Add different color on last column of the chart
preranalanjile opened this issue · comments
Hi,
I want to apply different color on last column of the chart.
I have 10 columns in chart, 9 columns should have one color and 10th column should have other color.
For example,
var data = GoogleVisualr::DataTable.new
data.new_column('string', 'Year' )
data.new_column('number', 'Sale' )
data_table.add_rows([
['2004', 1000],
['2005', 1170],
['2006', 660],
['2007', 1030]
]);
For 2004, 2005, 2006 columns, I want to show sales in "red" color and for 2007, sale should be in "black" color.
Does google_visualr have any option for this ?
Please tell me how to change the color of last column in the chart.
Thank you,
Prerana
Do take a look at DataTable's color formatters. Those should help you.
- https://developers.google.com/chart/interactive/docs/reference#formatters
- http://googlevisualr.herokuapp.com/docs/formatters
Thank you.