Assign individual colors to items in series

9 views
Skip to first unread message

Thomas V

unread,
Aug 3, 2009, 5:33:07 AM8/3/09
to plotkit
Hi there,

I have been playing around with the Plotkit toolset for a couple of
hours and while I love it I find I lack some control over the coloring
of the graph. I'm hoping that someone can help me with this.

I would like to assign a specific color to each of the items in a Pie
chart. Is this possible? I'd expect that by extension I would be able
to do the same for bar charts since a Pie chart is essentially the
same with just one series and not several.

Thanks.
Thomas V

Thomas V

unread,
Aug 3, 2009, 9:45:55 AM8/3/09
to plotkit
Hi there,

I've solved the issue using the following option settings:

var colors = [
Color.fromName("red"),
Color.fromName("green"),
Color.fromName("yellow")
];
var params = {
shouldFill: true,
colorScheme: colors,
drawBackground: false
};

This works fine for a pie chart. I haven't tested it with bar graphs.
Incidentally I have a couple of other questions but that will be for
another post.

Kind regards,
Thomas Vanparys
Reply all
Reply to author
Forward
0 new messages