X-axis category name from string in series list

highcharts

Solution

As of HighCharts 3 you can use xAxis.type and set it to "category" for your desired behavior without having to specify the category names.

http://api.highcharts.com/highcharts#xAxis.type

I've edited the jFiddle to have the following:

xAxis: {
        type: "category"
    }

http://jsfiddle.net/H7zgb/22/

Problem

Is it possible to get the x-axis names from a string in my series list? I'm building this series list on the backend and would like to use the "New York", "LA" and "Chicago" as my x-axis category values. I would expect "New York", "LA" and "Chicago" as my x-axis labels, however, I'm getting -0.25 through 2.25. Thanks. http://jsfiddle.net/nicholasduffy/H7zgb/2/ ``` $(function () { var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'column' }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: false } } }, series: [{ "data": [ ["New York", 3570.5], ["LA", 50128.38], ["Chicago", 5281.22] ], "name": "Stuff" }, { "data": [ ["New York", 10140.84], ["LA", 21445.04], ["Chicago", 12957.77] ], "name": "Junk" }, { "data": [ ["New York", 65119.6], ["LA", 103118.6], ["Chicago", 78349.6] ], "name": "Other Stuff" }] }); ``` });

Original source