开发者

core-plot map data to x-axis

开发者 https://www.devze.com 2023-04-06 07:03 出处:网络
I am not quite sure if core-plot is able to do this. I have a list of unix timestamps and some values and I need to display it as follows (Line graph)

I am not quite sure if core-plot is able to do this. I have a list of unix timestamps and some values and I need to display it as follows (Line graph)

  • Each year has its own line
  • X-Axis should show the month from Jan - Dec

En entry with the date 19.开发者_C百科02.2011 should be between Feb and March in the x-axis.

Could someone give me a hint on how to do that?

UPDATE

I have an example from Excel how it should look like

core-plot map data to x-axis

Thanks a lot Chris


Core Plot includes several example apps that show how to plot dates along an axis. You can use a CPTTimeFormatter (a wrapper for an NSDateFormatter) to format the values. You have to pick a reference date and then compute the offset between each date value and the reference date. The plot datasource then provides these offsets as the plot data.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号