Google line chart CategoryFilter

16 views
Skip to first unread message

Kumaranath Fernando

unread,
Mar 4, 2019, 9:06:17 AM3/4/19
to Google Visualization API
I'm attempting to display a control wrapper for a line chart. 

Here's the function that generates this linechart.

 function drawChart() {
    var data = google.visualization.arrayToDataTable([          
             [month, Hopong, Kalaw, Loilen],
             ["2018-09", 0, 0, 0],
             ["2018-11", 0, 0, 0],
             ["2018-12", 0.2, 0.3, 0.4],
             ["2019-01", 4, 5, 6]]);

          var dataTable = google.visualization.arrayToDataTable(mainArray);
               var options = {
                   title: 'Pentration Rate',
                   curveType: 'function',
                   legend: { position: 'bottom' },
                    vAxis: {
                        viewWindow: {
                            min: 0
                        }
                    }
               };
              var chart = new google.visualization.LineChart(document.getElementById('pentration_chart'));

              chart.draw(dataTable, options)
  }
How do I create a ControlWrapper (dropdown) containing a list of townships eg: Hopong, Kalaw,Loilen etc, to filter by the township for penetration rate values for each month for a particular township.?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages