score:0

if you want to add a custom property to your data to have it show in the tooltip you need to add to your sourcedata array. psuedo code below:

var sourcedata = [ 
                <?php
                            if (($handle = fopen("data.csv", "r")) !== false) {
                                $i=0;
                                $len = count(file('data.csv'));
                                while (($data = fgetcsv($handle, 1000, ",")) !== false) {
                                        if($i==$len - 1){
                                            echo "{x: ".$i.", y: ".$data[1].", extprop: '".$data[4]."'}";
                                            }else{
                                            echo "{x: ".$i.", y: ".$data[1].", extprop: '".$data[4]."'}," ;
                                            }
                                    $i++;
                                }
                                    fclose($handle);
                                }
                    ?>

                ];

you need to change the point object to the {...} format instead of [...]. where y is the yvalue and extprop is some extended info you want (this property name can be any non-reserved name).

then in your tooltip you need to add this extprop:

tooltip: {
    formatter: function () {
        console.log(this.point.extprop);
        var s = 'the value for <b>' + this.x +
            '</b> is <b>' + this.y + '</b>';
        if (this.point.extprop) {
           s += 'for <b>' + this.point.extprop + '</b>';
        }
        return s;
    }
}

Related Query

More Query from same tag