Accepted answer

You can set your points as follows:


        name: key_g,
        y: val_g



I know this question has been solved. but the map function for array might be a good choice in these cases, I love map in functional language!

data = [{"y":"Mr","x":"145"},{"y":"Miss","x":"43"},

var series ={ return parseInt(e.x); });

.... hight chart ....


By rearranging my Json to have "name" and "y" as the keys i was able to make progress i.e:


Then by looping through the json data and parsing the "y" value as a int with the function parseInt() in the JS i was able to get my desired result...

function genderData() {
$.getJSON('/statsboard/gender', function(data_g) {
$.each(data_g, function(key_g, val_g) {
    obj_g = val_g;
        y: parseInt(obj_g.y)


The forms:

[{"name": "Mr", "y": 145}, ...]


[["Mr", 145], ...]

will work. Notice the second form is an array of arrays not an array of objects (you were close).

See basic-pie demo (click view options and scroll down to data), docs, and series.addPoint docs for more info.

If you make the server side return the data in one of the two above forms you can just do:

function genderData() {
  $.getJSON('/statsboard/gender', function(data_g) {
    genderChart.series[0].setData(data_g, true);

Related Query

More Query from same tag