score:0

Accepted answer

highcharts expects a certain structure for the values/names in a point.

see series.data in the api where you can find the following structure:

data: [{
    x: 1,
    y: 10,
    name: "point2",
    color: "#00ff00"
}, {
   x: 1,
   y: 6,
   name: "point1",
   color: "#ff00ff"
}]

so if you change your point buildup to:

var myitem = {
    y: result[i].numberofkittens,
    x: result[i].timeofbirth,
    name: result[i].mummykittenname
};

highchartdata.push(myitem);

it should work.

then you will need to format the tooltip to your liking, see highcharts api on tooltips. where this is the key takeaway:

this.point (not shared) / this.points[i].point (shared)

the point object. the point name, if defined, is available through this.point.name.

the above is valid for a line graph and most other graphs, however, some graphs take different options for the points.


Related Query

More Query from same tag