Is it possible to add Checkbox Legends for DevExpress Dashboard Chart Item ???
How to add Checkbox Legends for DevExpress Dashboard Chart Item
Answers approved by DevExpress Support
To display custom check boxes, it is necessary to access the inner ChartControl used to display the item as described in the Access to Underlying Controls help topic. Note that the chart item displays different series in the legend and chart. You will need to handle the ChartControl.LegendItemChecked event that is raised when the legend series is checked and hide the corresponding series in the chart manually. Please refer to the following code snippet demonstrating this functionality:
C#private void dashboardDesigner1_DashboardItemControlCreated(object sender, DevExpress.DashboardWin.DashboardItemControlEventArgs e) {
if (e.ChartControl != null) {
e.ChartControl.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.CheckBoxAndMarker;
e.ChartControl.LegendItemChecked += ChartControl_LegendItemChecked;
}
}
private void ChartControl_LegendItemChecked(object sender, DevExpress.XtraCharts.LegendItemCheckedEventArgs e) {
ChartControl chart = (ChartControl)sender;
if (e.CheckedElement is Series) {
var series = (Series)e.CheckedElement;
chart.Series[series.LegendText].Visible = e.NewCheckState;
}
}
To avoid discussing different platforms within a single thread I've created a separate ticket regarding the Web Dashboard control on your behalf (T641848: Web Dashboard - How to add Checkbox Legends for DevExpress Dashboard Chart Item). It has been placed in our processing queue and will be answered shortly.
Is Checked Legend available in Dashboard Designer in 18.1 version instead of writing code ???
Hi,
In the latest version (v18.1), there is no built-in option to enable checkbox elements in the chart's Legend panel.