Help:Google pie format

From semantic-mediawiki.org
(Redirected from Help:Google pie format)
Help:Google pie formatGoogle pie format/zh-hans
Google pie format
Produces a pie 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: googlepie
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 googlepie, part of extension "Semantic Result Formats"Provides additional formats for semantic queries, is used to produce bar 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 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 fairly easy to do; see here for how.

Example[edit]

Syntax
{{#ask:
 [[Category:City]]
 [[Located in::Germany]]
 |?Population
 |format=googlepie
}}
Result
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[] = 'googlepie';
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.