Strip.AxisLabelText Property
Gets or sets the text for an axis label that identifies the strip within its axis.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
[XRLocalizable(true)]
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[XtraSerializableProperty]
public string AxisLabelText { get; set; }
Property Value
Type | Description |
---|---|
String | A String value that specifies the text of the strip’s axis label. |
Remarks
Use the AxisLabelText property to label the strip within its corresponding axis. This property specifies the text of the axis label which is used to indicate the strip. A strip’s axis label is displayed when the strip’s Strip.ShowAxisLabel property is set to true. If the AxisLabelText property is not set, the strip’s name specified by the ChartElementNamed.Name property is used as the text of the strip’s axis label.
Note that if a strip’s axis label is set to be visible, the default axis labels (which are generated automatically based upon the axis scale of the values of series data points) are not displayed within the corresponding axis. However, strip labels can be simultaneously displayed 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.
// 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;