Help:Googlebar format
From semantic-mediawiki.org
This format creates a bar chart based on property values, using the Google Charts API. It is defined within the Semantic Result Formats extension.
Contents |
Example
{{#ask:
[[Category:City]] [[located in::Germany]]
|?population
|format=googlebar
}}
This query currently cannot be displayed here, since the Googlepie format is not switched on on this site. See the North America page on semanticweb.org for an example.
Installation
Privacy notice
You must not forget that every time a user comes to a page with a Google chart, Google gets a ping. And you also send all your data to Google in order to render it. Don't forget also that these printers do not work offline, if you have a local wiki.
It should be noted that, if the Googlepie format is not enabled, the queries will be rendered as tables.
Usage
You use the same queries as usual, but make sure to add a printout statement with a property that is of type number. All printouts of properties of type number will be taken for the visualization. Specify format googlebar. The only further parameter (for now) is width (if not given, mostly sensible values are assumed).
You may want a pie chart to not show property values directly, but rather the popularity of different values of a property across the entire wiki; i.e. a numerical distribution. This is easy to do; see Help:Displaying numerical distributions for how to do this.
Future work
I do not expect to have much time to explore this further, even though it would be very cool to choose colours and to add more info, and to use more of the chart types that Google offers. It would be even cooler if someone could find an Open Source library that can create these charts itself (didn't find something when browsing shortly), so that the data does not have to be sent to Google, and so that we can expand it more easily, and make it a proper self contained part of SMW. So if you want to take over development here, feel free to do so! We probably will not clash when doing it (but you may drop a note on the dev list before you do something bigger so that we prevent double work). --Denny Vrandecic 14:16, 8 July 2008 (UTC)

