Skip to main content

AxisScaling.Max Property

Gets or sets the maximum value of the numerical or date axis. This may not be the same as the maximum value of the series associated with the axis.

Namespace: DevExpress.Spreadsheet.Charts

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

double Max { get; set; }

Property Value

Type Description
Double

A Double value that specifies the maximum value to display on the axis.

Remarks

Use the Max property to specify or obtain the maximum value shown on the numerical or date axis. Note that this property takes effect only when the AxisScaling.AutoMax property is set to false.

Note

The Max property will have no effect on the visual appearance of a chart displayed in the SpreadsheetControl, until you set the minimum value of the axis via the AxisScaling.Min property.

Example

The example below demonstrates how to create a clustered column chart and specify the value axis scale. Set the AxisScaling.AutoMax and AxisScaling.AutoMin properties to false to indicate that maximum and minimum values of the axis will be set manually by using the AxisScaling.Max and AxisScaling.Min properties

View Example

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"];

// Set the minimum and maximum values for the chart value axis.
Axis axis = chart.PrimaryAxes[1];
axis.Scaling.AutoMax = false;
axis.Scaling.Max = 1;
axis.Scaling.AutoMin = false;
axis.Scaling.Min = 0;

// Hide the legend.
chart.Legend.Visible = false;

The following code snippets (auto-collected from DevExpress Examples) contain references to the Max 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.

See Also