Using Color Functions and Variables to Set Chart Colors

BrightQVYou may have noticed when assigning colors to charts, they do not “stick”. That’s because the charts can’t have any missing elements in them. I’ve found two great posts on how to fix the colors, and make maintenance easier.

Henric Cronström at QlikviewDesignBlog :

It is not uncommon that users want specific products or customers to be displayed in specific colors. The most obvious way to do this is to change the colors in the chart properties. This is in fact quite easy if you use the copy and paste functions found when you right-click a color button. Just copy one button and paste on another, and you have moved the color.

This way you can assign which color is to be used for the different values of the field. However, a prerequisite for this to work is that the order of the field values doesn’t change.

A more robust way is to use color functions. Usually, you want to set the color of a bar, line or bubble and this is done by using the “Background Color” on the Expression tab…

Barry Harmsen at Qlikfix:

A short tip today on how to ensure that dimensions in different charts get assigned the same color, regardless of how the data is sorted or if dimensions are missing.

The trick to getting consistent dimension colors is to include the color data in your data source. In the example shown I have used the following source data.

Barry included a nice little QVW app to play with, and supported Excel data. Nice work all!


Get every new post delivered to your Inbox

Join other followers: