Javascript examples for highcharts:Stock Chart
Starting point of navigator in stock chart
<html> <head> <title>Highcharts Stock Demo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(function() {/*w w w. ja v a 2s . c o m*/ var seriesOptions = [], yAxisOptions = [], seriesCounter = 0, names = ['MSFT', 'AAPL', 'GOOG'], colors = Highcharts.getOptions().colors; $.each(names, function(i, name) { $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename='+ name.toLowerCase() +'-c.json&callback=?', function(data) { seriesOptions[i] = { name: name, data: data }; seriesCounter++; if (seriesCounter == names.length) { createChart(); } }); }); // create the chart when all data is loaded function createChart() { chart1 = new Highcharts.StockChart({ chart: { renderTo: 'container', zoomType: 'x' }, title: { text: 'Series compare by <em>percent</em>' }, subtitle: { text: 'Compare the values of the series against the first value in the visible range' }, rangeSelector: { enabled: false }, yAxis: { labels: { formatter: function() { return (this.value > 0 ? '+' : '') + this.value + '%'; } } }, plotOptions: { series: { compare: 'percent' } }, tooltip: { pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>', changeDecimals: 2, valueDecimals: 2 }, series: seriesOptions }); chart1.xAxis[0].setExtremes(1262304000000,chart1.xAxis[0].getExtremes().max); } }); </script> </head> <body> <div id="container" style="height: 400px; min-width: 600px"></div> <script src="https://code.highcharts.com/stock/highstock.js"></script> <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> </body> </html>