Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

218
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda