< < |
Chart Plugin (v1.300)
|
> > |
Chart Plugin (v1.400)
|
|
This plugin creates PNG or GIF charts to visualize TWiki tables using a default linear scale or an optional semilogarithmic scale.
|
< < |
Four types of charts are currently available, an area chart that shows data as areas under a line, a line chart that shows data as simple lines, a scatter chart that shows XY data points (allows mixing area, line, point, and pline), and a combo chart (formally known as arealine and still supported) which allows mixing area, line _point_, and pline.
All data is specified via TWiki tables.
|
> > |
Five types of charts, line, area, bar, scatter and combo, are currently available:
|
|
Type of Chart | Name | What it Does | Example |
Area | area | Shows a chart using areas under a line to represent the data | |
|
< < |
Line | line | Shows a chart using simple lines to represent the data. All data points on one of the lines are shown with their values | |
Scatter | scatter | Shows a scatter chart combining the features from area , point , and pline . All data points on the points are shown with their values | |
Area, Line, Point and Pline combined | combo | Shows a chart combining the features from area , point , and pline . | |
|
> > |
Bar | bar | Shows a chart using bars to represent the data | |
Line | line | Shows a chart using simple lines, points only, or lines with points to represent the data. Note: Any areas that fall behind already drawn areas are drawn as lines to make them visible | |
Scatter | scatter | Shows a scatter chart (XY data points) and allows mixing area or bar with line , point , and pline | |
Combo | combo | Shows a chart combining the features from area or bar with line , point , and pline Note: Formally known as arealine which is still supported | |
|
|
The %CHART{...}% variable gets expanded to an image representing the chart. Parameters and global settings determine the type of chart, dimensions, and values.
|
|
- Set DEBUG to 1 to get debug messages in
data/debug.txt . Default: 0
|
< < |
- Default chart used:
area , line , scatter or combo . Default: line
|
> > |
- Default chart used:
area , line , bar , scatter or combo . Default: line
|
|
- Default dimensions, scale and colors for a chart. See details in the syntax rules.
|
|
-
- Set AREA_COLORS = #FF3333, #FFFF33, #33FF33, #CC66FF, #99FFFF, #FFCC00, #008000, #FF8080, #3366CC, #800080
- Set LINE_COLORS = #FF0000, #FFCC00, #00CC00, #FF00FF, #33CCCC, #FF8000, #009900, #FF6666, #3333FF, #800080
- Set BGCOLOR = #FFFFFF, #FFFFFF
|
< < |
|
> > |
- Define the grid color. When xgrid/ygrid = "on", then just use the first color when drawing grid lines. When their value is "dot", then use the full specification for drawing the grid lines ("transparent" can be used to introduce holes in the line).
- Set GRIDCOLOR = #808080, #808080, #808080, transparent, transparent, transparent
|
|
|
> > |
- Define what to do when an empty table cell is found. "none" means assume no default value. A value of "10" would mean empty cells would be assumed to have a value of 10
|
|
|
> > |
- Define the default scale: linear or semilog
|
|
|
> > |
- Define the number of pixels wide lines are drawn with
- Define the number of pixels (in both the X and Y directions) to use when drawing a point
|
|
|
> > |
- Define bar chart specific parameters. BARSPACE defines the space (in pixels) between bars. BARLEADINGSPACE defines the leading space (in pixels) before the first bar. BARTRAILINGSPACE defines the trailing space (in pixels) after the last bar
- Set BARLEADINGSPACE = 6
- Set BARTRAILINGSPACE = 6
- Set BARSPACE = 5
|
|
Syntax Rules
The %CHART{...}% variable gets expanded to an image representing the chart.
|
|
- A range of table cells is defined by two cell addresses separated by
".." . For example, "row 1-20, column 3" is: R1:C3..R20:C3 and "row 15-5, column 2" is: R15:C2..R5:C2
%CHART% Parameter | Comment | Default |
|
< < |
type | The type of chart to create. One of "area" , "line" , "scatter" , "combo" | Global TYPE setting |
|
> > |
type | The type of chart to create. One of "area" , "bar" , "line" , "scatter" , "combo" | Global TYPE setting |
|
|
subtype | Sub type of chart. Supported values depend on chart type: | |
|
< < |
^ | - for type="line" chart: subtype="line, point, pline" (point line) | "line" |
^ | - for type="area" chart: subtype="area" | "area" |
^ | - for type="scatter" chart: subtype="area, line, point, pline" | "point" |
^ | - for type="combo" chart: subtype="area, line, point, pline" | All but the last data set are drawn as "area" and the last is drawn as "line" |
|
> > |
^ | - for type="area" = subtype="area" | "area" |
^ | - for type="bar" = subtype="bar" | "bar" |
^ | - for type="line" = subtype="line, point, pline" (point line) | "line" |
^ | - for type="scatter" subtype="area, bar, line, point, pline" Note: you cannot mix area and bar on the same chart. Note: It is not recommended using showing a bar on a scatter chart as the X axis placement is skewed with bar and will not exactly line up with drawn X axis values which will defeat the purpose of using scatter in the first place. | "point" |
^ | - for type="combo" subtype="area, bar, line, point, pline" (note: you can not mix area and bar on the same chart) | All but the last data set are drawn as "area" and the last is drawn as "line" |
|
|
^ | You can use a comma delimited list of values to set a specific subtype for each data set. For example "area, area, point, line" would say that the first two data sets are areas, the third is point and the last one is a line | |
scale | The scale to use when creating the chart. "linear" or "semilog" | Global SCALE setting |
name | Name to uniquely identify the chart file that is auto-created. | None; is required for all charts |
|
|
alt | Alternate text for chart image | Empty alt tag |
colors | A list of colors defining the color of each set of data points. | Global LINE_COLORS setting for lines; global AREA_COLORS setting for area |
bgcolor | Background color of the area surrounding the chart. For example, "#E7E7E7" sets a light gray background. Optionally specify a second values for the chart background itself. For example, "#E7E7E7, #FFFFC0" defines a chart with a light yellow background on a light gray surrounding. | Global BGCOLOR setting |
|
< < |
gridcolor | Color of the grid (if any) | Global GRIDCOLOR setting |
|
> > |
gridcolor | Colors/style of the grid (if any). If xgrid or ygrid = "on" then use the first gridcolor for drawing solid grid lines. If xgrid or ygrid = "dot", then use the full set of colors to define the line style for drawing the grid lines ("transparent" can be used to introduce holes in the line)" | Global GRIDCOLOR setting |
linewidth | Width of data lines in pixel | Global LINEWIDTH setting |
pointsize | Size of data points in pixel | Global POINTSIZE setting |
|
|
(other parameters) | Other parameters are passed on to the img tag. Useful to add additional image parameters like align="right" | None |
Note: To support legacy syntax, datatype maps to subtype , arealine maps to combo .
|
|
6 | 5 | 8 | 10 |
11 | 3 | 5 | 9 |
10 | 1 | 3 | 7 |
|
< < |
|
> > |
|
|
Type of chart | You type | You should get... | ...if installed |
|
< < |
line | %CHART{ type="line" name="line1" table="exampleTable1" data="R2:C2..R6:C2" xaxis="R2:C1..R6:C1" legend="R1:C2..R1:C2" width="225" height="200"}% | | ChartPlugin error: Required Perl module 'GD' not found |
line | %CHART{ type="line" name="line2" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200"}% | | ChartPlugin error: Required Perl module 'GD' not found |
scatter | %CHART{ type="scatter" name="scatter1" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200" numxgrids="4"}% | | ChartPlugin error: Required Perl module 'GD' not found |
area | %CHART{ type="area" name="area1" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200"}% | | ChartPlugin error: Required Perl module 'GD' not found |
combo | %CHART{ type="combo" name="combo1" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" datatype="area pline point line" width="225" height="200"}% | | ChartPlugin error: Required Perl module 'GD' not found |
|
> > |
area | Multiple area
%CHART{ type="area" name="area1" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
bar | Multiple bars
%CHART{ type="bar" name="bar1" table="exampleTable2" data="R3:C2..R5:C4" xaxis="R1:C2..R1:C4" legend="R3:C1..R5:C1" ymin="0" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
line | Simple line
%CHART{ type="line" name="line1" table="exampleTable1" data="R2:C2..R6:C2" xaxis="R2:C1..R6:C1" legend="R1:C2..R1:C2" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
line | Multiple lines
%CHART{ type="line" name="line2" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
scatter | Multiple scatter
%CHART{ type="scatter" subtype="pline" name="scatter1" table="exampleTable3" data="R2:C2..R6:C4" xaxis="R2:C1..R6:C1" legend="R1:C2..R1:C4" numxgrids="4" linewidth="1" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
combo | Combo with area, pline, point, & line
%CHART{ type="combo" subtype="area, pline, point, line" name="combo1" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
combo | Combo with bar, pline, point, & line
%CHART{ type="combo" subtype="bar, pline, point, line" name="combo2" table="exampleTable2" data="R2:C2..R5:C6" xaxis="R1:C2..R1:C6" legend="R2:C1..R5:C1" width="225" height="200" }% | | ChartPlugin error: Required Perl module 'GD' not found |
|
|
The "if installed" column shows images instead of variables in case the plugin is installed correctly.
|
|
pub/TWiki/ChartPlugin/area3.png | Sample area image |
pub/TWiki/ChartPlugin/scatter1.png | Sample scatter image |
pub/TWiki/ChartPlugin/combo1.png | Sample combo image |
|
> > |
pub/TWiki/ChartPlugin/combo2.png | Sample combo image |
|
|
pub/TWiki/ChartPlugin/lineexample.png | Sample line image |
pub/TWiki/ChartPlugin/areaexample.png | Sample area image |
pub/TWiki/ChartPlugin/scatterexample.png | Sample scatter image |
|
|
Plugin Info
|
< < |
Plugin Version: | 13 May 2004 (V1.300) |
|
> > |
Plugin Version: | 30 Aug 2004 (V1.400) |
|
|
Change History: | <!-- specify latest version first --> |
|
> > |
30 Aug 2004: | V1.400 - Added support for subtype="bar" (includes various global bar settings), updated gridcolor to not only define the grid color but allowing the user to define the line style (for drawing user defined dotted lines), add a global for how wide lines are drawn instead of a hard coded value, change the order of how things are drawn so now the order is: areas, grid lines and X/Y axis labels, bars, lines/points/plines, rectangle around chart, data point labels, chart title/X/Y labels, and finally the legends. |
|
|
13 May 2004: | V1.300 - Added support for type="scatter" ; renamed type="arealine" to "combo" (arealine is undocumented); renamed datatype to subtype (datatype is undocumented); added subtype options "point" and "pline" , added new settings GRIDCOLOR , DEFAULTDATA , POINTSIZE ; fixed bug with how the number of grids were drawn |
17 Oct 2003: | V1.201 - Fix boundary cases with semilog scale |
16 Oct 2003: | V1.200 - Add new options of scale and ytics. |
|
|
Related Topics: TWikiPreferences, TWikiPlugins
|
< < |
-- TWiki:Main.TaitCyrus - 13 May 2004
-- TWiki:Main.PeterThoeny - 14 May 2004
|
> > |
-- TWiki:Main.TaitCyrus - 3 June 2004
-- TWiki:Main.PeterThoeny - 30 Aug 2004
|
|
|
< < |
META FILEATTACHMENT | line1.png | attr="h" comment="" date="1084659379" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\line1.png" size="987" user="PeterThoeny" version="1.3" |
META FILEATTACHMENT | line2.png | attr="h" comment="" date="1084659390" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\line2.png" size="2023" user="PeterThoeny" version="1.3" |
|
> > |
META FILEATTACHMENT | line1.png | attr="h" comment="" date="1093917753" path="line1.png" size="1220" user="PeterThoeny" version="1.4" |
META FILEATTACHMENT | line2.png | attr="h" comment="" date="1093917765" path="line2.png" size="1993" user="PeterThoeny" version="1.4" |
|
|
META FILEATTACHMENT | lineexample.png | attr="h" comment="" date="1084659332" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\lineexample.png" size="2462" user="PeterThoeny" version="1.1" |
|
< < |
META FILEATTACHMENT | area3.png | attr="h" comment="" date="1084659264" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\area3.png" size="1813" user="PeterThoeny" version="1.3" |
|
|
META FILEATTACHMENT | areaexample.png | attr="h" comment="" date="1024533210" path="C:\Data\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\areaexample.png" size="3370" user="PeterThoeny" version="1.1" |
|
< < |
META FILEATTACHMENT | arealine4.png | attr="h" comment="" date="1034358891" path="C:\Data\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\arealine4.png" size="2102" user="PeterThoeny" version="1.2" |
META FILEATTACHMENT | arealineexample.png | attr="h" comment="" date="1024533223" path="C:\Data\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\arealineexample.png" size="4211" user="PeterThoeny" version="1.1" |
META FILEATTACHMENT | combo1.png | attr="h" comment="" date="1084659291" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\combo1.png" size="1712" user="PeterThoeny" version="1.1" |
|
> > |
META FILEATTACHMENT | combo1.png | attr="h" comment="" date="1093917959" path="combo1.png" size="1696" user="PeterThoeny" version="1.2" |
|
|
META FILEATTACHMENT | comboexample.png | attr="h" comment="" date="1084659314" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\comboexample.png" size="3071" user="PeterThoeny" version="1.2" |
|
< < |
META FILEATTACHMENT | scatter1.png | attr="h" comment="" date="1084659368" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\scatter1.png" size="1000" user="PeterThoeny" version="1.1" |
META FILEATTACHMENT | scatterexample.png | attr="h" comment="" date="1084659348" path="C:\DATA\MyTWiki\Plugins\ChartPlugin\pub\TWiki\ChartPlugin\scatterexample.png" size="3231" user="PeterThoeny" version="1.1" |
|
> > |
META FILEATTACHMENT | scatter1.png | attr="h" comment="" date="1093917951" path="scatter1.png" size="2071" user="PeterThoeny" version="1.2" |
META FILEATTACHMENT | scatterexample.png | attr="h" comment="" date="1093918171" path="scatterexample.png" size="1858" user="PeterThoeny" version="1.2" |
META FILEATTACHMENT | area1.png | attr="h" comment="" date="1093917730" path="area1.png" size="1774" user="PeterThoeny" version="1.1" |
META FILEATTACHMENT | bar1.png | attr="h" comment="" date="1093917742" path="bar1.png" size="1041" user="PeterThoeny" version="1.1" |
META FILEATTACHMENT | combo2.png | attr="h" comment="" date="1093917971" path="combo2.png" size="1583" user="PeterThoeny" version="1.1" |
META FILEATTACHMENT | barexample.png | attr="h" comment="" date="1093918158" path="barexample.png" size="1886" user="PeterThoeny" version="1.1" |
|