Anonymous avatar Anonymous committed 06d725f

added/suppressed the unneeded/needed files

Comments (0)

Files changed (7)

mustachebox/static/js/area.js

-    if(data.elem == undefined){
-        data.elem = 'area_chart_div'
-    };
-    google.load('visualization', '1', {'packages':['corechart']});
-    google.setOnLoadCallback(drawChart);
-    function drawChart() {
-        // define a new datatable
-        dataset = renderTable(data)
-        // define where the graph must be paint
-        var chart = chart(
-            document.getElementById(data.elem)
-        );
-        // effectively draw the graph
-        chart.draw(dataset);
-    }

mustachebox/static/js/barchart.js

-    if(data.elem == undefined){
-        data.elem = 'bar_chart_div'
-    };
-    google.load('visualization', '1', {'packages':['corechart']});
-    google.setOnLoadCallback(drawChart);
-    function drawChart() {
-        // define a new datatable
-        dataset = renderTable(data)
-        // define where the graph must be paint
-        var chart = new google.visualization.BarChart(
-            document.getElementById(data.elem)
-        );
-        // effectively draw the graph
-        chart.draw(dataset);
-    }

mustachebox/static/js/columnchart.js

-if(data.elem == undefined){
-        data.elem = 'area_chart_div'
-    };
-google.load('visualization', '1', {'packages':['corechart']});
-google.setOnLoadCallback(drawChart);
-
-function drawChart() {
-    // define a new datatable
-    dataset = renderTable(data)
-    // define where the graph must be paint
-    var chart = new google.visualization.ColumnChart(
-        document.getElementById(data.elem)
-    );
-    // effectively draw the graph
-    chart.draw(dataset);
-}

mustachebox/static/js/google_base.js

+// define utility functions to draw google charts
+
+function drawChart(chart, data, options) {
+    chart.draw(renderTable(data), options);
+};
+
+
+function drawPieChart(chart, data, options) {
+    chart.draw(pie_serie_renderTable(data), options);
+};

mustachebox/static/js/pie_chart.js

-if(data.elem == undefined){
-    data.elem = 'pie_chart_div'
-};
-google.load('visualization', '1', {'packages':['corechart']});
-google.setOnLoadCallback(drawChart);
-
-function drawChart() {
-    // define a new datatable
-    dataset = new google.visualization.DataTable();
-    for(var i=0; i< piedata.label.length; i++){
-        if(i == 0){
-            // first column is a string type
-            dataset.addColumn('string', piedata.label[i]);
-        }else{
-            dataset.addColumn('number', piedata.label[i]);}
-    }
-    rows = []
-    for(var i=0; i<piedata.records.length; i++){
-        rows.push(piedata.records[i])
-
-    }
-    // add every rows to the dataset
-    dataset.addRows(rows)
-    // define where the graph must be paint
-    var chart = new google.visualization.PieChart(
-        document.getElementById(data.elem)
-    );
-    // effectively draw the graph
-    chart.draw(dataset);
-}

mustachebox/static/js/pie_serie.js

+function pie_serie_renderTable(data){
+    dataset = new google.visualization.DataTable();
+    for(var i=0; i< data.label.length; i++){
+        if(i == 0){
+            // first column is a string type
+            dataset.addColumn('string', data.label[i]);
+        }else{
+            dataset.addColumn('number', data.label[i]);}
+    }
+    rows = []
+    for(var i=0; i<data.records.length; i++){
+        rows.push(data.records[i])
+    }
+    // add every rows to the dataset
+    dataset.addRows(rows)
+    return dataset
+}
Add a comment to this file

other_backends/__init__.py

Empty file added.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.