| ||
Introducing SharpPlot Your First Chart Recent Updates Sample Charts Tutorials General Tutorials Chart Tutorials SharpPlot Class Methods Structures Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Reference > Properties > XDateFormat Property SharpPlot.XDateFormat PropertySet Date picture (X axis). When the X-axis is set to style ‘Date’, ‘Annual’ or ‘Monthly’, the date labels may be formatted with a standard picture format. public string XDateFormat {get; set;} Examplesp.XDateFormat = "MMM-yy"; Dates are formatted according to the current locale. Note that newlines are accepted in the format string to allow multi-line labels to be created easily for timeseries axes: sp.XDateFormat = "MMMM\nyyyy"; This will create a 2-line set of labels which works well with the ‘Spanned’ style to centre the year below each set of 12 months. Shortening month namesTimeseries are often labeled with the first character of the month name JFMAM ... D which cannot be generated with a standard date formatter. To have SharpPlot label the time-axis like this, use the MMM date format and set the XLabelFormat to a picture such as ‘X~~’ which will truncate the month name down to one character. See also ...SharpPlot | XAxisStyle | XLabelFormat | Formatting | Using |