In this blog post I will show you how to create a template for setting colors and font styles for all your Displayr visualizations. This will save you having to manually create or copy and paste your visualizations to retain your style settings.
Creating your template
You can create your template by going to Insert > Utilities > Visualization > Create Template. This will then give you a preview of all the color, chart, and number font styles that you can set for your visualizations.
Setting your colors
We will start by defining the color palette. You can choose from several predefined or custom color settings. I will cover the custom color options for this example.
Under the Inputs tab on the right, the Custom palette setting allows you to enter the hex values of the desired colors, e.g., #ff0000 (red) and #008040 (green). This, in turn, updates the preview to show the alternating colors I selected.
The Custom gradient setting, in contrast, allows you to transition from one color to another by setting the start and end colors. You also have more advanced options for specifying hex and RGB values under the color picker's More Colors option. By keeping the same colors, the preview will now return a color gradient from red to green.
A further custom setting is Named colors. This is designed for when you want to use defined colors for specifically named items in your visualization, e.g., a brand list.
To use this setting, you should do the following:
- Set the default color for unnamed values
- Change the Specify colors using drop-down if necessary – I will keep the color picker option here
- Enter the name of the first item you want to color in the 'Color name 1' field
- Select the color using the 'Color 1' color picker
- Repeat for 'Color name 2' and so on until you have defined all items
Above I have chosen custom colors for 'Brand 1' and 'Brand 2', respectively. This means any visualization using this template that has these labels will be colored accordingly.
Setting your chart and number fonts
On the Chart fonts tab, you can set global font styles or make changes specific to various chart labels, such as data labels, legends, and X and Y axis titles.
Below I have updated the global font size, changed the title font to 'Century Gothic' and blue, and adjusted its font size.
The Number fonts tab includes similar options, but these are for single number-based visualizations.
Using the visualization template
Below I have a simple area chart using our small multiples feature, which compares the performance of two brands over the year.
I will now show you how to apply a template to this visualization. If you select your visualization, on the right, you need to do the following:
- Under Chart > APPEARANCE > Use template, select your template.
- Under DATA SERIES > Color palette ensure Default or template settings is selected.
Once calculated, your visualization will now apply the color and font settings from your template. In this example, I have used the Named colors setting to specify the brand colors.
This functionality also allows you to create multiple templates. It's just a matter of linking the appropriate template to your visualization. Furthermore, any update to your template settings will flow through to all visualizations that use this template.