Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxChartUserPalette.Count Property

Specifies the number of stored palette items.

#Declaration

Delphi
property Count: Integer read; write;

#Property Value

Type Description
Integer

The number of palette items accessible through the Items property.

#Remarks

The Count property specifies the size of the stored array of palette items. You can use this property to do the following:

  • Identify the number of palette items accessible through the Items property.
  • Clear the user palette (set the Count property to 0).
  • Shrink or expand the palette. If the Count property value decreases, the palette deletes its items whose ordinal number exceeds the new Count property value.

#Code Example: Create a User Palette

The following code example creates a user palette with three colors and applies the palette to a Chart control:

var
  AChartPalette: TdxChartUserPalette;
begin
  AChartPalette := dxChartPaletteRepository1.CreateItem;
  AChartPalette.Name := 'My Palette 1'; // Assigns a unique palette name
  AChartPalette.Count := 3;  // Sets the size of the palette item array
  AChartPalette.Items[0] := TdxChartPaletteItem.Create(TdxAlphaColors.Red);
  AChartPalette.Items[1] := TdxChartPaletteItem.Create(TdxAlphaColors.Green);
  AChartPalette.Items[2] := TdxChartPaletteItem.Create(TdxAlphaColors.Blue);
  dxChartControl1.Palette := AChartPalette;
end;

VCL Chart Control: A Simple Custom Palette Example

See Also