Vue PolarChart - series.label

An object defining the label configuration properties.

Selector: DxLabel
Type:

Object

Each series point can be accompanied by a text label that represents data related to the point. These are called series point labels. Use the label object's properties to set label properties for all chart series at once.

Specify the label object's properties within the commonSeriesSettings configuration object to set label properties for all chart series at once.

If you have several series of a single type, you can set label properties to the values specific to this series type using the corresponding object (area, line, etc.) within the commonSeriesSettings configuration object. The values that are set within series-type-specific configuration objects override the corresponding common values.

If you need to set a label property for an individual series, use the label object within the series object of the series array. The values that are set individually override the corresponding common values.

argumentFormat

Formats the point argument before it is displayed in the point label. To format the point value, use the format property.

Selector: DxArgumentFormat
Type:

Format

Default Value: undefined

NOTE
DevExtreme UI components provide a wide choice of predefined formats. If you are, however, going to use custom formats, link the Globalize library to your project. Learn how to do this from topics in the Installation section.
See Also
  • format - provides a comprehensive overview of formatting capabilities.
  • Value Formatting - shows how to apply formatting to various UI component elements.

backgroundColor

Colors the point labels' background. The default color is inherited from the points.

Selector: background-color
Type:

String

Default Value: undefined

This property supports the following colors:

You can remove the label's background by setting this property to "none". In this case, the label's text is the same color as the point.

border

Specifies border properties for point labels.

Selector: DxBorder
Type:

Object

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

connector

Specifies connector properties for series point labels.

Selector: DxConnector
Type:

Object

This member is exposed by the following entities:

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 properties using the connector object.

customizeText

Specifies a callback function that returns the text to be displayed by point labels.

Selector: customize-text
Type:

Function

Function parameters:
pointInfo:

Object

Information on the series point.

Return Value:

String

The text for the label to display.

Cannot be used in themes.

The function's parameter has the following fields:

  • originalValue
    Specifies the value of the represented point as it is set in the data source.
  • value
    Specifies the value of the represented point. Differs from the originalValue when the axis' value type differs from the value type in the data source. In this instance, value has the type of the value axis.
  • valueText
    Specifies the value of the represented point with applied formatting if the format property is specified (see label).
  • originalArgument
    Specifies the argument value of the represented point as it is set in the data source.
  • argument
    Specifies the argument value of the represented point. Differs from the originalArgument when the axis' argument type differs from the argument type in the data source. In this instance, argument has the type of the argument axis.
  • argumentText
    Specifies the argument value of the represented point with applied formatting if the argumentFormat property is specified.
  • size (for bubble series only)
    Specifies the size of the represented bubble as it is set in the data source.
  • index (for range area and range bar series only)
    Specifies whether the represented point is maximum (index = 1) or minimum (index = 0).
  • point
    Provides access to the represented point. To learn more about the field and methods of the point object, refer to the Point topic in the "Chart Elements" reference section.
  • seriesName
    Specifies the series of the represented point.
NOTE
As an alternative to the function’s parameter you can use the this keyword.
See Also

displayFormat

Specifies the label's text.

Selector: display-format
Type:

String

Default Value: undefined

This property is ignored if labels are hidden.

Use the parameters of the label.customizeLabel function as placeholders in the displayFormat property value.

The example below illustrates how to customize label text for all series and individual series:

jQuery
index.js
$(function() {
    $("#chartContainer").dxPolarChart({
    // ...
    commonSeriesSettings: {
        type: 'line',
        label: {
            format: 'thousands',
            visible: true,
            displayFormat: "{seriesName}: {valueText}",
        }
    },
    series: [
        { valueField: 'y1564', name: '15-64 years' },
        { valueField: 'y014', name: '0-14 years' },
        { valueField: 'y65', name: '65 years and older', 
            label: { 
                displayFormat: "<u>65+ years</u>: {valueText}",
            }, 
        },
    ],
    });
});
Angular
app.component.html
app.component.ts
app.module.ts
<dx-polar-chart ... >
    <dxi-series valueField="y1564" name="15-64 years"></dxi-series>
    <dxi-series valueField="y014" name="0-14 years"></dxi-series>
    <dxi-series valueField="y65" name="65 years and older">
        <dxo-label displayformat="<u>65+ years</u>: {valueText}">
        </dxo-label>
    </dxi-series>
    <dxo-common-series-settings ... >
        <dxo-label 
            format="thousands"
            [visible]="true"
            displayFormat="{seriesName}: {valueText}">
        </dxo-label>
    </dxo-common-series-settings>
</dx-polar-chart>
import { Component } from '@angular/core';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    // ...
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { DxPolarChartModule } from 'devextreme-angular';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        DxPolarChartModule
    ],
    providers: [ ],
    bootstrap: [AppComponent]
})
export class AppModule { }
Vue
App.vue
<template>
    <DxPolarChart ... >
        <DxSeries
            value-field="y1564"
            name="15-64 years"
        />
        <DxSeries
            value-field="y014"
            name="0-14 years"
        />
        <DxSeries
            value-field="y65"
            name="65 years and older">
            <DxLabel display-format="<u>65+ years</u>: {valueText}" />
        </DxSeries>
        <DxCommonSeriesSettings ... >
            <DxLabel :visible="true" format="thousands" display-format="{seriesName}: {valueText}" />
        </DxCommonSeriesSettings>
    </DxPolarChart>
</template>

<script>
import DxPolarChart, {
    DxSeries,
    DxLabel,
    DxCommonSeriesSettings
} from 'devextreme-vue/polar-chart';

export default {
    components: {
        DxPolarChart,
        DxSeries,
        DxLabel,
        DxCommonSeriesSettings
    },
    // ...
}
</script>
React
App.js
import React from 'react';

import PolarChart, {
    Series,
    Label,
    CommonSeriesSettings
} from 'devextreme-react/polar-chart';

class App extends React.Component {
    render() {
        return (
            <PolarChart ... >
                <Series valueField="y1564" name="15-64 years"></Series>
                <Series valueField="y014" name="0-14 years"></Series>
                <Series valueField="y65" name="65 years and older">
                    <Label displayFormat="<u>65+ years</u>: {valueText}" >
                    </Label>
                </Series>                
                <CommonSeriesSettings ... >
                    <Label 
                        format="thousands" 
                        visible={true}
                        displayFormat="{seriesName}: {valueText}"
                        >
                    </Label>
                </CommonSeriesSettings>
            </PolarChart>
        );
    }
}
export default App;
ASP.NET Core Controls
Razor C#
@(Html.DevExtreme().PolarChart()
    .CommonSeriesSettings(s => s
        .Label(label => label
            .Format(Format.Thousands)
            .DisplayFormat("{seriesName}: {valueText}")
            .Visible(true)                    
            )
        )
    )
    .Series(s => {
        s.Add().ValueField("y1564").Name("15-64 years");
        s.Add().ValueField("y014").Name("0-14 years");
        s.Add().ValueField("y65").Name("65 years and older").Label(label => label
            .DisplayFormat("<u>65+ years</u>: {valueText}")
        );
    })
    // ...
)
ASP.NET MVC Controls
Razor C#
@(Html.DevExtreme().PolarChart()
    .CommonSeriesSettings(s => s
        .Label(label => label
            .Format(Format.Thousands)
            .DisplayFormat("{seriesName}: {valueText}")
            .Visible(true)                    
            )
        )
    )
    .Series(s => {
        s.Add().ValueField("y1564").Name("15-64 years");
        s.Add().ValueField("y014").Name("0-14 years");
        s.Add().ValueField("y65").Name("65 years and older").Label(label => label
            .DisplayFormat("<u>65+ years</u>: {valueText}")
        );
    })
    // ...
)

font

Specifies font properties for the text displayed in point labels.

Selector: DxFont
Type:

Object

format

Formats a value before it is displayed in a point label.

Selector: DxFormat
Type:

Format

Default Value: undefined

See the format section for information on accepted values.

When this property value is undefined, the date-time axes display larger date range boundaries in labels. For example, if an axis displays months, it also displays a year near each instance of January. If an axis displays days, it also displays a month name near each first visible day mark.

See Also

position

Specifies a label position in bar-like series.

Default Value: 'outside'
This member is exposed by the following entities:

rotationAngle

Specifies the angle used to rotate point labels from their initial position.

Selector: rotation-angle
Type:

Number

Default Value: 0

showForZeroValues

Specifies whether or not to show a label when the point has a zero value.

Selector: show-for-zero-values
Type:

Boolean

Default Value: true
This member is exposed by the following entities:

visible

Specifies the visibility of point labels.

Type:

Boolean

Default Value: false