Flags Stack Distance in stock chart - Javascript highcharts

Javascript examples for highcharts:Stock Chart

Description

Flags Stack Distance in stock chart

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://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {/*from  w ww.  j  av a 2s  .c  o  m*/
    $.getJSON('https://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'
            },
            tooltip: {
                enabled:false
            },
            yAxis : {
                title : {
                    text : 'Exchange rate'
                }
            },
            plotOptions:{
                series:{
                    stackDistance: 20
                }
            },
            series : [{
                name : 'USD to EUR',
                data : data,
                id : 'dataseries'
            // the event marker flags
            }, {
                type : 'flags',
                data : [{
                    x : Date.UTC(2011, 3, 25),
                    title : 'H',
                    text : 'Euro Contained by Channel Resistance'
                }, {
                    x : Date.UTC(2011, 3, 25),
                    title : 'G',
                    text : 'EURUSD: Bulls Clear Path to 1.50 Figure'
                }],
                onSeries : 'dataseries',
                shape : 'circlepin',
                width : 16
            }]
        });
    });
});

      </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: 400px; min-width: 310px"></div>  
   </body>
</html>

Related Tutorials