HOW TO DRAW CHARTS BETWEEN TWO DATES VIA TWO DATEPICKERS FROM EXISTING DATABASE

25 views
Skip to first unread message

Igbekele Fanimo

unread,
Sep 21, 2015, 8:46:42 AM9/21/15
to Google Visualization API
Dear all, I now know  how to create chart from existing database . but my problem is to create datepicker and  pass date value to query select* where date =datepicker value . In short i want to draw chart base on date from datepicker.Please do not ignore me, let my young grow too....And I know I shall grow too with your help. example is this,help me create two dapickers and help me pass the value to select where date=---- I will be graeful


<!DOCTYPE html>

<html>

<head>

  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>

  <title>

    New members

  </title>

  <script type="text/javascript" src="https://www.google.com/jsapi"></script>

  <script type="text/javascript">

    google.load('visualization', '1.0', {packages: ['charteditor']});

  </script>

  <script type="text/javascript">

    google.setOnLoadCallback(loadEditor);

    var chartEditor = null;

 

    function loadEditor() {

      // Create the chart to edit.

      var wrapper = new google.visualization.ChartWrapper({

         'chartType':'LineChart',

         'dataSourceUrl':https://docs.google.com/spreadsheets/d/1hz2ahJiOb77cvxBsfIDeC91Gw4NdfUzbrKIkNgfbyP0=0',

         'query':'SELECT O,sum(c)where date = datepicker Group BY O',

         'options': {'title':'Number of members', 'legend':'none'}

      });

 

      chartEditor = new google.visualization.ChartEditor();

      google.visualization.events.addListener(chartEditor, 'ok', redrawChart);

      chartEditor.openDialog(wrapper, {});

    }

 

    // On "OK" save the chart to a <div> on the page.

    function redrawChart(){

      chartEditor.getChartWrapper().draw(document.getElementById('vis_div'));

    }

 

  </script>

</head>

<body>

  <div id="vis_div" style="height: 400px; width: 600px;"></div>

</body>

</html>

Reply all
Reply to author
Forward
0 new messages