防止系列使用clWhite和Delphi TChart

Jim*_*eth 2 delphi charts teechart colors

我有一份使用我正在维护的TChart的报告.其中一个自动添加的TLineSeries被赋予颜色clWhite,它太靠近背景(clBtnFace).

如果我改变它,那么下一个添加的系列就会变成clWhite.在创建了所有其他系列之后,没有回头并改变它,有没有办法告诉TChart我不希望我的任何系列都是clWhite?

当系列添加到TChart时,TChart会为其指定颜色.我希望它不分配clWhite.

Jim*_*eth 6

好吧,不是一个人轻易放弃,我做了更多的搜索.有被称为单元可变 ColorPalette类型的TColorArrayTeeProcs单元.如果我找到并用不同的颜色替换白色来修复它.可能有它的实例副本.我会继续寻找,因为那将是首选.

要恢复ColorPalette,只需在同一单元中调用单位方法SetDefaultColorPalette.

SetDefaultColorPalette; // Make sure we start with the default
ColorPalette[4] := $007FFF; // Change White to Orange
try
  // add series to the chart
finally
  SetDefaultColorPalette;  // Set it back to Default
end;
Run Code Online (Sandbox Code Playgroud)

顺便说一句,我不能接受答案,因为我也问了这个问题,但我测试了它并且它有效.