| ||
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 > XLabelFormat Property SharpPlot.XLabelFormat PropertySet a picture format for X-Labels. public string XLabelFormat {get; set;} This uses the normal C# format string, with two small variations. The ‘%’ symbol has no effect on the scale of the data, and you may use the ‘~’ character anywhere in the picture to suppress the digit at that position. Examplesp.XLabelFormat = "Week #0"; To label the tickmarks ‘Week 1’ ‘Week 2’ .... ‘Week 52’ as appropriate. Wrapping text labelsText labels may be wrapped into a preset width with a format such as: sp.XLabelFormat = "XXXXXX;"; This will force the labels to wrap at the length of the given string. If the string is simply ‘XXXXXXX’ then longer labels are clipped, and are ended with an ellipsis ‘...’ unless the pattern length is only one or two characters when the labels are simply truncated. Formatting multi-line labelsNormally the entire pattern applies to each line of a multi-line label, however a pattern such as ‘XX\nXXXX; will be applied line by line. This can be used to handle spanned date labels quite effectively, for example a date picture like ‘MMM\nyyyy’ could be used with a label formatter like ‘X\nXXXX’ to make a set of spanned labels showing the first letter of each month in the top line and the full year in the line below. See also ...SharpPlot Members | XDateFormat Property | Using Picture Formatters | Formatting text with simple HTML tags |