Different color for each bar in Google Chart

23 views
Skip to first unread message

swaroop komma

unread,
Jun 21, 2018, 5:33:24 AM6/21/18
to Google Visualization API

I am using Google Column Chart for creating column chart for my application. I would like to be able to have different colors for each bar. I am inserting the colors attribute into the options variable but it's not working.

Can anyone help me on this?


My fiddle

Setya Djajadinata

unread,
Jun 21, 2018, 8:40:21 AM6/21/18
to google-visua...@googlegroups.com
Hi,

You have to configure it along with your data with 'style' role.

Regards.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/a801a2f6-ed04-4dfc-8163-c2ddf197a441%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Srinivasulu Palla

unread,
Jun 21, 2018, 9:14:56 AM6/21/18
to Google Visualization API
Can you send your fiddle link again, the link you provided is not working.

Setya Djajadinata

unread,
Jun 21, 2018, 12:19:25 PM6/21/18
to google-visua...@googlegroups.com
Hi,


It's bar chart but the principle is the same.

Regards.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

Srinivasulu Palla

unread,
Jun 21, 2018, 12:29:07 PM6/21/18
to Google Visualization API
You were doing all correct.
replace your code with the below one:

These lines are from 9 - 11:

    ['Item 1', 0.429, '#00D200'],
    ['Item 2', 0.286, '#004dd1'],
    ['Item 3', 0.386, '#d10080']

Try and let me know.

On Thursday, June 21, 2018 at 12:19:25 PM UTC-4, Jeff Poslinski wrote:
Hi,


It's bar chart but the principle is the same.

Regards.
On Thu, Jun 21, 2018 at 8:14 PM, Srinivasulu Palla <pnv.sr...@gmail.com> wrote:
Can you send your fiddle link again, the link you provided is not working.

On Thursday, June 21, 2018 at 5:33:24 AM UTC-4, swaroop komma wrote:

I am using Google Column Chart for creating column chart for my application. I would like to be able to have different colors for each bar. I am inserting the colors attribute into the options variable but it's not working.

Can anyone help me on this?


My fiddle

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages