JSON ... it's the intersection of all modern programming languages. All languages have some sense of data, and structures of data. They all have simple values like number strings, and booleans. They all have some sense of a sequence of values. ... Every language has some sense of a collection of named values; it might be an object, or a record, or a struct, or a hash, or a property list, or something. All languages have these, these are universal ideas.
... But they all have the same idea about what the data looks like, and JSON has the thing that's common to everything. By being at the intersection, it turns out to be the thing that everybody can agree on, so it's really easy to pass data back and forth.
Prior data interchange formats tended to try to be the union of all the languages, and that turns out to be horrendously complex, and very difficult to deal with. JSON, by being so simple, actually became really easy to use.
google.visualization.Query and set its properties
according to values from the gadget preferences.
The type of parameter prefs is
_IG_Prefs
_table_query_url is used to set the Query data source URL._table_query_refresh_interval is used to set the Query refresh interval (in seconds).
google.visualization.Query.setResponse({
version: '0.6',
status: 'ok',
sig: '202289222',
table: {
cols: [{
id: 'A',
label: 'Name',
type: 'string',
pattern: ''
},
{
id: 'B',
label: 'Value',
type: 'number',
pattern: '#0.###############'
}],
rows: [{
c: [{
v: 'One'
},
{
v: 1.0,
f: '1'
}]
},
{
c: [{
v: 'Ten'
},
{
v: 10.0,
f: '10'
}]
}]
}
});
( pretty printed by http://jsbeautifier.org/ )
Represents a query that is sent to a data source.
google.visualization.Query(dataSourceUrl, opt_options)
Parameters
<script type="text/javascript" src="http://willarson.com/code/sparklines/processing.js"></script>
<script type="text/javascript" src="http://willarson.com/code/sparklines/sparklines.js"></script>
<script>
var setup_sparklines = function() {
var opts = {};
var data = [100,500,300,200,400,500,400,400,100,200];
new Sparkline('simple1', data).draw();
};
</script>
<p> A simple sparkline. </p>
<pre><code>var data = [100,500,300,200,400,500,400,400,100,200];
new Sparkline('simple1', data).draw();</code></pre>
<canvas width="300" height="50" id="simple1" ></canvas>
<script>
setup_sparklines();
</script>
http://willarson.com/code/sparklines/sparklines.html
A simple sparkline.
var data = [100,500,300,200,400,500,400,400,100,200];
new Sparkline('simple1', data).draw();