Highcharts test tool

by Torstein Hønsi

HTML

<script src="http://github.highcharts.com/highcharts.js"></script>

<div id="container"></div>

CSS

#container {
    min-width: 300px;
    max-width: 800px;
    height: 300px;
    margin: 1em auto;
}

JavaScript

Highcharts.wrap(Highcharts.Tooltip.prototype, 'bodyFormatter', function (proceed, items) {
    items.sort(function (a, b) {
        return b.y - a.y;
    });
    return proceed.call(this, items);
});


var options = {
	"yAxis": {
		"title": {
			"text": "FIDE Rating"
		}
	},
	"legend": {
		"layout": "vertical",
		"align": "right",
		"verticalAlign": "middle"
	},
	"chart": {
		"type": "line"
	},
	"title": {
		"text": "Carlsen's and Anand's chess rating over time"
	},
	"subtitle": {
		"text": "Source: www.fide.com"
	},
	"plotOptions": {
		"series": {
			"marker": {
				"radius": 2
			}
		}
	},
	"tooltip": {
		"shared": true
	},
	"xAxis": {
		"type": "datetime"
	},
	"series": [
		{
			"index": 0,
			"name": "Magnus Carlsen",
			"data":...