我正在尝试使用每天/每周(由时间范围决定)作为x轴标签的用户友好时间轴绘制图表。但是,数据源值是在另一个基础上给出的 - 一天可能有10个条目,而第一个可能在一个月内。
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 another basis - there might be 10 entries one day and the eleventh comes in a month.
查看photoshop图片:
See the photoshop image:
使用最新的Core Plot drop我无法找到方法,需要你的帮助。
With the latest Core Plot drop I cannot find a way to do it, need your help.
问候, user792677。
Regards, user792677.
推荐答案散点图询问xy数据对的数据源。不要求任何值遵循某种顺序或常规模式。其他绘图类型的工作方式类似,但数据字段的名称和数量可能会有所不同。
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.
在您的示例中,从 -numberOfRecordsForPlot返回4:方法。从 -numberForPlot:field:recordIndex:方法返回以下值。该表假设您的y值是由函数f(x)计算的,但它们当然可以来自任何来源。使用字段参数来确定图是否要求x值或y值。
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)更多推荐
Core Plot跳过的值Graph
发布评论