SupportColoringAttribute Class
Specifies whether data items in a section support coloring.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.1.Core.dll
NuGet Package: DevExpress.Dashboard.Core
Declaration
[AttributeUsage(AttributeTargets.Property)]
public class SupportColoringAttribute :
Attribute
Remarks
You can apply SupportColoringAttribute
to a data section when you create metadata for a custom dashboard item. The attribute indicates that a custom item supports coloring for data items in this section. Pass one of the DefaultColoringMode values as an argument to the SupportColoringAttribute
constructor:
- Hue
- Data item values use different colors.
- None
- Data item values use the same color.
The specified DefaultColoringMode
property defines the Default value of the Color by option (the DashboardItemColoringOptions.MeasuresColoringMode property for measures and the Dimension.ColoringMode property for dimensions).
The following code snippet shows how to enable color variation for data items in the Value and Arguments data sections:
using System.ComponentModel;
using DevExpress.DashboardCommon;
namespace CustomItemsSample {
[DisplayName("Funnel"),
CustomItemDescription("Funnel description"),
CustomItemImage("CustomItemsSample.Images.Funnel.svg")]
public class CustomFunnelMetadata : CustomItemMetadata{
[DisplayName("Value"),
EmptyDataItemPlaceholder("Value"),
SupportColoring(DefaultColoringMode.Hue)]
public Measure Value {
get { return GetPropertyValue<Measure>(); }
set { SetPropertyValue(value); }
}
[DisplayName("Arguments"),
EmptyDataItemPlaceholder("Argument"),
SupportColoring(DefaultColoringMode.Hue),
SupportInteractivity]
public DimensionCollection Arguments { get; } = new DimensionCollection();
}
}
The following image illustrates the Funnel custom item with enabled color variation for the Value and Arguments data sections. The Default value’s Color by option paints the Argument data item values. The indicator on the data item shows that color variation is enabled.