Highstock Demo Gallery - Plot lines on Y axis

« Go to the Highcharts home page

Pick an example on the left and combine it with a preset theme in the top menu. Click "View options" to inspect the code.

General

Chart types

Various features

Flags




View options
$(function() {
	$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function(data) {

		// Create the chart
		$('#container').highcharts('StockChart', {
			

			rangeSelector : {
				selected : 1
			},

			title : {
				text : 'USD to EUR exchange rate'
			},

			yAxis : {
				title : {
					text : 'Exchange rate'
				},
				plotLines : [{
					value : 0.6738,
					color : 'green',
					dashStyle : 'shortdash',
					width : 2,
					label : {
						text : 'Last quarter minimum'
					}
				}, {
					value : 0.7419,
					color : 'red',
					dashStyle : 'shortdash',
					width : 2,
					label : {
						text : 'Last quarter maximum'
					}
				}]
			},

			series : [{
				name : 'USD to EUR',
				data : data,
				tooltip : {
					valueDecimals : 4
				}
			}]
		});
	});
});
Edit in jsFiddle « Previous Next »