烛台后面的酒吧的颜色

时间:2014-08-07 19:20:45

标签: javascript jquery css google-visualization

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

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

stroke选项会更改框的颜色,但不会更改背后的粘贴。我得到了这个奇怪的黑色框与绿色或红色和蓝色stic的颜色组合。 无法在docs

中找到它

2 个答案:

答案 0 :(得分:4)

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

E.g。将第一个系列的指针改为红色,将第二个系列的指针改为棕色:

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

答案 1 :(得分:0)

这是不可能的,但是如果你想要加入,就会有一个GitHub issue