Reference > Properties > YLabelFormat Property

SharpPlot.YLabelFormat Property

Set picture format for Y-axis labels.

public string YLabelFormat {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.

Example

sp.YLabelFormat = "##0.00%";

To show the numbers to 2 decimal places with a trailing % symbol. Note that this does not automatically multiply the values by 100 (unlike VB and many OCX controls such as the Flexgrid).

Wrapping text labels

Text labels may be wrapped into a preset width with a format such as:

sp.YLabelFormat = "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.

See also ...

SharpPlot Members | Using Picture Formatters | Formatting text with simple HTML tags


Send comments on this topic
© Dyalog Ltd 2013