Reference > Properties > LabelStyle Property

SharpPlot.LabelStyle Property

Set Label style

public LabelStyles LabelStyle {get; set;}

Example

sp.LabelStyle = LabelStyles.FlatText;

To blank behind axis labels (useful if you have intercept axes and grid lines) set the label style to ‘opaque’:

sp.LabelStyle = LabelStyles.Opaque;

Labels are written by default to the left of the primary Y-axis and to the right of the secondary. Use style ‘centred’ to have them written (centre-aligned) on top of the axis. This would normally be used with the ‘opaque’ setting to make a white knockout over the axis line in which to write the text. Similarly, use style ‘middle’ to place the labels over the X-axis rather than below it.

sp.LabelStyle = LabelStyles.Opaque | LabelStyles.Middle;

Labels on 3D charts are normally angled to match the slope of the axis. The text may be more readable at small sizes if written horizontally, right-aligned to the tickmarks.

sp.LabelStyle = LabelStyles.FlatText;

will achieve this effect.

Options

CenterCentered (on y-axis) labels
FlatTextFlat text is used for 3D labels
LeftAlignLeft-align coltitles on table charts
MiddleMiddled (on x-axis) labels
NoWrapLabels are not wrapped automatically.
OpaqueOpaque background to label text
RightAlignRight-align coltitles on table charts

See also ...

SharpPlot Members


Send comments on this topic
© Dyalog Ltd 2013