【问题标题】:how set color of otherslice如何设置其他片的颜色
【发布时间】:2013-09-12 20:00:30
【问题描述】:

在 tchart 中,我可以为我的饼图系列的所有值设置颜色,除了自动生成的 otherlice。该系列有一个“otherslice”属性,但没有颜色属性。我尝试设置所有可用的颜色属性,如 seriescolor。这东西一直是丑陋的绿色。

编辑:我现在在我的笔记本电脑上编辑同一个项目,而我家用电脑上的其他部分是我笔记本电脑上的绿色眼睛明亮的疼痛,它是橄榄绿色,所以一定有什么东西能够影响颜色。我还尝试将 dfm 表单文件中所有提及颜色的内容更改为没有结果的文本。

【问题讨论】:

    标签: delphi teechart delphi-2006


    【解决方案1】:

    这可以通过 OtherSlice.Color 属性实现:

      Series1.AddPie(15, '', clRed);
      Series1.AddPie(7, '', clYellow);
      Series1.AddPie(9, '', clGreen);
      Series1.AddPie(11, '', clWhite);
      Series1.AddPie(5, '', clBlack);
      Series1.AddPie(3, '', clPurple);
    
      Series1.OtherSlice.Style:=poBelowValue;
      Series1.OtherSlice.Value:=6;
      Series1.OtherSlice.Color:=clBlue;
    

    由于默认调色板,不同计算机中的颜色可能会发生变化。当前的默认调色板是 Opera,而您的桌面可能仍具有旧的默认调色板集。您可以在图表上右键单击更改此设置,转到选项 -> 新图表。

    【讨论】:

    • 嗯,这可能是因为我拥有的版本(与 delphi turbo 2006 一起提供)但 otherlice 的颜色属性绝对不存在,因此您的行将无法编译。
    • @user2774133 那时您的版本可能无法使用。我的代码适用于最新的 TeeChart 2013 VCL/FMX 版本。
    猜你喜欢
    • 2019-04-10
    • 2019-02-08
    • 1970-01-01
    • 2015-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-02
    相关资源
    最近更新 更多