X Axis with Formatted Dates


I am trying to format the X axis to follow a specific pattern with dates.  I have been able to get the date to show as MM/DD easily, but the pattern I wish to implement eludes me.  The pattern is:

Month Day  Day  Day Month Day etc, where “Month” will show the month, once and only once for the first day plotted on the chart.  Each subsequent day will simply show the day number without the month until the month rolls to the next month.

Another example:  Jan 1 8 15 22 29 Feb 5 12 … etc …

Is this possible with the chart control, and if so, can anyone provide some insight on how this may be done?



Hello EIG,

Thanks for getting in touch. Could you please tell us - are you using our iOS or Android charts product?





We are using the iOS charts product.



If you want to do this, you’ll need to create a custom date formatter, assign it as your axes label formatter:

self.chart.xAxis.labelFormatter.formatter = myCustomDateFormatter;

You’ll then have to implement this formatter so it understands which tick mark is the first tick mark in the month, and return the month, and then any subsequent tickmarks, it can return the day.

Best regards,