SITUATION
I am building a chart using ZedGraph of price (Y axis) against time (X axis). The duration of time is three years.
At the moment I'm getting X axis labels of : Jan 11; Jan 12; Jan 13 for a set of data that runs from 3-Mar-2010 to 2-Mar-2013.
As far as I can see this is default behaviour if the axis is of type DateTime.
QUESTION
How do I change the X axis labelling so that I get: Mar 11; Mar 12; Mar 13 ? And more generally so that I can change the labels used to coincide with the start/end month of the data.
EDIT:
My initial attempt at this question was a little ambiguous so I'm just going to try to clarify.
It's not that I want the labels to be dd-MMM-yy - what I want is to able to control the locations on the X axis where the labels/tics appear.
So that, for an X-axis that spanned 3-Mar-2010 to 2-Mar-2013, instead of the labels always appearing in January
- Jan 11 [that is January 2011];
- Jan 12 [that is January 2012];
- Jan 13 [that is January 2013)
as shown in my screen dump I can choose which month the label/tic appears in . So for that data set I would like to have labels at :
- March 2010 (appearing as Mar10)
- March 2011 (appearing as Mar11)
- March 2012 (appearing as Mar12)
- March 2013 (appearing as Mar13)
I hope that's clearer.
DateTime day = new DateTime( 2012, 1, 1 );
– IrefulmyPane.XAxis.Type = AxisType.DateAsOrdinal
and used a custom label? Use this as a reference. Also you may need to setScale.Format = "MM-yy"
and see if that works. I've never tried it myself. – Ireful