Range.MaxValue Property
Gets or sets the maximum value to display on an Axis. This may not be the same as the maximum value of the series associated with this axis.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v19.1.dll
Declaration
[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
public object MaxValue { get; set; }
Property Value
Type | Description |
---|---|
Object | A Object that specifies the maximum value to display on an axis. |
Remarks
Use the MaxValue property to specify or obtain the maximum value to display on an axis.
Note that the MaxValue and Range.Auto properties are interdependent: changing one property will reset the other.
Note
Dealing with Qualitative or DateTime scale types, it may be required to determine the maximum value more precisely than allowed by these scale types. For example, for an axis whose DateTimeScaleOptions.MeasureUnit property is set to Year, it may be required to restrict its range by Month. To do this, you can use the Range.MaxValueInternal property, which stores the internal, numeric representation of Qualitative and DateTime values.
For more information, refer to Visual Ranges and Whole Ranges.
Example
The following example demonstrates how to create a ChartControl with a series of the RangeAreaSeriesView type, and add this chart to a form at runtime. Before proceeding with this example, first create a Windows Forms Application in Visual Studio, and include all necessary assemblies to the References list of your project.
Then, add the following code to the Form.Load event handler.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-create-a-range-area-chart-t123969
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
namespace RangeAreaChart {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, System.EventArgs e) {
// Create a new chart.
ChartControl rangeAreaChart = new ChartControl();
// Create a range area series.
Series series1 = new Series("Series 1", ViewType.RangeArea);
// Add points to them.
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 1), 2.08, 4.28));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 2), 2.42, 4.03));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 3), 2.78, 3.98));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 4), 2.57, 3.94));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 5), 2.69, 4.18));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 6), 2.69, 5.02));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 7), 2.36, 5.60));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 8), 1.97, 5.37));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 9), 2.76, 4.94));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 10), 3.54, 3.66));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 11), 4.31, 1.07));
series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 12), 4.08, 0.09));
// Add a series to the chart.
rangeAreaChart.Series.Add(series1);
// Access the view-type-specific options of the series.
((RangeAreaSeriesView)series1.View).Transparency = 80;
// Access the type-specific options of the diagram.
((XYDiagram)rangeAreaChart.Diagram).AxisX.GridLines.Visible = true;
((XYDiagram)rangeAreaChart.Diagram).AxisY.WholeRange.MinValue = -0.5;
((XYDiagram)rangeAreaChart.Diagram).AxisY.WholeRange.MaxValue = 6;
// Hide the legend (if necessary).
rangeAreaChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
// Add a title to the chart (if necessary).
rangeAreaChart.Titles.Add(new ChartTitle());
rangeAreaChart.Titles[0].Text = "A Range Area Chart";
// Add the chart to the form.
rangeAreaChart.Dock = DockStyle.Fill;
this.Controls.Add(rangeAreaChart);
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the MaxValue 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.