Axis.CrossType Property
Specifies where the current axis crosses the perpendicular axis.
Namespace: DevExpress.Spreadsheet.Charts
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Property Value
Type | Description |
---|---|
AxisCrossType | An enumeration member that specifies the axis intersection point. |
Available values:
Name | Description |
---|---|
Auto | The axis intersection point is zero, the minimum value (if minimum is greater than zero), or the maximum value (if maximum is less than zero). |
Min | The intersection point is the minimum value on the perpendicular axis. |
Max | The intersection point is the maximum value on the perpendicular axis. |
Custom | The Axis.CrossesAt property defines the axis intersection point. |
Remarks
When you set the CrossType property to Min or Max, the Spreadsheet evaluates the intersection point with the associated axis based on its orientation (AxisScaling.Orientation) and changes the position of the current axis (Axis.Position) accordingly.
The code below creates a simple line chart and specifies that the chart’s category axis crosses the value axis at the minimum y-value.
// Create a line chart and specify its location.
var chart = worksheet.Charts.Add(ChartType.LineMarker, worksheet["B2:C14"]);
chart.TopLeftCell = worksheet.Cells["E2"];
chart.BottomRightCell = worksheet.Cells["K14"];
// Hide the chart legend.
chart.Legend.Visible = false;
// Specify the axis intersection point.
chart.PrimaryAxes[0].CrossType = AxisCrossType.Min;
Set the CrossType property to Custom and use the Axis.CrossesAt property to specify a custom intersection point for the current axis and the associated perpendicular axis.
Important
The CrossesAt property is fully supported by Microsoft Excel only. The Spreadsheet control cannot render an axis inside the plot area. The control allows you to change the axis position to the opposite value only. For example, you can display the primary value axis in a line chart to the left (default) or to the right of the plot area. Refer to the Axis.Position property for details.