Back to Devexpress

Strip.ShowAxisLabel Property

corelibraries-devexpress-dot-xtracharts-dot-strip-f42602ca.md

latest4.3 KB
Original Source

Strip.ShowAxisLabel Property

Gets or sets a value that specifies whether the strip is labeled within its axis.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool ShowAxisLabel { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property ShowAxisLabel As Boolean

Property Value

TypeDescription
Boolean

true if the strip’s axis label is displayed; otherwise, false.

|

Remarks

Use the ShowAxisLabel property to control whether a specific axis label is automatically created and displayed for the strip within its corresponding axis. The text for the strip’s axis label can be specified by the Strip.AxisLabelText property.

Note that strip labels can’t be displayed within an axis simultaneously with the default axis labels (which are generated automatically based upon the axis scale of the values of series data points) - if the axis label of any strip is set to visible, the default labels are hidden. Strip labels can only be displayed along with custom labels within an axis.

For more information, refer to Strips.

Example

This example demonstrates how strips can be created and customized at runtime.

Since strips reside in an appropriate axis collection, you should first cast your diagram object to the required diagram’s type. Then, you can access the collection via the Axis2D.Strips property.

csharp
// Cast the chart's diagram to the XYDiagram type, to access its axes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;

// Create a strip with its maximum and minimum axis value defined.
diagram.AxisY.Strips.Add(new Strip("Strip 1", 5, 15));

// Customize the strip's behavior.
diagram.AxisY.Strips[0].Visible = true;
diagram.AxisY.Strips[0].ShowAxisLabel = true;
diagram.AxisY.Strips[0].AxisLabelText = "My Range";
diagram.AxisY.Strips[0].ShowInLegend = true;
diagram.AxisY.Strips[0].LegendText = "A Sample Strip";

// Customize the strip's appearance.
diagram.AxisY.Strips[0].Color = Color.CornflowerBlue;
diagram.AxisY.Strips[0].FillStyle.FillMode = FillMode.Empty;
vb
' Cast the chart's diagram to the XYDiagram type, to access its axes.
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)

' Create a strip with its maximum and minimum axis value defined.
diagram.AxisY.Strips.Add(new Strip("Strip 1", 5, 15))

' Customize the strip's behavior.
diagram.AxisY.Strips(0).Visible = True
diagram.AxisY.Strips(0).ShowAxisLabel = True
diagram.AxisY.Strips(0).AxisLabelText = "My Range"
diagram.AxisY.Strips(0).ShowInLegend = True
diagram.AxisY.Strips(0).LegendText = "A Sample Strip"

' Customize the strip's appearance.
diagram.AxisY.Strips(0).Color = Color.CornflowerBlue
diagram.AxisY.Strips(0).FillStyle.FillMode = FillMode.Empty

See Also

AxisLabelText

Strips

Strip Class

Strip Members

DevExpress.XtraCharts Namespace