Displaying multiple series in the navigator - Javascript highcharts

Javascript examples for highcharts:Chart Series

Description

Displaying multiple series in the navigator

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <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">
var new_data = [// w  ww.j a v  a 2s . co m
[1353498875000, 20],
[1353499295000, 11.160532142857],
[1353500135000, 10.883982142857],
[1353500975500, 10.702821428571]];
var default_serie = [{
    name : "",
    data : [[1353498875000,0],[1353500975500,0]],
    showInLegend:false,
    xAxis: 0,
    tooltip : {
        enabled:false
    }
}];
$(function() {
   Highcharts.setOptions({
        global: {
            useUTC: false
        },
        chart : {
            zoomType : 'x',
            alignTicks : false
        },
        xAxis : {
            ordinal : false
        },
        yAxis: [{
            title: {
                text: 'Test',
            }
        }],
        credits : {
            enabled : false
        },
        rangeSelector : {
            inputEnabled : false
        },
        navigator : {
            adaptToUpdatedData : false
        },
        legend : {
            enabled : true,
            layout : 'vertical',
            align : 'right',
            verticalAlign : 'top',
            x : -10,
            y : 100,
            borderWidth : 0
        },
        plotOptions : {
            series : {
                dataGrouping : {
                    enabled : true,
                    groupPixelWidth : 20,
                    approximation : 'average'
                }
            }
        }
    });
    window.chart = new Highcharts.StockChart({
        chart : {
            renderTo : 'container'
        },
        xAxis : {
            ordinal : false
        },
        exporting :
        {
            enabled: true
        },
        series : default_serie
    });
    window.chart.addSeries({
            name : "",
            xAxis: 0,
            yAxis: 1,
            type: "line",
            enableMouseTracking: false,
            data : new_data,
            showInLegend:false
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> 
      <div id="container" style="height: 500px; min-width: 500px"></div>  
   </body>
</html>

Related Tutorials