Skip to main content
All docs
V25.2
  • TdxChartUserPalette.Items Property

    Provides indexed access to stored user palette items.

    Declaration

    property Items[Index: Integer]: TdxChartPaletteItem read; write; default;

    Property Value

    Type Description
    TdxChartPaletteItem

    A stored user palette item.

    Remarks

    Use the Items property to access and manage stored palette items. The Count property specifies the size of the underlying array.

    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