Back to Devexpress

AxisScaling.Orientation Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-axisscaling.md

latest5.9 KB
Original Source

AxisScaling.Orientation Property

Gets or sets the orientation of the axis on the chart.

Namespace : DevExpress.Spreadsheet.Charts

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
AxisOrientation Orientation { get; set; }
vb
Property Orientation As AxisOrientation

Property Value

TypeDescription
AxisOrientation

An AxisOrientation enumeration value specifying the axis orientation.

|

Available values:

NameDescription
MinMax

Specifies that the axis must be displayed in the usual order, so the axis starts at the minimum value and ends at the maximum value.

| | MaxMin |

Specifies that the axis must be reversed, so the axis starts at the maximum value and ends at the minimum value.

|

Remarks

Note

The Position property is ignored if the AxisScaling.Orientation property is specified.

Example

The example below demonstrates how to create a chart and use the AxisScaling.Orientation property to reverse the category axis orientation, so the values on the axis are displayed from maximum to minimum.

View Example

csharp
Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B3:C5"]);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Reverse the category axis.
chart.PrimaryAxes[0].Scaling.Orientation = AxisOrientation.MaxMin;

// Hide the legend.
chart.Legend.Visible = false;
vb
Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B3:C5"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")

' Reverse the category axis.
chart.PrimaryAxes(0).Scaling.Orientation = AxisOrientation.MaxMin

' Hide the legend.
chart.Legend.Visible = False

The following code snippets (auto-collected from DevExpress Examples) contain references to the Orientation property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/CodeExamples/AxesActions.cs#L168

csharp
// Reverse the category axis.
chart.PrimaryAxes[0].Scaling.Orientation = AxisOrientation.MaxMin;

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/AxesActions.cs#L168

csharp
// Reverse the category axis.
chart.PrimaryAxes[0].Scaling.Orientation = AxisOrientation.MaxMin;

spreadsheet-document-api-chart-examples/CS/SpreadsheetDocServerChartAPISamples/CodeExamples/AxesActions.cs#L178

csharp
// Reverse the category axis.
chart.PrimaryAxes[0].Scaling.Orientation = AxisOrientation.MaxMin;

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/AxesActions.vb#L172

vb
' Reverse the category axis.
chart.PrimaryAxes(0).Scaling.Orientation = AxisOrientation.MaxMin

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/AxesActions.vb#L171

vb
' Reverse the category axis.
chart.PrimaryAxes(0).Scaling.Orientation = AxisOrientation.MaxMin

spreadsheet-document-api-chart-examples/VB/SpreadsheetDocServerChartAPISamples/CodeExamples/AxesActions.vb#L181

vb
' Reverse the category axis.
chart.PrimaryAxes(0).Scaling.Orientation = AxisOrientation.MaxMin

See Also

AxisScaling Interface

AxisScaling Members

DevExpress.Spreadsheet.Charts Namespace