gpt4 book ai didi

javascript - 烛台后面的柱线颜色

转载 作者:行者123 更新时间:2023-11-29 10:14:39 24 4
gpt4 key购买 nike

如何更改 Google Charts Api 中烛台后面的柱线?

candlestick:{fallingColor:{fill:"red", strokeWidth:0.5,stroke:'black'},
risingColor:{fill:"yellowgreen",strokeWidth:0.5,stroke:'black'}}}

stroke 选项改变方框的颜色,但不改变后面的棍子。我得到了黑框与绿色或红色和蓝色 stic 的这种奇怪的颜色组合。在 docs 中找不到它

最佳答案

colors 参数将修改“棒”的颜色。这指定了图表中每个系列的默认颜色。

例如将第一个系列的棒更改为红色,第二个系列的棒变为棕色:

google.setOnLoadCallback(drawChart);

function drawChart() {
var data = google.visualization.arrayToDataTable([
['Mon', 20, 28, 38, 45],
['Tue', 31, 38, 55, 66],
['Wed', 50, 55, 77, 80],
['Thu', 77, 77, 66, 50],
['Fri', 68, 66, 22, 15]
// Treat first row as data as well.
], true);

var options = {
legend: 'none',
colors: ['red','brown'],
candlestick: {
fallingColor:{ fill: "orange", strokeWidth:0.5, stroke:'black'},
risingColor:{ fill: "yellowgreen", strokeWidth:0.5, stroke:'black'}
}
};

var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div'));

chart.draw(data, options);
}

Fiddle here .

关于javascript - 烛台后面的柱线颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25190508/

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