Dynamically move highstock navigator - Javascript highcharts

Javascript examples for highcharts:Stock Chart

Description

Dynamically move highstock navigator

Demo Code

ResultView the demo in separate window

<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">
var chart;/* w  w  w .  j  a  v a2s  .  c  om*/
$(function() {
    chart = new Highcharts.StockChart({
        chart: {
            renderTo: 'container'
        },
        navigator: {
            top:40,
        },
        yAxis:{
            top:100,
            height:100
        },
        xAxis:{
            top:100
        },
        rangeSelector: {
            selected: 1
        },
        series: [{
            name: 'USD to EUR',
            data: usdeur
        }]
    });
});
function doFunction(){
        chart.update({
           navigator: {
             top: 202,
            height: 50
          }
        });
}

      </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> 
      <script type="text/javascript" src="https://www.highcharts.com/samples/data/usdeur.js"></script> 
      <input id="clickMe" type="button" value="clickme" onclick="doFunction();">  
   </body>
</html>

Related Tutorials