2017-12-04 9 views
1

私はGoogleのチャートからcandlechartsをカスタマイズしようとしています。Googleチャートの燭台の色

私はろうそく自分の色を変更する方法を発見したが、ラインの一つは、最高値と最低値を示していない。

enter image description here

ものは、私が提供するオプションは次のとおりです。

let options = { 
     legend: 'none', 
     candlestick: { 
     risingColor: {stroke: '#4CAF50', fill: 'white'}, 
     fallingColor: {stroke: '#F44336'} 
     } 
    } 

あなたはこのjsFiddleでそれを試すことができます。https://jsfiddle.net/El_Matella/h5p36t3w/2/

私は、ドキュメントの時間で見つけることができませんそれを変更するには、誰かがアイデアを持っていますか? (https://developers.google.com/chart/interactive/docs/gallery/candlestickchart

答えて

2

あなたは、すべての行が同じ色にしたい
場合はcolorsオプションを使用することができます...

が作業スニペットを次のように表示...

google.charts.load('current', {'packages':['corechart']}); 
 

 
google.charts.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', 
 
    candlestick: { 
 
     risingColor: {stroke: '#4CAF50', fill: 'white'}, 
 
     fallingColor: {stroke: '#F44336'} 
 
    }, 
 
    colors: ['magenta'] 
 
    }; 
 

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

 
    chart.draw(data, options); 
 
}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 
 
<div id="chart_div" style="width: 900px; height: 500px;"></div>

+0

ありがとうございます。 – Hammerbot

関連する問題