0

I'm using highcharts. Here is a screenshot of it.

enter image description here

The data that I gave are like this:

"1": {
      "Peoples": {
          "Very high": 0,
          "High": 3,
          "Moderate": 7,
          "Low": 1,
          "Very low": 1
      }
    }

I don't want to change this order, but on the graph, there is an alphabetical order and I want to remove it. I tried to add an index but nothing changes. Can somebody help me I am stuck

Mike Zavarello
  • 3,514
  • 4
  • 29
  • 43
  • 1
    Highcharts doesn't sort categories and this is not a correct series or data format for Highcharts. Could you post a minimal, verifiable, complete demo? How is your data parsed before using it in Highcharts? – Kacper Madej Jun 03 '16 at 13:08

1 Answers1

2

Without seeing the complete code for your chart, I would recommend you structure your code as follows.

Define the x-axis labels as categories. They will be arranged precisely as you order them in the categories array:

    xAxis: {
        categories: ['Very high','High','Moderate','Low','Very low']
    },

Then, arrange your series data to match the order of the categories:

    series: [{
        data: [0,3,7,1,1]
    }]

Here's a sample fiddle with your categories and data: http://jsfiddle.net/brightmatrix/5c51u9o2/

I hope this helps!

enter image description here

Mike Zavarello
  • 3,514
  • 4
  • 29
  • 43