Set legend labels in Google Chart Candlestick - Javascript Google Chart

Javascript examples for Google Chart:Legend

Description

Set legend labels in Google Chart Candlestick

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from  w ww  . j a  v  a  2  s  .com*/
var chart_options = {
   legend: {
        position: 'bottom'
    },
   hAxis: {
   }
};
var chartdata = new google.visualization.DataTable();
chartdata.addColumn('datetime', 'Datum');
chartdata.addColumn('number', 'label 1');
chartdata.addColumn('number', '');
chartdata.addColumn('number', '');
chartdata.addColumn('number', '');
chartdata.addColumn('number', 'label 2');
chartdata.addColumn('number', '');
chartdata.addColumn('number', '');
chartdata.addColumn('number', '');
chartdata.addRows([
    [new Date(2014, 3, 1), 95,100,98,110, null,null,null,null],
    [new Date(2014, 3, 2), 98,98,102,103, null,null,null,null],
    [new Date(2014, 3, 3), 90,102,95,105, 91,103,96,106],
    [new Date(2014, 3, 4), 93,95,103,103, 94,96,104,104],
    [new Date(2014, 3, 5), 94,103,104,105, 95,104,105,106],
]);
chart1 = new google.visualization.CandlestickChart(document.getElementById('chart'));
chart1.draw(chartdata, chart_options);
    }

      </script> 
   </head> 
   <body> 
      <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart']}]}"></script> 
      <div id="chart" style="min-height: 300px"></div>  
   </body>
</html>

Related Tutorials