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

256
Visualizações
very simple highcharts column graph with two arrays

I'm trying to make a simple highcharts column graph. The documentation on the highcharts website is more complex than I need and I just can't figure out how to use a simple array for the y axis. This is my code so far.

var species=[Acer rubrum,Tsuga canadensis,Pinus strobus];
var counts=[17746,10384,9986];

Highcharts.chart('container', {
  chart: {
    type: 'column'
  },
  title: {
    text: 'Top 10 Species'
  },
  subtitle: {
    text: 'by basal area'
  },
  xAxis: {
    categories: species,
    title: {
      text: 'Species'
    }
  },
  yAxis: {
    min: 0

  },


  series: [{ name: null, data: topSpecies }]
});
}

This gives me the correct species listed along the x-axis, but I want the counts along the y and currently it is blank and there are no columns. Any help is appreciated!

Thank you.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You have used the wrong variable for series data. Use counts instead of topSpecies.

var species = ['Acer rubrum', 'Tsuga canadensis', 'Pinus strobus'];
var counts = [17746, 10384, 9986];

Highcharts.chart('container', {
    ...,
    series: [{
        name: null,
        data: counts
    }]
});

Live demo: http://jsfiddle.net/BlackLabel/yfesv93x/

API Reference: https://api.highcharts.com/highcharts/series.column.data

about 4 years ago · Juan Pablo Isaza Relatório

0

Well for starters you haven't assigned your Y-axis any categories.

yAxis: {
categories: counts,

},

see the fiddle. https://jsfiddle.net/odrga0hL/3/

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