2
我有許多行的時間表,每行都有幾張時間表。Google時間軸爲每個時間表修復不同的顏色
我想爲每個時間表修正一個確切的顏色,所以一種時間表在每一行中都會有相同的顏色。
我使用這個代碼:
var options = {
colors: ['#0C14F2', '#114C9E', '#ee8800', '#F6FF00'],
timeline: {
showBarLabels: false,
avoidOverlappingGridLines: false
},
backgroundColor: '#f8f8ff'
};
這段代碼改變了顏色相宜隨機時間表的。
UPDATE:樣品JSON輸出
{"cols":[{"label":"Name","type":"string"},{"label":"Description","type":"string"},{"label":"Start","type":"date"},{"label":"End","type":"date"},{"role":"style","type":"string"}],"rows":
[{"c":[{"v":"Sample Name"},{"v":"Sample Desc"},{"v":"Date(2014,09,09,0,0,0)"},{"v":"Date(2014,09,09,1,0,0)"},{"v":"#124T9E"}]},
這似乎很大,但我怎麼能在P實現它惠普陣列?像這樣: http://paste.ubuntu.com/8256849/ – plaidshirt 2014-09-05 06:16:02
感謝您的更新! – plaidshirt 2014-09-06 20:23:43
我可以將顏色代碼存儲在簡單變量中嗎? $ color ='#ef8602'; – plaidshirt 2014-09-08 05:57:34