Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

446
Views
Is it possible to display the label of each bar outside the upper bound of a bar chart using react-apexcharts?

I am editing a bar chart that should display the values ​​above each bar. I need the values ​​to be displayed outside the upper limit of the chart. I managed to get this graph:

chart i have

However, I need the values ​​to be displayed as if it were a double x-axis (my understanding is that apexchart only has double-axis implemented for the y-axis). In a nutshell, I need this:

chart i need

I managed to move the labels to the top using "offsety" inside "datalabels" in my chart options, but they stay inside the chart, sitting right on the line of the maximum value of the y-axis (and I need them to be located above this line ).

These are my chart options:

  const options = {
    grid: {
      position: 'front'
    },
    legend:{
      position: "bottom",
      horizontalAlign: "right",
      offsetY: 10
    },
    colors:["#59ad30","#134E32","#3A7B05","#59AD31"],
    chart: {
      toolbar:{show:false},
      type: 'bar',
      height: 350
    },
    plotOptions: {
      bar: {
        dataLabels: {
          position: 'top',
        },
        columnWidth: `${categorias.length*13}%`,
      },
    },
    dataLabels: {
      enabled: true,
      formatter: function (val, opts) {
        return `${val.toFixed(1)} Lt`
      },
      offsetY: -1000,
      style: {
        fontSize: '11px',
        fontFamily: 'Roboto, Helvetica, Arial, sans-serif',
        fontWeight: undefined,
        colors: ["#000000"]
    },
    },
    stroke: {
      show: true,
      width: 2,
      colors: ['transparent']
    },
    xaxis: {
      categories: categorias,
      labels:{
        style: {
          fontWeight: "bold",
      },
      }
    },
    yaxis: {
      labels: {
        formatter: function(val) {
          return `${Math.floor(val)} Lt`
        }
      }
    },
    fill: {
      opacity: 1
    },
    tooltip: {
      y: {
        formatter: function (val) {
          return `${val} lts`
        }
      }
    }
  };

apexcharts version: "^3.35.3"

react-apexcharts version: "^1.4.0"

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!