Stacked Column Chart: a legend with custom colors

5,000 views
Skip to first unread message

Leonid Ganeline

unread,
Feb 3, 2015, 5:40:18 PM2/3/15
to google-visua...@googlegroups.com
Hello,
I need to create a Stacked Column Chart with custom colors.
The data compounded from the columns (Statuses) and rows (Types). I tried several methods but was unlucky, the legend and respective bar colors setup automatically. I want to set up the Status bars/legend with custom colors.
How to do this?

Thanks!

Sergey Grabkovsky

unread,
Feb 4, 2015, 9:53:11 AM2/4/15
to google-visua...@googlegroups.com
If you are using CoreCharts, you can set either the colors option to customize the palette or the series.<index>.color option to customize any individual series color.

The colors option should also work for the Material Bar Chart, however the series.color option does not work yet.

You can find the documentation for these options here: https://developers.google.com/chart/interactive/docs/gallery/columnchart

--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Leonid Ganeline

unread,
Mar 3, 2015, 6:03:36 PM3/3/15
to google-visua...@googlegroups.com
Sergey, thank you for help.
I still cannot set up colors for the columns. 
Now I'm trying to use Material Bar Chart:
  data.addColumn({ type: 'number', label: 'Failed Status', style: { color: 'red' } }); - doesn't work!

You mentioned the "color option". What is it?

Thanks,
Leonid


On Wednesday, 4 February 2015 06:53:11 UTC-8, Sergey wrote:
If you are using CoreCharts, you can set either the colors option to customize the palette or the series.<index>.color option to customize any individual series color.

The colors option should also work for the Material Bar Chart, however the series.color option does not work yet.

You can find the documentation for these options here: https://developers.google.com/chart/interactive/docs/gallery/columnchart

On Tue Feb 03 2015 at 5:40:21 PM Leonid Ganeline <leo.g...@gmail.com> wrote:
Hello,
I need to create a Stacked Column Chart with custom colors.
The data compounded from the columns (Statuses) and rows (Types). I tried several methods but was unlucky, the legend and respective bar colors setup automatically. I want to set up the Status bars/legend with custom colors.
How to do this?

Thanks!

--
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.

Sergey Grabkovsky

unread,
Mar 4, 2015, 7:57:10 AM3/4/15
to google-visua...@googlegroups.com
The style role is not yet supported for the Material Charts, and besides, you're not using it correctly. Please look at the Column Chart documentation for an example of using it correctly. The "colors" option is also documented on that page. Effectively, it allows you to change the colors used by the palette for the chart. This option can be used like:
var options = {
colors: ['red', 'green', 'blue']
}
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

Leonid Ganeline

unread,
Mar 4, 2015, 11:52:54 AM3/4/15
to google-visua...@googlegroups.com
Got it. It works! Thanks a lot, Sergey!
I switched back from the Material Chart and it works with 
var options = {
colors: ['red', 'green', 'blue']
}

On Wednesday, 4 March 2015 04:57:10 UTC-8, Sergey wrote:
The style role is not yet supported for the Material Charts, and besides, you're not using it correctly. Please look at the Column Chart documentation for an example of using it correctly. The "colors" option is also documented on that page. Effectively, it allows you to change the colors used by the palette for the chart. This option can be used like:
var options = {
colors: ['red', 'green', 'blue']
}
On Tue, Mar 3, 2015 at 6:03 PM Leonid Ganeline <leo.g...@gmail.com> wrote:
Sergey, thank you for help.
I still cannot set up colors for the columns. 
Now I'm trying to use Material Bar Chart:
  data.addColumn({ type: 'number', label: 'Failed Status', style: { color: 'red' } }); - doesn't work!

You mentioned the "color option". What is it?

Thanks,
Leonid


On Wednesday, 4 February 2015 06:53:11 UTC-8, Sergey wrote:
If you are using CoreCharts, you can set either the colors option to customize the palette or the series.<index>.color option to customize any individual series color.

The colors option should also work for the Material Bar Chart, however the series.color option does not work yet.

You can find the documentation for these options here: https://developers.google.com/chart/interactive/docs/gallery/columnchart

On Tue Feb 03 2015 at 5:40:21 PM Leonid Ganeline <leo.g...@gmail.com> wrote:
Hello,
I need to create a Stacked Column Chart with custom colors.
The data compounded from the columns (Statuses) and rows (Types). I tried several methods but was unlucky, the legend and respective bar colors setup automatically. I want to set up the Status bars/legend with custom colors.
How to do this?

Thanks!

--
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+unsubscr...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages