DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:avbarchart

AV Bar Chart Plugin

Compatible with DokuWiki

  • 2020-07-29 "Hogfather" yes
  • 2018-04-22 "Greebo" yes
  • 2017-02-19 "Frusterick Manners" unknown
  • 2016-06-26 "Elenor Of Tsort" unknown

plugin Generates a simple HTML/CSS bar chart. Supports colored bars.

Last updated on
2020-03-18
Provides
Syntax
Repository
Source

Similar to pchart

Tagged with chart, diagram, images, media

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: AV Bar Chart for Dokuwiki.

Syntax and Usage

<barchart>1000|A:700,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:700:#ff0000,B:50,C:250,D:1000</barchart>

Installation

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

Comments / Discussion

Hi everyone, let me know what you think. ~Sherri

Simple and elegant plugin. Excellent work!. ~Dmitri

plugin/avbarchart.txt · Last modified: 2020-08-05 10:29 by LMS23