label connector

Specifies connector options for series point labels.

Type: Object

A series point label can be placed separately, near the represented point. To make the relationship between a label and its respective point clear, use a connector. Set the connector's visibility and appearance options using the connector object.

Show Example:
jQuery

In this example, the series labels are displayed with connectors colored in cornflowerblue.

<div id="chartContainer" style="height:500px; max-width:700px; margin: 0 auto"></div>
var dataSource = [
    { year: 1990, istanbul: 7620000, moscow: 8967332, london: 6887280, sp: 5035200, ankara: 2583963 },
    { year: 2000, istanbul: 10923000, moscow: 10382754, london: 8173941, sp: 4694000, ankara: 3703362 },
    { year: 2012, istanbul: 13854740, moscow: 11689048, london: 8308369, sp: 5028000, ankara: 4965542 }
];

$(function () {
    $("#chartContainer").dxChart({
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: 'year',
            type: 'bar',
            label: {
                visible: true,
                connector: {
                    visible: true,
                    color: 'cornflowerblue'
                },
                format: 'largeNumber',
                precision: 1
            }
        },
        series: [
            { valueField: 'istanbul', name: 'Istanbul, Turkey' },
            { valueField: 'moscow', name: 'Moscow, Russia' },
            { valueField: 'london', name: 'London, UK' },
            { valueField: 'sp', name: 'Saint Petersburg, Russia' },
            { valueField: 'ankara', name: 'Ankara, Turkey' }
        ],
        palette: 'Soft Pastel',
        title: 'Largest Cities in Europe',
        argumentAxis: { type: 'discrete' },
        valueAxis: {
            label: { format: 'largeNumber' },
            title: {
                text: 'Population within borders',
                font: { weight: 100 }
            }
        },
        legend: {
            horizontalAlignment: 'center',
            verticalAlignment: 'bottom'
        }
    });
});

color

Specifies the color of label connectors.

Type: String
Default Value: undefined

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, the series labels are displayed with connectors colored in mediumorchid.

<div id="chartContainer" style="height:500px; max-width:700px; margin: 0 auto"></div>
var dataSource = [
    { year: 1990, istanbul: 7620000, moscow: 8967332, london: 6887280, sp: 5035200, ankara: 2583963 },
    { year: 2000, istanbul: 10923000, moscow: 10382754, london: 8173941, sp: 4694000, ankara: 3703362 },
    { year: 2012, istanbul: 13854740, moscow: 11689048, london: 8308369, sp: 5028000, ankara: 4965542 }
];

$(function () {
    $("#chartContainer").dxChart({
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: 'year',
            type: 'bar',
            label: {
                visible: true,
                connector: {
                    visible: true,
                    color: 'mediumorchid'
                },
                format: 'largeNumber',
                precision: 1
            }
        },
        series: [
            { valueField: 'istanbul', name: 'Istanbul, Turkey' },
            { valueField: 'moscow', name: 'Moscow, Russia' },
            { valueField: 'london', name: 'London, UK' },
            { valueField: 'sp', name: 'Saint Petersburg, Russia' },
            { valueField: 'ankara', name: 'Ankara, Turkey' }
        ],
        palette: 'Soft Pastel',
        title: 'Largest Cities in Europe',
        argumentAxis: { type: 'discrete' },
        valueAxis: {
            label: { format: 'largeNumber' },
            title: {
                text: 'Population within borders',
                font: { weight: 100 }
            }
        },
        legend: {
            horizontalAlignment: 'center',
            verticalAlignment: 'bottom'
        }
    });
});

visible

Indicates whether label connectors are visible.

Type: Boolean
Default Value: false
Accepted Values: true|false

Show Example:
jQuery

Toggle the check box below to change the visibility of the label connectors.

<div id="chartContainer" style="height:500px; max-width:700px; margin: 0 auto"></div>
<div id="checkboxContainer" style="height:40px;width:250px;margin:5px auto;font-family:'Trebuchet MS',Arial,sans-serif;font-size:14px;text-align:center">
    <input type="checkbox" id="visibleConnectorCheckbox"> Show Label Connectors
</div>
var dataSource = [
    { year: 1990, istanbul: 7620000, moscow: 8967332, london: 6887280, sp: 5035200, ankara: 2583963 },
    { year: 2000, istanbul: 10923000, moscow: 10382754, london: 8173941, sp: 4694000, ankara: 3703362 },
    { year: 2012, istanbul: 13854740, moscow: 11689048, london: 8308369, sp: 5028000, ankara: 4965542 }
];

$(function () {
    $("#chartContainer").dxChart({
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: 'year',
            type: 'bar',
            label: {
                visible: true,
                connector: { visible: false },
                format: 'largeNumber',
                precision: 1
            }
        },
        animation: false,
        series: [
            { valueField: 'istanbul', name: 'Istanbul, Turkey' },
            { valueField: 'moscow', name: 'Moscow, Russia' },
            { valueField: 'london', name: 'London, UK' },
            { valueField: 'sp', name: 'Saint Petersburg, Russia' },
            { valueField: 'ankara', name: 'Ankara, Turkey' }
        ],
        palette: 'Soft Pastel',
        title: 'Largest Cities in Europe',
        argumentAxis: { type: 'discrete' },
        valueAxis: {
            label: { format: 'largeNumber' },
            title: {
                text: 'Population within borders',
                font: { weight: 100 }
            }
        },
        legend: {
            horizontalAlignment: 'center',
            verticalAlignment: 'bottom'
        }
    });

    $('#visibleConnectorCheckbox').change(function () {
        var chart = $('#chartContainer').dxChart('instance');
        chart.option({
            commonSeriesSettings: {
                label: {
                    connector: { visible: this.checked }
                }
            }
        });
    });
});

width

Specifies the width of label connectors.

Type: Number
Default Value: 1

Show Example:
jQuery

In this example, the width option of the label connectors is set to 4.

<div id="chartContainer" style="height:500px; max-width:700px; margin: 0 auto"></div>
var dataSource = [
    { year: 1990, istanbul: 7620000, moscow: 8967332, london: 6887280, sp: 5035200, ankara: 2583963 },
    { year: 2000, istanbul: 10923000, moscow: 10382754, london: 8173941, sp: 4694000, ankara: 3703362 },
    { year: 2012, istanbul: 13854740, moscow: 11689048, london: 8308369, sp: 5028000, ankara: 4965542 }
];

$(function () {
    $("#chartContainer").dxChart({
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: 'year',
            type: 'bar',
            label: {
                visible: true,
                connector: {
                    visible: true,
                    width: 4
                },
                format: 'largeNumber',
                precision: 1
            }
        },
        series: [
            { valueField: 'istanbul', name: 'Istanbul, Turkey' },
            { valueField: 'moscow', name: 'Moscow, Russia' },
            { valueField: 'london', name: 'London, UK' },
            { valueField: 'sp', name: 'Saint Petersburg, Russia' },
            { valueField: 'ankara', name: 'Ankara, Turkey' }
        ],
        palette: 'Soft Pastel',
        title: 'Largest Cities in Europe',
        argumentAxis: { type: 'discrete' },
        valueAxis: {
            label: { format: 'largeNumber' },
            title: {
                text: 'Population within borders',
                font: { weight: 100 }
            }
        },
        legend: {
            horizontalAlignment: 'center',
            verticalAlignment: 'bottom'
        }
    });
});