How can I position the Bar chart key and define the correct colors?

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Antonio Vianello on 22nd March 2014
Hi there!

I have a stacked bar chart with many elements for each bar.
How can I avoid the keys box above the chart span horizontally and exceed the canvas area? Can I put the box on the right of the graph?
Another question.
The bars and the keys show a distinct color (i.e. blue, green, yellow, dark blue, light blue) for the first 5 elements only; from the sixth onwards the keys color is black and the corresponding bar elements is shown in green.
How can I dinamically assign colors to the bars and keys based on the number of elements in the stacked bar?

Thanks in advance
Posted by Richard on 24th March 2014
Hi there,

You can put the key on the right of the chart in the gutter - though it may still extend off-canvas if the entries are long. You could use the HTML key to have your key as part of the page instead of as a canvas element.

For the colours you can just have a "master" array containing lots of colours and then pick as many colours as you need from that array.

Or simply assign all of those colours to the bar chart and the unneeded ones won't get used.


Add a reply

« Back to message list