Jump to content

Setting the chart colours even if no data


calathea

Recommended Posts

I am trying to make some monthly pie charts where there is sometimes 3 and sometimes 4 segments. The data would look something like

May

A         10

B        34

C        54

D        5

 

June

A        23

C        76

D        122

What i would like is to be able to set the colours for A,B,C and D so that A would always be Red, B would be Yellow, C Green and D Blue.

By default the colours are orderd by segment, first second third etc but this makes it hard to spot trends in data over a number of months.

 

Any ideas?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

calathea,

 

It's a very common requirement. Unfortunately, there is no simple answer. It is possible to achieve this with a chart theme (chart themes replace the deprecated chart customizers). But that will require some Java coding.

 

If your data is coming from a database then the easiest solution is probably to use an OUTER JOIN to ensure that you always get a row for B. Just be careful to convert B's NULL value to 0 so the chart doesn't gag on the NULL.

 

Regards,
Matt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...