I am using the .NET datavisualization library to create some charts. The data is all time series based (ie, the x-axis is dates).
I know that I can use custom date and time format strings to format the x-axis labels (formatting from http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx), via the
AxisX.LabelStyle.Format = "yyyy"
command.
But what if I wanted to format the labels via a custom function that isn’t provided in the .NET library?
To be more specific, is it possible to format the x-axis labels using the Quarter of the date? In other words:
- Jan-Mar: Q1
- Apr-Jun: Q2
- Jul-Sep: Q3
- Oct-Dec: Q4
Thanks in advance!
Create your own function and return custom labels and assign them to data point individually
Eg:-