Column chart question

17 views
Skip to first unread message

Chun-Ling Chen

unread,
Apr 8, 2016, 2:50:13 AM4/8/16
to Google Visualization API
Have a question about whether we can have mutiple line in the 'Element':
https://developers.google.com/chart/interactive/docs/gallery/columnchart#coloring-columns
ex: 
       var data = google.visualization.arrayToDataTable([
         ['Element', 'Density', { role: 'style' }],
         ['Copper', 8.94, '#b87333'],            // RGB value
         ['Silver', 10.49, 'silver'],            // English color name
         ['Gold', 19.30, 'gold'],

       ['Platinum', 21.45, 'color: #e5e4e2' ], // CSS-style declaration
      ]);
we push 'Copper', 'Silver', 'Gold', 'Platinum' in the row label. Is there any way to push a object or json, etc to the label?
(such as push ['Copper', 8.94, '15%'] into 'Element')
ie: want to have row display:

After:
Copper   Silver   Gold   Platinum
 8.94     10.49    19.3    21.45
  15%      20%      30%     35%      

Before:
Copper Silver Gold Platinum

Thanks!

Reply all
Reply to author
Forward
0 new messages