Skip to main content

ItemWidgetBaseEventArgs Interface

Provides basic data for events related to client widgets used to visualize data in dashboard items.

Declaration

export interface ItemWidgetBaseEventArgs extends DashboardItemBaseEventArgs

Remarks

The Web Dashboard uses DevExtreme widgets to visualize data within dashboard items. The ViewerApiExtensionOptions.onItemWidgetUpdated, ViewerApiExtensionOptions.onItemWidgetCreated, and ViewerApiExtensionOptions.onItemWidgetOptionsPrepared handlers allow you to access these widgets and customize their settings if necessary.

Inherited Members

Properties

chartContext Property

Gets chart context for a Chart dashboard item.

Declaration

chartContext?: ChartContext

Property Value

Type Description
ChartContext

A ChartContext object that provides a connection between data item containers from the Values section and series from an underlying control.

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';
                }
            })
        }
    }
}

gaugeContext Property

Gets gauge context for a Gauge dashboard item.

Declaration

gaugeContext?: GaugeContext

Property Value

Type Description
GaugeContext

A GaugeContext object that provides a connection between data item containers from the Gauges section and underlying control’s gauges.

Remarks

The following code snippet shows how to use GaugeContext to get a Gauge item’s gauges:

var Model = DevExpress.Dashboard.Model;

function onItemWidgetOptionsPrepared(args) {
    if(args.dashboardItem instanceof Model.GaugeItem) {
        var gaugeOptions = args.options;
        var dashboardGauge = args.gaugeContext.getDashboardItemGauge(gaugeOptions);
        if(dashboardGauge.deltaOptions.valueType() === 'AbsoluteVariation') {
            gaugeOptions.title.text = 'AbsoluteVariation: ' + gaugeOptions.title.text;
        }
    }
}

gridContext Property

Gets grid context for a Grid dashboard item.

Declaration

gridContext?: GridContext

Property Value

Type Description
GridContext

A GridContext object that provides a connection between data item containers from the Columns section and an underlying control’s columns.

Remarks

The following code snippet shows how to use GridContext to get a Grid item’s columns:

var Model = DevExpress.Dashboard.Model;

function onItemWidgetOptionsPrepared(args) {
    if(args.dashboardItem instanceof Model.GridItem) {
        var gridOptions = args.options;
        if(gridOptions.columns) {
            gridOptions.columns.forEach(function(columnOptions) {
                var dashboardColumn = args.gridContext.getDashboardItemColumn(columnOptions)
                if(dashboardColumn instanceof Model.GridDimensionColumn && dashboardColumn.dimension().dataMember() === "id") {
                    columnOptions.alignment = 'center';
                }
            })
        }
    }
}

itemData Property

Gets multidimensional data visualized in the dashboard item.

Declaration

itemData: DevExpress.Dashboard.Data.ItemData

Property Value

Type Description
ItemData

A ItemData object that is multidimensional data visualized in the dashboard item.