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

219
Views
How can I prevent Highcharts from displaying decimal intervals in between x-axis ticks?

When the chart loads, instead of just having the points on the x-axis of 1, 2, 3, etc. it includes 0.2, 0.4, 0.6, etc in between each integer point. I can't figure out how to get rid of the in-between tick marks.

Chart:

new Highcharts.chart('<some id>', {
chart: {
    plotBackgroundColor: null,
    plotBorderWidth: null,
    plotShadow: false,
    type: 'bar'
},
title: {
    text: '<some label>'
},
plotOptions: {
    bar: {
        stacking: 'normal'
    }
},
xAxis: {
    categories: categories,
    // tickInterval: 1,
    tickPositions: [0, 1, 2, 3, 4],
    labels: {
        step: 1
    }
},
yAxis: {
    min: 0,
    max: 4,
    title: {
        text: '<some title>'
    }
},
series: seriesData
})

It seems like it's just ignoring my tick mark settings. I've tried tickInterval w/out the positions specified, and nothing has even somewhat altered the x-axis from the default look. Even if I remove all the settings other than the category data, it looks the same. And yes, my interval is always [0,4] so there's no unbounded worries there.

Any ideas?

edit: It seems dependent on page size and the chart width... but how do I turn this setting off? As I increase and decrease the size of the page, it should never show decimals in between the integer tick marks.

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

0

I've reproduced your example and I believe you wanted to add your tickPositions property to the yAxis (in the bar series yAxis is horizontal by default, so you may have missed it).

  yAxis: {
    tickPositions: [0, 1, 2, 3, 4]
  },

Live Demo: https://jsfiddle.net/BlackLabel/v1f2d5mp/

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!