Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Change color of trend line

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]

7 Replies
johnw
Not applicable

Re: Change color of trend line

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
Not applicable

Change color of trend line

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
Not applicable

Change color of trend line

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
Not applicable

Re: Change color of trend line

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

Re: Change color of trend line

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

Not applicable

Re: Change color of trend line

Thanks a lot Swuehl, this tip helped a lot.

erjohnso
Not applicable

Re: Change color of trend line

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.