summaryrefslogtreecommitdiff
path: root/underlays/basewiki/directive/sparkline.mdwn
diff options
context:
space:
mode:
authorWilliam Uther <willu@cse.unsw.edu.au>2008-09-11 17:04:23 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-11 17:05:19 -0400
commit4f0ac7fe59c196a602e07cc6c4abfc248999ec6b (patch)
tree725f523faeb8e8db0efd81be4024257799c93ef8 /underlays/basewiki/directive/sparkline.mdwn
parent595b0359157d1f57ee5a87c63e665dfa1d2130ec (diff)
add underlay files for listdirectives
As was noted, 'listdirectives' didn't include the underlay files that make it really worthwhile. I've just gone through all the plugin documentation, modified it to remove installation information and renamed the files to match the directives rather than the plugins. This can now serve as useful underlay. I've only gone through plugins in the 'plugins' dir. I did not go through the 'contrib' dir.
Diffstat (limited to 'underlays/basewiki/directive/sparkline.mdwn')
-rw-r--r--underlays/basewiki/directive/sparkline.mdwn58
1 files changed, 58 insertions, 0 deletions
diff --git a/underlays/basewiki/directive/sparkline.mdwn b/underlays/basewiki/directive/sparkline.mdwn
new file mode 100644
index 000000000..53dea2619
--- /dev/null
+++ b/underlays/basewiki/directive/sparkline.mdwn
@@ -0,0 +1,58 @@
+The `sparkline` directive is supplied by the [[!iki plugins/sparkline]] plugin.
+
+This directive allows for embedding sparklines into wiki pages. A
+sparkline is a small word-size graphic chart, that is designed to be
+inlined alongside text.
+
+# examples
+
+ \[[!sparkline 1 3 5 -3 10 0 width=40 height=16
+ featurepoint="4,-3,red,3" featurepoint="5,10,green,3"]]
+
+This creates a simple line graph, graphing several points.
+[[!if test="enabled(sparkline)" then="""
+[[!sparkline 1 3 5 -3 10 0 width=40 height=16
+featurepoint="4,-3,red,3" featurepoint="5,10,green,3"]]
+"""]]
+It will be drawn 40 pixels wide and 16 pixels high. The high point in the
+line has a green marker, and the low point has a red marker.
+
+ \[[!sparkline 1 -1(red) 1 -1(red) 1 1 1 -1(red) -1(red) style=bar barwidth=2
+ barspacing=1 height=13]]
+
+This more complex example generates a bar graph.
+[[!if test="enabled(sparkline)" then="""
+[[!sparkline 1 -1(red) 1 -1(red) 1 1 1 -1(red) -1(red)
+style=bar barwidth=2 barspacing=1 height=13]]
+"""]]
+The bars are 2 pixels wide, and separated by one pixel, and the graph is 13
+pixels tall. Width is determined automatically for bar graphs. The points
+with negative values are colored red, instead of the default black.
+
+# usage
+
+The form for the data points is "x,y", or just "y" if the x values don't
+matter. Bar graphs can also add "(color)" to specify a color for that bar.
+
+The following named parameters are recognised. Most of these are the same
+as those used by the underlying sparkline library, which is documented in
+more detail in [its wiki](http://sparkline.wikispaces.com/usage).
+
+* `style` - Either "line" (the default) or "bar".
+* `width` - Width of the graph in pixels. Only needed for line graphs.
+* `height` - Height of the graph in pixels. Defaults to 16.
+* `barwidth` - Width of bars in a bar graph. Default is 1 pixel.
+* `barspacing` - Spacing between bars in a bar graph, in pixels. Default is
+ 1 pixel.
+* `ymin`, `ymax` - Minimum and maximum values for the Y axis. This is
+ normally calculated automatically, but can be explicitly specified to get
+ the same values for multiple related graphs.
+* `featurepoint` - Adds a circular marker to a line graph, with optional
+ text. This can be used to label significant points.
+
+ The value is a comma-delimited list of parameters specifying the feature
+ point: X value, Y value, color name, circle diameter, text (optional),
+ and text location (optional). Example: `featurepoint="3,5,blue,3"`
+
+ Available values for the text location are: "top", "right", "bottom", and
+ "left".