LibChart

Summary: Creating charts in PmWiki
Version: 0.1
Prerequisites: Libchart, Version 1.1
Status: Alpha?
Maintainer: Breyten Ernsting
Categories: Markup, Markup changes
Discussion: LibChart-Talk

Questions answered by this recipe

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.

Description

'This recipe allows for the creation of simple charts in PmWiki by inline specification of the data.'This recipe allows for the creation of simple charts in PmWiki by inline specification of the data.

Notes

Installation

  1. Download LibChart 1.1
  2. Unpack the libchart in the cookbook/ directory
  3. Download libchart.phpΔ and put it in the cookbook/ directory
  4. Make a libchart directory inside pub/
  5. make sure the libchart directory is world writable (chmod 777 pub/libchart)
  6. Add include_once("$FarmD/cookbook/libchart.php"); to your config.php

Usage

(:chart title='Your Chart' data='1,2,3,4' labels='1,2,3,4' width=400 height=300 type=(HorizontalChart|VerticalChart|PieChart):)

  • Also supports (:chartdir:) instead of (:chart:) for compatibility with ChartDirector
  • Width and Height are in pixels
  • Only data and labels are required, the rest is optional
  • type must be one of HorizontalChart,VerticalChart,PieChart (case sensitive probably) -- defaults to VerticalChart
  • The charts are cached for an indefinite time -- delete the files in pub/libchart if you want to regenerate them.

Release Notes

  • 09/02/2006 - Initial version

Examples

Vertical bar chart

(:chartdir title='Network Activty Summary Packets' data=150,147,857,509,598,351,352,566,298,376,327,588,604 labels='Apr 01,Apr 08,Apr 15,Apr 22,Apr 29,May 06,May 13,May 20,May 27,Jun 03,Jun 10,Jun 17,Jun 24':)

Horizontal barchart

(:chartdir title='Most visited pages for www.example.com' data=50,83,142 labels='/wiki/Instant_messenger, /wiki/Web_Browser, /wiki/World_Wide_Web' type=HorizontalChart width=600 height=400:)

Pie chart

(:chartdir title='User agents for www.example.com' data=80,75,50 labels='Mozilla Firefox, Konqueror, Other' type=PieChart width=600 height=400:)

See Also

Contributors

Comments

See discussion at LibChart-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.