Bhagya Bhagya - 4 months ago 17x
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


For this you need to include library

include following library

<script src=""></script>