I have a chart with a time-based X axis using IGCategoryDateTimeXAxis. The chart logs data in realtime over the course of about an hour.
I'd like the x-axis labels to only display HH:mm instead of the full datetime, but I can't find a property on the axis that lets me set the date formatter.
I'm using Swift 4.
I found the IGCategoryDateSeriesDataSourceHelper.labelPath property, so I added a label property to my data model object. But setting that doesn't seem to be changing t.
LabelPath is to tell the chart which property or data column the labels are coming from. That's used for category series. What you're looking for is a delegate method on the chart called -chartView: labelForAxis: withInfo. Make sure your view controller is implementing IGChartViewDelegate, though.
-labelForAxis returns a string. It gets called for each label the chart wants to display and here you can change it to anything you want. For x axis, it'll be a date. You can use a date formatter to convert that to your custom format.