Bhagya Bhagya - 1 year ago 103
JSON Question

How to parse json and give to category in highcharts

I am using highcharts and want to parse JSON and assign to categories part

var chartData = {

"chart" :[
{name: "kolkata",categories: ["male", "female"]},
{name: "Mumbai",categories: ["male", "female"]}


I tired below

var category = [];
var Count = chartData.chart;
for (var i=0; i< Count.length; i++) {
category.push({name : chartData.chart[i].name, categories : chartData.chart[i].categories})


xAxis: {

categories: category

but its not coming properly on x axis what to do

Answer Source

For this you need to include library

include following library

<script src=""></script>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download