迷你图堆叠条颜色选项只允许两种颜色变化?

Sparklines stacked bar color options only allow two color variations?

我在 Google 电子表格中使用迷你图函数。这是一些数据的示例:

Feb-2015    MTD Actual  MTD Budget  Budget
Campaign 1  .32       .71   .00

我想根据文档 here.

创建堆叠条形图迷你图
=sparkline(D9:F9,{
    "charttype","bar";
    "color1","blue";
    "color2","yellow";
    "color3","red"})

D9:F9对应$41.42:$96

结果如下:

我原以为有一段是红色的(color3)。但迷你图似乎只能自定义 2 种颜色。在文档中看不到任何关于此的内容。这是一个错误吗?还是我误会了什么?

如果我只能使用此功能编辑 2 种颜色,我认为使用 Google-Apps-Script 编辑功能是不可能的?

条形图只列出了颜色 1 和颜色 2 选项。迷你图不会明确暴露给 Apps 脚本,但可以作为值写入单元格。例如:

ss.appendRow(['==sparkline(D9:F9,{"charttype","bar";"color1","blue";"color2","yellow";})']);

来自文档: https://support.google.com/docs/answer/3093289?hl=en

For bar charts:

"max" sets the maximum value along the horizontal axis.
"color1" sets the first color used for bars in the chart.
"color2" sets the second color used for bars in the chart.
"empty" sets how to treat empty cells. Possible corresponding values include: "zero" or "ignore".
"nan" sets how to treat cells with non-numeric data. Options are: "convert" and "ignore".
"rtl" determines whether or not the chart is rendered right to left. Options are true or false.

如果你想拥有 100% 的 3 股酒吧,有一个技巧。因此,如果您有 3 个值的总和为 100,请执行以下操作:

从数据单元格中删除第三个值。 设置“最大”、“100”(或欧洲的“最大”/“100”)。 为迷你图单元格制作彩色背景。

这样填充到 100 的第三个值由单元格背景表示 - 它是第三个迷你图颜色。