There is no "official" function for that. But you can use a random color
uses LCLIntf;
Series1.SeriesColor := rgb(random(256), random(256), random(256));
or use an array of predefined colors:
const
NUMCOLORS = 10;
SERIESCOLORS: array[0..NUMCOLORS-1] of TColor = (
clRed, clBlue, clOlive, //... etc
);
function GetSeriesColor(AIndex: integer): TColor;
begin
Result := SERIESCOLORS[AIndex mod NUMCOLORS];
end;
Series1.SeriesColor := GetSeriesColor(0);
Series2.SeriesColor := GetSeriesColor(1);
// etc.
Note that in the last solution the colors are repeated after the predefined colors are used up.
A variation would be to read the colors from an external file which gives the user the opportunity to change the colors:
var
SeriesColors: array of TColor;
procedure ReadColorsFromFile(AFileName: string);
var
List: TStringList;
begin
List := TStringList.Create;
try
List.ReadFromFile(AFileName);
SetLength(SeriesColors, List.Count);
for i:=0 to List.Count-1 do
SeriesColors[i] := StringToColor(List[i]);
finally
List.Free;
end;
It's your choice...