score:2

It works slow, because you are using Highcharts, where displaying 2000 points isn't the best idea. I suggest to use Highstock instead, where points are grouped to display average/sum/etc. of points group.

However, here you are demo

And code: http://jsfiddle.net/me5Uf/2/

    $('#container').highcharts({
        xAxis: {
            type: 'datetime'
        },
        plotOptions: {
            series: {
                marker: {
                    enabled: false
                },
                dataLabels: {
                    enabled: true,
                    formatter: function () {
                        if (this.point.options.showLabel) {
                            return this.y;
                        }
                        return null;
                    }
                }
            }
        },
        series: [{
            name: 'AAPL',
            data: data,
            tooltip: {
                valueDecimals: 2
            }
        }]
    }, callback);
});

function callback(chart) {
    var series = chart.series[0],
        points = series.points,
        pLen = points.length,
        i = 0,
        lastIndex = pLen - 1,
        minIndex = series.processedYData.indexOf(series.dataMin),
        maxIndex = series.processedYData.indexOf(series.dataMax);

    points[minIndex].options.showLabel = true;
    points[maxIndex].options.showLabel = true;
    points[lastIndex].options.showLabel = true;
    series.isDirty = true;
    chart.redraw();
}

Related Query

More Query from same tag