Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change color of trend line

Hello,

i would like to change the color of trend line in a bar chart.

Is it possible?

Thank you

Joao

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think the color can be set / changed in the Colors tab. Not quite sure about the logic (which color id in the sequence is used for the trend line, especially with multiple dimensions, but you can probably spot the color quite easily).

Then, you probably need to change the background color of your expression back to the color you want (I assume it should be different from the trend line). You can do this in expression tab, open expression attributes by clicking on the plus sign and add a color expression to background color).

[At least with QV11, I noticed that you could set colors e.g. for Totals and others in Colors tab. Why not for trend lines? I don't know]

View solution in original post

7 Replies
johnw
Champion III
Champion III

I don't think it is, but I could be wrong.  If you really need it to be a different color, you could calculate your own trend line as a second expression.  In the attached file, the first chart demonstrates calculating your own trend line, here in the context of forecasting sales as a linear trend from recent values.

Edit: Hit post instead of attach.  File should now be attached.

swuehl
MVP
MVP

I think the color can be set / changed in the Colors tab. Not quite sure about the logic (which color id in the sequence is used for the trend line, especially with multiple dimensions, but you can probably spot the color quite easily).

Then, you probably need to change the background color of your expression back to the color you want (I assume it should be different from the trend line). You can do this in expression tab, open expression attributes by clicking on the plus sign and add a color expression to background color).

[At least with QV11, I noticed that you could set colors e.g. for Totals and others in Colors tab. Why not for trend lines? I don't know]

johnw
Champion III
Champion III

Interesting.  I hadn't realized that the trend line ignored the background color expression.  I don't know if I consider that a feature or a design flaw, but it does give us an easier solution to this specific problem.

jjordaan
Partner - Specialist
Partner - Specialist

Hello everyone,

My reaction is a bit late but what I did is I changed the color of the background property in the expression with a RGB code.

This changes the color of the bars but not the color of the trendline.

I hope this helps.

Not applicable
Author

Change the color of total in Colors tab . Special Segment >Total

Not applicable
Author

Thanks a lot Swuehl, this tip helped a lot.

erjohnso
Creator
Creator

Had this same question... very simple and straightforward as noted above. Go to Properties > Colors and in the data appearance box, set the colors. The trendline color is represented by the first unused color in the set. So in a simple line graph, the line of the actual data points is represented by color 1 (default blue) and the trendline would be the second color (default red). Click on that red box to pull up the color pallet and change the color.