Welcome to Graph Help
What can this thing do?
See the Examples page.
How do I use it?
You can add the graph to a web page by using an <img> tag, or a special <div>; chances are you will need both.
If you want to use an animated "client side" graph (for example, using the Fusion graphing backend), you need to use the <div> mechanism. If you want to get a graph in a non-javascript environment (say, when passing to the PDF generator), you need to use the <img> tag method.
The div mechanism looks like this:
<div class='grapher'>
<div class='data'>({base: "graph/t/b/w/300/....?apikey=1111222233334444"})</div>
</div>
The <div> mechanism also requires a javascript library, so don't forget to include that; put something like this with your <head>:
<script src="http://{graph service host}/GraphHandler/class/grapher" type="text/javascript">
The <img> mechanism looks like this:
<img src="http://{graph service host}/graph/t/b/w/300....?apikey=1111222233334444"/>
In the case when you need to switch between the two, you can use some standard Knickers vanish tags, doing something like this:
{OUTPUT_MODE=Standard?:|VANISH|}
<div class='grapher'>...</div>
{/OUTPUT_MODE=Standard?:|VANISH|}
{OUTPUT_MODE=Standard?|VANISH|}
<img src="...."/>
{/OUTPUT_MODE=Standard?|VANISH|}
And here are the available variables:
| var name | description | required | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| t | Chart type.
|
yes | ||||||||||||||
| w | width (pixels) | yes | ||||||||||||||
| h | height (pixels) | yes | ||||||||||||||
| d | Data. Comma-sep list. | yes | ||||||||||||||
| l (lower L) | Label. Comma-sep list. | no | ||||||||||||||
| b | Graphing backend. Currently, Google is the currently the default. | no | ||||||||||||||
| ss | SettingSet name -- used for pre-configured settings, like palettes | no | ||||||||||||||
| c | Colors. Comma-sep list of hex (i.e., e9e39f,fff,000000); overrides the palette in the SettingSet. | no | ||||||||||||||
| bgc | Bacground color, in hex (i.e., e9e39f). | no | ||||||||||||||
| m | Markers. Specify "s" to show a shape marker at at the data point. Specify "v" to show the value. Or both. "s" is used by default on line graphs; to not show, send something other than "s". | |||||||||||||||
| f | Format Y-Axis labels. "h", "g", "i", "s" will be translated to hours (with leading zeros), hours (without leading zeros), minutes, and seconds, respectively. Additionally, two special formats are considered; "x" is the value, "p" for percent sign.
Examples:
|
|||||||||||||||
| r | Range (x-axis); auto-range by default. Format is min,max. To emulate old behavior where graphs normally always started at 0, send "0" or "0," for r. | no | ||||||||||||||
| n | Graph title ("name") | no | ||||||||||||||
| gl | Show gridlines. Defaults to 1 (on); send 0 to turn them off. | no | ||||||||||||||
| ax | Show axis. Defaults to 1 (on); send 0 to turn them off. | no | ||||||||||||||
| s | Maximum number of values to show (0 is all) | no | ||||||||||||||
| hr | Draw a horizontal rule at the given value, or "a" for the average value. | no | ||||||||||||||
| sd | Top N ("t")[default], Bottom N ("b"), Top/Bottom ("tb") | no | ||||||||||||||
| sb | (1/0) Show/Hide the avg bar for the rest of the values (only works in bar mode) | no |
There is some limited support for legends, but only on the Google backend at the moment. For a single bar, use the "k" parameter; for a multi-type, use k0 - kx. There are no controls over how it is displayed.