| Contents > SharpPlot > Properties | Index |
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
| FlatText | Flat text is used for 3D labels |
| Opaque | Opaque background to label text |
| Center | Centered (on y-axis) labels |
| Middle | Middled (on x-axis) labels |
| NoWrap | Labels are not wrapped automatically. |
