| ||
SharpPlot Tutorials General Tutorials Chart Samples Style Examples SharpLeaf Tutorials Document Layout Tutorials Text Flow Tutorials Table Tutorials Visual Glossaries SharpPlot Class SharpPlot Methods SharpPlot Structures SharpPlot Enumerations PageMap Class SharpLeaf Reference SharpLeaf Class SharpLeaf Properties SharpLeaf Methods Table Class Table Properties Table Methods SharpLeaf Structures FontType Structure ParagraphStyle Structure BoxStyle Structure SharpLeaf Enumerations DocumentLayout Classes DocumentLayout Class PageLayout Class PageElement Abstract Class Frame : PageElement Class TextBlock : PageElement Class ImageBlock : PageElement Class Box : PageElement Class Rule : PageElement Class Common Reference Document Class VectorMath Class DbUtil Class Download Release Notes Licensing |
SharpPlot Reference > SharpPlot 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 ...Using Date and Time axes | Formatting text with simple HTML tags | SharpPlot Members | SharpPlot.XAxisStyle Property | SharpPlot.XLabelFormat Property |