gpt4 book ai didi

javascript - 谷歌图表时间轴

转载 作者:行者123 更新时间:2023-11-30 06:23:54 24 4
gpt4 key购买 nike

我有一个包含 5 行的时间线图表,我已经为每一行定义了颜色:

var options = {         
colors: ['#FFF000', '#0094FF', '#FF6A00', '#26BA00', '#FF0000'],
timeline: {
colorByRowLabel: true
}
};

我想知道是否可以在同一行中有不同颜色的条。我想将第 1 行和第 2 行合并为一行。

enter image description here

最佳答案

groupByRowLabel 选项可以满足您的需求,请查看 the doc .

更具体地说,它说:

When there are four columns in a timeline dataTable, the first is interpreted as the row label, the second as the bar label, and the third and fourth as start and end.

因此,如果您将条形设置为具有相同行名称的不同颜色,以及 groupByRowLabel 选项,它们将以不同颜色出现在同一行上。

但是,它在逻辑上似乎与您的 colorByRowLabel 选项不兼容。

关于javascript - 谷歌图表时间轴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51637309/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com