How to add custom prefixes and suffixes per series

Across most of our templates, you can add a prefix to your series, but these settings will apply to all of your data. 

But what if some of your data represents currencies, while other columns are percentages? Follow this help doc to add custom suffixes and prefixes to your popups or panels that apply to specific columns in your data.

    1
    First, make sure that the series you want to add the same suffix or prefix to have, at least, one word in common in the header that is not repeated on any other series. For example, in the data below, we've split the data into "Percentage" and "GBP".
    2
    In the Preview tab, set the Popup content to be Custom

    3
    In the Popup custom header field you can add the column names by typing {{SERIES}}. In the Popup custom main content field you'll need to add the following code with some variations to fit your data. Click on the highlighted sections to display an explanation of what the code is doing:
    In this case, we're adding a suffix of "%" to the columns that contain the Percent class, that is, that have "Percent" in their column name. At the same time, we're adding a suffix of "million" and a prefix of "£" to the series with the class GBP

    TIP: Make sure you edit the name of the classes and the elements to append to match your data.

The final chart will display the prefixes and suffixes set up in the code through the popups but these won't show if the Labels on data points option is toggled on. Change the dropdown filter and explore the popups on the chart below to see the code in action.