Back to Devexpress

IntervalOptionsBase.UnderflowValuePattern Property

corelibraries-devexpress-dot-xtracharts-dot-intervaloptionsbase-2fbc6915.md

latest8.7 KB
Original Source

IntervalOptionsBase.UnderflowValuePattern Property

Gets or sets a format string that configures text for the underflow interval axis labels and crosshair labels.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public string UnderflowValuePattern { get; set; }
vb
Public Property UnderflowValuePattern As String

Property Value

TypeDescription
String

A format string.

|

Remarks

Patterns can contain regular text (displayed as is) and value placeholders in braces. To format numeric and date/time values, you can apply Format Specifiers. Use a colon to separate a placeholder and its format specifier.

The following table contains the available placeholders:

PlaceholderDescription
{OB}Displays an opening bracket.
{CB}Displays a closing bracket.
{A2}Displays the interval end value.

Example

This example demonstrates how to create a histogram chart with bins of a given width.

csharp
private void Form1_Load(object sender, EventArgs e) {
    // Load data to a chart.
    chartControl1.DataSource = LoadDataTableFromXml("..\\..\\Data\\CityWeather.xml", "CityWeather");
    Series series = new Series();
    series.ArgumentDataMember = "Temperature";
    SideBySideBarSeriesView view = series.View as SideBySideBarSeriesView;
    view.Border.Visibility = DevExpress.Utils.DefaultBoolean.True;
    view.BarWidth = 1;
    chartControl1.Series.Add(series);
    // Configure histogram options.
    XYDiagram diagram = chartControl1.Diagram as XYDiagram; 
    NumericScaleOptions scaleOptions = diagram.AxisX.NumericScaleOptions;
    scaleOptions.AggregateFunction = AggregateFunction.Histogram;
    scaleOptions.ScaleMode = ScaleMode.Interval;
    scaleOptions.IntervalOptions.DivisionMode = IntervalDivisionMode.Width;
    scaleOptions.IntervalOptions.Width = 10;
    scaleOptions.IntervalOptions.OverflowValue = 20;
    scaleOptions.IntervalOptions.UnderflowValue = -30;
    scaleOptions.IntervalOptions.Pattern = "{OB}{A1:F0} ― {A2:F0}{CB}";
    scaleOptions.IntervalOptions.OverflowValuePattern = "{OS} {A1}";
    scaleOptions.IntervalOptions.UnderflowValuePattern = "{US} {A2}";
    scaleOptions.IntervalOptions.GridLayoutMode = GridLayoutMode.GridShiftedLabelCentered;
    diagram.AxisX.GridLines.Visible = true;
    diagram.AxisX.Tickmarks.MinorVisible = false;
}
static DataTable LoadDataTableFromXml(string fileName, string tableName) {
    DataSet xmlDataSet = new DataSet();
    xmlDataSet.ReadXml(fileName);
    return xmlDataSet.Tables[tableName];
}
vb
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    ' Load data to a chart.
    chartControl1.DataSource = LoadDataTableFromXml("..\..\Data\CityWeather.xml", "CityWeather")
    Dim series As Series = New Series()
    series.ArgumentDataMember = "Temperature"
    Dim view As SideBySideBarSeriesView = TryCast(series.View, SideBySideBarSeriesView)
    view.Border.Visibility = DevExpress.Utils.DefaultBoolean.[True]
    view.BarWidth = 1
    chartControl1.Series.Add(series)
    ' Configure histogram options.
    Dim diagram As XYDiagram = TryCast(chartControl1.Diagram, XYDiagram)
    Dim scaleOptions As NumericScaleOptions = diagram.AxisX.NumericScaleOptions
    scaleOptions.AggregateFunction = AggregateFunction.Histogram
    scaleOptions.ScaleMode = ScaleMode.Interval
    scaleOptions.IntervalOptions.DivisionMode = IntervalDivisionMode.Width
    scaleOptions.IntervalOptions.Width = 10
    scaleOptions.IntervalOptions.OverflowValue = 20
    scaleOptions.IntervalOptions.UnderflowValue = -30
    scaleOptions.IntervalOptions.Pattern = "{OB}{A1:F0} ― {A2:F0}{CB}"
    scaleOptions.IntervalOptions.OverflowValuePattern = "{OS} {A1}"
    scaleOptions.IntervalOptions.UnderflowValuePattern = "{US} {A2}"    
    scaleOptions.IntervalOptions.GridLayoutMode = GridLayoutMode.GridShiftedLabelCentered
    diagram.AxisX.GridLines.Visible = True
    diagram.AxisX.Tickmarks.MinorVisible = False
End Sub
Private Shared Function LoadDataTableFromXml(ByVal fileName As String, ByVal tableName As String) As DataTable
    Dim xmlDataSet As DataSet = New DataSet()
    xmlDataSet.ReadXml(fileName)
    Return xmlDataSet.Tables(tableName)
End Function

The following API members configure the histogram options:

MemberDescription
ScaleGridOptionsBase.AggregateFunctionGets or sets the value indicating the aggregate function that should be used to relieve data.
ScaleOptionsBase.ScaleModeGets or sets the scale mode for an axis.
NumericScaleOptions.IntervalOptionsStores options for numeric axis when its ScaleMode is Interval.
NumericIntervalOptions.DivisionModeSpecifies how to divide axis scale into intervals.
NumericIntervalOptions.WidthGets or sets the interval size when DivisionMode is Width.
NumericIntervalOptions.OverflowValueGets or sets the start value for the interval that includes overflow values.
NumericIntervalOptions.UnderflowValueGets or sets the end value for the interval that includes underflow values.
IntervalOptionsBase.PatternGets or sets a format string that configures text for the interval axis labels and crosshair labels.
IntervalOptionsBase.OverflowValuePatternGets or sets a format string that configures text for the overflow interval axis labels and crosshair labels.
IntervalOptionsBase.UnderflowValuePatternGets or sets a format string that configures text for the underflow interval axis labels and crosshair labels.
NumericIntervalOptions.GridLayoutModeGets or sets the value that specifies the alignment of grid lines, major tickmarks and axis labels.

See Also

Format Text Chart Elements

IntervalOptionsBase Class

IntervalOptionsBase Members

DevExpress.XtraCharts Namespace