Skip to main content

ChartContext Class

Provides a connection between data item containers from the Values section and series from an underlying control.

Declaration

export class ChartContext

Remarks

The following code snippet shows how to use ChartContext to get a Chart item’s series:

var Model = DevExpress.Dashboard.Model;

function onItemWidgetOptionsPrepared(args) {
    if(args.dashboardItem instanceof Model.ChartItem) {
        var chartOptions = args.options;
        if(chartOptions.series) {
            chartOptions.series.forEach(function(seriesOptions) {
                var dashboardSeries = args.chartContext.getDashboardItemSeries(seriesOptions)
                if(dashboardSeries && dashboardSeries.plotOnSecondaryAxis()) {
                    seriesOptions.dashStyle = 'longDash';
                }
            })
        }
    }
}

constructor(_dashboardItem)

Initializes a new instance of the ChartContext class with specified settings.

Declaration

constructor(
    _dashboardItem: DevExpress.Dashboard.Model.ChartItem
)

Parameters

Name Type
_dashboardItem ChartItem

Methods

getDashboardItemSeries(seriesOptions) Method

Declaration

getDashboardItemSeries(
    seriesOptions: DevExpress.viz.ChartSeries
): DevExpress.Dashboard.Model.ChartSeries

Parameters

Name Type
seriesOptions ChartSeries

Returns

Type
ChartSeries