Skip to content

WordPress Plugin to enable inline charts powered by the Spark font by After the flood.

License

Notifications You must be signed in to change notification settings

nilslockean/sparklines-for-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sparklines for WordPress

Sparklines is a WordPress Plugin to enable inline charts powered by the Spark font by After the Flood.

Installation

Download the ZIP using the green button on this page and go to Plugins > Add New > Upload Plugin in your WordPress admin panel. Upload the ZIP file and you're good to go!

The plugin will soon be available in the official plugin repository. Hopefully. :)

Using the shortcode

The plugin provides you with a [spark] shortcode that takes some input and generates the appropriate HTML and enqueues the stylesheet.

The basic shortcode format is (with default vaules):
[spark start="123" data="10,20,30,40,50,60,70,80,90,100" end="789" type="bar-medium"]

Available attributes

Name Default  Description
start 123 The starting point. Will be displayed before the chart.
data 10,20,30,40,50,60,70,80,90,100
Data points to be rendered inside the graph. Anything that isn't a number will be filtered out (strings, spaces etc.).
end 789 The ending point. Will be displayed after the chart.
type bar-medium Type of chart to be used. See available fonts below.

Types of charts

The sparkline charts can be displayed in any of the following types:

  • Medium Bar (bar-medium): Medium Bar Sparkline
  • Narrow Bar (bar-narrow): Narrow Bar Sparkline
  • Thin Bar (bar-thin): Thin Bar Sparkline
  • Medium Dot (dot-medium): Medium Dot Sparkline
  • Small Dot (dot-small): Small Dot Sparkline
  • Medium Line (line-medium): Medium Dot Line
    Only supports values 0-9.

The font

AtF Spark is a font that allows for the combination of text and visual data to show an idea and evidence in one headline. This builds on the principle of Sparklines defined by Edward Tufte and makes them easier to use. Sparklines are currently available as plugins or javascript elements. By installing the Spark font you can use them immediately without the need for custom code.

The font is maintained by After the flood. Read more about AtF Spark here.

About

WordPress Plugin to enable inline charts powered by the Spark font by After the flood.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published