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

331
Views
Apexcharts - How to change the y-axis step size value and tooltip not showing string

I am using apexcharts.js. I am using the below code on my page. I have two issues

  1. How to change the y-axis step size value? As of now, it's talking 20.

enter image description here

  1. In the tooltip, I am not getting the string. It's only displaying the number.

enter image description here

var options = {
  series: [{
    data: ["30 lac", "40 lac", "35 lac", "50 lac", "49 lac", "60 lac", "70 lac", "91 lac", "125 lac"]
  }],
  chart: {
    height: 350,
    type: 'bar',
    events: {
      click: function(chart, w, e) {
        // console.log(chart, w, e)
      }
    }
  },
  //colors: colors,
  plotOptions: {
    bar: {
      columnWidth: '45%',
      distributed: true,
    }
  },
  dataLabels: {
    enabled: false
  },
  legend: {
    show: false
  },
  xaxis: {
    categories: [10, 20, 30, 40, 50, 60, 70, 80, 90],
    labels: {
      style: {
        // colors: colors,
        fontSize: '12px'
      }
    }
  },
  yaxis: {
    min: 0,
    max: 200
  }
};

var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
#chart {
  max-width: 650px;
  margin: 35px auto;
}
<div id="chart"></div>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. You can change number of intervals with tickAmount https://apexcharts.com/docs/options/yaxis/#tickAmount

  2. Use tooltip formatter https://apexcharts.com/docs/options/tooltip/#yformatter

      var options = {
    series: [{
      data: ["30 lac", "40 lac", "35 lac", "50 lac", "49 lac", "60 lac", "70 lac", "91 lac", "125 lac"]
    }],
    chart: {
      height: 350,
      type: 'bar',
      events: {
        click: function (chart, w, e) {
          // console.log(chart, w, e)
        }
      }
    },
    //colors: colors,
    plotOptions: {
      bar: {
        columnWidth: '45%',
        distributed: true,
      }
    },
    dataLabels: {
      enabled: false
    },
    legend: {
      show: false
    },
    tooltip: {
      y: {
        formatter: function (value, {dataPointIndex, w}) {
          return w.config.series[0].data[dataPointIndex]
          //or you can judt add 'lac' to value
          //return `${value} lac`
        }
      }
    },
    xaxis: {
      categories: [10, 20, 30, 40, 50, 60, 70, 80, 90],
      labels: {
        style: {
          // colors: colors,
          fontSize: '12px'
        }
      }
    },
    yaxis: {
      min: 0,
      max: 200,
      tickAmount: 4,
    }
  };

  var chart = new ApexCharts(document.querySelector("#chart"), options);
  chart.render();
#chart {
  max-width: 650px;
  margin: 35px auto;
}
<div id="chart"></div>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>

about 4 years ago · Juan Pablo Isaza Report
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!