Created
October 25, 2013 03:58
-
-
Save shailen/7149267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
import 'dart:js'; | |
void main() { | |
JsObject google = context['google']; | |
google.callMethod('load', ['visualization', '1', | |
new JsObject.jsify({'packages': ['corechart']})]); | |
google.callMethod('setOnLoadCallback', [() { | |
var data = google['visualization'].callMethod('arrayToDataTable', | |
new JsObject.jsify([ | |
['Year', 'Sales', 'Expenses'], | |
['2004', 1000, 400], | |
['2005', 1170, 460], | |
['2006', 660, 1120], | |
['2007', 1030, 540]])); | |
var options = new JsObject.jsify({'title': 'Company Performance'}); | |
var chart = new JsObject(google['visualization']['LineChart'], | |
[querySelector('#chart_div')]); | |
chart.callMethod('draw', [data, options]); | |
}]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment