Highcharts Demo

author(s): Torstein Hønsi

by Max Shu

HTML

<script src="https://code.highcharts.com/highcharts.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" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'line'
    },
		title: {
			text: ''
		},
		yAxis: {
			tickInterval: 5,
		},
		xAxis: {
			reversed: false,
			categories: ['2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012', '2011', '2010', '2009'],
			tickLength: 5,
			labels: {
				formatter: function() {
					return this.value;
				},
			},
		},
		series: [{
			name: 'Место в рейтинге университетов России',
			data: [
				{ name: '7', y: 7 },
				{ name: '8', y: 8 },
				{ name: '9', y: 9 },
				{ name: '11', y: 11 },
				{ name: '10', y: 10 },
				{ name: '11', y: 11 },
				{ name: '9-10', y: 9 },
				{ name: '7-8', y: 7 },
				{ name: '8-9', y: 8 },
				{ name: '5', y: 5 },
				{ name: '5-6', y: 5 }
			],
		}],
		colors: ['#EBA438', '#D9112D', '#293BA3'],
		plotOptions: {
			line: {
			  dataLabels: {
          enabled: true,
			    format: '<span style="color:{series.color}">{point.name}</span>',
			  },
			},
			series: {
				pointPadding: 0.5,
				pointWidth: 15,
			}
		},
		tooltips: {
			enabled: 'false',
		},
	});