Help:Google bar format

From semantic-mediawiki.org
(Redirected from Help:Google bar format)
Help:Google bar formatGoogle bar format/zh-hans
Google bar format
Produces a bar chart using the Google Charts API
Further Information
Provided by: Extension "Semantic Result Formats"
Added: 1.4.0
Removed: still supported
Requirements: none
Format name: googlebar
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. no
Authors: Denny Vrandečić
Categories: charts
Table of Contents
You must not forget that every time a user comes to a page embedding a Google chart, Google gets a ping. Moreover your data is being sent to Google in order to render it.

→ The creators of Semantic Result Formats have not control over and cannot take any responsibility in case of any misuse resulting from this!

As of April 20, 2012 the Google Charts API is deprecated and may be shut down without further notice. Thus you are advised to not rely on this result format.

The result format googlebar, part of extension "Semantic Result Formats"Provides additional formats for semantic queries, is used to produce pie charts using the Google Charts API.

Parameters[edit]

A fatal error occurred in the #smwdoc parser function

Usage[edit]

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. The only further parameters are height and width. If not given, mostly sensible values are assumed.

You may want a bar 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 fairly easy to do; see here for how.

Example[edit]

Syntax
{{#ask:
 [[Category:City]]
 [[Located in::Germany]]
 |?Population
 |format=googlebar
}}
This result format was not activated for this wiki. Thus a rendered example result cannot be shown.

Enabling[edit]

This result format is not enabled by default on a wiki. To enable it add the following line to your "LocalSettings.php" file after the inclusion of Semantic MediaWiki and Semantic Result Formats:

$srfgFormats[] = 'googlebar';
Do not forget also that these printers do not work offline, if you have a local wiki.

Chart formats[edit]

These are the chart related result formats provided by Semantic MediaWiki and extensions to Semantic MediaWiki.