Qlik Data Visualization Extension: Introducing Custom Drawing Over Custom Theme

Our Qlik Charts Extension now allows a custom renderer to be set for certain chart types! We’ll show you how to make use of this new great feature in your Qlik data visualization practice, implementing custom drawing over a custom theme.

Before we begin, please note: We recommend getting acquainted with the custom drawing documentation of AnyChart JS Charts if you never worked with it before. When you do that, it will be easier for you to understand what the custom drawing functions are and how to use them right and best.

Custom Renderer Overview

Setting up a custom renderer became possible thanks to the updates we pushed live to the AnyChart JavaScript charting library and our Qlik Sense extension last year. It works for all the basic chart types, pie charts, and gauge charts’ bar pointer.

The main thing to note is that the code of a custom renderer is placed in a custom theme, where one can also change any other settings such as palette, background color, font, and so on.

The code of any theme starts with the following pattern:

In the code above, customTheme is the name of a custom theme. All the other settings are in the object which is empty now.

Setting Up Custom Renderer for Advanced Qlik Data Visualization

(1) Palette and Default Background Color

First of all, add a palette and a default background color to be applied to all the charts.

Now, let’s see how to make it work for several chart types.

(2) Custom Renderer for Column Chart

For example, here’s how to add a custom renderer for the column series type. This particular drawer will be used by all the basic charts with a column series, making corners of all the columns rounded like this:

To achieve this result in your Qlik data visualization, we need to include the following custom drawing function:

That might seem complex at first. But when you look closer, that’s a simple work with the AnyChart Graphics Engine.

For any other basic chart series, the code starts with the same lines. For an area series, for example, it should be:

(3) Custom Renderer for Pie Chart

The same technique can be applied to a pie chart. It’s a single-series chart, so its API is a bit different from a multi-series one. A pie with a custom renderer is shown in the picture below. You can find the code for this renderer in the custom AnyChart theme file.

(4) Custom Renderer for Gauge Chart

And it works fine just like that for gauges too. The picture below shows a sample custom drawing in a circular gauge. You can find the code for this renderer in the custom AnyChart theme file.

For each chart type, the approach is the same.

If you want to achieve something you can’t do, please reach out to our Support Team and we will be happy to help.

Custom Theme Usage

The custom theme code for the charts shown above can be downloaded here: AnyChart Sample Custom Theme.

To add a custom theme to the AnyChart Qlik Extension, edit the file at ..\Users\\Documents\Qlik\Sense\Extensions\AnyChart-Qlik\lib\themes-combined.js by putting the code of your custom theme at the end.

To use the theme by default in the future, edit the config.js file at ..\Users\\Documents\Qlik\Sense\Extensions\AnyChart-Qlik. There is a property with an empty value at the end of the file. Set the name of your custom theme there so it looks: defaultTheme: "customTheme". This name should be the same as the name of the custom theme.

When all this is done, you just need to launch Qlik Sense and you’ll be able to use our Qlik data visualization extension along with the custom rendered charts.

The AnyChart Qlik data visualization extension is a powerful tool, and we continue its active development to make it even better. So if you have any questions or more suggestions about how it can be improved, feel free to share. You can send a message to AnyChart Support Team or simply leave a comment below.

Don’t hesitate to ask and suggest. We’re always glad to work with your feedback as it greatly helps us make our products better.

Originally published at www.anychart.com on January 16, 2019.

Cross-platform JavaScript/HTML5 data visualization solutions, flexible JS charts libraries & Qlik Sense extensions for all your dataviz needs: www.anychart.com