Category / Section
How to display the axis edge labels fully?
1 min read
The chart axis labels at the edges display text partially, by default. You can customize it to display the text fully. This can be done by setting values for the EdgeLabelsDrawingMode options, accordingly. This is specified as enum type. It has three options:
- Shift- To shift and place the labels inside the area.
- Center- To place the label at the centre of the ticks.
- ClippingProtection- To avoid overlapping of labels at the edge of axis.
The following code snippet illustrates this.
C#
// to show the partial x axis labels
chart.ChartArea.PrimaryXAxis.HidePartialLabels = false;
// to shift the x axis edge labels
chart.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
VB
// to show the partial x axis labels
Me.ChartArea.PrimaryXAxis.HidePartialLabels = false;
// to shift the x axis edge labels
Me.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
The output of the above code snippet is as follows: