{"action":"created","issue":{"url":"https://api.github.com/repos/niloch/iplotter/issues/5","repository_url":"https://api.github.com/repos/niloch/iplotter","labels_url":"https://api.github.com/repos/niloch/iplotter/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/niloch/iplotter/issues/5/comments","events_url":"https://api.github.com/repos/niloch/iplotter/issues/5/events","html_url":"https://github.com/niloch/iplotter/issues/5","id":173751095,"number":5,"title":"Google Charts Gauge","user":{"login":"loosak","id":12198024,"avatar_url":"https://avatars.githubusercontent.com/u/12198024?v=3","gravatar_id":"","url":"https://api.github.com/users/loosak","html_url":"https://github.com/loosak","followers_url":"https://api.github.com/users/loosak/followers","following_url":"https://api.github.com/users/loosak/following{/other_user}","gists_url":"https://api.github.com/users/loosak/gists{/gist_id}","starred_url":"https://api.github.com/users/loosak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loosak/subscriptions","organizations_url":"https://api.github.com/users/loosak/orgs","repos_url":"https://api.github.com/users/loosak/repos","events_url":"https://api.github.com/users/loosak/events{/privacy}","received_events_url":"https://api.github.com/users/loosak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-29T11:12:56Z","updated_at":"2016-11-27T19:01:00Z","closed_at":null,"body":"Hello, \n\nI try to create gauge charts from [examples](https://developers.google.com/chart/interactive/docs/gallery/gauge) and nothing is shown.\nOther chart (Pie) is working perfectly for same.\n\nHere is my code:\n\n``` python\nfrom iplotter import GCPlotter\n\nplotter = GCPlotter()\n\ndata = [\n        ['label', 'value'],\n        ['Memory', 80],\n        ['CPU', 55],\n        ['Network', 68]\n]\n\noptions = {\n     'width':  784,\n     'height': 400,\n     'redFrom': 90, \n     'redTo': 100,\n     'yellowFrom': 75, \n     'yellowTo': 90,\n     'minorTicks': 5\n}\n\nplotter.plot(data, 'Gauge', options)\n```\n\nThanks\n"},"comment":{"url":"https://api.github.com/repos/niloch/iplotter/issues/comments/263139993","html_url":"https://github.com/niloch/iplotter/issues/5#issuecomment-263139993","issue_url":"https://api.github.com/repos/niloch/iplotter/issues/5","id":263139993,"user":{"login":"niloch","id":6801168,"avatar_url":"https://avatars.githubusercontent.com/u/6801168?v=3","gravatar_id":"","url":"https://api.github.com/users/niloch","html_url":"https://github.com/niloch","followers_url":"https://api.github.com/users/niloch/followers","following_url":"https://api.github.com/users/niloch/following{/other_user}","gists_url":"https://api.github.com/users/niloch/gists{/gist_id}","starred_url":"https://api.github.com/users/niloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niloch/subscriptions","organizations_url":"https://api.github.com/users/niloch/orgs","repos_url":"https://api.github.com/users/niloch/repos","events_url":"https://api.github.com/users/niloch/events{/privacy}","received_events_url":"https://api.github.com/users/niloch/received_events","type":"User","site_admin":false},"created_at":"2016-11-27T19:01:00Z","updated_at":"2016-11-27T19:01:00Z","body":"Using `DataTable` with `addColumn` and `addRows` is equivalent to `arrayToDataTable`. So the first row of data should be `[\"From\", \"To\", \"Weight\"]`.\r\n\r\nThe following example works\r\n\r\n```python\r\n\r\nfrom iplotter import GCPlotter\r\n\r\nplotter= GCPlotter()\r\n\r\nplotter.template = '''\r\n<div id={{div_id}} style='width: 100%; height: 100%' ></div>\r\n    <script type='text/javascript'>\r\n        google.charts.load('current', {'packages':['sankey']});\r\n        google.charts.setOnLoadCallback(drawChart);\r\n\r\n        function drawChart() {\r\n            var data = google.visualization.arrayToDataTable({{data}});\r\n\r\n            var chart = new google.visualization.{{chart_type|title}}(document.getElementById('{{div_id}}'));\r\n\r\n            chart.draw(data, {{options}});\r\n        }\r\n    </script>\r\n'''\r\n\r\ndata =[\r\n        ['From', 'To', 'Weight'],\r\n        ['S', 'T', 60805],\r\n        ['S', 'F', 4965],\r\n        ['T', 'TT', 52324],\r\n        ['T', 'TF', 8481]\r\n    ]\r\n\r\nplotter.plot(data, \"Sankey\")\r\n```"}}
{"actor":{"display_login":"niloch"}}