I am trying to figure out how to add category / filter slider to my chart using Google charts. I have read the document, but as you can see I wrote the code individually. I should know where to bind the border slider to control "dashboard"?
Here's my code:
var line_data, line_json, line_chart, rangeSlider; "Line": {"fill": "#fff"}, "width": 800, "height": 600, "chartArray": {"height": "65%", "width": "" "" " "" "" "" "," Top ":" 5 "}," fontName ":" samo_sans_regular, arial, sans-seif "," legend ": {" position ":" none "}," linewidth " : "" "" "" "" "": "#%", "Textstyle": {"color": "# 333", " Bold ":" true "}," baseline color ":" #eee "," gridlines ": {" color ":" #eee "," count ":" 10 "}," short gridlines ": {" color " : "" "" "" "" ""} "," Hxis ": {" format ":" mmm or "," textstyle ": {" color ":" # 333 "," bold ":" true "", "Grayscale": {"color": "#"), "Green Gridlines": {"Color": "#", "Count": "10"}, "Slated text": "true", " "Range slider": "90" "viewwmod": "beautiful"}, "series": [{"color": "# 62BA8C"}], "focus tag": "category"} var range slideropts = {"control Type "filter", "container id", "filter"}; function drawLineChart (L) {var $ this = $ (el); console.log (this $); var aId = $ this.attr ("data -Id "); var line_json = $ .ajax ({// url:" / umbraco / surface / master / FetchStrategyGraphData /? DistId = "+ a id, url: $ this.attr (" data-distribution "), data type:" json ", async: wrong}). Response text; line_data = new google.visualization.DataTable (line_json); line_charts = New google.visualization.LineChart (document.getElementById ("Chart-" + AID)); //chart.draw (Data, Drawing Options); $ ("# Chart-" + AID). CSS ("Opacity", "0"); SetTimeout (function () {line_chart.draw (line_data, lineChartOptions, rangeSliderOptions); $ ("# chart -" + aID). CSS ("Opacity", "1");), 500);}
Something like this should be:
function drawLineChart (L) {var $ this = $ (el); console.log ( H $); var aId = $ this.attr ("data-id"); var line_json = $ .ajax ({// url: "/ umbraco / surface / master / FetchStrategyGraphData /? DistId =" + a id, url : $ This.attr ("data-delivery"), data type: "json", async: wrong}). Response text; line_data = new google.visualization.DataTable (line_json); var dashboard = new google.visualization.dashboard (Document.getElementById ('dashboard_div')); Var Chart = New google.visualization.ChartWrapper ({'Chart Type': 'Drawing', 'Container ID': "Chart-" + AID, 'Options': Linechartopts}); Var control = new google.visualization.ControlWrapper ({'controlType': 'NumberRangeFilter', 'containerId': 'filter', 'option': {filterColumnIndex: 1}}); Dashboard Bid (control, chart); Dashboard.draw (line_data); }
Comments
Post a Comment