plugin:avbarchart
Table of Contents
AV Bar Chart Plugin
Compatible with DokuWiki
- 2023-04-04 "Jack Jackrum" probably
- 2022-07-31 "Igor" probably
- 2020-07-29 "Hogfather" yes
- 2018-04-22 "Greebo" yes
Similar to pchart
Description
With this plugin you can create a quick and easy bar chart on your DokuWiki page. It uses CSS and HTML only and no images needed.
Screenshot and info available here: https://github.com/syntaxseed/avbarchart.
Syntax and Usage
<barchart>1000|A:500,B:50,C:250,D:1000</barchart>
- The first value is the max number that your data set will go to.
- After the | you have a comma separated list of labels and values to be graphed.
- In the source of the plugin are config vars that let you customize the size, color and font of your chart.
You can then use regular DokuWiki syntax to put a title above it and if needed, a legend below to describe the labels. If you make the bars wide, the labels can be full text.
Colored Bars
Add a hex color code to individual bars like so:
<barchart>1000|A:500:#ff0000,B:50,C:250,D:1000</barchart>
Installation
- Plugin Manager: Paste this URL into the Plugin Manager to install AVBarChart automatically: https://github.com/syntaxseed/avbarchart/archive/master.zip
Configuration Vars:
// ********* CHART CONFIG SETTINGS ************* var $barWidth = 20; //Pixel width of chart bars. var $barColor = "#ccccff"; //Color of graph bars. var $fontSize = "8pt;"; //Font size of labels and values. var $maxPxHeight = "100"; //Maximum height of the chart in pixels. // *********************************************
If your barWidth is not wider than the labels, your chart will look funny.
Source
Contributing
Please submit a PR to the GitHub repo.
Known Bugs
- None.
To Do
- Nicer style of bars.
- Use divs instead of table.
Changelog
- 2007-10-19
- Created plugin.
- 2009-05-15
- Added URL to zip for automatic installation.
- 2013-02-25
- Updated layout bugs for latest browsers and version of Dokuwiki.
- Updated this wiki page to remove redundant comments.
- 2020-02-07
- Update for PHP v 7+.
- Move to GitHub repo.
- Add colored bars support. Contributed by ~ Gregor Anželj
- 2022-08-08
- Test on 2022-07-31 “Igor”.
- Test and fix for PHP 8.1.
Comments / Discussion
Hi everyone, let me know what you think. ~Sherri
Simple and elegant plugin. Excellent work!. ~Dmitri
plugin/avbarchart.txt · Last modified: 2022-09-23 16:39 by johng