Vue RangeSelector - chart.series.label
Declared in commonSeriesSettings, the label settings apply to all point labels in the chart. Declared in a series configuration object, the label settings apply only to the point labels that belong to this particular series. The series-specific label settings override the common ones.
jQuery
$(function() { $("#chartContainer").dxChart({ // ... series: [{ label: { // Settings for all point labels of an individual series } }, { // ... }], commonSeriesSettings: { label: { // Settings for all point labels in the Chart } } }); });
Angular
<dx-chart ... > <dxi-series> <dxo-label ... > <!-- Settings for all point labels of an individual series --> </dxo-label> </dxi-series> <dxo-common-series-settings ... > <dxo-label ... > <!-- Settings for all point labels in the Chart --> </dxo-label> </dxo-common-series-settings> </dx-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 { DxChartModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxChartModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }
Vue
<template> <DxChart ... > <DxSeries ... > <DxLabel ...> <!-- Settings for all point labels of an individual series --> </DxLabel> </DxSeries> <DxCommonSeriesSettings ... > <DxLabel ... > <!-- Settings for all point labels in the Chart --> </DxLabel> </DxCommonSeriesSettings> </DxChart> </template> <script> import DxChart, { DxSeries, DxLabel, DxCommonSeriesSettings } from 'devextreme-vue/chart'; export default { components: { DxChart, DxSeries, DxLabel, DxCommonSeriesSettings }, // ... } </script>
React
import React from 'react'; import Chart, { Series, Label, CommonSeriesSettings } from 'devextreme-react/chart'; class App extends React.Component { render() { return ( <Chart ... > <Series ... > <Label ... > // Settings for all point labels of an individual series </Label> </Series> <CommonSeriesSettings ... > <Label ... > // Settings for all point labels in the Chart </Label> </CommonSeriesSettings> </Chart> ); } } export default App;
See Also
alignment
Use the HorizontalAlignment
enum to specify this option when the widget is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. This enum accepts the following values: Left
, Center
, and Right
.
argumentFormat
Formats the point argument before it is displayed in the point label. To format the point value, use the format option.
A point label displays only the point value by default. Using the label.customizeText option, you can instruct the label to display the point argument as well. The argumentFormat option applies in this case only. This option accepts an object whose fields are described in the format section.
See Also
- format - provides a comprehensive overview of formatting capabilities.
- Data Formatting - shows how to apply formatting to various widget elements.
backgroundColor
This option supports the following colors:
- Hexadecimal colors
- RGB colors
- RGBA colors
- Predefined/cross-browser color names
- Predefined SVG colors
- Paint server address
You can remove the label's background by setting this option to "none". In this case, the label's text is the same color as the point.
customizeText
This option accepts a function whose parameter exposes the following fields.
<table class="dx-table full-width"> <tr> <th>Field</th> <th>Description</th> </tr> <tr> <td>originalValue</td> <td>The raw value of the point.</td> </tr> <tr> <td>value</td> <td>The <i>originalValue</i> after <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Configuration/valueAxis/#valueType">type cast</a>.</td> </tr> <tr> <td>valueText</td> <td>The <i>value</i> with an applied <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Configuration/commonSeriesSettings/label/#format">format</a> and converted to string.</td> </tr> <tr> <td>originalArgument</td> <td>The raw argument of the point.</td> </tr> <tr> <td>argument</td> <td>The <i>originalArgument</i> after <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Configuration/argumentAxis/#argumentType">type cast</a>.</td> </tr> <tr> <td>argumentText</td> <td>The <i>argument</i> with an applied <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Configuration/commonSeriesSettings/label/#argumentFormat">format</a> and converted to string.</td> </tr> <tr> <td>size</td> <td>The size value of the point. For <i>bubble</i> series only.</td> </tr> <tr> <td>index</td> <td><i>0</i> - if the point is minimum; <i>1</i> - if the point is maximum. For <i>range area</i> and <i>range bar</i> series only.</td> </tr> <tr> <td>point</td> <td>The <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Chart_Elements/Point/">Point</a> object.</td> </tr> <tr> <td>seriesName</td> <td>The name of the series to which the point belongs.</td> </tr> </table>
The following fields are inherent to stacked-like series only.
<table class="dx-table full-width"> <tr> <th>Field</th> <th>Description</th> </tr> <tr> <td>percent</td> <td>The percentage value of the point.</td> </tr> <tr> <td>percentText</td> <td>The <i>percent</i> with an applied <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Configuration/commonSeriesSettings/label/#format">format</a> and converted to string.</td> </tr> <tr> <td>total</td> <td>The sum of all values in the stack.</td> </tr> <tr> <td>totalText</td> <td>The <i>total</i> with an applied <a href="/Vue/Documentation/19_2/ApiReference/Data_Visualization_Widgets/dxChart/Configuration/commonSeriesSettings/label/#format">format</a> and converted to string.</td> </tr> </table>
The following fields are inherent to financial series (candlestick and stock) only.
Field | Description |
---|---|
originalOpenValue | The raw open value of the point. |
openValue | The originalOpenValue after type cast. |
openValueText | The openValue with an applied format and converted to string. |
originalCloseValue | The raw close value of the point. |
closeValue | The originalCloseValue after type cast. |
closeValueText | The closeValue with an applied format and converted to string. |
originalHighValue | The raw high value of the point. |
highValue | The originalHighValue after type cast. |
highValueText | The highValue with an applied format and converted to string. |
originalLowValue | The raw low value of the point. |
lowValue | The originalLowValue after type cast. |
lowValueText | The lowValue with an applied format and converted to string. |
reductionValue | The reduction value. |
reductionValueText | The reductionValue with an applied format and converted to string. |
this
keyword.See Also
format
This option accepts an object whose fields are described in the format section. However, there is one more field, called percentPrecision, which is available only to full-stacked-like series, where one point always has an absolute and a percentage value. The percentPrecision field specifies how many digits after the decimal point to save in the percentage value. See an example in the following code.
format: { type: "fixedPoint", // the format of absolute values precision: 1, // the precision of absolute values (123.456 --> 123.4) percentPrecision: 2 // the precision of percentage values (12.3456 % --> 12.34 %) }
See Also
- format - provides a comprehensive overview of formatting capabilities.
- Data Formatting - shows how to apply formatting to various widget elements.
If you have technical questions, please create a support ticket in the DevExpress Support Center.