2012-12-12 71 views
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 
}; 

回答

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"] 
}; 
0
var options = { 
      legend: 'none', 
      series: { 
      0: { color: '#e2431e' }, 
      1: { color: '#e7711b' }, 
      2: { color: '#f1ca3a' }, 
      3: { color: '#6f9654' }, 
      4: { color: '#1c91c0' }, 
      5: { color: '#43459d' }, 
      } 
     }; 
給予多種顏色