valueAxis constantLines[]

    Declares a collection of constant lines belonging to the value axis.

    Type: Array
    Cannot be used in themes.

    DevExtreme HTML5 Charts ConstantLines

    Each object in the constantLines array configures a single constant line. Setting the value option is necessary for a constant line to be displayed.

    See Also
    • valueAxis | constantLineStyle - specifies the appearance of those constant lines that belong to the value axis.
    • commonAxisSettings | constantLineStyle - specifies the appearance of all constant lines in the widget.
    Show Example:
    jQuery

    In the following example, each value axis constant line is drawn in a different color and width.

    <div id="chartContainer" style="height:500px; max-width:700px; margin: 0 auto"></div>
    var dataSource = [
        { year: 2020, europe: 721, americas: 1027, africa: 1189 },
        { year: 2010, europe: 728, americas: 935, africa: 982 },
        { year: 2000, europe: 730, americas: 836, africa: 797 },
        { year: 1990, europe: 721, americas: 721, africa: 623 },
        { year: 1980, europe: 694, americas: 614, africa: 471 },
        { year: 1970, europe: 656, americas: 513, africa: 361 },
        { year: 1960, europe: 605, americas: 417, africa: 283 },
        { year: 1950, europe: 546, americas: 332, africa: 227 }
    ];
    
    $(function () {
        $("#chartContainer").dxChart({
            dataSource: dataSource,
            commonSeriesSettings: {
                argumentField: 'year'
            },
            series: [
                { valueField: 'europe', name: 'Europe' },
                { valueField: 'americas', name: 'Americas' },
                { valueField: 'africa', name: 'Africa' }
            ],
            valueAxis: {
                constantLines: [{
                        value: 500,
                        color: 'lightsalmon',
                        width: 1
                    }, {
                        value: 750,
                        color: 'orange',
                        width: 2
                    }, {
                        value: 1000,
                        color: 'orangered',
                        width: 3
                }]
            }
        });
    });

    color

    Specifies the color of constant lines.

    Type: String
    Default Value: '#000000'

    This option supports the following colors.

    dashStyle

    Specifies the dash style of constant lines.

    Type: String
    Default Value: 'solid'
    Accepted Values: 'solid' | 'longDash' | 'dash' | 'dot'

    This option accepts one of the following values.

    • solid
      Displays solid, continuous constant lines.
    • dash
      Displays constant lines using short dashes.
    • longDash
      Displays constant lines using long dashes.
    • dot
      Displays constant lines using dots.
    • Any combination of 'longDash', 'dash' and 'dot'
      Displays constant lines by repeating the specified combination. For example, 'dashdotdash'.

    label

    Configures the constant line label.

    Type: Object

    The constant line label displays the value of the constant line.

    DevExtreme HTML5 Charts ConstantLine ConstantLineLabel

    The label object specifies the following characteristics of the constant line label.

    • Visibility
      By default, the constant line label is visible. To hide it, assign false to the visible option.
    • Text
      By default, the constant line label displays the value of the constant line. To assign a custom text to the constant line label, use the text option.
    • Position
      The constant line label can be located inside or outside the chart plot. Use the position option to change this setting.
    • Alignment
      To align the constant line label in the horizontal and vertical directions, use the horizontalAlignment and verticalAlignment options.
    • Font
      To change the font of the constant line label, use the fields of the font object.
    See Also
    • valueAxis | constantLineStyle | label - specifies a unified style for the labels of those constant lines that belong to the value axis.
    • commonAxisSettings | constantLineStyle | label - specifies a unified style for the labels of all constant lines in the widget.

    paddingLeftRight

    Generates a pixel-measured empty space between the left/right side of a constant line and the constant line label.

    Type: Number
    Default Value: 10

    This option depends on the label | horizontalAlignment in the following way.

    • horizontalAlignment is "left" → padding applies to the left side of a constant line;
    • horizontalAlignment is "right" → padding applies to the right side of a constant line;
    • horizontalAlignment is "center" → padding is calculated automatically.

    DevExtreme HTML5 Charts ConstantLinePadding

    See Also
    • argumentAxis | constantLineStyle | label | horizontalAlignment - aligns constant line labels in the horizontal direction. Applies to the constant lines belonging to the argument axis.
    • valueAxis | constantLineStyle | label | horizontalAlignment - aligns constant line labels in the horizontal direction. Applies to the constant lines belonging to the value axis.

    paddingTopBottom

    Generates a pixel-measured empty space between the top/bottom side of a constant line and the constant line label.

    Type: Number
    Default Value: 10

    This option depends on the label | verticalAlignment in the following way.

    • verticalAlignment is "top" → padding applies to the top side of a constant line;
    • verticalAlignment is "bottom" → padding applies to the bottom side of a constant line;
    • verticalAlignment is "center" → padding is calculated automatically.

    DevExtreme HTML5 Charts ConstantLinePadding

    See Also
    • argumentAxis | constantLineStyle | label | verticalAlignment - aligns constant line labels in the vertical direction. Applies to the constant lines belonging to the argument axis.
    • valueAxis | constantLineStyle | label | verticalAlignment - aligns constant line labels in the vertical direction. Applies to the constant lines belonging to the value axis.

    value

    Specifies the value indicated by a constant line. Setting this option is necessary.

    Default Value: undefined

    width

    Specifies the width of constant lines in pixels.

    Type: Number
    Default Value: 1