I have been struggling the last week with getting the x-axis labels for a SChartDateTimeAxis to display properly. I have a pretty basic line chart that loads datapoints from our server. Our chart has 3 views, a day-view overview of the data, a weekview, and a monthview.
My problems are:
- Sometimes only one label is displayed at the start of the x-axis.
- Sometimes the last label cuts off(goes over the bounds of the chartview)
- Sometimes I get duplicate dates on the x-axis
I have tried various things,letting the chart calculate it automatically, setting the anchorpoint to the first date, calculating the amount of days and hours in my daterange and setting the majorTickFrequency with that,setMinimumFreeAxisSpace tweaks,SChartTickLabelClippingModeTicksAndLabelsPersist, (NSString *)sChart:(ShinobiChart *)chart longestLabelStringOnAxis:(SChartAxis *)axis,-(void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark beforeAddingToAxis:(SChartAxis *)axis etc
I think one of the problems is that there might be data gaps on our datasource, data is not always guaranteed in regular intervals,thus the chart is struggling to cacluate at what intervals to display the labels.
Ok long story short, is there a way to always display 3 labels on the x-axis. One at the beginning, one in the middle and one at the end(without cutting off). Are there any other methods I can use to customize the x-axis? Is it possible to hardcode?
Any help would be greatly appreciated!