wiki:GoogleChartPlugin

Version 12 (modified by anonymous, 15 years ago) (diff)

--

Google Chart API plugin

Description

Provides a simple way to chart the result of any query.

NOTE: This plugin currently uses an eval() statement to turn parameters in Python dict syntax into an actual dictionary. This is convenient, because it means you can pass tuples and lists to the engine. However, it is also quite dangerous, since you are allowing the author of the wiki page to execute arbitrary Python. Until this has been replaced by a more limited parser that only accepts primitive types, do not use this plugin in an environment where you don't trust your users.

Patches to fix this would be welcome!

How about this? Use JSON. Install simplejson, then in python:

>>> args = '["hurray",{"for":"json"}]'
>>> import simplejson
>>> simplejson.loads(args)
["hurray", {"for":"json"}]

Bugs/Feature Requests

Existing bugs and feature requests for GoogleChartPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from [download:googlechartplugin here].

Source

You can check out GoogleChartPlugin from here using Subversion, or browse the source with Trac.

Example

[[GChart(query="SELECT id FROM ticket", type="line")]]

Note: the following example macros must be entered in a single line.

Simple Pie

[[GChart(type="pie", chs="250x100", query="SELECT rev FROM revision")]]

Legend

[[GChart(chxt="y", chco="ff0000,00ff00,0000ff", chs="300x150", type="lc", 
         chdl="Animals|Vegetables|Minerals", 
         query="SELECT rev, (10+2*rev), (30+3*rev) FROM revision")]]

Fill

[[GChart( chxt="x,y", chf="c,lg,45,ffffff,0,76A4FB,0.75|bg,s,EFEFEF",
          chco="ff0000", chs="300x150", type="lc", 
          chxl="0:|1|2|3|4|5|1:||50|100", chls="4.0,3.0,0.0",
          query="SELECT id FROM ticket")]]

Equivalent to multi-line macro:

{{{
#!GChart
  type  = "lc", 
  chxt  = "x,y",
  chf   = "c,lg,45,ffffff,0,76A4FB,0.75|bg,s,EFEFEF",
  chco  = "ff0000", 
  chs   = "300x150", 
  chxl  = "0:|1|2|3|4|5|1:||50|100",
  chls  = "4.0,3.0,0.0",
  query = "SELECT id FROM ticket"
}}}

See README.txt for more information.

Recent Changes

16727 by rjollos on 2017-08-11 08:50:09
gchartplugin 0.2: Fix indentation

Fixes #6917.

16726 by rjollos on 2017-08-11 08:47:49
Remove intermediate directory
16397 by rjollos on 2017-03-25 09:37:00
Remove obsolete "0.9" code
(more)

Author/Contributors

Author: optilude
Contributors:

Attachments (1)

Download all attachments as: .zip