BookmarkSubscribeRSS Feed
Highlighted
TWE

Occasional Contributor

Joined:

Oct 8, 2018

Constant legend color

Hi,

 

I build a graph (bar chart) and changed the legend color (and therfore the bar color) by right-clicking and copy the script

SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				8,
				Properties( 0, {Fill Color( 10 )}, Item ID( "category", 1 ) ),

This is part of a bigger graph.

 

When I run the script and include a local data filter, the color for the categories are changing. This is detrimental because I want to have the same color for a category independently of a filter.

 

Kind regards,

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
stephen_pearson

Community Trekker

Joined:

Oct 6, 2014

Solution

Re: Constant legend color

You can lock the legend colours by using the column property - Value Colors. This will ensure whatever platform you are and what ever local data filter is applied the colours for each group will not change.
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: Constant legend color

You should be able to unclick the "Include" checkbox in the filter, to allow the chart's colors to stay the same. The "Include" checkbox tells the filter to Include/Exclude values in calculating the chart, so when it is not checked, it uses all of the values, thus the colors are calculated the save from filtered value to filtered value.
Jim
3 REPLIES
stephen_pearson

Community Trekker

Joined:

Oct 6, 2014

Solution

Re: Constant legend color

You can lock the legend colours by using the column property - Value Colors. This will ensure whatever platform you are and what ever local data filter is applied the colours for each group will not change.
TWE

Occasional Contributor

Joined:

Oct 8, 2018

Re: Constant legend color

Thanks,

I'm afraid that the answer of the next question is obviously, but how can I change all values in a column to a single color, via script?

txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: Constant legend color

You should be able to unclick the "Include" checkbox in the filter, to allow the chart's colors to stay the same. The "Include" checkbox tells the filter to Include/Exclude values in calculating the chart, so when it is not checked, it uses all of the values, thus the colors are calculated the save from filtered value to filtered value.
Jim