Back to Devexpress

Axis.CrossesAt Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-axis-5469c4b7.md

latest3.3 KB
Original Source

Axis.CrossesAt Property

Specifies a point on the perpendicular axis at which the current and perpendicular axes should cross.

Namespace : DevExpress.Spreadsheet.Charts

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
double CrossesAt { get; set; }
vb
Property CrossesAt As Double

Property Value

TypeDescription
Double

The intersection point on the perpendicular axis.

|

Remarks

Set the Axis.CrossType property to Custom and use the CrossesAt property to specify a custom intersection point for the current axis and the associated perpendicular axis. If you need to specify the intersection point on the category axis, use an integer as the category number, starting with 1 as the first category.

The code below creates a simple line chart and specifies that the chart’s category axis crosses the value axis at -10.

csharp
// 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.Custom;
chart.PrimaryAxes[0].CrossesAt = -10;
vb
' Create a line chart and specify its location.
Dim chart As 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.Custom
chart.PrimaryAxes(0).CrossesAt = -10

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.

See Also

CrossType

Position

Axis Interface

Axis Members

DevExpress.Spreadsheet.Charts Namespace