Back to Devexpress

Range.SetMinMaxValues(Object, Object) Method

wpf-devexpress-dot-xpf-dot-charts-dot-range-dot-setminmaxvalues-x28-system-dot-object-system-dot-object-x29.md

latest3.2 KB
Original Source

Range.SetMinMaxValues(Object, Object) Method

Sets both minimum and maximum values of an axis range.

Namespace : DevExpress.Xpf.Charts

Assembly : DevExpress.Xpf.Charts.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public void SetMinMaxValues(
    object minValue,
    object maxValue
)
vb
Public Sub SetMinMaxValues(
    minValue As Object,
    maxValue As Object
)

Parameters

NameTypeDescription
minValueObject

A Object which specifies the minimum set value. The type of an object depends on the axis scale type.

| | maxValue | Object |

A Object which specifies the maximum set value. The type of an object depends on the axis scale type.

|

Remarks

The SetMinMaxValues method provides a range check and correct value mapping of an axis, according to the type of passed arguments and the axis scale (Series.ArgumentScaleType and Series.ValueScaleType).

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SetMinMaxValues(Object, Object) method.

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-charts-create-real-time-chart/CS/RealtimeChartMVVM/MainWindow.xaml.cs#L16

csharp
DateTime maxRangeValue = (DateTime)axisX.ActualWholeRange.ActualMaxValue;
    axisX.ActualVisualRange.SetMinMaxValues(maxRangeValue.AddSeconds(-10), maxRangeValue);
}

wpf-charts-create-real-time-chart/VB/RealtimeChartMVVM/MainWindow.xaml.vb#L20

vb
Dim maxRangeValue As Date = CDate(axisX.ActualWholeRange.ActualMaxValue)
    axisX.ActualVisualRange.SetMinMaxValues(maxRangeValue.AddSeconds(-10), maxRangeValue)
End Sub

See Also

Range Class

Range Members

DevExpress.Xpf.Charts Namespace