Core Plot skipped values Graph

前端 未结 1 1636
北海茫月
北海茫月 2021-01-23 05:41

i\'m trying to draw a Graph with a user-friendly timeline having every day/week (to be decided by time range) as a label at x-axis. However, the datasource values are given on a

相关标签:
1条回答
  • 2021-01-23 06:03

    The scatter plot asks the datasource for x-y pairs of data. There is no requirement that either value follow some sort of sequence or regular pattern. Other plot types work similarly, although the names and number of data fields can vary.

    In your example, return 4 from the -numberOfRecordsForPlot: method. Return the following values from the -numberForPlot:field:recordIndex: method. The table assumes your y-values are calculated by a function f(x), but they can of course come from any source. Use the field parameter to determine whether the plot is asking for the x- or y- value.

    Index  X-Value  Y-Value
      0       1       f(1)
      1       3       f(3)
      2       9       f(9)
      3      10      f(10)
    
    0 讨论(0)
提交回复
热议问题