Highcharts Demo

author(s): Torstein Hønsi

by prakhar230792

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

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

CSS

#container {
	min-width: 310px;
	max-width: 800px;
	height: 400px;
	margin: 0 auto
}

JavaScript

Highcharts.chart('container', {
	"type": "svg",
	"title": {
		"text": null
	},
	"chart": {
		"type": "line"
	},
	"plotOptions": {
		"line": {
			"marker": {
				"enabled": false
			}
		},
		"series": {
			"showInLegend": "true"
		}
	},
	"legend": {
		"enabled": "true",
		"symbolRadius": 0,
		"align": "center",
		"verticalAlign": "bottom"
	},
	"tooltip": {
		"backgroundColor": "#5F5F5F",
		"borderColor": "#5F5F5F",
		"shadow": false,
		"style": {
			"color": "#FAFAFA",
			"opacity": 0.95
		}
	},
	"colors": [
		"#8CC350",
		"#5A6EAA",
		"#D755A5",
		"#1EBED7",
		"#F0A01E",
		"#9B8CE6",
		"#3CB5A0",
		"#3287D2",
		"#F0557D",
		"#C3D250",
		"#EB782D",
		"#78B4F5",
		"#5FAF69",
		"#AA5FA5",
		"#FA5A50",
		"#F5C841"
	],
	"xAxis": {
		"type": "datetime",
		"title": {}
	},
	"yAxis": {
		"type": "linear",
		"title": {}
	},
	"series": [
		{
			"name": "Benchmark S&P 500 Index",
			"data": [
				[
					1420050600000,
					170.97
				],
				[
					1435689000000,
					180.58
				],
				[
					1451586600000,
					200.15
				],
				[
					1467311400000,
					195.37
				],
				[
					1483209000000,
					210.25
				],
				[
					1498847400000,
					205
				],
				[
					1498847400000,
					140.29
				],
				[
					1514745000000,
					222.17
				],
				[
					1530383400000,
					230.05
				],
				[
					1546281000000,
					232.45
				]
			]
		},
		{
			"name": "Blue Chip Growth Fund",
			"data": [
				[
					1404153000000,
					150.78
				],
				[
					1420050600000,
					190.04
				],
				[
					1435689000000,
					199.19
				],
				[
					1451586600000,
					180.46
				],
				[
					1467311400000,
					200.13
				],
				[
					1483209000000,
					208.56
				],
				[
					1498847400000,
					218.45
				],
				[
					1514745000000,
					230.17
				],
				[
					1530383400000,
					222.23
				],
				[
					1546281000000,
					238.29
				]
			]
		}
	],
	"credits": {
		"enabled": false
	}
});