vcl-dxchartpalette-dot-tdxchartuserpalette.md
The user palette name.
property Name: string read; write;
| Type | Description |
|---|---|
| string |
The name of the user palette.
|
Use the Name property to specify a name for the user palette.
All standard and user palette names are unique. An exception occurs if you assign a name that matches the name of an existing standard palette or another palette stored in the repository component accessible through the Repository property.
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;
// ...
TdxChartUserPalette *AChartPalette;
// ...
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(TdxAlphaColors::Red);
AChartPalette->Items[1] = TdxChartPaletteItem(TdxAlphaColors::Green);
AChartPalette->Items[2] = TdxChartPaletteItem(TdxAlphaColors::Blue);
dxChartControl1->Palette = AChartPalette;
See Also