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

255
Views
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 answers
Answer question

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 Report

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 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!