winston / google_visualr

A Ruby Gem for the Google Visualization API. Write Ruby code. Generate Javascript. Display a Google Chart.

Home Page:http://googlevisualr.heroku.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Control the specific colors for the bars.

wbasmayor opened this issue · comments

Perhaps this feature can be added someday with the next version? I currently there is no way to mimic this behavior for visualr.

 // from https://developers.google.com/chart/interactive/docs/gallery/columnchart#Colors
  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
  ]);

nevermind, it seems it's supported already in the roles

e.g.

data_table.new_column('string' , nil, nil, 'style')

is this closed? I can't seem to change the colors of my bars.

data_table.new_column('string', 'category')
data_table.new_column('number', 'value')

data_table.add_rows(['Fit', 3000])
data_table.add_rows(['Unfit', 320])

Where will I add to change column chart colors?

@iamarmanjon Do you mind showing your code here? Thanks.

Hi Winston,

We already fixed it, didn't know that set_column method has 5 params,
didn't know that there was an ID.

On Fri, Mar 13, 2015 at 3:59 PM, Winston notifications@github.com wrote:

@iamarmanjon https://github.com/iamarmanjon Do you mind showing your
code here? Thanks.


Reply to this email directly or view it on GitHub
#80 (comment)
.

Great! :)