Help:Sparkline format

From semantic-mediawiki.org
Sparkline format
generates small inline charts (also known as sparklines)
Scenarios, examples, demos
Example: Sparkline examples
Collection
Further Information
Provided by: Extension "Semantic Result Formats"
Added: 1.8.0
Removed: still supported
Requirements: none
Format name: sparkline
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. Yes
Authors: James Hong Kong
Categories: charts
Group: sparkline , interactive format , data visualization
Table of Contents

This printer format uses the jquery.sparkline plugin to generated small inline charts (also known as sparklines) directly into a text.

This format is mainly used to enhance inline text with information such as trends etc. which can be easily incorporated graphically without causing an overall distraction of the reading process. For more graphical enriched representations, one might consider other chart formats.

Parameters[edit]

Parameter Type Default Description
distribution yes/no no Instead of displaying all values, count their occurrences, and show these.
distributionsort text none Sort the value distribution by occurrence count.
distributionlimit whole number no Limit the value distribution to the count of only some values.
aggregation text subject Specify to what the aggregation should relate to
min whole number no The minimum value to show on the Y-axis
charttype text bar Available chart type
class text empty Specify an additional cascading style sheet class

For better inline alignment with the surrounded text, one can use a class parameter to assign a css class (see example below).

.demo-center {
 display: inline-block;
}

Usage[edit]

Parameter [charttype] (pie, line, bar, discrete) determines the chart type.

{{#ask:[[Has value::+]]   
|?Has value  
|format=sparkline                
|link=all                   
|headers=show   
|charttype=pie
|class=demo-center
}}

Examples[edit]


This documentation page applies to all SMW versions from 1.8.0 to the most current version.