Ticket T640550
Visible to All Users

How to add Checkbox Legends for DevExpress Dashboard Chart Item

created 7 years ago

Is it possible to add Checkbox Legends for DevExpress Dashboard Chart Item ???

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

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; } }
    Show previous comments (8)
    DevExpress Support Team 7 years ago

      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.

      JA JA
      Junaid Ahmed 3 7 years ago

        Is Checked Legend available in Dashboard Designer in 18.1 version instead of writing code ???

        DevExpress Support Team 7 years ago

          Hi,

          In the latest version (v18.1), there is no built-in option to enable checkbox elements in the chart's Legend panel.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.