Skip to main content
All docs
V24.2

DashboardFlatDataSource.GetColoringColumn(String) Method

Gets the coloring column corresponding to the data item.

Namespace: DevExpress.DashboardCommon

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

Declaration

public DashboardFlatDataColumn GetColoringColumn(
    string dataItemId = null
)

Optional Parameters

Name Type Default Description
dataItemId String null

A data item’s unique id.

Returns

Type Description
DashboardFlatDataColumn

A data column.

Remarks

If you enabled color variation by several measures, you can get a coloring column for the specified measure. For this, pass the measure’s unique id to the GetColoringColumn method as the dataItemId parameter; otherwise, you get the coloring column of the first measure in a data item section.

Use the DashboardFlatDataSourceOptions.AddColoringColumns method to specify whether coloring columns should be added to DashboardFlatDataSource.

The following code snippet gets a coloring column and binds it to a chart series:

using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
using DevExpress.XtraCharts;

public class CustomFunnelControlProvider : CustomControlProviderBase {
  CustomDashboardItem<CustomFunnelMetadata> dashboardItem;
  //...
  protected override void UpdateControl(CustomItemData customItemData){
      chart.Series.Clear();
      if(dashboardItem.Metadata.Value != null && dashboardItem.Metadata.Arguments.Count > 0) {
          Series series = new Series("A Funnel Series", ViewType.Funnel);
          flatData = customItemData.GetFlatData(new DashboardFlatDataSourceOptions() { AddColoringColumns = true });
          series.DataSource = flatData;
          series.ValueDataMembers.AddRange(dashboardItem.Metadata.Value.UniqueId);
          series.ArgumentDataMember = dashboardItem.Metadata.Arguments.Last().UniqueId;
          series.ColorDataMember = flatData.GetColoringColumn(dashboardItem.Metadata.Value.UniqueId).Name;
          chart.Series.Add(series);
      }
  }
}
See Also