1

シリーズが1つだけの次のコードがあります。作業中のデータが原因で別のシリーズを追加できません。提示された課題は、棒グラフの棒をさまざまな色でスタイルすることです。助言がありますか?

var options = {
title:selVal + ': Electricity Consumption Yearly % Change',
legend:{alignment:'center', position:'bottom'},
vAxis:{title:'Yearly % Change', format:'#,###%'},
seriesType: "bars",
width:600, 
height:300
};
4

2 に答える 2

1
var options = {
          legend: 'none',
          series: {
            0: { color: '#e2431e' },
            1: { color: '#e7711b' },
            2: { color: '#f1ca3a' },
            3: { color: '#6f9654' },
            4: { color: '#1c91c0' },
            5: { color: '#43459d' },
          }
        };
于 2017-03-20T07:25:52.153 に答える
0

オプションで色の配列を指定すると、複数の色を指定できます

var options = {
title:selVal + ': Electricity Consumption Yearly % Change',
legend:{alignment:'center', position:'bottom'},
vAxis:{title:'Yearly % Change', format:'#,###%'},
seriesType: "bars",
width:600, 
height:300,
colors: ["red","blue","green"]
};
于 2013-01-08T10:28:52.567 に答える