This allows you to generate charts from either static HTML pages, or
from any web development environment, such as PHP (http://www.php.net/),
or from shell or perl CGI scripts, etc.
To produce a chart, you build a URL using the "owtchart" CGI path, and you add chart parameters in the QUERY_STIRNG part of the URL. See section 5 (below) for the list of chart parameters.
OK, this probably was not very clear... the best way to learn how to use the OWTChart engine is probably to look at some examples.
The following examples assume that the "owtchart" application is installed and is accessible at the URL "http://www.host.addr/cgi-bin/owtchart".
Let's start with a simple line chart:
http://www.host.addr/cgi-bin/owtchart?Type=Line&W=300&H=200&NumSets=1&NumPts=5&Vals=2!5!4!7!5And add a Title and labels along the X axis:
http://www.host.addr/cgi-bin/owtchart?Type=Line&W=300&H=200&NumSets=1&NumPts=5&Vals=2!5!4!7!5&Title=Chart+Title&XLabels=A;B;C;D;ENow, turn it into a 3D bar chart:
http://www.host.addr/cgi-bin/owtchart?Type=3DBar&W=300&H=200&NumSets=1&NumPts=5&Vals=2!5!4!7!5&Title=Chart+Title&XLabels=A;B;C;D;EAnd finally, add 1more set of bars, drawn in red, besides each other:
http://www.host.addr/cgi-bin/owtchart?Type=3DBar&W=300&H=200&NumSets=2&NumPts=5&Vals=2!5!4!7!5!1!4!3!3!4&Title=Chart+Title&XLabels=A;B;C;D;E&SetColors=0000FF!FF0000&StackType=Beside
Any other character must be escaped, the most frequent case is spaces that have to be converted to "+" characters, see RFC2396 for more details on the escaping of URLs.
Malformed URLs may work on some systems, but may not on others... it
really depends on the HTTP server you are running, it has nothing to do
with the OWT chart engine itself.
Let's reuse the examples from section 3.2 above and look at the input files that would produce the same charts:
A simple line chart:
Type=LineAdd a Title and labels along the X axis:
W=300
H=200
NumSets=1
NumPts=5
Vals=2!5!4!7!5
Type=LineTurn it into a 3D bar chart:
W=300
H=200
NumSets=1
NumPts=5
Vals=2!5!4!7!5
Title=Chart Title
XLabels=A;B;C;D;E
Type=3DBarAdd 1 more set of bars, drawn in red, besides each other:
W=300
H=200
NumSets=1
NumPts=5
Vals=2!5!4!7!5
Title=Chart Title
XLabels=A;B;C;D;E
Type=3DBar
W=300
H=200
NumSets=2
NumPts=5
Vals=2!5!4!7!5!1!4!3!3!4
Title=Chart Title
XLabels=A;B;C;D;E
SetColors=0000FF!FF0000
StackType=Beside
Name | Value | Description |
|
||
TYPE | Line Area Bar FloatingBar HiLoClose (HLC) Pie HBar H2Bar Combo_Line_Bar Combo_HLC_Bar Combo_Line_Area Combo_Line_Line Combo_HLC_Area 3DLine 3DArea 3DBar 3DFloatingBar 3DHiLoClose 3DPie 3DHBar 3DH2Bar 3DCombo_Line_Bar 3DCombo_HLC_Bar 3DCombo_Line_Area 3DCombo_Line_Line 3DCombo_HLC_Area |
Chart type. |
VALS | list | List of values to chart, separated by ";", "_", or "!": eg: "12.2;10.0;9.8;5.3;7.5" or "12.2!10.0!9.8!5.3!7.5" (The advantage of using "!" as a separator is that it does not need to be escaped inside URLs, but ";" has to be escaped, and its use can increase considerably the size of a URL) The number of values should be: for simple charts: NumPts*NumSets |
NumPts | integer | Number of points (values) along the X axis. (or number of slices in the case of a Pie chart.) |
|
||
NumSets | integer | Number of sets of values (i.e. for multiline, etc., Default = 1) Combo charts are only supported with NumSets=1 (i.e. 1 set for each Y axis). |
W | integer | Width of GIF image to create (Default = 300) |
H | integer | Height of GIF image (Default = 200) |
XLabels | list | List of (NumPts) labels for the X axis (or for each slice in a pie chart),
separated by semicolons. eg: "Label 1;Label 2;Label 3;Label 4" For now, labels cannot contain semicolons... this limitation will eventually be removed. |
Title | string | Main chart title, can contain line breaks. Semicolons (;) anywhere in the string will be replaced by line breaks. eg: "Title line 1;line2;line3" |
YTitle | string | Y Axis title |
XTitle | string | X Axis Title |
YTitle2 | string | Right-hand Y Axis title (for COMBO types) |
LTitle | string | For H2BAR types: Sub-title for the left side of the chart. |
RTitle | string | For H2BAR types: Sub-title for the right side of the chart. |
BGColor | color | Background color, Default = white (FFFFFF) |
GridColor | color | Grid lines color, default = grey |
LineColor | color | Color for the axis, default = black |
PlotColor | color | Color to use for plotting values, default=blue (0000FF) (See also: SetColors) |
SetColors | list of colors | Color to use for each set of data, separated by ";", "!", or "_". Supercedes PlotColor (See also: ExtColors) e.g. "FF0000;00FF00;0000FF" or "FF0000!00FF00!0000FF" |
ExtColors | list of colors | Color to use for each unit of data, separated by ";", "!", or "_". Supercedes SetColors e.g. "FF0000;00FF00;0000FF" or "FF0000!00FF00!0000FF" |
VolColor | color | |
TitleColor | color | Color for "Title", "LTitle", and "RTitle", default = opposite of BG. |
XTitleColor | color | Color for "Xtitle", default = "PlotColor". |
YTitleColor | color | Color for "YTitle", default = "PlotColor". |
YTitle2Color | color | Color for "YTitle2", default = "PlotColor". |
XLabelColor | color | Color for "Xlabels", default = "LineColor" |
YLabelColor | color | Color for Y value labels, default = "LineColor" |
YLabel2Color | color | Color for right-hand Y axis value labels, default = "VolColor" |
YLabelFmt | Format string | Printf format string (using %f, %e or %g) to use for Y axis labels, default = "%g" |
YLabel2Fmt | Format string | Printf format string (using %f, %e or %g) to use for right-hand Y axis labels, default = "%g" |
TitleFont | Font size |
Font size to use for "Title", "LTitle", and "RTitle",
default = MedBold.
|
XTitleFont | Font size | Font size for "Xtitle", default = MedBold |
YTitleFont | Font size | Font size for "YTitle", default = MedBold |
XLabelFont | Font size | Font size for "XLabels", default = Small |
YLabelFont | Font size | Font size for Y value labels, default = Small |
PieLabelFont | Font size | Font size for Pie labels, default = Small |
TranspBG | boolean | 0 = Opaque Background (the default) 1 = Transparent Background |
Grid | boolean | 0 = no grid, 1 = turn grid on (the default) |
XAxis | boolean | 0 = no X axis 1 = draw X axis (the default) |
YAxis | boolean | 0 = no Y axis 1 = draw Y axis (the default) |
YAxis2 | boolean | Draw right-hand Y axis in COMBO charts, default = 1 |
StackType | DEPTH SUM BESIDE LAYER |
How to stack multiple sets of values. Default = DEPTH |
3DDepth | integer | % of GIF size, default = 10% for pie charts, and 5% for all other types. |
3DAngle | integer | 3D Angle, 1-89°, default = 45° |
BarWidth | integer | % of interval for 1 bar along X axis, default = 75% |
LineStyles | list of style definitions |
For 2D line chart types: contains NumSets line style definitions, separated
by ";", "!", or "_".
Each line style definition is a character string in which spaces are
transparent pixels, and any other character will draw a pixel of the
line's color. Examples:
"xxxxxx !xx !xxxxxx xx " |
YScaleType | LINEAR LOG |
Y scale type, default is LINEAR scale. |
PiePctType | NONE ABOVE BELOW RIGHT LEFT |
Position of percentage labels on pie charts relative to the label itself. Default = RIGHT |
HLCStyle | integer | For HLC (Hi-Lo-close) charts, this parameter defines the style to use.
The following values can be OR'd:
1 = Diammond (the close value is represented with a diammond) |
HLCCapWidth | integer | For HLC charts, cap width, percentage (1-100) of available space. Default is 25%. |
YMin | float | Minimum value for the Y axis. |
YMax | float | Maximum value for the Y axis. |
YInterval | float | Requested interval value for the Y axis. |
YMin2 | float | Minimum value for the secondary Y axis (combo charts). |
YMax2 | float | Maximum value for the secondary Y axis (combo charts). |
PieRadius | float | Requested pie radius. Overrides default radius based on label size, etc. |