Google line chart with only zero and positive ones - Javascript Google Chart

Javascript examples for Google Chart:Line Chart

Description

Google line chart with only zero and positive ones

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 
      <script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {//from  w  w  w  . j ava 2  s.  co m
        var data = google.visualization.arrayToDataTable([["Day", "Value"], ["15", 0], ["16", 0], ["17", 0], ["18", 0], ["19", 0], ["20", 0], ["21", 7], ["22", 0], ["23", 0], ["24", 0], ["25", 0]]);
        var options = {
          title: 'Company Performance',
          legend: { position: 'bottom' }
        };
        var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
        chart.draw(data, options);
      }
    
      </script> 
   </head> 
   <body> 
      <div id="curve_chart" style="width: 900px; height: 500px"></div>  
   </body>
</html>

Related Tutorials