JavaScript/jQuery Chart - StockSeries

Describes settings supported by a series of the stock type.

Type:

Object

All the settings in this section are specified as follows:

  • The commonSeriesSettings object
    Specifies settings for all series in a Chart.

  • The commonSeriesSettings.stock object
    Specifies settings for all series of the stock type.

  • An object in the series array
    Specifies settings for an individual series.

View Demo

DevExtreme HTML5 Charts StockSeriesType

aggregation

Configures data aggregation for the series.

Type:

Object

Displaying all the points of a Chart with many series points can affect performance. In this case, aggregate the series points or replace a group of them with a single point. The group includes only those points that fall within the same interval on the argument axis. See aggregationInterval and aggregationGroupWidth for details on dividing the axis into intervals.

The Chart provides several aggregation methods, which differ depending on the series type, and a capability to implement a custom aggregate function. To enable data aggregation for the series, set the aggregation.enabled property to true.

See Also

argumentField

Specifies which data source field provides arguments for series points.

Type:

String

Default Value: 'date'
Cannot be used in themes.

Each point in a financial series has one argument and four values. Arguments are provided by the argumentField; values are provided by the openValueField, closeValueField, highValueField and lowValueField.

Commonly, when a chart contains several series, many of them have the same argument field. In this case, assign the name of this field to the argumentField property of the commonSeriesSettings object. If a series must have a unique argument field, specify the same property, but do so in the series object within the series array.

axis

Binds the series to a value axis.

Type:

String

Default Value: undefined

When there are multiple value axes in a chart, series need to know exactly which axis they are bound to. By default, all of them are bound to the first axis in the valueAxis array. To bind a series to another axis, assign the name of the axis to the axis series property.

View Demo

closeValueField

Specifies which data source field provides close values for points of a financial series.

Type:

String

Default Value: 'close'
Cannot be used in themes.

Each point in a financial series has one argument and four values. Arguments are provided by the argumentField; values are provided by the openValueField, closeValueField, highValueField and lowValueField.

If you use a series template, specify the value field properties in the commonSeriesSettings object. Otherwise, do this in the series object within the series array.

color

Specifies the color of the series.

Default Value: undefined

Specified in the commonSeriesSettings object, this property colors all series in the chart. To color an individual series, specify this property in the series object within the series array.

This property supports the following colors:

You can also specify a custom pattern or gradient instead of a plain color. Call the registerPattern() or registerGradient() method to obtain a fill ID. Assign that value to the fillId field.

This functionality is available for the following Chart series:

jQuery
index.js
$(function(){
    $("#chartContainer").dxChart({
        // ...
        series: {
            // ...
            color: {
                fillId: customPatternId
            }
        }
    });
});
Angular
app.component.html
app.component.ts
<dx-chart ... >
    <dxi-series 
        [color]="fill"
    >
    </dxi-series>
</dx-chart>
// ...

export class AppComponent {
    // ...

    fill = {
        fillId: this.customPatternId
    };
} 
Vue
App.vue (Options API)
App.vue (Composition API)
<template>
    <DxChart ... >
        <DxSeries :color="fill" />
        </DxSeries>
    </DxChart>
</template>

<script>
import DxChart, { DxSeries, DxSelectionStyle } from 'devextreme-vue/chart'; 
// ...

export default {
    components: {
        DxChart,
        DxSeries,
        DxSelectionStyle
    },
    data() {
        return {
            // ...
            fill: {
                fillId: this.customPatternId
            }
        }
    }
}
</script>
<template>
    <DxChart ... >
        <DxSeries :color="fill" />
    </DxChart>
</template>

<script setup>
import DxChart, { DxSeries, DxSelectionStyle } from 'devextreme-vue/chart';  
// ...

const fill = {
    fillId: customPatternId
};
</script>
React
App.js
import React from 'react';
import Chart, { Series, SelectionStyle } from 'devextreme-react/chart'; 

// ...
const fill = {
    fillId: customPatternId
};

export default function App() { 
    return ( 
        <Chart ... >
            <Series color={fill} />
        </Chart>        
    ); 
} 

highValueField

Specifies which data source field provides high values for points of a financial series.

Type:

String

Default Value: 'high'
Cannot be used in themes.

Each point in a financial series has one argument and four values. Arguments are provided by the argumentField; values are provided by the openValueField, closeValueField, highValueField and lowValueField.

If you use a series template, specify the value field properties in the commonSeriesSettings object. Otherwise, do this in the series object within the series array.

hoverMode

Specifies series elements to be highlighted when a user pauses on a series.

Type:

String

Default Value: 'onlyPoint'
Accepted Values: 'onlyPoint' | 'allSeriesPoints' | 'allArgumentPoints' | 'none'

When a user pauses on a series, it may react in one of the following ways depending on the value of the hoverMode property.

  • onlyPoint
    Only the series point that a user pauses on changes its style.
  • allSeriesPoints
    All points in the series change their style.
  • allArgumentPoints
    The series point that a user pauses on changes its style. Points with the same argument do it as well.
  • none
    The series does not react to pointing to it.
See Also
  • hoverStyle - specifies the appearance of series in the hover state.

hoverStyle

Configures the appearance adopted by the series when a user points to it.

Type:

Object

Declared in commonSeriesSettings, hoverStyle applies to all series in the chart. Declared in a series configuration object, hoverStyle applies to this particular series only. The series-specific hoverStyle overrides the common one.

ignoreEmptyPoints

Specifies whether the series should ignore null data points.

Type:

Boolean

Default Value: false

Data points that have the null value do not produce actual series points. Because of this, series may be drawn with unnecessary gaps where missing points should have been. To remove these gaps, set the ignoreEmptyPoints property to true.

label

Configures point labels.

Type:

Object

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
JavaScript
$(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
app.component.html
app.component.ts
app.module.ts
<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
App.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
App.js
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;

View Demo

See Also

lowValueField

Specifies which data source field provides low values for points of a financial series.

Type:

String

Default Value: 'low'
Cannot be used in themes.

Each point in a financial series has one argument and four values. Arguments are provided by the argumentField; values are provided by the openValueField, closeValueField, highValueField and lowValueField.

If you use a series template, specify the value field properties in the commonSeriesSettings object. Otherwise, do this in the series object within the series array.

maxLabelCount

Specifies a limit for the number of point labels.

Type:

Number

Default Value: undefined

If the number of points in a series increases over time, there comes a time when it becomes so massive that displaying labels for them makes the chart too cluttered. In this instance, to keep the chart clear to the viewer, specify a limit for the number of point labels using the maxLabelCount property. Once this limit is exceeded, all point labels of the series will be hidden.

openValueField

Specifies which data source field provides open values for points of a financial series.

Type:

String

Default Value: 'open'
Cannot be used in themes.

Each point in a financial series has one argument and four values. Arguments are provided by the argumentField; values are provided by the openValueField, closeValueField, highValueField and lowValueField.

If you use a series template, specify the value field properties in the commonSeriesSettings object. Otherwise, do this in the series object within the series array.

pane

Specifies which pane the series should belong to. Accepts the name of the pane.

Type:

String

Default Value: 'default'

If this property is not specified, the series will belong to the default pane.

See Also
  • panes - declares a collection of panes.

View Demo

reduction

Specifies reduction properties for financial series.

Type:

Object

Each point in a financial series has four values or "prices": high, low, open and close. To mirror the changes on the market more clearly, the UI component compares the price of every point with the price of the previous point. Those points whose price has decreased are painted in a specific color. To specify whether high, low, open or close prices of points should be compared, use the level property.

selectionMode

Specifies series elements to be highlighted when a user selects a point.

Type:

String

Default Value: 'onlyPoint'
Accepted Values: 'onlyPoint' | 'allSeriesPoints' | 'allArgumentPoints' | 'none'

NOTE
Though not provided out of the box, the selection capability can be implemented using the UI component API. Refer to the onPointClick property description for details.

When a user selects a point, its series may react in one of the following ways depending on the value of the selectionMode property.

  • onlyPoint
    Only the selected series point changes its style.
  • allSeriesPoints
    All points in the series change their style.
  • allArgumentPoints
    The selected series point changes its style. Points with the same argument do it as well.
  • none
    The series does not react in any way.
See Also
  • pointSelectionMode - specifies whether only one or several series points can stay selected.
  • series.selectionStyle - specifies the appearance of series points in the selected state.
  • pointSelectionChanged - an event that fires after the selection state of a series point has been changed.

selectionStyle

Configures the appearance adopted by the series when a user selects it.

Type:

Object

NOTE
Though not provided out of the box, the selection capability can be implemented using the UI component API. Refer to the onPointClick property description for details.

Declared in commonSeriesSettings, selectionStyle applies to all series in the chart. Declared in a series configuration object, selectionStyle applies to this particular series only. The series-specific selectionStyle overrides the common one.

showInLegend

Specifies whether to show the series in the legend or not.

Type:

Boolean

Default Value: true

tagField

Specifies which data source field provides auxiliary data for series points.

Type:

String

Default Value: 'tag'
Cannot be used in themes.

This property allows you to associate virtually any required data with a series point. This data will be stored in the tag field of the Point object.

Commonly, a chart contains several series, and many of them have the same tagField value. In this case, specify the tagField property in the commonSeriesSettings object. If a series must have a unique tagField value, specify the same property, but do so in the series object within the series array.

See Also
  • series.tag - associates data with an entire series.

visible

Specifies whether the series is visible or not.

Type:

Boolean

Default Value: true

NOTE
When the series is invisible, the marker of its legend item is faded.
See Also
  • Series.show() - shows the series at runtime.
  • Series.hide() - hides the series at runtime.

width

Specifies the width of the series line in pixels. Applies only to line-like series.

Type:

Number

Default Value: 2