Help:Sparkline format

From semantic-mediawiki.org
Jump to: navigation, search
Sparkline format
generates small inline charts (also known as sparklines)
Scenarios, examples, demos
Example: Sparkline examples
Image collection
Further Information
Provided by: Semantic Result Formats
Added: 1.8.0
Removed: still supported
Requirements: none
Format name: sparkline
Enabled by default: 
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

↓ INFO ↓

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

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 <smw-paramdesc-aggregation>
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

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



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

Help:Sparkline format en 1.8.0