How to add custom label in Bar Chart visualisation?

I have a bar chart of Sales of 2024 and 2025 side by side. I want to have the growth percentage from 2024 to 2025 on the top of my bar chart. Do anyone have any idea to achieve this?

It’s a bit faffy, but here is how I would do it:

  1. Create a table calculation to calculate the % of previous. Assuming you are using non-pivoted data, and your year column is sorted in descending order, the expression would be: (${name_of_measure_field}-offset(${name_of_measure_field},1))/offset(${name_of_measure_field},1)
  2. Create a stacked bar chart, and hide the legend.
  3. Edit the Chart Config Editor to add this code:
{

  // Specify  whether or not data labels should be displayed. Series 1 =  the first column in the data table
  series: [{ // series 1
    dataLabels: {
      enabled: false
    },
  }, { // series 2
    dataLabels: {
      enabled: true,
      align: 'center', // can also be set to 'left' or 'right'
      verticalAlign: 'top', // can also be set to 'middle' or 'bottom'
      x: 0, // offset the horizontal position of label
      y: 0, // offset the vertical position of label
      format: '{(multiply y 100):,.1f}%', // specify format string e.g. to format to 2 decimal places replace 1f with 2f
      style: {
        fontSize: '12px',
        color: '#ffffff',
      },
    }
  }],

}

Hey,

Hope you’re keeping well.

Looker’s native bar chart visualization doesn’t allow adding completely custom labels directly on top of bars, but you can achieve this by creating a calculated field in your Explore that computes the growth percentage between the two years, then adding it as a separate series. In the visualization settings, enable “Series Labels” or “Value Labels” so the percentage displays above the bars. If you need more control over label placement or formatting, you can use a Looker custom visualization via the Looker Visualization API or export the data to Looker Studio, where text annotations can be positioned freely.

Thanks and regards,
Taz