Trouble setting x-axis with looping frequency


#1

I’m looking to have an x-axis to display hours, starting at anywhere from 0-23, and loop 4 times, so the number will be 22, 23, 0, 1, 2 etc… 

What’s the best way to achieve this?

I’m happy to use a number range or date range, though I had some trouble with the date range after setting the frequency.


#2

I would use an SChartNumberAxis and assign an custom NSNumberFormatter subclass that understands how to map your data’s X values to your 0-23 range (probably by doing dataIndex%24).  :grin:

Equally, you could use an date axis, and use an NSDateFormatter to do a very similar thing, although this might get more complicated. 

Jan