commonAxisSettings constantLineStyle

Configures the appearance of all constant lines in the widget.

Type: Object

DevExtreme HTML5 Charts ConstantLines

The commonAxisSettings | constantLineStyle object, which is described here, specifies common settings for all constant lines in the chart. To configure only those constant lines that belong to a particular axis, use the following objects.

To configure individual constant lines, use the following arrays of objects.

Individual settings override axis-specific settings which, in their turn, override common settings.

Show Example:
AngularJS
Knockout
jQuery

In this example, you can see the default appearance of constant lines.

<div ng-controller="chartController">
    <div style="height:350px; max-width:800px; margin:0 auto" dx-chart="chartOptions"></div>
</div>
var population = [
    { year: 1950, europe: 549043000, americas: 339484000, africa: 228827000 },
    { year: 1960, europe: 605517000, americas: 424791000, africa: 285270000 },
    { year: 1970, europe: 657369000, americas: 519017000, africa: 366475000 },
    { year: 1980, europe: 694510000, americas: 618950000, africa: 478459000 },
    { year: 1990, europe: 723248000, americas: 727489000, africa: 629987000 },
    { year: 2000, europe: 729105000, americas: 841695000, africa: 808304000 },
    { year: 2010, europe: 742452000, americas: 942692000, africa: 1031084000 }
];

angular
    .module('myApp', ['dx'])
    .controller('chartController', function ($scope) {
        $scope.chartOptions = {
            dataSource: population,
            commonSeriesSettings: {
                argumentField: 'year'
            },
            series: [
                { valueField: 'europe', name: 'Europe' },
                { valueField: 'americas', name: 'Americas' },
                { valueField: 'africa', name: 'Africa' }
            ],
            argumentAxis: {
                constantLines: [
                    { value: 1970 },
                    { value: 1996 },
                    { value: 2009 }
                ]
            },
            valueAxis: {
                label: { format: 'largeNumber' },
                constantLines: [{ value: 700000000 }]
            }
        };
    });

angular.element(document).ready(function () {
   angular.bootstrap(document, ['myApp']);
});

In this example, you can see the default appearance of constant lines.

<div style="height:350px; max-width:800px; margin:0 auto" data-bind="dxChart: chartOptions"></div>
var population = [
    { year: 1950, europe: 549043000, americas: 339484000, africa: 228827000 },
    { year: 1960, europe: 605517000, americas: 424791000, africa: 285270000 },
    { year: 1970, europe: 657369000, americas: 519017000, africa: 366475000 },
    { year: 1980, europe: 694510000, americas: 618950000, africa: 478459000 },
    { year: 1990, europe: 723248000, americas: 727489000, africa: 629987000 },
    { year: 2000, europe: 729105000, americas: 841695000, africa: 808304000 },
    { year: 2010, europe: 742452000, americas: 942692000, africa: 1031084000 }
];

var viewModel = {
    chartOptions: {
        dataSource: population,
        commonSeriesSettings: {
            argumentField: 'year'
        },
        series: [
            { valueField: 'europe', name: 'Europe' },
            { valueField: 'americas', name: 'Americas' },
            { valueField: 'africa', name: 'Africa' }
        ],
        argumentAxis: {
            constantLines: [
                { value: 1970 },
                { value: 1996 },
                { value: 2009 }
            ]
        },
        valueAxis: {
            label: { format: 'largeNumber' },
            constantLines: [{ value: 700000000 }]
        }
    }
};

ko.applyBindings(viewModel);

In this example, you can see the default appearance of constant lines.

<div id="chartContainer" style="height:350px; max-width:800px; margin:0 auto"></div>
var population = [
    { year: 1950, europe: 549043000, americas: 339484000, africa: 228827000 },
    { year: 1960, europe: 605517000, americas: 424791000, africa: 285270000 },
    { year: 1970, europe: 657369000, americas: 519017000, africa: 366475000 },
    { year: 1980, europe: 694510000, americas: 618950000, africa: 478459000 },
    { year: 1990, europe: 723248000, americas: 727489000, africa: 629987000 },
    { year: 2000, europe: 729105000, americas: 841695000, africa: 808304000 },
    { year: 2010, europe: 742452000, americas: 942692000, africa: 1031084000 }
];

$(function () {
    $("#chartContainer").dxChart({
        dataSource: population,
        commonSeriesSettings: {
            argumentField: 'year'
        },
        series: [
            { valueField: 'europe', name: 'Europe' },
            { valueField: 'americas', name: 'Americas' },
            { valueField: 'africa', name: 'Africa' }
        ],
        argumentAxis: {
            constantLines: [
                { value: 1970 },
                { value: 1996 },
                { value: 2009 }
            ]
        },
        valueAxis: {
            label: { format: 'largeNumber' },
            constantLines: [{ value: 700000000 }]
        }
    });
});

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 constant line labels.

Type: Object

A constant line label displays the value of a constant line.

DevExtreme HTML5 Charts ConstantLine ConstantLineLabel

The commonAxisSettings | constantLineStyle | label object, which is described here, specifies common settings for all constant line labels in the chart. To configure the labels of those constant lines that belong to a particular axis, use the following objects.

  • argumentAxis | constantLineStyle | label
  • valueAxis | constantLineStyle | label

To configure the labels of individual constant lines use the following objects.

  • argumentAxis | constantLines[] | label
  • valueAxis | constantLines[] | label

Individual settings override axis-specific settings which, in their turn, override common settings.

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.

width

Specifies the width of constant lines in pixels.

Type: Number
Default Value: 1