Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

257
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda