All docs
V20.2
21.1 (EAP/Beta)
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ChartContext Class

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

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v20.2.Core.dll

Declaration

public class ChartContext :
    ControlContext

Remarks

A chart context provides the connection between dashboard data item containers from the Values section and the underlying control's series. The GetControlSeries method returns a data item container that corresponds to the specified control's series. The GetDashboardItemColumn method, in turn, gets a collection of the control's series that corresponds to the specified data item containers from the Values section.

The following code shows how to change the standard line to a line consisting of a repeating pattern of dash-dot. The Chart contains two panes with Total Sum and Quantity data items. The series contains two values. The DashboardDesigner.DashboardItemControlUpdated event is used to update the Chart's appearance.

using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
using DevExpress.XtraCharts;

// ...

private void DashboardDesigner1_DashboardItemControlUpdated(object sender, DashboardItemControlEventArgs e) {
    if(e.ChartControl != null) {
        DashboardDesigner designer = (DashboardDesigner)sender;
        var chartDashboardItem = designer.Dashboard.Items[e.DashboardItemName] as ChartDashboardItem;

        foreach(var pane in chartDashboardItem.Panes) {
            if(pane.Series.Count > 0) {
                foreach(var dashSeries in pane.Series) {
                    if(dashSeries != null) {
                        var controlSeries = e.ChartContext.GetChartSeries(dashSeries);
                        if(controlSeries != null) {
                            foreach(var ser in controlSeries) {
                                LineSeriesView view = ser.View as LineSeriesView;
                                if(view != null) {
                                    view.LineStyle.DashStyle = DashStyle.DashDot;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Inheritance

See Also