label border

Specifies border options for point labels.

Type: Object

Use this object to make the borders of point labels visible/invisible and set up border options such as color and width.

Show Example:
jQuery

In this example, the label border is colored in darkslateblue.

<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 },
                format: 'largeNumber',
                precision: 1,
                border: {
                    visible: true,
                    color: 'lightslategrey'
                }
            }
        },
        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 a border color for point labels.

Type: String
Default Value: '#d3d3d3'

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 label border is colored in lightpink.

<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 },
                format: 'largeNumber',
                precision: 1,
                border: {
                    visible: true,
                    color: 'lightpink'
                }
            }
        },
        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'
        }
    });
});

dashStyle

Specifies a dash style for the borders of point labels.

Type: String
Default Value: 'solid'
Accepted Values: 'solid'|any combination of 'longDash', 'dash', 'dot'

The following values are available.

  • solid
    Displays a solid, continuous line.
  • longDash
    Displays a border using long dashes.
  • dash
    Displays a border using dashes.
  • dot
    Displays a border using dots.
  • any combination of 'longDash', 'dash' and 'dot'
    Displays a border by repeating the specified combination. For instance, 'dashdotdash'.
Show Example:
jQuery

In this example, the dashStyle of the label border is set to longDashdot.

<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 },
                format: 'largeNumber',
                precision: 1,
                border: {
                    visible: true,
                    dashStyle: 'longDashdot'
                }
            }
        },
        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 or not borders are visible in point labels.

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

Show Example:
jQuery

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

<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="visibleBorderCheckbox"> Show Label Borders
</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 },
                format: 'largeNumber',
                precision: 1,
                border: {
                    visible: false
                }
            }
        },
        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'
        }
    });

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

width

Specifies a border width for point labels.

Type: Number
Default Value: 1

Show Example:
jQuery

In this example, the width option of the label border is set to 2.

<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 },
                format: 'largeNumber',
                precision: 1,
                border: {
                    visible: true,
                    width: 2
                }
            }
        },
        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'
        }
    });
});