From 7249a1d947680ece4b45ce84d478601da465dbba Mon Sep 17 00:00:00 2001
From: Adam Amstrong AQE6H*% It is common to group activities. We have used this feature in the
+ examples of constrains. There is no special type for activity bars that
+ are used to illustrate grouping. The common way of illustrating this
+ (as have been used above) is to add "half" a triangle marker at both
+ ends of the bar. The special provision that JpGraph does is that if you
+ add a left or right marker of type MARK_LEFTTRIANGLE or
+ MARK_RIGHTTRIANGLE those triangles will be drawn under the bars to give
+ the effect as show in the examples above. In the example above we also
+ have made the grouping bars have slightly less heigh since the end
+ triangles will visually "grow" the bar. So to get the effect we want for a group bar we have to use the two
+ lines: As of the current version There is not yet any formatting support to
+ accomplish the effect of indentation for the titles so this is
+ accomplished by using a fixed width font and adding spaces in front of
+ the title. Precisely as before you can also have a title spanning all the
+ columns. This title is specified with the property tableTitle of
+ the scale. Specifying a table title will automatically adjust the
+ height of the column titles to fit the table title. The small code
+ snippet below shows how to add a title.";
-$mi = "
";
diff --git a/html/includes/jpgraph/QPL.txt b/html/includes/jpgraph/QPL.txt
new file mode 100644
index 0000000000..66986cb17c
--- /dev/null
+++ b/html/includes/jpgraph/QPL.txt
@@ -0,0 +1,119 @@
+THE Q PUBLIC LICENSE version 1.0
+
+Copyright (C) 1999 Trolltech AS, Norway.
+ Everyone is permitted to copy and
+ distribute this license document.
+
+The intent of this license is to establish freedom to share and change
+the software regulated by this license under the open source model.
+
+This license applies to any software containing a notice placed by the
+copyright holder saying that it may be distributed under the terms of
+the Q Public License version 1.0. Such software is herein referred to
+as the Software. This license covers modification and distribution of
+the Software, use of third-party application programs based on the
+Software, and development of free software which uses the Software.
+
+
+Granted Rights
+
+1. You are granted the non-exclusive rights set forth in this license
+ provided you agree to and comply with any and all conditions in
+ this license. Whole or partial distribution of the Software, or
+ software items that link with the Software, in any form signifies
+ acceptance of this license.
+
+
+2. You may copy and distribute the Software in unmodified form
+ provided that the entire package, including - but not restricted to
+ - copyright, trademark notices and disclaimers, as released by the
+ initial developer of the Software, is distributed.
+
+
+3. You may make modifications to the Software and distribute your
+ modifications, in a form that is separate from the Software, such
+ as patches. The following restrictions apply to modifications:
+
+ a. Modifications must not alter or remove any copyright notices in the
+ Software.
+
+ b. When modifications to the Software are released under this license,
+ a non-exclusive royalty-free right is granted to the initial developer
+ of the Software to distribute your modification in future versions of
+ the Software provided such versions remain available under these terms
+ in addition to any other license(s) of the initial developer.
+
+
+4. You may distribute machine-executable forms of the Software or
+ machine-executable forms of modified versions of the Software,
+ provided that you meet these restrictions:
+
+ a. You must include this license document in the distribution.
+
+ b. You must ensure that all recipients of the machine-executable forms
+ are also able to receive the complete machine-readable source code to
+ the distributed Software, including all modifications, without any
+ charge beyond the costs of data transfer, and place prominent notices
+ in the distribution explaining this.
+
+ c. You must ensure that all modifications included in the
+ machine-executable forms are available under the terms of this
+ license.
+
+
+5. You may use the original or modified versions of the Software to
+ compile, link and run application programs legally developed by you
+ or by others.
+
+
+6. You may develop application programs, reusable components and other
+ software items that link with the original or modified versions of
+ the Software. These items, when distributed, are subject to the
+ following requirements:
+
+
+
+ a. You must ensure that all recipients of machine-executable forms of
+ these items are also able to receive and use the complete
+ machine-readable source code to the items without any charge beyond
+ the costs of data transfer.
+
+
+ b. You must explicitly license all recipients of your items to use and
+ re-distribute original and modified versions of the items in both
+ machine-executable and source code forms. The recipients must be able
+ to do so without any charges whatsoever, and they must be able to
+ re-distribute to anyone they choose.
+
+
+ c. If the items are not available to the general public, and the
+ initial developer of the Software requests a copy of the items, then
+ you must supply one.
+
+
+Limitations of Liability
+
+In no event shall the initial developers or copyright holders be
+liable for any damages whatsoever, including - but not restricted to -
+lost revenue or profits or other direct, indirect, special, incidental
+or consequential damages, even if they have been advised of the
+possibility of such damages, except to the extent invariable law, if
+any, provides otherwise.
+
+
+No Warranty
+
+The Software and this license document are provided AS IS with NO
+WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN,
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+
+Choice of Law
+
+This license is governed by the Laws of Norway. Disputes shall be
+settled by Oslo City Court.
+
+
+
+
+
diff --git a/html/includes/jpgraph/README b/html/includes/jpgraph/README
new file mode 100644
index 0000000000..c17ed7c8bb
--- /dev/null
+++ b/html/includes/jpgraph/README
@@ -0,0 +1,162 @@
+README FOR JPGRAPH
+==================
+
+This package contains JpGraph, an Object Oriented PHP4 Graph Plotting library.
+
+The library is Copyright (C) 1999-2009 Aditus Consulting and
+released under dual license QPL 1.0 for open source and educational
+use and JpGraph Professional License for commercial use.
+
+Please see full license details at http://www.aditus.nu/jpgraph/
+
+* --------------------------------------------------------------------
+* PHP5 IS NOT SUPPORTED IN THE 1.x SERIES
+* Please use the 2.x serie if PHP5 support is required
+* --------------------------------------------------------------------
+
+
+Included files
+--------------
+README This file
+QPL.txt QPL 1.0 Licensee
+
+/src
+ jpg-config.inc.php Configuration setup for JpGraph
+ jpgraph.php Base library
+ jpgraph_errhandler.inc.php Base library. Error handler module.
+ gd_image.inc.php Base library. GD interface class
+ jpgraph_ttf.inc.php Base library. TTF font handling
+
+ jpgraph_led.php Extension: LED digits module
+ jpgraph_log.php Extension: logarithmic scales
+ jpgraph_date.php Extension: date/time scales
+ jpgraph_line.php Extension: line plots
+ jpgraph_bar.php Extension: bar plots
+ jpgraph_error.php Extension: error plots
+ jpgraph_scatter.php Extension: scatter/impulse plots
+ jpgraph_radar.php Extension: radar plots
+ jpgraph_pie.php Extension: pie plots
+ jpgraph_pie3d.php Extension: 3D pie plots
+ jpgraph_canvas.php Extension: drawing canvas
+ jpgraph_canvtools.php Extension: utility classes for working with canvas
+ jpgraph_gantt.php Extension: Gantt chart
+ jpgraph_regstat.php Extension: Statistics and cubic splines.
+ jpgraph_stock.php Extension: Stock and box plots.
+ jpgraph_gradient.php Extension: Color gradient class
+ jpgraph_gb2312.php Extension: Chinese GB2312 to Unicode translation
+ jpgraph_plotmark.php Extension: Handle plotmarks in plots
+ jpgraph_imgtrans.php Extension: Basic image transformation
+ jpgraph_flags.php Extension: Country flags
+ jpgraph_iconplot.php Extension: Use image icons in plots
+ jpgraph_plotband.php Extension: Plotbands in graphs
+ jpgraph_plotmark.inc.php Extension: Using plotmarks in graphs
+ jpgraph_antispam.php Extension: Antispam module
+ jpgraph_antispam-digits.php Extension: Antispam module
+ jpgraph_utils.inc.php Extension: Non mandatory Utility classes
+ jpgraph_mgraph.php Extension: Multi graph
+ imgdata_*.inc Extension: Encoded images for plot marks
+ flags*.dat Raw Image data: Pre-compiled data for country flags.
+
+/src/Examples A directory with example sripts.
+ Run testsuit.php to get a list of all
+ files and you can easily click on a file to
+ see the code and the resulting image.
+
+/docs Directory with all documentation
+/docs/index.html Documentation portal
+
+/lang
+ de.inc.php German translation of error messages
+ en.inc.php English version of error messages
+ prod.inc.php Production version of error messages (does not
+ give specific details in error message.)
+Requirements:
+-------------
+Miminum:
+* PHP 4.4.1 or higher
+ (earlier versions might work but is unsupported)
+* GD 2.0.30 or higher
+ (earlier versions might work but is unsupported)
+
+Recommended:
+* PHP 4.4.9
+* PHP Builtin GD 2.0.34 library
+
+Installation
+------------
+0. Make sure that the PHP version is compatible with the stated requirements
+ and that the PHP installation has support for the GD library.
+ Please run phpinfo() to check if GD library
+ is supported in the installation.
+ If the GD library doesn't seem to be installed
+ please consult the PHP manual under section "Image" for
+ instructions on where to find this library. Please refer to
+ the manual section "Verifying your PHP installation"
+
+1. Unzip and copy the files to a directory of your choice where Your
+ httpd sever can access them.
+ For a global site installation you should copy the files to
+ somewhere in the PHP search path.
+
+2. Check that the default directory paths in jpg-config.inc
+ for cache directory and TTF directory suits your installation.
+ Note1: The default directories are different depending on if
+ the library is running on Windows or UNIX.
+ Note2: Apache/PHP must have write permission to your cache
+ directory if you enable the cache feature. By default the cache
+ is disabled.
+
+3. Check that all rest of the DEFINE in jpg-config.inc
+ is setup to your preference. The default should be fine
+ for most users. (See also Note 3. below)
+
+4. If any problems are encounted please start by reading the FAQ on
+ http://www.aditus.nu/jpgraph/jpgraphfaq.php.
+
+
+Documentation
+-------------
+The installation includes HTML documentation and reference guide for the
+library. The portal page for all the documentation is
+
zEI#{Wv%)AA!?|2RS2_M&k333CkSUn>6{g%9FqEi_c5Pj(<**3#v_
zs8~YdP7>fLdL#|;x=_Vu)vFD#zQc}iwVGY4#%GpfOoO#A8JMqqot_4vVpY|~IbU{r
zfp3-5P*FEf$6SA?cocAPaB?cBUJJ=T!Qet!*=@Oh0H*haUf?bdb@Z8DM00VHdsjH!_H0_|?ErEY+W<>7C)?#F_T9k#$f`DMOC
z#wNuD2~F_wT?^Q52tNZ(uw
+10.10 Grouping activities
+
+ $groupbar->
+leftMark->
+SetType(
+"MARK_LEFTTRIANGLE");
+
$groupbar
+->rightMark->SetType(
+"MARK_RIGHTTRIANGLE")
+
+Contents
+Previous
+Next
+
+
diff --git a/html/includes/jpgraph/docs/html/10111Addingatitleforthecolumns.html b/html/includes/jpgraph/docs/html/10111Addingatitleforthecolumns.html
new file mode 100644
index 0000000000..e1fa224fd0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/10111Addingatitleforthecolumns.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+Contents
+Previous
+Next
+
+10.11.1 Adding a title for the columns
+ $graph
+->scale->tableTitle->
+Set('Phase 1');
+
$graph->scale->
+tableTitle->
+SetFont(
+FF_ARIAL,
+FS_NORMAL,12);
+
$graph->scale->
+SetTableTitleBackground(
+'darkgreen@0.6');
+
$graph->scale->
+tableTitle->
+Show(true);
A full example of this is shown below
+ +In exactly the same way as for a single title it is possible to + specify individual CSIM targets for each of the title columns. This is + accomplished by specifying an array for both the target and the alt + text instead of a single string as arguments for SetCSIMTarget() + The following code snippet shows how to specify that.
$bar
+->title->SetCSIMTarget(array('sometarget1.html','sometarget1.html'),
+
array('alttext1'
+,'alttext2'));
It is often of interest not only to show one title for a gantt bar + but often one wants to show, title, start date, end date, duration or + effort and so on. Up until now we have, to keep things simple only + shown a single title for each activity. We will now show you how you + can specify an arbitrary number of columns as titles for a Gantt chart + as well as adding icons in the graph columns.
+First out is an example to help visualize what we will achieve
+To use multiple columns there is two steps. First you need to set + the titles (name, color, fonts etc). Thereafter you need to add the + title columns for each individual bar.
+To set the columns you will have to work with the Activity + information property of the scale. The following code excerpt show + this
+ $graph->scale->actinfo
+->SetColTitles
+(
+
array('Note'
+,'Task','Duration',
+'Start',
+'Finish'),array(
+30,100));
You will notice two things. We fist specify the titles using an + array. We have also specified a second array with the numbers 30 and + 100. This is an optional array that specifies the minimum width of, in + this case, the first two columns. By default the columns will be wide + enough to hold the widest text string in the column. However for + esthetic reasons you might sometimes want to increase the minium width. + This is what we have done here for the first two columns.
+Furthermore you can also adjust the background colors and the style + and colors of the vertical dividing grid lines. In the previous image + we used the lines
$graph->
+scale->actinfo->SetBackgroundColor('green:0.5@0.5');
+
$graph->scale->
+actinfo->
+SetFont(
+FF_ARIAL,
+FS_NORMAL,10);
+
$graph->scale->
+actinfo->vgrid->SetStyle
+('solid');
+
$graph->scale->
+actinfo->vgrid->SetColor
+('gray');
The style for the grid lines can also be "dashed", "dotted" or + "longdashed" as in other line formatting contexts within the library. + You can also adjust if you would like the small "3D" effect in the + titles. By default this is enabled. You can easily turn this of with a + call to
+ $graph->scale->actinfo
+->SetStyle(ACTINFO_2D);
+
To adjust the colors of the vertical dividing lines in the title the + method SetColor() is used as in + "$graph->scale->actinfo->SetColor('navy');".
+The second thins is to actually populate the columns. This is done + (of course) as you add the activity bars to the graph. Previous we just + used a string as the title when we wasn't using columns. By simply + replacing this string with an array we specify the content of the + columns.
+For example to specify two column titles we just create a + hypothetical Gantt bar as In the full example above we put all this in + arrays to make for better coding practice since we create several bars.
+In addition to ordinary text you can also add an image or any of the + predefined icons available. In order to add that in a column you first + create an instance of IconImage() and then specify that instance + instead of the text. So in the previous code snippet if we wanted a + "open folder" image in the first column we would change the lines to
+ $iconopen = new
+IconImage(
+GICON_FOLDEROPEN,
+0.6);
+
$title2="";
+
$bar
+= new GanttBar
+(0,array($iconopen,
+$title2),
+"2003-11-23",
+"2003-12-05");
+
The available builtin icons are
+In addition you can also use any of you own images if you specify + the argument as a string, for example
+ $myicon = IconImage(
+'myicon.png');
+
If you wonder, the second argument in the IconImage() call is + an optional scaling factor which you can use to adjust the size of the + image.
+The (default) white area in the top left of the gantt table may have + a title. This is accessed by the 'tableTitle' property of the gantt + scale. Using this is straightforward as the following lines show.
$graph
+->scale->tableTitle->
+Set(
+"(Rev: 1.22)");
+
$graph->scale->
+tableTitle->
+SetFont(
+FF_FONT1,
+FS_BOLD);
+
$graph->scale->
+SetTableTitleBackground(
+"silver");
+
$graph->scale->
+tableTitle->
+Show();
+
The example lines above also changes the default white background to + silver. Adding these lines to the previous example gives the following + result:
+From the above example you might notice that the width of the left + column (which holds all the titles) have automatically adjusted itself + to make the table title fit.
+The vertical and horizontal lines between the titles and the bars + can be modified by accessing the 'divider' and 'dividerh' properties of + the scale. Again, this is straightforward as the following example + shows:
+ $graph->scale->divider
+->SetWeight(3);
+
$graph->scale->
+divider->
+SetColor(
+"navy");
+
$graph->scale->
+dividerh->
+SetWeight(3);
+
$graph->scale->
+dividerh->
+SetColor(
+"navy");
+
The effect of this is shown in Figure 163 below
+ +In a similar manner to the other plots in JpGraph you modify the Box + round the plot with the standard graph method 'SetBox()' as in
$graph
+->SetBox(true,
+"navy",3)
which will result in a thicker plot box around the area as shown + below
+In order to make large charts easier to read it is possible to + specify alternating an horizontal grid and optional alternating line + colors in the background for Gantt charts. The horizontal grid is + accessed through the Graph::hgrid property and the line (used in + the grid) is accessed through the Graph::hgrid::line + sub-property
+In order to specify the alternating line colors the + SetRowFillColor() method is used. For example, to use alternating + blue background with blue grid line the following lines would have to + be added to the graph script
+
+// Setup a horizontal grid
+
$graph->hgrid->
+Show();
+
$graph->hgrid->
+line->SetColor('lightblue'
+);
+
$graph->hgrid->
+SetRowFillColor(
+'darkblue@0.9');
+
Below is an example of a Gantt graph using this formatting
+ +
+ $icon = new IconPlot(
+'penguin.png',
+0.01,0.95,1
+,15);
+
$icon->SetAnchor(
+'left',
+'bottom');
+
$graph->Add(
+$icon);
+
$graph
+= new GanttGraph
+(500);
+
$graph->SetMargin(
+0,0,30
+,0);
In this section we will show a few more way by which you may + customize the gantt chart itself. This includes
+As we have shown in the previous examples constructing a Gantt chart + consists of a number of repetitive tasks; Create the individual + activity bars and add them to the graph.
+Now when you have a basic understanding of how this works you are + ready to appreciate a small helper method. +GanttGraph::CreateSimple(). This method takes a few arrays of data + which specifies you Gantt chart and then constructs this chart. By + using this method you sacrifices a few adjustment possibilities for + simplicity. This method is nothing magical it just takes the data for + the activities,(start and end date, titles, progress, any constrains + and so on) and constructs the activities and adds them to the graph.
+The activities are specified in data array which for each activity + have the following fields
+So for example to create a Gantt chart consisting of two activities + which are grouped and a milestone one would have to use something + similar to the following code
+
+ $data = array(
+
array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26",
+"2001-11-23",
+""),
+
array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26",
+"2001-11-13",
+"[KJ]"),
+
array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20",
+"2001-11-22",
+"[EP]"),
+
array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",
+"M2") );
+
+
// Create the basic graph
+
$graph
+= new GanttGraph
+();
+
$graph->title->
+Set(
+"Gantt Graph using CreateSimple()");
+
+
// Setup scale
+
$graph->ShowHeaders(
+GANTT_HYEAR |
+GANTT_HMONTH |
+GANTT_HDAY |
+GANTT_HWEEK);
+
$graph->scale->
+week->SetStyle(WEEKSTYLE_FIRSTDAY);
+
+
// Add the specified activities
+
$graph->CreateSimple(
+$data);
+
+
// .. and stroke the graph
+
$graph->Stroke();
+
This will then show up as
+You may (slightly) modify the appearance of the simple Gantt charts + by means of the methods GanttGraph::SetSimpleFont() and GanttGraph::SetSimpleStyle() But not anything else, remember + that the purpose with this way of constructing graphs is to be simple. + If you need full advanced control you have to construct all the + activities in the "normal" way.
+You can also specify constrains and progress for each bar by + supplying additional data arrays to GanttGraph::CreateSimple().
+Gantt charts can have independent (different targets) hot spots in + both the activities and in the associated labels for each activity.
+You specify the target and the associated "Alt" text for an activity + bar by calling the + GanttBar::SetCSIMTarget() and + GanttBar::SetCSIMAlt()
+In a similar way you set the target and Alt texts for the activity + title as the following code extract shows.
$bar
+->SetCSIMTarget
+("http://localhost/abc/"
+);
+
$bar->SetCSIMAlt(
+"Alt Text for the bar");
+
$bar->title->
+SetCSIMTarget(
+"http://localhost/abc");
+
$bar->title->
+SetCSIMAlt(
+"Alt Text for the title");
+
The above code assumes that your activity is available in the + variable 'bar'. In the example directory there is a complete example of + how to use CSIM together with Gantt charts in the "ganttcsimex1.php" + file. (Please note that this example makes use of the simplified Gantt + chart specification using the CreateSimple() method.
+With Gantt charts there is often the need to illustrate constrains + between one or several activities. One of the most common constrain is + that on activity can't start before an other activity finish.
+JpGraph support visualizing the following types of constrains
+An example will clarify how to specify a constrain between two + activities.
+Assume that we start with the Gantt schema as illustrated below
+We would now like to add the constrains that the activity "Label 3" + cant start before activity "Label 2" has finished and that the + milestone "Phase 1 done" is depending on when activity "Label 3" is + done.
+The principle of adding constrains is that you for each activity you + want to have a constrain you have to tell to what other activity this + constrain should be to. That other activity is specified by telling on + what row that activity lies. Depending on what type of constrain, e.g. + Start-to-End, an arrow will now connect the two activities in correct + way.
+The way to do this is to call the + SetConstrain() method on the activity. In this method you specify + the type of constrain as well as to what other activity this constrain + should be to. If you read the class reference you can also see that you + can specify the type and size of arrow used. For now we will just use + the default sizes and type.
+So for example to add an End-To-Start constrain between "Label 2" + and "Label 3" you could write
+ $bar2->
+SetConstrain(2,CONSTRAIN_ENDSTART)
The first parameter in the call above "2" is the row of the target + activity (i.e. the row where "Label 3") activity is. In the example + below we have added the constrains we wanted.
+A note: The actual path followed by the arrow is controlled by some + heuristics to make it clear what the constrain is. It has been a design + decision that in order to keep the API simple the user has no further + detailed controlled on the actual path followed. However, in future + version the heuristics may be extended and provide some + user-controllable parameters.
+You can choose to only display a vertical slice of the overall Gantt + chart by explicitly specifying a date range with the method + GanttGraph::SetDateRange(). This will cap any bars to only be displayed + in between the start and end date given as parameters. For example + specifying
+ $graph->
+SetDateRange(
+"2001-12-20",
+"2002-01-20");
+
will show the part of the Gantt chart between the 20 Dec 2001 and 20 + of January 2002. Please note that the format depends on the locale + setting.
+You can set the week start day with a call to + GanttScale::SetWeekStart(). This method takes an integer [0,6] as input + which represents the start day of the week, 0 means Sunday, 1 Monday, 2 + Tuesday and so on. The default is to start the week on Monday.
+Depending on your installation of PHP you might have support for + several locales. By default the locale is set up to use the default + locale on the server.
+To specifically set a locale you specify the wanted locale with a + locale string (ala standard PHP), for example American English is + specified with the string 'EN_US', British English with 'EN_UK' 'nl_NL' + for Dutch and so on. If your current installation does not support the + specified locale an error message will be given.
+ $graph
+->scale->SetDateLocale(
+"se_SE");
+
The result is displayed below.
+ +Anti-aliased lines are enabled by calling the method + SetAntiAliasing() in the + Image class in the script where you want to use anti-aliasing.
+The anti-aliasing for lines works by "smoothing" out the edges on + the line by using a progressive scale of colors interpolated between + the background color and the line color.
+An example will show that this, quite simple algorithm, gives a + reasonable good result. The figures below shows a radar plot with and + without anti-aliasing.
+ + + + +One thing you need to keep in mind when deciding to use + anti-aliasing is that it could have potentially a dramatic effect on + the time it takes to generate the image. Line drawing with + anti-aliasing turned on is roughly 8 times slower than the normal line + drawing so treat this feature wisely.
+Furthermore there are a couple of "gotchas" you should be aware of + when using anti-aliasing.
+From version 1.2 JpGraph supports drawing of anti-aliased lines. + There are a few caveats in order to use this which is discussed in this + section.
+JpGraph provide the possibility for you to rotate the generated + graph an arbitrary angle. This will only affect the actual graph (axis, + axis titles, labels and so on) and not fixed elements on the graph like + title or footer.
+Rotation is probably most used to rotate a graph 90 degrees, for + example a bar graph to get the effect of horizontal bars.
+ +Performance note: Adding a rotation transformation + will make the graph generation slightly slower since each point of the + graph as to go through a transformation step before being stroked on to + the image. JpGraph optimizes this by using a pre-calculated + transformation matric and also optimizes the special case 90 degrees.
+ +By default the center of the rotation will be the center of the plot + area, which may or may not coincide with the center of the entire + image.
+To control the rotation you use the two methods
+For example
+ $graph->image->SetAngle
+(45);
There is actually a third method that you could use, adding a + translation to the graph after the rotation. Since + this probably a very little used method we don't discuss it further but + refer the reader to the class reference instead + Graph:image::SetTranslation()
+ When you rotate an image you should be aware of that the individual
+ labels on the axis are not rotated. The design decision behind this is
+
a) Bit mapped font can't be rotated
+
b) Maintain readability
Please remember that you may still rotate the labels by calling the Axis::SetLabelAngle() + method.
+Since the anchor point for labels is by default the optimum for + graph at 0 degree you might want to adjust the anchor point and + alignment for the labels on the axis to get a better visual appearance + on you rotated graph. This is accomplished by the method + Axis::SetLabelAlign() For a detailed discussion on how to do this + please see the section on horizontal bar graphs, ( +Working with bar plots )
+The table below shows some examples on different kinds of rotation + to give you an idea of how changing the angle and rotation center may + be used to generate different effects. The top left graph is the + original image. The point of rotation has been marked with a red-cross + in each of the images.
+ + + + + + + +As you can see from the images above if you rotate about any other + point than the center of the plot area the plot can be placed outside + the image after rotation.
+Since the rotation, by design, only affects the plot area it is + often most effective to use when the color of the margin is the same as + the background color.
+Canvas graph is really not a graph. It a blank sheet of paper which + you can use to draw arbitrary shapes and still have access to some of + the convenient features of JpGraph.
+You can work with a canvas in different levels of complexity. You + can for example work directly with the Image class which provides a + large number of primitives for drawing but requires that you use + absolute pixel coordinates.
+You can also make life a little bit easier by using a canvas scale. + This lets you define your own scale on the canvas which often makes it + easier by letting you work on a grid you have specified yourself. It + also makes it very easy to re-scale you image automatically by just + changing your scale. For example to half the size of you drawing you + just make the scale twice as large.
+To give you some help in working with different canvas you should + include the "jpgraph_canvtools.php" file when working on canvases. This + is not strictly necessary but it will give you some nice abstraction to + help you create your masterpieces.
+As another (concrete) example on the use of a canvas the figure + below is a listing of font styles available with JpGraph.
+ +The cynical view: To explain why your project is over-due and + over-budget.
+The pragmatic view: To keep management of our back and know what we + have forgotten
+The common view: As a tool to help identify project issues and + highlight problem areas.
+Basically, Gantt charts are used to show the state of a number of + activities (possible grouped) against time.
+The following section only applies to palette images. This + means it wont work on true-color images.
+It is often desirable to have a background image look a little bit + "washed" out so it doesn't take the concentration away from the actual + graph. There are basically two ways of accomplish this
+To adjust the background image call The levels for both brightness + and contrast are real numbers in the range [-1, 1] You can choose to + adjust for example just the background image or you might also choose + to adjust the whole image. To change the background image just use the + method + Graph::AdjBackgroundImage() to specify a suitable value. Let's show + some example on what we can do with this. The following example have + been generated by using the small utility "adjimg.php" which you can + find in the "utils/" directory.
+
+
Brightness=0, contrast=0, saturation = -1 (Original image)
+
Brightness=0, contrast=0, saturation = -1 (Black & White image)
+
Brightness=0.3, contrast=-0.3, saturation=0
+
Brightness=0.4, contrast=-0.7, saturation=0
+
Brightness=0.4, contrast=-0.7, saturation=-1
+
Brightness=0, contrast=0, saturation=1
During development and optimization it can be very handy to have the + actual time it took to generate the image as a footnote. The following + example shows the usage of this feature
+To enable this feature you can proceed in two ways.
+
+ $gJpgBrandTiming=true;
+
in the beginning of the script.
+If you like you might also change the way the timing is formatted by + setting the string defined by BRAND_TIMING_FORMAT (in jpgraph.php). + This string represents a standard printf() format string.
JpGraph has built-in support for over 200 country flags, i.e. they + are available to be used in graphs without any external image + definitions.
+Country flags can be used in primarily two settings
+In order to make it easy to find the appropriate country flags they + can be specified with either full or partial name or as an numeric + index. The routines in JpGraph are "smart" enough to figure out which + way you are trying to specify a particular flag.
+To specify a country flag as a marker you have to specify the + special mark type as one of MARK_FLAG1,MARK_FLAG2,MARK_FLAG3 or + MARK_FLAG4
+Flags are internally stored in 4 different sizes which is indicated + by the number in the mark types. Flags may also be arbitrary scaled + when displayed. Since this is partially overlapping functionality you + might very well ask why the flags are stored in four different basic + sizes. The reason is of course performance. It you only want a very + small flag it takes processing time to scale down a large image to, + say, a small icon size. At the same time for large flags to be used as + background a small original flag might not have enough details to be + scaled up to a large size. Hence the reason for storing the flags in 4 + different sizes.
+The example below shows how to use country flags as markers
+To use country flags as background one has to use the method + Graph::SetBackgroundCountryFlag(). With this method you can specify + both how much of the image should be filled as well as how much of the + flag should be mixed into the background.
+To see a list of all supported country flags you can run the script + "listallcountryflags.php" in the Example directory. This will show you + a table with all flags.
+In addition to the standard background image you can also add an + arbitrary number of icons onto the background of the graph. These icons + are created with a call to the special Plot class IconPlot.
+The image from icons are taken from a file or as one of the builtin + country flags.
+You may control how much of the icon should be blended into the + background by specifying a percentage (1-100). The example below shows + how to mix in the picture of "Tux" into the background of a filled line + graph. Note: This example uses alpha blending and will therefore + require GD2.
+To specify any of the roughly 200 country flags as an icon you first + create an empty Icon and then call the IconPlot::SetCountryFlag() with + the appropriate parameters. (See the class reference). This is + illustrated below by adding the Icelandic flag into the background as + an icon
+In order to create a canvas graph you need to include the file + "jpgraph_canvas.php" in addition to the standard "jpgraph.php" file. + You might also want to include the "jpgraph_canvtools.php" to get + access to some supporting classes that may (or not) come in handy.
+Creating a canvas gives you the opportunity draw arbitrary shapes on + a "white" piece of paper. Let's first show a simple example were we + just draw a text box. We first show you the code which we will walk + through
<?php
+
+// $Id: canvasex01.php,v 1.3 2002/10/23 08:17:23 aditus Exp $
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
+
// Setup a basic canvas we can work
+
$g = new CanvasGraph(
+400,300,'auto'
+);
+
$g->SetMargin(
+5,11,6
+,11);
+
$g->SetShadow();
+
$g->SetMarginColor(
+"teal");
+
+
+// We need to stroke the plotarea and margin before we add the
+
// text since we otherwise would overwrite the text.
+
$g->InitFrame();
+
+
// Draw a text box in the middle
+
$txt="This\nis\na TEXT!!!";
+
$t = new Text(
+$txt,200,10
+);
+
$t->SetFont(
+FF_ARIAL,
+FS_BOLD,40);
+
+
+// How should the text box interpret the coordinates?
+
$t->Align(
+'center','top');
+
+
// How should the paragraph be aligned?
+
$t->ParagraphAlign(
+'center');
+
+
+// Add a box around the text, white fill, black border and gray shadow
+
$t->SetBox(
+"white",
+"black","gray");
+
+
// Stroke the text
+
$t->Stroke(
+$g->img);
+
+
// Stroke the graph
+
$g->Stroke();
+
+
?>
+
+
The example above starts by creating a (400x200) sized image. We set + the margins to get a nice frame around the image. For canvases the + margins has no effect in the way you enter coordinates. Top left is + (0,0) and bottom right (including any potential margin and shadow) is + the maximum. In this case the coordinates are X:0-399, and Y:0-199
+We then call the + InitFrame() method which actually strokes the margin and plotarea + to the graph. Since everything is stroked in the order you issue the + commands you must make sure that the graphical objects you want on top + is stroked last. This is different from the way you normally work with + JpGraph since it queues up all you addition and then makes sure they + are stroked in the correct order.
+We then create a Text object, + setup it's properties, including the absolute screen position where we + want the text, and then stroke it. Her it might be a need for a closer + explanation of the, perhaps misnamed, method +Text::Align() This method states how the text coordinates + should be interpreted , i.e when we specify (200,10) as the + coordinates for the text paragraph should that be interpreted as the + top left corner, bottom-left corner or something else (of the bounding + box)? In the code above we have chosen to interpret the X-coordinate as + being the center of the bounding box and the Y-coordinate as the top. + Hence the text will be aligned so that the (200,100) point in the graph + is aligned with the middle of the top line of the paragraphs bounding + box.
+We also specify that the lines within the paragraph should be + centered with a call to + Text::ParagraphAlign() Since we also choose to have a box around + the text we have to make use of the method + Text::SetBox() which is used to specify the fill color, the border + color and the shadow color (if you leave out shadow color or set it to + '', no shadow will be used).
+Now we are ready to stroke the text onto the canvas. In order to do + so we must specify the basic Image drawing class we want to use. + Without discussing this further we just state that a suitable image + class can always be found as the img property of the + Graph class.
+Finally we are ready to stroke the entire graph, which in effect + sends the canvas back to the browser. Below you can see the effect of + all this code
+ + +A canvas also makes a good background for using standard graphic + primitives, for example circles and lines. What you first have to + remember is that you are (so far) working with absolute screen + coordinates and secondly all drawing primitives are found in the + Image Class accessible as a property of the Graph class. So for + example to draw a line between coordinate (0,0) and (100,100) you would + have to add the line
+ $graph->img->
+Line(0,0
+,100,100);
+
To your code. The following example shows some of the graphic + primitives you have access to in the Image class
<?php
+
+// $Id: canvasex02.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
+
// Setup a basic canvas we can work
+
$g = new CanvasGraph(
+400,200,'auto'
+);
+
$g->SetMargin(
+5,11,6
+,11);
+
$g->SetShadow();
+
$g->SetMarginColor(
+"teal");
+
+
+// We need to stroke the plotarea and margin before we add the
+
// text since we otherwise would overwrite the text.
+
$g->InitFrame();
+
+
// Add a black line
+
$g->img->
+SetColor(
+'black');
+
$g->img->
+Line(0,0
+,100,100);
+
+
// .. and a circle (x,y,diameter)
+
$g->img->
+Circle(100,100
+,50);
+
+
+// .. and a filled circle (x,y,diameter)
+
$g->img->
+SetColor('red');
+
$g->img->
+FilledCircle(
+200,100,50
+);
+
+
// .. add a rectangle
+
$g->img->
+SetColor(
+'green');
+
$g->img->
+FilledRectangle(
+10,10,50
+,50);
+
+
// .. add a filled rounded rectangle
+
$g->img->
+SetColor(
+'green');
+
$g->img->
+FilledRoundedRectangle(
+300,30,350
+,80,10);
+
// .. with a darker border
+
$g->img->
+SetColor(
+'darkgreen');
+
$g->img->
+RoundedRectangle(
+300,30,350
+,80,10);
+
+
// Stroke the graph
+
$g->Stroke();
+
+
?>
+
+
Pleas note the way to access these routines through the img property + of the Graph class. Please also keep in mind that the coordinates are + absolute.
+ + + +A note on GD For those of you using GD 1.xx you + might notice that the large "filled circle" isn't completely filled. + This is because in GD 1.xx there are no low level primitives to fill an + ellipse or circle so JpGraph tries to make the best out of a bad + situation and manually fake a filled circle. For interest of speed + JpGraph does not contain a complete (for example) Bresenham-circle fill + but cheats by using some existing GD routines. This is not a perfect + solution and for large filled circles like this you get some + moire-patterns in the circle. If you upgrade to GD 2.x JpGraph will be + able to make full use of those new existing methods and the fill will + be perfect.
+ +We refer you to the class reference to find out what other graphic + primitives are available for use.
+Time to show you an example of a Gantt chart and how easy it is to + make one. Lets make it the simplest possible Gantt chart. One activity, + named "Project", which lasts from "2001-11-01" to "2002-02-20".
+All it takes to do this (using default values for everything) is the + following code.
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_gantt.php");
+
+
// A new graph with automatic size
+
$graph
+= new GanttGraph
+(0,0,
+"auto");
+
+
// A new activity on row '0'
+
$activity
+= new GanttBar
+(0,"Project",
+"2001-12-21",
+"2002-01-20");
+
$graph->Add(
+$activity);
+
+
// Display the Gantt chart
+
$graph->Stroke();
+
?>
+
The resulting image is shown in Figure + + below.
Let's note a few things with the above image and code:
+So, lets start making this graph a little bit more interesting. + First we are going to add a title, then we will add a month scale and + finally we will change the color of the bar.
+All that is taken care of in the code below.
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_gantt.php");
+
+
$graph
+= new GanttGraph
+(0,0,
+"auto");
+
$graph->SetShadow();
+
+
// Add title and subtitle
+
$graph->title->
+Set(
+"A nice main title");
+
$graph->title->
+SetFont(
+FF_ARIAL,
+FS_BOLD,12);
+
$graph->subtitle->
+Set(
+"(Draft version)");
+
+
// Show day, week and month scale
+
$graph->ShowHeaders(
+GANTT_HDAY |
+GANTT_HWEEK |
+GANTT_HMONTH);
+
+
+// Instead of week number show the date for the first day in the week
+
// on the week scale
+
$graph->scale->
+week->SetStyle(WEEKSTYLE_FIRSTDAY);
+
+
+// Make the week scale font smaller than the default
+
$graph->scale->
+week->SetFont(FF_FONT0
+);
+
+
+// Use the short name of the month together with a 2 digit year
+
// on the month scale
+
$graph->scale->
+month->
+SetStyle(
+MONTHSTYLE_SHORTNAMEYEAR2);
+
+
+// Format the bar for the first activity
+
// ($row,$title,$startdate,$enddate)
+
$activity
+= new GanttBar
+(0,"Project",
+"2001-12-21",
+"2002-01-20");
+
+
+// Yellow diagonal line pattern on a red background
+
$activity
+->SetPattern(BAND_RDIAG,
+"yellow");
+
$activity
+->SetFillColor
+("red");
+
+
// Finally add the bar to the graph
+
$graph->Add(
+$activity);
+
+
// ... and display it
+
$graph->Stroke();
+
?>
+
From the above example you might note a few things
+To show that this is really simple let's show the full year in the + month, and set the header style to be white text on a dark blue + background by adding the lines
+
+// Use the short name of the month together with a 4 digit year
+
// on the month scale
+
$graph->scale->
+month->
+SetStyle(
+MONTHSTYLE_SHORTNAMEYEAR4);
+
$graph->scale->
+month->
+SetTextColor(
+"white");
+
$graph->scale->
+month->
+SetBackgroundColor(
+"blue");
+
to the code above. The resulting image is shown in Figure 145
+ +A Gantt chart is made up of four distinct areas.
+Since a Gantt chart inherits all the usual properties of a JpGraph + Graph() you have the access to the same method to formatting the image + as before. For example to have a shadow around the image you call + Graph::SetShadow() and to set the margin color you can use + Graph::SetMarginColor(). Please refer to the reference documentation + for a full list of supported features.
+To create a Gantt chart you add objects to it. As + of this writing you may add the following object by the use of the + GanttChart::Add() method
+All these objects may be extensively modified in terms of + formatting. You can specify color (both fill- and frame color), size, + titles, style and patterns and so on. All these objects comes with (in + my mind) sensible default so you don't have to specify a lot of + parameters. But if you need a fine grain control or if you disagree + with my taste you can.
+The previous method using absolute coordinates works. But nothing + more. It doesn't give you any chance to easily scale the image (unless + you manually recalculate all used coordinates) , it gets tedious to + work with pixel level resolution. Especially if you just like to draw a + few basic shapes.
+To help with this you can use a scale for the canvas. This lets you + define a "work-space" of your choice. You can for example set the + coordinates to be between X:0-10, Y:0-10. This makes it easier to + position objects on the canvas. This also has two additional + advantages:
+To use this type of scaling you must make sure you include the file + "jpgraph_canvtools.php" . In addition to the scaling class their are + also a couple of other utility classes that may come in handy, + especially the Shape class.
+Using the scale is quite simple. You first instantiate a scale + object passing the graph as a parameter and then specify the scale you + want to use. This means you need to add the lines
$scale
+= new CanvasScale
+($g);
+
$scale->Set(
+0,$xmax,0
+,$ymax);
to your code. You can then use one of the translation methods (for + example +CanvasScale::Translate()) in the canvas scale class to translate + between your world coordinates and the absolute screen coordinates. + This means you could take the code in the example above and just add + the lines, for example,
+ list(
+$x1,$y1) = $this
+->scale->Translate(
+$x1,$y1);
+
list($x2,$y2) =
+$this->scale->Translate
+($x2,$y2);
+
$g->img->
+Line($x1,$y1
+,$x2,$y2);
+
Since this pattern has to be repeated for every object that has to + be drawn it makes good sense to encapsulate this in a separate class. + This is exactly why the canvas tools file also have a utility class + called Shape This class is + mainly a wrapper around the most commonly used methods in the basic + Image class (with one important exception) and does all these the + translation for you. Please see the class reference for a complete list + of the available methods To set up the Shape class you instantiate it + with the graphic context and the scale you want to use as argument as + in
+
+ $shape = new
+Shape($g,$scale
+);
You are then ready to use all the methods in the shape class. Using + a scale and imitating the previous example we would get the source + shown below.
<?php
+
+// $Id: canvasex03.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
include "../jpgraph_canvtools.php";
+
+
// Define work space
+
$xmax=20;
+
$ymax=20;
+
+
// Setup a basic canvas we can work
+
$g = new CanvasGraph(
+400,200,'auto'
+);
+
$g->SetMargin(
+5,11,6
+,11);
+
$g->SetShadow();
+
$g->SetMarginColor(
+"teal");
+
+
+// We need to stroke the plotarea and margin before we add the
+
// text since we otherwise would overwrite the text.
+
$g->InitFrame();
+
+
// Create a new scale
+
$scale
+= new CanvasScale
+($g);
+
$scale->Set(
+0,$xmax,0
+,$ymax);
+
+
+// The shape class is wrapper around the Imgae class which translates
+
// the coordinates for us
+
$shape
+= new Shape($g,
+$scale);
+
$shape->SetColor(
+'black');
+
+
+
// Add a black line
+
$shape->SetColor(
+'black');
+
$shape->Line(
+0,0,20
+,20);
+
+
// .. and a circle (x,y,diameter)
+
$shape->Circle(
+5,14,2
+);
+
+
+// .. and a filled circle (x,y,diameter)
+
$shape->SetColor(
+'red');
+
$shape->FilledCircle(
+11,8,3
+);
+
+
// .. add a rectangle
+
$shape->SetColor(
+'green');
+
$shape->FilledRectangle(15,
+8,19,14
+);
+
+
// .. add a filled rounded rectangle
+
$shape->SetColor(
+'green');
+
$shape->FilledRoundedRectangle(2,
+3,8,6
+);
+
// .. with a darker border
+
$shape->SetColor(
+'darkgreen');
+
$shape->RoundedRectangle(2,
+3,8,6
+);
+
+
+
// Stroke the graph
+
$g->Stroke();
+
+
?>
+
+
If we like to make a smaller image we could just change the image + size and everything will be rescaled without any further code changes. + SO for example making the image half the size would give the result
If we instead wanted to keep the image size but shrink the shapes we + could just make the scale twice as large which would result in
+ +We previously mentioned that the Shape class was a wrapper around + the image class with one exception. So what is the exception? Well, + glad you asked. The exception is that it contain an additional method + which draws an "indented rectangle". An indented rectangle is a + rectangle where one of it's four corners have been moved into the + rectangle. You create an indented rectangle by calling either + Shape::IndentedRectangle() or A few examples illustrates what this + shape looks like.
+ +As a final note we mention the class + CanvasRectangleText Which can be used to add a text with a rounded + rectangle (possibly filled) onto the canvas. The previous example where + all the available fonts were drawn were using this class. We don't + describe it further but refer the interested reader to the class + reference and the 'listfontsex1.php' example file.
+You create a new Gantt Chart with a call to GanttChart(). The + signature for GanttGraph is the same as for ordinary JpGraph graphs, + i.e
+ function
+GanttGraph(
+$aWidth,
+$aHeight,
+$aCachedName,
+$aTimeOut,
+$aInline)
+
The only real difference is that for GanttCharts you can specify one + or both of the dimension parameters (width and height) as -1 in which + case that dimension will be automatically sized determined by scale and + fonts chosen. The following examples shows some possible ways of + creating a new graph
+Since GanttGraph() inherits all the methods (that make sense for + GanttGraph) from Graph you can specify shadow, color etc of the general + frame.
+As a final example we shortly discuss how the canvas type of graph + was used to generate the DB schema for the DDDA architecture.
+The library php file "utils/misc/imgdbschema.php" included in the + distribution contains some utility classes to make the drawing of table + schemes easier. It contains two basic classes, Class ImgDBTable and + Class ImgDBSchema. The first class understand how to draw an image + illustrating a single table. The second class is responsible for + automatically extract all the relevant information from a DB to draw a + complete DB Schema.
+Before going into this a little bit more we show what an example of + this might look like.
Before going on it should be noted that the ImgDBSchema assumes that + the DB can be accessed through a DB abstraction layer modeled after the + abstraction layer available in the 'jpdb.php' file in the DDDA + architecture. This abstraction layer assumes a MySQL database in the + bottom. This specific dependency of this particular abstraction layer + is the reason why these classes is not included in the generic canvas + tools file.
+The second thing to note is that this library does not contain a + complete automatic-layout engine but rather a very simple automatic + system which, if nothing else is specified, just puts the table in a + rectangular grid. A complete graph layout engine would simple be to + much to write in this context. This is also a very difficult + optimization problem and sofar not even any of the available research + programs that tries this can achieve a satisfactory layout without + manual intervention.
+The critical lines in the code to generate the above graph is
$tblposadj=array($tlo
+,0,$tblwidth+
+$tlo+2,0
+,2*$tblwidth+
+$tlo+4,0
+,-1,16,-
+1,16);
+
$dbschema
+= new ImgDBSchema
+("jpgraph_doc"
+,"FormatTblName"
+,"FormatFldName"
+);
+
$dbschema
+->SetMargin($leftm,
+$topm);
+
$dbschema
+->SetTableWidth
+($tblwidth);
+
$dbschema
+->Stroke($this->
+img,$this->iscale
+,$tblposadj);
The rest of the code in the file is just to setup the canvas, add an + indented rectangle to group some tables and generate a footer with the + date and time this image was generated.
+The first line instantiates a new ImgDBSCheme layout engine asking + it to draw an image for the database 'jpgraph_doc'. The following two + arguments specify two callback functions for formatting the text for + header and each field in a table.
+The next line specify the top left margin where the drawing of the + tables should be started.
+The third line specify the width of a single table. The final lines + starts the engine and draws all tables in the database to the canvas. + The final argument requires some further explanation. This is an offset + (x,y) from the top left corner how each individual table should be + positioned. If the value is -1 indicates that the default value should + be used. If this array is not specified then the tables will simple + arranged line by line.
+The full source code for drawing this DB schema example is shown + below.
+ <?php
+
+/*=======================================================================
+
// File: DBSCHEMAEX1.PHP
+
// Description: Draw a DB schema of the DDDA architecture
+
// Created: 2002-08-25
+
// Author: Johan Persson (johanp@aditus.nu)
+
+// Ver: $Id: dbschemaex1.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+
//
+
// License: This code is released under QPL
+
// Copyright (C) 2001,2002 Johan Persson
+
+// Note: The actual drawing of the tables are semi-automatically
+
+// but you can easily adjust the individual tables position
+
// with the 'tblposadj' array.
+
//
+
+//========================================================================
+
*/
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
include "../jpgraph_canvtools.php";
+
include "../utils/misc/imgdbschema.inc";
+
include "../utils/jpdocgen/jpdb.php";
+
+
+
+// Global callback to format the table header names
+
function
+FormatTblName(
+$aName) {
+
+// We want to replace any specifi references to the
+
// 'JpGraph' project with the generic '<project>'
+
return
+str_replace(
+'JpGraph',
+'<project>',
+$aName);
+
}
+
+
+// Global callback to format each field name in the table
+
function
+FormatFldName(
+$aName,$aTable) {
+
return $aName
+;
+
}
+
+
+
class Driver
+{
+
+
var $ig
+, $img, $iscale,
+$ishape;
+
var $iymax
+,$ixmax;
+
var $iwidth
+,$iheight;
+
+
function Driver
+() {
+
+
+// Define Image size and coordinate grid space to work within
+
$this
+->iwidth = 600;
+
$this
+->iheight= 750;
+
$this
+->iymax = 50;
+
$this
+->ixmax = 55;
+
+
// Setup a basic canvas
+
$this
+->ig = new CanvasGraph(
+$this->iwidth,$this
+->iheight,'auto');
+
$this
+->img = $this->
+ig->img;
+
+
// Define the scale to be used
+
$this
+->iscale
+= new CanvasScale
+($this->ig);
+
$this
+->iscale->Set(
+0,$this->ixmax
+,0,$this->
+iymax);
+
$this
+->ishape
+= new Shape($this->
+ig,$this->iscale
+);
+
+
// A small frame around the canvas
+
$this
+->ig->SetMargin(
+2,3,2
+,3);
+
$this
+->ig->SetMarginColor(
+"teal");
+
$this
+->ig->InitFrame();
+
+
}
+
+
function Run
+() {
+
+
$leftm
+=1.5; // Left margin (for table schemes)
+
$topm=5;
+// Top margin (for table schemes)
+
$tblwidth
+=15; // Individual table width
+
$tlo=1;
+// Offset for top line
+
+
// Add the background color for the project specific tables
+
$this
+->ishape->IndentedRectangle($leftm,
+$topm-1,3
+*$tblwidth+$tlo+
+6,45,
+
$tlo
++2*$tblwidth+
+2,30,CORNER_BOTTOMLEFT,
+
'lightblue');
+
+
+// Stroke the tables (series of x,y offsets, If =-1 then use the
+
// automtic positioning
+
$tblposadj
+=array($tlo,0,
+$tblwidth+$tlo+2
+,0,2*
+$tblwidth+$tlo+4
+,
+
0
+,-1,16,-
+1,16);
+
$dbschema
+= new ImgDBSchema
+('jpgraph_doc'
+,'FormatTblName'
+,'FormatFldName'
+);
+
$dbschema
+->SetMargin($leftm,
+$topm);
+
$dbschema
+->SetTableWidth
+($tblwidth);
+
$dbschema
+->Stroke($this->
+img,$this->iscale
+,$tblposadj);
+
+
$tt
+= new CanvasRectangleText
+();
+
$tt->SetFillColor(
+'');
+
$tt->SetColor(
+'');
+
$tt->SetFontColor(
+'navy');
+
+
// Add explanation
+
$tt->SetFont(
+FF_ARIAL,
+FS_NORMAL,12);
+
$tt->Set(
+'Project specific tables',
+$tblwidth+
+$leftm+3,16
+,15);
+
$tt->Stroke(
+$this->img,$this
+->iscale);
+
+
// Add title
+
$tt->SetColor(
+'');
+
$tt->SetFont(
+FF_VERDANA,
+FS_BOLD,26);
+
$tt->Set(
+'DDDA - DB Schema',
+9,0.5,30
+);
+
$tt->Stroke(
+$this->img,$this
+->iscale);
+
+
// Add a version and date
+
$tt->SetFillColor(
+'yellow');
+
$tt->SetFont(
+FF_FONT1,
+FS_NORMAL,10);
+
$tt->Set(
+"Generated: ".
+date("ymd H:i",time
+()),1,$this->
+iymax*0.96,15
+);
+
$tt->Stroke(
+$this->img,$this
+->iscale);
+
+
$this
+->ig->Stroke();
+
}
+
}
+
+
$driver
+= new Driver
+();
+
$driver->Run();
+
+
?>
+
+
Bars and Milestones need both a vertical position and a horizontal + position. The horizontal start position is specified as a date, e.g. + "2001-06-23", and the vertical positions are specified as a number + [0,1,2,3,...]. This vertical number indicates the position from the top + where the object should be placed. To understand this you might imagine + a number of "invisible" horizontal bands with a certain height. If you + specify 0 as the vertical position the bar will be placed in the first + band, specify 3 and the bar will be placed in the fourth band and so + on.
+It is perfectly legal, and perhaps even desirable to leave "gaps" + when laying out bands to group related activities. So, for example you + could have three activities/bars at positions 1,2,3 and then another 2 + bars at position 6,7 leaving band 0,4,5 empty.
+All these "invisible bands" have the same height (equ-spaced). The + height of each band is automatically determined and depends on both the + method of layout ( as specified by (GanttChart::SetLayout()) and the + individual heights of the individual bars and titles. The rules are + quite simple:
+As described above vertical positions are specified as a numeric + value [0..n] where 'n' is an arbitrary constant. (For practical + purposes n is most likely < 100)
+Using our previous example we will illustrate this parameter by + changing the position of our 'Project' activity to position 7. Therefor + we change the call to GanttBar() to
+ $activity = new GanttBar(
+7,"Project","2001-12-21"
+,"2002-02-20"
+);
and we then get the chart as shown below in Figure 146.
+ +Note that the height of each position (vertical position) will + depend on the actual height of the bar.
+Start of bars are given as a date string. The format depends on the + current locale. Examples of valid date strings are
+Even if several format are supported it is recommended to use all + numeric dates, i.e in the form "2001-10-22".
+Specifying the end position may be done in two different ways, + either by the end date in the same way as for the start date. The other + way is to specify the length of the activity in number of days + (and fractions thereof). Examples of valid end dates are:
+Please note that duration is specified as numerical values and + not strings.
+Milestones are similar to bars but have no end date since milestones + just apply to one single date. Milestones are created much the same way + as activities but using method MileStone() instead.
+The full signature for milestones are
+function MileStone
+($aVPos,$aTitle,
+$aDate,
+$aCaption)
+
+
+ $aVPos
+ | The vertical position for the + bar, [0..n] | |
+
+ $aTitle
+ | Title for the activity | |
+
+ $aDate
+ | Date for the milestone | |
+
+ $aCaption
+ | Text to the right of the + milestone |
Valid milestones are for example
+
+ $milestone = new
+MileStone(3,"Code complete","2001-12-01"
+);
+ $milestone = new
+MileStone(3,"Code complete","2001-12-01"
+,"(2001-12-01)"
+);
By default milestones are rendered as a filled "Diamond" shape. This + may be optionally modified. The actual shape is specified by the 'mark' + property of milestone which is an instance of the PlotMark() class + (same class responsible for the marks in line graphs).
+To change the shape of a milestone to, say a triangle, you use the + SetType() method as in
+ $milestone->mark->
+SetType(
+MARK_DTRIANGLE)
+
Let's put this into practice and add a milestone to our previous + example by adding the following two lines of code which result in + Figure 147 shown below.
+ +You may note that by default the title color is red for milestones. + If you like to change this to be instead, say bold black, you would + invoke the SetColor() and SetFont() methods on the title property of + milestones as in
$milestone->
+title->SetFont(FF_FONT1
+,FF_BOLD);
+
$milestone
+->title->SetColor(
+"black");
+
and thew result would now (not surprisingly be)
+To modify the caption you do exactly the same but act on property + 'caption' instead of 'title', i.e.
+ $milestone->caption->
+SetFont(
+FF_FONT1,
+FF_BOLD);
+
$milestone
+->caption->SetColor(
+"black");
+
It is worth noting that you modify the bar title and caption the + exact same way by acting on the 'title' and 'caption' property for the + bars.
+The final object you may add to a Gantt chart is simple, but quite + useful, a straight vertical line extending over the whole plot height. + This could for example be used to illustrate different phases in a + project. You create a line object by a call to GanttVLine()
+The full signature for GanttVLine() is
+function GanttVLine
+($aDate,$aTitle,
+$aColor,
+$aWeight,
+$aStyle)
+
+
+ $aDate
+ | Date for the milestone | |
+
+ $aTitle
+ | Title for the line. The title is + displayed at the bottom of the line | |
+
+ $aColor
+ | Color for the line | |
+
+ $aWeight
+ | Line width | |
+
+ $aStyle
+ | Line style,"dashed", "dotted" and + so on |
Valid creations of lines are for example
+
+ $vline = new
+GanttVLine(
+"2001-12-24");
+
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1");
+
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1",
+"darkred");
+
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1",
+"darkred",5);
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1",
+"darkred",5,"dotted"
+);
To add the line to the graph you just have to call GanttGraph::Add() + as with milestones and bars. Let's illustrate the use of vertical lines + by adding a line to the previous example.
$vline
+= new GanttVLine
+("2001-12-24","Phase 1");
+
$graph->Add(
+$vline);
+
and the example (See 149) now becomes
+From the above figure you can see that by default the line is drawn + at the beginning of the day of the specified date and in a 'dashed' + style. This can (of course!) be modified so that the line is + drawn/aligned anywhere in the specified day. You modify this by + invoking the method SetDayOffset() with an argument specifying the + fraction of the day where you want the line positioned.
+If you, for example, want to display the line in the middle of the + day just add the line
+ $vline->SetDayOffset(
+0.5);
+
to the previous code and the result will be
+ +As usual you may modify the font, size and color by invoking the + appropriate method (SetFont(), SetColor()) on the 'title' property of + lines.
+You can easily add a variety of markers both to the start and end of + the gantt bar. They could for example be used as an alternate way to + illustrate important milestones or anticipated deliveries.
+The left and right markers are accessed through the two properties + 'leftMark' and 'rightMark'. They are both instances of the general + 'PlotMark' class which is also used for the milestones (and in line + graphs). The 'PlotMark' class supports several different styles, for + example, diamond (the default for milestones), filled and unfilled + circles, squares, stares, and so on. Please refer to the reference + section for a complete listing.
+Let's illustrate this by adding a right marker to the previous + example. We will use a style of a filled (red) circle with a white + title, say, "M5". In order to accomplish this we must augment the + previous example with the following lines:
$activity
+->rightMark->Show();
+
$activity
+->rightMark->title->
+Set("M5");
+
$activity
+->rightMark->SetType(
+MARK_FILLEDCIRCLE);
+
$activity
+->rightMark->SetWidth(
+10);
+
$activity
+->rightMark->SetColor(
+"red");
+
$activity
+->rightMark->SetFillColor(
+"red");
+
$activity
+->rightMark->title->
+SetFont(
+FF_ARIAL,
+FS_BOLD,12);
+
$activity
+->rightMark->title->
+SetColor(
+"white");
+
This might seem like a lot of lines but this is as complicated as it + possible can get. As an illustration in the example belwo more or less + everything that is changeable has been changed, the default font, + font-color, fill-color, frame-color and width of marker. The two lines + only really necessary are the first two, showing the mark and setting a + title. One could still get a good result by using default values for + the rest of the properties.
+The resulting image can be seen in Figure 151 below.
+We have deliberately introduced a "strangeness" here. If the + previous two examples are compared it can bee seen that the last + example is larger than the previous one. Why?
+The explanation is trivial once we recall that the height of bars + are sized relative to the horizontal spacing. The horizontal spacing + are based on the highest single bar including title size and, here come + the explanation, marker size. The horizontal spacing has grown since + the minimum height is now based on 10 points(=the height of the mark). + The bar still occupy the same percentage of the height so it seems to + have grown.
+If this behavior is unwanted it is always possible to specify an + absolute size for the bar heigh, say 8 pixels, with a call
$activity->SetHeight
+(8);
and achieve the result in Figure 152 below.
+It is worth noting that the height reserved for each bar is still + the same since we haven't changed the height of the marker and the + reserved space is the maximum height used by any bar.
+Let's see what happens if we set the height of each bar to be 100% + of the reserved height by adding another activity/bar below the first + one and set the height of each bar to 100% by adding the lines (We omit + the added lines to add another bar since they are just a copy of the + first bar)
+ $activity->
+SetHeight(1.0);
+
$activity2
+->SetHeight(1.0);
+
to the previous example. (Note that a value in the range [0..1] is + interpretated as the fraction of the reserved height while a value > 1 + is interpretated as the absolute size in pixels.)
+Aha.. What we are trying to do doesn't really make sense. Since we + have specified that the bar will always occupy 100% of the available + reserved with there will be no distance between the bars. So what if we + specify the bar as 10 pixel absolute by changing the lines to
$activity->SetHeight
+(10);
+
$activity2
+->SetHeight(10);
+
we instead get
+So what can we actually do? Well if you remember the reserved height + for each bar is the maximum height of all bars including titles. This + guarantees that no two bars will ever overlap. To guarantee that titles + don't end up too close together there is a Vertical Label Margin + which basically specifies some extra "air" in between the titles. The + amount of air is specified in percent of the title height. To set the + margin you use
+ GanttGraph::
+SetLabelVMarginFactor(
+$aMargin)
+
As an example let's set that margin in the previous example to 0 and + see what happens.
+As you would perhaps expect the two bars just barely touches now + since there are no extra margin added. If the two bars hadn't had the + extra right marker it would have looked very compressed.
+By default the vertical margin is set to 40%.
+The most common of all object in a Gantt chart is of course the + activity bar (GanttBar()). In terms of formatting this object has a + very large flexibility. The full signature for the GanttBar constructor + is
+ function
+GanttBar(
+$aVPos,$aTitle,$aStart
+,$aEnd,$aCaption,
+$aHeight)
+
+
+ $aVPos
+ | The vertical position for the + bar, [0..n] | |
+
+ $aTitle
+ | Title for the activity | |
+
+ $aStart
+ | Start date for the activity given + as string, e.g "2001-09-22" | |
+
+ $aEnd
+ | End date for activity given as either + a date (a string) or as the duration (in days) of the activity, e.g + both "2001-10-15" and 20.5 are valid inputs | |
+
+ $aCaption
+ | Text string (caption) to appear + at the end (right side) of the bar | |
+
+ $aHeight
+ | Height of bar given as either + a value in range [0,1] in which case this is interpretated as what + fraction of the vertical position should the bar occupy. The height can + also be given in absolute pixels [1..200] |
Minute scale is the lowest resolution you can use. It is often + convenient to use Minute scale with "GanttScale::SetINtervall()" since + by default the increment will be 1 minute. The style of minute scale + can be further adjusted by the use style parameters which can be + one of
+Minute scale is enabled by adding the GANTT_HMIN in the + GanttGraph::ShowHeaders() call. For example as in
$graph
+->ShowHeaders(GANTT_HDAY |
+GANTT_HHOUR |
+GANTT_HMIN);
+
The code snippet below shows how to set up a minute scale with 30 + min interval and some custom colors.
+ $graph->scale->
+minute->
+SetIntervall(
+30);
+
$graph->scale->
+minute->
+SetBackgroundColor(
+'lightyellow:1.5');
+
$graph->scale->
+minute->
+SetFont(
+FF_FONT0);
+
$graph->scale->
+minute->
+SetStyle(
+MINUTESTYLE_MM);
+
$graph->scale->
+minute->grid->SetColor
+('lightgray');
The hour scale has more builtin formatting possibilities. The + following formatting options are available
+For hours it is possible to specify the interval in either of two + ways. With an integer, e.g. 6, or as time interval, e.g. "1:30" which + makes the interval one and a half hour. The only restriction is that + the interval must be even dividable for 24 hours since one day is the + smallest possible interval to show. This means that it is allowed to + use, for example 2,4,6,"1:30" or "0:45" as intervals but not 7, "2:45".
+The code snippet below shows hot to set up a hour scale to with 45 + minutes interval and some custom colors
$graph
+->scale->hour->
+SetBackgroundColor(
+'lightyellow:1.5');
+
$graph->scale->
+hour->SetFont(FF_FONT1
+);
+
$graph->scale->
+hour->SetStyle(HOURSTYLE_HMAMPM);
+
$graph->scale->
+hour->
+SetIntervall(
+"0:45");
+
The example below shows a gantt chart with the day and hour scale + enabled
+ +By default the day scale show the first letter of the week day but + it is also posible to format the day scale in a number of different + ways. Days can have one of the following scale formats.
+The formatting is specified by using the SetStyle() method as in
$graph
+->scale->day->
+SetStyle(
+DAYSTYLE_LONG);
+
The graphical formatting possibilities for days allow the + possibility to specify a different color for the weekend background and + also for the Sunday.
+
+ SetWeekendColor()
+
Set the background color for weekends. (Defaults to light gray)
+
+ SetSundayFontColor()
+
The Sunday font color. (Defaults to red)
+In addition to this there is also a possibility to choose whether or + not the weekend background should be extended vertically down over the + plot area. (the default). Since that is a property more of the whole + plot this behavior is modified with a call to the method
UseWeekendBackground()
of the scale, e.g.
+
+ $graph->scale->UseWeekendBackground(false
+);
Week scales, if enabled, by default shows the week number in range 1 + to 53 (as defined by ISO-8601, see the reference section).
+It might be worth pointing out here that the week number calculation + is carried out within JpGraph and does not rely on the underlying OS + date libraries. This makes the behavior consistent over several OS:s + (at least M$ Windows does not comply to ISO-8601 or supply any + way of doing this through the normal libraries, e.g. strftime())
+You may modify the week behavior in three ways. You can specify + (with SetStyle()) a different date format using the constants
+
+ WEEKSTYLE_WNBR
Show week number To further modify the formatting of the actual week + number you can optionally supply a format string with a call to
SetLabelFormatString()
The format of the string should be a standard sprintf() syntax + expecting an integer (the week number). By default a 'W' is prefixed to + the number.
+
+ WEEKSTYLE_FIRSTDAY
Show date of first day in week.
+
+ WEEKSTYLE_FIRSTDAY2
Show date of first day in week and short month
+
+ WEEKSTYLE_FIRSTDAYWNBR
Show weeknumber of first day in week.
+
+ WEEKSTYLE_FIRSTDAY2WNBR
Show weeknumber of first day in week and month
+For month scale you can use the SetStyle() method to choose between + a variety of formats.
+
+ MONTHSTYLE_SHORTNAME
Display the month name in its locale specific short form, i.e Jan, + Feb etc
+
+ MONTHSTYLE_SHORTNAMEYEAR2
Display the month name in its locale specific short form together + with a 2 digit year , i.e Jan '01, Feb '01 etc
+
+ MONTHSTYLE_SHORTNAMEYEAR4
Display the month name in its locale specific short form together + with a 4 digit year , i.e Jan 2001, Feb 2001 etc
+
+ MONTHSTYLE_LONGNAME
Display the month name in its locale specific long name, i.e. + January, February
+
+ MONTHSTYLE_LONGNAMEYEAR2
Display the month name in its locale specific long name together with + a 2 digit year , i.e January '01, February '01 etc
+
+ MONTHSTYLE_LONGNAMEYEAR4
Display the month name in its locale specific long name together with + a 4 digit year , i.e January 2001, February 2001 etc
+
+ MONTHSTYLE_FIRSTLETTER
The first letter of the month name
+Year scale has no extra formatting possibilities.
+The scale headers allow you to view up to four different scales at + the same time. The four basic scales are:
+You can choose what scale to include and exclude by using the + SetScale() method. For example, for a detailed gantt you might choose + to display days and weeks by specifying
$graph
+->ShowHeaders
+( GANTT_HWEEK
+| GANTT_DAY );
If you instead wanted "the big picture" it might be enough to show + year and months by specifying
+ $graph->ShowHeaders(
+GANTT_YEAR |
+GANTT_MONTH );
+
You can choose freely the combination of scales that you want, but a + chart must at least have one scale of course.
+Once you have decided what level of details you need you can then + fine tune the exact layout/formatting of each of the enabled scales as + described below.
+These scale header are all accessed through the graph instance + variables 'scale' as in
+ $graph->scale->
+week
or
+ $graph->scale->day
. All these headers share the following properties.
+
+ Show()
+
Determine if the scale should be shown or not
+
+ SetFont()
+
Font for text in header
+
+ SetFontColor()
+
Specify the color of the header text
+
+ SetStyle()
+
Specify what date format should be used, for example in the week + scale it is possible to show either week number, the start date of the + week and so on.
+
+ SetBackgroundColor()
+
As it says, the background color for the header
+
+ SetFrameWeight()
+
The line weight of the box around the scale
+
+ SetFrameColor()
+
The line color for the frame
+
+ SetTitleVertMargin()
+
The margin, in percent, below and above the title text
+In addition to these methods each scale also has the property 'grid' + which determines the appearance of grid lines for that specific scale. + You may modify the appearance of grid lines by the "normal" line + methods, i.e. SetColor(),SetWeight() SetStyle() and Show(). So for + example to set the week grid line red you would use
$graph
+->scale->week->
+grid->SetColor("red"
+);
Each of the scales also have some specific formatting possibilities + as described below.
+Caption for bars are placed at the far right side of the bars. They + can for example be used to indicate the resources assigned to a task, + the duration of the task or the progress of the activity.
+Caption text for a bar is specified either when creating a bar or + later by accessing the 'caption' property of bars. So the two lines
$activity = new GanttBar
+(0,"Activity 1",
+"2001-11-21",
+"2001-12-20",
+"[BS,ER]")
+
and
+ $activity->
+caption->Set("[BS,ER]"
+);
are both ways of specifying the caption "[BS,ER]" for the activity. + Since activity is a standard JpGraph text object you can easily modify + font, color and size with calls to SetFont() and SetColor(), (e.g.
$activity->caption
+->SetFont(FF_ARIAL,
+FF_BOLD,9);
The figure below illustrates the use of caption
+ +To indicate the progress of a specific activity it is also possible + to add a progress indicator to each bar. This progress indicator + consists of a smaller bar within the bar. By default this progress bar + is black and 70% of the height of the bar. These parameter can (of + course) all be changed.
+The properties for the progress indicator are accessed through the + 'progress' property and it's methods.
+To set the progress for a specific activity you only specify the + percent as a fraction. As in
+ $activity->progress->
+Set(0.4)
In Figure 158 the previous example is modified to indicate the + progress of each activity by the default progress indicator. A solid + bar. To make it clearer we have also modified the caption to reflect + the displayed progress. (At the same time we also modified the scale + headers just to illustrate some more formatting options).
+To specify a different format for the progress you use the + SetPattern() method as in
+ $activity->progress->
+SetPattern(
+BAND_RDIAG,
+"blue");
+
In the reference section you can see the exact parameters and all + available methods.
+ +This section shows some further modification you might do to + activity bars.
+Canvas graphing is an advanced feature that comes in handy where you + need to draw some more arbitrary graphics. To give you a flavor of what + you can do the following example shows an architecture overview of + JpGraph which was drawn using a canvas.
+Working with canvas requires more understanding of JpGraph as well + as more programming and fine tuning.
+There are two basic alternatives on how to generate the content of + the anti-spam image
+In order to write a script to generate a new challenge there are + four steps to be completed.
+First include the library file jpgraph_antispam.php. + Note that there is no need to include the "jpgraph.php" library since + all functionality is included in this library file.
+require_once "jpgraph_antispam.php";
Secondly a new instance of the class AntiSpam must be + created
+ $spam = new
+AntiSpam();
+
Thirdly the string to be used in the challenge must be + specified. To automatically generate a suitable string use
+// The argument determines the length of the generated string
+
$chars = $spam->
+Rand(5);
If instead the string to be used should be specified this string + should be specified in the initial creation of the AntiSpam() or by + calling the Set() method as in
+ $spam->
+Set("aui8k");
Please note that in order to minimize the risk for confusion the + letters 'O' and the number '0' (zero) is not allowed since they are too + alike and can be mistaken for each other.
+The final and fourth step is to output the image with a call + the method Stroke() on the created instance of the AntiSpam + class.
+ if( $spam->Stroke
+() === false
+) {
+
die("Illegal or no data to plot");
+
}
Note that we have put a guard around the output since in the case of + an error this method will result a boolean false value. As with the + other graph types it is possible to write the generated image to a file + by submitting a file name as an argument to Stroke().
+Canvas graph is really not a graph. It a blank sheet of paper which + you can use to draw arbitrary shapes and still have access to some of + the convenient features of JpGraph.
+You can work with a canvas in different levels of complexity. You + can for example work directly with the Image class which provides a + large number of primitives for drawing but requires that you use + absolute pixel coordinates.
+You can also make life a little bit easier by using a canvas scale. + This lets you define your own scale on the canvas which often makes it + easier by letting you work on a grid you have specified yourself. It + also makes it very easy to re-scale you image automatically by just + changing your scale. For example to half the size of you drawing you + just make the scale twice as large.
+To give you some help in working with different canvas you should + include the "jpgraph_canvtools.php" file when working on canvases. This + is not strictly necessary but it will give you some nice abstraction to + help you create your masterpieces.
+As another (concrete) example on the use of a canvas the figure + below is a listing of font styles available with JpGraph.
+ +In order to create a canvas graph you need to include the file + "jpgraph_canvas.php" in addition to the standard "jpgraph.php" file. + You might also want to include the "jpgraph_canvtools.php" to get + access to some supporting classes that may (or not) come in handy.
+Creating a canvas gives you the opportunity draw arbitrary shapes on + a "white" piece of paper. Let's first show a simple example were we + just draw a text box. We first show you the code which we will walk + through
<?php
+
+// $Id: canvasex01.php,v 1.3 2002/10/23 08:17:23 aditus Exp $
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
+
// Setup a basic canvas we can work
+
$g = new CanvasGraph(
+400,300,'auto'
+);
+
$g->SetMargin(
+5,11,6
+,11);
+
$g->SetShadow();
+
$g->SetMarginColor(
+"teal");
+
+
+// We need to stroke the plotarea and margin before we add the
+
// text since we otherwise would overwrite the text.
+
$g->InitFrame();
+
+
// Draw a text box in the middle
+
$txt="This\nis\na TEXT!!!";
+
$t = new Text(
+$txt,200,10
+);
+
$t->SetFont(
+FF_ARIAL,
+FS_BOLD,40);
+
+
+// How should the text box interpret the coordinates?
+
$t->Align(
+'center','top');
+
+
// How should the paragraph be aligned?
+
$t->ParagraphAlign(
+'center');
+
+
+// Add a box around the text, white fill, black border and gray shadow
+
$t->SetBox(
+"white",
+"black","gray");
+
+
// Stroke the text
+
$t->Stroke(
+$g->img);
+
+
// Stroke the graph
+
$g->Stroke();
+
+
?>
+
+
The example above starts by creating a (400x200) sized image. We set + the margins to get a nice frame around the image. For canvases the + margins has no effect in the way you enter coordinates. Top left is + (0,0) and bottom right (including any potential margin and shadow) is + the maximum. In this case the coordinates are X:0-399, and Y:0-199
+We then call the + InitFrame() method which actually strokes the margin and plotarea + to the graph. Since everything is stroked in the order you issue the + commands you must make sure that the graphical objects you want on top + is stroked last. This is different from the way you normally work with + JpGraph since it queues up all you addition and then makes sure they + are stroked in the correct order.
+We then create a Text object, + setup it's properties, including the absolute screen position where we + want the text, and then stroke it. Her it might be a need for a closer + explanation of the, perhaps misnamed, method +Text::Align() This method states how the text coordinates + should be interpreted , i.e when we specify (200,10) as the + coordinates for the text paragraph should that be interpreted as the + top left corner, bottom-left corner or something else (of the bounding + box)? In the code above we have chosen to interpret the X-coordinate as + being the center of the bounding box and the Y-coordinate as the top. + Hence the text will be aligned so that the (200,100) point in the graph + is aligned with the middle of the top line of the paragraphs bounding + box.
+We also specify that the lines within the paragraph should be + centered with a call to + Text::ParagraphAlign() Since we also choose to have a box around + the text we have to make use of the method + Text::SetBox() which is used to specify the fill color, the border + color and the shadow color (if you leave out shadow color or set it to + '', no shadow will be used).
+Now we are ready to stroke the text onto the canvas. In order to do + so we must specify the basic Image drawing class we want to use. + Without discussing this further we just state that a suitable image + class can always be found as the img property of the + Graph class.
+Finally we are ready to stroke the entire graph, which in effect + sends the canvas back to the browser. Below you can see the effect of + all this code
+ + +A canvas also makes a good background for using standard graphic + primitives, for example circles and lines. What you first have to + remember is that you are (so far) working with absolute screen + coordinates and secondly all drawing primitives are found in the + Image Class accessible as a property of the Graph class. So for + example to draw a line between coordinate (0,0) and (100,100) you would + have to add the line
+ $graph->img->
+Line(0,0
+,100,100);
+
To your code. The following example shows some of the graphic + primitives you have access to in the Image class
<?php
+
+// $Id: canvasex02.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
+
// Setup a basic canvas we can work
+
$g = new CanvasGraph(
+400,200,'auto'
+);
+
$g->SetMargin(
+5,11,6
+,11);
+
$g->SetShadow();
+
$g->SetMarginColor(
+"teal");
+
+
+// We need to stroke the plotarea and margin before we add the
+
// text since we otherwise would overwrite the text.
+
$g->InitFrame();
+
+
// Add a black line
+
$g->img->
+SetColor(
+'black');
+
$g->img->
+Line(0,0
+,100,100);
+
+
// .. and a circle (x,y,diameter)
+
$g->img->
+Circle(100,100
+,50);
+
+
+// .. and a filled circle (x,y,diameter)
+
$g->img->
+SetColor('red');
+
$g->img->
+FilledCircle(
+200,100,50
+);
+
+
// .. add a rectangle
+
$g->img->
+SetColor(
+'green');
+
$g->img->
+FilledRectangle(
+10,10,50
+,50);
+
+
// .. add a filled rounded rectangle
+
$g->img->
+SetColor(
+'green');
+
$g->img->
+FilledRoundedRectangle(
+300,30,350
+,80,10);
+
// .. with a darker border
+
$g->img->
+SetColor(
+'darkgreen');
+
$g->img->
+RoundedRectangle(
+300,30,350
+,80,10);
+
+
// Stroke the graph
+
$g->Stroke();
+
+
?>
+
+
Pleas note the way to access these routines through the img property + of the Graph class. Please also keep in mind that the coordinates are + absolute.
+ + + +A note on GD For those of you using GD 1.xx you + might notice that the large "filled circle" isn't completely filled. + This is because in GD 1.xx there are no low level primitives to fill an + ellipse or circle so JpGraph tries to make the best out of a bad + situation and manually fake a filled circle. For interest of speed + JpGraph does not contain a complete (for example) Bresenham-circle fill + but cheats by using some existing GD routines. This is not a perfect + solution and for large filled circles like this you get some + moire-patterns in the circle. If you upgrade to GD 2.x JpGraph will be + able to make full use of those new existing methods and the fill will + be perfect.
+ +We refer you to the class reference to find out what other graphic + primitives are available for use.
+The previous method using absolute coordinates works. But nothing + more. It doesn't give you any chance to easily scale the image (unless + you manually recalculate all used coordinates) , it gets tedious to + work with pixel level resolution. Especially if you just like to draw a + few basic shapes.
+To help with this you can use a scale for the canvas. This lets you + define a "work-space" of your choice. You can for example set the + coordinates to be between X:0-10, Y:0-10. This makes it easier to + position objects on the canvas. This also has two additional + advantages:
+To use this type of scaling you must make sure you include the file + "jpgraph_canvtools.php" . In addition to the scaling class their are + also a couple of other utility classes that may come in handy, + especially the Shape class.
+Using the scale is quite simple. You first instantiate a scale + object passing the graph as a parameter and then specify the scale you + want to use. This means you need to add the lines
$scale
+= new CanvasScale
+($g);
+
$scale->Set(
+0,$xmax,0
+,$ymax);
to your code. You can then use one of the translation methods (for + example +CanvasScale::Translate()) in the canvas scale class to translate + between your world coordinates and the absolute screen coordinates. + This means you could take the code in the example above and just add + the lines, for example,
+ list(
+$x1,$y1) = $this
+->scale->Translate(
+$x1,$y1);
+
list($x2,$y2) =
+$this->scale->Translate
+($x2,$y2);
+
$g->img->
+Line($x1,$y1
+,$x2,$y2);
+
Since this pattern has to be repeated for every object that has to + be drawn it makes good sense to encapsulate this in a separate class. + This is exactly why the canvas tools file also have a utility class + called Shape This class is + mainly a wrapper around the most commonly used methods in the basic + Image class (with one important exception) and does all these the + translation for you. Please see the class reference for a complete list + of the available methods To set up the Shape class you instantiate it + with the graphic context and the scale you want to use as argument as + in
+
+ $shape = new
+Shape($g,$scale
+);
You are then ready to use all the methods in the shape class. Using + a scale and imitating the previous example we would get the source + shown below.
<?php
+
+// $Id: canvasex03.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
include "../jpgraph_canvtools.php";
+
+
// Define work space
+
$xmax=20;
+
$ymax=20;
+
+
// Setup a basic canvas we can work
+
$g = new CanvasGraph(
+400,200,'auto'
+);
+
$g->SetMargin(
+5,11,6
+,11);
+
$g->SetShadow();
+
$g->SetMarginColor(
+"teal");
+
+
+// We need to stroke the plotarea and margin before we add the
+
// text since we otherwise would overwrite the text.
+
$g->InitFrame();
+
+
// Create a new scale
+
$scale
+= new CanvasScale
+($g);
+
$scale->Set(
+0,$xmax,0
+,$ymax);
+
+
+// The shape class is wrapper around the Imgae class which translates
+
// the coordinates for us
+
$shape
+= new Shape($g,
+$scale);
+
$shape->SetColor(
+'black');
+
+
+
// Add a black line
+
$shape->SetColor(
+'black');
+
$shape->Line(
+0,0,20
+,20);
+
+
// .. and a circle (x,y,diameter)
+
$shape->Circle(
+5,14,2
+);
+
+
+// .. and a filled circle (x,y,diameter)
+
$shape->SetColor(
+'red');
+
$shape->FilledCircle(
+11,8,3
+);
+
+
// .. add a rectangle
+
$shape->SetColor(
+'green');
+
$shape->FilledRectangle(15,
+8,19,14
+);
+
+
// .. add a filled rounded rectangle
+
$shape->SetColor(
+'green');
+
$shape->FilledRoundedRectangle(2,
+3,8,6
+);
+
// .. with a darker border
+
$shape->SetColor(
+'darkgreen');
+
$shape->RoundedRectangle(2,
+3,8,6
+);
+
+
+
// Stroke the graph
+
$g->Stroke();
+
+
?>
+
+
If we like to make a smaller image we could just change the image + size and everything will be rescaled without any further code changes. + SO for example making the image half the size would give the result
If we instead wanted to keep the image size but shrink the shapes we + could just make the scale twice as large which would result in
+ +We previously mentioned that the Shape class was a wrapper around + the image class with one exception. So what is the exception? Well, + glad you asked. The exception is that it contain an additional method + which draws an "indented rectangle". An indented rectangle is a + rectangle where one of it's four corners have been moved into the + rectangle. You create an indented rectangle by calling either + Shape::IndentedRectangle() or A few examples illustrates what this + shape looks like.
+ +As a final note we mention the class + CanvasRectangleText Which can be used to add a text with a rounded + rectangle (possibly filled) onto the canvas. The previous example where + all the available fonts were drawn were using this class. We don't + describe it further but refer the interested reader to the class + reference and the 'listfontsex1.php' example file.
+As a final example we shortly discuss how the canvas type of graph + was used to generate the DB schema for the DDDA architecture.
+The library php file "utils/misc/imgdbschema.php" included in the + distribution contains some utility classes to make the drawing of table + schemes easier. It contains two basic classes, Class ImgDBTable and + Class ImgDBSchema. The first class understand how to draw an image + illustrating a single table. The second class is responsible for + automatically extract all the relevant information from a DB to draw a + complete DB Schema.
+Before going into this a little bit more we show what an example of + this might look like.
Before going on it should be noted that the ImgDBSchema assumes that + the DB can be accessed through a DB abstraction layer modeled after the + abstraction layer available in the 'jpdb.php' file in the DDDA + architecture. This abstraction layer assumes a MySQL database in the + bottom. This specific dependency of this particular abstraction layer + is the reason why these classes is not included in the generic canvas + tools file.
+The second thing to note is that this library does not contain a + complete automatic-layout engine but rather a very simple automatic + system which, if nothing else is specified, just puts the table in a + rectangular grid. A complete graph layout engine would simple be to + much to write in this context. This is also a very difficult + optimization problem and sofar not even any of the available research + programs that tries this can achieve a satisfactory layout without + manual intervention.
+The critical lines in the code to generate the above graph is
$tblposadj=array($tlo
+,0,$tblwidth+
+$tlo+2,0
+,2*$tblwidth+
+$tlo+4,0
+,-1,16,-
+1,16);
+
$dbschema
+= new ImgDBSchema
+("jpgraph_doc"
+,"FormatTblName"
+,"FormatFldName"
+);
+
$dbschema
+->SetMargin($leftm,
+$topm);
+
$dbschema
+->SetTableWidth
+($tblwidth);
+
$dbschema
+->Stroke($this->
+img,$this->iscale
+,$tblposadj);
The rest of the code in the file is just to setup the canvas, add an + indented rectangle to group some tables and generate a footer with the + date and time this image was generated.
+The first line instantiates a new ImgDBSCheme layout engine asking + it to draw an image for the database 'jpgraph_doc'. The following two + arguments specify two callback functions for formatting the text for + header and each field in a table.
+The next line specify the top left margin where the drawing of the + tables should be started.
+The third line specify the width of a single table. The final lines + starts the engine and draws all tables in the database to the canvas. + The final argument requires some further explanation. This is an offset + (x,y) from the top left corner how each individual table should be + positioned. If the value is -1 indicates that the default value should + be used. If this array is not specified then the tables will simple + arranged line by line.
+The full source code for drawing this DB schema example is shown + below.
+ <?php
+
+/*=======================================================================
+
// File: DBSCHEMAEX1.PHP
+
// Description: Draw a DB schema of the DDDA architecture
+
// Created: 2002-08-25
+
+// Ver: $Id: dbschemaex1.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+
//
+
// License: This code is released under QPL
+
// Copyright (C) 2001,2002 Johan Persson
+
+// Note: The actual drawing of the tables are semi-automatically
+
+// but you can easily adjust the individual tables position
+
// with the 'tblposadj' array.
+
//
+
+//========================================================================
+
*/
+
include
+"../jpgraph.php";
+
include "../jpgraph_canvas.php";
+
include "../jpgraph_canvtools.php";
+
include "../imgdbschema.inc";
+
include "../jpdb.php"
+;
+
+
+
+// Global callback to format the table header names
+
function
+FormatTblName(
+$aName) {
+
+// We want to replace any specifi references to the
+
// 'JpGraph' project with the generic '<project>'
+
return
+str_replace(
+'JpGraph',
+'<project>',
+$aName);
+
}
+
+
+// Global callback to format each field name in the table
+
function
+FormatFldName(
+$aName,$aTable) {
+
return $aName
+;
+
}
+
+
+
class Driver
+{
+
+
var $ig
+, $img, $iscale,
+$ishape;
+
var $iymax
+,$ixmax;
+
var $iwidth
+,$iheight;
+
+
function Driver
+() {
+
+
+// Define Image size and coordinate grid space to work within
+
$this
+->iwidth = 600;
+
$this
+->iheight= 750;
+
$this
+->iymax = 50;
+
$this
+->ixmax = 55;
+
+
// Setup a basic canvas
+
$this
+->ig = new CanvasGraph(
+$this->iwidth,$this
+->iheight,'auto');
+
$this
+->img = $this->
+ig->img;
+
+
// Define the scale to be used
+
$this
+->iscale
+= new CanvasScale
+($this->ig);
+
$this
+->iscale->Set(
+0,$this->ixmax
+,0,$this->
+iymax);
+
$this
+->ishape
+= new Shape($this->
+ig,$this->iscale
+);
+
+
// A small frame around the canvas
+
$this
+->ig->SetMargin(
+2,3,2
+,3);
+
$this
+->ig->SetMarginColor(
+"teal");
+
$this
+->ig->InitFrame();
+
+
}
+
+
function Run
+() {
+
+
$leftm
+=1.5; // Left margin (for table schemes)
+
$topm=5;
+// Top margin (for table schemes)
+
$tblwidth
+=15; // Individual table width
+
$tlo=1;
+// Offset for top line
+
+
// Add the background color for the project specific tables
+
$this
+->ishape->IndentedRectangle($leftm,
+$topm-1,3
+*$tblwidth+$tlo+
+6,45,
+
$tlo
++2*$tblwidth+
+2,30,CORNER_BOTTOMLEFT,
+
'lightblue');
+
+
+// Stroke the tables (series of x,y offsets, If =-1 then use the
+
// automtic positioning
+
$tblposadj
+=array($tlo,0,
+$tblwidth+$tlo+2
+,0,2*
+$tblwidth+$tlo+4
+,
+
0
+,-1,16,-
+1,16);
+
$dbschema
+= new ImgDBSchema
+('jpgraph_doc'
+,'FormatTblName'
+,'FormatFldName'
+);
+
$dbschema
+->SetMargin($leftm,
+$topm);
+
$dbschema
+->SetTableWidth
+($tblwidth);
+
$dbschema
+->Stroke($this->
+img,$this->iscale
+,$tblposadj);
+
+
$tt
+= new CanvasRectangleText
+();
+
$tt->SetFillColor(
+'');
+
$tt->SetColor(
+'');
+
$tt->SetFontColor(
+'navy');
+
+
// Add explanation
+
$tt->SetFont(
+FF_ARIAL,
+FS_NORMAL,12);
+
$tt->Set(
+'Project specific tables',
+$tblwidth+
+$leftm+3,16
+,15);
+
$tt->Stroke(
+$this->img,$this
+->iscale);
+
+
// Add title
+
$tt->SetColor(
+'');
+
$tt->SetFont(
+FF_VERDANA,
+FS_BOLD,26);
+
$tt->Set(
+'DDDA - DB Schema',
+9,0.5,30
+);
+
$tt->Stroke(
+$this->img,$this
+->iscale);
+
+
// Add a version and date
+
$tt->SetFillColor(
+'yellow');
+
$tt->SetFont(
+FF_FONT1,
+FS_NORMAL,10);
+
$tt->Set(
+"Generated: ".
+date("ymd H:i",time
+()),1,$this->
+iymax*0.96,15
+);
+
$tt->Stroke(
+$this->img,$this
+->iscale);
+
+
$this
+->ig->Stroke();
+
}
+
}
+
+
$driver
+= new Driver
+();
+
$driver->Run();
+
+
?>
+
+
JpGraph includes a module to easily generate Anti-Spam challenges. + With this we mean an image consisting of numbers and letters which are + very hard to read for an OCR program. This is often used to secure sign + up for bulletin boards, on-line mail system or mailing lists since this + very effectively prevent automatic sign up by robots (spam-bots).
+The module in JpGraph responsible for this is + jpgraph_antispam.php and behaves as a simplified plot module.
+The example below illustrates how such an image can look like
+Anti spam images have less functionality then the usual images + generated with JpGraph in order to keep this utility reasonable small. + The primary limitation is that there are now additional formatting + options for the images and the image generated will always use the + JPEG image format. Hence it is not possible to change this to use, + for example, PNG.
+Version | Date | Status | Who | Comment | +
---|---|---|---|---|
R1.9 | 2007-03-18 | Released | Johan Persson | +Additional info for JpGraph 1.21 |
Canvas graphing is an advanced feature that comes in handy where you + need to draw some more arbitrary graphics. To give you a flavor of what + you can do the following example shows an architecture overview of + JpGraph which was drawn using a canvas.
+Working with canvas requires more understanding of JpGraph as well + as more programming and fine tuning.
+There are two basic alternatives on how to generate the content of + the anti-spam image
+In order to write a script to generate a new challenge there are + four steps to be completed.
+First include the library file jpgraph_antispam.php. + Note that there is no need to include the "jpgraph.php" library since + all functionality is included in this library file.
+require_once "jpgraph_antispam.php";
Secondly a new instance of the class AntiSpam must be + created
+ $spam = new
+AntiSpam();
+
Thirdly the string to be used in the challenge must be + specified. To automatically generate a suitable string use
+// The argument determines the length of the generated string
+
$chars = $spam->
+Rand(5);
If instead the string to be used should be specified this string + should be specified in the initial creation of the AntiSpam() or by + calling the Set() method as in
+ $spam->
+Set("aui8k");
Please note that in order to minimize the risk for confusion the + letters 'O' and the number '0' (zero) is not allowed since they are too + alike and can be mistaken for each other.
+The final and fourth step is to output the image with a call + the method Stroke() on the created instance of the AntiSpam + class.
+ if( $spam->Stroke
+() === false
+) {
+
die("Illegal or no data to plot");
+
}
Note that we have put a guard around the output since in the case of + an error this method will result a boolean false value. As with the + other graph types it is possible to write the generated image to a file + by submitting a file name as an argument to Stroke().
+The creation of LED digits and letters are extremely simple. The + following complete example demonstrates the creation of a LED display
+
+
include
+"../jpgraph.php";
+
include "../jpgraph_led.php";
+
+
+// By default each "LED" circle has a radius of 3 pixels
+
$led
+= new DigitalLED74
+();
+
$led->Stroke(
+'0123456789. ABCDEFGHIJKL',
+LEDC_GREEN);
+
The result of running this script can be seen by running the + "Examples/ledex1.php" Example in the example directory. As can be seen + from the above example the color to be used for the LED digits is + specified as the second argument to the DigitalLED74::Stroke() method. + Available color for LED digits is given by the table below
+Symbolic name | Color |
LEDC_RED | Red |
LEDC_GREEN | Green |
LEDC_BLUE | Blue |
LEDC_YELLOW | Yellow |
GREY | Grey |
All digits, 0-9 |
Capital Letters, A-L |
JpGraph includes a module to easily generate Anti-Spam challenges. + With this we mean an image consisting of numbers and letters which are + very hard to read for an OCR program. This is often used to secure sign + up for bulletin boards, on-line mail system or mailing lists since this + very effectively prevent automatic sign up by robots (spam-bots).
+The module in JpGraph responsible for this is + jpgraph_antispam.php and behaves as a simplified plot module.
+The example below illustrates how such an image can look like
+Anti spam images have less functionality then the usual images + generated with JpGraph in order to keep this utility reasonable small. + The primary limitation is that there are now additional formatting + options for the images and the image generated will always use the + JPEG image format. Hence it is not possible to change this to use, + for example, PNG.
+Various settings in JpGraph are controlled by overall DEFINEs in the + configuration file "jpg-config.inc". Most of these defines have default + values that should be valid for most usage.
+In the rest of this chapter all constants are described with default + value and usage.
+ +Define, default value | Comment |
---|---|
"CACHE_DIR", "/tmp/jpgraph_cache/" | The full + absolute name of directory to be used as a cache. This directory + must be readable and writable for PHP. Must end with '/' |
"TTF_DIR", "/usr/local/fonts/ttf/" | +Directory for JpGraph TTF fonts. Must end with '/' The fonts must follow + the naming conventions as used by the supplied TTF fonts in JpGraph. | +
"CSIMCACHE_DIR", "csimcache/" | Directory for + cache directory for CSIM graphs. Must end with '/' Cache directory + specification for use with CSIM graphs that are using the cache. The + directory must be the filesystem name as seen by PHP and the 'http' + version must be the same directory but as seen by the HTTP server + relative to the 'htdocs' directory. If a relative path is specified it + is taken to be relative from where the image script is executed. Note: + The default setting is to create a subdirectory in the directory from + where the image script is executed and store all files there. As usual + this directory must be writable by the PHP process. |
"CSIMCACHE_HTTP_DIR", "csimcache" | Directory + for JpGraph TTF fonts. Must end with '/' Cache directory specification + for use with CSIM graphs that are using the cache. The directory must + be the filesystem name as seen by PHP and the 'http' version must be + the same directory but as seen by the HTTP server relative to the + 'htdocs' directory. If a relative path is specified it is taken to be + relative from where the image script is executed. Note: The default + setting is to create a subdirectory in the directory from where the + image script is executed and store all files there. As usual this + directory must be writable by the PHP process. |
"CHINESE_TTF_FONT", "bkai00mp.ttf" | Actual + name of the TTF file used together with FF_CHINESE aka FF_BIG5 This is + the TTF file being used when the font family is specified as either + FF_CHINESE or FF_BIG5 |
"LANGUAGE_CYRILLIC", false | Special unicode + Cyrillic language support. |
"CYRILLIC_FROM_WINDOWS", false | If you are + setting this config to true the conversion will assume that the input + text is windows 1251, if false it will assume koi8-r |
'MINCHO_TTF_FONT', 'ipam.ttf' | Japanese + TrueType font used with FF_MINCHO |
'PMINCHO_TTF_FONT', 'ipamp.ttf' | Japanese + TrueType font used with FF_PMINCHO |
'GOTHIC_TTF_FONT', 'ipag.ttf' | Japanese + TrueType font used with FF_GOTHIC |
'PGOTHIC_TTF_FONT', 'ipagp.ttf' | Japanese + TrueType font used with FF_PGOTHIC |
"INSTALL_PHP_ERR_HANDLER", false | Determine + if the library should also setup the default PHP error handler to + generate a graphic error message. This is useful during development to + be able to see the error message as an image instead as a "red-cross" + in a page where an image is expected. |
"CATCH_PHPERRMSG", true | Should the library + examine the global php_errmsg string and convert any error in it to a + graphical representation. This is handy for the occasions when, for + example, header files cannot be found and this results in the graph not + being created and just a "red-cross" image would be seen. This should + be turned off for a production site. |
"USE_LIBRARY_GD2",false | Specify if we + should use GD 2.x or GD 1.x If you have GD 2.x installed it is + recommended that you use it since it will give a slightly, slightly + better visual appearance for arcs. If you don't have GD2 installed this + must be set to false! |
'USE_TRUECOLOR',true | Should the image be a + truecolor image? Note 1: Can only be used with GD 2.0.2 and above. Note + 2: GD 2.0.1 + PHP 4.0.6 on Win32 crashes when trying to use truecolor. + Truecolor support is to be considered alpha since GD 2.x is still not + considered stable (especially on Win32). Note 3: MUST be enabled to get + background images working with GD2 Note 4: If enabled then truetype + fonts will look very ugly => You can't have both background images and + truetype fonts in the same image until these bugs has been fixed in GD + 2.01 |
"USE_CACHE",false | Should the cache be used + at all? By setting this to false no files will be generated in the + cache directory. The difference from READ_CACHE being that setting + READ_CACHE to false will still create the image in the cache directory + just not use it. By setting USE_CACHE=false no files will even be + generated in the cache directory. |
"READ_CACHE",true | Should we try to find an + image in the cache before generating it? Set this define to false to + bypass the reading of the cache and always regenerate the image. Note + that even if reading the cache is disabled the cached will still be + updated with the newly generated image. Set also "USE_CACHE" below. | +
"DEFAULT_GFORMAT","auto" | Default graphic + format set to "auto" which will automatically choose the best available + format in the order png,gif,jpg (The supported format depends on what + your PHP installation supports) |
"USE_IMAGE_ERROR_HANDLER",true | Determine + if the error handler should be image based or purely text based. Image + based makes it easier since the script will always return an image even + in case of errors. |
"USE_APPROX_COLORS",true | If the color + palette is full should JpGraph try to allocate the closest match? If + you plan on using background image or gradient fills it might be a good + idea to enable this. If not you will otherwise get an error saying that + the color palette is exhausted. The drawback of using approximations is + that the colors might not be exactly what you specified. Note1: This + does only apply to a palette image, not true color images since they + don't have the limitations of maximum number of colors. |
"ERR_DEPRECATED",false | Should usage of + deprecated functions and parameters give a fatal error? (Useful to + check if code is future proof.) |
"BRAND_TIMING",false | Should the time taken + to generate each picture be branded to the lower left in corner in each + generated image? Useful for performance measurements generating graphs | +
"BRAND_TIME_FORMAT","Generated in: %01.3fs" | +What format should be used for the timing string? |
The following defines should very rarely need to be changed
+ +Define, default value | Comment |
---|---|
"CACHE_FILE_GROUP","wwwadmin" | What group + should the cached file belong to (Set to "" will give the default group + for the "PHP-user") Please note that the Apache user must be a member + of the specified group since otherwise it is impossible for Apache to + set the specified group. |
"CACHE_FILE_MOD",0664 | What permissions + should the cached file have (Set to "" will give the default + permissions for the "PHP-user") |
"USE_BRESENHAM",false | Decide if we should + use the Bresenham circle algorithm or the built in Arc(). Bresenham + gives better visual appearance of circles but is more CPU intensive and + slower then the built in Arc() function in GD. Turned off by default + for speed |
"_CSIM_SPECIALFILE","_csim_special_" | +Special file name to indicate that we only want to calc the image map in + the call to Graph::Stroke() used internally from the GetHTMLCSIM() + method. |
"_CSIM_DISPLAY","_jpg_csimd" | HTTP GET + argument that is used with image map to indicate to the script to just + generate the image and not the full CSIM HTML page. |
+
 
+The bulk of the text was written directly in Emacs on a GNU/Linux + system in a mixture of PHP and HTML. A number of PHP functions were + used to automate the handling of formatting example code and figures.
+To generate the images automatically in the img directory a custom + awk-script is used to extract all the used image script from the + manual. The script then uses the client version of PHP generate the + images from the scripts and stores them in the 'img' directory.
+The final set of HTML files was then processes by HTMLDOC to + construct table of contents and chapter links.
+For example setting the oversampling to "1" is the same thing as + disabling super-sampling. This will generate a fast image but a LED + appearance that looks quite "rugged".
+Increasing the level of oversampling above "4" gives almost no + visual improvement to the resulting image, it will only increase the + CPU time needed to create the final image. Hence it is recommended that + the super-sampling is only specified as an integer in the range one to + four.
+Various settings in JpGraph are controlled by overall DEFINEs in the + configuration file "jpg-config.inc.php". Most of these defines have + default values that should be valid for most usage.
+In the rest of this chapter all constants are described with default + value and usage.
+ +Define, default value | Comment |
---|---|
"CACHE_DIR", "/tmp/jpgraph_cache/" | The full + absolute name of directory to be used as a cache. This directory + must be readable and writable for PHP. Must end with '/' |
"TTF_DIR", "/usr/local/fonts/ttf/" | +Directory for JpGraph TTF fonts. Must end with '/' The fonts must follow + the naming conventions as used by the supplied TTF fonts in JpGraph. | +
"CSIMCACHE_DIR", "csimcache/" | Directory for + cache directory for CSIM graphs. Must end with '/' Cache directory + specification for use with CSIM graphs that are using the cache. The + directory must be the filesystem name as seen by PHP and the 'http' + version must be the same directory but as seen by the HTTP server + relative to the 'htdocs' directory. If a relative path is specified it + is taken to be relative from where the image script is executed. Note: + The default setting is to create a subdirectory in the directory from + where the image script is executed and store all files there. As usual + this directory must be writable by the PHP process. |
"CSIMCACHE_HTTP_DIR", "csimcache" | Directory + for JpGraph TTF fonts. Must end with '/' Cache directory specification + for use with CSIM graphs that are using the cache. The directory must + be the filesystem name as seen by PHP and the 'http' version must be + the same directory but as seen by the HTTP server relative to the + 'htdocs' directory. If a relative path is specified it is taken to be + relative from where the image script is executed. Note: The default + setting is to create a subdirectory in the directory from where the + image script is executed and store all files there. As usual this + directory must be writable by the PHP process. |
"CHINESE_TTF_FONT", "bkai00mp.ttf" | Actual + name of the TTF file used together with FF_CHINESE aka FF_BIG5 This is + the TTF file being used when the font family is specified as either + FF_CHINESE or FF_BIG5 |
"LANGUAGE_CYRILLIC", false | Special unicode + Cyrillic language support. |
"CYRILLIC_FROM_WINDOWS", false | If you are + setting this config to true the conversion will assume that the input + text is windows 1251, if false it will assume koi8-r |
'MINCHO_TTF_FONT', 'ipam.ttf' | Japanese + TrueType font used with FF_MINCHO |
'PMINCHO_TTF_FONT', 'ipamp.ttf' | Japanese + TrueType font used with FF_PMINCHO |
'GOTHIC_TTF_FONT', 'ipag.ttf' | Japanese + TrueType font used with FF_GOTHIC |
'PGOTHIC_TTF_FONT', 'ipagp.ttf' | Japanese + TrueType font used with FF_PGOTHIC |
"INSTALL_PHP_ERR_HANDLER", false | Determine + if the library should also setup the default PHP error handler to + generate a graphic error message. This is useful during development to + be able to see the error message as an image instead as a "red-cross" + in a page where an image is expected. |
"CATCH_PHPERRMSG", true | Should the library + examine the global php_errmsg string and convert any error in it to a + graphical representation. This is handy for the occasions when, for + example, header files cannot be found and this results in the graph not + being created and just a "red-cross" image would be seen. This should + be turned off for a production site. |
"USE_LIBRARY_GD2",false | Specify if we + should use GD 2.x or GD 1.x If you have GD 2.x installed it is + recommended that you use it since it will give a slightly, slightly + better visual appearance for arcs. If you don't have GD2 installed this + must be set to false! |
'USE_TRUECOLOR',true | Should the image be a + truecolor image? Note 1: Can only be used with GD 2.0.2 and above. Note + 2: GD 2.0.1 + PHP 4.0.6 on Win32 crashes when trying to use truecolor. + Truecolor support is to be considered alpha since GD 2.x is still not + considered stable (especially on Win32). Note 3: MUST be enabled to get + background images working with GD2 Note 4: If enabled then truetype + fonts will look very ugly => You can't have both background images and + truetype fonts in the same image until these bugs has been fixed in GD + 2.01 |
"USE_CACHE",false | Should the cache be used + at all? By setting this to false no files will be generated in the + cache directory. The difference from READ_CACHE being that setting + READ_CACHE to false will still create the image in the cache directory + just not use it. By setting USE_CACHE=false no files will even be + generated in the cache directory. |
"READ_CACHE",true | Should we try to find an + image in the cache before generating it? Set this define to false to + bypass the reading of the cache and always regenerate the image. Note + that even if reading the cache is disabled the cached will still be + updated with the newly generated image. Set also "USE_CACHE" below. | +
"DEFAULT_GFORMAT","auto" | Default graphic + format set to "auto" which will automatically choose the best available + format in the order png,gif,jpg (The supported format depends on what + your PHP installation supports) |
"USE_IMAGE_ERROR_HANDLER",true | Determine + if the error handler should be image based or purely text based. Image + based makes it easier since the script will always return an image even + in case of errors. |
"USE_APPROX_COLORS",true | If the color + palette is full should JpGraph try to allocate the closest match? If + you plan on using background image or gradient fills it might be a good + idea to enable this. If not you will otherwise get an error saying that + the color palette is exhausted. The drawback of using approximations is + that the colors might not be exactly what you specified. Note1: This + does only apply to a palette image, not true color images since they + don't have the limitations of maximum number of colors. |
"ERR_DEPRECATED",false | Should usage of + deprecated functions and parameters give a fatal error? (Useful to + check if code is future proof.) |
"BRAND_TIMING",false | Should the time taken + to generate each picture be branded to the lower left in corner in each + generated image? Useful for performance measurements generating graphs | +
"BRAND_TIME_FORMAT","Generated in: %01.3fs" | +What format should be used for the timing string? |
The following defines should very rarely need to be changed
+ +Define, default value | Comment |
---|---|
"CACHE_FILE_GROUP","wwwadmin" | What group + should the cached file belong to (Set to "" will give the default group + for the "PHP-user") Please note that the Apache user must be a member + of the specified group since otherwise it is impossible for Apache to + set the specified group. |
"CACHE_FILE_MOD",0664 | What permissions + should the cached file have (Set to "" will give the default + permissions for the "PHP-user") |
"USE_BRESENHAM",false | Decide if we should + use the Bresenham circle algorithm or the built in Arc(). Bresenham + gives better visual appearance of circles but is more CPU intensive and + slower then the built in Arc() function in GD. Turned off by default + for speed |
"_CSIM_SPECIALFILE","_csim_special_" | +Special file name to indicate that we only want to calc the image map in + the call to Graph::Stroke() used internally from the GetHTMLCSIM() + method. |
"_CSIM_DISPLAY","_jpg_csimd" | HTTP GET + argument that is used with image map to indicate to the script to just + generate the image and not the full CSIM HTML page. |
+
 
+The creation of LED digits and letters are extremely simple. The + following complete example demonstrates the creation of a LED display
+
+
include
+"../jpgraph.php";
+
include "../jpgraph_led.php";
+
+
+// By default each "LED" circle has a radius of 3 pixels
+
$led
+= new DigitalLED74
+();
+
$led->Stroke(
+'0123456789. ABCDEFGHIJKL',
+LEDC_GREEN);
+
The result of running this script can be seen by running the + "Examples/ledex1.php" Example in the example directory. As can be seen + from the above example the color to be used for the LED digits is + specified as the second argument to the DigitalLED74::Stroke() method. + Available color for LED digits is given by the table below
+Symbolic name | Color |
LEDC_RED | Red |
LEDC_GREEN | Green |
LEDC_BLUE | Blue |
LEDC_YELLOW | Yellow |
GREY | Grey |
Since the standard LED matrix of 7x4 dots does not lend itself to + accurately represent all normal ASCII characters only the following + numbers and letters can be displayed.
+All digits, 0-9 |
Capital Letters, A-L |
Various settings in JpGraph are controlled by overall DEFINEs in the + configuration file "jpg-config.inc.php". Most of these defines have + default values that should be valid for most usage.
+In the rest of this chapter all constants are described with default + value and usage.
+ +Define, default value | Comment |
---|---|
"CACHE_DIR", "/tmp/jpgraph_cache/" | The full + absolute name of directory to be used as a cache. This directory + must be readable and writable for PHP. Must end with '/' |
"TTF_DIR", "/usr/local/fonts/ttf/" | +Directory for JpGraph TTF fonts. Must end with '/' The fonts must follow + the naming conventions as used by the supplied TTF fonts in JpGraph. | +
"CSIMCACHE_DIR", "csimcache/" | Directory for + cache directory for CSIM graphs. Must end with '/' Cache directory + specification for use with CSIM graphs that are using the cache. The + directory must be the filesystem name as seen by PHP and the 'http' + version must be the same directory but as seen by the HTTP server + relative to the 'htdocs' directory. If a relative path is specified it + is taken to be relative from where the image script is executed. Note: + The default setting is to create a subdirectory in the directory from + where the image script is executed and store all files there. As usual + this directory must be writable by the PHP process. |
"CSIMCACHE_HTTP_DIR", "csimcache" | Directory + for JpGraph TTF fonts. Must end with '/' Cache directory specification + for use with CSIM graphs that are using the cache. The directory must + be the filesystem name as seen by PHP and the 'http' version must be + the same directory but as seen by the HTTP server relative to the + 'htdocs' directory. If a relative path is specified it is taken to be + relative from where the image script is executed. Note: The default + setting is to create a subdirectory in the directory from where the + image script is executed and store all files there. As usual this + directory must be writable by the PHP process. |
"CHINESE_TTF_FONT", "bkai00mp.ttf" | Actual + name of the TTF file used together with FF_CHINESE aka FF_BIG5 This is + the TTF file being used when the font family is specified as either + FF_CHINESE or FF_BIG5 |
"LANGUAGE_CYRILLIC", false | Special unicode + Cyrillic language support. |
"CYRILLIC_FROM_WINDOWS", false | If you are + setting this config to true the conversion will assume that the input + text is windows 1251, if false it will assume koi8-r |
'MINCHO_TTF_FONT', 'ipam.ttf' | Japanese + TrueType font used with FF_MINCHO |
'PMINCHO_TTF_FONT', 'ipamp.ttf' | Japanese + TrueType font used with FF_PMINCHO |
'GOTHIC_TTF_FONT', 'ipag.ttf' | Japanese + TrueType font used with FF_GOTHIC |
'PGOTHIC_TTF_FONT', 'ipagp.ttf' | Japanese + TrueType font used with FF_PGOTHIC |
"INSTALL_PHP_ERR_HANDLER", false | Determine + if the library should also setup the default PHP error handler to + generate a graphic error message. This is useful during development to + be able to see the error message as an image instead as a "red-cross" + in a page where an image is expected. |
"CATCH_PHPERRMSG", true | Should the library + examine the global php_errmsg string and convert any error in it to a + graphical representation. This is handy for the occasions when, for + example, header files cannot be found and this results in the graph not + being created and just a "red-cross" image would be seen. This should + be turned off for a production site. |
"USE_LIBRARY_GD2",false | Specify if we + should use GD 2.x or GD 1.x If you have GD 2.x installed it is + recommended that you use it since it will give a slightly, slightly + better visual appearance for arcs. If you don't have GD2 installed this + must be set to false! |
'USE_TRUECOLOR',true | Should the image be a + truecolor image? Note 1: Can only be used with GD 2.0.2 and above. Note + 2: GD 2.0.1 + PHP 4.0.6 on Win32 crashes when trying to use truecolor. + Truecolor support is to be considered alpha since GD 2.x is still not + considered stable (especially on Win32). Note 3: MUST be enabled to get + background images working with GD2 Note 4: If enabled then truetype + fonts will look very ugly => You can't have both background images and + truetype fonts in the same image until these bugs has been fixed in GD + 2.01 |
"USE_CACHE",false | Should the cache be used + at all? By setting this to false no files will be generated in the + cache directory. The difference from READ_CACHE being that setting + READ_CACHE to false will still create the image in the cache directory + just not use it. By setting USE_CACHE=false no files will even be + generated in the cache directory. |
"READ_CACHE",true | Should we try to find an + image in the cache before generating it? Set this define to false to + bypass the reading of the cache and always regenerate the image. Note + that even if reading the cache is disabled the cached will still be + updated with the newly generated image. Set also "USE_CACHE" below. | +
"DEFAULT_GFORMAT","auto" | Default graphic + format set to "auto" which will automatically choose the best available + format in the order png,gif,jpg (The supported format depends on what + your PHP installation supports) |
"USE_IMAGE_ERROR_HANDLER",true | Determine + if the error handler should be image based or purely text based. Image + based makes it easier since the script will always return an image even + in case of errors. |
"USE_APPROX_COLORS",true | If the color + palette is full should JpGraph try to allocate the closest match? If + you plan on using background image or gradient fills it might be a good + idea to enable this. If not you will otherwise get an error saying that + the color palette is exhausted. The drawback of using approximations is + that the colors might not be exactly what you specified. Note1: This + does only apply to a palette image, not true color images since they + don't have the limitations of maximum number of colors. |
"ERR_DEPRECATED",false | Should usage of + deprecated functions and parameters give a fatal error? (Useful to + check if code is future proof.) |
"BRAND_TIMING",false | Should the time taken + to generate each picture be branded to the lower left in corner in each + generated image? Useful for performance measurements generating graphs | +
"BRAND_TIME_FORMAT","Generated in: %01.3fs" | +What format should be used for the timing string? |
The following defines should very rarely need to be changed
+ +Define, default value | Comment |
---|---|
"CACHE_FILE_GROUP","wwwadmin" | What group + should the cached file belong to (Set to "" will give the default group + for the "PHP-user") Please note that the Apache user must be a member + of the specified group since otherwise it is impossible for Apache to + set the specified group. |
"CACHE_FILE_MOD",0664 | What permissions + should the cached file have (Set to "" will give the default + permissions for the "PHP-user") |
"USE_BRESENHAM",false | Decide if we should + use the Bresenham circle algorithm or the built in Arc(). Bresenham + gives better visual appearance of circles but is more CPU intensive and + slower then the built in Arc() function in GD. Turned off by default + for speed |
"_CSIM_SPECIALFILE","_csim_special_" | +Special file name to indicate that we only want to calc the image map in + the call to Graph::Stroke() used internally from the GetHTMLCSIM() + method. |
"_CSIM_DISPLAY","_jpg_csimd" | HTTP GET + argument that is used with image map to indicate to the script to just + generate the image and not the full CSIM HTML page. |
+
 
+This manual covers versions up to 1.21 of JpGraph. A 2D graph + plotting library for PHP4 and PHP5.
+The library exists in two main tracks, the 1.x track and the 2.x + track. From a functional perspective both branches are equivalent. The + difference is that 1.x is suitable for PHP4 and 2.x is suitable for + PHP5.
+Please make sure you use the correct version ! The 1.x version will + not in general wotk on PHP5 installation and vice versa.
+Even though the library is known to work with version of PHP prior + to 4.3 and 5.1 respectively the library is not tested nor is it + recommended to run with any older versions of PHP.
+JpGraph is released under a dual license. For non-comercial usage + the library is released uner QPL 1.0 (Qt-License) and under the JpGraph + Professional License for commercial use. Commercial use is defined as + either a) The library is included as an integral part of a product that + is sold with a cost that exceeds the cost of the distribution medium. + b) The library is offered as a WEB service for a fee c) The library is + used on an intranet in a company with more than 5 employees
+JpGraph library is an OO graph library which makes it easy to both + draw a "quick and dirty" graph with a minimum of code and quite complex + graphs which requires a very fine grain of control. The library tries + to assign sensible default values for most parameters hence making the + learning curve quite flat since for most of the time very few commands + is required to draw graphs with a pleasing esthetic look.
+Some highlights of available features are
+In addition to these high level features the library has been + designed to be orthogonal and consistent in its' naming convention. For + example, to specify color each object (i.e. axis, grids, texts, titles + etc) within the graph implements the method SetColor() with the same + signature.
+The latest version of jpgraph can always be found on +http://www.aditus.nu/jpgraph/
+Information on version numbering schema
+For the latest update on planned future version see the web-site for + JpGraph at http://www.aditus.nu/jpgraph/
+For an overview of current issues that have been reported and are + unders investigation please see our DMS (Defect Management System) + available at +http://wwww.aditus.nu/bugtraq/
+The idea for writing this library grew out of our own need for a + high quality graph drawing library for PHP. When evaluating potential + existing libraries we found (at that time around 2000) these three
+All these libraries implements some fine graphic features but + unfortunately none of those completely fulfilled our needs either for + available functionality (for example none of these supported both two + Y-scales, auto-scaling, and logarithmic scales), or general + flexibility. We especially needed the option of two Y-scales, which + none of the above packages supported. Our own preferences for design + was closest to "chart 0.3" so we started by fixing some bugs in that + package and adding some new features. However It was soon realized that + to add all the features and flexibility we needed to "chart 0.3" it + would require a complete rewrite since the original design wasn't + flexible enough, especially adding a second Y-scale would require a + more flexible OO architecture.
+Defects or suggestion for new features can be entered using the +JpGraph BugTracker available at +http://www.aditus.nu/bugtraq/
+Before reporting bugs or feature suggestions may we ask that the + following facts are considered.
+Customers who have acquired the pro-version of the library are + entitled to prioritized e-mail support for a specific time after the + purchase. Support tickets may be created by first logging in to +http://www.aditus.nu/jpgraph/pro_login.php and then create a support + ticket.
+For other users a public community forum is available at +http://jpgraph.intellit.nl/ where many common questions are answered + and discussed.
+A collection of FAQ is available at +http://www.aditus.nu/jpgraph/jpgraphfaq.php
+In addition there is a growing list of "HowTo" documents available + at +http://www.aditus.nu/jpgraph/jpgraphowto.php
+Finally, we regret that we are unable to provide general support + regarding PHP/GD/TTF/Apache installation outside the specific scope of + the JpGraph library. Please see the corresponding documentation and + relevant FAQ for those products.
+ +In order to make sure that the GD installed the following example + would be run. The example creates a very simple image using just pure + GD calls and outputs an image in PNG format. This could be considered a + smoke-test to see that the GD library is available from PHP. Please + note that this is an absolute pre-requisite in order for the + JpGraph library to work at all.
+Store the code snippet below somewhere in the document root and make + sure it runs correctly.
+ $im = @
+ImageCreate (
+150, 100)
+
or die (
+"Cannot create a new GD image.");
+
$background_color
+= ImageColorAllocate
+($im, 255,
+255, 255);
+
$text_color
+= ImageColorAllocate
+($im, 233,
+14, 91);
+
ImageString
+($im, 1,
+5, 5, "A Simple Text String", $text_color
+);
+
header ("Content-type: image/png");
+
ImagePng ($im);
+
If the above script does not work or some error or warnings are + printed on the screen then it is necessary to correct those problems + before proceeding with the installation.
+To access the more advanced features of JpGraph needs the GD 2.x + library. This will allow the use of features such as alpha-blending and + trucolor images.
+The GD 2.x library is included in all standard PHP versions from + 4.2.x and above. To make sure that the GD 2.x library is installed the + following script must be working.
+ $im =
+imagecreatetruecolor (
+300, 200);
+
$black = imagecolorallocate ($im,
+0, 0, 0
+);
+
$white = imagecolorallocate ($im,
+255, 255, 255
+);
+
+
imagefilledrectangle
+($im,0,
+0,399,99
+,$white);
+
imagerectangle
+($im,20,
+20,250,190
+,$black);
+
+
header ("Content-type: image/png"
+);
+
imagepng ($im);
+
After running this script you should now see a black rectangle in + your browser.
+JpGraph contains as default a standard set of bitmap fonts which + only supports the standard ASCII 7-bit character set. In order to use + accented characters, UTF-8, Chinese, Japanese, etc You need to download + TTF fonts. Due to various legal issues no TTF fonts are supplied in the + JpGraph package. To enable TTF fonts there are three alternatives:
+It is also necessary to make sure that the PHP installation supports + TTF fonts (either through FreeType 1 or FreeType 2 libraries). I n + addition some suitable TTF font files must also be available. To make + the font files available for the library the directory path to the + location of the font files must be specified in the configuration file, + jpg-config.inc.php
+JpGraph uses a standard naming convention for the TTF font files in + order to be able to find the correct font files. This naming convention + follows the standard naming of the available font files.
+If the installation of the library is made on a computer running MS + Windows then it is recommended to use the already available font files + in Windows (usually located in C:\WINDOWS\FONTS).
+If the installation is made on a UNIX derivate running X11 then the + font location can differ between versions and UNIX brands. One commonly + used path is "/usr/X11R6/lib/X11/fonts/truetype/".
+Finally we note that it is possible to install additional fonts not + natively supported by the library. Since this requires augmenting the + library files this is considered advanced use and not further discussed + in this introduction.
+In addition to European font it is also possible to use non-latin + based fonts such as Cyrillic, Japanese and Chinese.
+In all cases a suitable TTF font that supports the non-latin based + language must be available.
+For Cyrillic support the define LANGUAGE_CYRILLIC in jpg-config.php + must be set to true. It is then possible to use a suitable Cyrillic + font as replacement for the ordinary fonts.
+For Chinese character set JpGraph supports both BIG5 and GB2312 + encoding. For BIG5 encoding the PHP installation must have support for + the "iconv()" function. Furthermore the define CHINESE_TTF_FONT must be + set to the name of the Chinese BIG5 font that is to be used. By default + this is set to "bkai00mp.ttf". To use the Chinese BIG5 font in the + scripts one must then specify the font family as FF_CHINESE.
+To use the alternative font files "simsun.ttc" and "simhei.ttf" + (which uses the GB2312 encoding) the only step needed is to install + those fonts in the normal TTF font directory and then specify the font + family as FF_SIMSUN, the "simhei.ttf" is used when the font style is + specified as FS_BOLD.
+Some care must be taken due to the encoding that the library + expects. The library TTF handling expects the fonts to be encoded in + UTF8 encoding. Since the most commonly used Japanese encoding is EUC-JP + some conversion must be done. The best way to do this is by using the + mbstring extension to PHP to handle the encoding. By default this + module is not included and to compile PHP with support for mbstring the + option "--enable-mbstring" must be given when compiling PHP. Your + installation of PHP might also provide mbstring as a PHP module that is + loaded at runtime.
+To convert from EUC-JP the function mb_convert_encoding() is + used as the following example shows.
++$utf8-encoded-text = mb_convert_encoding($eucjp-encoded-txt, 'UTF-8','EUC-JP'); ++ By enabling the define "ASSUME_EUCJP_ENCODING" (in + jpg-config.inc.php.php) this encoding is done automatically in the + library when one of the Japanese fonts have been enabled. By default + this automatic conversion is disabled. +
If this define is false then it is up to the client to make sure + that the proper utf8 encoded text is passed on to all the methods that + are use to specify text in the library given that one of the Japanese + fonts have been selected.
+A different method also exists when it comes to Japanese font + support. By compiling PHP with the option "--enable-gd-jis-conv" this + will automatically convert Japanese characters to UTF8 when using the + FreeType libraries. However the method with the mbstring module is + preferred since the automatic conversion might on occasion fail to + detect the proper encoding.
+In order to make use of the library it is necessary to ensure that + the script files can correctly access the library include files (as + described below) and that the PHP installation supports at least one + graphic format, i.e. it supports the "image" extension in PHP.
+This is easiest verified by either checking the output of the + phpinfo() standard PHP function or by making sure the PHP + installation make the 'imagecreate()' function available.
+This means that the installation + + must have a working GD-library together with PHP before the library + JpGraph can be used. Please make sure you have version 4.3.x or above + of PHP since JpGraph is not actively tested with + versions prior to PHP 4.3.x Ideally you should use at least PHP 4.3.8
+Please note that the 1.x version of the library do not + support PHP 5.x
+In order for JpGraph to work it is necessary to adjust the cache and + TTF directory to suit the specific installation. By default the TTF + directory is "/usr/X11R6/lib/X11/fonts/truetype/" and for the cache + "/tmp/jpgraph_cache/". These are defined as PHP defines at the top of + jpg-config.inc.php
+Please make sure that PHP has write permissions to the cache + directory if the cache feature should be used. If this is not the case + a "Can't write file xxx.yyy" error will occur when a graph that uses + the cache feature are generate. More information regarding the cache + feature of JpGraph is available in the section Making sense of + caching system in JpGraph
+To add plots to the graph you will need one or more of the following + files plot extension files depending on what kind of graph you need to + create.
+In the pro-version the following additional files are available
+This is the base library files, which you must have
+Per default the standard GD image library supports PNG graphic + formats. You will need to have that installed together with your PHP + module for this library to work at all. Please refer to PHP + documentation on specifics. Note that the newer versions of GD does not + support the GIF format due to copyright problems. Hence by default only + PNG is supported.
+If you want JPEG support you will also need an additional library + for PHP, again please see PHP documentation for specifics. For most + practical purposes PNG is a better format since it normally achieves + better compression then GIF (typically by a factor of 2 for the types + of images generated by JpGraph). In comparison with JPEG format PNG is + also better for the type of images generated by this library. So, the + bottom line is, you should have a very good reason to choose any other + format then PNG.
+By default the image format is set to "auto". This means that + JpGraph automatically chooses the best available graphic using the + preferred order "PNG", "GIF", "JPG".
+ +If You are insatlling the 2.x branch then make sure the PHP version + used is at least 5.0.1 (preferable 5.0.5 or higher) and that the PHP + version have compiled support for GD 2.x library. Please note that the + 2.x branch will not work with PHP 4.x
+For 99% of the users this library will work directly with a recent + installation of PHP without any problem.
+Experience shows that most of the trouble are caused by either an + old buggy version of the free-type TTF library or using an old + antiquated version of the GD library. In order to narrow it down the + problem the following steps is helpful.
+This is not meant to be a complete discussion about configuring + or compiling PHP. It is meant as an example of a configuration of PHP + that is known to work well with JpGraph.
+Below is an example of a standard configuration that can be used to + configure and compile PHP for use with the JpGraph Library
+Please note that depending on the specific installation requirements + other options might have to be specified, specifically the paths to + external libraries might need to be adjusted.
++./configure --prefix=/usr/share \ +--datadir=/usr/share/php \ +--with-apxs=/usr/sbin/apxs \ +--libdir=/usr/share \ +--includedir=/usr/include \ +--bindir=/usr/bin \ +--with-config-file-path=/etc \ +--enable-mbstring --enable-mbregex \ +--with-pdflib=/usr \ +--with-mysql \ +--with-ttf-dir=/usr/lib \ +--with-freetype-dir=/usr/lib \ +--with-gd --enable-gd-imgstrttf --enable-gd-native-ttf \ +--with-zlib-dir=/usr/lib \ +--with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-xpm-dir=/usr/X11R6 \ +--with-tiff-dir=/usr/lib \ +--enable-ftp \ +--enable-memory-limit --enable-safe-mode \ +--bindir=/usr/bin \ +--enable-bcmath -enable-calendar \ +--enable-ctype --with-ftp \ +--enable-magic-quotes \ +--enable-inline-optimization \ +--with-bz2 \ +--with-iconv ++
To get access to the JpGraph library you will need to include at + least two files, the base library and one or more of the plot + extensions. So for example to create a basic line plot the top of your + PHP file must have the lines:
+
+
include (
+'jpgraph.php');
+
include ('jpgraph_line.php'
+);
+
...
+
// Code that uses the jpgraph library
+
...
+
As a general rule each PHP script which generates an image must be + specified in a separate file which is then called in an HTML <IMG> tag. + For example, the following HTML excerpt includes the image generated by + the PHP script in "fig1.php".
+
+ <img src="fig1.php"
+border=0 align=center width
+=300 height=200>
+
Strictly speaking the "align", "width" and "height" are not + necessary but helps the browser position the image correctly before the + image has been fully sent back to the browser.
+The library will automatically generate the necessary headers to be + sent back to the browser so that it correctly recognize the data stream + received as an image of either PNG/GIF/JPEG format. The browser can + then correctly decode the image
+Observe that you can't return anything else than an + image from the image script. By definition each HTML page (or more + correctly each HTTP stream) can only consist of one mime type which is + determined by the header for that particular stream.
+A common mistake is to have a space in the beginning of the image + script which the HTTP server will send back to the browser. The browser + now assumes that the data coming back from this script is text since it + hasn't received an explicit header. When then the image headers get + sent back to the browser to forewarn the browser of the forthcoming + image the browser will not like that as it has already assumed the data + stream was a text stream. The browser will then give the infamous + "Headers already sent error".
+To include several images together with text on a page you need to + have a parent page with several <IMG> tags which each refers to an + image script (or the same image script with GET/POST data).
+It is also possible to generate images directly using the command + line version of PHP. This works the same way as the normal "through the + browser" generation with the exception that no HTTP headers will be + generated. Only the binary image data.
+Please make sure that you run the command line version of PHP (cli). + Using the CGI SAPI version will not work since then the HTTP headers + will be generated. Note: If the CGI version is used the generation of + headers may be suppressed by the '-q' option.
+You can easily check the version installed by running
+php --version+
you should then get a response with something like
++PHP 4.3.8 (cli) (built: Aug 29 2004 22:48:10) +Copyright (c) 1997-2004 The PHP Group +Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies ++
The important thing here is the
+(cli)+
marker. The JpGraph library check from what SAPI API it is invoked + from and adjusts the header generation accordingly.
+If all the above requirements are met then images can be generated + directly on the command line and stored in a suitable file. For example + by
++$> php myimage.php > image.png ++
Please note that the file extension on the image file must match the + format in which the image is generated.
+The common pattern for creating graphs is
+Of course it is of perfectly possible to call the image script + directly in the browser to just display the generated image in the + browser.
+You should remember that it is also possible to pass arguments to + the image script via the normal HTTP GET/POST arguments. For example
<img src
+="showgraph.php?a=1&b=2"
+>
This could for example be used to control the appearance of the + image or perhaps send data to the image which will be displayed. Note + that this is probably not the best way to send large amount of data to + plot. Instead the only practical way, for large data sizes, is to get + all the data in the image script, perhaps from a DB. Another + alternative for large amount of data to be sent to the image script is + by creating a POST request to the image script.
+echo '<img src="myimagescript.php?dummy='.now().'">'; ++ It is also important to be aware of any internal caching the browser + might do. The general problem with dynamically generated images is that + the image generating script (file) remains the same. This makes the + browser believe that the data hasn't changed and if the browser already + has issues a previous GET request and has the data cached it will not + send a new GET if the timestamp on the file is the same since it then + believes it my use the old cached version.
When it comes to the structure of your imaging script they will + generally have the structure
+
+// ... Include necessary headers
+
+
$graph
+= new Graph($width,
+$height, ...);
+
+
+// ... code to construct the graph details
+
+
$graph->Stroke();
+
JpGraph is completely Object oriented so all calls will be action on + specific instances of classes. One of the fundamental classes is the + Graph() class which represents the entire graph.
+After the creation of the Graph() object all the code lines to + construct the details of the graph are added.
+The final method called in an image script will most likely be the + Graph::Stroke() method. This will send the constructed image back + to the browser. A variation of this is used if the graph are supposed + to have image maps. In that case the final method will be + Graph::StrokeCSIM()
+In addition to this standard usage pattern you can also choose to
+The cache system, which lessens the burden of the PHP server, works + by avoiding o run all the code that follows the initial Graph() call by + checking if the image has already been created and in that case + directly send back the previously created (and stored in a file) image + to the browser. When using the cache system a filename must be + specified in the initial Graph() call which is used to store the image + in the cache system and possibly also a timeout value to indicate how + long the image in the cache directory should be valid.
+In many of the examples in this manual the following pattern will be + used
+ $graph = new
+Graph(300,200
+,"auto");
The two first parameters specify the width and height of the graph + and the third parameter the name of the image file in the cache + directory. The special name 'auto' indicates that the image file + will be given the same name as the image script but with the extension + changed to indicate the graphic format used, i.e '.jpg', '.png' and so + on.
+Please note that the cache system by default is disabled and must be + enabled by setting the proper define in the file "jpg-config.inc.php"
+By default JpGraph automatically chooses the image format to use in + the order PNG, JPEG and GIF. The exact format depends on what is + available on your system. There are two ways you can influence the way + the graphic format is chosen.
+ DEFINE
+("DEFAULT_GFORMAT"
+,"auto");
$graph->
+img->
+SetImgFormat(
+"jpeg")
+
If you like to save the image directly to a file instead of + streaming it back to the browser then you just have to specify an + absolute filename in the final call to Graph::Stroke(), i.e.
+
+ $graph->
+Stroke(
+"/usr/home/peter/images/result2002.png");
Please note that the user running as Apache/PHP must have write + access to the specified directory.
+There are also two predefined filenames which have special meaning.
+ $handle =
+$graph->Stroke(__IMG_HANDLER
+);
Since Internally TrueType fonts are rendered by locating a font + specification file you must install the accompanying TrueType fonts in + directory of your choice. You must then tell JpGraph where these fonts + may be found by specifying the font-path in the FONT_PATH define (in + jpg-config.inc.php). Please note that this must be the absolute file + path and not relative to the htdocs directory. By default the path is + set to
+ DEFINE(
+"TTF_DIR",
+"/usr/local/fonts/ttf/");
+
Since JpGraph must be able to tell the difference between the italic + and bold versions of the same font family a standard naming convention + is used to name the files. The available fonts are also defined by + DEFINES and hence you can't just copy your own TTF files to the + directory and expect it to work. At the moment there is no "easy" way + to add new fonts but to make some (small) mods to the code. However + this is expected to change in future version of JpGraph.
+In order to get TTF fonts working with JpGraph you should first + check that the following pure GD scripts work correctly. Please adjust + the font path according to your installation.
+ DEFINE
+("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/"
+);
+
+
$im = imagecreatetruecolor (400,
+100);
+
$black = imagecolorallocate ($im,
+0, 0, 0
+);
+
$white = imagecolorallocate ($im,
+255, 255, 255
+);
+
+
imagerectangle
+($im,0,
+0,399,99
+,$black);
+
imagefilledrectangle
+($im,0,
+0,399,99
+,$white);
+
+
imagettftext
+($im, 30,
+0, 10, 40
+, $black, TTF_DIR.
+"arial.ttf",
+"Hello World!");
+
+
header ("Content-type: image/png"
+);
+
imagepng ($im);
+
The above script assumes you have the GD2 library and will create an + image with the classical "Hello World!" text printed in black.
+All graph objects that uses text allows you to specify the font to + be used by calling the SetFont() method and specifying three parameters
+For the builtin fonts the third, size, parameter is ignored since + the size is fixed for the three builtin fonts. The available font + families and the corresponding name (in JpGraph 1.7) are listed in the + table below.
+ +Font family | Type | Note |
FF_FONT0 | Builtin font | A very small font, only + one style |
FF_FONT1 | Builtin font | A medium sized font |
FF_FONT2 | Builtin font | The largest bit mapped + font |
FF_ARIAL | TTF font | Arial font |
FF_VERDANA | TTF font | Verdana font |
FF_COURIER | TTF font | Fix pitched courier |
FF_BOOK | TTF font | Bookman |
FF_COMIC | TTF font | Comic sans |
FF_TIMES | TTF font | Times New Roman |
FF_GEORGIA | TTF font | Georgia |
FF_TREBUCHE | TTF font | Trebuche |
FF_VERA | TTF font | Gnome Vera font, Available from + http://www.gnome.org/fonts/ |
FF_VERAMONO | TTF font | Gnome Vera Mono font, + Available from http://www.gnome.org/fonts/ |
FF_VERASERIF | TTF font | Gnome Vera Serif font, + Available from http://www.gnome.org/fonts/ |
FF_CHINESE | TTF font | Installed chinese font |
FF_SIMSUN | TTF font | Installed chinese font |
FF_BIG5 | TTF font | Installed Chinese BIG5 font + (needs iconv()) |
Please note that not all font families support all styles. The + figure below illustrates each of the available font families and what + styles you may use.
+ +We finally show some example of valid font specifications
$graph
+->title->SetFont(
+FF_FONT2);
+
$graph->title->
+SetFont(
+FF_FONT2,
+FS_BOLD);
+
$graph->title->
+SetFont(
+FF_ARIAL);
+
$graph->title->
+SetFont(
+FF_ARIAL,
+FS_BOLD,24);
Note: This information is only given here for very + advanced users. No free support will be given in the case you run into + difficulties trying to add new fonts. At the moment adding new fonts + require code modifications as outlined below.
+In order to add you favorite fonts there are three steps you need to + follow :
+For everyday use of JpGraph understanding of the alignment of text + strings in not necessary. However, if you like to add arbitrary strings + to the graph (with Graph::AddText()) or when working directly on a + canvas it will help understand this.
+Text is added to a graph with the creation of a +Text() object. And the alignment is specified with +Text::Align() Text alignment might actually be a misguiding name. + What you specify is rather the anchor point for the text, i.e. when you + specify that a text should be positioned at position (x,y) how + is that coordinate to be interpretated.
+The image below shows a text string aligned in the 9 possible + combinations. In the image the red crosses indicate what coordinate + that text string was positioned at. The alignment used for each of the + cases is shown below.
+ + +JpGraph supports both a set of built in bit-mapped fonts as well as + True Type Fonts. For scale values on axis it is strongly recommended + that you just use the built in bitmap fonts for the simple reason that + they are, for most people, easier to read (they are also quicker to + render). Try to use TTF only for headlines and perhaps the title for a + graph and it's axis. By default the TTF will be drawn with + anti-aliasing turned on.
+In many of the example you can see examples of both TrueType and + Bitmap fonts.
+There are a number of subtle differences in the way builtin fonts + and TrueType fonts are rendered to the screen. However, JpGraph, + abstracts away 99.9% of the differences so it will be, for the user, + completely transparent to switch between the different fonts.
+From version 1.10 JpGraph also supports the use of Alpha Blending + together with GD2.x This lets you specify how much of the underlying + color should be visible. You specify the amount of transparency for a + color by adding an extra parameter to the color specification separated + by an '@' (at) character.
+For example to specify a red color which is 40% transparent you + write
+ SetColor(
+"red@0.4");
+
or to specify 90% transparancy you write
+ SetColor
+("red@0.9");
Below is an example of how a bar graph with a background image can + make use of transparency + +
+ The chart below shows all available named colors.
+
+
+
For more on how to use the different themes to set the colors of Pie + plots please refer to "Working with 2D & 3D pie plots"
+
+
Theme 1: Earth
+
Theme 2: Pastel
+
Theme 3: Water
+
Theme 4: Sand
Colors can be specified in three different ways
+ SetColor
+("khaki");
A named color can also be modified by adding a adjustment factor. An + adjustment factor, 0 < f < 1, a smaller value will give a darker + version and a value of 0 or 1 will return the original color. A value > + 1 will make the color brighter. A few examples
+ SetColor
+("khaki:0.5"
+); // A darker version of "khaki"
+
SetColor("yellow:1.2");
+// A slightly lighter version of "yellow"
+
+ SetColor(array(65,
+100,176));
SetColor
+("#A16BFF");
The purpose of this chapter is to put dynamic image generation in + perspective and illustrate how HTML tags is used to call image + generating scripts. Even if You are familiar with PHP it is strongly + recommended to quickly browse through this chapter to make sure all + concepts are known.
+If You fully understand and can explain the concept of MIME types, + HTTP streams and why the "Headers already sent error" error is very + common when generating dynamic images with PHP it is probably safe to + skip this chapter. Otherwise it might be wise to read through this + chapter once.
+The enabling disabling of the cache system is controlled by two + defines (in jpg-config.php)
+
+ DEFINE(
+"USE_CACHE",
+true);
+
DEFINE("READ_CACHE",
+true)
+
The first of these, USE_CACHE, is the master-switch which must be + set to true to enable the caching system. The second switch READ_CACHE + very seldom needs to be changed.
+This second switch basically tells whether or not JpGraph should + ever look in the cache. Setting this to false and the master-switch to + true would then always generate an new updated image file in the cache + and this new image would be send back to the browser. The main use for + this (admittedly) strange setting is if you like to have the side + effect of the script that a fresh image is always stored in the cache + directory.
+Once you have enabled the cache you must also make sure that a valid + cache directory is setup. The cache directory is specified with the + define
+
+ DEFINE(
+"CACHE_DIR",
+"/tmp/jpgraph_cache/");
+
You can of course change the default directory to whatever directory + you fancy. But, you must remember one important thing. The + cache directory must be writable for the user running Apache/PHP +.
+For this reason one of the resource files included is the special + language "prod" which is meant to be used in a production site where to + give a generic error message. The generic error message can be tailored + by changing a define in the prod locale resource file.
+To use caching in your script you must supply a suitable file name + which will be used to store the image in the cache. You can also supply + a timeout value indicating how many minutes the cached image should be + considered valid.
+These parameters are supplied in the initial Graph() method call + which should be among the first in your script. Instead of manually + specifying a file name to be used you could often use the special name + "auto". If the filename is specified as "auto" the cashed image will + then be named the same as the image script but with the correct + extension depending on what image format have been chosen.
+If you don't specify a file name no caching will be used no matter + the settings of USE_CACHE (without a file name it is impossible!)
+The following call to Graph() shows a typical use of the cache.
+
+ $graph = new
+Graph(300,200
+,"auto",60)
+
The above code will use the automatic filename and a make the cache + valid for 60 minutes.
+So, how does this all work now?
+The first time you call your script (no cached image) everything + will be as usual, the script will run and you will in the end send back + the image to the browser. However if you have the caching enabled + JpGraph will automatically have stored a copy of the generated image in + the cache directory.
+The next time you call the script the first thing that happens in + the initial Graph() is that it will go and check in the cache directory + if the named image exists there. If this is the case it will also + checks that the image isn't too old (as compared to the specified + timeout value). If the image is valid then the image will be streamed + straight back from the image file to the browser and the script will + end it's execution.
+Hence, if the image is found in the cache no code lines + after the initial Graph() call will be executed
+The design decision behind this is that your image script code never + has to include anything special to make full use of the cache. It will + just automatically work.
+The arguments are formatted in the error text in the same way as + parameters in the printf() family of functions.
+To create your own localized error resource file You should copy the + "en.inc.php" to a temporary file, rename it for localem and then + translate each error message to Your language of choice. Make sure the + file is stored under the lang/ catalogue and You are ready to use your + new locale.
+You can also use the cache system for CSIM as well. The cache system + interface is slightly different in this case since the cache needs to + store both the cached image and the cached image-map. + It also needs to change due to the way CSIM HTML paradigm work. The two + major differences from the "standard" cache is
+The performance benefits even for simple CSIM images is around 50% + if the cache can be used and can of course be several 1000% if + construction of the image requires DB calls and other complex + operations which can be avoided.
+Before reading further you should have an understanding on how the + CSIM works by reading the section "sing Client side image maps".
+Please remember that when using CSIM you must end your script with a + call to Graph::StrokeCSIM() method instead of the +Graph::Stroke() used for non-csim.
+To use the cache with CSIM you have to call the +Graph::CheckCSIMCache(). As with the caching for non-CSIM you have + to supply a name to be used for the cached version as well as an + optional timeout value. The default timeout value if nothing else is + specified is 60 minutes.
+The name argument requires some more explanations. You must specify + a relative name here. For example "myimage" or perhaps + "firstpage/image3". Depending on your installation of JpGraph this will + now end up in the directory specified in the CSIMCACHE_DIR define. This + must also be a directory accessible by the normal web server. By + default a directory called "csimcache" will be created in the same + directory as the image script itself.
+This has the drawback that the directory from where the script is + executed must be writable by the process running PHP. Best practice for + this is to keep the number of writable directory for PHP down to a + minimum and re-use the same directory as is used for the standard + cache. This however, require that your system administrator setup that + cache directory so that it also accessible by the HTTP server from the + htdocs root.
+The CheckCSIMCache() method checks the cache for an existing cached + version and if found it returns it and halts execution of the script. + So, this call should be the first call after the creation of the + Graph() and before any heavy work is done to create the image so that + you can minimize the execution of the script in the case a match is + found.
+So, the general structure of a script that uses CSIM and the cache + is
+ $graph = new
+Graph(400,300
+);
+
+
// Check cache, 10 min timeout
+
$graph->CheckCSIMCache(
+"image1",10);
+
+
+// !! If cached version exists, execution halts here !!
+
+
//
+
// ... Construct the image with heavy DB calls etc, etc
+
//
+
+
$graph->StrokeCSIM();
+
Please note that you do not need to pass any + argument to the final call to StrokeCSIM() as you do when not using the + cache.
By default all plots are clipped outside the plot area. This means + that if you manually specify a scale and then try to plot which has + values smaller/larger than the scale those values will not show.
+The clipping algorithm is "perfect" in the sense that for example + line plots where the plot area cuts the line between two data points + the line will be drawn up to the edge of the plot area. The algorithm + used is O(1) in number of data points.
+The disabling/enabling of clipping manually is controlled by +Graph::SetClipping()
+This is a summary of the available feature for all Graph based + charts, i.e. line plots, error plots, scatter plots, etc.
+The library has a quite extensive set of error messages to give + hints and catch erroneous input to many of the controlling methods and + also do sanity check on the data to be plotted.
+All error messages are collected in resource files which are + localized to a specific language. All resource files are located under + the "lang/" directory in the JpGraph installation directory. The + deafult locale to be used is defined in the configuration file with the + setting DEFAULT_ERR_LOCALE in the distribution this is set to English + locale.
+The chosen locale is specified in the beginning of the script with a + call to the static method JpGraphError::SetErrLocale(). The + argument to this method is the ISO naming of the country/language to be + selected. For example to enable the special production locale the + following line should be added in the beginning of the script
++JpGraphError::SetErrLocale('prod'); ++ If an unknown or unsupported locale is given the error message will + default to English.
To reduce load on the web server JpGraph implements an advanced + caching system which avoids the burden of always having to run the full + image script.
+Depending on the complexity of the image script (for example if it + is doing several DB lookups) this could significantly improve + performance.
+The rationale behind this is of course performance, and the + observation that very few graphs are really real-time, i.e. needs to be + updated absolutely every time the graphing script is called.
+ +The enabling disabling of the cache system is controlled by two + defines (in jpg-config.php)
+
+ DEFINE(
+"USE_CACHE",
+true);
+
DEFINE("READ_CACHE",
+true)
+
The first of these, USE_CACHE, is the master-switch which must be + set to true to enable the caching system. The second switch READ_CACHE + very seldom needs to be changed.
+This second switch basically tells whether or not JpGraph should + ever look in the cache. Setting this to false and the master-switch to + true would then always generate an new updated image file in the cache + and this new image would be send back to the browser. The main use for + this (admittedly) strange setting is if you like to have the side + effect of the script that a fresh image is always stored in the cache + directory.
+Once you have enabled the cache you must also make sure that a valid + cache directory is setup. The cache directory is specified with the + define
+
+ DEFINE(
+"CACHE_DIR",
+"/tmp/jpgraph_cache/");
+
You can of course change the default directory to whatever directory + you fancy. But, you must remember one important thing. The + cache directory must be writable for the user running Apache/PHP +.
+The standard structure for an HTML page using client side image maps + would be something along the lines of
+ ++// Image map specification with name "mapname" +<MAP NAME=...> +... specification ... +</MAP> + +// Image tag +<img src="..." ISMAP USEMAP="mapname"> ++
This poses an interesting question.
+Since we normally call the graphing script directly in the <img> tag + how do we get hold of the image map (which is available only in the + image script) in this "HTML wrapper" script?
+In JpGraph there is actually two ways of solving this.
+The first (and preferred) way modifies the stroke method so that + instead of returning an image (like the standard Stroke() method) + StrokeCSIM() actually returns an HTML page containing both the image + map specification and the correct <IMG> tag.
+This of course means that it is necessary to treat an image map + returning image script differently from a non-CSIM image script, for + example you can't use it directly as the target for the "src" attribute + of the <IMG> tag since it sends back an actual HTML page containing + both an image tag together with an image map.
+To turn a standard image script into a CSIM script the first thing + needed to do is to supply the appropriate URL targets for the hotspots + in the image.
+What the hotspots represent depends on the type of plot you are + doing. The following plot types and graph areas support image maps.
+To specify a link for each hotspot you have to use the + SetCSIMTargets() method for each plot (or specific area) in the + graph which should be a hotspot.
+There are two arguments to this method
+To use caching in your script you must supply a suitable file name + which will be used to store the image in the cache. You can also supply + a timeout value indicating how many minutes the cached image should be + considered valid.
+These parameters are supplied in the initial Graph() method call + which should be among the first in your script. Instead of manually + specifying a file name to be used you could often use the special name + "auto". If the filename is specified as "auto" the cashed image will + then be named the same as the image script but with the correct + extension depending on what image format have been chosen.
+If you don't specify a file name no caching will be used no matter + the settings of USE_CACHE (without a file name it is impossible!)
+The following call to Graph() shows a typical use of the cache.
+
+ $graph = new
+Graph(300,200
+,"auto",60)
+
The above code will use the automatic filename and a make the cache + valid for 60 minutes.
+So, how does this all work now?
+The first time you call your script (no cached image) everything + will be as usual, the script will run and you will in the end send back + the image to the browser. However if you have the caching enabled + JpGraph will automatically have stored a copy of the generated image in + the cache directory.
+The next time you call the script the first thing that happens in + the initial Graph() is that it will go and check in the cache directory + if the named image exists there. If this is the case it will also + checks that the image isn't too old (as compared to the specified + timeout value). If the image is valid then the image will be streamed + straight back from the image file to the browser and the script will + end it's execution.
+Hence, if the image is found in the cache no code lines + after the initial Graph() call will be executed
+The design decision behind this is that your image script code never + has to include anything special to make full use of the cache. It will + just automatically work.
+The simplest way of creating a creating a CSIM image is with the + StrokeCSIM() method. As mentioned before this method actually returns a + (small) HTML page containing both the image-tag as well as the image + map specification. Hence it is not possible to use a script that + ends with this method in a standard image-tags src property.
+There are two ways to create CSIM (or get hold of) the image maps
+
+
+<a href="mycsimscript.html">
+
+
This has the drawback that the image page will only contain the
+ image and nothing else.
+
+<h2> This is an CSIM image </h2>
+
+<?php
+include "mycsimscript.php"
+?>
+
+
The process to replace Stroke() with StrokeCSIM() is strait forward. + Replace all existing calls to Stroke() with the equivalent calls to + StrokeCSIM().
+ The only difference is that it is necessary ti supply a minimum of
+ one file name in the StrokeCSIM() method. The first argument must be
+ the name of the actual image script file including the extension. So
+ for example if the image script is called "mycsimscript.php" it is
+ necessary to write
+
+ $graph->
+StrokeCSIM(
+'mycsimscript.php')
+
+
However, it is possible to apply a small "trick" here. PHP maintain
+ a special variable called "__FILE__" which is always set to the current
+ file name. This means you could use the following construction:
+ $graph->
+StrokeCSIM(
+basename(
+__FILE__))
+
This is a better way since the script can now be renamed without + having to change any code in the file which otherwise would be needed.
The other arguments to StrokeCSIM() are optional. Please note that + if several CSIM images are used in the same HTML page it is also + necessary to specify the image map name as the second parameter since + all image maps must be unique to properly match each image map against + each image. Please consult the class reference + StrokeCSIM() for more details.
+You can also use the cache system for CSIM as well. The cache system + interface is slightly different in this case since the cache needs to + store both the cached image and the cached image-map. + It also needs to change due to the way CSIM HTML paradigm work. The two + major differences from the "standard" cache is
+The performance benefits even for simple CSIM images is around 50% + if the cache can be used and can of course be several 1000% if + construction of the image requires DB calls and other complex + operations which can be avoided.
+Before reading further you should have an understanding on how the + CSIM works by reading the section "sing Client side image maps".
+Please remember that when using CSIM you must end your script with a + call to Graph::StrokeCSIM() method instead of the +Graph::Stroke() used for non-csim.
+To use the cache with CSIM you have to call the +Graph::CheckCSIMCache(). As with the caching for non-CSIM you have + to supply a name to be used for the cached version as well as an + optional timeout value. The default timeout value if nothing else is + specified is 60 minutes.
+The name argument requires some more explanations. You must specify + a relative name here. For example "myimage" or perhaps + "firstpage/image3". Depending on your installation of JpGraph this will + now end up in the directory specified in the CSIMCACHE_DIR define. This + must also be a directory accessible by the normal web server. By + default a directory called "csimcache" will be created in the same + directory as the image script itself.
+This has the drawback that the directory from where the script is + executed must be writable by the process running PHP. Best practice for + this is to keep the number of writable directory for PHP down to a + minimum and re-use the same directory as is used for the standard + cache. This however, require that your system administrator setup that + cache directory so that it also accessible by the HTTP server from the + htdocs root.
+The CheckCSIMCache() method checks the cache for an existing cached + version and if found it returns it and halts execution of the script. + So, this call should be the first call after the creation of the + Graph() and before any heavy work is done to create the image so that + you can minimize the execution of the script in the case a match is + found.
+So, the general structure of a script that uses CSIM and the cache + is
+ $graph = new
+Graph(400,300
+);
+
+
// Check cache, 10 min timeout
+
$graph->CheckCSIMCache(
+"image1",10);
+
+
+// !! If cached version exists, execution halts here !!
+
+
//
+
// ... Construct the image with heavy DB calls etc, etc
+
//
+
+
$graph->StrokeCSIM();
+
Please note that you do not need to pass any + argument to the final call to StrokeCSIM() as you do when not using the + cache.
In the Example/ directory there are a number of examples of how to + setup the various types of image maps. The following examples are + currently available
+In order to easily access all of these examples it is possible to + call the testsuit.php example with an additional argument "t=2". + By following the link +testsuit.php?t=2 a separate window will open with all the possible + CSIM examples.
+By default plots are not clipped outside the plot area for + performance reasons.
+This means that if you have manually specified a scale range and + your data is outside that range the plot will be drawn outside the + scale and into the margin.
+The clipping algorithm is "perfect" in the sense that for example + line plots where the plot area cuts the line between two data points + the line will be drawn up to the edge of the plot area. The algorithm + used is O(1) in number of data points.
+The disabling/enabling of clipping manually is controlled by +Graph::SetClipping()
+This is a summary of the available feature for all Graph based + charts, i.e. line plots, error plots, scatter plots, etc.
+Knowledge of the exact technical details of the way StrokeCSIM() + works is probably not needed by many people but for completeness we + outline those details in this short section.
+The fundamental issue we have to solve is that we must be able to + call the image script in two modes. When the user includes the image + script the StrokeCSIM() method should return the HTML page but when the + image script is later called directly in the image tag it must not + return an HTML page but rather the actual image.
+The way this is solved is by using one HTTP argument which is passed + on automatically when we use the image script name in the image-tag.
+If you look at the generated HTML you will see that the argument to + the src-property of the image tag is not simply the script name but the + script name with a additional argument.
+In the JpGraph internal code this pre-defined argument is checked + for and if it exists the image is send back and not the HTML page.
+The name of this argument is defined by a DEFINE() statement in + JpGraph. The define is _CSIM_DISPLAY.
+In the case where you want to store the image on disk and later use + it in an img-tag you need to get hold of the image map. For this you + will have to use the function + Graph::GetHTMLImageMap()
+An example of the use of this is shown below. With these lines the + image will be written to a file. The script then returns a HTML page + which contains the Client side image map and an img-tag which will + retrieve the previously stored file.
+ $graph->Stroke(
+"/usr/local/httpd/htdocs/img/image001.png"
+);
+
echo $graph
+->GetHTMLImageMap
+("myimagemap001"
+);
+
echo
+"<img src=\"img/image001.png\" ISMAP USEMAP=\"#myimagemap001\" border=0>"
+;
+
For version 1.9 the cache system has been extended to include even + the CSIM maps. For each CSIM graph two files are stored in the cache, + the image file itself as well as the wrapper HTML with the actual image + map. For further information see the chapter on "Understanding the + Cache system"
+To reduce load on the web server JpGraph implements an advanced + caching system which avoids the burden of always having to run the full + image script.
+Depending on the complexity of the image script (for example if it + is doing several DB lookups) this could significantly improve + performance.
+The rationale behind this is of course performance, and the + observation that very few graphs are really real-time, i.e. needs to be + updated absolutely every time the graphing script is called.
+ +Image maps, or client side image (CSIM) as they are known is fully + supported in JpGraph. It gives you the opportunity to create hot-spots + in the graphs which allows you to build a set of "drill-down" graphs.
+In the following section is based on the assumption that the reader + is familiar with the basic concepts of client side image map in HTML.
+To shortly recapitulate. Client side image maps consists of two + parts. The first part is the actual image and the second part is a + mapping that gives the coordinates for areas in the image which should + be marked as hot spots (i.e. click-able by the user). The library can + automatically generate these coordinate maps from a given graph.
+Through out the manual areas of the graph that may be used as a + hotspot is given in conjuction with the general description of that + area.
+The easiest way to get a date time scale for the X-axis is to use + the pre-defined "dat" scale. To be able to use that it is first + necessary to include the module "jpgraph_date.php" and the + specify the scale, for example as "datlin" in the call to SetScale() + as the following code snippet shows.
+ require_once("../jpgraph.php");
+
require_once("../jpgraph_line.php");
+
require_once("../jpgraph_date.php");
+
...
+
$graph
+= new Graph(540,
+300);
+
$graph->SetScale(
+'datlin');
+
...
The above code snippet would create a date/linear scale for the + graph. We will first show a basic use of the date scale and then go on + to illustrate how it is possible to tailor the exact formatting of the + date axis.
+When using the fully automatic formatting the library will use the + shortest possible string that uniquely identifieas a date/time. For + example if the entire intervall falls within the same day only the time + values will be displayed, if the intervall falls over several days then + also the date will be added to the label.
+As usual it is also possible to manually force a certain label + formatting to be used this is illustrated below.
+The first basic example below creates a data set that emulates a + sample rate every S second and falls over a total period of two days. + It is important to note that the input data on the X-axis must be a in + the form of timestamp data, i.e. the number of seconds from the system + epoch. In PHP the current timestamp value is returned by the function + time().
+This means that it is always mandatory to specify two input vectors + for a plot. For example to specify a line plot
+ $line
+= new LinePlot
+($data,$xdata);
+
The example below show this in practice
+Please review the script (by following the [src] link) that creates + this graph before continuing since we will base all further examples on + the above example.
+As can be seen from the above example the scale starts slightly + before the first data point. Why? This is of course by purpose in order + to make the first time label to start on an "even" value, in this case + on an hour. Depending on the entire interval of the graph the start + value will always be chosen to be the largest "even" time value, this + could for example be on an even minute, even 30min, even hour, even + day, even week and so on.
+The alignment of the start (and end) vdate alignment can also be + adjusted manually by using the two methods
+These method allow the alignment to be made by specifying one of the + following constants.
+For the SetTimeAlign() the following symbolic constants can be used
+For the SetDateAlign() the following symbolic constants can + be used
+Some examples will calrify the use of these methods.
+Example 1. We want the time adjustment to start on an even + quarter of an hour, i.e. an even 15 minute period.
$graph
+->xaxis->scale->
+SetTimeAlign(
+MINADJ_15);
+
Example 2. We want the time to start on an even 2 hour
$graph
+->xaxis->scale->
+SetTimeAlign(
+HOURADJ_2);
+
Example 3. We want the start to be on an even day
$graph
+->xaxis->scale->
+SetDateAlign(
+DAYADJ_1);
+
The default label format always tries to use the shortest possible + unique string. To manually set a manual scale the method + SetDateFormat() is used for example as in
+ $graph
+->xaxis->scale->
+SetDateFormat(
+'H:i');
+
The above example will force the labels to be displayed as hour (24h) + and minutes.
As with the linear scale it is possible to indicate what density of + scale ticks is needed. This is specified as usual with a call to + Graph::SetTickDensity()
+ $graph->SetTickDensity(
+TICKD_DENSE);
+
In the following we will assume that all data points are specified + by a tuple where the date/time is specified as a timestamp in second in + the same format as is returned by the PHP function time().
+The trick here is to use a label formatting callback routine which + gets called to format each label on the scale.
+What we do is that we specify that the X-scale should be an ordinary + "int" scale (remember that the data values are timestamps which are + integers). We then install our custom label callback (with a call to + SetLabelFormatCallback()) which given a timestamp formats it to a + suitable human readable form. In our example we will use the PHP + function Date() for this purpose.
+The callback we use will be
+
+// The callback that converts timestamp to minutes and seconds
+
function
+TimeCallback(
+$aVal) {
+
return Date
+('H:i:s',$aVal);
+
}
Using some random data we can now generate the following graph
In the above example we have specified the X-scale manually to make + sure that the min/max values on the X-axis exactly matches the min/max + x-data values.
+SetLabelFormatCallback() will be called for each of the displayed + labels and the argument passed on to the supplied function is the + default label that the library is assigning that specific label.
+This means that if the data to be displayed is based on, for + example, timestamps which are given in seconds the displayed value + might not be aligned to how time/date values normally should be + displayed.
+Using integer scales this will not work very well since the library + determines label positions to be at even positions (e.g. every 2,5,10, + 20,50,100 etc) to suit the auto-scaling since the library will assume + that the data is integers and not timestamp values.
+The best way to solve this is to use an integer X-scale together + with a a callback function with a manually specified scale. In order to + setup the scale a bit of manually work is needed. Depending on the data + to be displayed one should ensure that the scale starts and ends at + suitable times and that the tick interval chosen fits with an even + multiple of minutes, hours, days or what is best suited for the time + range that is to be displayed.
+The following code example illustrates this. It creates some "fake" + data that is assumed to be sampled time based data and sets up some + suitable scales and tick interval. This script may be used as a basis + for more advanced handling of the time data.
<?php
+
+// Example on how to treat and format timestamp as human readable labels
+
require_once(
+"../jpgraph.php");
+
require_once("../jpgraph_line.php");
+
+
// Number of "fake" data points
+
DEFINE('NDATAPOINTS',
+500);
+
+
+// Assume data points are sample every 10th second
+
DEFINE('SAMPLERATE',
+10);
+
+
+// Callback formatting function for the X-scale to convert timestamps
+
// to hour and minutes.
+
function
+TimeCallback(
+$aVal) {
+
return Date
+('H:i', $aVal);
+
}
+
+
// Get start time
+
$start = time();
+
+// Set the start time to be on the closest minute just before the "start" timestamp
+
$adjstart
+= floor($start /
+60);
+
+
+// Create a data set in range (20,100) and X-positions
+
+// We also apply a simple low pass filter on the data to make it less
+
// random and a little smoother
+
$data
+= array();
+
$xdata
+= array();
+
$data[0] =
+rand(20,100
+);
+
$xdata[0] =
+$adjstart;
+
for( $i=1;
+$i <
+NDATAPOINTS; ++
+$i ) {
+
$data[$i] =
+rand(20,100
+)*0.2 + $data[
+$i-1]*0.8
+;
+
$xdata
+[$i] = $adjstart +
+$i *
+SAMPLERATE;
+
}
+
+
+// Assume that the data points represents data that is sampled every 10s
+
// when determing the end value on the scale. We also add some extra
+
// length to end on an even label tick.
+
$adjend = $adjstart + (
+NDATAPOINTS+10)*10
+;
+
+
$graph
+= new Graph(500,
+250);
+
$graph->SetMargin(
+40,20,30
+,50);
+
+
+// Now specify the X-scale explicit but let the Y-scale be auto-scaled
+
$graph->SetScale(
+"intlin",0,0
+,$adjstart,$adjend);
+
$graph->title->
+Set(
+"Example on TimeStamp Callback");
+
+
+// Setup the callback and adjust the angle of the labels
+
$graph->xaxis->
+SetLabelFormatCallback(
+'TimeCallback');
+
$graph->xaxis->
+SetLabelAngle(
+90);
+
+
+// Set the labels every 5min (i.e. 300seconds) and minor ticks every minute
+
$graph->xaxis->
+scale->ticks->Set
+(300,60);
+
+
$line
+= new LinePlot
+($data,$xdata);
+
$line->SetColor(
+'lightblue');
+
$graph->Add(
+$line);
+
+
$graph->Stroke();
+
?>
+
With date/time scale we refer to the plotting of data where the + independent variable (X-axis) de-nominates a time value. This could for + example be the temperature measured in intervals during a day.
+From version 1.18 and onwards there are two principal ways of + handling date/time scales. The manual way and fully automatic using the + special "dat" scale. For most cases the automatic "dat" scale is the + preferred choice but in rare circumstances it might be more appropriate + to use the manual way since it gives slightly more control (but not + that much) of the overall handling of scales.
+To be able to use a date/time scale at all we will assume that the + data points are represented by both an X coordinate (time-value) and a + Y-value (anything else wouldn't make sense).
+We first start by describing the use of the "dat" scale.
+By default only the Y-axis have grid lines and then only on major + ticks, i.e. ticks which have a label. It is of course possible to + change this. Both the X , Y and Y2 can have grid lines. It is also + possible to let the gridlines also be drawn on the minor tick marks, + i.e. ticks without a label. Lets see how we can apply this to the graph + above.
+The grid is modified by accessing the xgrid (or ygrid) component of + the graph. So to display minor grid lines for the Y graph we make the + call
+ $graph->ygrid->Show
+(true,true)
+
The first parameter determines if the grid should be displayed at + all and the second parameter determines whether or not the minor grid + lines should be displayed.
+If you also wanted the grid lines to be displayed for the Y2 axis + you would call
+ $graph->
+y2grid->Show(true
+,true)
Note. In general it is not a good idea to display + both the Y and Y2 grid lines since the resulting image becomes + difficult to read for a viewer.
+We can also enable the X-grid lines with the call
$graph
+->xgrid->Show(
+true)
+
In the above line we will of course only just enable the major grid + lines.
+To bring all this together we will display a graph with grid lines + for both Y and X axis enabled.
Another option for the grid lines is the possibility to have the + area between the grid lines filled with alternating two colors. The + example below illustrates this.
+In the example above we have also made use of alpha-blending + (requires GD 2.x or higher). By default the filled grid lines are + disabled. To enable this style you have to call the +Grid::SetFill() method.
+You might want to have specific labels you want to use for the + X-axis when this has been specified as a "text" scale. In the previous + example each Y-point might represent a specific measurement for each of + the first 10 month. We might then want to display the name of the + months as X-scale.
+To specify the labels on the scale you make use of the + SetTickLabels() method.
+To get a localized version of the name of the month you can use a + nice feature in JpGraph, the global '$gDateLocal' object which is an + instance of the + DateLocale
+This class has a number of methods to get localized versions of + relevant names for dates, (months and weekdays).
+So to specify the X-axis with the short form of the month names we + use the construction
+ $a =
+$gDateLocale->
+GetShortMonth();
+
$graph->xaxis->
+SetTickLabels(
+$a);
+
This will, now result in the image displayed below
+As can be seen in the previous example the X-axis is slightly + cluttered with the labels very close to each other. We might rectify + this by either enlarging the image or just displaying fewer tick label + on the x-axis.
+Specifying that we only want, for example, to print every second + label on the axis is done by a call to the method + SetTextLabelInterval() Which would result in the graph
+ +If the text labels are long (for example full dates) then another + way might be to adjust the angle of the text. We could for example + choose to rotate the labels on the X-axis by 90 degrees. With the help + of the SetLabelAngle() +
+Which would then result in the image below
+Using a filled line plot is not much different from using a normal + line plot, in fact the only difference is that you must call the method + SetFillColor() + on a normal line plot. This will then fill the area under the line + graph with the chosen color.
+In the example below we have also, as an example, specified plot + marks (see previous sections).
+Note 1. If you add multiple filled line plots to + one graph make sure you add the one with the highest Y-values first + since it will otherwise overwrite the other plots and they will not be + visible. Plots are stroked in the order they are added to the graph, so + the graph you want front-most must be added last.
+Note 2. When using legends with filled line plot + the legend will show the fill color and not the bounding line color.
+Note 3. Filled line plots is only supposed to be + used with positive values. Filling line plots which have negative data + values will probably not have the appearance you expect.
+As you can see from the graph above the grid lines are below the + filled line graph. If you want the grid lines in front of the graph you + can adjust the depth with call to + Graph::SetGridDepth() As the following example shows
+ +Accumulated line graphs are line graphs that are "stacked" on top of + each other. That is, the values in the supplied data for the Y-axis is + not the absolute value but rather the relative value from graph below. + For example if you have two line graphs with three points each, say + [3,7,5] and [6,9,7]. The first graph will be plotted on the absolute + Y-values [3,7,5] the second plot will be plotted at [3+6, 7+9, 5+7], + hence the values of the previous graphs will be used as offsets.
+You may add any number of ordinary line graphs together. If you want + to use three line plots in an accumulated line plot graph you write the + following code
+
+ // First create the individual plots
+
$p1 = new LinePlot(
+$datay_1);
+
$p2 = new LinePlot(
+$datay_2);
+
$p3 = new LinePlot(
+$datay_3);
+
+
+// Then add them together to form a accumulated plot
+
$ap = new AccLinePlot(array($p1,
+$p2,$p3));
+
+
+// Add the accumulated line plot to the graph
+
$graph->Add(
+$ap);
+
You might of course also fill each line plot by adding the lines
$p1
+->SetFillColor
+("red");
+
$p2->SetFillColor(
+"blue");
+
$p3->SetFillColor(
+"green");
+
Using some appropriate data this might then give a graph perhaps + like the one showed in the figure below
+ +If you only have access to a few data points but still want a smooth + curve between those data points JpGraph can help you achieving that by + letting you construct cubic splines. If you never have heard of cubic + splines before, don't worry. You only have to supply the data points + you know tell JpGraph how many interpolated points in total you want in + the graph. JpGraph will now take care of constructing a smooth curve + between all you data points. The new, smooth, curve will be made up of + exactly as many interpolated points as you have specified.
+To construct a spline you need both the X and Y coordinates for the + known data points.
+You start by constructing a new Spline instance. To + get access to the Spline class you must first remember to include the + file "jpgraph_regstat.php". You instantiate this class by calling it + with your two known data arrays (X and Y) as follows.
$spline
+= new Spline($xdata,
+$ydata);
+
This call initializes the spline with the data points you have. These + data points are also known as Control points for the spline. + This helper class doesn't draw any line itself. Instead it is merely + used to get a new (larger) data array which have all the interpolated + values. You then use these new value in your plot. This way give you + great flexibility in how you want to use this interpolated data.
+Continuing the above line we now use the Spline::Get() + method to get an interpolated array containing a specified number of + points. So for example the line
+ list(
+$sdatax,
+$sdatay) =
+$spline->Get(50
+);
Will construct the two new data arrays '$sdatax' and '$sdatay' which + contains 50 data points. These two arrays are constructed from the + control point we specified when we created the '$spline' object.
+You would then use these two new data array in exactly the same way + as you would form ordinary data vectors.
+The following example illustrates this
+In order to make the example more interesting we actually use two + plots. First a line plot to get the smooth curve and then a standard + scatter plot which is used to illustrate where the control points are.
+To emphasize the specific data points it is possible to add plot + marks at each data point. Plot marks can be either
+You access the plot mark through the "mark" instance variable in the + plot, as in
+ $lineplot->
+mark->SetColor("red"
+);
To choose between the different plot marks you call the +PlotMark::SetType() method with the correct define to choose the + plot type you want to use.
+The simple shape type of plot marks are
+To specify an arbitrary image you use the special define
+In this case you must also specify a image file name and an optional + scaling constant. For example as in
+ $lineplot->mark->
+SetTYPE(
+MARK_IMG,
+"myimage.jpg",
+1.5);
+
If you want to use one of the built-in images the following images + are available. Please note that not all images are available in all + possible colors. The available colors for each image is listed below.
+The following shape (the first class) plot marks are available
+For the second class (built-in images) the following table list the + different images as well as what color they are available in. For the + built-in images you specify the color with the second argument.
+Note that some of the images are available in different sizes. The + reason is that even though you can scale them by the third argument + there is a visual degradation to scale an image larger than it's + original size since some pixels needs to be interpolated. Reducing the + size with a scale < 1.0 gives much better visual apperance.
+The scaling works with both GD 1 and GD 2 but with GD 2 the quality + of the scaling is much better.
+Built-in images and available colors:
+Type | Description | Colors |
---|---|---|
MARK_IMG_PUSHPIN, MARK_IMG_SPUSHPIN | Push-pin image | +'red','blue','green','pink','orange' |
MARK_IMG_LPUSHPIN | A larger Push-pin image | +'red','blue','green','pink','orange' |
MARK_IMG_BALL, MARK_IMAGE_SBALL | A round 3D rendered ball | +'bluegreen','cyan','darkgray','greengray', + 'gray','graypurple','green','greenblue','lightblue', + 'lightred','navy','orange','purple','red','yellow' |
MARK_IMAGE_MBALL | A medium sized round 3D rendered ball | + 'blue','bluegreen','brown','cyan', + 'darkgray','greengray','gray','green', + 'greenblue','lightblue','lightred', 'purple','red','white','yellow' | +
MARK_IMAGE_LBALL | A large sized round 3D rendered ball | + 'blue','lightblue','brown','darkgreen', + 'green','purple','red','gray','yellow','silver','gray' |
MARK_IMAGE_SQUARE | A 3D rendered square | +'bluegreen','blue','green', 'lightblue','orange','purple','red','yellow' | +
MARK_IMG_STAR | A 3D rendered star image | +'bluegreen','lightblue','purple','blue','green','pink','red','yellow' | +
MARK_IMG_DIAMOND | A 3D rendered diamond | +'lightblue','darkblue','gray', 'blue','pink','purple','red','yellow' | +
MARK_IMG_BEVEL | A 3D rendered bevel style round ring | +'green','purple','orange','red','yellow' |
It might sometimes be desirable to highlight the data-points with + marks in the intersection between the given x and Y-coordinates. This + is accomplished by specifying the wanted plot mark type for the "mark" + property of the line graph. A full list of all available marks is given + in the class reference +PlotMarks
+For now let's just add a triangle shape marker to our previous graph + by adding the line
$lineplot->
+mark->SetType(MARK_UTRIANGLE
+);
This will give the graph as shown below
+ +If you like you can of course both change the size, fill-color and + frame color of the chosen plot mark.
+The colors of the marks will, if you don't specify them explicitly, + follow the line color. Please note that if you want different colors + for the marks and the line the call to SetColor() for the marks must be + done after the call to the line since the marks color will always be + reset to the lines color when you set the line.
+In the following section we will work through an number of examples + on how to manipulate labels on a text scale. Primarily we will + investigate how to best handle the case where you have a large number + of values.
+As a remainder; Text scale is meant to be used on the X-axis when + the X-axis doesn't have a numeric value, i.e you are only interested in + linear ordering of the data. If you don't specify the labels manually + they will be set automatically starting from 1 as the example below + shows.
+ + +To specify the labels on the X-axis as suitable text strings you + call the method + Axis::SetTickLabels() with an array containing the text-labels. If + there are more data points than labels the non-specified labels will be + given their ordinal number. If we augment the previous example with the + name of the month we get the following new example
+ + + +What happen now if we have a larger number of bars? Let's try with + 25 bars and see what result we get.
+ + +Not all to impressive. The labels are to close and they overlap. + Hence it is not a good idea to display every label. To adjust what + labels are to be displayed you use the + SetTextLabelInterval() method. The argument to this method is the + interval between text labels. So to display only every 3 month you + would add the line
+
+ $graph->xaxis->SetTextLabelIntervall(3
+)
Which would give the result shown below
+ +Much better, quite readable.
+If we have an even larger data set it might not longer be meaningful + to display all the tick marks since they would simple become to close. + In JpGraph there is a possibility to specify that you only would like + every n:th tick mark to be visible ( + SetTextTickIntervall() ). For bar graphs using text scale however, + that might not be such a good idea since the tick marks are between the + bars and the labels centered under the bars. If we only were to + display, say, every 3 tick mark it wouldn't look to good. Not that we + can't do it, as the example below shows, but it just doesn't look very + good.
+ +A better way to handle large data set is simply to hide the tick + marks all together. Tick marks may be hidden by calling the method + Axis::HideTicks(); If we hide all the ticks on the X-axis we will + get the result shown below
+ +To add clarification or other information text strings to the graph + you can add arbitrary lines of text anywhere you like onto the graph. + The text might have multiple lines and you can choose the paragraph + alignment.
+To add text you have to create one or more instances of the + Text() object and then add the text object to the graph with the + AddText() method.
+The position of these text boxes are given as fraction of the width + and height of the graph. When you are positioning these text boxes you + might also choose what part of the text box should be considered the + anchor point for the position you specify.
+By default the anchor point is the upper left corner of the bounding + box for the text.
+To show some ways of positioning the text we use a very simple bar + graph not to distract from the text. We first just add a single text + line with most of the settings their default value by adding the + following lines to the graph
+ $txt=new Text(
+"This is a text");
+
$txt->Pos(
+0,0);
+
$txt->SetColor(
+"red");
+
$graph->AddText(
+$txt);
+
The result is shown below.
+Not too exiting. Let's make it more interesting by having a + background color, using larger fonts and framing the text box and + adding a drop shadow to the text box by using the methods + SetBox() and SetBox()
+That's better. Now we get some attention. If you want to add a text + with several lines you just need to separate the lines with a newline + ('\n' character). The default paragraph alignment is left edge but you + can also use right and center alignment.
+As an illustration let's add a couple of more lines to the previous + text, center the text box in the middle of the graph and also use + centered paragraph alignment for the text. To adjust the paragraph + alignment of the text you have to use the + Text::ParagraphAlign()
+Of course there is no limit to the number of text string you can add + to the graph.
+From version 1.12 it is also possible to add text strings to a graph + using the scale coordinates instead. This is accomplished by using the Text::SetScalePos() Which + is completely analog to SetPos() with the only difference that the + positions given are interpretated as scale values instead of fractions + of the width and height.
+As a final easy modification we can enable the display of the data + value above each data point. The value is represented by the 'value' + property in the plot. (You can read more about the possibilities of the + display value + in the class reference.)
+To enable the display of the value you just need to call the Show() + method of the value as in
+ $lineplot->value->
+Show()
+
Adding that line to the previous line plot would give the result + shown below.
+We can of course change both color, font and format of the displayed + value. So for example if we wanted the display values to be dark red, + use a bold font and have a '$' in front we need to add the lines
$lineplot->value
+->SetColor("darkred");
+
$lineplot
+->value->SetFont(
+FF_FONT1,
+FS_BOLD);
+
$lineplot
+->value->SetFormat(
+"$ %0.1f");
+
This would then result in the following image
+What if we want to add a second plot to the graph we just produced? + Well, this is quite straightforward and just requires two simple step:
+To create the second plot we need some data (we could of course use + the same data as for the first plot but then we wouldn't be able to see + the new plot!)
+The following lines show how to create the new plot and add it to + the graph (we only show the new lines - not the full script)
$ydata2
+= array(1,19,
+15,7,22
+,14,5,
+9,21,13
+);
+
$lineplot2
+=new LinePlot($ydata2);
+
$lineplot2
+->SetColor("orange");
+
$lineplot2
+->SetWeight(2);
+
+
$graph->Add(
+$lineplot2);
+
Making these changes to the previous graph script would generate a + new graph as illustrated below.
+There is a few things worth noting here
+Each graph can have up to three different titles accessed by the + three properties
+All of these three properties is a standard text object which means + that you can have individual font, colors, margins and sizes of these + tree titles.
+The only thing you need to think of is that you probably want to add + some extra margin to make room for the titles (using + Graph::SetMargin() )
+The individual positioning of these titles are done automatically + and will adjust to the font size being used.
+If you for, esthetic reasons, would like increase the distance from + the top where the title is positioned (or the intra distance between + title and sub title) you can use the + Text::SetMargin() method. For example the line
+
+ $graph->title->SetMargin
+(20);
will set the distance between the top of the title string and the top + of the graph to 20 pixels. If you instead call the SetMargin() method + for the subtitle it will adjust the distance between the top of the + subtitle and the bottom of the title.
+The titles will be positioned at the top and be centered in the + graph. Each of these titles may have multiple lines each separated by a + "\n" (newline) character. By default the paragraph alignment for each + title is centered but may of course be changed (using the + ParagraphAlign()) method.
+Each graph can also have a footer. This footer is actually three + footers. Left, center and right. The 'left' footer is aligned to the + left, the 'center' at the bottom center and the right to the right.
+Each of these three positions is a standard Text object which means + you can change color, font and size as you please individually on each + of these footer positions.
+You access the footer through the Graph::footer property as the + following example shows
+
+ $graph->
+footer->left->Set
+("(C) 2002 KXY"
+);
+
$graph->footer->
+center->Set("CONFIDENTIAL"
+);
+
$graph->footer->
+center->
+SetColor("red");
+
$graph->footer->
+center->
+SetFont(
+FF_FONT2,
+FS_BOLD);
+
$graph->footer->
+right->Set("19 Aug 2002"
+);
As you saw in the preceding example you could add multiple plots to + the same graph and Y-axis. However what if the two plots you want to + display in the graph has very different ranges. One might for example + have Y-values like above but the other might have Y-values in the + 100:s. Even though it is perfectly possible to add them as above the + graph with the smallest values will have a very low dynamic range since + the scale must accomplish the bigger dynamic range of the second plot.
+The solution to this is to use a second Y-axis with a different + scale and add the second plot to this Y-axis instead. Let's take a look + at how that is accomplished.
+First we need to create a new data array with large values and + secondly we need to specify a scale for the Y2 axis. This is done by + the lines
+ $y2data = array(
+354,200,265
+,99,111,
+91,198,225
+,293,251);
+
$graph->SetY2Scale(
+"lin");
+
and finally we create a new line plot and add that to the second + Y-axis. Note that we here use a new method, AddY2(), since we want this + plot to be added to the second Y-axis. Note that JpGraph will only + support two different Y-axis. This is not considered a limitation since + using more than two scales in the same graph would make it very + difficult to interpret the meaning of the graph.
+To make the graph a little bit more esthetic pleasing we use + different colors for the different plots and let the two different + Y-axis get the same colors as the plots.
+The resulting graph is shown below. source)
+ +A variant of the titles is the tab title. This is just + another option you have of putting a name on the graph. The appearance + of this type is a tab on top of the plot area with text inside.
+You can access the tab using the 'tabtitle' property of the graph.
+The following figure shows an example of how this can look.
+As usual you have full freedom to specify font and colors for this + type of title. Please see the class reference regarding +GraphTabTitle() for more information.
+With more than one plot on the same graph it is necessary to somehow + indicate which plot is which. This is normally done by adding a legend + to the graph.
+You will see that each plot type has a 'SetLegend()' method which is + used to name that plot in the legend. SO to name the two plots in the + example we have been working with so far we need to add the lines
$lineplot->SetLegend
+("Plot 1");
+
$lineplot2
+->SetLegend("Plot 2");
+
to the previous code. The resulting graph is shown below
+As you can see the legend gets automatically sized depending on how + many plots there are that have legend texts to display. By default it + is placed with it's top right corner close to the upper right edge of + the image. Depending on the image you might want to adjust this or you + might want to add a larger margin which is big enough to accompany the + legend. Let's do both.
+First we increase the right margin and then we place the legend so + that it is roughly centered. We will also enlarge the overall image so + the plot area doesn't get too squeezed.
+To modify the legend you access the 'legend' property of the graph. + For a full reference on all the possibilities (changing colors, layout, + etc) see class legend in + the class reference
+For this we use the legends 'SetPos()' method as in
$graph
+->legend->Pos(
+0.05,0.5,"right"
+,"center");
Doing this small modification will give the result shown below
+The above method 'SetPos()' deserves some explanation since it might + not be obvious. You specify the position as a fraction of the overall + width and height of the entire image. This makes it possible for you to + resize the image within disturbing the relative position of the legend. + We will later see that the same method is just to place arbitrary text + in the image.
+To give added flexibility one must also specify to what edge of the + legend the position given should be relative to. In the example above + we have specified "right" edge on the legend for the for the horizontal + positioning and "center" for the vertical position.
+This means that the right edge of the legend should be position 5 % + of the image width from the right. If you had specified "left" the the + legends left edge would be positioned 5 % of the image width from the + image left side.
+By default the legends in the legend box gets stacked on top of each + other. The other possibility is to have them sideways. To adjust this + you use the SetLayout() + method. Using a horizontal layout with the previous example give the + following result.
+ +For more advanced fomatting of the legend it is possible to adjust
+In order to adjust the number of columns used in the legend the + method Legend::SetColumns is used. So for example to have the + legend lined up using three columns the follwing lines have to be added + to teh script
+ $graph->
+legend->
+SetColumns(3);
Instead of having a single color background you can easily have an + arbitrary image as the background. The image may be in either PNG, JPG + or GIF format depending on what your installation supports.
+ +A note on GD: If you are using GD 2.xx you must + make sure that the define USE_TRUECOLOR is set to true. This is also + the default. Failure to do so in combination with GD 2.xx will make the + background image just look like a solid black square.
+ +To use a specific image as the background you just have to use the + method + Graph::SetBackgroundImage() The arguments specify file-name, how + the image should be positioned in the graph and finally the format of + the image (if it is in JPG, PNG or GIF) format. If the format is + specified as "auto" (the default) then the appropriate image format + will be determined from the extension of the image file.
+The file name is of course obvious but the second argument might not + be. This arguments determine how the image should be copied onto the + graph image. You can specify three different variants here
+You might often find yourself wanting to use a background image as a + "waterstamp". This usually means taking the original image, import it + to some image editing program and then "bleaching" the color + saturation, reducing the contrast and so on. Finally you save the + modified image which you then use as a background image.
+This whole process can be automatically accomplished in JpGraph by + using the method + Graph::AdjBackgroundImage() which allow you to adjust color + saturation, brightness and contrast of the background image.
+
+ $graph->
+AdjBackgroundImage(...)
+
to achieve the "watercolor" effect to avoid the image being too + intrusive in the graph.
+JpGraph offers two ways of handling null values (or discontinuities) + in the data. You can either have a "whole" in the data or the line may + be extended between the previous and next data point in the graph.
+If the data value is null ("") or the special value "x" then the + data point will not be plotted and will leave a gap in the line.
+If the data value is "-" then the line will be drawn between the + previous and next point in the data ignoring the "-" point.
+The following example shows both these possibilities.
+ + +In addition to the background image you can also add a background + color gradient. This gradient can be covering the entire graph, just + the plot area or just the margins. This flexibility allows you to + combine a background image with a background color gradient. You can + for example use a background image in the plot area and a color + gradient out in the margins.
+You specify a color gradient background by calling the + Graph::SetBackgroundGradient() method. All details are available in + the class reference (follow the link above). We finally give a quick + example on what kind of effect you can achieve using this feature.
Finally we like to mention that in the "/utils/misc/" directory you + will find a small utility script called "mkgrad.php". Running this + script presents you with a UI that makes it a breeze to create a + gradient image on it's own.
+ The UI for the utility is so obvious that we won't discuss it
+ further, we just show it below. The UI for the mkgrad.php utility
In the example below this utility is used to get a more interesting + plot area.
+ + +An interesting enhancement when using Plotmarks is the possibility + to add a callback function to control the size and color of the + plotmarks.
+This callback function will get called with the current Y-value (for + the plotmark) as it's argument. As return value the callback function + must return an array containing three (possible null) values. The + values returned must be
+The exact meaning of the parameters will of course depend on the + type of plot marks being used.
+The callback must be a global function and is installed with a call + to + PlotMark::SetCallback()
+So for example to install a callback that changes the fill color for + all marks with a (Y) value higher than 90 you could add the lines
+
+ function
+MarkCallback(
+$aVal) {
+
if( $aVal
+> 90)
+
$fcolor
+="red"
+
else
+
$fcolor
+="";
+
return array(""
+,"",$fcolor);
+
}
+
...
+
$plot->mark->
+SetCallback(
+"MarkCallback");
+
...
As you can see in the above example we have left some of the return + values blank. Doing this will just ignore any change of these value and + use the global settings for the plotmarks.
+If you also let the (Y) value affect the size of the plot marks you + can get what is sometimes known as a "balloon plot". The example below + is basically a scatter plot that uses filled circles to mark the + points. A format callback is then used to change the color and size + depending on the Y-value for each plot.
+ + +Step style refers to an alternate way of rendering line plots by not + drawing a direct line between two adjacent points but rather draw two + segments. The first segment being a horizontal line to the next X-value + and then a vertical line from that point to the correct Y-value. This + is perhaps easier demonstrated by an example as seen below.
+You specify that you want the plot to be rendered with this style by + calling the method +SetStepStyle() on the lineplot.
+ +In section 10.2 you can read about + arbitrary rotation of the graphs. For most practical purposes rotation + of 90 degrees is most useful. This could for example be used to plot + horizontal bar graphs.
+The slight complication with general rotation is that the margins + also rotates, this means that if you rotate a graph 90 degrees the left + margin in the image was originally the bottom margin. In additional by + default the center of the rotation is the center of the plot area and + not the entire image (if all the margins are symmetrical then they will + of course coincide). This means that depending on your margin the + center of the rotation will move. You can read more about this and how + to manually set the center for rotation in the section about rotation, 10.2
+This is just a slight inconvenience which you have to take into + account when you need to set an explicit margin with a call to +Graph::SetMargin()
+However, in order to make a rotation of 90 degrees much easier you + can easily rotate a graph 90 degrees and set the correct margin with a + call to +Graph::Set90AndMargin() The parameter to this method lets you + specify the margins as you will see them in the image without having to + think of what becomes what after the rotation.
+So, the only thing you need to do is call this method and then the + graph will have been rotated 90 degrees.
+Using a logarithmic scale requires you to include the logarithmic + add on module in "jpgraph_log.php". So you must have the line
+include("jpgraph_log.php"
+);
on the top of your code. To Illustrate how to use a logarithmic scale + let's make the right Y scale in the previous example a logarithmic + scale. This is done by the line
+ $graph->SetY2Scale(
+"log");
+
This will then give the following result
+ +You can of course also use a logarithmic X-scale as well. The + following example shows this.
Even though we have so far only shown line graphs logarithmic scale + can also be used for bar, error, scatter plots as well. Even radar + plots supports the use of logarithmic plots. The following example + shows how to use a logarithmic scale for a bar graph.
+ + +Assuming we start with the traditional two axis graph, one X and one + Y axis. You may then change the position of each axis by calling + Axis::SetPos($aPosition) You have to remember that you need to + specify the position on the other axis. SO you need to specify the + world-coordinate for the position. By default the axis are each + positioned at the 0-point on the other axis, i.e. the axis will cross + at the 0,0 point in the graph.
+In addition to the standard positioning you may also use the two + special position markers "min" and "max". This will position the axis + at the minimum (or maximum) position of the other axis.
+For example, to make sure that the X-axis is always at the bottom of + the graph (at lowest possible Y-value) you would have to add the line
+
+ $graph->xaxis->SetPos
+("min");
To change the color and width of the axis you have to make use of + the Axis::SetColor() and + Axis::SetWeight() + methods.
+You might also want to add titles to the axis. This is done through + the Axis::SetTitle() + method. This is actually just a shortcut for accessing the title + property direct. Axis::title::Set() which also allow you to set the + alignment in one call.
+By default the position of the title is to the far right for the + X-axis and in the middle (and 90 degrees rotated) for the Y-axis.
+You can adjust the position of the title with the help of the second + argument to the + Axis::SetTitle() method.
+The possible positions are "high","middle" and "low" which refers to + the scale values on the axis.
+One common modification you might want to do to the title is to + increase the margin between the axis and the actual title. This is + often necessary to do for the Y-axis if the values displayed are large. + You may adjust the distance (in pixels) between the axis and the title + by using the method + Axis::SetTitleMargin()
+So for example to increase the margin on the Y-axis you might add + the line
+
+ $graph->yaxis->SetTitleMargin(40
+);
to your code.
+Finally we mention something about the positioning of tick marks and + labels on the axis. You have the possibility to choose what side of the + axis the tick marks and the labels should be at. For the X-axis this + can be specified as either on the the top (inside the plot area) or at + bottom (outside of the plotarea). In the same way you can specify for + the Y-axis if the labels ( or ticks) should be on the left or right + side.
+To adjust the label positioning you have to use the method + Axis::SetTitleSide() and to adjust the position of the tick mark + you have to use the method + SetTickSide()
For example, the following lines added to a script would change side + of the labels and tickmarks for the X-axis.
+
+ $graph->xaxis->SetLabelPos
+(SIDE_UP);
+
$graph->xaxis->
+SetTickSide(
+SIDE_DOWN);
+
This technique is for example used if you position the X-axis at the + top of the graph as the following example shows.
In scientific style plots it is often common to duplicate each axis + so that all sides of the graph have a labeled axis. This is of course + also fully supported by JpGraph.
+Before we continue we show a small example to illustrate this + feature
+ + +The example above shows the basic configuration. There are now + several modifications you may do to these axis like
+The style of axis is determined by the method + Graph::SetAxisStyle() The available type of axis are
+How to adjust the actual labels are discussed elsewhere in this + manual (see ???,???). However we like to mention here that you can + adjust the label margin (distance between the axis and the labels) with + the method + Axis::SetLabelMargin()
+to adjust the actual label format (like font, color, angle) you need + to access the Axis::SetFont() + and the Axis::SetColor() + methods. If you investigate the + Axis class you will discover more methods to adjust the many + aspects of the axis layout.
+As a final note we also mention the methods + Axis::SetLabelAlign() and + Axis::SetLabelAngle() This first method is really only mentioned + here for completeness since it is mostly used for internal purposes. + However on some occasion you might want to adjust the alignment of the + labels. By default they are centered in respect to the tick mark. By + using the method you might override this positioning should you choose + to do so.
+The second of these methods adjusts the angle of the label in + regards to the axis. This is very useful for X-axis that have long + labels.
+In order to have full control over the way that the labels are + displayed it is possible to define a callback function that will be + applied to all labels. The callback function will be called with the + label as the only argument and should return the value that will be + displayed in the graph. This could for example be used to turn seconds + (used to position data points) into hour and minutes on the scale. For + further reference see the two methods: + Graph::SetLabelFormatCallback(); and + Graph::SetLabelFormat();
+One good way of illustrate the usefulness of label callbacks in a + slightly different context is to show how we can achieve the effect of + an inverted Y-scale.
+An inverted Y-scale has the lowest number at the top and the scale + values increases downwards.
+Even though JpGraph doesn't directly support this feature it is + quite easy to achieve with just a few extra lines of code in your image + script.
+Before we continue we give an example of what we are referring to.
+ + +Two achieve this effect there are two simple steps to take:
+And that's it! We refer you to the code in the example above for the + details.
+To get the exact type of axis you want in your graph there are a + number of adjustments available for you. You may change, color, size, + position and general appearance.
+ +As you saw in the previous example it is possible to use different + types of scales. In JpGraph you can use the following scales
+Any combination of these may be used. Linear and logarithmic scales + are pretty straightforward. The text scale might deserve some + explanation. The easiest way to think of the text scale is as a linear + scale consisting of only natural numbers, i.e. 0,1,2,3,4,... . This + scale is used when you just have a number of Y-values you want to plot + in a consecutive order and don't care about the X-values. For the above + example it will also work fine to use a linear X-scale (try it!). + However, the scale is now treated as consisting or real numbers so the + auto scaling, depending on the size of the image an the number of data + points, might decide to display other labels then the natural numbers., + i.e. a label might be 2.5 say. This is not going to happen if you use a + text scale.
+The normal practice for text scale is to specify text strings as + labels instead as the default natural numbers. You can specify text + strings for the labels by calling the + SetTickLabels() method on the Axis.
+To specify the scale you use the + SetScale() method. A few examples might help clarify this.
+As you can see all your graphs will require at least one call to + SetScale() in the beginning of your script. Normally it will come right + after the creation of the Graph().
+To specify the scale for the Y2 axis you use the + SetY2Scale() Since you only specify one axis you only specify + "half" of the string in the previous examples. So to set a logarithmic + Y2 scale you will call
+ $graph->SetY2Scale(
+"log");
+
The first example draws a line graph consisting of 10 Y-values. In + this first example we show the full code. In the following examples we + will only show interesting piece of the code.
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_line.php");
+
+
// Some data
+
$ydata
+= array(11,3,
+8,12,5
+,1,9,
+13,5,7
+);
+
+
+// Create the graph. These two calls are always required
+
$graph
+= new Graph(350,
+250,"auto");
+
$graph->SetScale(
+"textlin");
+
+
// Create the linear plot
+
$lineplot
+=new LinePlot($ydata);
+
$lineplot
+->SetColor("blue");
+
+
// Add the plot to the graph
+
$graph->Add(
+$lineplot);
+
+
// Display the graph
+
$graph->Stroke();
+
?>
+
You might note a few things
+This is a perfect fine graph but looks a little bit "sparse". To + make it more interesting we might want to add a few things like
+From looking at the previous example you can see that you access all + properties of JpGraph through the objects you create. Graph(), + LinePlot() and so on. In general all objects you can see in the graph + is accessed through a named instance.
+For example the title of the graph is accessed through the + 'Graph::title' property. So to specify a title string you make a call + to the 'Set()' method on the title property as in:
+
+ $graph->title->Set
+('Example 2');
So by adding just a few more lines to the previous code we get a + graph as shown below.
To achieve this we just needed to add a few more lines. (We only show + the part of example 1 we changed, to look at the full source just click + the [src] link in the caption. )
+
+// Setup margin and titles
+
$graph->img->
+SetMargin(40,20
+,20,40);
+
$graph->title->
+Set(
+"Example 2");
+
$graph->xaxis->
+title->Set("X-title"
+);
+
$graph->yaxis->
+title->Set("Y-title"
+);
+
Again there are a couple of things you should note here
+A nice change would now be to have all the titles in a bold font and + the line plot a little bit thicker and in blue color. Let's do that by + adding the lines
$graph->
+title->SetFont(FF_FONT1
+,FS_BOLD);
+
$graph->yaxis->
+title->SetFont(FF_FONT1
+,FS_BOLD);
+
$graph->xaxis->
+title->SetFont(FF_FONT1
+,FS_BOLD);
+
$lineplot
+->SetColor("blue");
+
$lineplot
+->SetWeight(2);
+// Two pixel wide
Again please note the consistent interface. To change font you just + have to invoke the SetFont() method on the appropriate object. This + principle is true for most methods you will learn. The methods may be + applied to a variety of objects in JpGraph. So for example it might not + come as a big surprise that to have the Y-axis in red you have to say:
+ $graph->yaxis->SetColor
+("red")
or perhaps we also want to make the Y-axis a bit wider by
$graph
+->yaxis->SetWidth(
+2)
+
As a final touch let's add a frame and a drop shadow around the + image since this is by default turned off. This is done with
$graph
+->SetShadow()
The result of all these modifications are shown below.
The standard structure for an HTML page using client side image maps + would be something along the lines of
+ ++// Image map specification with name "mapname" +<MAP NAME=...> +... specification ... +</MAP> + +// Image tag +<img src="..." ISMAP USEMAP="mapname"> ++
This poses an interesting question.
+Since we normally call the graphing script directly in the <img> tag + how do we get hold of the image map (which is available only in the + image script) in this "HTML wrapper" script?
+In JpGraph there is actually two ways of solving this.
+The first (and preferred) way modifies the stroke method so that + instead of returning an image (like the standard Stroke() method) + StrokeCSIM() actually returns an HTML page containing both the image + map specification and the correct <IMG> tag.
+This of course means that it is necessary to treat an image map + returning image script differently from a non-CSIM image script, for + example you can't use it directly as the target for the "src" attribute + of the <IMG> tag since it sends back an actual HTML page containing + both an image tag together with an image map.
+By default the auto-scaling algorithm tries to make best possible + use of screen estate by making the scale as large as possible, i.e. the + extreme values (min/max) will be on the top and bottom of the scale if + they happen to fall on a scale-tick. So for example doing a simple line + plot could look like the plot shown in the below.
+However you might sometime want to add some extra to the minimum and + maximum values so that there is some "air" in the graph between the end + of the scale values and the extreme points in the graphs. This can be + done by adding a "grace" percentage to the scale. So for example adding + 10% to the y-scale in the image above is done by calling the + SetGrace() method on the yscale as in
+
+ $graph->yaxis->scale
+->SetGrace(10,
+10);
+
These lines add a minimum of 10% to the top and bottom values of the + scale. Note that we say "minimum" since depending on the specific tick + values choose this might be a little bit more to make the end of the + scale fall on an even tick mark.
+Adding this line to the previous graph will result in the following + example
+ +Since we haven't adjusted the position of the X-axis it will remain + at Y=0 which might not necessary be what we would like so we therefor + also add the line
+
+ $graph->xaxis->SetPos
+("min");
So that the X-axis always will remain at the lowest possible + Y-value. Doing this will then result in the example below
+ + +Semi filled bar graphs are in principle the same as normal filled + bar graphs but with the additional feature that you can choose to only + fill a specified range (or ranges) of X-coordinates. The figure below + illustrates this
+ + +In this example we defined two areas along the X-axis to be filled. + You can add filled areas by using the method + AddArea() and specifying range and color for the filled area.
+All patterns can be customized by
+
+
+ $band
+->prect->SetHorizon(
+$aHorizon)
+
assuming that the band is a 3D plane.
+To finish this section we give one final, more creative, example on + how to use the bands.
+ +As an additional way of emphasizing certain areas of the graph it is + possible to add bands (either vertical or horizontal) to any one of the + standard X-Y coordinate system based graphs. A band is a rectangular + area that stretches one entire axis. This means that if you define a + band between X-coordinates 3 and 5 the band area will occupy an area + between the X-coordinates and the entire Y-range.
+In order to access this functionality you must first make sure that + you include the additional library file jpgraph_plotband.php
+At the time of this writing (current as of JpGraph 1.8) the table + below illustrates the 8 basic types of patterns available. We will + shortly show you how you can customize these patterns, To keep these + examples clear we have only used one pattern in each figure.
+ ++ + | + + |
+ + | + + |
+ + | + + |
+ + | + + |
To add a one of these patterns to your graph you need to call the + method + PlotBand::PlotBand() The arguments is fairly easy to understand. + The pattern you would like to use is specified by using the correct + constant. You can see the name of the correct constants in the figures + above. You also need to specify if the band should stretch along the + vertical or horizontal axis as well as the min and max coordinates for + the band. As coordinates you may also use the special values "min" and + "max" which automatically sets the value to the minimum/maximum value + of the scale. The specified numeric value will be automatically + truncated to fit within the plot area.
+We don't discuss the other arguments further here, instead we refer + you to the class reference.
+JpGraph allows you to easy customize the appearance of the bar + graph, for example to change the width of each bar. The width of each + bar can be specified either as a fraction of the width between each + major tick or as an absolute width (in pixels).
+To set the width in fraction you use the method + SetWidth() and to set the width in pixels you use the + SetAbsWidth()
+As an example let's take the previous example and set the width to + 100% of the distance between the ticks. The example will now become
+ + +In addition to the bands you can also add static lines to the graph. + An example of that is actually shown in figure 11 above. You create a + line as an instance of + class PlotLine . So for example the lines
+ $sline
+= new PlotLine
+(HORIZONTAL,0,
+"black",2);
+
$graph->Add(
+$sline);
+
will add a 2-pixel wide horizontal static line at Y-position zero.
+You can easily choose to display the value (and it's format) on top + of each bar by accessing the bar's 'value' property. So for example by + just adding the line
+ $barplot->value->
+Show();
+
Will enable the values in it's simplest form and will give the + result
+You cane see a small nuisance in this graph. The auto scaling + algorithm chooses quite tight limits for the scale so that the bars + just fit. Adding the value on top of the bar makes it collide with the + top of the graph. To remedy this we tell the auto scaling algorithm to + allow for more "grace" space at the top of the scale by using the + method + SetGrace() which is used to tell the scale to add a percentage (of + the total scale span) more space to either one end or both ends of the + scale. In this case we add 20% more space at the top to make more room + for the values with the line
+ $graph->yaxis->
+scale->
+SetGrace(20);
This will then give the graph as shown below
+ +You can also adjust the general position of the value in respect to + the bar by using the + BarPlot::SetValuePos() method. You can set the position to either + 'top' (the default) , 'center' or 'bottom'. The graph below shows the + value being positioned in the center. In this example we have also + adjusted the format to just display the value as an integer without any + decimals.
+It is also possible to specify a more fine grained control on how + you want the values presented. You can for example, rotate them, change + font, change color. It is also possible to adjust the actual value + displayed by either using a printf()-type format string or with the + more advanced technique of a format callback routine.
+To show what you can do we just give another example for you to + examine without much further explanations. Just remember that to have + text at an angle other than 0 or 90 degrees we have to use TTF fonts. + Even though we haven't explained the SetFont() method it should be + fairly obvious.
+ +One simple way of making the bar graph more attracting is to add a + drop shadow to each bar. This is done by calling the + SetShadow() method. An example will clarify this.
+ +As you have seen from the previous examples bar graphs are normally + centered between the trick marks on a text scale. However, you can + modify this behavior by calling the method + BarPlot::SetAlign()
+These types of bar graph is used to easy group two or more bars + together around each tick (X-value). The bars will be placed + immediately beside each other and as a group centered on each tick + mark. A grouped bar is created by aggregating two or more ordinary bar + graphs and creating a + GroupBarPlot() From two ordinary bar graphs along the lines of
+// Create the bar plots
+
$b1plot
+= new BarPlot($data1y);
+
$b1plot->SetFillColor(
+"orange");
+
+
$b2plot
+= new BarPlot($data2y);
+
$b2plot->SetFillColor(
+"blue");
+
+
// Create the grouped bar plot
+
$gbplot
+= new GroupBarPlot
+(array($b1plot
+,$b2plot));
+
+
// ...and add it to the graPH
+
$graph->Add(
+$gbplot);
+
The following example illustrates this type of graph
+There is no limit on the number of plots you may group together.
+If you use the SetWidth() method on the GroupBarPlot() this will + affect the total width used by all the added plots. Each individual bar + width will be the same for all added bars. The default width for + grouped bar is 70%.
+Setting the grouped with to 0.9 would result in the image below.
+ +The final variety of group bars you can have are accumulated bars. + They work in much the same way as accumulated line plots described + above. Each plot is stacked on top of each other.
+You create accumulated bar plots in the same way as grouped bar + plots by first creating a number of ordinary bar plots that are then + aggregated with a call to + AccBarPlot();
+An example makes this clear. Let's use the same data as in the two + examples above but instead of grouping the bars we accumulate (or + stack) them. The code would be very similar (actually only one line has + to change)
+ +It is perfectly possible to combine the previous bar types to have + grouped accumulated bar plots. This is done by just adding the + different accumulated plots to a group bar plot, for example the + following code would do that.
+
+// Create all the 4 bar plots
+
$b1plot
+= new BarPlot($data1y);
+
$b1plot->SetFillColor(
+"orange");
+
$b2plot
+= new BarPlot($data2y);
+
$b2plot->SetFillColor(
+"blue");
+
$b3plot
+= new BarPlot($data3y);
+
$b3plot->SetFillColor(
+"green");
+
$b4plot
+= new BarPlot($data4y);
+
$b4plot->SetFillColor(
+"brown");
+
+
// Create the accumulated bar plots
+
$ab1plot
+= new AccBarPlot
+(array($b1plot
+,$b2plot));
+
$ab2plot
+= new AccBarPlot
+(array($b3plot
+,$b4plot));
+
+
// Create the grouped bar plot
+
$gbplot
+= new GroupBarPlot
+(array($ab1plot
+,$ab2plot));
+
+
// ...and add it to the graph
+
$graph->Add(
+$gbplot);
+
Putting this together in an example would then produce the graph as + shown below
+ +It can often come in handy to have horizontal bar graphs especially + if you have a large number of values to display. Even though JpGraph + doesn't directly support horizontal bar graphs this is easy achieved by + constructing a normal vertical bar graph which is then rotated 90 + degrees.
+The example below shows a simple example of this
+ +In order to achieve this effect you should study the above example + carefully and you might notice two things
+We finally show three more examples of horizontal bar plots. In the + first plot we have hidden the Y-axis and in the second we have + positioned the Y - axis at top as opposed to the bottom as the first + example shows.
+ + + +In the final example which is almost similar to the two first we + illustrate the use of labels with more than one line.
It is possible to use color gradient fill for the individual bars in + the bar graph.
+Color gradient fill fills a rectangle with a smooth transition + between two colors. In what direction the transition goes (from left to + right, down and up, from the middle and out etc) is determined by the + style of the gradient fill. JpGraph currently supports 8 different + styles. All supported styles are displayed in the figure below.
+ + + + + + + + +To specify a gradient fill for the bar plots you make use of the + method + BarPlot::SetFillGradient() . See the class reference for details of + this function.
+When using gradient fills there are a couple of caveats you should + be aware of:
+Jpgraph also supports 2D vertical bar plots. Before you can use any + bar plots you must make sure that you included the file + "jpgraph_bar.php" in your script.
+Using bar plots is quite straightforward and works in much the same + way as line plots which you are already familiar with from the previous + examples. Assuming you have a data array consisting of the values + [12,8,19,3,10,5] and you want to display them as a bar plot. This is + the simplest way to do this:
+ $datay=array(12,
+8,19,3
+,10,5);
+
$bplot
+= new BarPlot($datay);
+
$graph->Add(
+$bplot);
+
If you compare this to the previous line examples you can see that + the only change necessary was that instead of creating a new line plot + (via the new LinePlot(...) call) we used the statement new + BarPplot().
+The other change we should do is to make sure the X-axis have an + text-scale (it is perfectly fine to use a linear X-scale but in most + cases this is not the effect you want when you use a bar graph, see + more below). With this two simple change we will now get a bar graph as + displayed in the following image
+You can of course modify the appearance of the bar graph. So for + example to change the fill color you would use the + BarPlot::SetFillColor() method. Making this small change to the + previous example would give the expected effect as can be seen in the + next example.
+To turn a standard image script into a CSIM script the first thing + needed to do is to supply the appropriate URL targets for the hotspots + in the image.
+What the hotspots represent depends on the type of plot you are + doing. The following plot types and graph areas support image maps.
+To specify a link for each hotspot you have to use the + SetCSIMTargets() method for each plot (or specific area) in the + graph which should be a hotspot.
+There are two arguments to this method
+A line error plot is an error plot with the addition that a line is + drawn between the average value of each error pair. You use this type + of plot the exact same way you would use an error plot. The only change + is that you must instantiated an + ErrorLinePlot() instead and make sure you have included the + "jpgraph_line.php" since the line error plot makes use of the line plot + class to stroke the line.
+To control the various properties of the line drawn the "line" + property of the error line plot may be accessed. So, for example, if + you want the line to be 2 pixels wide and blue you would have to add + the following two lines
+ $elplot->line->
+SetWeight(2);
+
$elplot->line->
+SetColor(
+"blue");
+
to generate the graph as shown below
+You may of course add legends to none, one or both of the line types + in the above graph. So for example if we wanted the legend "Min/Max" + for the red error bars and a legend "Average" for the blue line you + would have to add the lines
+ $errplot->SetLegend(
+"Min/Max");
+
$errplot->line->
+SetLegend(
+"Average");
+
The resulting graph will now look like (note that we are using the + default placement of the legend box)
+ +Error plots are used to visually indicate uncertainty in data + points. This is done by for each X value by giving both a minimum and a + maximum Y-value.
+Before you can use error plots you must remember to include the file + "jpgraph_error.php" in your script.
+The following example illustrates a simple error bar. We will have 5 + points, so we need 10 Y-values. We also would like the error bars to be + red and 2 pixels wide. All this is accomplished by creating an + ErrorPlot() in much the same way as, for example, a normal line + plot. Doing this would now give the example shown below.
+ +You might notice that there is one displeasing esthetic quality of + this graph. The X-scale is just wide enough to just accompany the + number of error bars and hence the first bar is drawn on the Y-axis and + the and last bar just at the edge of the plot area. To adjust this you + might call the SetCenter() + method which will adjust the X-scale so it does not use the full width + of the X-axis.
+The following example illustrates the use of this feature by + applying this technique to the previous example
+ +The simplest way of creating a creating a CSIM image is with the + StrokeCSIM() method. As mentioned before this method actually returns a + (small) HTML page containing both the image-tag as well as the image + map specification. Hence it is not possible to use a script that + ends with this method in a standard image-tags src property.
+There are two ways to create CSIM (or get hold of) the image maps
+
+
+<a href="mycsimscript.html">
+
+
This has the drawback that the image page will only contain the
+ image and nothing else.
+
+<h2> This is an CSIM image </h2>
+
+<?php
+include "mycsimscript.php"
+?>
+
+
The process to replace Stroke() with StrokeCSIM() is strait forward. + Replace all existing calls to Stroke() with the equivalent calls to + StrokeCSIM().
+ The only difference is that it is necessary ti supply a minimum of
+ one file name in the StrokeCSIM() method. The first argument must be
+ the name of the actual image script file including the extension. So
+ for example if the image script is called "mycsimscript.php" it is
+ necessary to write
+
+ $graph->
+StrokeCSIM(
+'mycsimscript.php')
+
+
However, it is possible to apply a small "trick" here. PHP maintain
+ a special variable called "__FILE__" which is always set to the current
+ file name. This means you could use the following construction:
+ $graph->
+StrokeCSIM(
+basename(
+__FILE__))
+
This is a better way since the script can now be renamed without + having to change any code in the file which otherwise would be needed.
The other arguments to StrokeCSIM() are optional. Please note that + if several CSIM images are used in the same HTML page it is also + necessary to specify the image map name as the second parameter since + all image maps must be unique to properly match each image map against + each image. Please consult the class reference + StrokeCSIM() for more details.
+In the Example/ directory there are a number of examples of how to + setup the various types of image maps. The following examples are + currently available
+In order to easily access all of these examples it is possible to + call the testsuit.php example with an additional argument "t=2". + By following the link +testsuit.php?t=2 a separate window will open with all the possible + CSIM examples.
+Scatter plots are very simple; they plot a number of points + specified by their X- and Y-coordinate. Each point is stroked on the + image with a mark as with line plots. The stroked marks can also be + connected with an optional line.
Even though you would normally supply X-coordinates it is still + perfectly possible to use a text-scale for X-coordinates to just + enumerate the points. This is especially useful when using the + "Impulse" type of scatter plot as is shown below.
+Scatter pots are created by including the jpgraph extension + "jpgraph_scatter.php" and then creating an instance of plot type of + ScatterPlot(). To specify the mark you want to use you access the mark + with the instance variable "mark" in the scatter plot. The default is + to use an unfilled small circle.
+To create a scatter plot you will create an instance
+A simple example using just default values will illustrate this
+ +We can easily adjust the size and colors for the markers to get + another effect as shown below
+Another possible variant of scatter plot is impulse-scatter plots. + This is a variant of normal scatter plot where each mark have a line + from the mark to the Y=0 base line. To change a scatter plot into an + impulse scatter plot you have to call the method + SetImpuls() on the scatter plot.
+This type of plots are often used to illustrate signals in + conjunction with digital signal processing. The following two examples + illustrates simple use of impulse plots.
+The next example shows how to modify the color and width of the + impulse plot
+As a final touch we show two more advanced impulse graphs . In these + graphs we have used more advanced formatting for the Y-axis labels as + well as adjusted the position of the axis position.
A variant of scatter plot is the so called Field Plots this + is basically a scatter plot where each scatter point is an arrow with a + direction between 0 to 359 degrees. This effectively allows the + visualization of 3 parameters at each point (x,y,angle). As an + additional bonus there is also possible to define a callback for each + scatter plot to also define the color for each point.
+To create a field plot you create an instance of +FieldPlot in the same way as you created a normal scatter plot. The + arguments to this method are Y-coordinate, X-coordinate and angle. To + specify a callback you use +FieldPlot::SetCallback()
+The following example (and code) illustrates the usage of the field + plot type.
+ +In addition to the parameters mentioned above you can also adjust + both the general size of the arrow and also the specific size of the + arrowhead. The arrow size is specified in pixels and the arrow head is + specified as an integers between 0 and 10. These sizes are specified + with a call to +FieldPlot::arrow::SetSize()
+Knowledge of the exact technical details of the way StrokeCSIM() + works is probably not needed by many people but for completeness we + outline those details in this short section.
+The fundamental issue we have to solve is that we must be able to + call the image script in two modes. When the user includes the image + script the StrokeCSIM() method should return the HTML page but when the + image script is later called directly in the image tag it must not + return an HTML page but rather the actual image.
+The way this is solved is by using one HTTP argument which is passed + on automatically when we use the image script name in the image-tag.
+If you look at the generated HTML you will see that the argument to + the src-property of the image tag is not simply the script name but the + script name with a additional argument.
+In the JpGraph internal code this pre-defined argument is checked + for and if it exists the image is send back and not the HTML page.
+The name of this argument is defined by a DEFINE() statement in + JpGraph. The define is _CSIM_DISPLAY.
+Stock charts is used to display data values where one is interested + in 4 different values for each data point. This could for example be + used to display a stocks open,close, min and max value during a + specific day. Hence the name Stock chart (or Stock plot).
+The figure below illustrates a sample Stock chart plot
+For this type of plot the Y-data array must be consist of a number + of quadruples of data where each quadruple consists of + (open,close,min,max). The open and close values determine the min max + for the middle bar and the min,max determine the end points of the + "error-lines" at the top and bottom of of each bar.
+Note that the data follows the following rules
+To separate the two cases where "open > close" or "open < close " + different colors are used. These colors are specified with the +SetColor() method. By default a positive bar (close > open) have a + fill color of white and for the negative case where (close < open) the + bars have a red color.
+You can specify the width of the bar by setting the width (in + pixels) with a call to the method +SetWidth()
+The final variation of stock plots you can have is to determine + whether or not the end point for the min,max lines should have the + horizontal line marking the end of the line or not. This can be + adjusted with a call to method +HideEndLine().
+A minor variation of stock charts is the "BoxPlot()" this is almost + the same as StockPlot() but with the very small difference that in + addition to the open,close,min, max values you also specify a median + value . The median lies between the open and close value and is + illustrated as a horizontal line within the bar.
+You may modify the median line color for positive and negative data + points / bars by using the +SetMedianColor() method.
+In the same way as for other plots you may associate an image map + with these plots. The "hot" area for each plot is the mid "bar" + section. In the same way as other plot types you use the + SetCSIMTargets() to set the URLs you want to use.
+These plot types, though normally used without explicit X-values, + can of course handle a supplied X-coordinate array without any problem.
+JpGraph offers two variation on what is usually known as stock + charts, candle-charts or box plot.
+In the case where you want to store the image on disk and later use + it in an img-tag you need to get hold of the image map. For this you + will have to use the function + Graph::GetHTMLImageMap()
+An example of the use of this is shown below. With these lines the + image will be written to a file. The script then returns a HTML page + which contains the Client side image map and an img-tag which will + retrieve the previously stored file.
+ $graph->Stroke(
+"/usr/local/httpd/htdocs/img/image001.png"
+);
+
echo $graph
+->GetHTMLImageMap
+("myimagemap001"
+);
+
echo
+"<img src=\"img/image001.png\" ISMAP USEMAP=\"#myimagemap001\" border=0>"
+;
+
It is perfectly legal to add several different plot types to the + same graph. It is therefore possible to mix line plots with (for + example) filled bar graphs. What you should keep in mind doing this is + the order in which these plots are stroked to the image since a later + stroke will overwrite a previous one. All plots are stroked in the + order you add them, i.e. the first plot added will be stroked first. + You can therefore control which plot is placed in the background and + which one is placed in the foreground by the order you add them to the + plot.
+To start simple we just mix a filled line plot with a non-filled + line plot as the following example shows.
+ + +Let's now go to something a little bit more complicated. How to mix + bar and line graphs. Let's just take one of our previous bar graphs and + add a line plot to it and see what happens.
+ +Not too bad. But we can't see the line so we change the order in + which we add the lines to the graph and sees what happens.
+ +If you want the line points to be aligned in the center of the bars + you can accomplish this is two ways.
+If you use a text scale then you need to call the + LinePlot::SetBarCenter()
You can also use an integer scale. This places both + the bar and the line points centered at the tick marks. As the + following example will show
+ +As a final example we show how you can combine a scatter plot and a + line plot which could be used to illustrate a regression line fitting.
+ +For version 1.9 the cache system has been extended to include even + the CSIM maps. For each CSIM graph two files are stored in the cache, + the image file itself as well as the wrapper HTML with the actual image + map. For further information see the chapter on "Understanding the + Cache system"
+Normally the automatic scaling should be doing an adequate job in + most circumstances but there might be cases where you like to manually + set the scale. For example if you have several graphs where you like to + be able to easily compare them and therefore want them all to have the + same scale.
+To specify a manual scale you have to add arguments to the standard Graph::SetScale() method. + So to specify that you want an Y-scale between 0 and 100 you need to + write
+ $graph->
+SetScale(
+"textlin",0,100
+);
When you specify a scale manually there is one additional thing you + need to decide. How the tick marks should be positioned. You have three + choices
+
+ $graph->SetScale(
+"textlin",0,100
+);
+
$graph->yscale->
+ticks->Set(10
+,5);
Will set the major tick marks every at 0,10,20,.. And every minor + tick mark in between (0,5,10,15,20,25,...).
+The three images below illustrates the difference between the + possibilities of ticks for a manual scale.
+ + + + + +You can adjust the automatic tick marks by telling JpGraph how dense + you want them to be. You use the + Graph::SetTickDensity() method. You can set the density setting in + four steps
+Taking the previous example with the manual scale but automatic + ticks and using a denser ticks setting gives the following result
+ +Image maps, or client side image (CSIM) as they are known is fully + supported in JpGraph. It gives you the opportunity to create hot-spots + in the graphs which allows you to build a set of "drill-down" graphs.
+In the following section is based on the assumption that the reader + is familiar with the basic concepts of client side image map in HTML.
+To shortly recapitulate. Client side image maps consists of two + parts. The first part is the actual image and the second part is a + mapping that gives the coordinates for areas in the image which should + be marked as hot spots (i.e. click-able by the user). The library can + automatically generate these coordinate maps from a given graph.
+Through out the manual areas of the graph that may be used as a + hotspot is given in conjuction with the general description of that + area.
+The purpose of this chapter is to introduce the basic concepts of + creating scripts with JpGraph that will generate various types of basic + plots. Throughout the text it is possible to view the exact source for + all the graphs by clicking on the "[src]" link in the caption of the + image shown. This will open the image together with the source in a + separate window. This way it is easy to compare the actual image with + the script that generated the image.
+The easiest way to get a date time scale for the X-axis is to use + the pre-defined "dat" scale. To be able to use that it is first + necessary to include the module "jpgraph_date.php" and the + specify the scale, for example as "datlin" in the call to SetScale() + as the following code snippet shows.
+ require_once("../jpgraph.php");
+
require_once("../jpgraph_line.php");
+
require_once("../jpgraph_date.php");
+
...
+
$graph
+= new Graph(540,
+300);
+
$graph->SetScale(
+'datlin');
+
...
The above code snippet would create a date/linear scale for the + graph. We will first show a basic use of the date scale and then go on + to illustrate how it is possible to tailor the exact formatting of the + date axis.
+When using the fully automatic formatting the library will use the + shortest possible string that uniquely identifieas a date/time. For + example if the entire intervall falls within the same day only the time + values will be displayed, if the intervall falls over several days then + also the date will be added to the label.
+As usual it is also possible to manually force a certain label + formatting to be used this is illustrated below.
+The first basic example below creates a data set that emulates a + sample rate every S second and falls over a total period of two days. + It is important to note that the input data on the X-axis must be a in + the form of timestamp data, i.e. the number of seconds from the system + epoch. In PHP the current timestamp value is returned by the function + time().
+This means that it is always mandatory to specify two input vectors + for a plot. For example to specify a line plot
+ $line
+= new LinePlot
+($data,$xdata);
+
The example below show this in practice
+Please review the script (by following the [src] link) that creates + this graph before continuing since we will base all further examples on + the above example.
+As can be seen from the above example the scale starts slightly + before the first data point. Why? This is of course by purpose in order + to make the first time label to start on an "even" value, in this case + on an hour. Depending on the entire interval of the graph the start + value will always be chosen to be the largest "even" time value, this + could for example be on an even minute, even 30min, even hour, even + day, even week and so on.
+The alignment of the start (and end) vdate alignment can also be + adjusted manually by using the two methods
+These method allow the alignment to be made by specifying one of the + following constants.
+For the SetTimeAlign() the following symbolic constants can be used
+For the SetDateAlign() the following symbolic constants can + be used
+Some examples will calrify the use of these methods.
+Example 1. We want the time adjustment to start on an even + quarter of an hour, i.e. an even 15 minute period.
$graph
+->xaxis->scale->
+SetTimeAlign(
+MINADJ_15);
+
Example 2. We want the time to start on an even 2 hour
$graph
+->xaxis->scale->
+SetTimeAlign(
+HOURADJ_2);
+
Example 3. We want the start to be on an even day
$graph
+->xaxis->scale->
+SetDateAlign(
+DAYADJ_1);
+
The default label format always tries to use the shortest possible + unique string. To manually set a manual scale the method + SetDateFormat() is used for example as in
+ $graph
+->xaxis->scale->
+SetDateFormat(
+'H:i');
+
The above example will force the labels to be displayed as hour (24h) + and minutes.
As with the linear scale it is possible to indicate what density of + scale ticks is needed. This is specified as usual with a call to + Graph::SetTickDensity()
+ $graph->SetTickDensity(
+TICKD_DENSE);
+
In the following we will assume that all data points are specified + by a tuple where the date/time is specified as a timestamp in second in + the same format as is returned by the PHP function time().
+The trick here is to use a label formatting callback routine which + gets called to format each label on the scale.
+What we do is that we specify that the X-scale should be an ordinary + "int" scale (remember that the data values are timestamps which are + integers). We then install our custom label callback (with a call to + SetLabelFormatCallback()) which given a timestamp formats it to a + suitable human readable form. In our example we will use the PHP + function Date() for this purpose.
+The callback we use will be
+
+// The callback that converts timestamp to minutes and seconds
+
function
+TimeCallback(
+$aVal) {
+
return Date
+('H:i:s',$aVal);
+
}
Using some random data we can now generate the following graph
In the above example we have specified the X-scale manually to make + sure that the min/max values on the X-axis exactly matches the min/max + x-data values.
+SetLabelFormatCallback() will be called for each of the displayed + labels and the argument passed on to the supplied function is the + default label that the library is assigning that specific label.
+This means that if the data to be displayed is based on, for + example, timestamps which are given in seconds the displayed value + might not be aligned to how time/date values normally should be + displayed.
+Using integer scales this will not work very well since the library + determines label positions to be at even positions (e.g. every 2,5,10, + 20,50,100 etc) to suit the auto-scaling since the library will assume + that the data is integers and not timestamp values.
+The best way to solve this is to use an integer X-scale together + with a a callback function with a manually specified scale. In order to + setup the scale a bit of manually work is needed. Depending on the data + to be displayed one should ensure that the scale starts and ends at + suitable times and that the tick interval chosen fits with an even + multiple of minutes, hours, days or what is best suited for the time + range that is to be displayed.
+The following code example illustrates this. It creates some "fake" + data that is assumed to be sampled time based data and sets up some + suitable scales and tick interval. This script may be used as a basis + for more advanced handling of the time data.
<?php
+
+// Example on how to treat and format timestamp as human readable labels
+
require_once(
+"../jpgraph.php");
+
require_once("../jpgraph_line.php");
+
+
// Number of "fake" data points
+
DEFINE('NDATAPOINTS',
+500);
+
+
+// Assume data points are sample every 10th second
+
DEFINE('SAMPLERATE',
+10);
+
+
+// Callback formatting function for the X-scale to convert timestamps
+
// to hour and minutes.
+
function
+TimeCallback(
+$aVal) {
+
return Date
+('H:i', $aVal);
+
}
+
+
// Get start time
+
$start = time();
+
+// Set the start time to be on the closest minute just before the "start" timestamp
+
$adjstart
+= floor($start /
+60);
+
+
+// Create a data set in range (20,100) and X-positions
+
+// We also apply a simple low pass filter on the data to make it less
+
// random and a little smoother
+
$data
+= array();
+
$xdata
+= array();
+
$data[0] =
+rand(20,100
+);
+
$xdata[0] =
+$adjstart;
+
for( $i=1;
+$i <
+NDATAPOINTS; ++
+$i ) {
+
$data[$i] =
+rand(20,100
+)*0.2 + $data[
+$i-1]*0.8
+;
+
$xdata
+[$i] = $adjstart +
+$i *
+SAMPLERATE;
+
}
+
+
+// Assume that the data points represents data that is sampled every 10s
+
// when determing the end value on the scale. We also add some extra
+
// length to end on an even label tick.
+
$adjend = $adjstart + (
+NDATAPOINTS+10)*10
+;
+
+
$graph
+= new Graph(500,
+250);
+
$graph->SetMargin(
+40,20,30
+,50);
+
+
+// Now specify the X-scale explicit but let the Y-scale be auto-scaled
+
$graph->SetScale(
+"intlin",0,0
+,$adjstart,$adjend);
+
$graph->title->
+Set(
+"Example on TimeStamp Callback");
+
+
+// Setup the callback and adjust the angle of the labels
+
$graph->xaxis->
+SetLabelFormatCallback(
+'TimeCallback');
+
$graph->xaxis->
+SetLabelAngle(
+90);
+
+
+// Set the labels every 5min (i.e. 300seconds) and minor ticks every minute
+
$graph->xaxis->
+scale->ticks->Set
+(300,60);
+
+
$line
+= new LinePlot
+($data,$xdata);
+
$line->SetColor(
+'lightblue');
+
$graph->Add(
+$line);
+
+
$graph->Stroke();
+
?>
+
With date/time scale we refer to the plotting of data where the + independent variable (X-axis) de-nominates a time value. This could for + example be the temperature measured in intervals during a day.
+From version 1.18 and onwards there are two principal ways of + handling date/time scales. The manual way and fully automatic using the + special "dat" scale. For most cases the automatic "dat" scale is the + preferred choice but in rare circumstances it might be more appropriate + to use the manual way since it gives slightly more control (but not + that much) of the overall handling of scales.
+To be able to use a date/time scale at all we will assume that the + data points are represented by both an X coordinate (time-value) and a + Y-value (anything else wouldn't make sense).
+We first start by describing the use of the "dat" scale.
+By default only the Y-axis have grid lines and then only on major + ticks, i.e. ticks which have a label. It is of course possible to + change this. Both the X , Y and Y2 can have grid lines. It is also + possible to let the gridlines also be drawn on the minor tick marks, + i.e. ticks without a label. Lets see how we can apply this to the graph + above.
+The grid is modified by accessing the xgrid (or ygrid) component of + the graph. So to display minor grid lines for the Y graph we make the + call
+ $graph->ygrid->Show
+(true,true)
+
The first parameter determines if the grid should be displayed at + all and the second parameter determines whether or not the minor grid + lines should be displayed.
+If you also wanted the grid lines to be displayed for the Y2 axis + you would call
+ $graph->
+y2grid->Show(true
+,true)
Note. In general it is not a good idea to display + both the Y and Y2 grid lines since the resulting image becomes + difficult to read for a viewer.
+We can also enable the X-grid lines with the call
$graph
+->xgrid->Show(
+true)
+
In the above line we will of course only just enable the major grid + lines.
+To bring all this together we will display a graph with grid lines + for both Y and X axis enabled.
Another option for the grid lines is the possibility to have the + area between the grid lines filled with alternating two colors. The + example below illustrates this.
+In the example above we have also made use of alpha-blending + (requires GD 2.x or higher). By default the filled grid lines are + disabled. To enable this style you have to call the +Grid::SetFill() method.
+You might want to have specific labels you want to use for the + X-axis when this has been specified as a "text" scale. In the previous + example each Y-point might represent a specific measurement for each of + the first 10 month. We might then want to display the name of the + months as X-scale.
+To specify the labels on the scale you make use of the + SetTickLabels() method.
+To get a localized version of the name of the month you can use a + nice feature in JpGraph, the global '$gDateLocal' object which is an + instance of the + DateLocale
+This class has a number of methods to get localized versions of + relevant names for dates, (months and weekdays).
+So to specify the X-axis with the short form of the month names we + use the construction
+ $a =
+$gDateLocale->
+GetShortMonth();
+
$graph->xaxis->
+SetTickLabels(
+$a);
+
This will, now result in the image displayed below
+As can be seen in the previous example the X-axis is slightly + cluttered with the labels very close to each other. We might rectify + this by either enlarging the image or just displaying fewer tick label + on the x-axis.
+Specifying that we only want, for example, to print every second + label on the axis is done by a call to the method + SetTextLabelInterval() Which would result in the graph
+ +If the text labels are long (for example full dates) then another + way might be to adjust the angle of the text. We could for example + choose to rotate the labels on the X-axis by 90 degrees. With the help + of the SetLabelAngle() +
+Which would then result in the image below
+Using a filled line plot is not much different from using a normal + line plot, in fact the only difference is that you must call the method + SetFillColor() + on a normal line plot. This will then fill the area under the line + graph with the chosen color.
+In the example below we have also, as an example, specified plot + marks (see previous sections).
+Note 1. If you add multiple filled line plots to + one graph make sure you add the one with the highest Y-values first + since it will otherwise overwrite the other plots and they will not be + visible. Plots are stroked in the order they are added to the graph, so + the graph you want front-most must be added last.
+Note 2. When using legends with filled line plot + the legend will show the fill color and not the bounding line color.
+Note 3. Filled line plots is only supposed to be + used with positive values. Filling line plots which have negative data + values will probably not have the appearance you expect.
+As you can see from the graph above the grid lines are below the + filled line graph. If you want the grid lines in front of the graph you + can adjust the depth with call to + Graph::SetGridDepth() As the following example shows
+ +Accumulated line graphs are line graphs that are "stacked" on top of + each other. That is, the values in the supplied data for the Y-axis is + not the absolute value but rather the relative value from graph below. + For example if you have two line graphs with three points each, say + [3,7,5] and [6,9,7]. The first graph will be plotted on the absolute + Y-values [3,7,5] the second plot will be plotted at [3+6, 7+9, 5+7], + hence the values of the previous graphs will be used as offsets.
+You may add any number of ordinary line graphs together. If you want + to use three line plots in an accumulated line plot graph you write the + following code
+
+ // First create the individual plots
+
$p1 = new LinePlot(
+$datay_1);
+
$p2 = new LinePlot(
+$datay_2);
+
$p3 = new LinePlot(
+$datay_3);
+
+
+// Then add them together to form a accumulated plot
+
$ap = new AccLinePlot(array($p1,
+$p2,$p3));
+
+
+// Add the accumulated line plot to the graph
+
$graph->Add(
+$ap);
+
You might of course also fill each line plot by adding the lines
$p1
+->SetFillColor
+("red");
+
$p2->SetFillColor(
+"blue");
+
$p3->SetFillColor(
+"green");
+
Using some appropriate data this might then give a graph perhaps + like the one showed in the figure below
+ +If you only have access to a few data points but still want a smooth + curve between those data points JpGraph can help you achieving that by + letting you construct cubic splines. If you never have heard of cubic + splines before, don't worry. You only have to supply the data points + you know tell JpGraph how many interpolated points in total you want in + the graph. JpGraph will now take care of constructing a smooth curve + between all you data points. The new, smooth, curve will be made up of + exactly as many interpolated points as you have specified.
+To construct a spline you need both the X and Y coordinates for the + known data points.
+You start by constructing a new Spline instance. To + get access to the Spline class you must first remember to include the + file "jpgraph_regstat.php". You instantiate this class by calling it + with your two known data arrays (X and Y) as follows.
$spline
+= new Spline($xdata,
+$ydata);
+
This call initializes the spline with the data points you have. These + data points are also known as Control points for the spline. + This helper class doesn't draw any line itself. Instead it is merely + used to get a new (larger) data array which have all the interpolated + values. You then use these new value in your plot. This way give you + great flexibility in how you want to use this interpolated data.
+Continuing the above line we now use the Spline::Get() + method to get an interpolated array containing a specified number of + points. So for example the line
+ list(
+$sdatax,
+$sdatay) =
+$spline->Get(50
+);
Will construct the two new data arrays '$sdatax' and '$sdatay' which + contains 50 data points. These two arrays are constructed from the + control point we specified when we created the '$spline' object.
+You would then use these two new data array in exactly the same way + as you would form ordinary data vectors.
+The following example illustrates this
+In order to make the example more interesting we actually use two + plots. First a line plot to get the smooth curve and then a standard + scatter plot which is used to illustrate where the control points are.
+To emphasize the specific data points it is possible to add plot + marks at each data point. Plot marks can be either
+You access the plot mark through the "mark" instance variable in the + plot, as in
+ $lineplot->
+mark->SetColor("red"
+);
To choose between the different plot marks you call the +PlotMark::SetType() method with the correct define to choose the + plot type you want to use.
+The simple shape type of plot marks are
+To specify an arbitrary image you use the special define
+In this case you must also specify a image file name and an optional + scaling constant. For example as in
+ $lineplot->mark->
+SetTYPE(
+MARK_IMG,
+"myimage.jpg",
+1.5);
+
If you want to use one of the built-in images the following images + are available. Please note that not all images are available in all + possible colors. The available colors for each image is listed below.
+The following shape (the first class) plot marks are available
+For the second class (built-in images) the following table list the + different images as well as what color they are available in. For the + built-in images you specify the color with the second argument.
+Note that some of the images are available in different sizes. The + reason is that even though you can scale them by the third argument + there is a visual degradation to scale an image larger than it's + original size since some pixels needs to be interpolated. Reducing the + size with a scale < 1.0 gives much better visual apperance.
+The scaling works with both GD 1 and GD 2 but with GD 2 the quality + of the scaling is much better.
+Built-in images and available colors:
+Type | Description | Colors |
---|---|---|
MARK_IMG_PUSHPIN, MARK_IMG_SPUSHPIN | Push-pin image | +'red','blue','green','pink','orange' |
MARK_IMG_LPUSHPIN | A larger Push-pin image | +'red','blue','green','pink','orange' |
MARK_IMG_BALL, MARK_IMAGE_SBALL | A round 3D rendered ball | +'bluegreen','cyan','darkgray','greengray', + 'gray','graypurple','green','greenblue','lightblue', + 'lightred','navy','orange','purple','red','yellow' |
MARK_IMAGE_MBALL | A medium sized round 3D rendered ball | + 'blue','bluegreen','brown','cyan', + 'darkgray','greengray','gray','green', + 'greenblue','lightblue','lightred', 'purple','red','white','yellow' | +
MARK_IMAGE_LBALL | A large sized round 3D rendered ball | + 'blue','lightblue','brown','darkgreen', + 'green','purple','red','gray','yellow','silver','gray' |
MARK_IMAGE_SQUARE | A 3D rendered square | +'bluegreen','blue','green', 'lightblue','orange','purple','red','yellow' | +
MARK_IMG_STAR | A 3D rendered star image | +'bluegreen','lightblue','purple','blue','green','pink','red','yellow' | +
MARK_IMG_DIAMOND | A 3D rendered diamond | +'lightblue','darkblue','gray', 'blue','pink','purple','red','yellow' | +
MARK_IMG_BEVEL | A 3D rendered bevel style round ring | +'green','purple','orange','red','yellow' |
It might sometimes be desirable to highlight the data-points with + marks in the intersection between the given x and Y-coordinates. This + is accomplished by specifying the wanted plot mark type for the "mark" + property of the line graph. A full list of all available marks is given + in the class reference +PlotMarks
+For now let's just add a triangle shape marker to our previous graph + by adding the line
$lineplot->
+mark->SetType(MARK_UTRIANGLE
+);
This will give the graph as shown below
+ +If you like you can of course both change the size, fill-color and + frame color of the chosen plot mark.
+The colors of the marks will, if you don't specify them explicitly, + follow the line color. Please note that if you want different colors + for the marks and the line the call to SetColor() for the marks must be + done after the call to the line since the marks color will always be + reset to the lines color when you set the line.
+In the following section we will work through an number of examples + on how to manipulate labels on a text scale. Primarily we will + investigate how to best handle the case where you have a large number + of values.
+As a remainder; Text scale is meant to be used on the X-axis when + the X-axis doesn't have a numeric value, i.e you are only interested in + linear ordering of the data. If you don't specify the labels manually + they will be set automatically starting from 1 as the example below + shows.
+ + +To specify the labels on the X-axis as suitable text strings you + call the method + Axis::SetTickLabels() with an array containing the text-labels. If + there are more data points than labels the non-specified labels will be + given their ordinal number. If we augment the previous example with the + name of the month we get the following new example
+ + + +What happen now if we have a larger number of bars? Let's try with + 25 bars and see what result we get.
+ + +Not all to impressive. The labels are to close and they overlap. + Hence it is not a good idea to display every label. To adjust what + labels are to be displayed you use the + SetTextLabelInterval() method. The argument to this method is the + interval between text labels. So to display only every 3 month you + would add the line
+
+ $graph->xaxis->SetTextLabelIntervall(3
+)
Which would give the result shown below
+ +Much better, quite readable.
+If we have an even larger data set it might not longer be meaningful + to display all the tick marks since they would simple become to close. + In JpGraph there is a possibility to specify that you only would like + every n:th tick mark to be visible ( + SetTextTickIntervall() ). For bar graphs using text scale however, + that might not be such a good idea since the tick marks are between the + bars and the labels centered under the bars. If we only were to + display, say, every 3 tick mark it wouldn't look to good. Not that we + can't do it, as the example below shows, but it just doesn't look very + good.
+ +A better way to handle large data set is simply to hide the tick + marks all together. Tick marks may be hidden by calling the method + Axis::HideTicks(); If we hide all the ticks on the X-axis we will + get the result shown below
+ +Let's start by creating a very simple radar plot based on 5 data + points using mostly default values.
+As the first thing you must remember to include the extension module + that contains the radar plot. "jpgraph_radar.php".
+A very simple radar plot is created by the code
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_radar.php");
+
+
// Some data to plot
+
$data
+= array(55,80,
+46,71,95
+);
+
+
// Create the graph and the plot
+
$graph
+= new RadarGraph
+(250,200,
+"auto");
+
$plot
+= new RadarPlot
+($data);
+
+
// Add the plot and display the graph
+
$graph->Add(
+$plot);
+
$graph->Stroke();
+
?>
and would give the result
+To change the size and position of the radar graph is similar to the + pie plot and you do it by using the methods + SetSize() and + SetCenter()
+If you want a filled radar plot you need to specify the fill color + with the method + SetFillColor() The following example shows these methods in action
+ +To add clarification or other information text strings to the graph + you can add arbitrary lines of text anywhere you like onto the graph. + The text might have multiple lines and you can choose the paragraph + alignment.
+To add text you have to create one or more instances of the + Text() object and then add the text object to the graph with the + AddText() method.
+The position of these text boxes are given as fraction of the width + and height of the graph. When you are positioning these text boxes you + might also choose what part of the text box should be considered the + anchor point for the position you specify.
+By default the anchor point is the upper left corner of the bounding + box for the text.
+To show some ways of positioning the text we use a very simple bar + graph not to distract from the text. We first just add a single text + line with most of the settings their default value by adding the + following lines to the graph
+ $txt=new Text(
+"This is a text");
+
$txt->Pos(
+0,0);
+
$txt->SetColor(
+"red");
+
$graph->AddText(
+$txt);
+
The result is shown below.
+Not too exiting. Let's make it more interesting by having a + background color, using larger fonts and framing the text box and + adding a drop shadow to the text box by using the methods + SetBox() and SetBox()
+That's better. Now we get some attention. If you want to add a text + with several lines you just need to separate the lines with a newline + ('\n' character). The default paragraph alignment is left edge but you + can also use right and center alignment.
+As an illustration let's add a couple of more lines to the previous + text, center the text box in the middle of the graph and also use + centered paragraph alignment for the text. To adjust the paragraph + alignment of the text you have to use the + Text::ParagraphAlign()
+Of course there is no limit to the number of text string you can add + to the graph.
+From version 1.12 it is also possible to add text strings to a graph + using the scale coordinates instead. This is accomplished by using the Text::SetScalePos() Which + is completely analog to SetPos() with the only difference that the + positions given are interpretated as scale values instead of fractions + of the width and height.
+As a final easy modification we can enable the display of the data + value above each data point. The value is represented by the 'value' + property in the plot. (You can read more about the possibilities of the + display value + in the class reference.)
+To enable the display of the value you just need to call the Show() + method of the value as in
+ $lineplot->value->
+Show()
+
Adding that line to the previous line plot would give the result + shown below.
+We can of course change both color, font and format of the displayed + value. So for example if we wanted the display values to be dark red, + use a bold font and have a '$' in front we need to add the lines
$lineplot->value
+->SetColor("darkred");
+
$lineplot
+->value->SetFont(
+FF_FONT1,
+FS_BOLD);
+
$lineplot
+->value->SetFormat(
+"$ %0.1f");
+
This would then result in the following image
+We normally would like something more meaningful as description of + each axis than it's number. Specifying the titles are accomplished + through the use of the method SetTitles() of the graph. Let's say that + each axis corresponds to a month. We could then use the code
$titles
+= $gDateLocale
+->GetShortMonth
+();
+
$graph->SetTitles(
+$titles);
+
As you can see the way radar plot is constructed will assign the + titles (and plot points) in a counter-clockwise direction. If you want + them in clock-wise order you will have to inverse your input data array + as well as the title array.
+To specify a legend you (as with the other plot) make use of the + SetLegend(); method on each radar plot.
+Each major tick mark can also be connected together to create a + grid. The grid is accessed through the 'grid' property of the graph. To + enable the grid and set the line style to "dotted" you would have to + add the lines
+ $graph->grid->Show
+();
+
$graph->grid->
+SetLineStyle(
+"dotted");
+
and would result in the following graph
+By design the plot is above the grid line but beneath the axis in + image depth, hence some part of the grid lines are hidden.
+To have the grid lines more "visible" just change their color, say + to, dark red by invoking the SetColor() method on the grid lines which + would give the following result
+Another simple change we could do would be to just change the + background color of the radar graph. This is (not surprisingly) done by + a call to the method SetColor() invoked on the graph object.
+ +What if we want to add a second plot to the graph we just produced? + Well, this is quite straightforward and just requires two simple step:
+To create the second plot we need some data (we could of course use + the same data as for the first plot but then we wouldn't be able to see + the new plot!)
+The following lines show how to create the new plot and add it to + the graph (we only show the new lines - not the full script)
$ydata2
+= array(1,19,
+15,7,22
+,14,5,
+9,21,13
+);
+
$lineplot2
+=new LinePlot($ydata2);
+
$lineplot2
+->SetColor("orange");
+
$lineplot2
+->SetWeight(2);
+
+
$graph->Add(
+$lineplot2);
+
Making these changes to the previous graph script would generate a + new graph as illustrated below.
+There is a few things worth noting here
+Each graph can have up to three different titles accessed by the + three properties
+All of these three properties is a standard text object which means + that you can have individual font, colors, margins and sizes of these + tree titles.
+The only thing you need to think of is that you probably want to add + some extra margin to make room for the titles (using + Graph::SetMargin() )
+The individual positioning of these titles are done automatically + and will adjust to the font size being used.
+If you for, esthetic reasons, would like increase the distance from + the top where the title is positioned (or the intra distance between + title and sub title) you can use the + Text::SetMargin() method. For example the line
+
+ $graph->title->SetMargin
+(20);
will set the distance between the top of the title string and the top + of the graph to 20 pixels. If you instead call the SetMargin() method + for the subtitle it will adjust the distance between the top of the + subtitle and the bottom of the title.
+The titles will be positioned at the top and be centered in the + graph. Each of these titles may have multiple lines each separated by a + "\n" (newline) character. By default the paragraph alignment for each + title is centered but may of course be changed (using the + ParagraphAlign()) method.
+Each graph can also have a footer. This footer is actually three + footers. Left, center and right. The 'left' footer is aligned to the + left, the 'center' at the bottom center and the right to the right.
+Each of these three positions is a standard Text object which means + you can change color, font and size as you please individually on each + of these footer positions.
+You access the footer through the Graph::footer property as the + following example shows
+
+ $graph->
+footer->left->Set
+("(C) 2002 KXY"
+);
+
$graph->footer->
+center->Set("CONFIDENTIAL"
+);
+
$graph->footer->
+center->
+SetColor("red");
+
$graph->footer->
+center->
+SetFont(
+FF_FONT2,
+FS_BOLD);
+
$graph->footer->
+right->Set("19 Aug 2002"
+);
As you saw in the preceding example you could add multiple plots to + the same graph and Y-axis. However what if the two plots you want to + display in the graph has very different ranges. One might for example + have Y-values like above but the other might have Y-values in the + 100:s. Even though it is perfectly possible to add them as above the + graph with the smallest values will have a very low dynamic range since + the scale must accomplish the bigger dynamic range of the second plot.
+The solution to this is to use a second Y-axis with a different + scale and add the second plot to this Y-axis instead. Let's take a look + at how that is accomplished.
+First we need to create a new data array with large values and + secondly we need to specify a scale for the Y2 axis. This is done by + the lines
+ $y2data = array(
+354,200,265
+,99,111,
+91,198,225
+,293,251);
+
$graph->SetY2Scale(
+"lin");
+
and finally we create a new line plot and add that to the second + Y-axis. Note that we here use a new method, AddY2(), since we want this + plot to be added to the second Y-axis. Note that JpGraph will only + support two different Y-axis. This is not considered a limitation since + using more than two scales in the same graph would make it very + difficult to interpret the meaning of the graph.
+To make the graph a little bit more esthetic pleasing we use + different colors for the different plots and let the two different + Y-axis get the same colors as the plots.
+The resulting graph is shown below. source)
+ +A variant of the titles is the tab title. This is just + another option you have of putting a name on the graph. The appearance + of this type is a tab on top of the plot area with text inside.
+You can access the tab using the 'tabtitle' property of the graph.
+The following figure shows an example of how this can look.
+As usual you have full freedom to specify font and colors for this + type of title. Please see the class reference regarding +GraphTabTitle() for more information.
+You can easily create several radar plot which are added to the same + radar graph. The thing to remember is that if you use filled radar + plots and they overlap each other that the order which they are added + will be the order they are drawn.
+A simple example of this is shown below
+ +With more than one plot on the same graph it is necessary to somehow + indicate which plot is which. This is normally done by adding a legend + to the graph.
+You will see that each plot type has a 'SetLegend()' method which is + used to name that plot in the legend. SO to name the two plots in the + example we have been working with so far we need to add the lines
$lineplot->SetLegend
+("Plot 1");
+
$lineplot2
+->SetLegend("Plot 2");
+
to the previous code. The resulting graph is shown below + + As you can see the legend gets automatically sized depending on how + many plots there are that have legend texts to display. By default it + is placed with it's top right corner close to the upper right edge of + the image. Depending on the image you might want to adjust this or you + might want to add a larger margin which is big enough to accompany the + legend. Let's do both.
+First we increase the right margin and then we place the legend so + that it is roughly centered. We will also enlarge the overall image so + the plot area doesn't get too squeezed.
+To modify the legend you access the 'legend' property of the graph. + For a full reference on all the possibilities (changing colors, layout, + etc) see class legend in + the class reference
+For this we use the legends 'SetPos()' method as in
$graph
+->legend->Pos(
+0.05,0.5,"right"
+,"center");
Doing this small modification will give the result shown below
+The above method 'SetPos()' deserves some explanation since it might + not be obvious. You specify the position as a fraction of the overall + width and height of the entire image. This makes it possible for you to + resize the image within disturbing the relative position of the legend. + We will later see that the same method is just to place arbitrary text + in the image.
+To give added flexibility one must also specify to what edge of the + legend the position given should be relative to. In the example above + we have specified "right" edge on the legend for the for the horizontal + positioning and "center" for the vertical position.
+This means that the right edge of the legend should be position 5 % + of the image width from the right. If you had specified "left" the the + legends left edge would be positioned 5 % of the image width from the + image left side.
+By default the legends in the legend box gets stacked on top of each + other. The other possibility is to have them sideways. To adjust this + you use the SetLayout() + method. Using a horizontal layout with the previous example give the + following result.
+ +For more advanced fomatting of the legend it is possible to adjust
+In order to adjust the number of columns used in the legend the + method Legend::SetColumns is used. So for example to have the + legend lined up using three columns the follwing lines have to be added + to teh script
+ $graph->
+legend->
+SetColumns(3);
In exactly the same way as for line graphs it is possible to add + plot marks in radar plots. The mark property is accessed through the + RadarPlot::mark The example below adds a red ball as a marker.
+ +Instead of having a single color background you can easily have an + arbitrary image as the background. The image may be in either PNG, JPG + or GIF format depending on what your installation supports.
+ +A note on GD: If you are using GD 2.xx you must + make sure that the define USE_TRUECOLOR is set to true. This is also + the default. Failure to do so in combination with GD 2.xx will make the + background image just look like a solid black square.
+ +To use a specific image as the background you just have to use the + method + Graph::SetBackgroundImage() The arguments specify file-name, how + the image should be positioned in the graph and finally the format of + the image (if it is in JPG, PNG or GIF) format. If the format is + specified as "auto" (the default) then the appropriate image format + will be determined from the extension of the image file.
+The file name is of course obvious but the second argument might not + be. This arguments determine how the image should be copied onto the + graph image. You can specify three different variants here
+You might often find yourself wanting to use a background image as a + "waterstamp". This usually means taking the original image, import it + to some image editing program and then "bleaching" the color + saturation, reducing the contrast and so on. Finally you save the + modified image which you then use as a background image.
+This whole process can be automatically accomplished in JpGraph by + using the method + Graph::AdjBackgroundImage() which allow you to adjust color + saturation, brightness and contrast of the background image.
+
+ $graph->
+AdjBackgroundImage(...)
+
to achieve the "watercolor" effect to avoid the image being too + intrusive in the graph.
+JpGraph offers two ways of handling null values (or discontinuities) + in the data. You can either have a "whole" in the data or the line may + be extended between the previous and next data point in the graph.
+If the data value is null ("") or the special value "x" then the + data point will not be plotted and will leave a gap in the line.
+If the data value is "-" then the line will be drawn between the + previous and next point in the data ignoring the "-" point.
+The following example shows both these possibilities.
+ + +In addition to the background image you can also add a background + color gradient. This gradient can be covering the entire graph, just + the plot area or just the margins. This flexibility allows you to + combine a background image with a background color gradient. You can + for example use a background image in the plot area and a color + gradient out in the margins.
+You specify a color gradient background by calling the + Graph::SetBackgroundGradient() method. All details are available in + the class reference (follow the link above). We finally give a quick + example on what kind of effect you can achieve using this feature.
Finally we like to mention that in the "/utils/misc/" directory you + will find a small utility script called "mkgrad.php". Running this + script presents you with a UI that makes it a breeze to create a + gradient image on it's own.
+ The UI for the utility is so obvious that we won't discuss it
+ further, we just show it below. The UI for the mkgrad.php utility
In the example below this utility is used to get a more interesting + plot area.
+ + +An interesting enhancement when using Plotmarks is the possibility + to add a callback function to control the size and color of the + plotmarks.
+This callback function will get called with the current Y-value (for + the plotmark) as it's argument. As return value the callback function + must return an array containing three (possible null) values. The + values returned must be
+The exact meaning of the parameters will of course depend on the + type of plot marks being used.
+The callback must be a global function and is installed with a call + to + PlotMark::SetCallback()
+So for example to install a callback that changes the fill color for + all marks with a (Y) value higher than 90 you could add the lines
++ + 90) $fcolor="red" else $fcolor=""; return array("","",$fcolor); } ... + $plot->mark->SetCallback("MarkCallback"); ...'; ShowCodeSnippet($t); ?>
+As you can see in the above example we have left some of the return + values blank. Doing this will just ignore any change of these value and + use the global settings for the plotmarks.
+If you also let the (Y) value affect the size of the plot marks you + can get what is sometimes known as a "balloon plot". The example below + is basically a scatter plot that uses filled circles to mark the + points. A format callback is then used to change the color and size + depending on the Y-value for each plot.
+ + +Step style refers to an alternate way of rendering line plots by not + drawing a direct line between two adjacent points but rather draw two + segments. The first segment being a horizontal line to the next X-value + and then a vertical line from that point to the correct Y-value. This + is perhaps easier demonstrated by an example as seen below.
+You specify that you want the plot to be rendered with this style by + calling the method +SetStepStyle() on the lineplot.
+ +In section 10.2 you can read about + arbitrary rotation of the graphs. For most practical purposes rotation + of 90 degrees is most useful. This could for example be used to plot + horizontal bar graphs.
+The slight complication with general rotation is that the margins + also rotates, this means that if you rotate a graph 90 degrees the left + margin in the image was originally the bottom margin. In additional by + default the center of the rotation is the center of the plot area and + not the entire image (if all the margins are symmetrical then they will + of course coincide). This means that depending on your margin the + center of the rotation will move. You can read more about this and how + to manually set the center for rotation in the section about rotation, 10.2
+This is just a slight inconvenience which you have to take into + account when you need to set an explicit margin with a call to +Graph::SetMargin()
+However, in order to make a rotation of 90 degrees much easier you + can easily rotate a graph 90 degrees and set the correct margin with a + call to +Graph::Set90AndMargin() The parameter to this method lets you + specify the margins as you will see them in the image without having to + think of what becomes what after the rotation.
+So, the only thing you need to do is call this method and then the + graph will have been rotated 90 degrees.
+Using a logarithmic scale requires you to include the logarithmic + add on module in "jpgraph_log.php". So you must have the line
+include("jpgraph_log.php"
+);
on the top of your code. To Illustrate how to use a logarithmic scale + let's make the right Y scale in the previous example a logarithmic + scale. This is done by the line
+ $graph->SetY2Scale(
+"log");
+
This will then give the following result
+ +You can of course also use a logarithmic X-scale as well. The + following example shows this.
Even though we have so far only shown line graphs logarithmic scale + can also be used for bar, error, scatter plots as well. Even radar + plots supports the use of logarithmic plots. The following example + shows how to use a logarithmic scale for a bar graph.
+ + +Assuming we start with the traditional two axis graph, one X and one + Y axis. You may then change the position of each axis by calling + Axis::SetPos($aPosition) You have to remember that you need to + specify the position on the other axis. SO you need to specify the + world-coordinate for the position. By default the axis are each + positioned at the 0-point on the other axis, i.e. the axis will cross + at the 0,0 point in the graph.
+In addition to the standard positioning you may also use the two + special position markers "min" and "max". This will position the axis + at the minimum (or maximum) position of the other axis.
+For example, to make sure that the X-axis is always at the bottom of + the graph (at lowest possible Y-value) you would have to add the line
+
+ $graph->xaxis->SetPos
+("min");
To change the color and width of the axis you have to make use of + the Axis::SetColor() and + Axis::SetWeight() + methods.
+You might also want to add titles to the axis. This is done through + the Axis::SetTitle() + method. This is actually just a shortcut for accessing the title + property direct. Axis::title::Set() which also allow you to set the + alignment in one call.
+By default the position of the title is to the far right for the + X-axis and in the middle (and 90 degrees rotated) for the Y-axis.
+You can adjust the position of the title with the help of the second + argument to the + Axis::SetTitle() method.
+The possible positions are "high","middle" and "low" which refers to + the scale values on the axis.
+One common modification you might want to do to the title is to + increase the margin between the axis and the actual title. This is + often necessary to do for the Y-axis if the values displayed are large. + You may adjust the distance (in pixels) between the axis and the title + by using the method + Axis::SetTitleMargin()
+So for example to increase the margin on the Y-axis you might add + the line
+
+ $graph->yaxis->SetTitleMargin(40
+);
to your code.
+Finally we mention something about the positioning of tick marks and + labels on the axis. You have the possibility to choose what side of the + axis the tick marks and the labels should be at. For the X-axis this + can be specified as either on the the top (inside the plot area) or at + bottom (outside of the plotarea). In the same way you can specify for + the Y-axis if the labels ( or ticks) should be on the left or right + side.
+To adjust the label positioning you have to use the method + Axis::SetTitleSide() and to adjust the position of the tick mark + you have to use the method + SetTickSide()
For example, the following lines added to a script would change side + of the labels and tickmarks for the X-axis.
+
+ $graph->xaxis->SetLabelPos
+(SIDE_UP);
+
$graph->xaxis->
+SetTickSide(
+SIDE_DOWN);
+
This technique is for example used if you position the X-axis at the + top of the graph as the following example shows.
In scientific style plots it is often common to duplicate each axis + so that all sides of the graph have a labeled axis. This is of course + also fully supported by JpGraph.
+Before we continue we show a small example to illustrate this + feature
+ + +The example above shows the basic configuration. There are now + several modifications you may do to these axis like
+The style of axis is determined by the method + Graph::SetAxisStyle() The available type of axis are
+How to adjust the actual labels are discussed elsewhere in this + manual (see ???,???). However we like to mention here that you can + adjust the label margin (distance between the axis and the labels) with + the method + Axis::SetLabelMargin()
+to adjust the actual label format (like font, color, angle) you need + to access the Axis::SetFont() + and the Axis::SetColor() + methods. If you investigate the + Axis class you will discover more methods to adjust the many + aspects of the axis layout.
+As a final note we also mention the methods + Axis::SetLabelAlign() and + Axis::SetLabelAngle() This first method is really only mentioned + here for completeness since it is mostly used for internal purposes. + However on some occasion you might want to adjust the alignment of the + labels. By default they are centered in respect to the tick mark. By + using the method you might override this positioning should you choose + to do so.
+The second of these methods adjusts the angle of the label in + regards to the axis. This is very useful for X-axis that have long + labels.
+In order to have full control over the way that the labels are + displayed it is possible to define a callback function that will be + applied to all labels. The callback function will be called with the + label as the only argument and should return the value that will be + displayed in the graph. This could for example be used to turn seconds + (used to position data points) into hour and minutes on the scale. For + further reference see the two methods: + Graph::SetLabelFormatCallback(); and + Graph::SetLabelFormat();
+One good way of illustrate the usefulness of label callbacks in a + slightly different context is to show how we can achieve the effect of + an inverted Y-scale.
+An inverted Y-scale has the lowest number at the top and the scale + values increases downwards.
+Even though JpGraph doesn't directly support this feature it is + quite easy to achieve with just a few extra lines of code in your image + script.
+Before we continue we give an example of what we are referring to.
+ + +Two achieve this effect there are two simple steps to take:
+And that's it! We refer you to the code in the example above for the + details.
+To get the exact type of axis you want in your graph there are a + number of adjustments available for you. You may change, color, size, + position and general appearance.
+ +As you saw in the previous example it is possible to use different + types of scales. In JpGraph you can use the following scales
+Any combination of these may be used. Linear and logarithmic scales + are pretty straightforward. The text scale might deserve some + explanation. The easiest way to think of the text scale is as a linear + scale consisting of only natural numbers, i.e. 0,1,2,3,4,... . This + scale is used when you just have a number of Y-values you want to plot + in a consecutive order and don't care about the X-values. For the above + example it will also work fine to use a linear X-scale (try it!). + However, the scale is now treated as consisting or real numbers so the + auto scaling, depending on the size of the image an the number of data + points, might decide to display other labels then the natural numbers., + i.e. a label might be 2.5 say. This is not going to happen if you use a + text scale.
+The normal practice for text scale is to specify text strings as + labels instead as the default natural numbers. You can specify text + strings for the labels by calling the + SetTickLabels() method on the Axis.
+To specify the scale you use the + SetScale() method. A few examples might help clarify this.
+As you can see all your graphs will require at least one call to + SetScale() in the beginning of your script. Normally it will come right + after the creation of the Graph().
+To specify the scale for the Y2 axis you use the + SetY2Scale() Since you only specify one axis you only specify + "half" of the string in the previous examples. So to set a logarithmic + Y2 scale you will call + + SetY2Scale("log");'; ShowCodeSnippet($t); ?>
+The first example draws a line graph consisting of 10 Y-values. In + this first example we show the full code. In the following examples we + will only show interesting piece of the code.
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_line.php");
+
+
// Some data
+
$ydata
+= array(11,3,
+8,12,5
+,1,9,
+13,5,7
+);
+
+
+// Create the graph. These two calls are always required
+
$graph
+= new Graph(350,
+250,"auto");
+
$graph->SetScale(
+"textlin");
+
+
// Create the linear plot
+
$lineplot
+=new LinePlot($ydata);
+
$lineplot
+->SetColor("blue");
+
+
// Add the plot to the graph
+
$graph->Add(
+$lineplot);
+
+
// Display the graph
+
$graph->Stroke();
+
?>
+
You might note a few things
+This is a perfect fine graph but looks a little bit "sparse". To + make it more interesting we might want to add a few things like
+From looking at the previous example you can see that you access all + properties of JpGraph through the objects you create. Graph(), + LinePlot() and so on. In general all objects you can see in the graph + is accessed through a named instance.
+For example the title of the graph is accessed through the + 'Graph::title' property. So to specify a title string you make a call + to the 'Set()' method on the title property as in:
+
+ $graph->title->Set
+('Example 2');
So by adding just a few more lines to the previous code we get a + graph as shown below.
To achieve this we just needed to add a few more lines. (We only show + the part of example 1 we changed, to look at the full source just click + the [src] link in the caption. )
+
+// Setup margin and titles
+
$graph->img->
+SetMargin(40,20
+,20,40);
+
$graph->title->
+Set(
+"Example 2");
+
$graph->xaxis->
+title->Set("X-title"
+);
+
$graph->yaxis->
+title->Set("Y-title"
+);
+
Again there are a couple of things you should note here
+A nice change would now be to have all the titles in a bold font and + the line plot a little bit thicker and in blue color. Let's do that by + adding the lines
$graph->
+title->SetFont(FF_FONT1
+,FS_BOLD);
+
$graph->yaxis->
+title->SetFont(FF_FONT1
+,FS_BOLD);
+
$graph->xaxis->
+title->SetFont(FF_FONT1
+,FS_BOLD);
+
$lineplot
+->SetColor("blue");
+
$lineplot
+->SetWeight(2);
+// Two pixel wide
Again please note the consistent interface. To change font you just + have to invoke the SetFont() method on the appropriate object. This + principle is true for most methods you will learn. The methods may be + applied to a variety of objects in JpGraph. So for example it might not + come as a big surprise that to have the Y-axis in red you have to say:
+ $graph->yaxis->SetColor
+("red")
or perhaps we also want to make the Y-axis a bit wider by
$graph
+->yaxis->SetWidth(
+2)
+
As a final touch let's add a frame and a drop shadow around the + image since this is by default turned off. This is done with
$graph
+->SetShadow()
The result of all these modifications are shown below.
Spider plots are most often used to display how a number of results + compare to some set targets. They make good use of the human ability to + spot symmetry (or rather un-symmetry) . the figure below show an + example of a spider (sometimes called a web-plot). Spiderplots are not + suitable if you want very accurate readings from the graph since, by + it's nature, it can be difficult to read out very detailed values.
+ +In the following section we show how to draw both simple and complex + radar graph. As we will show all the settings will follow the same + pattern as for the more standard linear graphs.
+By default the auto-scaling algorithm tries to make best possible + use of screen estate by making the scale as large as possible, i.e. the + extreme values (min/max) will be on the top and bottom of the scale if + they happen to fall on a scale-tick. So for example doing a simple line + plot could look like the plot shown in the below.
+However you might sometime want to add some extra to the minimum and + maximum values so that there is some "air" in the graph between the end + of the scale values and the extreme points in the graphs. This can be + done by adding a "grace" percentage to the scale. So for example adding + 10% to the y-scale in the image above is done by calling the + SetGrace() method on the yscale as in
+
+ $graph->yaxis->scale
+->SetGrace(10,
+10);
+
These lines add a minimum of 10% to the top and bottom values of the + scale. Note that we say "minimum" since depending on the specific tick + values choose this might be a little bit more to make the end of the + scale fall on an even tick mark.
+Adding this line to the previous graph will result in the following + example
+ +Since we haven't adjusted the position of the X-axis it will remain + at Y=0 which might not necessary be what we would like so we therefor + also add the line
+
+ $graph->xaxis->SetPos
+("min");
So that the X-axis always will remain at the lowest possible + Y-value. Doing this will then result in the example below
+ + +Semi filled bar graphs are in principle the same as normal filled + bar graphs but with the additional feature that you can choose to only + fill a specified range (or ranges) of X-coordinates. The figure below + illustrates this
+ + +In this example we defined two areas along the X-axis to be filled. + You can add filled areas by using the method + AddArea() and specifying range and color for the filled area.
+All patterns can be customized by
+
+
+ $band
+->prect->SetHorizon(
+$aHorizon)
+
assuming that the band is a 3D plane.
+To finish this section we give one final, more creative, example on + how to use the bands.
+ +As an additional way of emphasizing certain areas of the graph it is + possible to add bands (either vertical or horizontal) to any one of the + standard X-Y coordinate system based graphs. A band is a rectangular + area that stretches one entire axis. This means that if you define a + band between X-coordinates 3 and 5 the band area will occupy an area + between the X-coordinates and the entire Y-range.
+In order to access this functionality you must first make sure that + you include the additional library file jpgraph_plotband.php
+At the time of this writing (current as of JpGraph 1.8) the table + below illustrates the 8 basic types of patterns available. We will + shortly show you how you can customize these patterns, To keep these + examples clear we have only used one pattern in each figure.
+ ++ + | + + |
+ + | + + |
+ + | + + |
+ + | + + |
To add a one of these patterns to your graph you need to call the + method + PlotBand::PlotBand() The arguments is fairly easy to understand. + The pattern you would like to use is specified by using the correct + constant. You can see the name of the correct constants in the figures + above. You also need to specify if the band should stretch along the + vertical or horizontal axis as well as the min and max coordinates for + the band. As coordinates you may also use the special values "min" and + "max" which automatically sets the value to the minimum/maximum value + of the scale. The specified numeric value will be automatically + truncated to fit within the plot area.
+We don't discuss the other arguments further here, instead we refer + you to the class reference.
+For very busy Pie plots it can become too little space for the + labels to be printed just beside the pie slice. For this purpose it is + possible to use guide lines for the labels. The library will then draw + a line from the center edge of the slices to the label which will be + positioned further out from the Pie Plot.
+There is one method that is primarily used to handle this, + PiePlot::SetGuideLines() the simplest usage of this would be
$pieplot
+->SetGuideLines
+();
An example of this could then be
+The above example will give guide lines very similar as what is + produced by other programs, e.g. Excel. In addition to the above + variant it is also possible to instruct the library to line up the + labels vertically in a way that we think is easier to read. This is + achieved by specifying the second parameter to the SetGuideLines() to + 'false' as in
$pieplot->
+SetGuideLines(
+true,false);
The first parameter is to enable/disable the guide-lines. With the + same example as above this would then produce the image
+It is also possible to configure the vertical distance between the + labels. By default the distance between the labels is roughly 40% of + the labels font height. By using the method + PiePlot::SetGuideLinesAdjust() it is possible to specify a + fractional value which is interpretated as the distance between the + bottom of one label to the bottom of the next. This means that + specifying a value of '1.0' the labels will have no space between them + and the bottom of one label will touch the top of another label. By + default this value is 1.4.
+By increasing or decreasing this value it is possible to make the + labels become positioned more or less compact. Below we have taken the + above example and reduced the distance to '1.1' and as can be seen this + yields much more compact labeling.
+ +Note: Guide lines is only available in 2D Pie plots.
+JpGraph allows you to easy customize the appearance of the bar + graph, for example to change the width of each bar. The width of each + bar can be specified either as a fraction of the width between each + major tick or as an absolute width (in pixels).
+To set the width in fraction you use the method + SetWidth() and to set the width in pixels you use the + SetAbsWidth()
+As an example let's take the previous example and set the width to + 100% of the distance between the ticks. The example will now become
+ + +In addition to the bands you can also add static lines to the graph. + An example of that is actually shown in figure 11 above. You create a + line as an instance of + class PlotLine . So for example the lines
+ $sline
+= new PlotLine
+(HORIZONTAL,0,
+"black",2);
+
$graph->Add(
+$sline);
+
will add a 2-pixel wide horizontal static line at Y-position zero.
+So far we have only made use of 2D pie plots, creating 3D pie plots + is no more difficult. Instead of creating the plots with a call to + PiePlot() you create the plots with a call to + PiePlot3D() If we just take the first simple pie plot and replace + the call to PiePlot() with a call to PiePlot3D() we get the following + result.
+3D Pie plots have the same possibilities as the normal pie plots + with the added twist of a 3:rd dimension. You can adjust the + perspective angle with the method + SetAngle() So for example to make the pie more "flat" you just set + it to a smaller angle. Setting the perspective angle to 20 degrees in + the previous example will give the following result.
+ +You can easily choose to display the value (and it's format) on top + of each bar by accessing the bar's 'value' property. So for example by + just adding the line
+ $barplot->value->
+Show();
+
Will enable the values in it's simplest form and will give the + result
+You cane see a small nuisance in this graph. The auto scaling + algorithm chooses quite tight limits for the scale so that the bars + just fit. Adding the value on top of the bar makes it collide with the + top of the graph. To remedy this we tell the auto scaling algorithm to + allow for more "grace" space at the top of the scale by using the + method + SetGrace() which is used to tell the scale to add a percentage (of + the total scale span) more space to either one end or both ends of the + scale. In this case we add 20% more space at the top to make more room + for the values with the line
+ $graph->yaxis->
+scale->
+SetGrace(20);
This will then give the graph as shown below
+ +You can also adjust the general position of the value in respect to + the bar by using the + BarPlot::SetValuePos() method. You can set the position to either + 'top' (the default) , 'center' or 'bottom'. The graph below shows the + value being positioned in the center. In this example we have also + adjusted the format to just display the value as an integer without any + decimals.
+It is also possible to specify a more fine grained control on how + you want the values presented. You can for example, rotate them, change + font, change color. It is also possible to adjust the actual value + displayed by either using a printf()-type format string or with the + more advanced technique of a format callback routine.
+To show what you can do we just give another example for you to + examine without much further explanations. Just remember that to have + text at an angle other than 0 or 90 degrees we have to use TTF fonts. + Even though we haven't explained the SetFont() method it should be + fairly obvious.
+ +One simple way of making the bar graph more attracting is to add a + drop shadow to each bar. This is done by calling the + SetShadow() method. An example will clarify this.
+ +One way to attract attention to some specific piece of information + in a pie chart is to "explode" one or more slices. Both 2D and 3D pies + support exploding one or several slices.
+Exploding slices is accomplished by the methods + Explode() and + ExplodeSlice() The first method is used if you want to explode more + than one slices and the second is a shorthand to make it easy to just + explode one slice.
+For example to explode one slice the default "explode" radius you + would just have to say
+ $pieplot->ExplodeSlice(
+1)
+
The above line would explode the second slice (slices are numbered + from 0 and upwards) the default amount. Doing this to the two previous + example would result in
+ + + +To explode all slices at once you can use the + PiePlot::ExplodeAll() method. If you want to explode several slices + you can use the + PiePlot::Explode() method and supply a suitable array argument.
+As you have seen from the previous examples bar graphs are normally + centered between the trick marks on a text scale. However, you can + modify this behavior by calling the method + BarPlot::SetAlign()
+By default the values shown just outside the pie for each slice are + the percentage value for each slice. If you instead wanted the absolute + value you would just have to use the + SetLabelType() method. So to use the absolute value you would call
+
+ $pieplot->
+SetLabelType(
+"PIE_VALUE_ABS");
+
Furthermore you could enhance the formatting of the value by either + using a printf() style format string (using + SetFormat() ) or by providing a formatting function callback (using + + SetFormatCallback() ) for doing more advanced formatting.
+You can also adjust the position of the labels by means of the + PiePlot::SetLabelPos() method. The argument to this method is + either the fraction of the radius or the string 'auto'. In the latter + case JpGraph automatically determines the best position and the the + first case The following example illustrates this
+ +If this formatting is not enough you can also "manually" specify the + labels for each slice individually. You do this by using the + PiePLot::SetLabels() method. This will let you specify individual + text strings for each label. In each specification you can also add a + printf() formatting specification for a number. The number passed on + will be either the absolute value for the slice or the percentage value + depending on what was specified in the call to + SetLabelType()
+The SetLabels() method can also take a second parameter, the label + position parameter. This is just a shortcut to the SetLabelPos() as + described above. By default the position will be set to 'auto' if not + explicitely specified.
Another typical change would be to change the colors of the slices. + There are two fundamental ways of doing this. You either manually + specify the colors for the slices as an array using the method + SetSliceColors() If you specify fewer colors than the number of + slices they will just wrap around.
+Another way is to use one of the pre-defined color "themes". This is + just a predefined set of colors that will be used for the slices. You + choose what "theme" you like to use with the method ( + SetTheme() ) At the time of this writing the available themes are
+The following example shows the same pie using the different + "themes" in order.
+ + + + +A complete color chart of all available colors in the different + themes can be found here
+Another simple change is to remove the border ( or change it's + colors ) that separates each slice. This can be done by a call to + ShowBorder()
+These types of bar graph is used to easy group two or more bars + together around each tick (X-value). The bars will be placed + immediately beside each other and as a group centered on each tick + mark. A grouped bar is created by aggregating two or more ordinary bar + graphs and creating a + GroupBarPlot() From two ordinary bar graphs along the lines of
+// Create the bar plots
+
$b1plot
+= new BarPlot($data1y);
+
$b1plot->SetFillColor(
+"orange");
+
+
$b2plot
+= new BarPlot($data2y);
+
$b2plot->SetFillColor(
+"blue");
+
+
// Create the grouped bar plot
+
$gbplot
+= new GroupBarPlot
+(array($b1plot
+,$b2plot));
+
+
// ...and add it to the graPH
+
$graph->Add(
+$gbplot);
+
The following example illustrates this type of graph
+There is no limit on the number of plots you may group together.
+If you use the SetWidth() method on the GroupBarPlot() this will + affect the total width used by all the added plots. Each individual bar + width will be the same for all added bars. The default width for + grouped bar is 70%.
+Setting the grouped with to 0.9 would result in the image below.
+ +An additional visual enhancements can be made by adding a drop + shadow to the individual slices. This is accomplished by means of the PiePlot::SetShadow() + method. Adding a drop shadow is often more affective if the pie has one + or more slices exploded as the following example shows
+ +The final variety of group bars you can have are accumulated bars. + They work in much the same way as accumulated line plots described + above. Each plot is stacked on top of each other.
+You create accumulated bar plots in the same way as grouped bar + plots by first creating a number of ordinary bar plots that are then + aggregated with a call to + AccBarPlot();
+An example makes this clear. Let's use the same data as in the two + examples above but instead of grouping the bars we accumulate (or + stack) them. The code would be very similar (actually only one line has + to change)
+ +As mentioned in the beginning there are two versions of the 2D pie + plots. The normal pie plot created as an instance of + class PiePlot and a variant created as an instance of + class PiePlotC
+This variant is an extension of the standard PiePlot in the sense + that it also have a filled circle in the center. The following example + illustrates this
+ + +Since the PiePlotC is an extension to the basic pie plot all the + normal formatting you can do for pie plots you can also do for the + PiePlotC .
+The additional formatting only concerns the filled middle circle. + You have the option of adjusting size, fill color and all font + properties. You perform these operations with the methods
+ ++PiePlotC::SetMidColor() | Set fill color of mid circle |
+PiePlotC::SetMidSize() | Set size (fraction of radius) |
+PiePlotC::SetMidTitle() | Set title string (may be + multi-lined) |
+PiePlotC::SetMid() | Set all parameters in a single method + call |
In addition to the normal CSIM for PiePlot:s the center area is also + a CSIM hotspot. You specify the target CSIM with a call to + PiePlotC::SetMidCSIM()
+The next example shows an example with some more innovative + formatting. In this example we have :
+It is perfectly possible to combine the previous bar types to have + grouped accumulated bar plots. This is done by just adding the + different accumulated plots to a group bar plot, for example the + following code would do that.
+
+// Create all the 4 bar plots
+
$b1plot
+= new BarPlot($data1y);
+
$b1plot->SetFillColor(
+"orange");
+
$b2plot
+= new BarPlot($data2y);
+
$b2plot->SetFillColor(
+"blue");
+
$b3plot
+= new BarPlot($data3y);
+
$b3plot->SetFillColor(
+"green");
+
$b4plot
+= new BarPlot($data4y);
+
$b4plot->SetFillColor(
+"brown");
+
+
// Create the accumulated bar plots
+
$ab1plot
+= new AccBarPlot
+(array($b1plot
+,$b2plot));
+
$ab2plot
+= new AccBarPlot
+(array($b3plot
+,$b4plot));
+
+
// Create the grouped bar plot
+
$gbplot
+= new GroupBarPlot
+(array($ab1plot
+,$ab2plot));
+
+
// ...and add it to the graph
+
$graph->Add(
+$gbplot);
+
Putting this together in an example would then produce the graph as + shown below
+ +It can often come in handy to have horizontal bar graphs especially + if you have a large number of values to display. Even though JpGraph + doesn't directly support horizontal bar graphs this is easy achieved by + constructing a normal vertical bar graph which is then rotated 90 + degrees.
+The example below shows a simple example of this
+ +In order to achieve this effect you should study the above example + carefully and you might notice two things
+We finally show three more examples of horizontal bar plots. In the + first plot we have hidden the Y-axis and in the second we have + positioned the Y - axis at top as opposed to the bottom as the first + example shows.
+ + + +In the final example which is almost similar to the two first we + illustrate the use of labels with more than one line.
It is possible to use color gradient fill for the individual bars in + the bar graph.
+Color gradient fill fills a rectangle with a smooth transition + between two colors. In what direction the transition goes (from left to + right, down and up, from the middle and out etc) is determined by the + style of the gradient fill. JpGraph currently supports 8 different + styles. All supported styles are displayed in the figure below.
+ + + + + + + + +To specify a gradient fill for the bar plots you make use of the + method + BarPlot::SetFillGradient() . See the class reference for details of + this function.
+When using gradient fills there are a couple of caveats you should + be aware of:
+Jpgraph also supports 2D vertical bar plots. Before you can use any + bar plots you must make sure that you included the file + "jpgraph_bar.php" in your script.
+Using bar plots is quite straightforward and works in much the same + way as line plots which you are already familiar with from the previous + examples. Assuming you have a data array consisting of the values + [12,8,19,3,10,5] and you want to display them as a bar plot. This is + the simplest way to do this:
+ $datay=array(12,
+8,19,3
+,10,5);
+
$bplot
+= new BarPlot($datay);
+
$graph->Add(
+$bplot);
+
If you compare this to the previous line examples you can see that + the only change necessary was that instead of creating a new line plot + (via the new LinePlot(...) call) we used the statement new + BarPplot().
+The other change we should do is to make sure the X-axis have an + text-scale (it is perfectly fine to use a linear X-scale but in most + cases this is not the effect you want when you use a bar graph, see + more below). With this two simple change we will now get a bar graph as + displayed in the following image + + You can of course modify the appearance of the bar graph. So for + example to change the fill color you would use the + BarPlot::SetFillColor() method. Making this small change to the + previous example would give the expected effect as can be seen in the + next example. + +
So far we have just show plots based on an X-Y coordinate system. + This is not the only types of graphs you can create with JpGraph. + Another common type is Pie plots. JpGraph supports both 2D and 3D pie + plots. For 2D pie plots there are also 2 versions, but more on that + later.
+The main difference as compared to the X-Y plots is that to all pie + plots are added to the + PieGraph() instead of the Graph() object we used for the X-Y graphs + we have drawn so far. For this you must first include the + "jpgraph_pie.php" in your script (or "jpgraph_pie3d.php" if you want to + use 3-dimensional pies).
+Below you cane see the code needed to create the simplest possible + pie graph just using the default settings.
+
+ include (
+"../jpgraph.php");
+
include ("../jpgraph_pie.php");
+
+
$data
+= array(40,60,
+21,33);
+
+
$graph
+= new PieGraph
+(300,200);
+
$graph->SetShadow();
+
+
$graph->title->
+Set(
+"A simple Pie plot");
+
+
$p1 = new PiePlot(
+$data);
+
$graph->Add(
+$p1);
+
$graph->Stroke();
+
The above code would give the following pie graph
+There is a few things worth noting here
+You can change almost all aspects of appearance of the pie graphs. + For example you could change :
+The next simplest addition we can do is to add a legend to the pie + graph. We do this by using the + SetLegends(); method. By adding the legends to the previous example + we get the following image
+ +(In the figure above we also moved the center of the pie slightly to + the left to make more room for the legend box.)
+The text for the legends can also contain printf() style format + strings to format a number. This number passed on into this string is + either the absolute value of the slice or the percentage value. How to + switch between the is describe further down in this chapter.
+The next change you might want to change is the size and position of + the Pie plot. You can change the size with a call to + SetSize(); and the position of the center of the pie plot with a + call to SetCenter(); + The size can be specified as either an absolute size in pixels or as a + fraction of width/height (whatever is the smallest). The position of + the pie plot is specified as a fraction of the width and height.
+To put the size and positioning API to use we will show how to put + several pie plots on the same pie graph. In the following example we + have also adjusted the legends of the slice values to use a smaller + font.
+What we do in this example is quite simple, create 4 pie plots, make + them smaller and put them in the four corner of the graph. This will + give the result as shown in the following example.
+ +Each data point in a polar plot is represented by a tuple consisting + of a radius and an angle. The polar plot itself can be either outlined + or filled. In addition each point may have a standard marker (the same + as for line and scatter plots).
+The scale for the radius can be either linear or logarithmic.
+A polar graph is created by creating an instance of +PolarGraph::PolarGraph(). The polar graph type inherits all the + capabilities of ordinary X-Y graphs, i.e they can have background + images, background gradients, tabbed titles and so on.
+Polar graphs comes in two basic types, they can either show a full + 360 degree graph or a half 180 degree graph. The two examples below + show these two basic types of graphs.
+ + + +A line error plot is an error plot with the addition that a line is + drawn between the average value of each error pair. You use this type + of plot the exact same way you would use an error plot. The only change + is that you must instantiated an + ErrorLinePlot() instead and make sure you have included the + "jpgraph_line.php" since the line error plot makes use of the line plot + class to stroke the line.
+To control the various properties of the line drawn the "line" + property of the error line plot may be accessed. So, for example, if + you want the line to be 2 pixels wide and blue you would have to add + the following two lines
+ $elplot->line->
+SetWeight(2);
+
$elplot->line->
+SetColor(
+"blue");
+
to generate the graph as shown below
+You may of course add legends to none, one or both of the line types + in the above graph. So for example if we wanted the legend "Min/Max" + for the red error bars and a legend "Average" for the blue line you + would have to add the lines
+ $errplot->SetLegend(
+"Min/Max");
+
$errplot->line->
+SetLegend(
+"Average");
+
The resulting graph will now look like (note that we are using the + default placement of the legend box)
+ +The radius axis can be shown in either a linear or logarithmic + scale. This is controlled, as usual, by a call to +PolarGraph::SetScale() The two examples below show the same plot in + either linear or logarithmic scale
+ + + + +Please note that the maximum values of the scales are different.
+By default the scale will be auto scaled depending on the data. You + can also specify a manual scale by supplying an extra argument to the + SetScale() value. The only difference from the manual scaling with the + other X-Y-graphs is that for polar graph you only specify a manual + maximum. The minimum will always be 0 for the linear scale and a scaled + value of 10 (i.e 1, 0.1, 0.001 and so on) for the logarithmic scale.
+The plot is clipped to the plot area so if you specify a smaller + scale then the maximum value that part of the plot that are outside the + plot area will be clipped.
+As usual you have full freedom to select what grid lines you like to + show (and what colors they should have). There are three different + types of grid lines you may adjust. The radius minor and major grid + lines and the angle grid lines.
+You select what grid lines to show with a call to +PolarAxis::ShowGrid() The two example below shows a logarithmic plot + with either just major grid lines or both minor and major grid lines.
+ + + +The colors of the grid lines are specified with a call to + PolarAxis::SetGridColor()
+For the angle grid lines it is possible to specify the angle + division between each grid line with the method + PolarAxis::SetAngleStep() You specify the step distance in degrees. + By default the step size is 15 degrees.
+You can individually specify different fonts and colors for the + angle and the radius labels. The radius font is specified with + PolarAxis::SetFont() and the angle font is specified with a call to + PolarAxis::SetAngleFont()
+You can adjust the color with the method +PolarAxis::SetColor() ?>
+The following example specifies different color for the labels. it + also shows that you can add both a radial axis title as well as a + tabbed title. In this example we have also chosen not to show the frame + around the edge of the plot.
+As can be seen from the previous examples the angle labels have a + small superscripted "o" after each label. You can select if you like to + show this degree mark or not with a call to the + PolarAxis::SetANgleDegreeMark() method by which you can enable or + disable that mark after the angels.
+For the radius labels all standard formatting that can be done to + the X-Y axis such as format string or format callbacks are supported.
+A common modification for polar plots is probably to disable the + display the last label when using a 360 degree plot since the last + label will "collide" with the plot box around the plot area. It is + possible to disable the last label with a call to +Axis::HideLastTickLabel() As you can see this has been used in some + of the examples in this chapter.
+If you have specified markers for the polar plot (by setting the + mark property of the plot) each marker can be a hot spot in a client + side image map. The target URL are as usual specified with the + SetCSIMTargets() as the following short code excerpt shows
+// Start by specifying the proper URL targets
+
$targets
+= array("#1","#2", ....... );
+
$polarplot
+= new PoalrPlot
+($data);
+
$polarplot
+->mark->SetType(
+MARK_SQUARE);
+
$polarplot
+->SetCSIMTargets
+(targets);
+
$graph->Add(
+$polarplot);
+
$graph->StrokeCSIM();
+
As a final example we show a full 360 degree polar plot with square + markers as well as background color gradient and a legend for the plot.
+ +Error plots are used to visually indicate uncertainty in data + points. This is done by for each X value by giving both a minimum and a + maximum Y-value.
+Before you can use error plots you must remember to include the file + "jpgraph_error.php" in your script.
+The following example illustrates a simple error bar. We will have 5 + points, so we need 10 Y-values. We also would like the error bars to be + red and 2 pixels wide. All this is accomplished by creating an + ErrorPlot() in much the same way as, for example, a normal line + plot. Doing this would now give the example shown below.
+ +You might notice that there is one displeasing esthetic quality of + this graph. The X-scale is just wide enough to just accompany the + number of error bars and hence the first bar is drawn on the Y-axis and + the and last bar just at the edge of the plot area. To adjust this you + might call the SetCenter() + method which will adjust the X-scale so it does not use the full width + of the X-axis.
+The following example illustrates the use of this feature by + applying this technique to the previous example
+ +Scatter plots are very simple; they plot a number of points + specified by their X- and Y-coordinate. Each point is stroked on the + image with a mark as with line plots. The stroked marks can also be + connected with an optional line.
Even though you would normally supply X-coordinates it is still + perfectly possible to use a text-scale for X-coordinates to just + enumerate the points. This is especially useful when using the + "Impulse" type of scatter plot as is shown below.
+Scatter pots are created by including the jpgraph extension + "jpgraph_scatter.php" and then creating an instance of plot type of + ScatterPlot(). To specify the mark you want to use you access the mark + with the instance variable "mark" in the scatter plot. The default is + to use an unfilled small circle.
+To create a scatter plot you will create an instance
+A simple example using just default values will illustrate this
+ +We can easily adjust the size and colors for the markers to get + another effect as shown below
+Another possible variant of scatter plot is impulse-scatter plots. + This is a variant of normal scatter plot where each mark have a line + from the mark to the Y=0 base line. To change a scatter plot into an + impulse scatter plot you have to call the method + SetImpuls() on the scatter plot.
+This type of plots are often used to illustrate signals in + conjunction with digital signal processing. The following two examples + illustrates simple use of impulse plots.
+The next example shows how to modify the color and width of the + impulse plot
+As a final touch we show two more advanced impulse graphs . In these + graphs we have used more advanced formatting for the Y-axis labels as + well as adjusted the position of the axis position.
A variant of scatter plot is the so called Field Plots this + is basically a scatter plot where each scatter point is an arrow with a + direction between 0 to 359 degrees. This effectively allows the + visualization of 3 parameters at each point (x,y,angle). As an + additional bonus there is also possible to define a callback for each + scatter plot to also define the color for each point.
+To create a field plot you create an instance of +FieldPlot in the same way as you created a normal scatter plot. The + arguments to this method are Y-coordinate, X-coordinate and angle. To + specify a callback you use +FieldPlot::SetCallback()
+The following example (and code) illustrates the usage of the field + plot type.
+ +In addition to the parameters mentioned above you can also adjust + both the general size of the arrow and also the specific size of the + arrowhead. The arrow size is specified in pixels and the arrow head is + specified as an integers between 0 and 10. These sizes are specified + with a call to +FieldPlot::arrow::SetSize()
+Stock charts is used to display data values where one is interested + in 4 different values for each data point. This could for example be + used to display a stocks open,close, min and max value during a + specific day. Hence the name Stock chart (or Stock plot).
+The figure below illustrates a sample Stock chart plot
+For this type of plot the Y-data array must be consist of a number + of quadruples of data where each quadruple consists of + (open,close,min,max). The open and close values determine the min max + for the middle bar and the min,max determine the end points of the + "error-lines" at the top and bottom of of each bar.
+Note that the data follows the following rules
+To separate the two cases where "open > close" or "open < close " + different colors are used. These colors are specified with the +SetColor() method. By default a positive bar (close > open) have a + fill color of white and for the negative case where (close < open) the + bars have a red color.
+You can specify the width of the bar by setting the width (in + pixels) with a call to the method +SetWidth()
+The final variation of stock plots you can have is to determine + whether or not the end point for the min,max lines should have the + horizontal line marking the end of the line or not. This can be + adjusted with a call to method +HideEndLine().
+A minor variation of stock charts is the "BoxPlot()" this is almost + the same as StockPlot() but with the very small difference that in + addition to the open,close,min, max values you also specify a median + value . The median lies between the open and close value and is + illustrated as a horizontal line within the bar.
+You may modify the median line color for positive and negative data + points / bars by using the +SetMedianColor() method.
+In the same way as for other plots you may associate an image map + with these plots. The "hot" area for each plot is the mid "bar" + section. In the same way as other plot types you use the + SetCSIMTargets() to set the URLs you want to use.
+These plot types, though normally used without explicit X-values, + can of course handle a supplied X-coordinate array without any problem.
+JpGraph offers two variation on what is usually known as stock + charts, candle-charts or box plot.
+It is perfectly legal to add several different plot types to the + same graph. It is therefore possible to mix line plots with (for + example) filled bar graphs. What you should keep in mind doing this is + the order in which these plots are stroked to the image since a later + stroke will overwrite a previous one. All plots are stroked in the + order you add them, i.e. the first plot added will be stroked first. + You can therefore control which plot is placed in the background and + which one is placed in the foreground by the order you add them to the + plot.
+To start simple we just mix a filled line plot with a non-filled + line plot as the following example shows.
+ + +Let's now go to something a little bit more complicated. How to mix + bar and line graphs. Let's just take one of our previous bar graphs and + add a line plot to it and see what happens.
+ +Not too bad. But we can't see the line so we change the order in + which we add the lines to the graph and sees what happens.
+ +If you want the line points to be aligned in the center of the bars + you can accomplish this is two ways.
+If you use a text scale then you need to call the + LinePlot::SetBarCenter()
You can also use an integer scale. This places both + the bar and the line points centered at the tick marks. As the + following example will show
+ +As a final example we show how you can combine a scatter plot and a + line plot which could be used to illustrate a regression line fitting.
+ +Normally the automatic scaling should be doing an adequate job in + most circumstances but there might be cases where you like to manually + set the scale. For example if you have several graphs where you like to + be able to easily compare them and therefore want them all to have the + same scale.
+To specify a manual scale you have to add arguments to the standard Graph::SetScale() method. + So to specify that you want an Y-scale between 0 and 100 you need to + write
+ $graph->
+SetScale(
+"textlin",0,100
+);
When you specify a scale manually there is one additional thing you + need to decide. How the tick marks should be positioned. You have three + choices
+
+ $graph->SetScale(
+"textlin",0,100
+);
+
$graph->yscale->
+ticks->Set(10
+,5);
Will set the major tick marks every at 0,10,20,.. And every minor + tick mark in between (0,5,10,15,20,25,...).
+The three images below illustrates the difference between the + possibilities of ticks for a manual scale.
+ + + + + +You can adjust the automatic tick marks by telling JpGraph how dense + you want them to be. You use the + Graph::SetTickDensity() method. You can set the density setting in + four steps
+Taking the previous example with the manual scale but automatic + ticks and using a denser ticks setting gives the following result
+ +Non X,Y plots includes
+The fundamental difference is that these classes makes use of an + extended version of the basic Graph class. Therefor you can not mix X,Y + plots with non-X,Y plots. For example it is not possible to mix a line + graph with a Polar graph.
+The purpose of this chapter is to introduce the basic concepts of + creating scripts with JpGraph that will generate various types of basic + plots. Throughout the text it is possible to view the exact source for + all the graphs by clicking on the "[src]" link in the caption of the + image shown. This will open the image together with the source in a + separate window. This way it is easy to compare the actual image with + the script that generated the image.
+It is common to group activities. We have used this feature in the + examples of constrains. There is no special type for activity bars that + are used to illustrate grouping. The common way of illustrating this + (as have been used above) is to add "half" a triangle marker at both + ends of the bar. The special provision that JpGraph does is that if you + add a left or right marker of type MARK_LEFTTRIANGLE or + MARK_RIGHTTRIANGLE those triangles will be drawn under the bars to give + the effect as show in the examples above. In the example above we also + have made the grouping bars have slightly less heigh since the end + triangles will visually "grow" the bar.
+So to get the effect we want for a group bar we have to use the two + lines:
+ $groupbar->
+leftMark->
+SetType(
+"MARK_LEFTTRIANGLE");
+
$groupbar
+->rightMark->SetType(
+"MARK_RIGHTTRIANGLE")
+
As of the current version There is not yet any formatting support to + accomplish the effect of indentation for the titles so this is + accomplished by using a fixed width font and adding spaces in front of + the title.
+Precisely as before you can also have a title spanning all the + columns. This title is specified with the property tableTitle of + the scale. Specifying a table title will automatically adjust the + height of the column titles to fit the table title. The small code + snippet below shows how to add a title.
$graph
+->scale->tableTitle->
+Set('Phase 1');
+
$graph->scale->
+tableTitle->
+SetFont(
+FF_ARIAL,
+FS_NORMAL,12);
+
$graph->scale->
+SetTableTitleBackground(
+'darkgreen@0.6');
+
$graph->scale->
+tableTitle->
+Show(true);
A full example of this is shown below
+ +In exactly the same way as for a single title it is possible to + specify individual CSIM targets for each of the title columns. This is + accomplished by specifying an array for both the target and the alt + text instead of a single string as arguments for SetCSIMTarget() + The following code snippet shows how to specify that.
$bar
+->title->SetCSIMTarget(array('sometarget1.html','sometarget1.html'),
+
array('alttext1'
+,'alttext2'));
Let's start by creating a very simple radar plot based on 5 data + points using mostly default values.
+As the first thing you must remember to include the extension module + that contains the radar plot. "jpgraph_radar.php".
+A very simple radar plot is created by the code
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_radar.php");
+
+
// Some data to plot
+
$data
+= array(55,80,
+46,71,95
+);
+
+
// Create the graph and the plot
+
$graph
+= new RadarGraph
+(250,200,
+"auto");
+
$plot
+= new RadarPlot
+($data);
+
+
// Add the plot and display the graph
+
$graph->Add(
+$plot);
+
$graph->Stroke();
+
?>
and would give the result
+To change the size and position of the radar graph is similar to the + pie plot and you do it by using the methods + SetSize() and + SetCenter()
+If you want a filled radar plot you need to specify the fill color + with the method + SetFillColor() The following example shows these methods in action
+ +It is often of interest not only to show one title for a gantt bar + but often one wants to show, title, start date, end date, duration or + effort and so on. Up until now we have, to keep things simple only + shown a single title for each activity. We will now show you how you + can specify an arbitrary number of columns as titles for a Gantt chart + as well as adding icons in the graph columns.
+First out is an example to help visualize what we will achieve
+To use multiple columns there is two steps. First you need to set + the titles (name, color, fonts etc). Thereafter you need to add the + title columns for each individual bar.
+To set the columns you will have to work with the Activity + information property of the scale. The following code excerpt show + this
+ $graph->scale->actinfo
+->SetColTitles
+(
+
array('Note'
+,'Task','Duration',
+'Start',
+'Finish'),array(
+30,100));
You will notice two things. We fist specify the titles using an + array. We have also specified a second array with the numbers 30 and + 100. This is an optional array that specifies the minimum width of, in + this case, the first two columns. By default the columns will be wide + enough to hold the widest text string in the column. However for + esthetic reasons you might sometimes want to increase the minium width. + This is what we have done here for the first two columns.
+Furthermore you can also adjust the background colors and the style + and colors of the vertical dividing grid lines. In the previous image + we used the lines
$graph->
+scale->actinfo->SetBackgroundColor('green:0.5@0.5');
+
$graph->scale->
+actinfo->
+SetFont(
+FF_ARIAL,
+FS_NORMAL,10);
+
$graph->scale->
+actinfo->vgrid->SetStyle
+('solid');
+
$graph->scale->
+actinfo->vgrid->SetColor
+('gray');
The style for the grid lines can also be "dashed", "dotted" or + "longdashed" as in other line formatting contexts within the library. + You can also adjust if you would like the small "3D" effect in the + titles. By default this is enabled. You can easily turn this of with a + call to
+ $graph->scale->actinfo
+->SetStyle(ACTINFO_2D);
+
To adjust the colors of the vertical dividing lines in the title the + method SetColor() is used as in + "$graph->scale->actinfo->SetColor('navy');".
+The second thins is to actually populate the columns. This is done + (of course) as you add the activity bars to the graph. Previous we just + used a string as the title when we wasn't using columns. By simply + replacing this string with an array we specify the content of the + columns.
+For example to specify two column titles we just create a + hypothetical Gantt bar as In the full example above we put all this in + arrays to make for better coding practice since we create several bars.
+In addition to ordinary text you can also add an image or any of the + predefined icons available. In order to add that in a column you first + create an instance of IconImage() and then specify that instance + instead of the text. So in the previous code snippet if we wanted a + "open folder" image in the first column we would change the lines to
+ $iconopen = new
+IconImage(
+GICON_FOLDEROPEN,
+0.6);
+
$title2="";
+
$bar
+= new GanttBar
+(0,array($iconopen,
+$title2),
+"2003-11-23",
+"2003-12-05");
+
The available builtin icons are
+In addition you can also use any of you own images if you specify + the argument as a string, for example
+ $myicon = IconImage(
+'myicon.png');
+
If you wonder, the second argument in the IconImage() call is + an optional scaling factor which you can use to adjust the size of the + image.
+The (default) white area in the top left of the gantt table may have + a title. This is accessed by the 'tableTitle' property of the gantt + scale. Using this is straightforward as the following lines show.
$graph
+->scale->tableTitle->
+Set(
+"(Rev: 1.22)");
+
$graph->scale->
+tableTitle->
+SetFont(
+FF_FONT1,
+FS_BOLD);
+
$graph->scale->
+SetTableTitleBackground(
+"silver");
+
$graph->scale->
+tableTitle->
+Show();
+
The example lines above also changes the default white background to + silver. Adding these lines to the previous example gives the following + result:
+From the above example you might notice that the width of the left + column (which holds all the titles) have automatically adjusted itself + to make the table title fit.
+The vertical and horizontal lines between the titles and the bars + can be modified by accessing the 'divider' and 'dividerh' properties of + the scale. Again, this is straightforward as the following example + shows:
+ $graph->scale->divider
+->SetWeight(3);
+
$graph->scale->
+divider->
+SetColor(
+"navy");
+
$graph->scale->
+dividerh->
+SetWeight(3);
+
$graph->scale->
+dividerh->
+SetColor(
+"navy");
+
The effect of this is shown in Figure 167 below
+ +In a similar manner to the other plots in JpGraph you modify the Box + round the plot with the standard graph method 'SetBox()' as in
$graph
+->SetBox(true,
+"navy",3)
which will result in a thicker plot box around the area as shown + below
+In order to make large charts easier to read it is possible to + specify alternating an horizontal grid and optional alternating line + colors in the background for Gantt charts. The horizontal grid is + accessed through the Graph::hgrid property and the line (used in + the grid) is accessed through the Graph::hgrid::line + sub-property
+In order to specify the alternating line colors the + SetRowFillColor() method is used. For example, to use alternating + blue background with blue grid line the following lines would have to + be added to the graph script
+
+// Setup a horizontal grid
+
$graph->hgrid->
+Show();
+
$graph->hgrid->
+line->SetColor('lightblue'
+);
+
$graph->hgrid->
+SetRowFillColor(
+'darkblue@0.9');
+
Below is an example of a Gantt graph using this formatting
+ +
+ $icon = new IconPlot(
+'penguin.png',
+0.01,0.95,1
+,15);
+
$icon->SetAnchor(
+'left',
+'bottom');
+
$graph->Add(
+$icon);
+
$graph
+= new GanttGraph
+(500);
+
$graph->SetMargin(
+0,0,30
+,0);
In this section we will show a few more way by which you may + customize the gantt chart itself. This includes
+We normally would like something more meaningful as description of + each axis than it's number. Specifying the titles are accomplished + through the use of the method SetTitles() of the graph. Let's say that + each axis corresponds to a month. We could then use the code
$titles
+= $gDateLocale
+->GetShortMonth
+();
+
$graph->SetTitles(
+$titles);
+
As you can see the way radar plot is constructed will assign the + titles (and plot points) in a counter-clockwise direction. If you want + them in clock-wise order you will have to inverse your input data array + as well as the title array.
+To specify a legend you (as with the other plot) make use of the + SetLegend(); method on each radar plot.
+Each major tick mark can also be connected together to create a + grid. The grid is accessed through the 'grid' property of the graph. To + enable the grid and set the line style to "dotted" you would have to + add the lines
+ $graph->grid->Show
+();
+
$graph->grid->
+SetLineStyle(
+"dotted");
+
and would result in the following graph
+By design the plot is above the grid line but beneath the axis in + image depth, hence some part of the grid lines are hidden.
+To have the grid lines more "visible" just change their color, say + to, dark red by invoking the SetColor() method on the grid lines which + would give the following result
+Another simple change we could do would be to just change the + background color of the radar graph. This is (not surprisingly) done by + a call to the method SetColor() invoked on the graph object.
+ +As we have shown in the previous examples constructing a Gantt chart + consists of a number of repetitive tasks; Create the individual + activity bars and add them to the graph.
+Now when you have a basic understanding of how this works you are + ready to appreciate a small helper method. +GanttGraph::CreateSimple(). This method takes a few arrays of data + which specifies you Gantt chart and then constructs this chart. By + using this method you sacrifices a few adjustment possibilities for + simplicity. This method is nothing magical it just takes the data for + the activities,(start and end date, titles, progress, any constrains + and so on) and constructs the activities and adds them to the graph.
+The activities are specified in data array which for each activity + have the following fields
+So for example to create a Gantt chart consisting of two activities + which are grouped and a milestone one would have to use something + similar to the following code
+
+ $data = array(
+
array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26",
+"2001-11-23",
+""),
+
array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26",
+"2001-11-13",
+"[KJ]"),
+
array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20",
+"2001-11-22",
+"[EP]"),
+
array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",
+"M2") );
+
+
// Create the basic graph
+
$graph
+= new GanttGraph
+();
+
$graph->title->
+Set(
+"Gantt Graph using CreateSimple()");
+
+
// Setup scale
+
$graph->ShowHeaders(
+GANTT_HYEAR |
+GANTT_HMONTH |
+GANTT_HDAY |
+GANTT_HWEEK);
+
$graph->scale->
+week->SetStyle(WEEKSTYLE_FIRSTDAY);
+
+
// Add the specified activities
+
$graph->CreateSimple(
+$data);
+
+
// .. and stroke the graph
+
$graph->Stroke();
+
This will then show up as
+You may (slightly) modify the appearance of the simple Gantt charts + by means of the methods GanttGraph::SetSimpleFont() and GanttGraph::SetSimpleStyle() But not anything else, remember + that the purpose with this way of constructing graphs is to be simple. + If you need full advanced control you have to construct all the + activities in the "normal" way.
+You can also specify constrains and progress for each bar by + supplying additional data arrays to GanttGraph::CreateSimple().
+Gantt charts can have independent (different targets) hot spots in + both the activities and in the associated labels for each activity.
+You specify the target and the associated "Alt" text for an activity + bar by calling the + GanttBar::SetCSIMTarget() and + GanttBar::SetCSIMAlt()
+In a similar way you set the target and Alt texts for the activity + title as the following code extract shows.
$bar
+->SetCSIMTarget
+("http://localhost/abc/"
+);
+
$bar->SetCSIMAlt(
+"Alt Text for the bar");
+
$bar->title->
+SetCSIMTarget(
+"http://localhost/abc");
+
$bar->title->
+SetCSIMAlt(
+"Alt Text for the title");
+
The above code assumes that your activity is available in the + variable 'bar'. In the example directory there is a complete example of + how to use CSIM together with Gantt charts in the "ganttcsimex1.php" + file. (Please note that this example makes use of the simplified Gantt + chart specification using the CreateSimple() method.
+You can easily create several radar plot which are added to the same + radar graph. The thing to remember is that if you use filled radar + plots and they overlap each other that the order which they are added + will be the order they are drawn.
+A simple example of this is shown below
+ +With Gantt charts there is often the need to illustrate constrains + between one or several activities. One of the most common constrain is + that on activity can't start before an other activity finish.
+JpGraph support visualizing the following types of constrains
+An example will clarify how to specify a constrain between two + activities.
+Assume that we start with the Gantt schema as illustrated below
+We would now like to add the constrains that the activity "Label 3" + cant start before activity "Label 2" has finished and that the + milestone "Phase 1 done" is depending on when activity "Label 3" is + done.
+The principle of adding constrains is that you for each activity you + want to have a constrain you have to tell to what other activity this + constrain should be to. That other activity is specified by telling on + what row that activity lies. Depending on what type of constrain, e.g. + Start-to-End, an arrow will now connect the two activities in correct + way.
+The way to do this is to call the + SetConstrain() method on the activity. In this method you specify + the type of constrain as well as to what other activity this constrain + should be to. If you read the class reference you can also see that you + can specify the type and size of arrow used. For now we will just use + the default sizes and type.
+So for example to add an End-To-Start constrain between "Label 2" + and "Label 3" you could write
+ $bar2->
+SetConstrain(2,CONSTRAIN_ENDSTART)
The first parameter in the call above "2" is the row of the target + activity (i.e. the row where "Label 3") activity is. In the example + below we have added the constrains we wanted.
+A note: The actual path followed by the arrow is controlled by some + heuristics to make it clear what the constrain is. It has been a design + decision that in order to keep the API simple the user has no further + detailed controlled on the actual path followed. However, in future + version the heuristics may be extended and provide some + user-controllable parameters.
+In exactly the same way as for line graphs it is possible to add + plot marks in radar plots. The mark property is accessed through the + RadarPlot::mark The example below adds a red ball as a marker.
+ +You can choose to only display a vertical slice of the overall Gantt + chart by explicitly specifying a date range with the method + GanttGraph::SetDateRange(). This will cap any bars to only be displayed + in between the start and end date given as parameters. For example + specifying
+ $graph->
+SetDateRange(
+"2001-12-20",
+"2002-01-20");
+
will show the part of the Gantt chart between the 20 Dec 2001 and 20 + of January 2002. Please note that the format depends on the locale + setting.
+You can set the week start day with a call to + GanttScale::SetWeekStart(). This method takes an integer [0,6] as input + which represents the start day of the week, 0 means Sunday, 1 Monday, 2 + Tuesday and so on. The default is to start the week on Monday.
+Depending on your installation of PHP you might have support for + several locales. By default the locale is set up to use the default + locale on the server.
+To specifically set a locale you specify the wanted locale with a + locale string (ala standard PHP), for example American English is + specified with the string 'EN_US', British English with 'EN_UK' 'nl_NL' + for Dutch and so on. If your current installation does not support the + specified locale an error message will be given.
+ $graph
+->scale->SetDateLocale(
+"se_SE");
+
The result is displayed below.
+ +Anti-aliased lines are enabled by calling the method + SetAntiAliasing() in the + Image class in the script where you want to use anti-aliasing.
+The anti-aliasing for lines works by "smoothing" out the edges on + the line by using a progressive scale of colors interpolated between + the background color and the line color.
+An example will show that this, quite simple algorithm, gives a + reasonable good result. The figures below shows a radar plot with and + without anti-aliasing.
+ + + + +One thing you need to keep in mind when deciding to use + anti-aliasing is that it could have potentially a dramatic effect on + the time it takes to generate the image. Line drawing with + anti-aliasing turned on is roughly 8 times slower than the normal line + drawing so treat this feature wisely.
+Furthermore there are a couple of "gotchas" you should be aware of + when using anti-aliasing.
+From version 1.2 JpGraph supports drawing of anti-aliased lines. + There are a few caveats in order to use this which is discussed in this + section.
+JpGraph provide the possibility for you to rotate the generated + graph an arbitrary angle. This will only affect the actual graph (axis, + axis titles, labels and so on) and not fixed elements on the graph like + title or footer.
+Rotation is probably most used to rotate a graph 90 degrees, for + example a bar graph to get the effect of horizontal bars.
+ +Performance note: Adding a rotation transformation + will make the graph generation slightly slower since each point of the + graph as to go through a transformation step before being stroked on to + the image. JpGraph optimizes this by using a pre-calculated + transformation matric and also optimizes the special case 90 degrees.
+ +By default the center of the rotation will be the center of the plot + area, which may or may not coincide with the center of the entire + image.
+To control the rotation you use the two methods
+For example
+ $graph->image->SetAngle
+(45);
There is actually a third method that you could use, adding a + translation to the graph after the rotation. Since + this probably a very little used method we don't discuss it further but + refer the reader to the class reference instead + Graph:image::SetTranslation()
+ When you rotate an image you should be aware of that the individual
+ labels on the axis are not rotated. The design decision behind this is
+
a) Bit mapped font can't be rotated
+
b) Maintain readability
Please remember that you may still rotate the labels by calling the Axis::SetLabelAngle() + method.
+Since the anchor point for labels is by default the optimum for + graph at 0 degree you might want to adjust the anchor point and + alignment for the labels on the axis to get a better visual appearance + on you rotated graph. This is accomplished by the method + Axis::SetLabelAlign() For a detailed discussion on how to do this + please see the section on horizontal bar graphs, ( +Working with bar plots )
+The table below shows some examples on different kinds of rotation + to give you an idea of how changing the angle and rotation center may + be used to generate different effects. The top left graph is the + original image. The point of rotation has been marked with a red-cross + in each of the images.
+ + + + + + + +As you can see from the images above if you rotate about any other + point than the center of the plot area the plot can be placed outside + the image after rotation.
+Since the rotation, by design, only affects the plot area it is + often most effective to use when the color of the margin is the same as + the background color.
+Spider plots are most often used to display how a number of results + compare to some set targets. They make good use of the human ability to + spot symmetry (or rather un-symmetry) . the figure below show an + example of a spider (sometimes called a web-plot). Spiderplots are not + suitable if you want very accurate readings from the graph since, by + it's nature, it can be difficult to read out very detailed values.
+ +In the following section we show how to draw both simple and complex + radar graph. As we will show all the settings will follow the same + pattern as for the more standard linear graphs.
+The cynical view: To explain why your project is over-due and + over-budget.
+The pragmatic view: To keep management of our back and know what we + have forgotten
+The common view: As a tool to help identify project issues and + highlight problem areas.
+Basically, Gantt charts are used to show the state of a number of + activities (possible grouped) against time.
+The following section only applies to palette images. This + means it wont work on true-color images.
+It is often desirable to have a background image look a little bit + "washed" out so it doesn't take the concentration away from the actual + graph. There are basically two ways of accomplish this
+To adjust the background image call The levels for both brightness + and contrast are real numbers in the range [-1, 1] You can choose to + adjust for example just the background image or you might also choose + to adjust the whole image. To change the background image just use the + method + Graph::AdjBackgroundImage() to specify a suitable value. Let's show + some example on what we can do with this. The following example have + been generated by using the small utility "adjimg.php" which you can + find in the "utils/" directory.
+
+
Brightness=0, contrast=0, saturation = -1 (Original image)
+
Brightness=0, contrast=0, saturation = -1 (Black & White image)
+
Brightness=0.3, contrast=-0.3, saturation=0
+
Brightness=0.4, contrast=-0.7, saturation=0
+
Brightness=0.4, contrast=-0.7, saturation=-1
+
Brightness=0, contrast=0, saturation=1
For very busy Pie plots it can become too little space for the + labels to be printed just beside the pie slice. For this purpose it is + possible to use guide lines for the labels. The library will then draw + a line from the center edge of the slices to the label which will be + positioned further out from the Pie Plot.
+There is one method that is primarily used to handle this, + PiePlot::SetGuideLines() the simplest usage of this would be
$pieplot
+->SetGuideLines
+();
An example of this could then be
+The above example will give guide lines very similar as what is + produced by other programs, e.g. Excel. In addition to the above + variant it is also possible to instruct the library to line up the + labels vertically in a way that we think is easier to read. This is + achieved by specifying the second parameter to the SetGuideLines() to + 'false' as in
$pieplot->
+SetGuideLines(
+true,false);
The first parameter is to enable/disable the guide-lines. With the + same example as above this would then produce the image
+It is also possible to configure the vertical distance between the + labels. By default the distance between the labels is roughly 40% of + the labels font height. By using the method + PiePlot::SetGuideLinesAdjust() it is possible to specify a + fractional value which is interpretated as the distance between the + bottom of one label to the bottom of the next. This means that + specifying a value of '1.0' the labels will have no space between them + and the bottom of one label will touch the top of another label. By + default this value is 1.4.
+By increasing or decreasing this value it is possible to make the + labels become positioned more or less compact. Below we have taken the + above example and reduced the distance to '1.1' and as can be seen this + yields much more compact labeling.
+ +Note: Guide lines is only available in 2D Pie plots.
+During development and optimization it can be very handy to have the + actual time it took to generate the image as a footnote. The following + example shows the usage of this feature
+To enable this feature you can proceed in two ways.
+
+ $gJpgBrandTiming=true;
+
in the beginning of the script.
+If you like you might also change the way the timing is formatted by + setting the string defined by BRAND_TIMING_FORMAT (in jpgraph.php). + This string represents a standard printf() format string.
So far we have only made use of 2D pie plots, creating 3D pie plots + is no more difficult. Instead of creating the plots with a call to + PiePlot() you create the plots with a call to + PiePlot3D() If we just take the first simple pie plot and replace + the call to PiePlot() with a call to PiePlot3D() we get the following + result.
+3D Pie plots have the same possibilities as the normal pie plots + with the added twist of a 3:rd dimension. You can adjust the + perspective angle with the method + SetAngle() So for example to make the pie more "flat" you just set + it to a smaller angle. Setting the perspective angle to 20 degrees in + the previous example will give the following result.
+ +JpGraph has built-in support for over 200 country flags, i.e. they + are available to be used in graphs without any external image + definitions.
+Country flags can be used in primarily two settings
+In order to make it easy to find the appropriate country flags they + can be specified with either full or partial name or as an numeric + index. The routines in JpGraph are "smart" enough to figure out which + way you are trying to specify a particular flag.
+To specify a country flag as a marker you have to specify the + special mark type as one of MARK_FLAG1,MARK_FLAG2,MARK_FLAG3 or + MARK_FLAG4
+Flags are internally stored in 4 different sizes which is indicated + by the number in the mark types. Flags may also be arbitrary scaled + when displayed. Since this is partially overlapping functionality you + might very well ask why the flags are stored in four different basic + sizes. The reason is of course performance. It you only want a very + small flag it takes processing time to scale down a large image to, + say, a small icon size. At the same time for large flags to be used as + background a small original flag might not have enough details to be + scaled up to a large size. Hence the reason for storing the flags in 4 + different sizes.
+The example below shows how to use country flags as markers
+To use country flags as background one has to use the method + Graph::SetBackgroundCountryFlag(). With this method you can specify + both how much of the image should be filled as well as how much of the + flag should be mixed into the background.
+To see a list of all supported country flags you can run the script + "listallcountryflags.php" in the Example directory. This will show you + a table with all flags.
+In addition to the standard background image you can also add an + arbitrary number of icons onto the background of the graph. These icons + are created with a call to the special Plot class IconPlot.
+The image from icons are taken from a file or as one of the builtin + country flags.
+You may control how much of the icon should be blended into the + background by specifying a percentage (1-100). The example below shows + how to mix in the picture of "Tux" into the background of a filled line + graph. Note: This example uses alpha blending and will therefore + require GD2.
+To specify any of the roughly 200 country flags as an icon you first + create an empty Icon and then call the IconPlot::SetCountryFlag() with + the appropriate parameters. (See the class reference). This is + illustrated below by adding the Icelandic flag into the background as + an icon
+One way to attract attention to some specific piece of information + in a pie chart is to "explode" one or more slices. Both 2D and 3D pies + support exploding one or several slices.
+Exploding slices is accomplished by the methods + Explode() and + ExplodeSlice() The first method is used if you want to explode more + than one slices and the second is a shorthand to make it easy to just + explode one slice.
+For example to explode one slice the default "explode" radius you + would just have to say
+ $pieplot->ExplodeSlice(
+1)
+
The above line would explode the second slice (slices are numbered + from 0 and upwards) the default amount. Doing this to the two previous + example would result in
+ + + +To explode all slices at once you can use the + PiePlot::ExplodeAll() method. If you want to explode several slices + you can use the + PiePlot::Explode() method and supply a suitable array argument.
+By default the values shown just outside the pie for each slice are + the percentage value for each slice. If you instead wanted the absolute + value you would just have to use the + SetLabelType() method. So to use the absolute value you would call
+
+ $pieplot->
+SetLabelType(
+"PIE_VALUE_ABS");
+
Furthermore you could enhance the formatting of the value by either + using a printf() style format string (using + SetFormat() ) or by providing a formatting function callback (using + + SetFormatCallback() ) for doing more advanced formatting.
+You can also adjust the position of the labels by means of the + PiePlot::SetLabelPos() method. The argument to this method is + either the fraction of the radius or the string 'auto'. In the latter + case JpGraph automatically determines the best position and the the + first case The following example illustrates this
+ +If this formatting is not enough you can also "manually" specify the + labels for each slice individually. You do this by using the + PiePLot::SetLabels() method. This will let you specify individual + text strings for each label. In each specification you can also add a + printf() formatting specification for a number. The number passed on + will be either the absolute value for the slice or the percentage value + depending on what was specified in the call to + SetLabelType()
+The SetLabels() method can also take a second parameter, the label + position parameter. This is just a shortcut to the SetLabelPos() as + described above. By default the position will be set to 'auto' if not + explicitely specified.
Another typical change would be to change the colors of the slices. + There are two fundamental ways of doing this. You either manually + specify the colors for the slices as an array using the method + SetSliceColors() If you specify fewer colors than the number of + slices they will just wrap around.
+Another way is to use one of the pre-defined color "themes". This is + just a predefined set of colors that will be used for the slices. You + choose what "theme" you like to use with the method ( + SetTheme() ) At the time of this writing the available themes are
+The following example shows the same pie using the different + "themes" in order.
+ + + + +A complete color chart of all available colors in the different + themes can be found here
+Another simple change is to remove the border ( or change it's + colors ) that separates each slice. This can be done by a call to + ShowBorder()
+An additional visual enhancements can be made by adding a drop + shadow to the individual slices. This is accomplished by means of the PiePlot::SetShadow() + method. Adding a drop shadow is often more affective if the pie has one + or more slices exploded as the following example shows
+ +As mentioned in the beginning there are two versions of the 2D pie + plots. The normal pie plot created as an instance of + class PiePlot and a variant created as an instance of + class PiePlotC
+This variant is an extension of the standard PiePlot in the sense + that it also have a filled circle in the center. The following example + illustrates this
+ + +Since the PiePlotC is an extension to the basic pie plot all the + normal formatting you can do for pie plots you can also do for the + PiePlotC .
+The additional formatting only concerns the filled middle circle. + You have the option of adjusting size, fill color and all font + properties. You perform these operations with the methods
+ ++PiePlotC::SetMidColor() | Set fill color of mid circle |
+PiePlotC::SetMidSize() | Set size (fraction of radius) |
+PiePlotC::SetMidTitle() | Set title string (may be + multi-lined) |
+PiePlotC::SetMid() | Set all parameters in a single method + call |
In addition to the normal CSIM for PiePlot:s the center area is also + a CSIM hotspot. You specify the target CSIM with a call to + PiePlotC::SetMidCSIM()
+The next example shows an example with some more innovative + formatting. In this example we have :
+So far we have just show plots based on an X-Y coordinate system. + This is not the only types of graphs you can create with JpGraph. + Another common type is Pie plots. JpGraph supports both 2D and 3D pie + plots. For 2D pie plots there are also 2 versions, but more on that + later.
+The main difference as compared to the X-Y plots is that to all pie + plots are added to the + PieGraph() instead of the Graph() object we used for the X-Y graphs + we have drawn so far. For this you must first include the + "jpgraph_pie.php" in your script (or "jpgraph_pie3d.php" if you want to + use 3-dimensional pies).
+Below you cane see the code needed to create the simplest possible + pie graph just using the default settings.
+
+ include (
+"../jpgraph.php");
+
include ("../jpgraph_pie.php");
+
+
$data
+= array(40,60,
+21,33);
+
+
$graph
+= new PieGraph
+(300,200);
+
$graph->SetShadow();
+
+
$graph->title->
+Set(
+"A simple Pie plot");
+
+
$p1 = new PiePlot(
+$data);
+
$graph->Add(
+$p1);
+
$graph->Stroke();
+
The above code would give the following pie graph
+There is a few things worth noting here
+You can change almost all aspects of appearance of the pie graphs. + For example you could change :
+The next simplest addition we can do is to add a legend to the pie + graph. We do this by using the + SetLegends(); method. By adding the legends to the previous example + we get the following image
+ +(In the figure above we also moved the center of the pie slightly to + the left to make more room for the legend box.)
+The text for the legends can also contain printf() style format + strings to format a number. This number passed on into this string is + either the absolute value of the slice or the percentage value. How to + switch between the is describe further down in this chapter.
+The next change you might want to change is the size and position of + the Pie plot. You can change the size with a call to + SetSize(); and the position of the center of the pie plot with a + call to SetCenter(); + The size can be specified as either an absolute size in pixels or as a + fraction of width/height (whatever is the smallest). The position of + the pie plot is specified as a fraction of the width and height.
+To put the size and positioning API to use we will show how to put + several pie plots on the same pie graph. In the following example we + have also adjusted the legends of the slice values to use a smaller + font.
+What we do in this example is quite simple, create 4 pie plots, make + them smaller and put them in the four corner of the graph. This will + give the result as shown in the following example.
+ +Each data point in a polar plot is represented by a tuple consisting + of a radius and an angle. The polar plot itself can be either outlined + or filled. In addition each point may have a standard marker (the same + as for line and scatter plots).
+The scale for the radius can be either linear or logarithmic.
+A polar graph is created by creating an instance of +PolarGraph::PolarGraph(). The polar graph type inherits all the + capabilities of ordinary X-Y graphs, i.e they can have background + images, background gradients, tabbed titles and so on.
+Polar graphs comes in two basic types, they can either show a full + 360 degree graph or a half 180 degree graph. The two examples below + show these two basic types of graphs.
+ + + +The radius axis can be shown in either a linear or logarithmic + scale. This is controlled, as usual, by a call to +PolarGraph::SetScale() The two examples below show the same plot in + either linear or logarithmic scale
+ + + + +Please note that the maximum values of the scales are different.
+By default the scale will be auto scaled depending on the data. You + can also specify a manual scale by supplying an extra argument to the + SetScale() value. The only difference from the manual scaling with the + other X-Y-graphs is that for polar graph you only specify a manual + maximum. The minimum will always be 0 for the linear scale and a scaled + value of 10 (i.e 1, 0.1, 0.001 and so on) for the logarithmic scale.
+The plot is clipped to the plot area so if you specify a smaller + scale then the maximum value that part of the plot that are outside the + plot area will be clipped.
+As usual you have full freedom to select what grid lines you like to + show (and what colors they should have). There are three different + types of grid lines you may adjust. The radius minor and major grid + lines and the angle grid lines.
+You select what grid lines to show with a call to +PolarAxis::ShowGrid() The two example below shows a logarithmic plot + with either just major grid lines or both minor and major grid lines.
+ + + +The colors of the grid lines are specified with a call to + PolarAxis::SetGridColor()
+For the angle grid lines it is possible to specify the angle + division between each grid line with the method + PolarAxis::SetAngleStep() You specify the step distance in degrees. + By default the step size is 15 degrees.
+You can individually specify different fonts and colors for the + angle and the radius labels. The radius font is specified with + PolarAxis::SetFont() and the angle font is specified with a call to + PolarAxis::SetAngleFont()
+You can adjust the color with the method +PolarAxis::SetColor() ?>
+The following example specifies different color for the labels. it + also shows that you can add both a radial axis title as well as a + tabbed title. In this example we have also chosen not to show the frame + around the edge of the plot.
+As can be seen from the previous examples the angle labels have a + small superscripted "o" after each label. You can select if you like to + show this degree mark or not with a call to the + PolarAxis::SetANgleDegreeMark() method by which you can enable or + disable that mark after the angels.
+For the radius labels all standard formatting that can be done to + the X-Y axis such as format string or format callbacks are supported.
+A common modification for polar plots is probably to disable the + display the last label when using a 360 degree plot since the last + label will "collide" with the plot box around the plot area. It is + possible to disable the last label with a call to +Axis::HideLastTickLabel() As you can see this has been used in some + of the examples in this chapter.
+If you have specified markers for the polar plot (by setting the + mark property of the plot) each marker can be a hot spot in a client + side image map. The target URL are as usual specified with the + SetCSIMTargets() as the following short code excerpt shows
+// Start by specifying the proper URL targets
+
$targets
+= array("#1","#2", ....... );
+
$polarplot
+= new PoalrPlot
+($data);
+
$polarplot
+->mark->SetType(
+MARK_SQUARE);
+
$polarplot
+->SetCSIMTargets
+(targets);
+
$graph->Add(
+$polarplot);
+
$graph->StrokeCSIM();
+
As a final example we show a full 360 degree polar plot with square + markers as well as background color gradient and a legend for the plot.
+ +Time to show you an example of a Gantt chart and how easy it is to + make one. Lets make it the simplest possible Gantt chart. One activity, + named "Project", which lasts from "2001-11-01" to "2002-02-20".
+All it takes to do this (using default values for everything) is the + following code.
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_gantt.php");
+
+
// A new graph with automatic size
+
$graph
+= new GanttGraph
+(0,0,
+"auto");
+
+
// A new activity on row '0'
+
$activity
+= new GanttBar
+(0,"Project",
+"2001-12-21",
+"2002-01-20");
+
$graph->Add(
+$activity);
+
+
// Display the Gantt chart
+
$graph->Stroke();
+
?>
+
The resulting image is shown in Figure 147 below.
Let's note a few things with the above image and code:
+So, lets start making this graph a little bit more interesting. + First we are going to add a title, then we will add a month scale and + finally we will change the color of the bar.
+All that is taken care of in the code below.
<?php
+
include (
+"../jpgraph.php");
+
include ("../jpgraph_gantt.php");
+
+
$graph
+= new GanttGraph
+(0,0,
+"auto");
+
$graph->SetShadow();
+
+
// Add title and subtitle
+
$graph->title->
+Set(
+"A nice main title");
+
$graph->title->
+SetFont(
+FF_ARIAL,
+FS_BOLD,12);
+
$graph->subtitle->
+Set(
+"(Draft version)");
+
+
// Show day, week and month scale
+
$graph->ShowHeaders(
+GANTT_HDAY |
+GANTT_HWEEK |
+GANTT_HMONTH);
+
+
+// Instead of week number show the date for the first day in the week
+
// on the week scale
+
$graph->scale->
+week->SetStyle(WEEKSTYLE_FIRSTDAY);
+
+
+// Make the week scale font smaller than the default
+
$graph->scale->
+week->SetFont(FF_FONT0
+);
+
+
+// Use the short name of the month together with a 2 digit year
+
// on the month scale
+
$graph->scale->
+month->
+SetStyle(
+MONTHSTYLE_SHORTNAMEYEAR2);
+
+
+// Format the bar for the first activity
+
// ($row,$title,$startdate,$enddate)
+
$activity
+= new GanttBar
+(0,"Project",
+"2001-12-21",
+"2002-01-20");
+
+
+// Yellow diagonal line pattern on a red background
+
$activity
+->SetPattern(BAND_RDIAG,
+"yellow");
+
$activity
+->SetFillColor
+("red");
+
+
// Finally add the bar to the graph
+
$graph->Add(
+$activity);
+
+
// ... and display it
+
$graph->Stroke();
+
?>
+
From the above example you might note a few things
+To show that this is really simple let's show the full year in the + month, and set the header style to be white text on a dark blue + background by adding the lines
+
+// Use the short name of the month together with a 4 digit year
+
// on the month scale
+
$graph->scale->
+month->
+SetStyle(
+MONTHSTYLE_SHORTNAMEYEAR4);
+
$graph->scale->
+month->
+SetTextColor(
+"white");
+
$graph->scale->
+month->
+SetBackgroundColor(
+"blue");
+
to the code above. The resulting image is shown in Figure 149
+ +A Gantt chart is made up of four distinct areas.
+Since a Gantt chart inherits all the usual properties of a JpGraph + Graph() you have the access to the same method to formatting the image + as before. For example to have a shadow around the image you call + Graph::SetShadow() and to set the margin color you can use + Graph::SetMarginColor(). Please refer to the reference documentation + for a full list of supported features.
+To create a Gantt chart you add objects to it. As + of this writing you may add the following object by the use of the + GanttChart::Add() method
+All these objects may be extensively modified in terms of + formatting. You can specify color (both fill- and frame color), size, + titles, style and patterns and so on. All these objects comes with (in + my mind) sensible default so you don't have to specify a lot of + parameters. But if you need a fine grain control or if you disagree + with my taste you can.
+You create a new Gantt Chart with a call to GanttChart(). The + signature for GanttGraph is the same as for ordinary JpGraph graphs, + i.e
+ function
+GanttGraph(
+$aWidth,
+$aHeight,
+$aCachedName,
+$aTimeOut,
+$aInline)
+
The only real difference is that for GanttCharts you can specify one + or both of the dimension parameters (width and height) as -1 in which + case that dimension will be automatically sized determined by scale and + fonts chosen. The following examples shows some possible ways of + creating a new graph
+Since GanttGraph() inherits all the methods (that make sense for + GanttGraph) from Graph you can specify shadow, color etc of the general + frame.
+Bars and Milestones need both a vertical position and a horizontal + position. The horizontal start position is specified as a date, e.g. + "2001-06-23", and the vertical positions are specified as a number + [0,1,2,3,...]. This vertical number indicates the position from the top + where the object should be placed. To understand this you might imagine + a number of "invisible" horizontal bands with a certain height. If you + specify 0 as the vertical position the bar will be placed in the first + band, specify 3 and the bar will be placed in the fourth band and so + on.
+It is perfectly legal, and perhaps even desirable to leave "gaps" + when laying out bands to group related activities. So, for example you + could have three activities/bars at positions 1,2,3 and then another 2 + bars at position 6,7 leaving band 0,4,5 empty.
+All these "invisible bands" have the same height (equ-spaced). The + height of each band is automatically determined and depends on both the + method of layout ( as specified by (GanttChart::SetLayout()) and the + individual heights of the individual bars and titles. The rules are + quite simple:
+As described above vertical positions are specified as a numeric + value [0..n] where 'n' is an arbitrary constant. (For practical + purposes n is most likely < 100)
+Using our previous example we will illustrate this parameter by + changing the position of our 'Project' activity to position 7. Therefor + we change the call to GanttBar() to
+ $activity = new GanttBar(
+7,"Project","2001-12-21"
+,"2002-02-20"
+);
and we then get the chart as shown below in Figure 150.
+ +Note that the height of each position (vertical position) will + depend on the actual height of the bar.
+Start of bars are given as a date string. The format depends on the + current locale. Examples of valid date strings are
+Even if several format are supported it is recommended to use all + numeric dates, i.e in the form "2001-10-22".
+Specifying the end position may be done in two different ways, + either by the end date in the same way as for the start date. The other + way is to specify the length of the activity in number of days + (and fractions thereof). Examples of valid end dates are:
+Please note that duration is specified as numerical values and + not strings.
+Milestones are similar to bars but have no end date since milestones + just apply to one single date. Milestones are created much the same way + as activities but using method MileStone() instead.
+The full signature for milestones are
+function MileStone
+($aVPos,$aTitle,
+$aDate,
+$aCaption)
+
+
+ $aVPos
+ | The vertical position for the + bar, [0..n] | |
+
+ $aTitle
+ | Title for the activity | |
+
+ $aDate
+ | Date for the milestone | |
+
+ $aCaption
+ | Text to the right of the + milestone |
Valid milestones are for example
+
+ $milestone = new
+MileStone(3,"Code complete","2001-12-01"
+);
+ $milestone = new
+MileStone(3,"Code complete","2001-12-01"
+,"(2001-12-01)"
+);
By default milestones are rendered as a filled "Diamond" shape. This + may be optionally modified. The actual shape is specified by the 'mark' + property of milestone which is an instance of the PlotMark() class + (same class responsible for the marks in line graphs).
+To change the shape of a milestone to, say a triangle, you use the + SetType() method as in
+ $milestone->mark->
+SetType(
+MARK_DTRIANGLE)
+
Let's put this into practice and add a milestone to our previous + example by adding the following two lines of code which result in + Figure 151 shown below.
+ +You may note that by default the title color is red for milestones. + If you like to change this to be instead, say bold black, you would + invoke the SetColor() and SetFont() methods on the title property of + milestones as in
$milestone->
+title->SetFont(FF_FONT1
+,FF_BOLD);
+
$milestone
+->title->SetColor(
+"black");
+
and thew result would now (not surprisingly be)
+To modify the caption you do exactly the same but act on property + 'caption' instead of 'title', i.e.
+ $milestone->caption->
+SetFont(
+FF_FONT1,
+FF_BOLD);
+
$milestone
+->caption->SetColor(
+"black");
+
It is worth noting that you modify the bar title and caption the + exact same way by acting on the 'title' and 'caption' property for the + bars.
+The final object you may add to a Gantt chart is simple, but quite + useful, a straight vertical line extending over the whole plot height. + This could for example be used to illustrate different phases in a + project. You create a line object by a call to GanttVLine()
+The full signature for GanttVLine() is
+function GanttVLine
+($aDate,$aTitle,
+$aColor,
+$aWeight,
+$aStyle)
+
+
+ $aDate
+ | Date for the milestone | |
+
+ $aTitle
+ | Title for the line. The title is + displayed at the bottom of the line | |
+
+ $aColor
+ | Color for the line | |
+
+ $aWeight
+ | Line width | |
+
+ $aStyle
+ | Line style,"dashed", "dotted" and + so on |
Valid creations of lines are for example
+
+ $vline = new
+GanttVLine(
+"2001-12-24");
+
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1");
+
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1",
+"darkred");
+
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1",
+"darkred",5);
+ $vline = new
+GanttVLine(
+"2001-12-24",
+"Phase 1",
+"darkred",5,"dotted"
+);
To add the line to the graph you just have to call GanttGraph::Add() + as with milestones and bars. Let's illustrate the use of vertical lines + by adding a line to the previous example.
$vline
+= new GanttVLine
+("2001-12-24","Phase 1");
+
$graph->Add(
+$vline);
+
and the example (See 153) now becomes
+From the above figure you can see that by default the line is drawn + at the beginning of the day of the specified date and in a 'dashed' + style. This can (of course!) be modified so that the line is + drawn/aligned anywhere in the specified day. You modify this by + invoking the method SetDayOffset() with an argument specifying the + fraction of the day where you want the line positioned.
+If you, for example, want to display the line in the middle of the + day just add the line
+ $vline->SetDayOffset(
+0.5);
+
to the previous code and the result will be
+ +As usual you may modify the font, size and color by invoking the + appropriate method (SetFont(), SetColor()) on the 'title' property of + lines.
+You can easily add a variety of markers both to the start and end of + the gantt bar. They could for example be used as an alternate way to + illustrate important milestones or anticipated deliveries.
+The left and right markers are accessed through the two properties + 'leftMark' and 'rightMark'. They are both instances of the general + 'PlotMark' class which is also used for the milestones (and in line + graphs). The 'PlotMark' class supports several different styles, for + example, diamond (the default for milestones), filled and unfilled + circles, squares, stares, and so on. Please refer to the reference + section for a complete listing.
+Let's illustrate this by adding a right marker to the previous + example. We will use a style of a filled (red) circle with a white + title, say, "M5". In order to accomplish this we must augment the + previous example with the following lines:
$activity
+->rightMark->Show();
+
$activity
+->rightMark->title->
+Set("M5");
+
$activity
+->rightMark->SetType(
+MARK_FILLEDCIRCLE);
+
$activity
+->rightMark->SetWidth(
+10);
+
$activity
+->rightMark->SetColor(
+"red");
+
$activity
+->rightMark->SetFillColor(
+"red");
+
$activity
+->rightMark->title->
+SetFont(
+FF_ARIAL,
+FS_BOLD,12);
+
$activity
+->rightMark->title->
+SetColor(
+"white");
+
This might seem like a lot of lines but this is as complicated as it + possible can get. As an illustration in the example belwo more or less + everything that is changeable has been changed, the default font, + font-color, fill-color, frame-color and width of marker. The two lines + only really necessary are the first two, showing the mark and setting a + title. One could still get a good result by using default values for + the rest of the properties.
+The resulting image can be seen in Figure 155 below.
+We have deliberately introduced a "strangeness" here. If the + previous two examples are compared it can bee seen that the last + example is larger than the previous one. Why?
+The explanation is trivial once we recall that the height of bars + are sized relative to the horizontal spacing. The horizontal spacing + are based on the highest single bar including title size and, here come + the explanation, marker size. The horizontal spacing has grown since + the minimum height is now based on 10 points(=the height of the mark). + The bar still occupy the same percentage of the height so it seems to + have grown.
+If this behavior is unwanted it is always possible to specify an + absolute size for the bar heigh, say 8 pixels, with a call
$activity->SetHeight
+(8);
and achieve the result in Figure 156 below.
+It is worth noting that the height reserved for each bar is still + the same since we haven't changed the height of the marker and the + reserved space is the maximum height used by any bar.
+Let's see what happens if we set the height of each bar to be 100% + of the reserved height by adding another activity/bar below the first + one and set the height of each bar to 100% by adding the lines (We omit + the added lines to add another bar since they are just a copy of the + first bar)
+ $activity->
+SetHeight(1.0);
+
$activity2
+->SetHeight(1.0);
+
to the previous example. (Note that a value in the range [0..1] is + interpretated as the fraction of the reserved height while a value > 1 + is interpretated as the absolute size in pixels.)
+Aha.. What we are trying to do doesn't really make sense. Since we + have specified that the bar will always occupy 100% of the available + reserved with there will be no distance between the bars. So what if we + specify the bar as 10 pixel absolute by changing the lines to
$activity->SetHeight
+(10);
+
$activity2
+->SetHeight(10);
+
we instead get
+So what can we actually do? Well if you remember the reserved height + for each bar is the maximum height of all bars including titles. This + guarantees that no two bars will ever overlap. To guarantee that titles + don't end up too close together there is a Vertical Label Margin + which basically specifies some extra "air" in between the titles. The + amount of air is specified in percent of the title height. To set the + margin you use
+ GanttGraph::
+SetLabelVMarginFactor(
+$aMargin)
+
As an example let's set that margin in the previous example to 0 and + see what happens.
+As you would perhaps expect the two bars just barely touches now + since there are no extra margin added. If the two bars hadn't had the + extra right marker it would have looked very compressed.
+By default the vertical margin is set to 40%.
+The most common of all object in a Gantt chart is of course the + activity bar (GanttBar()). In terms of formatting this object has a + very large flexibility. The full signature for the GanttBar constructor + is
+ function
+GanttBar(
+$aVPos,$aTitle,$aStart
+,$aEnd,$aCaption,
+$aHeight)
+
+
+ $aVPos
+ | The vertical position for the + bar, [0..n] | |
+
+ $aTitle
+ | Title for the activity | |
+
+ $aStart
+ | Start date for the activity given + as string, e.g "2001-09-22" | |
+
+ $aEnd
+ | End date for activity given as either + a date (a string) or as the duration (in days) of the activity, e.g + both "2001-10-15" and 20.5 are valid inputs | |
+
+ $aCaption
+ | Text string (caption) to appear + at the end (right side) of the bar | |
+
+ $aHeight
+ | Height of bar given as either + a value in range [0,1] in which case this is interpretated as what + fraction of the vertical position should the bar occupy. The height can + also be given in absolute pixels [1..200] |
Minute scale is the lowest resolution you can use. It is often + convenient to use Minute scale with "GanttScale::SetINtervall()" since + by default the increment will be 1 minute. The style of minute scale + can be further adjusted by the use style parameters which can be + one of
+Minute scale is enabled by adding the GANTT_HMIN in the + GanttGraph::ShowHeaders() call. For example as in
$graph
+->ShowHeaders(GANTT_HDAY |
+GANTT_HHOUR |
+GANTT_HMIN);
+
The code snippet below shows how to set up a minute scale with 30 + min interval and some custom colors.
+ $graph->scale->
+minute->
+SetIntervall(
+30);
+
$graph->scale->
+minute->
+SetBackgroundColor(
+'lightyellow:1.5');
+
$graph->scale->
+minute->
+SetFont(
+FF_FONT0);
+
$graph->scale->
+minute->
+SetStyle(
+MINUTESTYLE_MM);
+
$graph->scale->
+minute->grid->SetColor
+('lightgray');
The hour scale has more builtin formatting possibilities. The + following formatting options are available
+For hours it is possible to specify the interval in either of two + ways. With an integer, e.g. 6, or as time interval, e.g. "1:30" which + makes the interval one and a half hour. The only restriction is that + the interval must be even dividable for 24 hours since one day is the + smallest possible interval to show. This means that it is allowed to + use, for example 2,4,6,"1:30" or "0:45" as intervals but not 7, "2:45".
+The code snippet below shows hot to set up a hour scale to with 45 + minutes interval and some custom colors
$graph
+->scale->hour->
+SetBackgroundColor(
+'lightyellow:1.5');
+
$graph->scale->
+hour->SetFont(FF_FONT1
+);
+
$graph->scale->
+hour->SetStyle(HOURSTYLE_HMAMPM);
+
$graph->scale->
+hour->
+SetIntervall(
+"0:45");
+
The example below shows a gantt chart with the day and hour scale + enabled
+ +By default the day scale show the first letter of the week day but + it is also posible to format the day scale in a number of different + ways. Days can have one of the following scale formats.
+The formatting is specified by using the SetStyle() method as in
$graph
+->scale->day->
+SetStyle(
+DAYSTYLE_LONG);
+
The graphical formatting possibilities for days allow the + possibility to specify a different color for the weekend background and + also for the Sunday.
+
+ SetWeekendColor()
+
Set the background color for weekends. (Defaults to light gray)
+
+ SetSundayFontColor()
+
The Sunday font color. (Defaults to red)
+In addition to this there is also a possibility to choose whether or + not the weekend background should be extended vertically down over the + plot area. (the default). Since that is a property more of the whole + plot this behavior is modified with a call to the method
UseWeekendBackground()
of the scale, e.g.
+
+ $graph->scale->UseWeekendBackground(false
+);
Week scales, if enabled, by default shows the week number in range 1 + to 53 (as defined by ISO-8601, see the reference section).
+It might be worth pointing out here that the week number calculation + is carried out within JpGraph and does not rely on the underlying OS + date libraries. This makes the behavior consistent over several OS:s + (at least M$ Windows does not comply to ISO-8601 or supply any + way of doing this through the normal libraries, e.g. strftime())
+You may modify the week behavior in three ways. You can specify + (with SetStyle()) a different date format using the constants
+
+ WEEKSTYLE_WNBR
Show week number To further modify the formatting of the actual week + number you can optionally supply a format string with a call to
SetLabelFormatString()
The format of the string should be a standard sprintf() syntax + expecting an integer (the week number). By default a 'W' is prefixed to + the number.
+
+ WEEKSTYLE_FIRSTDAY
Show date of first day in week.
+
+ WEEKSTYLE_FIRSTDAY2
Show date of first day in week and short month
+
+ WEEKSTYLE_FIRSTDAYWNBR
Show weeknumber of first day in week.
+
+ WEEKSTYLE_FIRSTDAY2WNBR
Show weeknumber of first day in week and month
+For month scale you can use the SetStyle() method to choose between + a variety of formats.
+
+ MONTHSTYLE_SHORTNAME
Display the month name in its locale specific short form, i.e Jan, + Feb etc
+
+ MONTHSTYLE_SHORTNAMEYEAR2
Display the month name in its locale specific short form together + with a 2 digit year , i.e Jan '01, Feb '01 etc
+
+ MONTHSTYLE_SHORTNAMEYEAR4
Display the month name in its locale specific short form together + with a 4 digit year , i.e Jan 2001, Feb 2001 etc
+
+ MONTHSTYLE_LONGNAME
Display the month name in its locale specific long name, i.e. + January, February
+
+ MONTHSTYLE_LONGNAMEYEAR2
Display the month name in its locale specific long name together with + a 2 digit year , i.e January '01, February '01 etc
+
+ MONTHSTYLE_LONGNAMEYEAR4
Display the month name in its locale specific long name together with + a 4 digit year , i.e January 2001, February 2001 etc
+
+ MONTHSTYLE_FIRSTLETTER
The first letter of the month name
+Year scale has no extra formatting possibilities.
+The scale headers allow you to view up to four different scales at + the same time. The four basic scales are:
+You can choose what scale to include and exclude by using the + SetScale() method. For example, for a detailed gantt you might choose + to display days and weeks by specifying
$graph
+->ShowHeaders
+( GANTT_HWEEK
+| GANTT_DAY );
If you instead wanted "the big picture" it might be enough to show + year and months by specifying
+ $graph->ShowHeaders(
+GANTT_YEAR |
+GANTT_MONTH );
+
You can choose freely the combination of scales that you want, but a + chart must at least have one scale of course.
+Once you have decided what level of details you need you can then + fine tune the exact layout/formatting of each of the enabled scales as + described below.
+These scale header are all accessed through the graph instance + variables 'scale' as in
+ $graph->scale->
+week
or
+ $graph->scale->day
. All these headers share the following properties.
+
+ Show()
+
Determine if the scale should be shown or not
+
+ SetFont()
+
Font for text in header
+
+ SetFontColor()
+
Specify the color of the header text
+
+ SetStyle()
+
Specify what date format should be used, for example in the week + scale it is possible to show either week number, the start date of the + week and so on.
+
+ SetBackgroundColor()
+
As it says, the background color for the header
+
+ SetFrameWeight()
+
The line weight of the box around the scale
+
+ SetFrameColor()
+
The line color for the frame
+
+ SetTitleVertMargin()
+
The margin, in percent, below and above the title text
+In addition to these methods each scale also has the property 'grid' + which determines the appearance of grid lines for that specific scale. + You may modify the appearance of grid lines by the "normal" line + methods, i.e. SetColor(),SetWeight() SetStyle() and Show(). So for + example to set the week grid line red you would use
$graph
+->scale->week->
+grid->SetColor("red"
+);
Each of the scales also have some specific formatting possibilities + as described below.
+Caption for bars are placed at the far right side of the bars. They + can for example be used to indicate the resources assigned to a task, + the duration of the task or the progress of the activity.
+Caption text for a bar is specified either when creating a bar or + later by accessing the 'caption' property of bars. So the two lines
$activity = new GanttBar
+(0,"Activity 1",
+"2001-11-21",
+"2001-12-20",
+"[BS,ER]")
+
and
+ $activity->
+caption->Set("[BS,ER]"
+);
are both ways of specifying the caption "[BS,ER]" for the activity. + Since activity is a standard JpGraph text object you can easily modify + font, color and size with calls to SetFont() and SetColor(), (e.g.
$activity->caption
+->SetFont(FF_ARIAL,
+FF_BOLD,9);
The figure below illustrates the use of caption
+ +To indicate the progress of a specific activity it is also possible + to add a progress indicator to each bar. This progress indicator + consists of a smaller bar within the bar. By default this progress bar + is black and 70% of the height of the bar. These parameter can (of + course) all be changed.
+The properties for the progress indicator are accessed through the + 'progress' property and it's methods.
+To set the progress for a specific activity you only specify the + percent as a fraction. As in
+ $activity->progress->
+Set(0.4)
In Figure 162 the previous example is modified to indicate the + progress of each activity by the default progress indicator. A solid + bar. To make it clearer we have also modified the caption to reflect + the displayed progress. (At the same time we also modified the scale + headers just to illustrate some more formatting options).
+To specify a different format for the progress you use the + SetPattern() method as in
+ $activity->progress->
+SetPattern(
+BAND_RDIAG,
+"blue");
+
In the reference section you can see the exact parameters and all + available methods.
+ +This section shows some further modification you might do to + activity bars.
+Non X,Y plots includes
+The fundamental difference is that these classes makes use of an + extended version of the basic Graph class. Therefor you can not mix X,Y + plots with non-X,Y plots. For example it is not possible to mix a line + graph with a Polar graph.
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$datay1=array(140,110,50,60);
$datay2=array(35,90,190,190);
$datay3=array(20,60,70,140);
// Create the basic graph
$graph = new Graph(450,250,'auto');
$graph->SetScale("textlin");
$graph->img->SetMargin(40,80,30,40);
// Adjust the position of the legend box
$graph->legend->Pos(0.02,0.15);
// Adjust the color for theshadow of the legend
$graph->legend->SetShadow('darkgray@0.5');
$graph->legend->SetFillColor('lightblue@0.3');
// Get localised version of the month names
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Set a nice summer (in Stockholm) image
$graph->SetBackgroundImage('stship.jpg',BGIMG_COPY);
// Set axis titles and fonts
$graph->xaxis->title->Set('Year 2002');
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetColor('white');
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->SetColor('white');
$graph->yaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->SetColor('white');
//$graph->ygrid->Show(false);
$graph->ygrid->SetColor('white@0.5');
// Setup graph title
$graph->title->Set('Using alpha blending with a background');
// Some extra margin (from the top)
$graph->title->SetMargin(3);
$graph->title->SetFont(FF_COMIC,FS_NORMAL,12);
// Create the three var series we will combine
$bplot1 = new BarPlot($datay1);
$bplot2 = new BarPlot($datay2);
$bplot3 = new BarPlot($datay3);
// Setup the colors with 40% transparency (alpha channel)
$bplot1->SetFillColor('orange@0.4');
$bplot2->SetFillColor('brown@0.4');
$bplot3->SetFillColor('darkgreen@0.4');
// Setup legends
$bplot1->SetLegend('Label 1');
$bplot2->SetLegend('Label 2');
$bplot3->SetLegend('Label 3');
// Setup each bar with a shadow of 50% transparency
$bplot1->SetShadow('black@0.4');
$bplot2->SetShadow('black@0.4');
$bplot3->SetShadow('black@0.4');
$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3));
$gbarplot->SetWidth(0.6);
$graph->Add($gbarplot);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/antispamex01.html b/html/includes/jpgraph/docs/html/exframes/antispamex01.html
new file mode 100644
index 0000000000..6e9ad97b5d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/antispamex01.html
@@ -0,0 +1,3 @@
+
+<?php
// Antispam example using a random string
require_once "../jpgraph_antispam.php";
// Create new anti-spam challenge creator
// Note: Neither '0' (digit) or 'O' (letter) can be used to avoid confusion
$spam = new AntiSpam();
// Create a random 5 char challenge and return the string generated
$chars = $spam->Rand(5);
// Stroke random cahllenge
if( $spam->Stroke() === false ) {
die('Illegal or no data to plot');
}
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/backgroundex03.html b/html/includes/jpgraph/docs/html/exframes/backgroundex03.html
new file mode 100644
index 0000000000..1c80d0bbc6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/backgroundex03.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
// Some data
$datay = array(28,19,18,23,12,11);
$data2y = array(14,18,33,29,39,55);
// A nice graph with anti-aliasing
$graph = new Graph(400,200,"auto");
$graph->img->SetMargin(40,180,40,40);
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_COPY);
$graph->img->SetAntiAliasing("white");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->Set("Background image");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Slightly adjust the legend from it's default position in the
// top right corner.
$graph->legend->Pos(0.05,0.5,"right","center");
// Create the first line
$p1 = new LinePlot($datay);
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend("Triumph Tiger -98");
$graph->Add($p1);
// ... and the second
$p2 = new LinePlot($data2y);
$p2->mark->SetType(MARK_STAR);
$p2->mark->SetFillColor("red");
$p2->mark->SetWidth(4);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend("New tiger -99");
$graph->Add($p2);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/balloonex1.html b/html/includes/jpgraph/docs/html/exframes/balloonex1.html
new file mode 100644
index 0000000000..5b8a01e8e3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/balloonex1.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: balloonex1.php,v 1.5 2002/12/15 16:08:51 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
// Some data
$datax = array(1,2,3,4,5,6,7,8);
$datay = array(12,23,95,18,65,28,86,44);
// Callback for markers
// Must return array(width,color,fill_color)
// If any of the returned values are "" then the
// default value for that parameter will be used.
function FCallback($aVal) {
// This callback will adjust the fill color and size of
// the datapoint according to the data value according to
if( $aVal < 30 ) $c = "blue";
elseif( $aVal < 70 ) $c = "green";
else $c="red";
return array(floor($aVal/3),"",$c);
}
// Setup a basic graph
$graph = new Graph(400,300,'auto');
$graph->SetScale("linlin");
$graph->img->SetMargin(40,100,40,40);
$graph->SetShadow();
$graph->title->Set("Example of ballon scatter plot");
// Use a lot of grace to get large scales
$graph->yaxis->scale->SetGrace(50,10);
// Make sure X-axis as at the bottom of the graph
$graph->xaxis->SetPos('min');
// Create the scatter plot
$sp1 = new ScatterPlot($datay,$datax);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
// Uncomment the following two lines to display the values
$sp1->value->Show();
$sp1->value->SetFont(FF_FONT1,FS_BOLD);
// Specify the callback
$sp1->mark->SetCallback("FCallback");
// Setup the legend for plot
$sp1->SetLegend('Year 2002');
// Add the scatter plot to the graph
$graph->Add($sp1);
// ... and send to browser
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bar_csimex1.html b/html/includes/jpgraph/docs/html/exframes/bar_csimex1.html
new file mode 100644
index 0000000000..5c18684927
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bar_csimex1.html
@@ -0,0 +1,4 @@
+
+<?php
include_once ("../jpgraph.php");
include_once ("../jpgraph_bar.php");
$datay=array(12,26,9,17,31);
// Create the graph.
// One minute timeout for the cached image
// INLINE_NO means don't stream it back to the browser.
$graph = new Graph(310,250,'auto');
$graph->SetScale("textlin");
$graph->img->SetMargin(60,30,20,40);
$graph->yaxis->SetTitleMargin(45);
$graph->yaxis->scale->SetGrace(30);
$graph->SetShadow();
// Turn the tickmarks
$graph->xaxis->SetTickSide(SIDE_DOWN);
$graph->yaxis->SetTickSide(SIDE_LEFT);
// Create a bar pot
$bplot = new BarPlot($datay);
// Create targets for the image maps. One for each column
$targ=array("bar_clsmex1.php#1","bar_clsmex1.php#2","bar_clsmex1.php#3","bar_clsmex1.php#4","bar_clsmex1.php#5","bar_clsmex1.php#6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$bplot->SetCSIMTargets($targ,$alts);
$bplot->SetFillColor("orange");
// Use a shadow on the bar graphs (just use the default settings)
$bplot->SetShadow();
$bplot->value->SetFormat(" $ %2.1f",70);
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$bplot->value->SetColor("blue");
$bplot->value->Show();
$graph->Add($bplot);
$graph->title->Set("Image maps barex1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('bar_csimex1.php','bar_csimex1');
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bar_csimex2.html b/html/includes/jpgraph/docs/html/exframes/bar_csimex2.html
new file mode 100644
index 0000000000..65ebf8302a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bar_csimex2.html
@@ -0,0 +1,4 @@
+
+<?php
include_once ("../jpgraph.php");
include_once ("../jpgraph_bar.php");
$data1y=array(12,8,19,3,10,5);
$data2y=array(8,2,12,7,14,4);
// Create the graph. These two calls are always required
$graph = new Graph(310,200,'auto');
$graph->SetScale("textlin");
$graph->img->SetMargin(40,30,20,40);
$graph->SetShadow();
// Create the bar plots
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3",
"bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$b1plot->SetCSIMTargets($targ,$alts);
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
$targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9",
"bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$b2plot->SetCSIMTargets($targ,$alts);
// Create the grouped bar plot
$abplot = new AccBarPlot(array($b1plot,$b2plot));
$abplot->SetShadow();
$abplot->value->Show();
// ...and add it to the graPH
$graph->Add($abplot);
$graph->title->Set("Image map barex2");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('bar_csimex2.php');
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bar_csimex3.html b/html/includes/jpgraph/docs/html/exframes/bar_csimex3.html
new file mode 100644
index 0000000000..126e26712f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bar_csimex3.html
@@ -0,0 +1,4 @@
+
+<?php
// $Id: bar_csimex3.php,v 1.3 2002/08/31 20:03:46 aditus Exp $
// Horiontal bar graph with image maps
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$data1y=array(5,8,19,3,10,5);
$data2y=array(12,2,12,7,14,4);
// Setup the basic parameters for the graph
$graph = new Graph(400,700);
$graph->SetAngle(90);
$graph->SetScale("textlin");
// The negative margins are necessary since we
// have rotated the image 90 degress and shifted the
// meaning of width, and height. This means that the
// left and right margins now becomes top and bottom
// calculated with the image width and not the height.
$graph->img->SetMargin(-80,-80,210,210);
$graph->SetMarginColor('white');
// Setup title for graph
$graph->title->Set('Horizontal bar graph');
$graph->title->SetFont(FF_FONT2,FS_BOLD);
$graph->subtitle->Set("With image map\nNote: The URL just points back to this image");
// Setup X-axis.
$graph->xaxis->SetTitle("X-title",'center');
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetAngle(90);
$graph->xaxis->SetTitleMargin(30);
$graph->xaxis->SetLabelMargin(15);
$graph->xaxis->SetLabelAlign('right','center');
// Setup Y-axis
// First we want it at the bottom, i.e. the 'max' value of the
// x-axis
$graph->yaxis->SetPos('max');
// Arrange the title
$graph->yaxis->SetTitle("Turnaround (mkr)",'center');
$graph->yaxis->SetTitleSide(SIDE_RIGHT);
$graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD);
$graph->yaxis->title->SetAngle(0);
$graph->yaxis->title->Align('center','top');
$graph->yaxis->SetTitleMargin(30);
// Arrange the labels
$graph->yaxis->SetLabelSide(SIDE_RIGHT);
$graph->yaxis->SetLabelAlign('center','top');
// Create the bar plots with image maps
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3",
"bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$b1plot->SetCSIMTargets($targ,$alts);
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
$targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9",
"bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$b2plot->SetCSIMTargets($targ,$alts);
// Create the accumulated bar plot
$abplot = new AccBarPlot(array($b1plot,$b2plot));
$abplot->SetShadow();
// We want to display the value of each bar at the top
$abplot->value->Show();
$abplot->value->SetFont(FF_FONT1,FS_NORMAL);
$abplot->value->SetAlign('left','center');
$abplot->value->SetColor("black","darkred");
$abplot->value->SetFormat('%.1f mkr');
// ...and add it to the graph
$graph->Add($abplot);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('bar_csimex3.php','bar_csimex3');
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex1.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex1.html
new file mode 100644
index 0000000000..090658a724
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_MIDVER"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDVER);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex2.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex2.html
new file mode 100644
index 0000000000..b92655069a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_MIDHOR"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDHOR);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex3.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex3.html
new file mode 100644
index 0000000000..ee439bb643
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_HOR"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_HOR);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex4.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex4.html
new file mode 100644
index 0000000000..27a72a6a77
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_VER"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_VER);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex5.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex5.html
new file mode 100644
index 0000000000..d4ed655bec
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex5.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_WIDE_MIDVER"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDVER);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex6.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex6.html
new file mode 100644
index 0000000000..9f2609a610
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex6.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_WIDE_MIDHOR"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDHOR);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex7.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex7.html
new file mode 100644
index 0000000000..74d354fcb9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex7.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_CENTER"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_CENTER);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bargradsmallex8.html b/html/includes/jpgraph/docs/html/exframes/bargradsmallex8.html
new file mode 100644
index 0000000000..99f2682f08
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bargradsmallex8.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// We need some data
$datay=array(4,8,6);
// Setup the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(25,15,25,25);
$graph->title->Set('"GRAD_RAISED_PANEL"');
$graph->title->SetColor('darkred');
// Setup font for axis
$graph->xaxis->SetFont(FF_FONT1);
$graph->yaxis->SetFont(FF_FONT1);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient('navy','orange',GRAD_RAISED_PANEL);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/barline_csimex1.html b/html/includes/jpgraph/docs/html/exframes/barline_csimex1.html
new file mode 100644
index 0000000000..2bdcf5456b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/barline_csimex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_bar.php");
$ydata = array(2,3,4,5,6,7,8,9,10,11);
$ydata2 = array(1,2,3,4,5,6,7,8,9,10);
$targ = array("#1","#2","#3","#4","#5","#6","#7","#8","#9","#10");
$alt = array(1,2,3,4,5,6,7,8,9,10);
// Create the graph.
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,20,30,40);
$graph->title->Set("CSIM example with bar and line");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Setup axis titles
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_FILLEDCIRCLE);
$lineplot->mark->SetWidth(5);
$lineplot->mark->SetColor('black');
$lineplot->mark->SetFillColor('red');
$lineplot->SetCSIMTargets($targ,$alt);
// Create line plot
$barplot=new barPlot($ydata2);
$barplot->SetCSIMTargets($targ,$alt);
// Add the plots to the graph
$graph->Add($lineplot);
$graph->Add($barplot);
$graph->StrokeCSIM('barline_csimex1.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/barlinefreq_csimex1.html b/html/includes/jpgraph/docs/html/exframes/barlinefreq_csimex1.html
new file mode 100644
index 0000000000..c216574593
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/barlinefreq_csimex1.html
@@ -0,0 +1,4 @@
+
+<?php
//
// Example of CSIM frequence bar that uses the cache
//
include_once ("../jpgraph.php");
include_once ("../jpgraph_bar.php");
include_once ("../jpgraph_line.php");
// Utility function to calculate the accumulated frequence
// for a set of values and ocurrences
function accfreq($data) {
rsort($data);
$s = array_sum($data);
$as = array($data[0]);
$asp = array(100*$as[0]/$s);
$n = count($data);
for( $i=1; $i < $n; ++$i ) {
$as[$i] = $as[$i-1]+$data[$i];
$asp[$i] = 100.0*$as[$i]/$s;
}
return $asp;
}
// some data
$data_freq = array(22,20,12,10,5,4,2);
$data_accfreq = accfreq($data_freq);
// Create the graph.
$graph = new Graph(350,250);
// We need to make this extra call for CSIM scripts
// that make use of the cache. If the cache contains this
// graph the HTML wrapper will be returned and then the
// method will call exit() and hence NO LINES AFTER THIS
// CALL WILL BE EXECUTED.
// $graph->CheckCSIMCache('auto');
// Setup some basic graph parameters
$graph->SetScale("textlin");
$graph->SetY2Scale('lin',0,100);
$graph->img->SetMargin(50,70,30,40);
$graph->yaxis->SetTitleMargin(30);
$graph->SetMarginColor('#EEEEEE');
// Setup titles and fonts
$graph->title->Set("Frequence plot");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Turn the tickmarks
$graph->xaxis->SetTickSide(SIDE_DOWN);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->y2axis->SetTickSide(SIDE_RIGHT);
$graph->y2axis->SetColor('black','blue');
$graph->y2axis->SetLabelFormat('%3d.0%%');
// Create a bar pot
$bplot = new BarPlot($data_freq);
// Create targets and alt texts for the image maps. One for each bar
// (In this example this is just "dummy" targets)
$targ=array("#1","#2","#3","#4","#5","#6","#7");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$bplot->SetCSIMTargets($targ,$alts);
// Create accumulative graph
$lplot = new LinePlot($data_accfreq);
// We want the line plot data point in the middle of the bars
$lplot->SetBarCenter();
// Use transperancy
$lplot->SetFillColor('lightblue@0.6');
$lplot->SetColor('blue@0.6');
//$lplot->SetColor('blue');
$graph->AddY2($lplot);
// Setup the bars
$bplot->SetFillColor("orange@0.2");
$bplot->SetValuePos('center');
$bplot->value->SetFormat("%d");
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$bplot->value->Show();
// Add it to the graph
$graph->Add($bplot);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('barlinefreq_csimex1.php');
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bartutex1.html b/html/includes/jpgraph/docs/html/exframes/bartutex1.html
new file mode 100644
index 0000000000..773a6834f5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bartutex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$databary=array(12,7,16,5,7,14,9,3);
// New graph with a drop shadow
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale("textlin");
// Set title and subtitle
$graph->title->Set("Elementary barplot with a text scale");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
//$b1->SetAbsWidth(6);
//$b1->SetShadow();
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the image
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bartutex2.html b/html/includes/jpgraph/docs/html/exframes/bartutex2.html
new file mode 100644
index 0000000000..debde985d1
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bartutex2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$databary=array(12,7,16,6,7,14,9,3);
$months=$gDateLocale->GetShortMonth();
// New graph with a drop shadow
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale("textlin");
// Specify X-labels
$graph->xaxis->SetTickLabels($months);
// Set title and subtitle
$graph->title->Set("Textscale with specified labels");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
//$b1->SetAbsWidth(6);
//$b1->SetShadow();
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the image
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bartutex3.html b/html/includes/jpgraph/docs/html/exframes/bartutex3.html
new file mode 100644
index 0000000000..c48d1f0267
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bartutex3.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$months=$gDateLocale->GetShortMonth();
srand ((double) microtime() * 1000000);
for( $i=0; $i<25; ++$i) {
$databary[]=rand(1,50);
$databarx[]=$months[$i%12];
}
// New graph with a drop shadow
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale("textlin");
// Specify X-labels
$graph->xaxis->SetTickLabels($databarx);
// Set title and subtitle
$graph->title->Set("Bar tutorial example 3");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
//$b1->SetAbsWidth(6);
//$b1->SetShadow();
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the image
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bartutex4.html b/html/includes/jpgraph/docs/html/exframes/bartutex4.html
new file mode 100644
index 0000000000..4f030cb6fe
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bartutex4.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$months=$gDateLocale->GetShortMonth();
srand ((double) microtime() * 1000000);
for( $i=0; $i<25; ++$i) {
$databary[]=rand(1,50);
$databarx[]=$months[$i%12];
}
// New graph with a drop shadow
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale("textlin");
// Specify X-labels
//$databarx = array('tXi','','','xxx','','','iXii','','','OOO','','','tOO');
$graph->xaxis->SetFont(FF_FONT1,FS_NORMAL);
$graph->xaxis->SetTickLabels($databarx);
$graph->xaxis->SetTextLabelInterval(3);
// Set title and subtitle
$graph->title->Set("Displaying only every third label");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
//$b1->SetAbsWidth(6);
//$b1->SetShadow();
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the image
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bartutex5.html b/html/includes/jpgraph/docs/html/exframes/bartutex5.html
new file mode 100644
index 0000000000..91be3b7f20
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bartutex5.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$months=$gDateLocale->GetShortMonth();
srand ((double) microtime() * 1000000);
for( $i=0; $i<25; ++$i) {
$databary[]=rand(1,50);
$databarx[]=$months[$i%12];
}
// New graph with a drop shadow
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale("textlin");
// Specify X-labels
$graph->xaxis->SetTickLabels($databarx);
$graph->xaxis->SetTextLabelInterval(1);
$graph->xaxis->SetTextTickInterval(3);
// Set title and subtitle
$graph->title->Set("Bar tutorial example 5");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
$b1->SetWidth(0.4);
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the image
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/bartutex6.html b/html/includes/jpgraph/docs/html/exframes/bartutex6.html
new file mode 100644
index 0000000000..38be9517ff
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/bartutex6.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
// Some data
$months=$gDateLocale->GetShortMonth();
srand ((double) microtime() * 1000000);
for( $i=0; $i<25; ++$i) {
$databary[]=rand(1,50);
$databarx[]=$months[$i%12];
}
// New graph with a drop shadow
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale("textlin");
// Specify X-labels
$graph->xaxis->SetTickLabels($databarx);
$graph->xaxis->SetTextLabelInterval(3);
// Hide the tick marks
$graph->xaxis->HideTicks();
// Set title and subtitle
$graph->title->Set("Bar tutorial example 6");
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
$b1->SetWidth(0.4);
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the image
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/boxstockcsimex1.html b/html/includes/jpgraph/docs/html/exframes/boxstockcsimex1.html
new file mode 100644
index 0000000000..9290325acc
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/boxstockcsimex1.html
@@ -0,0 +1,4 @@
+
+<?php
// Example of a stock chart
include ("../jpgraph.php");
include ("../jpgraph_stock.php");
// Data must be in the format : open,close,min,max,median
$datay = array(
34,42,27,45,36,
55,25,14,59,40,
15,40,12,47,23,
62,38,25,65,57,
38,49,32,64,45);
// Setup a simple graph
$graph = new Graph(300,200);
$graph->SetScale("textlin");
$graph->SetMarginColor('lightblue');
$graph->title->Set('Box Stock chart example');
// Create a new stock plot
$p1 = new BoxPlot($datay);
// Setup URL target for image map
$p1->SetCSIMTargets(array('#1','#2','#3','#4','#5'));
// Width of the bars (in pixels)
$p1->SetWidth(9);
//$p1->SetCenter();
// Uncomment the following line to hide the horizontal end lines
//$p1->HideEndLines();
// Add the plot to the graph and send it back to the browser
$graph->Add($p1);
$graph->StrokeCSIM(basename(__FILE__));
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/boxstockex1.html b/html/includes/jpgraph/docs/html/exframes/boxstockex1.html
new file mode 100644
index 0000000000..5ed65bcea2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/boxstockex1.html
@@ -0,0 +1,4 @@
+
+<?php
// Example of a stock chart
include ("../jpgraph.php");
include ("../jpgraph_stock.php");
// Data must be in the format : open,close,min,max,median
$datay = array(
34,42,27,45,36,
55,25,14,59,40,
15,40,12,47,23,
62,38,25,65,57,
38,49,32,64,45);
// Setup a simple graph
$graph = new Graph(300,200);
$graph->SetScale("textlin");
$graph->SetMarginColor('lightblue');
$graph->title->Set('Box Stock chart example');
// Create a new stock plot
$p1 = new BoxPlot($datay);
// Width of the bars (in pixels)
$p1->SetWidth(9);
// Uncomment the following line to hide the horizontal end lines
//$p1->HideEndLines();
// Add the plot to the graph and send it back to the browser
$graph->Add($p1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/builtinplotmarksex1.html b/html/includes/jpgraph/docs/html/exframes/builtinplotmarksex1.html
new file mode 100644
index 0000000000..88ee9f49ab
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/builtinplotmarksex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay1 = array(2,6,7,12,13,18);
$datay2 = array(5,12,12,19,25,20);
// Setup the graph
$graph = new Graph(350,200);
$graph->SetMargin(30,20,60,20);
$graph->SetMarginColor('white');
$graph->SetScale("linlin");
// Hide the frame around the graph
$graph->SetFrame(false);
// Setup title
$graph->title->Set("Using Builtin PlotMarks");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
// Note: requires jpgraph 1.12p or higher
// $graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_PLOT);
$graph->tabtitle->Set('Region 1' );
$graph->tabtitle->SetWidth(TABTITLE_WIDTHFULL);
// Enable X and Y Grid
$graph->xgrid->Show();
$graph->xgrid->SetColor('gray@0.5');
$graph->ygrid->SetColor('gray@0.5');
// Format the legend box
$graph->legend->SetColor('navy');
$graph->legend->SetFillColor('lightgreen');
$graph->legend->SetLineWeight(1);
$graph->legend->SetFont(FF_ARIAL,FS_BOLD,8);
$graph->legend->SetShadow('gray@0.4',3);
$graph->legend->SetAbsPos(15,120,'right','bottom');
// Create the line plots
$p1 = new LinePlot($datay1);
$p1->SetColor("red");
$p1->SetFillColor("yellow@0.5");
$p1->SetWeight(2);
$p1->mark->SetType(MARK_IMG_DIAMOND,5,0.6);
$p1->SetLegend('2006');
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$p2->SetColor("darkgreen");
$p2->SetWeight(2);
$p2->SetLegend('2001');
$p2->mark->SetType(MARK_IMG_MBALL,'red');
$graph->Add($p2);
// Add a vertical line at the end scale position '7'
$l1 = new PlotLine(VERTICAL,7);
$graph->Add($l1);
// Output the graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvas_jpgarchex.html b/html/includes/jpgraph/docs/html/exframes/canvas_jpgarchex.html
new file mode 100644
index 0000000000..5ff0a6aa43
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvas_jpgarchex.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvas_jpgarchex.php,v 1.3 2002/08/29 10:14:19 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
// Scale we are using
$ymax=24;
$xmax=20;
// Setup the basic canvas
$g = new CanvasGraph(700,650,'auto');
$g->SetMargin(2,3,2,3);
$g->SetMarginColor("teal");
$g->InitFrame();
// ... and a scale
$scale = new CanvasScale($g);
$scale->Set(0,$xmax,0,$ymax);
// ... we need shape since we want the indented rectangle
$shape = new Shape($g,$scale);
$shape->SetColor('black');
// ... basic parameters for the overall image
$l = 2; // Left margin
$r = 18; // Row number to start the lowest line on
$width = 16; // Total width
// Setup the two basic rectangle text object we will use
$tt = new CanvasRectangleText();
$tt->SetFont(FF_ARIAL,FS_NORMAL,14);
$tt->SetFillColor('');
$tt->SetColor('');
$tt->SetFontColor('navy');
$t = new CanvasRectangleText();
$t->SetFont(FF_ARIAL,FS_NORMAL,14);
$t->SetFillColor('goldenrod1');
$t->SetFontColor('navy');
// Now start drawing the arch overview from the bottom and up
// This is all pretty manual and one day I will write a proper
// framework to make it easy to construct these types of architecture
// overviews. But for now, just plain old coordinates..
// Line: GD Library and image libraries
$h=3;
$s = 3; $d=$l + $width-9;
$t->SetFillColor('cadetblue3');
$t->Set("TTF",$d,$r+2,$s,1);
$t->Stroke($g->img,$scale);
$t->Set("PNG",$d+$s,$r+2,$s,1);
$t->Stroke($g->img,$scale);
$t->Set("JPEG",$d+2*$s,$r+2,$s,1);
$t->Stroke($g->img,$scale);
$shape->IndentedRectangle($l,$r,$width,$h,$s*3,1,2,'lightgreen');
$tt->Set("GD Basic library\n(1.8.x or 2.x)",$l,$r,$width,$h-1);
$tt->Stroke($g->img,$scale);
// Area: Basic internal JpGraph architecture
$t->SetFillColor('goldenrod1');
$h = 2;
$r -= $h; $d=8;
$t->Set("Image primitives\n(RGB, Anti-aliasing,\nGD Abstraction)",$l,$r-0.5,$width*0.5,$h+0.5);
$t->Stroke($g->img,$scale);
$t->Set("Image Cache &\nStreaming",$l+0.5*$width,$r,$width*0.4,$h);
$t->Stroke($g->img,$scale);
$r -= $h; $d=8;
$t->Set("2D Rot & Transformation",$l,$r,$width*0.5,$h-0.5); $t->Stroke($g->img,$scale);
$r -= 2; $h = 4;
$shape->IndentedRectangle($l,$r,$width*0.9,$h,$d,2,3,'goldenrod1');
$tt->Set("Axis, Labelling, (Auto)-Scaling",$l,$r,$width*0.9,$h-2); $tt->Stroke($g->img,$scale);
$r -= 1;
$shape->IndentedRectangle($l,$r,$width,7,$width*0.9,6,3,'goldenrod1');
$tt->Set("Error handling & Utility classes",$l,$r,$width,1); $tt->Stroke($g->img,$scale);
// Area: Top area with graph components
$t->SetFillColor('gold1');
$r -= 3;
$w = $width*0.55/4; $h = 2;
$t->Set("Gantt\nGraph",$l,$r,$w,$h);
$t->Stroke($g->img,$scale);
$t->Set("Pie\nGraph",$l+$w,$r,$w,$h);
$t->Stroke($g->img,$scale);
$t->Set("Radar\nGraph",$l+$w*2,$r,$w,$h);
$t->Stroke($g->img,$scale);
$shape->IndentedRectangle($l,$r,$width,3,4*$w,2,0,'gold1');
$tt->Set("Base Graph\n(Orthogonal\ncoordinate system)",$l+4*$w,$r,$width-$w*4,3);
$tt->Stroke($g->img,$scale);
$r -= 2;
$d = 0.7;
$shape->IndentedRectangle($l+3*$w,$r,$w,4, $w*$d,2,0,'gold1');
$t->Set("Canv\nUtil",$l+3*$w,$r,$w*$d,$h); $t->Stroke($g->img,$scale);
$tt->Set("Canvas\nGraph",$l+3*$w,$r+2,$w,2); $tt->Stroke($g->img,$scale);
// Top line of plotting plugins
$t->SetFillColor('cyan');
$t->Set("Gantt\nPlot",$l,$r,$w,$h); $t->Stroke($g->img,$scale);
$t->Set("2D\nPlot",$l+$w,$r,$w/2,$h); $t->Stroke($g->img,$scale);
$t->Set("3D\nPlot",$l+$w+$w/2,$r,$w/2,$h);$t->Stroke($g->img,$scale);
$t->Set("Radar\nPlot",$l+2*$w,$r,$w,$h); $t->Stroke($g->img,$scale);
$wp = ($width - 4*$w)/4;
$t->Set("Error\nPlot",$l+4*$w,$r,$wp,$h); $t->Stroke($g->img,$scale);
$t->Set("Line\nPlot",$l+4*$w+$wp,$r,$wp,$h); $t->Stroke($g->img,$scale);
$t->Set("Bar\nPlot",$l+4*$w+2*$wp,$r,$wp,$h); $t->Stroke($g->img,$scale);
$t->Set("Scatter\nPlot",$l+4*$w+3*$wp,$r,$wp,$h); $t->Stroke($g->img,$scale);
// Show application top
$r -= 2.5; $h=2;
$t->SetFillColor('blue');
$t->SetFontColor('white');
$t->SetFont(FF_ARIAL,FS_BOLD,20);
$t->Set("PHP Application",$l,$r,$width,$h); $t->Stroke($g->img,$scale);
// Stroke title
$r = 0.5;
$tt->SetFontColor('black');
$tt->SetFont(FF_TIMES,FS_BOLD,28);
$tt->Set("JpGraph Architecture Overview",$l,$r,$width,1);
$tt->Stroke($g->img,$scale);
// Stroke footer
$tt->SetFont(FF_VERDANA,FS_NORMAL,10);
$tt->Set("Generated: ".date("ymd H:m",time()),0.1,$ymax*0.95);
$tt->Stroke($g->img,$scale);
// .. and stream it all back
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvasex01.html b/html/includes/jpgraph/docs/html/exframes/canvasex01.html
new file mode 100644
index 0000000000..8ae2722768
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvasex01.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvasex01.php,v 1.3 2002/10/23 08:17:23 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
// Setup a basic canvas we can work
$g = new CanvasGraph(400,300,'auto');
$g->SetMargin(5,11,6,11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Draw a text box in the middle
$txt="This\nis\na TEXT!!!";
$t = new Text($txt,200,10);
$t->SetFont(FF_ARIAL,FS_BOLD,40);
// How should the text box interpret the coordinates?
$t->Align('center','top');
// How should the paragraph be aligned?
$t->ParagraphAlign('center');
// Add a box around the text, white fill, black border and gray shadow
$t->SetBox("white","black","gray");
// Stroke the text
$t->Stroke($g->img);
// Stroke the graph
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvasex02.html b/html/includes/jpgraph/docs/html/exframes/canvasex02.html
new file mode 100644
index 0000000000..a6efdc6a18
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvasex02.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvasex02.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
// Setup a basic canvas we can work
$g = new CanvasGraph(400,200,'auto');
$g->SetMargin(5,11,6,11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Add a black line
$g->img->SetColor('black');
$g->img->Line(0,0,100,100);
// .. and a circle (x,y,diameter)
$g->img->Circle(100,100,50);
// .. and a filled circle (x,y,diameter)
$g->img->SetColor('red');
$g->img->FilledCircle(200,100,50);
// .. add a rectangle
$g->img->SetColor('green');
$g->img->FilledRectangle(10,10,50,50);
// .. add a filled rounded rectangle
$g->img->SetColor('green');
$g->img->FilledRoundedRectangle(300,30,350,80,10);
// .. with a darker border
$g->img->SetColor('darkgreen');
$g->img->RoundedRectangle(300,30,350,80,10);
// Stroke the graph
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvasex03.html b/html/includes/jpgraph/docs/html/exframes/canvasex03.html
new file mode 100644
index 0000000000..ee9b211e3a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvasex03.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvasex03.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
// Define work space
$xmax=20;
$ymax=20;
// Setup a basic canvas we can work
$g = new CanvasGraph(400,200,'auto');
$g->SetMargin(5,11,6,11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Create a new scale
$scale = new CanvasScale($g);
$scale->Set(0,$xmax,0,$ymax);
// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g,$scale);
$shape->SetColor('black');
// Add a black line
$shape->SetColor('black');
$shape->Line(0,0,20,20);
// .. and a circle (x,y,diameter)
$shape->Circle(5,14,2);
// .. and a filled circle (x,y,diameter)
$shape->SetColor('red');
$shape->FilledCircle(11,8,3);
// .. add a rectangle
$shape->SetColor('green');
$shape->FilledRectangle(15,8,19,14);
// .. add a filled rounded rectangle
$shape->SetColor('green');
$shape->FilledRoundedRectangle(2,3,8,6);
// .. with a darker border
$shape->SetColor('darkgreen');
$shape->RoundedRectangle(2,3,8,6);
// Stroke the graph
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvasex04.html b/html/includes/jpgraph/docs/html/exframes/canvasex04.html
new file mode 100644
index 0000000000..254419de12
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvasex04.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvasex04.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
// Define work space
$xmax=20;
$ymax=20;
// Setup a basic canvas we can work
$g = new CanvasGraph(200,100,'auto');
$g->SetMargin(5,11,6,11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Create a new scale
$scale = new CanvasScale($g);
$scale->Set(0,$xmax,0,$ymax);
// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g,$scale);
$shape->SetColor('black');
// Add a black line
$shape->SetColor('black');
$shape->Line(0,0,20,20);
// .. and a circle (x,y,diameter)
$shape->Circle(5,14,2);
// .. and a filled circle (x,y,diameter)
$shape->SetColor('red');
$shape->FilledCircle(11,8,3);
// .. add a rectangle
$shape->SetColor('green');
$shape->FilledRectangle(15,8,19,14);
// .. add a filled rounded rectangle
$shape->SetColor('green');
$shape->FilledRoundedRectangle(2,3,8,6);
// .. with a darker border
$shape->SetColor('darkgreen');
$shape->RoundedRectangle(2,3,8,6);
// Stroke the graph
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvasex05.html b/html/includes/jpgraph/docs/html/exframes/canvasex05.html
new file mode 100644
index 0000000000..c740c3889c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvasex05.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvasex05.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
// Define work space
$xmax=40;
$ymax=40;
// Setup a basic canvas we can work
$g = new CanvasGraph(400,200,'auto');
$g->SetMargin(5,11,6,11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Create a new scale
$scale = new CanvasScale($g);
$scale->Set(0,$xmax,0,$ymax);
// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g,$scale);
$shape->SetColor('black');
// Add a black line
$shape->SetColor('black');
$shape->Line(0,0,20,20);
// .. and a circle (x,y,diameter)
$shape->Circle(5,14,2);
// .. and a filled circle (x,y,diameter)
$shape->SetColor('red');
$shape->FilledCircle(11,8,3);
// .. add a rectangle
$shape->SetColor('green');
$shape->FilledRectangle(15,8,19,14);
// .. add a filled rounded rectangle
$shape->SetColor('green');
$shape->FilledRoundedRectangle(2,3,8,6);
// .. with a darker border
$shape->SetColor('darkgreen');
$shape->RoundedRectangle(2,3,8,6);
// Stroke the graph
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/canvasex06.html b/html/includes/jpgraph/docs/html/exframes/canvasex06.html
new file mode 100644
index 0000000000..7faf171f7d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/canvasex06.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: canvasex06.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
// Define work space
$xmax=40;
$ymax=40;
// Setup a basic canvas we can work
$g = new CanvasGraph(400,200,'auto');
$g->SetMargin(5,11,6,11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Create a new scale
$scale = new CanvasScale($g);
$scale->Set(0,$xmax,0,$ymax);
// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g,$scale);
$shape->SetColor('black');
$shape->IndentedRectangle(1,2,15,15,8,8,CORNER_TOPLEFT,'khaki');
$shape->IndentedRectangle(1,20,15,15,8,8,CORNER_BOTTOMLEFT,'khaki');
$shape->IndentedRectangle(20,2,15,15,8,8,CORNER_TOPRIGHT,'khaki');
$shape->IndentedRectangle(20,20,15,15,8,8,CORNER_BOTTOMRIGHT,'khaki');
// Stroke the graph
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/color_chart01.html b/html/includes/jpgraph/docs/html/exframes/color_chart01.html
new file mode 100644
index 0000000000..014d1242c6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/color_chart01.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
// The callback that converts timestamp to minutes and seconds
function TimeCallback($aVal) {
return Date('H:i:s',$aVal);
}
// Fake some suitable random data
$now = time();
$datax = array($now);
for( $i=0; $i < 360; $i += 10 ) {
$datax[] = $now + $i;
}
$n = count($datax);
$datay=array();
for( $i=0; $i < $n; ++$i ) {
$datay[] = rand(30,150);
}
// Setup the basic graph
$graph = new Graph(324,250);
$graph->SetMargin(40,40,30,70);
$graph->title->Set('Date: '.date('Y-m-d',$now));
$graph->SetAlphaBlending();
// Setup a manual x-scale (We leave the sentinels for the
// Y-axis at 0 which will then autoscale the Y-axis.)
// We could also use autoscaling for the x-axis but then it
// probably will start a little bit earlier than the first value
// to make the first value an even number as it sees the timestamp
// as an normal integer value.
$graph->SetScale("intlin",0,200,$now,$datax[$n-1]);
// Setup the x-axis with a format callback to convert the timestamp
// to a user readable time
$graph->xaxis->SetLabelFormatCallback('TimeCallback');
$graph->xaxis->SetLabelAngle(90);
// Create the line
$p1 = new LinePlot($datay,$datax);
$p1->SetColor("blue");
// Set the fill color partly transparent
$p1->SetFillColor("blue@0.4");
// Add lineplot to the graph
$graph->Add($p1);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/dateaxisex2.html b/html/includes/jpgraph/docs/html/exframes/dateaxisex2.html
new file mode 100644
index 0000000000..78c12afae2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/dateaxisex2.html
@@ -0,0 +1,4 @@
+
+<?php
require_once("../jpgraph.php");
require_once("../jpgraph_line.php");
require_once("../jpgraph_date.php");
// Create a data set in range (50,70) and X-positions
DEFINE('NDATAPOINTS',360);
DEFINE('SAMPLERATE',240);
$start = time();
$end = $start+NDATAPOINTS*SAMPLERATE;
$data = array();
$xdata = array();
for( $i=0; $i < NDATAPOINTS; ++$i ) {
$data[$i] = rand(50,70);
$xdata[$i] = $start + $i * SAMPLERATE;
}
// Create the new graph
$graph = new Graph(540,300);
// Slightly larger than normal margins at the bottom to have room for
// the x-axis labels
$graph->SetMargin(40,40,30,130);
// Fix the Y-scale to go between [0,100] and use date for the x-axis
$graph->SetScale('datlin',0,100);
$graph->title->Set("Example on Date scale");
// Set the angle for the labels to 90 degrees
$graph->xaxis->SetLabelAngle(90);
$line = new LinePlot($data,$xdata);
$line->SetLegend('Year 2005');
$line->SetFillColor('lightblue@0.5');
$graph->Add($line);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/dateaxisex4.html b/html/includes/jpgraph/docs/html/exframes/dateaxisex4.html
new file mode 100644
index 0000000000..6aef1c937b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/dateaxisex4.html
@@ -0,0 +1,4 @@
+
+<?php
require_once("../jpgraph.php");
require_once("../jpgraph_line.php");
require_once("../jpgraph_date.php");
// Create a data set in range (50,70) and X-positions
DEFINE('NDATAPOINTS',360);
DEFINE('SAMPLERATE',240);
$start = time();
$end = $start+NDATAPOINTS*SAMPLERATE;
$data = array();
$xdata = array();
for( $i=0; $i < NDATAPOINTS; ++$i ) {
$data[$i] = rand(50,70);
$xdata[$i] = $start + $i * SAMPLERATE;
}
// Create the new graph
$graph = new Graph(540,300);
// Slightly larger than normal margins at the bottom to have room for
// the x-axis labels
$graph->SetMargin(40,40,30,130);
// Fix the Y-scale to go between [0,100] and use date for the x-axis
$graph->SetScale('datlin',0,100);
$graph->title->Set("Example on Date scale");
// Set the angle for the labels to 90 degrees
$graph->xaxis->SetLabelAngle(90);
// The automatic format string for dates can be overridden
$graph->xaxis->scale->SetDateFormat('H:i');
// Adjust the start/end to a specific alignment
$graph->xaxis->scale->SetTimeAlign(MINADJ_10);
$line = new LinePlot($data,$xdata);
$line->SetLegend('Year 2005');
$line->SetFillColor('lightblue@0.5');
$graph->Add($line);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/dbschemaex1.html b/html/includes/jpgraph/docs/html/exframes/dbschemaex1.html
new file mode 100644
index 0000000000..30feb4925e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/dbschemaex1.html
@@ -0,0 +1,3 @@
+
+<?php
/*=======================================================================
// File: DBSCHEMAEX1.PHP
// Description: Draw a DB schema of the DDDA architecture
// Created: 2002-08-25
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: dbschemaex1.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
//
// License: This code is released under QPL
// Copyright (C) 2001,2002 Johan Persson
// Note: The actual drawing of the tables are semi-automatically
// but you can easily adjust the individual tables position
// with the 'tblposadj' array.
//
//========================================================================
*/
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
include "../utils/misc/imgdbschema.inc";
include "../utils/jpdocgen/jpdb.php";
// Global callback to format the table header names
function FormatTblName($aName) {
// We want to replace any specifi references to the
// 'JpGraph' project with the generic '<project>'
return str_replace('JpGraph','<project>', $aName);
}
// Global callback to format each field name in the table
function FormatFldName($aName,$aTable) {
return $aName;
}
class Driver {
var $ig, $img, $iscale, $ishape;
var $iymax,$ixmax;
var $iwidth,$iheight;
function Driver() {
// Define Image size and coordinate grid space to work within
$this->iwidth = 600;
$this->iheight= 750;
$this->iymax = 50;
$this->ixmax = 55;
// Setup a basic canvas
$this->ig = new CanvasGraph($this->iwidth,$this->iheight,'auto');
$this->img = $this->ig->img;
// Define the scale to be used
$this->iscale = new CanvasScale($this->ig);
$this->iscale->Set(0,$this->ixmax,0,$this->iymax);
$this->ishape = new Shape($this->ig,$this->iscale);
// A small frame around the canvas
$this->ig->SetMargin(2,3,2,3);
$this->ig->SetMarginColor("teal");
$this->ig->InitFrame();
}
function Run() {
$leftm=1.5; // Left margin (for table schemes)
$topm=5; // Top margin (for table schemes)
$tblwidth=15; // Individual table width
$tlo=1; // Offset for top line
// Add the background color for the project specific tables
$this->ishape->IndentedRectangle($leftm,$topm-1,3*$tblwidth+$tlo+6,45,
$tlo+2*$tblwidth+2,30,CORNER_BOTTOMLEFT,
'lightblue');
// Stroke the tables (series of x,y offsets, If =-1 then use the
// automtic positioning
$tblposadj=array($tlo,0,$tblwidth+$tlo+2,0,2*$tblwidth+$tlo+4,
0,-1,16,-1,16);
$dbschema = new ImgDBSchema('jpgraph_doc','FormatTblName','FormatFldName');
$dbschema->SetMargin($leftm,$topm);
$dbschema->SetTableWidth($tblwidth);
$dbschema->Stroke($this->img,$this->iscale,$tblposadj);
$tt = new CanvasRectangleText();
$tt->SetFillColor('');
$tt->SetColor('');
$tt->SetFontColor('navy');
// Add explanation
$tt->SetFont(FF_ARIAL,FS_NORMAL,12);
$tt->Set('Project specific tables',$tblwidth+$leftm+3,16,15);
$tt->Stroke($this->img,$this->iscale);
// Add title
$tt->SetColor('');
$tt->SetFont(FF_VERDANA,FS_BOLD,26);
$tt->Set('DDDA - DB Schema',9,0.5,30);
$tt->Stroke($this->img,$this->iscale);
// Add a version and date
$tt->SetFillColor('yellow');
$tt->SetFont(FF_FONT1,FS_NORMAL,10);
$tt->Set("Generated: ".date("ymd H:i",time()),1,$this->iymax*0.96,15);
$tt->Stroke($this->img,$this->iscale);
$this->ig->Stroke();
}
}
$driver = new Driver();
$driver->Run();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example0.html b/html/includes/jpgraph/docs/html/exframes/example0.html
new file mode 100644
index 0000000000..2c8e330116
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example0.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
// Some data
$ydata = array(11,3,8,12,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(350,250,"auto");
$graph->SetScale("textlin");
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetColor("blue");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example11.html b/html/includes/jpgraph/docs/html/exframes/example11.html
new file mode 100644
index 0000000000..d0bf65960d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example11.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$ydata2 = array(1,19,15,7,22,14,5,9,21,13);
$gJpgBrandTiming=true;
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($ydata2);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->Add($lineplot2);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Timing a graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$graph->yaxis->SetColor("red");
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example13.html b/html/includes/jpgraph/docs/html/exframes/example13.html
new file mode 100644
index 0000000000..e774c5e418
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example13.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_error.php");
$errdatay = array(11,9,2,4,19,26,13,19,7,12);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,30,20,40);
$graph->SetShadow();
// Create the error plot
$errplot=new ErrorPlot($errdatay);
$errplot->SetColor("red");
$errplot->SetWeight(2);
// Add the plot to the graph
$graph->Add($errplot);
$graph->title->Set("Simple error plot");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$datax = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($datax);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example14.html b/html/includes/jpgraph/docs/html/exframes/example14.html
new file mode 100644
index 0000000000..5e08e04b54
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example14.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_error.php");
$errdatay = array(11,9,2,4,19,26,13,19,7,12);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,30,20,40);
$graph->SetShadow();
// Create the error plot
$errplot=new ErrorPlot($errdatay);
$errplot->SetColor("red");
$errplot->SetWeight(2);
$errplot->SetCenter();
// Add the plot to the graph
$graph->Add($errplot);
$graph->title->Set("Simple error plot");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$datax = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($datax);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example15.html b/html/includes/jpgraph/docs/html/exframes/example15.html
new file mode 100644
index 0000000000..94a61376b6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example15.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_error.php");
$errdatay = array(11,9,2,4,19,26,13,19,7,12);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,30,20,40);
$graph->SetShadow();
// Create the linear plot
$errplot=new ErrorLinePlot($errdatay);
$errplot->SetColor("red");
$errplot->SetWeight(2);
$errplot->SetCenter();
$errplot->line->SetWeight(2);
$errplot->line->SetColor("blue");
// Add the plot to the graph
$graph->Add($errplot);
$graph->title->Set("Linear error plot");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$datax = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($datax);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example16.1.html b/html/includes/jpgraph/docs/html/exframes/example16.1.html
new file mode 100644
index 0000000000..479cda61df
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example16.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_error.php");
include ("../jpgraph_bar.php");
$l1datay = array(11,9,2,4,3,13,17);
$l2datay = array(23,12,5,19,17,10,15);
$datax=array("Jan","Feb","Mar","Apr","May");
// Create the graph.
$graph = new Graph(400,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,130,20,40);
$graph->SetShadow();
// Create the linear error plot
$l1plot=new LinePlot($l1datay);
$l1plot->SetColor("red");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$l2plot = new LinePlot($l2datay);
$l2plot->SetFillColor("orange");
$l2plot->SetLegend("Result");
// Add the plots to the graph
$graph->Add($l2plot);
$graph->Add($l1plot);
$graph->title->Set("Mixing line and filled line");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
//$graph->xaxis->SetTickLabels($datax);
//$graph->xaxis->SetTextTickInterval(2);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example16.2.html b/html/includes/jpgraph/docs/html/exframes/example16.2.html
new file mode 100644
index 0000000000..e27c3fccfb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example16.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_bar.php");
$l1datay = array(11,9,2,4,3,13,17);
$l2datay = array(23,12,5,19,17,10,15);
$datax=array("Jan","Feb","Mar","Apr","May");
// Create the graph.
$graph = new Graph(400,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,130,20,40);
$graph->SetShadow();
// Create the linear error plot
$l1plot=new LinePlot($l1datay);
$l1plot->SetColor("red");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$bplot = new BarPlot($l2datay);
$bplot->SetFillColor("orange");
$bplot->SetLegend("Result");
// Add the plots to t'he graph
$graph->Add($l1plot);
$graph->Add($bplot);
$graph->title->Set("Adding a line plot to a bar graph v1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
//$graph->xaxis->SetTickLabels($datax);
//$graph->xaxis->SetTextTickInterval(2);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example16.3.html b/html/includes/jpgraph/docs/html/exframes/example16.3.html
new file mode 100644
index 0000000000..232541c454
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example16.3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_bar.php");
$l1datay = array(11,9,2,4,3,13,17);
$l2datay = array(23,12,5,19,17,10,15);
$datax=array("Jan","Feb","Mar","Apr","May");
// Create the graph.
$graph = new Graph(400,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,130,20,40);
$graph->SetShadow();
// Create the linear error plot
$l1plot=new LinePlot($l1datay);
$l1plot->SetColor("red");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$bplot = new BarPlot($l2datay);
$bplot->SetFillColor("orange");
$bplot->SetLegend("Result");
// Add the plots to t'he graph
$graph->Add($bplot);
$graph->Add($l1plot);
$graph->title->Set("Adding a line plot to a bar graph v1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
//$graph->xaxis->SetTickLabels($datax);
//$graph->xaxis->SetTextTickInterval(2);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example16.4.html b/html/includes/jpgraph/docs/html/exframes/example16.4.html
new file mode 100644
index 0000000000..328f6824e8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example16.4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_bar.php");
$l1datay = array(11,9,2,4,3,13,17);
$l2datay = array(23,12,5,19,17,10,15);
// Create the graph.
$graph = new Graph(400,200,"auto");
$graph->SetScale("intlin");
$graph->img->SetMargin(40,130,20,40);
$graph->SetShadow();
// Create the linear error plot
$l1plot=new LinePlot($l1datay);
$l1plot->SetColor("red");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$bplot = new BarPlot($l2datay);
$bplot->SetFillColor("orange");
$bplot->SetLegend("Result");
// Add the plots to t'he graph
$graph->Add($bplot);
$graph->Add($l1plot);
$graph->title->Set("Adding a line plot to a bar graph v3");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$datax = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($datax);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example16.6.html b/html/includes/jpgraph/docs/html/exframes/example16.6.html
new file mode 100644
index 0000000000..46788dde83
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example16.6.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
include ("../jpgraph_line.php");
// Create some "fake" regression data
$datay = array();
$datay2 = array();
$datax = array();
$a=rand(-3,3);
$b=rand(-5,5);
for($x=0; $x<20; ++$x) {
$datay[] = $a*$x + $b;
$datay2[] = $a*$x + $b + rand(-30,30);
$datax[] = $x;
}
// Create the graph
$graph = new Graph(300,200,'auto');
$graph->SetScale("linlin");
// Setup title
$graph->title->Set("Example of linear regression");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// make sure that the X-axis is always at the
// bottom at the plot and not just at Y=0 which is
// the default position
$graph->xaxis->SetPos('min');
// Create the scatter plot with some nice colors
$sp1 = new ScatterPlot($datay2,$datax);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("red");
$sp1->SetColor("blue");
$sp1->SetWeight(3);
$sp1->mark->SetWidth(4);
// Create the regression line
$lplot = new LinePlot($datay);
$lplot->SetWeight(2);
$lplot->SetColor('navy');
// Add the pltos to the line
$graph->Add($sp1);
$graph->Add($lplot);
// ... and stroke
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example16.html b/html/includes/jpgraph/docs/html/exframes/example16.html
new file mode 100644
index 0000000000..d40ff74f11
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example16.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_error.php");
$errdatay = array(11,9,2,4,19,26,13,19,7,12);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,30,20,40);
$graph->SetShadow();
// Create the linear plot
$errplot=new ErrorLinePlot($errdatay);
$errplot->SetColor("red");
$errplot->SetWeight(2);
$errplot->SetCenter();
$errplot->line->SetWeight(2);
$errplot->line->SetColor("blue");
// Setup the legends
$errplot->SetLegend("Min/Max");
$errplot->line->SetLegend("Average");
// Add the plot to the graph
$graph->Add($errplot);
$graph->title->Set("Linear error plot");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$datax = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($datax);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example17.html b/html/includes/jpgraph/docs/html/exframes/example17.html
new file mode 100644
index 0000000000..a51dac0ade
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example17.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay1 = array(11,7,5,8,3,5,5,4,8,6,5,5,3,2,5,1,2,0);
$datay2 = array( 4,5,4,5,6,5,7,4,7,4,4,3,2,4,1,2,2,1);
$datay3 = array(4,5,7,10,13,15,15,22,26,26,30,34,40,43,47,55,60,62);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
// Create the linear plots for each category
$dplot[] = new LinePLot($datay1);
$dplot[] = new LinePLot($datay2);
$dplot[] = new LinePLot($datay3);
$dplot[0]->SetFillColor("red");
$dplot[1]->SetFillColor("blue");
$dplot[2]->SetFillColor("green");
// Create the accumulated graph
$accplot = new AccLinePlot($dplot);
// Add the plot to the graph
$graph->Add($accplot);
$graph->xaxis->SetTextTickInterval(2);
$graph->title->Set("Example 17");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example18.html b/html/includes/jpgraph/docs/html/exframes/example18.html
new file mode 100644
index 0000000000..55bb253723
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example18.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example19.1.html b/html/includes/jpgraph/docs/html/exframes/example19.1.html
new file mode 100644
index 0000000000..95e7e98160
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example19.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(260,100,"auto");
$graph->SetScale("linlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Bar graph, linear scale");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example19.html b/html/includes/jpgraph/docs/html/exframes/example19.html
new file mode 100644
index 0000000000..92e9a12877
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example19.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example2.html b/html/includes/jpgraph/docs/html/exframes/example2.html
new file mode 100644
index 0000000000..1ad2af19fc
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,10,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Setup margin and titles
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Example 2");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example20.1.html b/html/includes/jpgraph/docs/html/exframes/example20.1.html
new file mode 100644
index 0000000000..4327f7c912
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example20.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->value->Show();
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example20.2.html b/html/includes/jpgraph/docs/html/exframes/example20.2.html
new file mode 100644
index 0000000000..ee5734d8ff
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example20.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->value->Show();
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Bar graph with Y-scale grace");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example20.3.html b/html/includes/jpgraph/docs/html/exframes/example20.3.html
new file mode 100644
index 0000000000..0422805e7f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example20.3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetAngle(45);
$bplot->value->SetFormat('%0.1f');
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Bar graph with Y-scale grace");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example20.4.html b/html/includes/jpgraph/docs/html/exframes/example20.4.html
new file mode 100644
index 0000000000..54fcdf30f8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example20.4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->SetShadow();
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetAngle(45);
$bplot->value->SetFormat('%0.1f');
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Bar graph with drop shadow");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example20.5.html b/html/includes/jpgraph/docs/html/exframes/example20.5.html
new file mode 100644
index 0000000000..8b4d3e4f7f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example20.5.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
// Setup values
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$bplot->value->SetFont(FF_FONT1,FS_BOLD);
// Center the values in the bar
$bplot->SetValuePos('center');
// Make the bar a little bit wider
$bplot->SetWidth(0.7);
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Centered values for bars");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example20.html b/html/includes/jpgraph/docs/html/exframes/example20.html
new file mode 100644
index 0000000000..04ca2066d3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example20.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->SetWidth(1.0);
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example21.html b/html/includes/jpgraph/docs/html/exframes/example21.html
new file mode 100644
index 0000000000..ba7cb9d63a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example21.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$data1y=array(12,8,19,3,10,5);
$data2y=array(8,2,11,7,14,4);
// Create the graph. These two calls are always required
$graph = new Graph(310,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
// Create the bar plots
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($b1plot,$b2plot));
// ...and add it to the graPH
$graph->Add($gbplot);
$graph->title->Set("Example 21");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example22.html b/html/includes/jpgraph/docs/html/exframes/example22.html
new file mode 100644
index 0000000000..e4ea4c39da
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example22.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$data1y=array(12,8,19,3,10,5);
$data2y=array(8,2,11,7,14,4);
// Create the graph. These two calls are always required
$graph = new Graph(310,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
// Create the bar plots
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($b1plot,$b2plot));
$gbplot->SetWidth(0.9);
// ...and add it to the graPH
$graph->Add($gbplot);
$graph->title->Set("Adjusting the width");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example23.html b/html/includes/jpgraph/docs/html/exframes/example23.html
new file mode 100644
index 0000000000..9d994bb25b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example23.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
setlocale (LC_ALL, 'et_EE.ISO-8859-1');
$data1y=array(12,8,19,3,10,5);
$data2y=array(8,2,11,7,14,4);
// Create the graph. These two calls are always required
$graph = new Graph(310,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
// Create the bar plots
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
// Create the grouped bar plot
$gbplot = new AccBarPlot(array($b1plot,$b2plot));
// ...and add it to the graPH
$graph->Add($gbplot);
$graph->title->Set("Accumulated bar plots");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example24.html b/html/includes/jpgraph/docs/html/exframes/example24.html
new file mode 100644
index 0000000000..3d38277aae
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example24.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$data1y=array(12,8,19,3,10,5);
$data2y=array(8,2,11,7,14,4);
$data3y=array(3,9,2,7,5,8);
$data4y=array(1,5,11,2,14,4);
// Create the graph. These two calls are always required
$graph = new Graph(310,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
$b3plot = new BarPlot($data3y);
$b3plot->SetFillColor("green");
$b4plot = new BarPlot($data4y);
$b4plot->SetFillColor("brown");
// Create the accumulated bar plots
$ab1plot = new AccBarPlot(array($b1plot,$b2plot));
$ab2plot = new AccBarPlot(array($b3plot,$b4plot));
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($ab1plot,$ab2plot));
// ...and add it to the graph
$graph->Add($gbplot);
$graph->title->Set("Grouped Accumulated bar plots");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example25.1.html b/html/includes/jpgraph/docs/html/exframes/example25.1.html
new file mode 100644
index 0000000000..b0500568e9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example25.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Create and add a new text
$txt=new Text("This is a text");
$txt->Pos(10,25);
$txt->SetFont(FF_FONT1,FS_BOLD);
$txt->SetBox('yellow','navy','gray');
$txt->SetColor("red");
$graph->AddText($txt);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example25.2.html b/html/includes/jpgraph/docs/html/exframes/example25.2.html
new file mode 100644
index 0000000000..dddba05744
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example25.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Create and add a new text
$txt=new Text("This is a text\nwith many\nand even\nmore\nlines of text");
$txt->Pos(0.5,0.5,"center","center");
$txt->SetFont(FF_FONT2,FS_BOLD);
$txt->ParagraphAlign('cenetered');
$txt->SetBox('yellow','navy','gray');
$txt->SetColor("red");
$graph->AddText($txt);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example25.html b/html/includes/jpgraph/docs/html/exframes/example25.html
new file mode 100644
index 0000000000..60c012a35c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example25.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,8,19,3,10,5);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Create and add a new text
$txt=new Text("This is a text");
$txt->Pos(0,0);
$txt->SetColor("red");
$graph->AddText($txt);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example26.1.html b/html/includes/jpgraph/docs/html/exframes/example26.1.html
new file mode 100644
index 0000000000..75e175451b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example26.1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,21,33);
$graph = new PieGraph(300,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot($data);
$p1->SetLegends($gDateLocale->GetShortMonth());
$p1->SetCenter(0.4);
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example26.html b/html/includes/jpgraph/docs/html/exframes/example26.html
new file mode 100644
index 0000000000..970fe5d74c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example26.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,21,33);
$graph = new PieGraph(300,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$p1 = new PiePlot($data);
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example27.1.html b/html/includes/jpgraph/docs/html/exframes/example27.1.html
new file mode 100644
index 0000000000..11b845944b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example27.1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
include ("../jpgraph_pie3d.php");
$data = array(40,60,21,33);
$graph = new PieGraph(300,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot3D($data);
$p1->SetAngle(20);
$p1->SetSize(0.5);
$p1->SetCenter(0.45);
$p1->SetLegends($gDateLocale->GetShortMonth());
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example27.2.html b/html/includes/jpgraph/docs/html/exframes/example27.2.html
new file mode 100644
index 0000000000..af0b90a03d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example27.2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
include ("../jpgraph_pie3d.php");
$data = array(40,60,21,33);
$graph = new PieGraph(300,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot($data);
$p1->ExplodeSlice(1);
$p1->SetCenter(0.45);
$p1->SetLegends($gDateLocale->GetShortMonth());
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example27.3.html b/html/includes/jpgraph/docs/html/exframes/example27.3.html
new file mode 100644
index 0000000000..640d8c838d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example27.3.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
include ("../jpgraph_pie3d.php");
$data = array(40,60,21,33);
$graph = new PieGraph(330,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple 3D Pie plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot3D($data);
$p1->ExplodeSlice(1);
$p1->SetCenter(0.45);
$p1->SetLegends($gDateLocale->GetShortMonth());
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example27.html b/html/includes/jpgraph/docs/html/exframes/example27.html
new file mode 100644
index 0000000000..1c104dd3a2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example27.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
include ("../jpgraph_pie3d.php");
$data = array(40,60,21,33);
$graph = new PieGraph(300,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot3D($data);
$p1->SetSize(0.5);
$p1->SetCenter(0.45);
$p1->SetLegends($gDateLocale->GetShortMonth());
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example28.1.html b/html/includes/jpgraph/docs/html/exframes/example28.1.html
new file mode 100644
index 0000000000..817468bd9c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example28.1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,21,33,12,33);
$graph = new PieGraph(150,150,"auto");
$graph->SetShadow();
$graph->title->Set("'earth' Theme");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot($data);
$p1->SetTheme("earth");
$p1->SetCenter(0.5,0.55);
$p1->value->Show(false);
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example28.2.html b/html/includes/jpgraph/docs/html/exframes/example28.2.html
new file mode 100644
index 0000000000..d9dfcd0796
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example28.2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,21,33,12,33);
$graph = new PieGraph(150,150,"auto");
$graph->SetShadow();
$graph->title->Set("'pastel' Theme");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot($data);
$p1->SetTheme("pastel");
$p1->SetCenter(0.5,0.55);
$p1->value->Show(false);
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example28.3.html b/html/includes/jpgraph/docs/html/exframes/example28.3.html
new file mode 100644
index 0000000000..2336fdd0e3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example28.3.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,21,33,12,33);
$graph = new PieGraph(150,150,"auto");
$graph->SetShadow();
$graph->title->Set("'water' Theme");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot($data);
$p1->SetTheme("water");
$p1->SetCenter(0.5,0.55);
$p1->value->Show(false);
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example28.html b/html/includes/jpgraph/docs/html/exframes/example28.html
new file mode 100644
index 0000000000..99a896b67a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example28.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,21,33,12,33);
$graph = new PieGraph(150,150,"auto");
$graph->SetShadow();
$graph->title->Set("'sand' Theme");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.5,0.55);
$p1->value->Show(false);
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.1.html b/html/includes/jpgraph/docs/html/exframes/example3.1.html
new file mode 100644
index 0000000000..6ebe3f2f6f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_UTRIANGLE);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Example 3.1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetColor("red");
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.2.1.html b/html/includes/jpgraph/docs/html/exframes/example3.2.1.html
new file mode 100644
index 0000000000..f2470da26c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.2.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,15,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(10,10);
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_CIRCLE);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Grace value, version 1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.2.2.html b/html/includes/jpgraph/docs/html/exframes/example3.2.2.html
new file mode 100644
index 0000000000..27df44ffc5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.2.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,15,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(10,10);
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_CIRCLE);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Grace value version 2");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->xaxis->SetPos('min');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.2.html b/html/includes/jpgraph/docs/html/exframes/example3.2.html
new file mode 100644
index 0000000000..65135e3569
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,15,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_CIRCLE);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Example 3.2");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.3.html b/html/includes/jpgraph/docs/html/exframes/example3.3.html
new file mode 100644
index 0000000000..2ca495aea8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Adjust the margin
$graph->img->SetMargin(40,20,20,40);
$graph->SetShadow();
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_UTRIANGLE);
$lineplot->value->show();
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("Displaying the values");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.4.html b/html/includes/jpgraph/docs/html/exframes/example3.4.html
new file mode 100644
index 0000000000..201a25a15d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Adjust the margin
$graph->img->SetMargin(40,20,20,40);
$graph->SetShadow();
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_UTRIANGLE);
$lineplot->value->show();
$lineplot->value->SetColor('darkred');
$lineplot->value->SetFont(FF_FONT1,FS_BOLD);
$lineplot->value->SetFormat('$%0.1f');
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("Displaying the values");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example3.html b/html/includes/jpgraph/docs/html/exframes/example3.html
new file mode 100644
index 0000000000..7181c569b5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Example 3");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetColor("red");
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example4.html b/html/includes/jpgraph/docs/html/exframes/example4.html
new file mode 100644
index 0000000000..01f8132097
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$ydata2 = array(1,19,15,7,22,14,5,9,21,13);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($ydata2);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->Add($lineplot2);
$graph->img->SetMargin(40,20,20,40);
$graph->title->Set("Example 4");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$graph->yaxis->SetColor("red");
$graph->yaxis->SetWeight(2);
$graph->SetShadow();
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example5.1.html b/html/includes/jpgraph/docs/html/exframes/example5.1.html
new file mode 100644
index 0000000000..b7870a1106
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example5.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,200,265,99,111,91,198,225,293,251);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->img->SetMargin(40,40,20,40);
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->SetShadow();
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($y2data);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddY2($lineplot2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$graph->y2axis->SetColor("orange");
$graph->title->Set("Example 5");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$graph->yaxis->SetColor("blue");
$lineplot->SetLegend("Plot 1");
$lineplot2->SetLegend("Plot 2");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example5.html b/html/includes/jpgraph/docs/html/exframes/example5.html
new file mode 100644
index 0000000000..ba2c5b7716
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example5.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,200,265,99,111,91,198,225,293,251);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->img->SetMargin(40,40,20,40);
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->SetShadow();
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($y2data);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddY2($lineplot2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$graph->y2axis->SetColor("orange");
$graph->title->Set("Example 5");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$graph->yaxis->SetColor("blue");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example6.1.html b/html/includes/jpgraph/docs/html/exframes/example6.1.html
new file mode 100644
index 0000000000..d938f8bd5a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example6.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,200,265,99,111,91,198,225,293,251);
// Create the graph and specify the scale for both Y-axis
$graph = new Graph(300,240,"auto");
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->SetShadow();
// Adjust the margin
$graph->img->SetMargin(40,40,20,70);
// Create the two linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($y2data);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddY2($lineplot2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
// Adjust the axis color
$graph->y2axis->SetColor("orange");
$graph->yaxis->SetColor("blue");
$graph->title->Set("Example 6.1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Set the colors for the plots
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
// Set the legends for the plots
$lineplot->SetLegend("Plot 1");
$lineplot2->SetLegend("Plot 2");
// Adjust the legend position
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.4,0.95,"center","bottom");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example6.2.html b/html/includes/jpgraph/docs/html/exframes/example6.2.html
new file mode 100644
index 0000000000..815201e2c4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example6.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,200,265,99,111,91,198,225,293,251);
// Create the graph and specify the scale for both Y-axis
$graph = new Graph(300,240,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
// Adjust the margin
$graph->img->SetMargin(40,40,20,70);
// Create the two linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetStepStyle();
// Adjust the axis color
$graph->yaxis->SetColor("blue");
$graph->title->Set("Example 6.2");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Set the colors for the plots
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
// Set the legends for the plots
$lineplot->SetLegend("Plot 1");
// Add the plot to the graph
$graph->Add($lineplot);
// Adjust the legend position
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.4,0.95,"center","bottom");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example6.html b/html/includes/jpgraph/docs/html/exframes/example6.html
new file mode 100644
index 0000000000..dd70cd0cf8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example6.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,200,265,99,111,91,198,225,293,251);
// Create the graph and specify the scale for both Y-axis
$graph = new Graph(400,200,"auto");
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->SetShadow();
// Adjust the margin
$graph->img->SetMargin(40,140,20,40);
// Create the two linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($y2data);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddY2($lineplot2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
// Adjust the axis color
$graph->y2axis->SetColor("orange");
$graph->yaxis->SetColor("blue");
$graph->title->Set("Example 6");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Set the colors for the plots
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
// Set the legends for the plots
$lineplot->SetLegend("Plot 1");
$lineplot2->SetLegend("Plot 2");
// Adjust the legend position
$graph->legend->Pos(0.05,0.5,"right","center");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example7.html b/html/includes/jpgraph/docs/html/exframes/example7.html
new file mode 100644
index 0000000000..37b03bfa23
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example7.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,70,265,29,111,91,198,225,593,251);
// Create the graph.
$graph = new Graph(350,200,"auto");
$graph->SetScale("textlin");
$graph->SetY2Scale("log");
$graph->SetShadow();
$graph->img->SetMargin(40,110,20,40);
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($y2data);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddY2($lineplot2);
$graph->yaxis->SetColor('blue');
$graph->title->Set("Example 7");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$lineplot2->SetWeight(2);
$lineplot->SetLegend("Plot 1");
$lineplot2->SetLegend("Plot 2");
$graph->legend->Pos(0.05,0.5,"right","center");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example8.html b/html/includes/jpgraph/docs/html/exframes/example8.html
new file mode 100644
index 0000000000..8044f3f50d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example8.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$y2data = array(354,200,265,99,111,91,198,225,293,251);
// Create the graph. These two calls are always required
$graph = new Graph(350,200,"auto");
$graph->SetScale("textlog");
$graph->SetShadow();
$graph->img->SetMargin(40,110,20,40);
// Show the gridlines
$graph->ygrid->Show(true,true);
$graph->xgrid->Show(true,false);
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot2=new LinePlot($y2data);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("Example 8");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
// Adjust the color of the Y axis
$graph->yaxis->SetColor("blue");
// Specifya a legend
$lineplot->SetLegend("Plot 1");
// Adjust the position of the grid box
$graph->legend->Pos(0.05,0.5,"right","center");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example9.1.html b/html/includes/jpgraph/docs/html/exframes/example9.1.html
new file mode 100644
index 0000000000..5b8b7ba61d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example9.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,42,5,1,9,13,5,7);
$datax = array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","aug","Sep","Oct");
// Create the graph. These two calls are always required
$graph = new Graph(350,200,"auto");
$graph->SetScale("textlog");
$graph->img->SetMargin(40,110,20,40);
$graph->SetShadow();
$graph->ygrid->Show(true,true);
$graph->xgrid->Show(true,false);
// Specify the tick labels
$a = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($a);
$graph->xaxis->SetTextLabelInterval(2);
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("Examples 9");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetColor("blue");
$lineplot->SetLegend("Plot 1");
$graph->legend->Pos(0.05,0.5,"right","center");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example9.2.html b/html/includes/jpgraph/docs/html/exframes/example9.2.html
new file mode 100644
index 0000000000..93ba719992
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example9.2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,42,5,1,9,13,5,7);
$datax = array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","aug","Sep","Oct");
// Create the graph. These two calls are always required
$graph = new Graph(350,200,"auto");
$graph->SetScale("textlog");
$graph->img->SetMargin(40,110,20,50);
$graph->SetShadow();
$graph->ygrid->Show(true,true);
$graph->xgrid->Show(true,false);
// Specify the tick labels
$a = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($a);
//$graph->xaxis->SetTextLabelInterval(2);
$graph->xaxis->SetLabelAngle(90);
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("Examples 9");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetColor("blue");
$lineplot->SetLegend("Plot 1");
$graph->legend->Pos(0.05,0.5,"right","center");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/example9.html b/html/includes/jpgraph/docs/html/exframes/example9.html
new file mode 100644
index 0000000000..2f37f1a344
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/example9.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_line.php");
$ydata = array(11,3,8,42,5,1,9,13,5,7);
$datax = array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","aug","Sep","Oct");
// Create the graph. These two calls are always required
$graph = new Graph(350,200,"auto");
$graph->SetScale("textlog");
$graph->img->SetMargin(40,110,20,40);
$graph->SetShadow();
$graph->ygrid->Show(true,true);
$graph->xgrid->Show(true,false);
// Specify the tick labels
$a = $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($a);
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("Examples 9");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
$graph->yaxis->SetColor("blue");
$lineplot->SetLegend("Plot 1");
$graph->legend->Pos(0.05,0.5,"right","center");
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/fieldscatterex1.html b/html/includes/jpgraph/docs/html/exframes/fieldscatterex1.html
new file mode 100644
index 0000000000..9423d73c19
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/fieldscatterex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
$polex = 6;
$poley = 40;
function FldCallback($x,$y,$a) {
GLOBAL $polex, $poley;
$maxr = 3000;
// Size and arrow size is constant
$size="";
$arrowsize="";
// Since we have different scales we need the data points
// to be of the same magnitude to give it a distance
// interpretation.
$x *= 10;
// Colors gets colder the further out we go from the center
$r = ($x-$polex*10)*($x-$polex*10)+($y-$poley)*($y-$poley);
$f = $r/$maxr;
if( $f > 1 ) $f=1;
$red = floor((1-$f)*255);
$blue = floor($f*255);
$color = array($red,0,$blue);
//echo "x=$x, y=$y, blue=$blue, red=$red<br>";
return array($color,$size,$arrowsize);
}
// Create data for a simulated pseudo-magnetic radient field
$datax = array();
$datay = array();
$angle = array();
for($x=1; $x < 10; ++$x ) {
for($y=10; $y<100; $y += 10) {
$a = -1;
if( $x==$polex && $y==$poley ) continue;
if( $x==$polex ) {
if( $y > $poley ) $a=90;
else $a = 270;
}
if( $y==$poley ) {
if( $x > $polex ) $a=0;
else $a=180;
}
if( $a == -1 ) {
$d1 = $y-$poley;
$d2 = ($polex-$x)*20;
if( $y < $poley ) $d2 *= -1;
$h = sqrt($d1*$d1+$d2*$d2);
$t = -$d2/$h;
$ac = acos($t);
if( $y < $poley ) $ac += M_PI;
$a = $ac * 180/M_PI;
}
$datax[] = $x;
$datay[] = $y;
$angle[] = $a;
}
}
// Setup the graph
$graph = new Graph(300,200);
$graph->SetScale("intlin",0,100,0,10);
$graph->SetMarginColor('lightblue');
// ..and titles
$graph->title->Set("Field plot");
// Setup the field plot
$fp = new FieldPlot($datay,$datax,$angle);
// Setup formatting callback
$fp->SetCallback('FldCallback');
// First size argument is length (in pixels of arrow)
// Second size argument is roughly size of arrow. Arrow size is specified as
// an integer in the range [0,9]
$fp->arrow->SetSize(20,2);
$fp->arrow->SetColor('navy');
$graph->Add($fp);
// .. and output
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/filledgridex1.html b/html/includes/jpgraph/docs/html/exframes/filledgridex1.html
new file mode 100644
index 0000000000..7593aecfa3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/filledgridex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay1 = array(20,15,23,15);
$datay2 = array(12,9,42,8);
$datay3 = array(5,17,32,24);
// Setup the graph
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30,50,30,30);
$graph->title->Set('Filled Y-grid');
$graph->yaxis->HideZeroLabel();
$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5');
$graph->xgrid->Show();
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Create the first line
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
$p1->SetLegend('Line 1');
$graph->Add($p1);
// Create the second line
$p2 = new LinePlot($datay2);
$p2->SetColor("red");
$p2->SetLegend('Line 2');
$graph->Add($p2);
// Create the third line
$p3 = new LinePlot($datay3);
$p3->SetColor("orange");
$p3->SetLegend('Line 3');
$graph->Add($p3);
$graph->legend->SetShadow('gray@0.4',5);
$graph->legend->SetPos(0.1,0.1,'right','top');
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/filledlineex01.1.html b/html/includes/jpgraph/docs/html/exframes/filledlineex01.1.html
new file mode 100644
index 0000000000..36e74c366a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/filledlineex01.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay = array(1.23,1.9,1.6,3.1,3.4,2.8,2.1,1.9);
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,40,40,40);
$graph->SetShadow();
$graph->SetGridDepth(DEPTH_FRONT);
$graph->title->Set("Example of filled line plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new LinePlot($datay);
$p1->SetFillColor("orange");
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
$graph->Add($p1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/filledlineex01.html b/html/includes/jpgraph/docs/html/exframes/filledlineex01.html
new file mode 100644
index 0000000000..8a34a141a4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/filledlineex01.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay = array(1.23,1.9,1.6,3.1,3.4,2.8,2.1,1.9);
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40,40,40,40);
$graph->SetShadow();
$graph->title->Set("Example of filled line plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new LinePlot($datay);
$p1->SetFillColor("orange");
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
$graph->Add($p1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_JpGraph_Logo.html b/html/includes/jpgraph/docs/html/exframes/frame_JpGraph_Logo.html
new file mode 100644
index 0000000000..67fed7d83f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_JpGraph_Logo.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_alphabarex1.html b/html/includes/jpgraph/docs/html/exframes/frame_alphabarex1.html
new file mode 100644
index 0000000000..563c33b800
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_alphabarex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_antispamex01.html b/html/includes/jpgraph/docs/html/exframes/frame_antispamex01.html
new file mode 100644
index 0000000000..70fd15d12f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_antispamex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_backgroundex03.html b/html/includes/jpgraph/docs/html/exframes/frame_backgroundex03.html
new file mode 100644
index 0000000000..06dd7bf9d0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_backgroundex03.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_balloonex1.html b/html/includes/jpgraph/docs/html/exframes/frame_balloonex1.html
new file mode 100644
index 0000000000..2fe4c2ba60
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_balloonex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex1.html
new file mode 100644
index 0000000000..7fcae39178
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex2.html b/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex2.html
new file mode 100644
index 0000000000..2d0a0729e1
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex3.html b/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex3.html
new file mode 100644
index 0000000000..35ffcdc1c2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bar_csimex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex1.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex1.html
new file mode 100644
index 0000000000..4c4e9d10bb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex2.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex2.html
new file mode 100644
index 0000000000..23249a0823
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex3.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex3.html
new file mode 100644
index 0000000000..b95ce73dd3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex4.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex4.html
new file mode 100644
index 0000000000..9bea58376f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex5.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex5.html
new file mode 100644
index 0000000000..20d6c4b1b9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex6.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex6.html
new file mode 100644
index 0000000000..ee84e6c67f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex6.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex7.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex7.html
new file mode 100644
index 0000000000..e12702928f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex7.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex8.html b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex8.html
new file mode 100644
index 0000000000..3e3ede43e4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bargradsmallex8.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_barline_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_barline_csimex1.html
new file mode 100644
index 0000000000..74eea8fe27
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_barline_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_barlinefreq_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_barlinefreq_csimex1.html
new file mode 100644
index 0000000000..69ba2519c4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_barlinefreq_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bartutex1.html b/html/includes/jpgraph/docs/html/exframes/frame_bartutex1.html
new file mode 100644
index 0000000000..56abe05bea
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bartutex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bartutex2.html b/html/includes/jpgraph/docs/html/exframes/frame_bartutex2.html
new file mode 100644
index 0000000000..571458ca60
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bartutex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bartutex3.html b/html/includes/jpgraph/docs/html/exframes/frame_bartutex3.html
new file mode 100644
index 0000000000..98519035d1
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bartutex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bartutex4.html b/html/includes/jpgraph/docs/html/exframes/frame_bartutex4.html
new file mode 100644
index 0000000000..8ef111e28f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bartutex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bartutex5.html b/html/includes/jpgraph/docs/html/exframes/frame_bartutex5.html
new file mode 100644
index 0000000000..852456722c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bartutex5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_bartutex6.html b/html/includes/jpgraph/docs/html/exframes/frame_bartutex6.html
new file mode 100644
index 0000000000..8e4043f883
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_bartutex6.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_boxstockcsimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_boxstockcsimex1.html
new file mode 100644
index 0000000000..d694139b33
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_boxstockcsimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_boxstockex1.html b/html/includes/jpgraph/docs/html/exframes/frame_boxstockex1.html
new file mode 100644
index 0000000000..462394a334
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_boxstockex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_builtinplotmarksex1.html b/html/includes/jpgraph/docs/html/exframes/frame_builtinplotmarksex1.html
new file mode 100644
index 0000000000..c7fb3bfbbf
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_builtinplotmarksex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvas_jpgarchex.html b/html/includes/jpgraph/docs/html/exframes/frame_canvas_jpgarchex.html
new file mode 100644
index 0000000000..38fec349f5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvas_jpgarchex.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvasex01.html b/html/includes/jpgraph/docs/html/exframes/frame_canvasex01.html
new file mode 100644
index 0000000000..1dfdf91ee6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvasex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvasex02.html b/html/includes/jpgraph/docs/html/exframes/frame_canvasex02.html
new file mode 100644
index 0000000000..6a3c352e74
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvasex02.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvasex03.html b/html/includes/jpgraph/docs/html/exframes/frame_canvasex03.html
new file mode 100644
index 0000000000..ef2a6eb37c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvasex03.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvasex04.html b/html/includes/jpgraph/docs/html/exframes/frame_canvasex04.html
new file mode 100644
index 0000000000..1dace9dfcb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvasex04.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvasex05.html b/html/includes/jpgraph/docs/html/exframes/frame_canvasex05.html
new file mode 100644
index 0000000000..8fe74d93f1
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvasex05.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_canvasex06.html b/html/includes/jpgraph/docs/html/exframes/frame_canvasex06.html
new file mode 100644
index 0000000000..9f6907f959
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_canvasex06.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_color_chart01.html b/html/includes/jpgraph/docs/html/exframes/frame_color_chart01.html
new file mode 100644
index 0000000000..a0f63aad8b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_color_chart01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_color_chart02.html b/html/includes/jpgraph/docs/html/exframes/frame_color_chart02.html
new file mode 100644
index 0000000000..fbd949eed3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_color_chart02.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_color_chart03.html b/html/includes/jpgraph/docs/html/exframes/frame_color_chart03.html
new file mode 100644
index 0000000000..9e96fa1fee
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_color_chart03.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_color_chart04.html b/html/includes/jpgraph/docs/html/exframes/frame_color_chart04.html
new file mode 100644
index 0000000000..a5d213ce4b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_color_chart04.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex1.html b/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex1.html
new file mode 100644
index 0000000000..a37fef38ee
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex2.html b/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex2.html
new file mode 100644
index 0000000000..bb62ee68ce
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex4.html b/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex4.html
new file mode 100644
index 0000000000..6979d9a293
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_dateaxisex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_dbschemaex1.html b/html/includes/jpgraph/docs/html/exframes/frame_dbschemaex1.html
new file mode 100644
index 0000000000..e80b159989
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_dbschemaex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example0.html b/html/includes/jpgraph/docs/html/exframes/frame_example0.html
new file mode 100644
index 0000000000..0d3f85a15d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example0.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example11.html b/html/includes/jpgraph/docs/html/exframes/frame_example11.html
new file mode 100644
index 0000000000..30ec8df07b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example11.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example13.html b/html/includes/jpgraph/docs/html/exframes/frame_example13.html
new file mode 100644
index 0000000000..1220360d4a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example13.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example14.html b/html/includes/jpgraph/docs/html/exframes/frame_example14.html
new file mode 100644
index 0000000000..963ce05ed8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example14.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example15.html b/html/includes/jpgraph/docs/html/exframes/frame_example15.html
new file mode 100644
index 0000000000..e28993f768
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example15.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example16.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example16.1.html
new file mode 100644
index 0000000000..09803aac8f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example16.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example16.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example16.2.html
new file mode 100644
index 0000000000..16cfa4eeab
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example16.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example16.3.html b/html/includes/jpgraph/docs/html/exframes/frame_example16.3.html
new file mode 100644
index 0000000000..617e279ca8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example16.3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example16.4.html b/html/includes/jpgraph/docs/html/exframes/frame_example16.4.html
new file mode 100644
index 0000000000..3439ece37c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example16.4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example16.6.html b/html/includes/jpgraph/docs/html/exframes/frame_example16.6.html
new file mode 100644
index 0000000000..88e5b7e0b8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example16.6.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example16.html b/html/includes/jpgraph/docs/html/exframes/frame_example16.html
new file mode 100644
index 0000000000..8a14f18e7f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example16.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example17.html b/html/includes/jpgraph/docs/html/exframes/frame_example17.html
new file mode 100644
index 0000000000..6fd3e53fcd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example17.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example18.html b/html/includes/jpgraph/docs/html/exframes/frame_example18.html
new file mode 100644
index 0000000000..4b403a8021
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example18.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example19.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example19.1.html
new file mode 100644
index 0000000000..f48c308ddd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example19.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example19.html b/html/includes/jpgraph/docs/html/exframes/frame_example19.html
new file mode 100644
index 0000000000..f557dacbb5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example19.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example2.html b/html/includes/jpgraph/docs/html/exframes/frame_example2.html
new file mode 100644
index 0000000000..0458bf7418
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example20.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example20.1.html
new file mode 100644
index 0000000000..e329ba9925
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example20.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example20.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example20.2.html
new file mode 100644
index 0000000000..ec4aace674
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example20.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example20.3.html b/html/includes/jpgraph/docs/html/exframes/frame_example20.3.html
new file mode 100644
index 0000000000..549112ee4d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example20.3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example20.4.html b/html/includes/jpgraph/docs/html/exframes/frame_example20.4.html
new file mode 100644
index 0000000000..62ab1d0995
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example20.4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example20.5.html b/html/includes/jpgraph/docs/html/exframes/frame_example20.5.html
new file mode 100644
index 0000000000..d3b4b4c5d3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example20.5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example20.html b/html/includes/jpgraph/docs/html/exframes/frame_example20.html
new file mode 100644
index 0000000000..876d2d3acb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example20.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example21.html b/html/includes/jpgraph/docs/html/exframes/frame_example21.html
new file mode 100644
index 0000000000..2565318178
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example21.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example22.html b/html/includes/jpgraph/docs/html/exframes/frame_example22.html
new file mode 100644
index 0000000000..dfd3543a54
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example22.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example23.html b/html/includes/jpgraph/docs/html/exframes/frame_example23.html
new file mode 100644
index 0000000000..ad09befe93
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example23.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example24.html b/html/includes/jpgraph/docs/html/exframes/frame_example24.html
new file mode 100644
index 0000000000..416c01e5f3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example24.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example25.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example25.1.html
new file mode 100644
index 0000000000..5daeabba78
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example25.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example25.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example25.2.html
new file mode 100644
index 0000000000..f33e1fd35f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example25.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example25.html b/html/includes/jpgraph/docs/html/exframes/frame_example25.html
new file mode 100644
index 0000000000..2b0a6fad6e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example25.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example26.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example26.1.html
new file mode 100644
index 0000000000..00e90f1bdc
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example26.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example26.html b/html/includes/jpgraph/docs/html/exframes/frame_example26.html
new file mode 100644
index 0000000000..fe3768bd7b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example26.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example27.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example27.1.html
new file mode 100644
index 0000000000..618c4dc796
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example27.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example27.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example27.2.html
new file mode 100644
index 0000000000..b5afc73d2a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example27.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example27.3.html b/html/includes/jpgraph/docs/html/exframes/frame_example27.3.html
new file mode 100644
index 0000000000..ca939bbc60
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example27.3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example27.html b/html/includes/jpgraph/docs/html/exframes/frame_example27.html
new file mode 100644
index 0000000000..ff1c0425d3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example27.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example28.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example28.1.html
new file mode 100644
index 0000000000..84ccf0e4ce
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example28.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example28.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example28.2.html
new file mode 100644
index 0000000000..11a09cf43a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example28.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example28.3.html b/html/includes/jpgraph/docs/html/exframes/frame_example28.3.html
new file mode 100644
index 0000000000..2261445d7b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example28.3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example28.html b/html/includes/jpgraph/docs/html/exframes/frame_example28.html
new file mode 100644
index 0000000000..ae7a9b6419
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example28.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.1.html
new file mode 100644
index 0000000000..5147abf643
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.2.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.2.1.html
new file mode 100644
index 0000000000..631e195533
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.2.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.2.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.2.2.html
new file mode 100644
index 0000000000..cc8e12ab7d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.2.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.2.html
new file mode 100644
index 0000000000..d9e43085c7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.3.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.3.html
new file mode 100644
index 0000000000..e82bb3e594
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.4.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.4.html
new file mode 100644
index 0000000000..c5f4f94f83
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example3.html b/html/includes/jpgraph/docs/html/exframes/frame_example3.html
new file mode 100644
index 0000000000..db8e0aad75
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example4.html b/html/includes/jpgraph/docs/html/exframes/frame_example4.html
new file mode 100644
index 0000000000..957b2f93ab
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example5.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example5.1.html
new file mode 100644
index 0000000000..f8f84c7218
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example5.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example5.html b/html/includes/jpgraph/docs/html/exframes/frame_example5.html
new file mode 100644
index 0000000000..005a3dcaff
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example6.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example6.1.html
new file mode 100644
index 0000000000..869dfd8526
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example6.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example6.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example6.2.html
new file mode 100644
index 0000000000..b7dc04cc7b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example6.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example6.html b/html/includes/jpgraph/docs/html/exframes/frame_example6.html
new file mode 100644
index 0000000000..3b3e81e7a3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example6.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example7.html b/html/includes/jpgraph/docs/html/exframes/frame_example7.html
new file mode 100644
index 0000000000..8c9386a374
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example7.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example8.html b/html/includes/jpgraph/docs/html/exframes/frame_example8.html
new file mode 100644
index 0000000000..24e2c4b1e9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example8.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example9.1.html b/html/includes/jpgraph/docs/html/exframes/frame_example9.1.html
new file mode 100644
index 0000000000..a53e429681
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example9.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example9.2.html b/html/includes/jpgraph/docs/html/exframes/frame_example9.2.html
new file mode 100644
index 0000000000..af370353f5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example9.2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_example9.html b/html/includes/jpgraph/docs/html/exframes/frame_example9.html
new file mode 100644
index 0000000000..a7d1f1d345
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_example9.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_fieldscatterex1.html b/html/includes/jpgraph/docs/html/exframes/frame_fieldscatterex1.html
new file mode 100644
index 0000000000..79deb202a8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_fieldscatterex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_filledgridex1.html b/html/includes/jpgraph/docs/html/exframes/frame_filledgridex1.html
new file mode 100644
index 0000000000..d30041d291
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_filledgridex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_filledlineex01.1.html b/html/includes/jpgraph/docs/html/exframes/frame_filledlineex01.1.html
new file mode 100644
index 0000000000..d73bac129a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_filledlineex01.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_filledlineex01.html b/html/includes/jpgraph/docs/html/exframes/frame_filledlineex01.html
new file mode 100644
index 0000000000..341beca9e2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_filledlineex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_funcex1.html b/html/includes/jpgraph/docs/html/exframes/frame_funcex1.html
new file mode 100644
index 0000000000..664937fc1e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_funcex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttconstrainex0.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttconstrainex0.html
new file mode 100644
index 0000000000..04c8fa503b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttconstrainex0.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttconstrainex1.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttconstrainex1.html
new file mode 100644
index 0000000000..41b2d03a84
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttconstrainex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttcsimex01.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttcsimex01.html
new file mode 100644
index 0000000000..909ec9c685
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttcsimex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttcsimex02.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttcsimex02.html
new file mode 100644
index 0000000000..ebcb1fab7c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttcsimex02.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex00.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex00.html
new file mode 100644
index 0000000000..1ca1d229b6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex00.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex01.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex01.html
new file mode 100644
index 0000000000..64c08f449f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex02.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex02.html
new file mode 100644
index 0000000000..dcab4b9483
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex02.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex03.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex03.html
new file mode 100644
index 0000000000..83f3678b47
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex03.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex04.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex04.html
new file mode 100644
index 0000000000..99095ab5e5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex04.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex05.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex05.html
new file mode 100644
index 0000000000..75d410d9f6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex05.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex06.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex06.html
new file mode 100644
index 0000000000..b79cf846ef
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex06.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex07.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex07.html
new file mode 100644
index 0000000000..cc6c9cbc27
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex07.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex08.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex08.html
new file mode 100644
index 0000000000..e436f258dd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex08.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex09.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex09.html
new file mode 100644
index 0000000000..9822733d95
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex09.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex10.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex10.html
new file mode 100644
index 0000000000..ef42a6bc69
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex10.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex11.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex11.html
new file mode 100644
index 0000000000..a664ac1500
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex11.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex12.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex12.html
new file mode 100644
index 0000000000..eca0254bba
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex12.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex13.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex13.html
new file mode 100644
index 0000000000..6dbe44e93f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex13.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex14.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex14.html
new file mode 100644
index 0000000000..cb7a13eb51
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex14.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex15.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex15.html
new file mode 100644
index 0000000000..397458f30a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex15.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex16.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex16.html
new file mode 100644
index 0000000000..4323183401
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex16.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex17.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex17.html
new file mode 100644
index 0000000000..721c3cffe0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex17.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex18.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex18.html
new file mode 100644
index 0000000000..836e9a7009
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex18.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttex19.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttex19.html
new file mode 100644
index 0000000000..30d4c9c5dd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttex19.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_gantthgridex1.html b/html/includes/jpgraph/docs/html/exframes/frame_gantthgridex1.html
new file mode 100644
index 0000000000..2c018f2410
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_gantthgridex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_gantthourex1.html b/html/includes/jpgraph/docs/html/exframes/frame_gantthourex1.html
new file mode 100644
index 0000000000..ef3e629471
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_gantthourex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_gantthourminex1.html b/html/includes/jpgraph/docs/html/exframes/frame_gantthourminex1.html
new file mode 100644
index 0000000000..0056101962
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_gantthourminex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_gantticonex1.html b/html/includes/jpgraph/docs/html/exframes/frame_gantticonex1.html
new file mode 100644
index 0000000000..6a3cd53878
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_gantticonex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_ganttsimpleex1.html b/html/includes/jpgraph/docs/html/exframes/frame_ganttsimpleex1.html
new file mode 100644
index 0000000000..806eb1764f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_ganttsimpleex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_gradbkgex1.html b/html/includes/jpgraph/docs/html/exframes/frame_gradbkgex1.html
new file mode 100644
index 0000000000..090086a2f3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_gradbkgex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_horizbarex1.html b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex1.html
new file mode 100644
index 0000000000..bb5f1d5c8f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_horizbarex2.html b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex2.html
new file mode 100644
index 0000000000..86ffc10621
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_horizbarex3.html b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex3.html
new file mode 100644
index 0000000000..b4b863285d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_horizbarex4.html b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex4.html
new file mode 100644
index 0000000000..378ffcda7f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_horizbarex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_imgmarkercsimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_imgmarkercsimex1.html
new file mode 100644
index 0000000000..90c6aa866d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_imgmarkercsimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_imgmarkerex1.html b/html/includes/jpgraph/docs/html/exframes/frame_imgmarkerex1.html
new file mode 100644
index 0000000000..e40c12410c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_imgmarkerex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_impulsex1.html b/html/includes/jpgraph/docs/html/exframes/frame_impulsex1.html
new file mode 100644
index 0000000000..33c1f61b48
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_impulsex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_impulsex2.html b/html/includes/jpgraph/docs/html/exframes/frame_impulsex2.html
new file mode 100644
index 0000000000..b793c401d3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_impulsex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_impulsex3.html b/html/includes/jpgraph/docs/html/exframes/frame_impulsex3.html
new file mode 100644
index 0000000000..42f2e07470
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_impulsex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_impulsex4.html b/html/includes/jpgraph/docs/html/exframes/frame_impulsex4.html
new file mode 100644
index 0000000000..7cd309960f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_impulsex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_inyaxisex2.html b/html/includes/jpgraph/docs/html/exframes/frame_inyaxisex2.html
new file mode 100644
index 0000000000..8c97db8169
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_inyaxisex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_linebarcentex1.html b/html/includes/jpgraph/docs/html/exframes/frame_linebarcentex1.html
new file mode 100644
index 0000000000..89d2c6d34a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_linebarcentex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_lineiconex1.html b/html/includes/jpgraph/docs/html/exframes/frame_lineiconex1.html
new file mode 100644
index 0000000000..d85bbfcafd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_lineiconex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_lineiconex2.html b/html/includes/jpgraph/docs/html/exframes/frame_lineiconex2.html
new file mode 100644
index 0000000000..fb43638751
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_lineiconex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_listfontsex1.html b/html/includes/jpgraph/docs/html/exframes/frame_listfontsex1.html
new file mode 100644
index 0000000000..7f3e433db6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_listfontsex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_logbarex1.html b/html/includes/jpgraph/docs/html/exframes/frame_logbarex1.html
new file mode 100644
index 0000000000..6ac15fa474
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_logbarex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_loglogex1.html b/html/includes/jpgraph/docs/html/exframes/frame_loglogex1.html
new file mode 100644
index 0000000000..bb11d8faf7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_loglogex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_manscaleex1.html b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex1.html
new file mode 100644
index 0000000000..e81452cf25
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_manscaleex2.html b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex2.html
new file mode 100644
index 0000000000..6599470afd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_manscaleex3.html b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex3.html
new file mode 100644
index 0000000000..7d9201f6b3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_manscaleex4.html b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex4.html
new file mode 100644
index 0000000000..1d1f172a3d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_manscaleex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_markflagex1.html b/html/includes/jpgraph/docs/html/exframes/frame_markflagex1.html
new file mode 100644
index 0000000000..b4d3f9b039
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_markflagex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_nullvalueex01.html b/html/includes/jpgraph/docs/html/exframes/frame_nullvalueex01.html
new file mode 100644
index 0000000000..86f2799d8f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_nullvalueex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_partiallyfilledlineex1.html b/html/includes/jpgraph/docs/html/exframes/frame_partiallyfilledlineex1.html
new file mode 100644
index 0000000000..0bc03485e3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_partiallyfilledlineex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_penguin.html b/html/includes/jpgraph/docs/html/exframes/frame_penguin.html
new file mode 100644
index 0000000000..37b4a2e8d0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_penguin.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pie3d_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_pie3d_csimex1.html
new file mode 100644
index 0000000000..3fd827bf31
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pie3d_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pie_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_pie_csimex1.html
new file mode 100644
index 0000000000..c99e507493
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pie_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_piec_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_piec_csimex1.html
new file mode 100644
index 0000000000..e0146d0e21
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_piec_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_piecex1.html b/html/includes/jpgraph/docs/html/exframes/frame_piecex1.html
new file mode 100644
index 0000000000..20455c5894
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_piecex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_piecex2.html b/html/includes/jpgraph/docs/html/exframes/frame_piecex2.html
new file mode 100644
index 0000000000..552e805962
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_piecex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pieex3.html b/html/includes/jpgraph/docs/html/exframes/frame_pieex3.html
new file mode 100644
index 0000000000..210f1978eb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pieex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pieex8.html b/html/includes/jpgraph/docs/html/exframes/frame_pieex8.html
new file mode 100644
index 0000000000..cb498764f2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pieex8.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pieex9.html b/html/includes/jpgraph/docs/html/exframes/frame_pieex9.html
new file mode 100644
index 0000000000..4f36ec2fb2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pieex9.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex1.html b/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex1.html
new file mode 100644
index 0000000000..c53fa0d638
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex2.html b/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex2.html
new file mode 100644
index 0000000000..85e4798d30
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex4.html b/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex4.html
new file mode 100644
index 0000000000..1a333bec57
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_pielabelsex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex0-180.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex0-180.html
new file mode 100644
index 0000000000..22873387b8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex0-180.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex0.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex0.html
new file mode 100644
index 0000000000..fbad3b63ae
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex0.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex3-lin.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex3-lin.html
new file mode 100644
index 0000000000..90a96c2133
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex3-lin.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex3.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex3.html
new file mode 100644
index 0000000000..e1f2b58f4a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex4.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex4.html
new file mode 100644
index 0000000000..330de97c7e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex5.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex5.html
new file mode 100644
index 0000000000..8a9ced1d3d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex7-2.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex7-2.html
new file mode 100644
index 0000000000..5b28aa8ca7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex7-2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_polarex9.html b/html/includes/jpgraph/docs/html/exframes/frame_polarex9.html
new file mode 100644
index 0000000000..19a7806637
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_polarex9.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex1.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex1.html
new file mode 100644
index 0000000000..1f2f0036a3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex2.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex2.html
new file mode 100644
index 0000000000..45677514ea
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex4.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex4.html
new file mode 100644
index 0000000000..5173d860d0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex6.1.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex6.1.html
new file mode 100644
index 0000000000..eb02e8cdbf
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex6.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex6.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex6.html
new file mode 100644
index 0000000000..4ed273f732
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex6.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex7.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex7.html
new file mode 100644
index 0000000000..614a75a631
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex7.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex8.1.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex8.1.html
new file mode 100644
index 0000000000..460c64bc1a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex8.1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarex8.html b/html/includes/jpgraph/docs/html/exframes/frame_radarex8.html
new file mode 100644
index 0000000000..20fcb20b31
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarex8.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_radarmarkex1.html b/html/includes/jpgraph/docs/html/exframes/frame_radarmarkex1.html
new file mode 100644
index 0000000000..0aa3379b44
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_radarmarkex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_rotex0.html b/html/includes/jpgraph/docs/html/exframes/frame_rotex0.html
new file mode 100644
index 0000000000..1940cf6817
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_rotex0.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_rotex1.html b/html/includes/jpgraph/docs/html/exframes/frame_rotex1.html
new file mode 100644
index 0000000000..8d41a95a16
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_rotex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_rotex2.html b/html/includes/jpgraph/docs/html/exframes/frame_rotex2.html
new file mode 100644
index 0000000000..5dec757628
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_rotex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_rotex3.html b/html/includes/jpgraph/docs/html/exframes/frame_rotex3.html
new file mode 100644
index 0000000000..fc52b81652
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_rotex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_rotex4.html b/html/includes/jpgraph/docs/html/exframes/frame_rotex4.html
new file mode 100644
index 0000000000..a1d9c9bc35
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_rotex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_rotex5.html b/html/includes/jpgraph/docs/html/exframes/frame_rotex5.html
new file mode 100644
index 0000000000..28f00df83c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_rotex5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_scatter_csimex1.html b/html/includes/jpgraph/docs/html/exframes/frame_scatter_csimex1.html
new file mode 100644
index 0000000000..fc3b9cf344
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_scatter_csimex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_scatterex1.html b/html/includes/jpgraph/docs/html/exframes/frame_scatterex1.html
new file mode 100644
index 0000000000..cf61e111ff
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_scatterex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_scatterex2.html b/html/includes/jpgraph/docs/html/exframes/frame_scatterex2.html
new file mode 100644
index 0000000000..876987065f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_scatterex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex1.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex1.html
new file mode 100644
index 0000000000..c5eb5f8a8c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex10.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex10.html
new file mode 100644
index 0000000000..03f55151c2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex10.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex2.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex2.html
new file mode 100644
index 0000000000..ae83bfc14d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex2.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex3.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex3.html
new file mode 100644
index 0000000000..d5b9a80a30
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex3.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex4.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex4.html
new file mode 100644
index 0000000000..819691b363
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex4.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex5.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex5.html
new file mode 100644
index 0000000000..bbf050c04b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex5.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex6.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex6.html
new file mode 100644
index 0000000000..da1728e2d4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex6.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex7.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex7.html
new file mode 100644
index 0000000000..a6f4616a88
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex7.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex8.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex8.html
new file mode 100644
index 0000000000..be945eae7e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex8.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex9.html b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex9.html
new file mode 100644
index 0000000000..dbc7bf4a49
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_smallstaticbandsex9.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_splineex1.html b/html/includes/jpgraph/docs/html/exframes/frame_splineex1.html
new file mode 100644
index 0000000000..2510bf83d4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_splineex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_staticbandbarex7.html b/html/includes/jpgraph/docs/html/exframes/frame_staticbandbarex7.html
new file mode 100644
index 0000000000..3a225eda53
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_staticbandbarex7.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_stockex1.html b/html/includes/jpgraph/docs/html/exframes/frame_stockex1.html
new file mode 100644
index 0000000000..6968ae69ac
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_stockex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_tabtitleex1.html b/html/includes/jpgraph/docs/html/exframes/frame_tabtitleex1.html
new file mode 100644
index 0000000000..6dc032294c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_tabtitleex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_textalignex1.html b/html/includes/jpgraph/docs/html/exframes/frame_textalignex1.html
new file mode 100644
index 0000000000..eced480c19
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_textalignex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_titlecsimex01.html b/html/includes/jpgraph/docs/html/exframes/frame_titlecsimex01.html
new file mode 100644
index 0000000000..45389bbc45
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_titlecsimex01.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/frame_topxaxisex1.html b/html/includes/jpgraph/docs/html/exframes/frame_topxaxisex1.html
new file mode 100644
index 0000000000..c9ac06d2a6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/frame_topxaxisex1.html
@@ -0,0 +1 @@
+
diff --git a/html/includes/jpgraph/docs/html/exframes/funcex1.html b/html/includes/jpgraph/docs/html/exframes/funcex1.html
new file mode 100644
index 0000000000..02f7e94d68
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/funcex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_utils.inc");
$f = new FuncGenerator('cos($x)*$x');
list($xdata,$ydata) = $f->E(-1.2*M_PI,1.2*M_PI);
$f = new FuncGenerator('$x*$x');
list($x2data,$y2data) = $f->E(-2,2);
// Setup the basic graph
$graph = new Graph(450,350,"auto");
$graph->SetScale("linlin");
$graph->SetShadow();
$graph->img->SetMargin(50,50,60,40);
$graph->SetBox(true,'black',2);
$graph->SetMarginColor('white');
$graph->SetColor('lightyellow');
// ... and titles
$graph->title->Set('Example of Function plot');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->subtitle->Set("(With some more advanced axis formatting\nHiding first and last label)");
$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL);
$graph->xgrid->Show();
$graph->yaxis->SetPos(0);
$graph->yaxis->SetWeight(2);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->SetColor('black','darkblue');
$graph->yaxis->HideTicks(true,false);
$graph->yaxis->HideFirstLastLabel();
$graph->xaxis->SetWeight(2);
$graph->xaxis->HideZeroLabel();
$graph->xaxis->HideFirstLastLabel();
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->SetColor('black','darkblue');
$lp1 = new LinePlot($ydata,$xdata);
$lp1->SetColor('blue');
$lp1->SetWeight(2);
$lp2 = new LinePlot($y2data,$x2data);
list($xm,$ym)=$lp2->Max();
$lp2->SetColor('red');
$lp2->SetWeight(2);
$graph->Add($lp1);
$graph->Add($lp2);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttconstrainex0.html b/html/includes/jpgraph/docs/html/exframes/ganttconstrainex0.html
new file mode 100644
index 0000000000..ae5cba7d5b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttconstrainex0.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
//
// The data for the graphs
//
$data = array(
array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",''),
array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-16",''),
array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",''),
array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2') );
// The constrains between the activities
//$constrains = array(array(1,2,CONSTRAIN_ENDSTART),
// array(2,3,CONSTRAIN_STARTSTART));
$constrains = array();
$progress = array(array(1,0.4));
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Example with grouping and constrains");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
// Add the specified activities
$graph->CreateSimple($data,$constrains,$progress);
// .. and stroke the graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttconstrainex1.html b/html/includes/jpgraph/docs/html/exframes/ganttconstrainex1.html
new file mode 100644
index 0000000000..c72b01e24c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttconstrainex1.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
//
// The data for the graphs
//
$data = array(
array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",''),
array(1,ACTYPE_NORMAL, " Label 1", "2001-10-26","2001-11-18",''),
array(2,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-16",''),
array(3,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",''),
array(4,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2') );
// The constrains between the activities
$constrains = array(array(1,2,CONSTRAIN_ENDSTART),
array(1,3,CONSTRAIN_STARTSTART),
array(3,4,CONSTRAIN_STARTSTART));
$progress = array(array(1,0.4));
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Example with grouping and constrains");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
// Add the specified activities
$graph->CreateSimple($data,$constrains,$progress);
// .. and stroke the graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttcsimex01.html b/html/includes/jpgraph/docs/html/exframes/ganttcsimex01.html
new file mode 100644
index 0000000000..93452688a9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttcsimex01.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt example to create CSIM
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$bar1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-20");
$bar1->SetCSIMTarget('#','Go back 1');
$bar1->title->SetCSIMTarget('#','Go back 1 (title)');
$bar2 = new GanttBar(1,"Activity 2","2002-01-03","2002-01-25");
$bar2->SetCSIMTarget('#','Go back 2');
$bar2->title->SetCSIMTarget('#','Go back 2 (title)');
$graph = new GanttGraph(500);
$graph->title->Set("Example with image map");
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT1);
$graph->Add(array($bar1,$bar2));
// And stroke
$graph->StrokeCSIM('ganttcsimex01.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttcsimex02.html b/html/includes/jpgraph/docs/html/exframes/ganttcsimex02.html
new file mode 100644
index 0000000000..8661169fb7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttcsimex02.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt example to create CSIM using CreateSimple()
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$data = array(
array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",'',
'#1','Go home'),
array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-16",'ab,cd',
'#2','Go home'),
array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",'ek',
'#3','Go home'),
array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2',
'#4','Go home') );
// The constrains between the activities
$constrains = array(array(1,2,CONSTRAIN_ENDSTART),
array(2,3,CONSTRAIN_STARTSTART));
$progress = array(array(1,0.4));
$graph = new GanttGraph(500);
$graph->title->Set("Example with image map");
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT1);
$graph->CreateSimple($data,$constrains,$progress);
// Add the specified activities
//SetupSimpleGantt($graph,$data,$constrains,$progress);
// And stroke
$graph->StrokeCSIM('ganttcsimex02.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex00.html b/html/includes/jpgraph/docs/html/exframes/ganttex00.html
new file mode 100644
index 0000000000..970edb2e95
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex00.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
// A new graph with automatic size
$graph = new GanttGraph(0,0,"auto");
// A new activity on row '0'
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
$graph->Add($activity);
// Display the Gantt chart
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex01.html b/html/includes/jpgraph/docs/html/exframes/ganttex01.html
new file mode 100644
index 0000000000..331d90afa9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex01.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex02.html b/html/includes/jpgraph/docs/html/exframes/ganttex02.html
new file mode 100644
index 0000000000..7f09eaef65
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex02.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
// Show day, week and month scale
//$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
$graph->ShowHeaders(GANTT_HWEEK );
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_WNBR);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-02-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex03.html b/html/includes/jpgraph/docs/html/exframes/ganttex03.html
new file mode 100644
index 0000000000..73b1093b3e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex03.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(7,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex04.html b/html/includes/jpgraph/docs/html/exframes/ganttex04.html
new file mode 100644
index 0000000000..a2f998edc6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex04.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$graph->Add($milestone);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex05.html b/html/includes/jpgraph/docs/html/exframes/ganttex05.html
new file mode 100644
index 0000000000..3226e4f0e5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex05.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex06.html b/html/includes/jpgraph/docs/html/exframes/ganttex06.html
new file mode 100644
index 0000000000..7e651fdcb1
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex06.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex07.html b/html/includes/jpgraph/docs/html/exframes/ganttex07.html
new file mode 100644
index 0000000000..aa0b7e1770
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex07.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Finally add the bar to the graph
$graph->Add($activity);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex08.html b/html/includes/jpgraph/docs/html/exframes/ganttex08.html
new file mode 100644
index 0000000000..14103256dd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex08.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Add a right marker
$activity->rightMark->Show();
$activity->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity->rightMark->SetWidth(13);
$activity->rightMark->SetColor("red");
$activity->rightMark->SetFillColor("red");
$activity->rightMark->title->Set("M5");
$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity->rightMark->title->SetColor("white");
// Finally add the bar to the graph
$graph->Add($activity);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex09.html b/html/includes/jpgraph/docs/html/exframes/ganttex09.html
new file mode 100644
index 0000000000..6522a7017d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex09.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Add a right marker
$activity->rightMark->Show();
$activity->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity->rightMark->SetWidth(13);
$activity->rightMark->SetColor("red");
$activity->rightMark->SetFillColor("red");
$activity->rightMark->title->Set("M5");
$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity->rightMark->title->SetColor("white");
// Set absolute height
$activity->SetHeight(8);
// Finally add the bar to the graph
$graph->Add($activity);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex10.html b/html/includes/jpgraph/docs/html/exframes/ganttex10.html
new file mode 100644
index 0000000000..8fb725ee20
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex10.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Add a right marker
$activity->rightMark->Show();
$activity->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity->rightMark->SetWidth(13);
$activity->rightMark->SetColor("red");
$activity->rightMark->SetFillColor("red");
$activity->rightMark->title->Set("M5");
$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity->rightMark->title->SetColor("white");
// Set absolute height
$activity->SetHeight(1);
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Add a right marker
$activity2->rightMark->Show();
$activity2->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity2->rightMark->SetWidth(13);
$activity2->rightMark->SetColor("red");
$activity2->rightMark->SetFillColor("red");
$activity2->rightMark->title->Set("M5");
$activity2->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity2->rightMark->title->SetColor("white");
// Set absolute height
$activity2->SetHeight(1);
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex11.html b/html/includes/jpgraph/docs/html/exframes/ganttex11.html
new file mode 100644
index 0000000000..1908528834
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex11.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Add a right marker
$activity->rightMark->Show();
$activity->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity->rightMark->SetWidth(13);
$activity->rightMark->SetColor("red");
$activity->rightMark->SetFillColor("red");
$activity->rightMark->title->Set("M5");
$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity->rightMark->title->SetColor("white");
// Set absolute height
$activity->SetHeight(10);
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Add a right marker
$activity2->rightMark->Show();
$activity2->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity2->rightMark->SetWidth(13);
$activity2->rightMark->SetColor("red");
$activity2->rightMark->SetFillColor("red");
$activity2->rightMark->title->Set("M5");
$activity2->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity2->rightMark->title->SetColor("white");
// Set absolute height
$activity2->SetHeight(10);
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex12.html b/html/includes/jpgraph/docs/html/exframes/ganttex12.html
new file mode 100644
index 0000000000..5f8110fb87
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex12.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("A nice main title");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(0);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Add a right marker
$activity->rightMark->Show();
$activity->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity->rightMark->SetWidth(13);
$activity->rightMark->SetColor("red");
$activity->rightMark->SetFillColor("red");
$activity->rightMark->title->Set("M5");
$activity->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity->rightMark->title->SetColor("white");
// Set absolute height
$activity->SetHeight(10);
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-20");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Add a right marker
$activity2->rightMark->Show();
$activity2->rightMark->SetType(MARK_FILLEDCIRCLE);
$activity2->rightMark->SetWidth(13);
$activity2->rightMark->SetColor("red");
$activity2->rightMark->SetFillColor("red");
$activity2->rightMark->title->Set("M5");
$activity2->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12);
$activity2->rightMark->title->SetColor("white");
// Set absolute height
$activity2->SetHeight(10);
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Create a miletone
$milestone = new MileStone(2,"Milestone","2002-01-15","2002-01-15");
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex13.html b/html/includes/jpgraph/docs/html/exframes/ganttex13.html
new file mode 100644
index 0000000000..060421b853
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex13.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex13.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[ER,TR]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[BO,SW,JC]");
// ADjust font for caption
$activity2->caption->SetFont(FF_ARIAL,FS_BOLD);
$activity2->caption->SetColor("darkred");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex14.html b/html/includes/jpgraph/docs/html/exframes/ganttex14.html
new file mode 100644
index 0000000000..718f805ad0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex14.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex14.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex15.html b/html/includes/jpgraph/docs/html/exframes/ganttex15.html
new file mode 100644
index 0000000000..4f890add12
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex15.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex15.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
$activity->progress->SetPattern(BAND_HVCROSS,"blue");
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
$activity2->progress->SetPattern(BAND_HVCROSS,"blue");
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex16.html b/html/includes/jpgraph/docs/html/exframes/ganttex16.html
new file mode 100644
index 0000000000..53a013f0c6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex16.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex16.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Set table title
$graph->scale->tableTitle->Set("(Rev: 1.22)");
$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD);
$graph->scale->SetTableTitleBackground("silver");
$graph->scale->tableTitle->Show();
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
$activity->progress->SetPattern(BAND_HVCROSS,"blue");
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
$activity2->progress->SetPattern(BAND_HVCROSS,"blue");
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex17.html b/html/includes/jpgraph/docs/html/exframes/ganttex17.html
new file mode 100644
index 0000000000..bbca8cfdbb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex17.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex17.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Set table title
$graph->scale->tableTitle->Set("(Rev: 1.22)");
$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD);
$graph->scale->SetTableTitleBackground("silver");
// Modify the appearance of the dividing lines
$graph->scale->divider->SetWeight(3);
$graph->scale->divider->SetColor("navy");
$graph->scale->dividerh->SetWeight(3);
$graph->scale->dividerh->SetColor("navy");
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
$activity->progress->SetPattern(BAND_HVCROSS,"blue");
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
$activity2->progress->SetPattern(BAND_HVCROSS,"blue");
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex18.html b/html/includes/jpgraph/docs/html/exframes/ganttex18.html
new file mode 100644
index 0000000000..e0b2e0d74b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex18.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex18.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Set table title
$graph->scale->tableTitle->Set("(Rev: 1.22)");
$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD);
$graph->scale->SetTableTitleBackground("silver");
// Modify the appearance of the dividing lines
$graph->scale->divider->SetWeight(3);
$graph->scale->divider->SetColor("navy");
$graph->scale->dividerh->SetWeight(3);
$graph->scale->dividerh->SetColor("navy");
$graph->SetBox(true,"navy",3);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
$activity->progress->SetPattern(BAND_HVCROSS,"blue");
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
$activity2->progress->SetPattern(BAND_HVCROSS,"blue");
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttex19.html b/html/includes/jpgraph/docs/html/exframes/ganttex19.html
new file mode 100644
index 0000000000..64054009fb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttex19.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph(0,0,"auto");
$graph->SetBox();
$graph->SetShadow();
// Use swedish locale
$graph->scale->SetDateLocale("sv_SE");
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(ganttex19.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Set table title
$graph->scale->tableTitle->Set("(Rev: 1.22)");
$graph->scale->tableTitle->SetFont(FF_FONT1,FS_BOLD);
$graph->scale->SetTableTitleBackground("silver");
$graph->scale->tableTitle->Show();
$graph->scale->divider->SetStyle('solid');
$graph->scale->divider->SetWeight(2);
$graph->scale->divider->SetColor('black');
$graph->SetBox(true,"navy",2);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
$activity->progress->SetPattern(BAND_HVCROSS,"blue");
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG,"yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
$activity2->progress->SetPattern(BAND_HVCROSS,"blue");
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24","Phase 1");
$vline->SetDayOffset(0.5);
//$graph->Add($vline);
// ... and display it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/gantthgridex1.html b/html/includes/jpgraph/docs/html/exframes/gantthgridex1.html
new file mode 100644
index 0000000000..c2cda1db18
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/gantthgridex1.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt horizontal grid example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
// Some dummy data for some activities
$data = array(
array(0,"Group 1 Johan", "2001-10-23","2001-11-06",FF_FONT1,FS_BOLD,8),
array(1," Label 2", "2001-10-26","2001-11-04"),
array(3,"Group 2", "2001-11-20","2001-11-28",FF_FONT1,FS_BOLD,8),
array(4," Label 1", "2001-11-20","2001-12-1"));
// New Gantt Graph
$graph = new GanttGraph(500);
// Setup a title
$graph->title->Set("Grid example");
$graph->subtitle->Set("(Horizontal grid)");
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14);
// Specify what headers to show
$graph->ShowHeaders(GANTT_HMONTH|GANTT_HDAY );
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT0);
// Setup a horizontal grid
$graph->hgrid->Show();
$graph->hgrid->SetRowFillColor('darkblue@0.9');
for($i=0; $i<count($data); ++$i) {
$bar = new GanttBar($data[$i][0],$data[$i][1],$data[$i][2],$data[$i][3],"[5%]",10);
if( count($data[$i]) > 4 )
$bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]);
$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red");
$graph->Add($bar);
}
// Setup a vertical marker line
$vline = new GanttVLine("2001-11-01");
$vline->SetDayOffset(0.5);
$vline->title->Set("2001-11-01");
$vline->title->SetFont(FF_FONT1,FS_BOLD,10);
$graph->Add($vline);
// Setup a milestone
$ms = new MileStone(6,"M5","2001-11-28","28/12");
$ms->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($ms);
// And to show that you can also add an icon we add "Tux"
$icon = new IconPlot('penguin.png',0.01,0.95,1,15);
$icon->SetAnchor('left','bottom');
$graph->Add($icon);
// .. and finally send it back to the browser
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/gantthourex1.html b/html/includes/jpgraph/docs/html/exframes/gantthourex1.html
new file mode 100644
index 0000000000..6e1fa8d3f7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/gantthourex1.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt hour example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
$graph = new GanttGraph();
$graph->SetMarginColor('blue:1.7');
$graph->SetColor('white');
$graph->SetBackgroundGradient('navy','white',GRAD_HOR,BGRAD_MARGIN);
$graph->scale->hour->SetBackgroundColor('lightyellow:1.5');
$graph->scale->hour->SetFont(FF_FONT1);
$graph->scale->day->SetBackgroundColor('lightyellow:1.5');
$graph->scale->day->SetFont(FF_FONT1,FS_BOLD);
$graph->title->Set("Example of hours in scale");
$graph->title->SetColor('white');
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT1);
$graph->scale->hour->SetIntervall(4);
$graph->scale->hour->SetStyle(HOURSTYLE_HM24);
$graph->scale->day->SetStyle(DAYSTYLE_SHORTDAYDATE3);
$data = array(
array(0," Label 1", "2001-01-26 04:00","2001-01-26 14:00"),
array(1," Label 2", "2001-01-26 10:00","2001-01-26 18:00"),
array(2," Label 3", "2001-01-26","2001-01-27 10:00")
);
for($i=0; $i<count($data); ++$i) {
$bar = new GanttBar($data[$i][0],$data[$i][1],$data[$i][2],$data[$i][3],"[5%]",10);
if( count($data[$i])>4 )
$bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]);
$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red");
$graph->Add($bar);
}
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/gantthourminex1.html b/html/includes/jpgraph/docs/html/exframes/gantthourminex1.html
new file mode 100644
index 0000000000..08c24d241c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/gantthourminex1.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt hour + minute example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
// Some sample Gantt data
$data = array(
array(0,array("Group 1","345 days","2004-03-01","2004-05-05"), "2001-11-27 10:00","2001-11-27 14:00",FF_FONT2,FS_NORMAL,0),
array(1,array(" Label one",' 122,5 days',' 2004-03-01',' 2003-05-05','MJ'), "2001-11-27 16:00","2001-11-27 18:00"),
array(2," Label two", "2001-11-27","2001-11-27 10:00"),
array(3," Label three", "2001-11-27","2001-11-27 08:00")
);
// Basic graph parameters
$graph = new GanttGraph();
$graph->SetMarginColor('darkgreen@0.8');
$graph->SetColor('white');
// We want to display day, hour and minute scales
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN);
// We want to have the following titles in our columns
// describing each activity
$graph->scale->actinfo->SetColTitles(
array('Act','Duration','Start','Finish','Resp'));//,array(100,70,70,70));
// Uncomment the following line if you don't want the 3D look
// in the columns headers
//$graph->scale->actinfo->SetStyle(ACTINFO_2D);
$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10);
//These are the default values for use in the columns
//$graph->scale->actinfo->SetFontColor('black');
//$graph->scale->actinfo->SetBackgroundColor('lightgray');
//$graph->scale->actinfo->vgrid->SetStyle('solid');
$graph->scale->actinfo->vgrid->SetColor('gray');
$graph->scale->actinfo->SetColor('darkgray');
// Setup day format
$graph->scale->day->SetBackgroundColor('lightyellow:1.5');
$graph->scale->day->SetFont(FF_ARIAL);
$graph->scale->day->SetStyle(DAYSTYLE_SHORTDAYDATE1);
// Setup hour format
$graph->scale->hour->SetIntervall(1);
$graph->scale->hour->SetBackgroundColor('lightyellow:1.5');
$graph->scale->hour->SetFont(FF_FONT0);
$graph->scale->hour->SetStyle(HOURSTYLE_H24);
$graph->scale->hour->grid->SetColor('gray:0.8');
// Setup minute format
$graph->scale->minute->SetIntervall(30);
$graph->scale->minute->SetBackgroundColor('lightyellow:1.5');
$graph->scale->minute->SetFont(FF_FONT0);
$graph->scale->minute->SetStyle(MINUTESTYLE_MM);
$graph->scale->minute->grid->SetColor('lightgray');
$graph->scale->tableTitle->Set('Phase 1');
$graph->scale->tableTitle->SetFont(FF_ARIAL,FS_NORMAL,12);
$graph->scale->SetTableTitleBackground('darkgreen@0.6');
$graph->scale->tableTitle->Show(true);
$graph->title->Set("Example of hours & mins scale");
$graph->title->SetColor('darkgray');
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
for($i=0; $i<count($data); ++$i) {
$bar = new GanttBar($data[$i][0],$data[$i][1],$data[$i][2],$data[$i][3]);
if( count($data[$i])>4 )
$bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]);
$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("gray");
$graph->Add($bar);
}
$vline = new GanttVLine("2001-11-27 13:00");
$vline->title->Set("27/11 13:00");
$vline->title->SetFont(FF_FONT1,FS_BOLD,10);
$graph->Add($vline);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/gantticonex1.html b/html/includes/jpgraph/docs/html/exframes/gantticonex1.html
new file mode 100644
index 0000000000..4f9a08832c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/gantticonex1.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
// Basic Gantt graph
$graph = new GanttGraph();
$graph->title->Set("Using the builtin icons");
// Explicitely set the date range
// (Autoscaling will of course also work)
$graph->SetDateRange('2001-10-06','2002-4-10');
// 1.5 line spacing to make more room
$graph->SetVMarginFactor(1.5);
// Setup some nonstandard colors
$graph->SetMarginColor('lightgreen@0.8');
$graph->SetBox(true,'yellow:0.6',2);
$graph->SetFrame(true,'darkgreen',4);
$graph->scale->divider->SetColor('yellow:0.6');
$graph->scale->dividerh->SetColor('yellow:0.6');
// Display month and year scale with the gridlines
$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR);
$graph->scale->month->grid->SetColor('gray');
$graph->scale->month->grid->Show(true);
$graph->scale->year->grid->SetColor('gray');
$graph->scale->year->grid->Show(true);
// For the titles we also add a minimum width of 100 pixels for the Task name column
$graph->scale->actinfo->SetColTitles(
array('Note','Task','Duration','Start','Finish'),array(30,100));
$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5');
$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10);
$graph->scale->actinfo->vgrid->SetStyle('solid');
$graph->scale->actinfo->vgrid->SetColor('gray');
// Uncomment this to keep the columns but show no headers
//$graph->scale->actinfo->Show(false);
// Setup the icons we want to use
$erricon = new IconImage(GICON_FOLDER,0.6);
$startconicon = new IconImage(GICON_FOLDEROPEN,0.6);
$endconicon = new IconImage(GICON_TEXTIMPORTANT,0.5);
// Store the icons in the first column and use plain text in the others
$data = array(
array(0,array($erricon,"Pre-study","102 days","23 Nov '01","1 Mar '02")
, "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8),
array(1,array($startconicon,"Prototype","21 days","26 Oct '01","16 Nov '01"),
"2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8),
array(2,array($endconicon,"Report","12 days","1 Mar '02","13 Mar '02"),
"2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8)
);
// Create the bars and add them to the gantt chart
for($i=0; $i<count($data); ++$i) {
$bar = new GanttBar($data[$i][0],$data[$i][1],$data[$i][2],$data[$i][3],"[50%]",10);
if( count($data[$i])>4 )
$bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]);
$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("gray");
$bar->progress->Set(0.5);
$bar->progress->SetPattern(GANTT_SOLID,"darkgreen");
$bar->title->SetCSIMTarget(array('#1'.$i,'#2'.$i,'#3'.$i,'#4'.$i,'#5'.$i),array('11'.$i,'22'.$i,'33'.$i));
$graph->Add($bar);
}
// Output the chart
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/ganttsimpleex1.html b/html/includes/jpgraph/docs/html/exframes/ganttsimpleex1.html
new file mode 100644
index 0000000000..8702c10a73
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/ganttsimpleex1.html
@@ -0,0 +1,3 @@
+
+<?php
// Gantt example
include ("../jpgraph.php");
include ("../jpgraph_gantt.php");
//
// The data for the graphs
//
$data = array(
array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",''),
array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-13",'[KJ]'),
array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",'[EP]'),
array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2') );
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Gantt Graph using CreateSimple()");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Add the specified activities
$graph->CreateSimple($data);
// .. and stroke the graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/gradbkgex1.html b/html/includes/jpgraph/docs/html/exframes/gradbkgex1.html
new file mode 100644
index 0000000000..e03fbb55cb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/gradbkgex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay1 = array(4,26,12,18,8,22);
$datay2 = array(12,9,42,8,20,19);
// Setup the graph
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin",0,50);
$graph->SetMargin(30,50,30,30);
// We must have the frame enabled to get the gradient
// However, we don't want the frame line so we set it to
// white color which makes it invisible.
$graph->SetFrame(true,'white');
// Setup a background gradient image
$graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_PLOT);
// Setup the tab title
$graph->tabtitle->Set(' 3rd Division ' );
$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13);
// Setup x,Y grid
$graph->xgrid->Show();
$graph->xgrid->SetColor('gray@0.5');
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
$graph->ygrid->SetColor('gray@0.5');
// Setup color for axis and labels on axis
$graph->xaxis->SetColor('orange','black');
$graph->yaxis->SetColor('orange','black');
// Ticks on the outsid
$graph->xaxis->SetTickSide(SIDE_DOWN);
$graph->yaxis->SetTickSide(SIDE_LEFT);
// Setup the legend box colors and font
$graph->legend->SetColor('white','navy');
$graph->legend->SetFillColor('navy@0.25');
$graph->legend->SetFont(FF_ARIAL,FS_BOLD,8);
$graph->legend->SetShadow('darkgray@0.4',3);
$graph->legend->SetPos(0.05,0.05,'right','top');
// Create the first line
$p1 = new LinePlot($datay1);
$p1->SetColor("red");
$p1->SetWeight(2);
$p1->SetLegend('2002');
$graph->Add($p1);
// Create the second line
$p2 = new LinePlot($datay2);
$p2->SetColor("lightyellow");
$p2->SetLegend('2001');
$p2->SetWeight(2);
$graph->Add($p2);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/horizbarex1.html b/html/includes/jpgraph/docs/html/exframes/horizbarex1.html
new file mode 100644
index 0000000000..78e5502c17
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/horizbarex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(2,3,5,8,12,6,3);
$datax=array("Jan","Feb","Mar","Apr","May","Jun","Jul");
// Size of graph
$width=400;
$height=500;
// Set the basic parameters of the graph
$graph = new Graph($width,$height,'auto');
$graph->SetScale("textlin");
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(50,20,50,30);
// Nice shadow
$graph->SetShadow();
// Setup title
$graph->title->Set("Horizontal bar graph ex 1");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
$graph->subtitle->Set("(No Y-axis)");
// Setup X-axis
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12);
// Some extra margin looks nicer
$graph->xaxis->SetLabelMargin(10);
// Label align for X-axis
$graph->xaxis->SetLabelAlign('right','center');
// Add some grace to y-axis so the bars doesn't go
// all the way to the end of the plot area
$graph->yaxis->scale->SetGrace(20);
// We don't want to display Y-axis
$graph->yaxis->Hide();
// Now create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$bplot->SetShadow();
//You can change the width of the bars if you like
//$bplot->SetWidth(0.5);
// We want to display the value of each bar at the top
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12);
$bplot->value->SetAlign('left','center');
$bplot->value->SetColor("black","darkred");
$bplot->value->SetFormat('%.1f mkr');
// Add the bar to the graph
$graph->Add($bplot);
// .. and stroke the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/horizbarex2.html b/html/includes/jpgraph/docs/html/exframes/horizbarex2.html
new file mode 100644
index 0000000000..c0c14953e0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/horizbarex2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(2,3,5,8,12,6,3);
$datax=array("Jan","Feb","Mar","Apr","May","Jun","Jul");
$width=400;
$height=500;
// Set the basic parameters of the graph
$graph = new Graph($width,$height,'auto');
$graph->SetScale("textlin");
$top = 80;
$bottom = 30;
$left = 50;
$right = 30;
$graph->Set90AndMargin($left,$right,$top,$bottom);
// Nice shadow
$graph->SetShadow();
// Setup title
$graph->title->Set("Horizontal bar graph ex 2");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
$graph->subtitle->Set("(Axis at top)");
// Setup X-axis
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12);
// Some extra margin looks nicer
$graph->xaxis->SetLabelMargin(5);
// Label align for X-axis
$graph->xaxis->SetLabelAlign('right','center');
// Add some grace to y-axis so the bars doesn't go
// all the way to the end of the plot area
$graph->yaxis->scale->SetGrace(20);
$graph->yaxis->SetLabelAlign('center','bottom');
$graph->yaxis->SetLabelAngle(45);
$graph->yaxis->SetLabelFormat('%d');
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,12);
// We don't want to display Y-axis
//$graph->yaxis->Hide();
// Now create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$bplot->SetShadow();
//You can change the width of the bars if you like
//$bplot->SetWidth(0.5);
// We want to display the value of each bar at the top
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12);
$bplot->value->SetAlign('left','center');
$bplot->value->SetColor("black","darkred");
$bplot->value->SetFormat('%.1f mkr');
// Add the bar to the graph
$graph->Add($bplot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/horizbarex3.html b/html/includes/jpgraph/docs/html/exframes/horizbarex3.html
new file mode 100644
index 0000000000..3e9126454e
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/horizbarex3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(2,3,-5,8,12,6,3);
$datax=array("Jan","Feb","Mar","Apr","May","Jun","Jul");
// Size of graph
$width=400;
$height=500;
// Set the basic parameters of the graph
$graph = new Graph($width,$height,'auto');
$graph->SetScale("textlin");
$top = 50;
$bottom = 80;
$left = 50;
$right = 20;
$graph->Set90AndMargin($left,$right,$top,$bottom);
$graph->xaxis->SetPos('min');
// Nice shadow
$graph->SetShadow();
// Setup title
$graph->title->Set("Horizontal bar graph ex 3");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
$graph->subtitle->Set("(Axis at bottom)");
// Setup X-axis
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_FONT2,FS_BOLD,12);
// Some extra margin looks nicer
$graph->xaxis->SetLabelMargin(5);
// Label align for X-axis
$graph->xaxis->SetLabelAlign('right','center');
// Add some grace to y-axis so the bars doesn't go
// all the way to the end of the plot area
$graph->yaxis->scale->SetGrace(20);
// Setup the Y-axis to be displayed in the bottom of the
// graph. We also finetune the exact layout of the title,
// ticks and labels to make them look nice.
$graph->yaxis->SetPos('max');
// First make the labels look right
$graph->yaxis->SetLabelAlign('center','top');
$graph->yaxis->SetLabelFormat('%d');
$graph->yaxis->SetLabelSide(SIDE_RIGHT);
// The fix the tick marks
$graph->yaxis->SetTickSide(SIDE_LEFT);
// Finally setup the title
$graph->yaxis->SetTitleSide(SIDE_RIGHT);
$graph->yaxis->SetTitleMargin(35);
// To align the title to the right use :
$graph->yaxis->SetTitle('Turnaround 2002','high');
$graph->yaxis->title->Align('right');
// To center the title use :
//$graph->yaxis->SetTitle('Turnaround 2002','center');
//$graph->yaxis->title->Align('center');
$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->yaxis->title->SetAngle(0);
$graph->yaxis->SetFont(FF_FONT2,FS_NORMAL);
// If you want the labels at an angle other than 0 or 90
// you need to use TTF fonts
//$graph->yaxis->SetLabelAngle(0);
// Now create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$bplot->SetShadow();
//You can change the width of the bars if you like
//$bplot->SetWidth(0.5);
// We want to display the value of each bar at the top
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12);
$bplot->value->SetAlign('left','center');
$bplot->value->SetColor("black","darkred");
$bplot->value->SetFormat('%.1f mkr');
// Add the bar to the graph
$graph->Add($bplot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/horizbarex4.html b/html/includes/jpgraph/docs/html/exframes/horizbarex4.html
new file mode 100644
index 0000000000..2e003278a4
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/horizbarex4.html
@@ -0,0 +1,4 @@
+
+<?php
// $Id: horizbarex4.php,v 1.4 2002/11/17 23:59:27 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(1992,1993,1995,1996,1997,1998,2001);
// Size of graph
$width=400;
$height=500;
// Set the basic parameters of the graph
$graph = new Graph($width,$height,'auto');
$graph->SetScale("textlin");
$top = 60;
$bottom = 30;
$left = 80;
$right = 30;
$graph->Set90AndMargin($left,$right,$top,$bottom);
// Nice shadow
$graph->SetShadow();
// Setup labels
$lbl = array("Andrew\nTait","Thomas\nAnderssen","Kevin\nSpacey","Nick\nDavidsson",
"David\nLindquist","Jason\nTait","Lorin\nPersson");
$graph->xaxis->SetTickLabels($lbl);
// Label align for X-axis
$graph->xaxis->SetLabelAlign('right','center','right');
// Label align for Y-axis
$graph->yaxis->SetLabelAlign('center','bottom');
// Titles
$graph->title->Set('Year Married');
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$bplot->SetWidth(0.5);
$bplot->SetYMin(1990);
$graph->Add($bplot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/image_JpGraph_Logo.html b/html/includes/jpgraph/docs/html/exframes/image_JpGraph_Logo.html
new file mode 100644
index 0000000000..3058d7e112
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/image_JpGraph_Logo.html
@@ -0,0 +1 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_scatter.php");
$datay1 = array(4,26,15,44);
// Setup the graph
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30,5,25,20);
// Setup the tab
$graph->tabtitle->Set(' Year 2003 ' );
$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13);
$graph->tabtitle->SetColor('darkred','#E1E1FF');
// Enable X-grid as well
$graph->xgrid->Show();
// Use months as X-labels
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Create the plot
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
$p1->SetCSIMTargets(array('#1','#2','#3','#4','#5'));
// Use an image of favourite car as
$p1->mark->SetType(MARK_IMG,'saab_95.jpg',0.5);
//$p1->mark->SetType(MARK_SQUARE);
// Displayes value on top of marker image
$p1->value->SetFormat('%d mil');
$p1->value->Show();
$p1->value->SetColor('darkred');
$p1->value->SetFont(FF_ARIAL,FS_BOLD,10);
// Increase the margin so that the value is printed avove tje
// img marker
$p1->value->SetMargin(14);
// Incent the X-scale so the first and last point doesn't
// fall on the edges
$p1->SetCenter();
$graph->Add($p1);
$graph->StrokeCSIM('imgmarkercsimex1.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/imgmarkerex1.html b/html/includes/jpgraph/docs/html/exframes/imgmarkerex1.html
new file mode 100644
index 0000000000..bd070a7182
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/imgmarkerex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_scatter.php");
$datay1 = array(4,26,15,44);
// Setup the graph
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30,5,25,20);
// Setup the tab
$graph->tabtitle->Set(' Year 2003 ' );
$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13);
$graph->tabtitle->SetColor('darkred','#E1E1FF');
// Enable X-grid as well
$graph->xgrid->Show();
// Use months as X-labels
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Create the plot
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
// Use an image of favourite car as marker
$p1->mark->SetType(MARK_IMG,'saab_95.jpg',0.5);
// Displayes value on top of marker image
$p1->value->SetFormat('%d mil');
$p1->value->Show();
$p1->value->SetColor('darkred');
$p1->value->SetFont(FF_ARIAL,FS_BOLD,10);
// Increase the margin so that the value is printed avove tje
// img marker
$p1->value->SetMargin(14);
// Incent the X-scale so the first and last point doesn't
// fall on the edges
$p1->SetCenter();
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/impulsex1.html b/html/includes/jpgraph/docs/html/exframes/impulsex1.html
new file mode 100644
index 0000000000..075c0e9ff2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/impulsex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,40,40,40);
$graph->title->Set("Simple mpuls plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$sp1 = new ScatterPlot($datay);
$sp1->mark->SetType(MARK_SQUARE);
$sp1->SetImpuls();
$graph->Add($sp1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/impulsex2.html b/html/includes/jpgraph/docs/html/exframes/impulsex2.html
new file mode 100644
index 0000000000..3fe23929d8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/impulsex2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,40,40,40);
$graph->title->Set("Impuls plot, variant 2");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->Set("Impuls respons");
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$sp1 = new ScatterPlot($datay);//,$datax);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(4);
$sp1->SetImpuls();
$sp1->SetColor("blue");
$sp1->SetWeight(3);
$graph->Add($sp1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/impulsex3.html b/html/includes/jpgraph/docs/html/exframes/impulsex3.html
new file mode 100644
index 0000000000..b478d6da94
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/impulsex3.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
$numpoints=50;
$k=0.05;
// Create some data points
for($i=0; $i<$numpoints; ++$i) {
$datay[$i]=exp(-$k*$i)*cos(2*M_PI/10*$i);
}
// A format callbakc function
function mycallback($l) {
return sprintf("%02.2f",$l);
}
// Setup the basic parameters for the graph
$graph = new Graph(400,200,"auto");
$graph->SetScale("intlin");
$graph->SetShadow();
$graph->SetBox();
$graph->title->Set("Impuls Example 3");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Set format callback for labels
$graph->yaxis->SetLabelFormatCallback("mycallback");
// Set X-axis at the minimum value of Y-axis (default will be at 0)
$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis
// Extend the margin for the labels on the Y-axis and reverse the direction
// of the ticks on the Y-axis
$graph->yaxis->SetLabelMargin(12);
$graph->xaxis->SetLabelMargin(6);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->xaxis->SetTickSide(SIDE_DOWN);
// Create a new impuls type scatter plot
$sp1 = new ScatterPlot($datay);
$sp1->mark->SetType(MARK_SQUARE);
$sp1->mark->SetFillColor("red");
$sp1->SetImpuls();
$sp1->SetColor("blue");
$sp1->SetWeight(1);
$sp1->mark->SetWidth(3);
$graph->Add($sp1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/impulsex4.html b/html/includes/jpgraph/docs/html/exframes/impulsex4.html
new file mode 100644
index 0000000000..57f8e4e331
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/impulsex4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
include ("../jpgraph_line.php");
$numpoints=50;
$k=0.05;
// Create some data points
for($i=-$numpoints+1; $i<0; ++$i) {
$datay[$i+$numpoints-1]=exp($k*$i)*cos(2*M_PI/10*$i)*14;
$datayenv[$i+$numpoints-1]=exp($k*$i)*14;
$datax[$i+$numpoints-1]=$i;
}
for($i=0; $i<$numpoints; ++$i) {
$datay[$i+$numpoints-1]=exp(-$k*$i)*cos(2*M_PI/10*$i)*14;
$datayenv[$i+$numpoints-1]=exp(-$k*$i)*14;
$datax[$i+$numpoints-1]=$i;
}
// Setup the basic parameters for the graph
$graph = new Graph(500,250,"auto");
$graph->SetScale("intlin");
$graph->SetShadow();
$graph->SetBox();
$graph->title->Set("Impuls Example 4");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Set some other color then the boring default
$graph->SetColor("lightyellow");
$graph->SetMarginColor("khaki");
// Set legend box specification
$graph->legend->SetFillColor("white");
$graph->legend->SetLineWeight(2);
// Set X-axis at the minimum value of Y-axis (default will be at 0)
$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis
// Extend the margin for the labels on the Y-axis and reverse the direction
// of the ticks on the Y-axis
$graph->yaxis->SetLabelMargin(12);
$graph->xaxis->SetLabelMargin(6);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->xaxis->SetTickSide(SIDE_DOWN);
// Add mark graph with static lines
$line = new PlotLine(HORIZONTAL,0,"black",2);
$graph->AddLine($line);
// Create a new impuls type scatter plot
$sp1 = new ScatterPlot($datay,$datax);
$sp1->mark->SetType(MARK_SQUARE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(3);
$sp1->SetImpuls();
$sp1->SetColor("blue");
$sp1->SetWeight(1);
$sp1->SetLegend("Non-causal signal");
$graph->Add($sp1);
// Create the envelope plot
$ep1 = new LinePlot($datayenv,$datax);
$ep1->SetStyle("dotted");
$ep1->SetLegend("Positive envelope");
$graph->Add($ep1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/inyaxisex2.html b/html/includes/jpgraph/docs/html/exframes/inyaxisex2.html
new file mode 100644
index 0000000000..d2ac099318
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/inyaxisex2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
// Callback to negate the argument
function _cb_negate($aVal) {
return round(-$aVal);
}
// A fake depth curve
$ydata = array(0,1,4,5,8,9,10,14,16,16,16,18,20,20,20,22,22.5,22,19,19,15,15,15,15,10,10,10,6,5,5,5,4,4,2,1,0);
// Negate all data
$n = count($ydata);
for($i=0; $i<$n; ++$i) {
$ydata[$i] = round(-$ydata[$i]);
}
// Basic graph setup
$graph = new Graph(400,300,"auto");
$graph->SetScale("linlin");
$graph->img->SetMargin(50,50,60,40);
$graph->SetMarginColor('darkblue');
$graph->SetColor('darkblue');
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
$graph->SetBackgroundImage("blueblack400x300grad.png",1);
//$graph->SetBackgroundImage("lightbluedarkblue400x300grad.png",1);
$graph->title->Set("Depth curve. Dive #2");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->title->SetColor("white");
$graph->subtitle->Set("(Negated Y-axis)");
$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL);
$graph->subtitle->SetColor("white");
// Setup axis
$graph->yaxis->SetLabelFormatCallback("_cb_negate");
$graph->xaxis->SetColor("lightblue","white");
$graph->yaxis->SetColor("lightblue","white");
$graph->ygrid->SetColor("blue");
$lp1 = new LinePlot($ydata);
$lp1->SetColor("yellow");
$lp1->SetWeight(2);
$graph->Add($lp1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/linebarcentex1.html b/html/includes/jpgraph/docs/html/exframes/linebarcentex1.html
new file mode 100644
index 0000000000..35eb4d3433
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/linebarcentex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_bar.php");
$l1datay = array(11,9,2,4,3,13,17);
$l2datay = array(23,12,5,19,17,10,15);
$datax=$gDateLocale->GetShortMonth();
// Create the graph.
$graph = new Graph(400,200,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(40,130,20,40);
$graph->SetShadow();
$graph->xaxis->SetTickLabels($datax);
// Create the linear error plot
$l1plot=new LinePlot($l1datay);
$l1plot->SetColor("red");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
//Center the line plot in the center of the bars
$l1plot->SetBarCenter();
// Create the bar plot
$bplot = new BarPlot($l2datay);
$bplot->SetFillColor("orange");
$bplot->SetLegend("Result");
// Add the plots to t'he graph
$graph->Add($bplot);
$graph->Add($l1plot);
$graph->title->Set("Adding a line plot to a bar graph v1");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/lineiconex1.html b/html/includes/jpgraph/docs/html/exframes/lineiconex1.html
new file mode 100644
index 0000000000..0b24addcd5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/lineiconex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_iconplot.php");
//$datay = array(20,15,23,15,17,35,22);
$datay = array(30,25,33,25,27,45,32);
$datay2 = array(3,25,10,15,50,5,18);
$datay3 = array(10,5,10,15,5,2,1);
// Setup the graph
$graph = new Graph(400,250);
$graph->SetMargin(40,40,20,30);
$graph->SetScale("textlin");
$graph->title->Set('Adding an icon ("tux") in the background');
$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12);
//$graph->SetBackgroundGradient('red','blue');
$graph->xaxis->SetPos('min');
$p1 = new LinePlot($datay);
$p1->SetColor("blue");
$p1->SetFillGradient('yellow@0.4','red@0.4');
$p2 = new LinePlot($datay2);
$p2->SetColor("black");
$p2->SetFillGradient('green@0.4','white');
$p3 = new LinePlot($datay3);
$p3->SetColor("blue");
$p3->SetFillGradient('navy@0.4','white@0.4');
$graph->Add($p1);
$graph->Add($p2);
$graph->Add($p3);
$icon = new IconPlot('penguin.png',0.2,0.3,1,30);
$icon->SetAnchor('center','center');
$graph->Add($icon);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/lineiconex2.html b/html/includes/jpgraph/docs/html/exframes/lineiconex2.html
new file mode 100644
index 0000000000..dae7ad608b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/lineiconex2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_flags.php");
include ("../jpgraph_iconplot.php");
$datay = array(30,25,33,25,27,45,32);
// Setup the graph
$graph = new Graph(400,250);
$graph->SetMargin(40,40,20,30);
$graph->SetScale("textlin");
$graph->title->Set('Adding a country flag as a an icon');
$p1 = new LinePlot($datay);
$p1->SetColor("blue");
$p1->SetFillGradient('yellow@0.4','red@0.4');
$graph->Add($p1);
$icon = new IconPlot();
$icon->SetCountryFlag('iceland',50,30,1.5,40,3);
$icon->SetAnchor('left','top');
$graph->Add($icon);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/listfontsex1.html b/html/includes/jpgraph/docs/html/exframes/listfontsex1.html
new file mode 100644
index 0000000000..0760a3b546
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/listfontsex1.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: listfontsex1.php,v 1.3 2002/10/25 22:44:15 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
$g = new CanvasGraph(550,450,'auto');
$scale = new CanvasScale($g);
$scale->Set(0,27,0,53);
$g->SetMargin(5,6,5,6);
$g->SetColor('white');
$g->SetMarginColor("teal");
$g->InitFrame();
$t = new CanvasRectangleText();
$t->SetFillColor('lightgreen');
$t->SetFontColor('navy');
$t->SetFont(FF_ARIAL,FS_NORMAL,16);
$t->Set("\n\n\n\n\n\n\n\n\n\n\nTTF Fonts",0.5,19,26,32);
$t->Stroke($g->img,$scale);
$t = new CanvasRectangleText();
$t->SetFillColor('');
$t->SetFontColor('black');
$t->SetColor('');
$t->SetShadow('');
$t->SetFont(FF_ARIAL,FS_BOLD,18);
$t->Set('Family',1,1,8);
$t->Stroke($g->img,$scale);
$t->Set('Italic style',9,1,8);
$t->Stroke($g->img,$scale);
$t->Set('Bold style',17.5,1,8);
$t->Stroke($g->img,$scale);
$t->SetFillColor('yellow');
$t->SetFontColor('black');
$t->SetColor('black');
$t->SetShadow('gray');
$r=6;$c=1;$w=7.5;$h=3.5;
$fonts=array(
array("Font 0",FF_FONT0,FS_NORMAL),
array("",FF_FONT0,FS_ITALIC),
array("",FF_FONT0,FS_BOLD),
array("Font 1",FF_FONT1,FS_NORMAL),
array("",FF_FONT1,FS_ITALIC),
array("Font 1 bold",FF_FONT1,FS_BOLD),
array("Font 2",FF_FONT2,FS_NORMAL),
array("",FF_FONT2,FS_ITALIC),
array("Font 2 bold",FF_FONT2,FS_BOLD),
array("Arial",FF_ARIAL,FS_NORMAL),
array("Arial italic",FF_ARIAL,FS_ITALIC),
array("Arial bold",FF_ARIAL,FS_BOLD),
array("Verdana",FF_VERDANA,FS_NORMAL),
array("Verdana italic",FF_VERDANA,FS_ITALIC),
array("Verdana bold",FF_VERDANA,FS_BOLD),
array("Trebuche",FF_TREBUCHE,FS_NORMAL),
array("Trebuche italic",FF_TREBUCHE,FS_ITALIC),
array("Trebuche bold",FF_TREBUCHE,FS_BOLD),
array("Georgia",FF_GEORGIA,FS_NORMAL),
array("Georgia italic",FF_GEORGIA,FS_ITALIC),
array("Georgia bold",FF_GEORGIA,FS_BOLD),
array("Comic",FF_COMIC,FS_NORMAL),
array("",FF_COMIC,FS_ITALIC),
array("Comic bold",FF_COMIC,FS_BOLD),
array("Courier",FF_COURIER,FS_NORMAL),
array("Courier italic",FF_COURIER,FS_ITALIC),
array("Courier bold",FF_COURIER,FS_BOLD),
array("Times normal",FF_TIMES,FS_NORMAL),
array("Times italic",FF_TIMES,FS_ITALIC),
array("Times bold italic",FF_TIMES,FS_BOLDITALIC),
);
$n=count($fonts);
for( $i=0; $i < $n; ++$i ) {
if( $i==9 ) $r += 3;
if( $fonts[$i][0] ) {
$t->SetTxt($fonts[$i][0]);
$t->SetPos($c,$r,$w,$h);
$t->SetFont($fonts[$i][1],$fonts[$i][2],13);
$t->Stroke($g->img,$scale);
}
$c += $w+1;
if( $c > 30-$w-2 ) {
$c = 1;
$r += 4;
}
}
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/logbarex1.html b/html/includes/jpgraph/docs/html/exframes/logbarex1.html
new file mode 100644
index 0000000000..42688c61bb
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/logbarex1.html
@@ -0,0 +1,4 @@
+
+<?php
// $Id: logbarex1.php,v 1.4 2003/05/30 20:12:43 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_bar.php");
$datay=array(4,13,30,28,12,45,30,12,55,3,0.5);
$datax=array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov");
// Create the graph.
$graph = new Graph(400,220,'auto');
//$graph->img->SetMargin(50,30,50,50);
$graph->SetScale("textlog");
//$graph->SetShadow();
// Setup titles for graph and axis
$graph->title->Set("Bar with logarithmic Y-scale");
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,18);
$graph->xaxis->SetTitle("2002");
$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16);
$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16);
$graph->yaxis->SetTitle("Y-title",'center');
$graph->yaxis->SetTitleMargin(30);
// Setup month on X-scale
//$graph->xaxis->SetTickLabels($datax);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
//You can also set a manual base of the bars
//$bplot->SetYBase(0.001);
/*
$bplot->SetShadow();
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
$bplot->value->SetAngle(45);
$bplot->value->SetColor("black","darkred");
*/
$graph->Add($bplot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/loglogex1.html b/html/includes/jpgraph/docs/html/exframes/loglogex1.html
new file mode 100644
index 0000000000..c3dd01982b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/loglogex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_log.php");
include ("../jpgraph_line.php");
include ("../jpgraph_scatter.php");
$ab2 = array( 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0,
12.0, 15.0, 20.0, 25.0, 30.0, 40.0, 50.0, 60.0 ,75.0,
100., 125., 150.);
$mn2 = array( 0.5, 0.5, 0.5, 0.5, 0.8, 0.8, 0.8, 0.8, 1.0,
1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0,
5.0, 5.0, 5.0);
$rhos = array(30.0, 31.0, 32.0, 34.0, 35.5, 37.5, 38.0, 39.5, 41.5,
43.0, 41.0, 42.0, 42.5, 45.0, 49.0, 53.5, 58.0, 66.5,
75.0, 81.0, 89.0);
// Create the graph.
$graph = new Graph(500,300,"auto");
$graph->SetScale("loglog");
$graph->SetY2Scale("lin");
$graph->y2axis->SetColor("blue","blue");
$graph->img->SetMargin(50,70,40,50);
$graph->title->Set("Geoelektrik");
$graph->xaxis->title->Set("Auslage ab/2 [m]");
$graph->yaxis->title->Set("rho_s [Ohm m]");
$graph->y2axis->title->Set("mn/2 [m]");
$graph->y2axis->title->SetColor("blue");
$graph->y2axis->SetTitleMargin(35);
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xgrid->Show(true,true);
$graph->ygrid->Show(true,true);
// Create the linear plot
$lineplot=new LinePlot($rhos,$ab2);
$lineplot->SetWeight(1);
$lineplot->mark->SetType(MARK_FILLEDCIRCLE);
$lineplot->mark->SetWidth(2);
// Create scatter plot
$scplot=new ScatterPlot($mn2,$ab2);
$scplot->mark->SetType(MARK_FILLEDCIRCLE);
$scplot->mark->SetColor("blue");
$scplot->mark->SetWidth(2);
// Add plots to the graph
$graph->AddY2($scplot);
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/manscaleex1.html b/html/includes/jpgraph/docs/html/exframes/manscaleex1.html
new file mode 100644
index 0000000000..4e3571a0d8
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/manscaleex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(220,200);
$graph->SetScale("textlin",3,35);
$graph->yscale->ticks->Set(7,2);
$graph->title->Set('Manual scale, manual ticks');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$line = new LinePlot($ydata);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/manscaleex2.html b/html/includes/jpgraph/docs/html/exframes/manscaleex2.html
new file mode 100644
index 0000000000..7a5a2c082f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/manscaleex2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(220,200);
$graph->SetScale("textlin",3,35);
$graph->title->Set('Manual scale, exact limits');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$line = new LinePlot($ydata);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/manscaleex3.html b/html/includes/jpgraph/docs/html/exframes/manscaleex3.html
new file mode 100644
index 0000000000..b7f6720b00
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/manscaleex3.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(250,200);
$graph->SetScale("textlin",3,35);
$graph->SetTickDensity(TICKD_DENSE);
$graph->yscale->SetAutoTicks();
$graph->title->Set('Manual scale, auto ticks');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$line = new LinePlot($ydata);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/manscaleex4.html b/html/includes/jpgraph/docs/html/exframes/manscaleex4.html
new file mode 100644
index 0000000000..dc4b4f3110
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/manscaleex4.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(220,200);
$graph->SetScale("textlin",3,35);
$graph->yscale->SetAutoTicks();
$graph->title->Set('Manual scale, allow adjustment');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$line = new LinePlot($ydata);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/markflagex1.html b/html/includes/jpgraph/docs/html/exframes/markflagex1.html
new file mode 100644
index 0000000000..2bfd3883e6
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/markflagex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_scatter.php");
$datay = array(
array(4,26,15,44),
array(20,51,32,20));
// Setup the graph
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30,5,25,20);
// Enable X-grid as well
$graph->xgrid->Show();
// Use months as X-labels
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
//------------------------
// Create the plots
//------------------------
$p1 = new LinePlot($datay[0]);
$p1->SetColor("navy");
// Use a flag
$p1->mark->SetType(MARK_FLAG1,'chin');
// Displayes value on top of marker image
$p1->value->SetFormat('%d mil');
$p1->value->Show();
$p1->value->SetColor('darkred');
$p1->value->SetFont(FF_ARIAL,FS_BOLD,10);
// Increase the margin so that the value is printed avove tje
// img marker
$p1->value->SetMargin(14);
// Incent the X-scale so the first and last point doesn't
// fall on the edges
$p1->SetCenter();
$graph->Add($p1);
//------------
// 2:nd plot
//------------
$p2 = new LinePlot($datay[1]);
$p2->SetColor("navy");
// Use a flag
$p2->mark->SetType(MARK_FLAG1,'united states');
// Displayes value on top of marker image
$p2->value->SetFormat('%d mil');
$p2->value->Show();
$p2->value->SetColor('darkred');
$p2->value->SetFont(FF_ARIAL,FS_BOLD,10);
// Increase the margin so that the value is printed avove tje
// img marker
$p2->value->SetMargin(14);
// Incent the X-scale so the first and last point doesn't
// fall on the edges
$p2->SetCenter();
$graph->Add($p2);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/nullvalueex01.html b/html/includes/jpgraph/docs/html/exframes/nullvalueex01.html
new file mode 100644
index 0000000000..314069f8f9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/nullvalueex01.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
// Some data
$datax = array("2001-04-01","2001-04-02","2001-04-03","2001-04-04","2001-04-05","2001-04-06");
$datay = array(28,13,24,"",90,11);
$data2y = array(11,41,"-",33,"-",63);
// Setup graph
$graph = new Graph(400,250,"auto");
$graph->img->SetMargin(40,150,40,80);
$graph->SetScale("textlin");
$graph->SetShadow();
//Setup title
$graph->title->Set("Line plot with null values");
// Use built in font
$graph->title->SetFont(FF_COMIC,FS_NORMAL,14);
// Slightly adjust the legend from it's default position
$graph->legend->Pos(0.03,0.5,"right","center");
$graph->legend->SetFont(FF_FONT1,FS_BOLD);
// Setup X-scale
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
$graph->xaxis->SetLabelAngle(45);
// Create the first line
$p1 = new LinePlot($datay);
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend("Undefined\nvariant 1");
$graph->Add($p1);
// ... and the second
$p2 = new LinePlot($data2y);
$p2->mark->SetType(MARK_STAR);
$p2->mark->SetFillColor("red");
$p2->mark->SetWidth(4);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend("Undefined\nvariant 2");
$graph->Add($p2);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/partiallyfilledlineex1.html b/html/includes/jpgraph/docs/html/exframes/partiallyfilledlineex1.html
new file mode 100644
index 0000000000..9e96b28411
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/partiallyfilledlineex1.html
@@ -0,0 +1,4 @@
+
+<?php
include("../jpgraph.php");
include("../jpgraph_line.php");
// Some data
$ydata = array(5,10,15,20,15,10,8,7,4,10,5);
// Create the graph
$graph= new Graph(400,300,"auto");
$graph->SetScale("textlin");
$graph->SetShadow(true);
$graph->SetMarginColor("lightblue");
// Setup format for legend
$graph->legend->SetFillColor("antiquewhite");
$graph->legend->SetShadow(true);
// Setup title
$graph->title->Set("Filled Area Example");
$graph->title->SetFont(FF_FONT2,FS_BOLD);
// Setup semi-filled line plot
$lineplot = new LinePlot($ydata);
$lineplot->SetLegend("Semi-filled\nLineplot");
// Set line color
$lineplot->SetColor("black");
// Setup the two areas to be filled
$lineplot->AddArea(2,5,LP_AREA_FILLED,"red");
$lineplot->AddArea(6,8,LP_AREA_FILLED,"green");
// Display the marks on the lines
$lineplot->mark->SetType(MARK_DIAMOND);
$lineplot->mark->SetSize(8);
$lineplot->mark->Show();
// add plot to the graph
$graph->Add($lineplot);
// display graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/penguin.html b/html/includes/jpgraph/docs/html/exframes/penguin.html
new file mode 100644
index 0000000000..9af41a39ad
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/penguin.html
@@ -0,0 +1,4 @@
+
+<?php
include_once ("../jpgraph.php");
include_once ("../jpgraph_pie.php");
include_once ("../jpgraph_pie3d.php");
//$gJpgBrandTiming=true;
// Some data
$data = array(40,21,17,27,23);
// Create the Pie Graph.
$graph = new PieGraph(400,200,'auto');
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("3D Pie Client side image map");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p1 = new PiePlot3D($data);
$p1->SetLegends(array("Jan (%d)","Feb","Mar","Apr","May","Jun","Jul"));
$targ=array("pie3d_csimex1.php?v=1","pie3d_csimex1.php?v=2","pie3d_csimex1.php?v=3",
"pie3d_csimex1.php?v=4","pie3d_csimex1.php?v=5","pie3d_csimex1.php?v=6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$p1->SetCSIMTargets($targ,$alts);
// Use absolute labels
$p1->SetLabelType(1);
$p1->value->SetFormat("%d kr");
// Move the pie slightly to the left
$p1->SetCenter(0.4,0.5);
$graph->Add($p1);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('pie3d_csimex1.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pie_csimex1.html b/html/includes/jpgraph/docs/html/exframes/pie_csimex1.html
new file mode 100644
index 0000000000..8b0a2e8ddc
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pie_csimex1.html
@@ -0,0 +1,3 @@
+
+<?php
include_once ("../jpgraph.php");
include_once ("../jpgraph_pie.php");
// Some data
$data = array(40,21,17,14,23);
// Create the Pie Graph.
$graph = new PieGraph(300,200,'auto');
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Client side image map");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p1 = new PiePlot($data);
$p1->SetCenter(0.4,0.5);
$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul"));
$targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3",
"pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$p1->SetCSIMTargets($targ,$alts);
$graph->Add($p1);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('pie_csimex1.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/piec_csimex1.html b/html/includes/jpgraph/docs/html/exframes/piec_csimex1.html
new file mode 100644
index 0000000000..a270935bcd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/piec_csimex1.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: piec_csimex1.php,v 1.1.2.1 2003/10/09 21:05:39 aditus Exp $
// Example of pie with center circle
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
// Some data
$data = array(50,28,25,27,31,20);
// A new pie graph
$graph = new PieGraph(400,400);
// If you don't want any border just uncomment this line
// $graph->SetFrame(false);
// Uncomment this line to add a drop shadow to the border
// $graph->SetShadow();
// Setup title
$graph->title->Set("CSIM Center Pie plot ex 1");
$graph->title->SetFont(FF_COMIC,FS_BOLD,18);
$graph->title->SetMargin(8); // Add a little bit more margin from the top
// Create the pie plot
$p1 = new PiePlotC($data);
// Set the radius of pie (as fraction of image size)
$p1->SetSize(0.32);
// Move the center of the pie slightly to the top of the image
$p1->SetCenter(0.5,0.45);
// Label font and color setup
$p1->value->SetFont(FF_ARIAL,FS_BOLD,12);
$p1->value->SetColor('white');
// Setup the title on the center circle
$p1->midtitle->Set("Test mid\nRow 1\nRow 2");
$p1->midtitle->SetFont(FF_ARIAL,FS_NORMAL,14);
// Set color for mid circle
$p1->SetMidColor('yellow');
// Use percentage values in the legends values (This is also the default)
$p1->SetLabelType(PIE_VALUE_PER);
// The label array values may have printf() formatting in them. The argument to the
// form,at string will be the value of the slice (either the percetage or absolute
// depending on what was specified in the SetLabelType() above.
$lbl = array("adam\n%.1f%%","bertil\n%.1f%%","johan\n%.1f%%",
"peter\n%.1f%%","daniel\n%.1f%%","erik\n%.1f%%");
$p1->SetLabels($lbl);
// Uncomment this line to remove the borders around the slices
// $p1->ShowBorder(false);
// Add drop shadow to slices
$p1->SetShadow();
// Explode all slices 15 pixels
$p1->ExplodeAll(15);
// Setup the CSIM targets
$targ=array("piec_csimex1.php#1","piec_csimex1.php#2","piec_csimex1.php#3",
"piec_csimex1.php#4","piec_csimex1.php#5","piec_csimex1.php#6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$p1->SetCSIMTargets($targ,$alts);
$p1->SetMidCSIM("piec_csimex1.php#7","Center");
// Setup a small help text in the image
$txt = new Text("Note: This is an example of image map. Hold\nyour mouse over the slices to see the values.\nThe URL just points back to this page");
$txt->SetFont(FF_FONT1,FS_BOLD);
$txt->Pos(0.5,0.97,'center','bottom');
$txt->SetBox('yellow','black');
$txt->SetShadow();
$graph->AddText($txt);
// Add plot to pie graph
$graph->Add($p1);
// .. and send the image on it's marry way to the browser
$graph->StrokeCSIM('piec_csimex1.php');
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/piecex1.html b/html/includes/jpgraph/docs/html/exframes/piecex1.html
new file mode 100644
index 0000000000..4a3da724a2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/piecex1.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id
// Example of pie with center circle
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
// Some data
$data = array(50,28,25,27,31,20);
// A new pie graph
$graph = new PieGraph(300,300,'auto');
// Setup title
$graph->title->Set("Pie plot with center circle");
$graph->title->SetFont(FF_COMIC,FS_BOLD,14);
$graph->title->SetMargin(8); // Add a little bit more margin from the top
// Create the pie plot
$p1 = new PiePlotC($data);
// Set size of pie
$p1->SetSize(0.32);
// Label font and color setup
$p1->value->SetFont(FF_ARIAL,FS_BOLD,10);
$p1->value->SetColor('black');
// Setup the title on the center circle
$p1->midtitle->Set("Test mid\nRow 1\nRow 2");
$p1->midtitle->SetFont(FF_COMIC,FS_NORMAL,10);
// Set color for mid circle
$p1->SetMidColor('yellow');
// Use percentage values in the legends values (This is also the default)
$p1->SetLabelType(PIE_VALUE_PER);
// Add plot to pie graph
$graph->Add($p1);
// .. and send the image on it's marry way to the browser
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/piecex2.html b/html/includes/jpgraph/docs/html/exframes/piecex2.html
new file mode 100644
index 0000000000..a1cd605263
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/piecex2.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: piecex2.php,v 1.3.2.1 2003/08/19 20:40:12 aditus Exp $
// Example of pie with center circle
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
// Some data
$data = array(50,28,25,27,31,20);
// A new pie graph
$graph = new PieGraph(400,400,'auto');
// Don't display the border
$graph->SetFrame(false);
// Uncomment this line to add a drop shadow to the border
// $graph->SetShadow();
// Setup title
$graph->title->Set("PiePlotC");
$graph->title->SetFont(FF_COMIC,FS_BOLD,18);
$graph->title->SetMargin(8); // Add a little bit more margin from the top
// Create the pie plot
$p1 = new PiePlotC($data);
// Set size of pie
$p1->SetSize(0.35);
// Label font and color setup
$p1->value->SetFont(FF_ARIAL,FS_BOLD,12);
$p1->value->SetColor('white');
$p1->value->Show();
// Setup the title on the center circle
$p1->midtitle->Set("Test mid\nRow 1\nRow 2");
$p1->midtitle->SetFont(FF_COMIC,FS_NORMAL,14);
// Set color for mid circle
$p1->SetMidColor('yellow');
// Use percentage values in the legends values (This is also the default)
$p1->SetLabelType(PIE_VALUE_PER);
// The label array values may have printf() formatting in them. The argument to the
// form,at string will be the value of the slice (either the percetage or absolute
// depending on what was specified in the SetLabelType() above.
$lbl = array("adam\n%.1f%%","bertil\n%.1f%%","johan\n%.1f%%",
"peter\n%.1f%%","daniel\n%.1f%%","erik\n%.1f%%");
$p1->SetLabels($lbl);
// Uncomment this line to remove the borders around the slices
// $p1->ShowBorder(false);
// Add drop shadow to slices
$p1->SetShadow();
// Explode all slices 15 pixels
$p1->ExplodeAll(15);
// Add plot to pie graph
$graph->Add($p1);
// .. and send the image on it's marry way to the browser
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pieex3.html b/html/includes/jpgraph/docs/html/exframes/pieex3.html
new file mode 100644
index 0000000000..044ebcd98c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pieex3.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
// Some data
$data = array(40,21,17,14,23);
// Create the Pie Graph.
$graph = new PieGraph(350,300,"auto");
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Multiple - Pie plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create plots
$size=0.13;
$p1 = new PiePlot($data);
$p1->SetLegends(array("Jan","Feb","Mar","Apr","May"));
$p1->SetSize($size);
$p1->SetCenter(0.25,0.32);
$p1->value->SetFont(FF_FONT0);
$p1->title->Set("2001");
$p2 = new PiePlot($data);
$p2->SetSize($size);
$p2->SetCenter(0.65,0.32);
$p2->value->SetFont(FF_FONT0);
$p2->title->Set("2002");
$p3 = new PiePlot($data);
$p3->SetSize($size);
$p3->SetCenter(0.25,0.75);
$p3->value->SetFont(FF_FONT0);
$p3->title->Set("2003");
$p4 = new PiePlot($data);
$p4->SetSize($size);
$p4->SetCenter(0.65,0.75);
$p4->value->SetFont(FF_FONT0);
$p4->title->Set("2004");
$graph->Add($p1);
$graph->Add($p2);
$graph->Add($p3);
$graph->Add($p4);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pieex8.html b/html/includes/jpgraph/docs/html/exframes/pieex8.html
new file mode 100644
index 0000000000..5580a0bb29
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pieex8.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,31,35);
// A new pie graph
$graph = new PieGraph(250,200,"auto");
$graph->SetShadow();
// Title setup
$graph->title->Set("Adjusting the label pos");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Setup the pie plot
$p1 = new PiePlot($data);
// Adjust size and position of plot
$p1->SetSize(0.4);
$p1->SetCenter(0.5,0.52);
// Setup slice labels and move them into the plot
$p1->value->SetFont(FF_FONT1,FS_BOLD);
$p1->value->SetColor("darkred");
$p1->SetLabelPos(0.6);
// Finally add the plot
$graph->Add($p1);
// ... and stroke it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pieex9.html b/html/includes/jpgraph/docs/html/exframes/pieex9.html
new file mode 100644
index 0000000000..74ad19c443
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pieex9.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(40,60,31,35);
// A new pie graph
$graph = new PieGraph(250,200,"auto");
$graph->SetShadow();
// Title setup
$graph->title->Set("Exploding all slices");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Setup the pie plot
$p1 = new PiePlot($data);
// Adjust size and position of plot
$p1->SetSize(0.35);
$p1->SetCenter(0.5,0.52);
// Setup slice labels and move them into the plot
$p1->value->SetFont(FF_FONT1,FS_BOLD);
$p1->value->SetColor("darkred");
$p1->SetLabelPos(0.65);
// Explode all slices
$p1->ExplodeAll(10);
// Add drop shadow
$p1->SetShadow();
// Finally add the plot
$graph->Add($p1);
// ... and stroke it
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pielabelsex1.html b/html/includes/jpgraph/docs/html/exframes/pielabelsex1.html
new file mode 100644
index 0000000000..42ac0cac88
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pielabelsex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(19,12,4,3,3,12,3,3,5,6,7,8,8,1,7,2,2,4,6,8,21,23,2,2,12);
// Create the Pie Graph.
$graph = new PieGraph(300,350);
// Set A title for the plot
$graph->title->Set("Label guide lines");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1,0.2);
// Create pie plot
$p1 = new PiePlot($data);
$p1->SetCenter(0.5,0.55);
$p1->SetSize(0.3);
// Enable and set policy for guide-lines
$p1->SetGuideLines();
$p1->SetGuideLinesAdjust(1.4);
// Setup the labels
$p1->SetLabelType(PIE_VALUE_PER);
$p1->value->Show();
$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$p1->value->SetFormat('%2.1f%%');
// Add and stroke
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pielabelsex2.html b/html/includes/jpgraph/docs/html/exframes/pielabelsex2.html
new file mode 100644
index 0000000000..f1a5f82daf
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pielabelsex2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(19,12,4,3,3,12,3,3,5,6,7,8,8,1,7,2,2,4,6,8,21,23,2,2,12);
// Create the Pie Graph.
$graph = new PieGraph(300,350);
// Set A title for the plot
$graph->title->Set("Label guide lines");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1,0.2);
// Create pie plot
$p1 = new PiePlot($data);
$p1->SetCenter(0.5,0.55);
$p1->SetSize(0.3);
// Enable and set policy for guide-lines. Make labels line up vertically
$p1->SetGuideLines(true,false);
$p1->SetGuideLinesAdjust(1.5);
// Setup the labels
$p1->SetLabelType(PIE_VALUE_PER);
$p1->value->Show();
$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$p1->value->SetFormat('%2.1f%%');
// Add and stroke
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/pielabelsex4.html b/html/includes/jpgraph/docs/html/exframes/pielabelsex4.html
new file mode 100644
index 0000000000..849e21637f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/pielabelsex4.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
$data = array(19,12,4,3,3,12,3,3,5,6,7,8,8,1,7,2,2,4,6,8,21,23,2,2,12);
// Create the Pie Graph.
$graph = new PieGraph(300,350);
// Set A title for the plot
$graph->title->Set("Label guide lines");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1,0.2);
// Create pie plot
$p1 = new PiePlot($data);
$p1->SetCenter(0.5,0.55);
$p1->SetSize(0.3);
// Enable and set policy for guide-lines. Make labels line up vertically
$p1->SetGuideLines(true,false);
$p1->SetGuideLinesAdjust(1.1);
// Setup the labels
$p1->SetLabelType(PIE_VALUE_PER);
$p1->value->Show();
$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$p1->value->SetFormat('%2.1f%%');
// Add and stroke
$graph->Add($p1);
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex0-180.html b/html/includes/jpgraph/docs/html/exframes/polarex0-180.html
new file mode 100644
index 0000000000..346819f281
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex0-180.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph, example 0
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,
85,270,90,280,
95,270,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(250,250);
$graph->SetScale('lin');
$graph->SetMargin(35,35,25,25);
$graph->SetType(POLAR_180);
$p = new PolarPlot($data);
$p->SetFillColor('lightblue@0.5');
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex0.html b/html/includes/jpgraph/docs/html/exframes/polarex0.html
new file mode 100644
index 0000000000..708956e72f
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex0.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph, example 0
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,
85,270,90,280,
95,270,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(250,250);
$graph->SetScale('lin');
$graph->SetMargin(35,35,25,25);
$p = new PolarPlot($data);
$p->SetFillColor('lightblue@0.5');
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex3-lin.html b/html/includes/jpgraph/docs/html/exframes/polarex3-lin.html
new file mode 100644
index 0000000000..160ade6cb7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex3-lin.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph, example 2
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,
85,270,90,280,
95,270,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(300,300);
$graph->SetScale('lin',200);
$graph->SetType(POLAR_180);
$graph->title->Set('Polar plot #3');
$graph->title->SetFont(FF_FONT2,FS_BOLD);
$graph->title->SetColor('navy');
$graph->axis->ShowGrid(true,false);
$p = new PolarPlot($data);
$p->SetFillColor('lightred@0.5');
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex3.html b/html/includes/jpgraph/docs/html/exframes/polarex3.html
new file mode 100644
index 0000000000..9965d49155
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex3.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph, example 2
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,
85,270,90,280,
95,270,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(300,300);
$graph->SetScale('log',100);
$graph->SetType(POLAR_180);
$graph->title->Set('Polar plot #3');
$graph->title->SetFont(FF_FONT2,FS_BOLD);
$graph->title->SetColor('navy');
$graph->axis->ShowGrid(true,false);
$p = new PolarPlot($data);
$p->SetFillColor('lightred@0.5');
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex4.html b/html/includes/jpgraph/docs/html/exframes/polarex4.html
new file mode 100644
index 0000000000..563bb0953a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex4.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph, example 2
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,
85,270,90,280,
95,270,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(300,350);
$graph->SetScale('log');
$graph->title->Set('Polar plot #4');
$graph->title->SetFont(FF_FONT2,FS_BOLD);
$graph->title->SetColor('navy');
// Hide last labels on the Radius axis
// They intersect with the box otherwise
$graph->axis->HideLastTickLabel();
$p = new PolarPlot($data);
$p->SetFillColor('lightred@0.5');
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex5.html b/html/includes/jpgraph/docs/html/exframes/polarex5.html
new file mode 100644
index 0000000000..5a95b260fd
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex5.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph, example 2
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,
85,270,90,280,
95,270,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(300,350);
$graph->SetScale('log');
// Show both major and minor grid lines
$graph->axis->ShowGrid(true,true);
$graph->title->Set('Polar plot #5');
$graph->title->SetFont(FF_FONT2,FS_BOLD);
$graph->title->SetColor('navy');
// Hide last labels on the Radius axis
// They intersect with the box otherwise
$graph->axis->HideLastTickLabel();
$p = new PolarPlot($data);
$p->SetFillColor('lightred@0.5');
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex7-2.html b/html/includes/jpgraph/docs/html/exframes/polarex7-2.html
new file mode 100644
index 0000000000..9abc98c389
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex7-2.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph,
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,30,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,85,370,
90,480,
95,370,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,150,2,180,1);
$n = count($data);
for($i=0; $i < $n; $i+=2 ) {
$data[$n+$i] = 360-$data[$i];
$data[$n+$i+1] = $data[$i+1];
}
$graph = new PolarGraph(300,400);
$graph->SetScale('log',100);
$graph->SetType(POLAR_360);
$graph->SetPlotSize(220,300);
// Hide frame around graph (by setting width=0)
$graph->SetFrame(true,'white',1);
$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_MIDHOR,BGRAD_PLOT);
// Set color for gradient lines
$graph->axis->SetGridColor('gray','gray','gray');
$graph->title->Set('Polar plot #7-2');
$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
$graph->title->SetColor('navy');
// Adjust legen box position and color
$graph->legend->SetColor('navy','darkgray');
$graph->legend->SetFillColor('white');
$graph->legend->SetShadow('darkgray@0.5',5);
$p = new PolarPlot($data);
$p->SetFillColor('yellow@0.6');
$p->mark->SetType(MARK_SQUARE);
$p->SetLegend("Mirophone #1\n(No amps)");
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/polarex9.html b/html/includes/jpgraph/docs/html/exframes/polarex9.html
new file mode 100644
index 0000000000..c52b1af3e9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/polarex9.html
@@ -0,0 +1,4 @@
+
+<?php
// A simple Polar graph,
include "../jpgraph.php";
include "../jpgraph_polar.php";
$data = array(0,1,10,2,30,25,40,60,
50,110,60,160,70,210,75,230,80,260,85,370,
90,480,
95,370,100,260,105,230,
110,210,120,160,130,110,140,60,
150,25,170,2,180,1);
$graph = new PolarGraph(350,320);
$graph->SetScale('log',100);
$graph->SetType(POLAR_180);
// Hide frame around graph (by setting width=0)
$graph->SetFrame(true,'white',1);
// Show both major and minor grid lines
$graph->axis->ShowGrid(true,true);
// Set color for gradient lines
$graph->axis->SetGridColor('lightblue:0.9','lightblue:0.9','lightblue:0.9');
// Set label and axis colors
$graph->axis->SetColor('black','navy','darkred');
// Draw the ticks on the bottom side of the radius axis
$graph->axis->SetTickSide(SIDE_DOWN);
// Increase the margin for the labels since we changed the
// side of the ticks.
$graph->axis->SetLabelMargin(6);
// Change fonts
$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8);
$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8);
// Setup axis title
$graph->axis->SetTitle('Coverage (in meter)','middle');
$graph->axis->title->SetFont(FF_FONT1,FS_BOLD);
// Setup graph title
$graph->title->Set('Polar plot #9');
$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
$graph->title->SetColor('navy');
// Setup tab title
$graph->tabtitle->Set('Microphone #1');
$graph->tabtitle->SetColor('brown:0.5','lightyellow');
$p = new PolarPlot($data);
$p->SetFillColor('lightblue@0.5');
$p->mark->SetType(MARK_SQUARE);
$graph->Add($p);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex1.html b/html/includes/jpgraph/docs/html/exframes/radarex1.html
new file mode 100644
index 0000000000..89fe24e53d
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Some data to plot
$data = array(55,80,46,71,95);
// Create the graph and the plot
$graph = new RadarGraph(250,200,"auto");
$plot = new RadarPlot($data);
// Add the plot and display the graph
$graph->Add($plot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex2.html b/html/includes/jpgraph/docs/html/exframes/radarex2.html
new file mode 100644
index 0000000000..edd100936b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Some data to plot
$data = array(55,80,46,71,95);
// Create the graph and the plot
$graph = new RadarGraph(300,200,"auto");
$graph->title->Set('Weekly goals');
$graph->subtitle->Set('Year 2003');
$plot = new RadarPlot($data);
$plot->SetFillColor('lightred');
$graph->SetSize(0.6);
$graph->SetPos(0.5,0.6);
// Add the plot and display the graph
$graph->Add($plot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex4.html b/html/includes/jpgraph/docs/html/exframes/radarex4.html
new file mode 100644
index 0000000000..ae150cb6b3
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex4.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Some data to plot
$data = array(55,80,26,31,95);
// Create the graph and the plot
$graph = new RadarGraph(250,200,"auto");
// Create the titles for the axis
$titles = $gDateLocale->GetShortMonth();
$graph->SetTitles($titles);
// Add grid lines
$graph->grid->Show();
$graph->grid->SetLineStyle('dotted');
$plot = new RadarPlot($data);
$plot->SetFillColor('lightblue');
// Add the plot and display the graph
$graph->Add($plot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex6.1.html b/html/includes/jpgraph/docs/html/exframes/radarex6.1.html
new file mode 100644
index 0000000000..b83e9f29e5
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex6.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Some data to plot
$data = array(55,80,26,31,95);
$data2 = array(15,50,46,39,25);
// Create the graph and the plot
$graph = new RadarGraph(250,200,"auto");
// Add a drop shadow to the graph
$graph->SetShadow();
// Create the titles for the axis
$titles = $gDateLocale->GetShortMonth();
$graph->SetTitles($titles);
$graph->SetColor('lightyellow');
// ADjust the position to make more room
// for the legend
$graph->SetCenter(0.4,0.55);
$graph->SetSize(0.6);
// Add grid lines
$graph->grid->Show();
$graph->grid->SetColor('darkred');
$graph->grid->SetLineStyle('dotted');
$plot = new RadarPlot($data);
$plot->SetFillColor('lightblue');
$plot->SetLegend("QA results");
$plot2 = new RadarPlot($data2);
$plot2->SetLegend("Target");
$plot2->SetColor('red');
$plot2->SetFill(false);
$plot2->SetLineWeight(2);
// Add the plot and display the graph
$graph->Add($plot);
$graph->Add($plot2);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex6.html b/html/includes/jpgraph/docs/html/exframes/radarex6.html
new file mode 100644
index 0000000000..900b20a5a9
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex6.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Some data to plot
$data = array(55,80,26,31,95);
// Create the graph and the plot
$graph = new RadarGraph(250,200,"auto");
// Add a drop shadow to the graph
$graph->SetShadow();
// Create the titles for the axis
$titles = $gDateLocale->GetShortMonth();
$graph->SetTitles($titles);
$graph->SetColor('lightyellow');
// ADjust the position to make more room
// for the legend
$graph->SetCenter(0.4,0.5);
// Add grid lines
$graph->grid->Show();
$graph->grid->SetColor('darkred');
$graph->grid->SetLineStyle('dotted');
$plot = new RadarPlot($data);
$plot->SetFillColor('lightblue');
$plot->SetLegend("QA results");
// Add the plot and display the graph
$graph->Add($plot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex7.html b/html/includes/jpgraph/docs/html/exframes/radarex7.html
new file mode 100644
index 0000000000..f7adfab836
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex7.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Create the basic rtadar graph
$graph = new RadarGraph(300,200,"auto");
// Set background color and shadow
$graph->SetColor("white");
$graph->SetShadow();
// Position the graph
$graph->SetCenter(0.4,0.55);
// Setup the axis formatting
$graph->axis->SetFont(FF_FONT1,FS_BOLD);
$graph->axis->SetWeight(2);
// Setup the grid lines
$graph->grid->SetLineStyle("longdashed");
$graph->grid->SetColor("navy");
$graph->grid->Show();
$graph->HideTickMarks();
// Setup graph titles
$graph->title->Set("Quality result");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetTitles(array("One","Two","Three","Four","Five","Sex","Seven","Eight","Nine","Ten"));
// Create the first radar plot
$plot = new RadarPlot(array(30,80,60,40,71,81,47));
$plot->SetLegend("Goal");
$plot->SetColor("red","lightred");
$plot->SetFill(false);
$plot->SetLineWeight(2);
// Create the second radar plot
$plot2 = new RadarPlot(array(70,40,30,80,31,51,14));
$plot2->SetLegend("Actual");
$plot2->SetColor("blue","lightred");
// Add the plots to the graph
$graph->Add($plot2);
$graph->Add($plot);
// And output the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex8.1.html b/html/includes/jpgraph/docs/html/exframes/radarex8.1.html
new file mode 100644
index 0000000000..42c4bddba2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex8.1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Create the basic radar graph
$graph = new RadarGraph(300,200,"auto");
$graph->img->SetAntiAliasing();
// Set background color and shadow
$graph->SetColor("white");
$graph->SetShadow();
// Position the graph
$graph->SetCenter(0.4,0.55);
// Setup the axis formatting
$graph->axis->SetFont(FF_FONT1,FS_BOLD);
// Setup the grid lines
$graph->grid->SetLineStyle("solid");
$graph->grid->SetColor("navy");
$graph->grid->Show();
$graph->HideTickMarks();
// Setup graph titles
$graph->title->Set("Quality result");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetTitles($gDateLocale->GetShortMonth());
// Create the first radar plot
$plot = new RadarPlot(array(70,80,60,90,71,81,47));
$plot->SetLegend("Goal");
$plot->SetColor("red","lightred");
$plot->SetFill(false);
$plot->SetLineWeight(2);
// Create the second radar plot
$plot2 = new RadarPlot(array(70,40,30,80,31,51,14));
$plot2->SetLegend("Actual");
$plot2->SetLineWeight(2);
$plot2->SetColor("blue");
$plot2->SetFill(false);
// Add the plots to the graph
$graph->Add($plot2);
$graph->Add($plot);
// And output the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarex8.html b/html/includes/jpgraph/docs/html/exframes/radarex8.html
new file mode 100644
index 0000000000..daf7edce38
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarex8.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Create the basic radar graph
$graph = new RadarGraph(300,200,"auto");
//$graph->img->SetAntiAliasing();
// Set background color and shadow
$graph->SetColor("white");
$graph->SetShadow();
// Position the graph
$graph->SetCenter(0.4,0.55);
// Setup the axis formatting
$graph->axis->SetFont(FF_FONT1,FS_BOLD);
// Setup the grid lines
$graph->grid->SetLineStyle("solid");
$graph->grid->SetColor("navy");
$graph->grid->Show();
$graph->HideTickMarks();
// Setup graph titles
$graph->title->Set("Quality result");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetTitles($gDateLocale->GetShortMonth());
// Create the first radar plot
$plot = new RadarPlot(array(70,80,60,90,71,81,47));
$plot->SetLegend("Goal");
$plot->SetColor("red","lightred");
$plot->SetFill(false);
$plot->SetLineWeight(2);
// Create the second radar plot
$plot2 = new RadarPlot(array(70,40,30,80,31,51,14));
$plot2->SetLegend("Actual");
$plot2->SetLineWeight(2);
$plot2->SetColor("blue");
$plot2->SetFill(false);
// Add the plots to the graph
$graph->Add($plot2);
$graph->Add($plot);
// And output the graph
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/radarmarkex1.html b/html/includes/jpgraph/docs/html/exframes/radarmarkex1.html
new file mode 100644
index 0000000000..1870fed573
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/radarmarkex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
$titles=array('Planning','Quality','Time','RR','CR','DR');
$data=array(18, 40, 70, 90, 42,66);
$graph = new RadarGraph (300,280,"auto");
$graph->title->Set("Radar with marks");
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12);
$graph->SetTitles($titles);
$graph->SetCenter(0.5,0.55);
$graph->HideTickMarks();
$graph->SetColor('lightgreen@0.7');
$graph->axis->SetColor('darkgray');
$graph->grid->SetColor('darkgray');
$graph->grid->Show();
$graph->axis->title->SetFont(FF_ARIAL,FS_NORMAL,12);
$graph->axis->title->SetMargin(5);
$graph->SetGridDepth(DEPTH_BACK);
$graph->SetSize(0.6);
$plot = new RadarPlot($data);
$plot->SetColor('red@0.2');
$plot->SetLineWeight(1);
$plot->SetFillColor('red@0.7');
$plot->mark->SetType(MARK_IMG_SBALL,'red');
$graph->Add($plot);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/rotex0.html b/html/includes/jpgraph/docs/html/exframes/rotex0.html
new file mode 100644
index 0000000000..646ddb156c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/rotex0.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(270,170);
$graph->SetMargin(30,90,30,30);
$graph->SetScale("textlin");
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/rotex1.html b/html/includes/jpgraph/docs/html/exframes/rotex1.html
new file mode 100644
index 0000000000..f07a5c4a02
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/rotex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(270,170);
$graph->SetMargin(30,90,30,30);
$graph->SetScale("textlin");
$graph->img->SetAngle(45);
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/rotex2.html b/html/includes/jpgraph/docs/html/exframes/rotex2.html
new file mode 100644
index 0000000000..1d2c75375c
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/rotex2.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(270,170);
$graph->SetMargin(30,90,30,30);
$graph->SetScale("textlin");
$graph->img->SetAngle(90);
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/rotex3.html b/html/includes/jpgraph/docs/html/exframes/rotex3.html
new file mode 100644
index 0000000000..ba0e9388ed
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/rotex3.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(270,170);
$graph->SetMargin(30,90,30,30);
$graph->SetScale("textlin");
$graph->img->SetAngle(45);
$graph->img->SetCenter(floor(270/2),floor(170/2));
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/rotex4.html b/html/includes/jpgraph/docs/html/exframes/rotex4.html
new file mode 100644
index 0000000000..98b11d2314
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/rotex4.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(270,170);
$graph->SetMargin(30,90,30,30);
$graph->SetScale("textlin");
$graph->img->SetAngle(90);
$graph->img->SetCenter(floor(270/2),floor(170/2));
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/rotex5.html b/html/includes/jpgraph/docs/html/exframes/rotex5.html
new file mode 100644
index 0000000000..e5cd0ebaed
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/rotex5.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$ydata = array(12,17,22,19,5,15);
$graph = new Graph(270,170);
$graph->SetMargin(30,90,30,30);
$graph->SetScale("textlin");
$graph->img->SetAngle(-30);
$graph->img->SetCenter(30,170-30);
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/scatter_csimex1.html b/html/includes/jpgraph/docs/html/exframes/scatter_csimex1.html
new file mode 100644
index 0000000000..05404d2981
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/scatter_csimex1.html
@@ -0,0 +1,4 @@
+
+<?php
include_once ("../jpgraph.php");
include_once ("../jpgraph_scatter.php");
// Some data for the points
$datax = array(3.5,13.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7);
$datay = array(10,22,12,13,17,20,16,19,30,31,40,43);
// A new scatter graph
$graph = new Graph(300,200,'auto');
$graph->SetShadow();
$graph->SetScale("linlin");
//$graph->img->SetMargin(40,40,40,40);
$graph->title->Set("Scatter plot with Image Map");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Client side image map targets
$targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3",
"pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6",
"pie_csimex1.php#7","pie_csimex1.php#8","pie_csimex1.php#9" );
// Strings to put as "alts" (and "title" value)
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
// Create a new scatter plot
$sp1 = new ScatterPlot($datay,$datax);
// Use diamonds as markerss
$sp1->mark->SetType(MARK_DIAMOND);
$sp1->mark->SetWidth(10);
// Set the scatter plot image map targets
$sp1->SetCSIMTargets($targ,$alts);
// Add the plot
$graph->Add($sp1);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('scatter_csimex1.php');
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/scatterex1.html b/html/includes/jpgraph/docs/html/exframes/scatterex1.html
new file mode 100644
index 0000000000..7127694d4a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/scatterex1.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
$datax = array(3.5,3.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7);
$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);
$graph = new Graph(300,200,"auto");
$graph->SetScale("linlin");
$graph->img->SetMargin(40,40,40,40);
$graph->SetShadow();
$graph->title->Set("A simple scatter plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$sp1 = new ScatterPlot($datay,$datax);
$graph->Add($sp1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/scatterex2.html b/html/includes/jpgraph/docs/html/exframes/scatterex2.html
new file mode 100644
index 0000000000..aa3054259b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/scatterex2.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");
$datax = array(3.5,3.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7);
$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);
$graph = new Graph(300,200,"auto");
$graph->SetScale("linlin");
$graph->img->SetMargin(40,40,40,40);
$graph->SetShadow();
$graph->title->Set("A simple scatter plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$sp1 = new ScatterPlot($datay,$datax);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(8);
$graph->Add($sp1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex1.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex1.html
new file mode 100644
index 0000000000..de03393dce
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex1.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex1.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_RDIAG,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_RDIAG');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex10.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex10.html
new file mode 100644
index 0000000000..d7efb2f640
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex10.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex10.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_DIAGCROSS,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_DIAGCROSS');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex2.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex2.html
new file mode 100644
index 0000000000..569742fa3a
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex2.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex2.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_LDIAG,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_LDIAG');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex3.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex3.html
new file mode 100644
index 0000000000..ab90b86d60
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex3.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex3.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_SOLID,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_SOLID');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex4.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex4.html
new file mode 100644
index 0000000000..a0a1bdca68
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex4.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex4.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4');
$band->SetDensity(60);
$band->ShowFrame(true);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_3DPLANE, Density=60');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex5.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex5.html
new file mode 100644
index 0000000000..7cd7cc0098
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex5.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex5.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_HVCROSS,15,35,'khaki4');
$band->ShowFrame(true);
$band->SetOrder(DEPTH_FRONT);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_HVCROSS, In front');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex6.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex6.html
new file mode 100644
index 0000000000..9d73ef3908
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex6.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex6.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_VLINE,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_VLINE');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex7.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex7.html
new file mode 100644
index 0000000000..f07a0c11b2
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex7.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex7.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_HLINE,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_HLINE');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex8.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex8.html
new file mode 100644
index 0000000000..3d73197d39
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex8.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex8.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_3DPLANE');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex9.html b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex9.html
new file mode 100644
index 0000000000..5272812a03
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/smallstaticbandsex9.html
@@ -0,0 +1,4 @@
+
+<?php
// Illustration of the different patterns for bands
// $Id: smallstaticbandsex9.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(10,29,3,6);
// Create the graph.
$graph = new Graph(200,150,"auto");
$graph->SetScale("textlin");
$graph->SetMargin(25,10,20,20);
// Add 10% grace ("space") at top and botton of Y-scale.
$graph->yscale->SetGrace(10);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("lightblue");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
$graph->ygrid->Show(false);
// .. and add the plot to the graph
$graph->Add($bplot);
// Add band
$band = new PlotBand(HORIZONTAL,BAND_HVCROSS,15,35,'khaki4');
$band->ShowFrame(false);
$graph->AddBand($band);
// Set title
$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
$graph->title->SetColor('darkred');
$graph->title->Set('BAND_HVCROSS');
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/splineex1.html b/html/includes/jpgraph/docs/html/exframes/splineex1.html
new file mode 100644
index 0000000000..cc30324f15
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/splineex1.html
@@ -0,0 +1,3 @@
+
+<?php
include "../jpgraph.php";
include "../jpgraph_line.php";
include "../jpgraph_scatter.php";
include "../jpgraph_regstat.php";
// Original data points
$xdata = array(1,3,5,7,9,12,15,17.1);
$ydata = array(5,1,9,6,4,3,19,12);
// Get the interpolated values by creating
// a new Spline object.
$spline = new Spline($xdata,$ydata);
// For the new data set we want 40 points to
// get a smooth curve.
list($newx,$newy) = $spline->Get(50);
// Create the graph
$g = new Graph(300,200);
$g->SetMargin(30,20,40,30);
$g->title->Set("Natural cubic splines");
$g->title->SetFont(FF_ARIAL,FS_NORMAL,12);
$g->subtitle->Set('(Control points shown in red)');
$g->subtitle->SetColor('darkred');
$g->SetMarginColor('lightblue');
//$g->img->SetAntiAliasing();
// We need a linlin scale since we provide both
// x and y coordinates for the data points.
$g->SetScale('linlin');
// We want 1 decimal for the X-label
$g->xaxis->SetLabelFormat('%1.1f');
// We use a scatterplot to illustrate the original
// contro points.
$splot = new ScatterPlot($ydata,$xdata);
//
$splot->mark->SetFillColor('red@0.3');
$splot->mark->SetColor('red@0.5');
// And a line plot to stroke the smooth curve we got
// from the original control points
$lplot = new LinePlot($newy,$newx);
$lplot->SetColor('navy');
// Add the plots to the graph and stroke
$g->Add($lplot);
$g->Add($splot);
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/staticbandbarex7.html b/html/includes/jpgraph/docs/html/exframes/staticbandbarex7.html
new file mode 100644
index 0000000000..89d23b6906
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/staticbandbarex7.html
@@ -0,0 +1,4 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
$datay=array(12,5,19,22,17,6);
// Create the graph.
$graph = new Graph(400,300,"auto");
$graph->img->SetMargin(60,30,50,40);
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->SetFont(FF_ARIAL,FS_BOLD,15);
$graph->title->Set("Cash flow ");
$graph->subtitle->Set("Use of static line, 3D and solid band");
// Turn off Y-grid (it's on by default)
$graph->ygrid->Show(false);
// Add 10% grace ("space") at top of Y-scale.
$graph->yscale->SetGrace(10);
$graph->yscale->SetAutoMin(-20);
// Turn the tick mark out from the plot area
$graph->xaxis->SetTickSide(SIDE_DOWN);
$graph->yaxis->SetTickSide(SIDE_LEFT);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$bplot->SetShadow("darkblue");
// Show the actual value for each bar on top/bottom
$bplot->value->Show(true);
$bplot->value->SetFormat("%02d kr");
// Position the X-axis at the bottom of the plotare
$graph->xaxis->SetPos("min");
// .. and add the plot to the graph
$graph->Add($bplot);
// Add upper and lower band and use no frames
$band[0]=new PlotBand(HORIZONTAL,BAND_3DPLANE,"min",0,"blue");
$band[0]->ShowFrame(false);
$band[0]->SetDensity(20);
$band[1]=new PlotBand(HORIZONTAL,BAND_SOLID,0,"max","steelblue");
$band[1]->ShowFrame(false);
$graph->Add($band);
$graph->Add(new PlotLine(HORIZONTAL,0,"black",2));
//$graph->title->Set("Test of bar gradient fill");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,11);
$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,11);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/stockex1.html b/html/includes/jpgraph/docs/html/exframes/stockex1.html
new file mode 100644
index 0000000000..ecd05853a0
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/stockex1.html
@@ -0,0 +1,4 @@
+
+<?php
// Example of a stock chart
include ("../jpgraph.php");
include ("../jpgraph_stock.php");
// Data must be in the format : open,close,min,max
$datay = array(
34,42,27,45,
55,25,14,59,
15,40,12,47,
62,38,25,65,
38,49,32,64);
// Setup a simple graph
$graph = new Graph(300,200);
$graph->SetScale("textlin");
$graph->SetMarginColor('lightblue');
$graph->title->Set('Stockchart example');
// Create a new stock plot
$p1 = new StockPlot($datay);
// Width of the bars (in pixels)
$p1->SetWidth(9);
// Uncomment the following line to hide the horizontal end lines
//$p1->HideEndLines();
// Add the plot to the graph and send it back to the browser
$graph->Add($p1);
$graph->Stroke();
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/tabtitleex1.html b/html/includes/jpgraph/docs/html/exframes/tabtitleex1.html
new file mode 100644
index 0000000000..b01374acbc
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/tabtitleex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
$datay1 = array(20,15,23,15);
$datay2 = array(12,9,42,8);
$datay3 = array(5,17,32,24);
// Setup the graph
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30,50,30,30);
$graph->tabtitle->Set(' Year 2003 ' );
$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,13);
$graph->yaxis->HideZeroLabel();
$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5');
$graph->xgrid->Show();
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Create the first line
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
$p1->SetLegend('Line 1');
$graph->Add($p1);
// Create the second line
$p2 = new LinePlot($datay2);
$p2->SetColor("red");
$p2->SetLegend('Line 2');
$graph->Add($p2);
// Create the third line
$p3 = new LinePlot($datay3);
$p3->SetColor("orange");
$p3->SetLegend('Line 3');
$graph->Add($p3);
$graph->legend->SetShadow('gray@0.4',5);
$graph->legend->SetPos(0.1,0.1,'right','top');
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/textalignex1.html b/html/includes/jpgraph/docs/html/exframes/textalignex1.html
new file mode 100644
index 0000000000..2056242066
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/textalignex1.html
@@ -0,0 +1,3 @@
+
+<?php
// $Id: textalignex1.php,v 1.1 2002/10/19 17:42:53 aditus Exp $
require_once "../jpgraph.php";
require_once "../jpgraph_canvas.php";
if( empty($_GET['a']) ) {
$angle=40;
}
else {
$angle=$_GET['a'];
}
$caption = "Demonstration of different anchor points for texts as specified with\nTextAlign(). The red cross marks the coordinate that was given to\nstroke each instance of the string.\n(The green box is the bounding rectangle for the text.)";
$txt="TextAlign()";
// Initial width and height since we need a "dummy" canvas to
// calculate the height of the text strings
$w=480;$h=50;
$xm=90;$ym=80;
$g = new CanvasGraph($w,$h);
$aImg = $g->img;
$aImg->SetFont(FF_ARIAL,FS_NORMAL,16);
$tw=$aImg->GetBBoxWidth($txt,$angle);
$th=$aImg->GetBBoxHeight($txt,$angle);
$aImg->SetFont(FF_ARIAL,FS_NORMAL,11);
$ch=$aImg->GetBBoxHeight($caption);
// Calculate needed height for the image
$h = 3*$th+2*$ym + $ch;
$g = new CanvasGraph($w,$h);
$aImg = $g->img;
$prof = array('left','top',
'center','top',
'right','top',
'left','center',
'center','center',
'right','center',
'left','bottom',
'center','bottom',
'right','bottom');
$n = count($prof)/2;
for( $i=0,$r=0,$c=0; $i < $n; ++$i ) {
$x = $c*($tw+$xm)+$xm/2;
$y = $r*($th+$ym)+$ym/2-10;
$aImg->SetColor('blue');
$aImg->SetTextAlign($prof[$i*2],$prof[$i*2+1]);
$aImg->SetFont(FF_ARIAL,FS_NORMAL,16);
$aImg->StrokeText($x,$y,$txt,$angle,"left",true);
$aImg->SetColor('black');
$aImg->SetFont(FF_FONT1,FS_BOLD);
$aImg->SetTextAlign('center','top');
$align = sprintf('("%s","%s")',$prof[$i*2],$prof[$i*2+1]);
$aImg->StrokeText($c*($tw/2+$xm)+$xm/2+$tw/2,$r*($th/2+$ym)+$th+$ym/2-4,$align);
$c++;
if( $c==3 ) {
$c=0;$r++;
}
}
$aImg->SetTextAlign('center','bottom');
$aImg->SetFont(FF_ARIAL,FS_ITALIC,11);
$aImg->StrokeText($w/2,$h-10,$caption,0,'left');
$aImg->SetColor('navy');
$aImg->Rectangle(0,0,$w-1,$h-1);
$g->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/titlecsimex01.html b/html/includes/jpgraph/docs/html/exframes/titlecsimex01.html
new file mode 100644
index 0000000000..ce84f9049b
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/titlecsimex01.html
@@ -0,0 +1,4 @@
+
+<?php
include_once ("../jpgraph.php");
include_once ("../jpgraph_bar.php");
$datay=array(12,26,9,17,31);
// Create the graph.
$graph = new Graph(400,250);
$graph->SetScale("textlin");
$graph->SetMargin(50,80,20,40);
$graph->yaxis->SetTitleMargin(30);
$graph->yaxis->scale->SetGrace(30);
$graph->SetShadow();
// Create a bar pot
$bplot = new BarPlot($datay);
// Create targets for the bars image maps. One for each column
$targ=array("bar_clsmex1.php#1","bar_clsmex1.php#2","bar_clsmex1.php#3","bar_clsmex1.php#4","bar_clsmex1.php#5","bar_clsmex1.php#6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$bplot->SetCSIMTargets($targ,$alts);
$bplot->SetFillColor("orange");
$bplot->SetLegend('Year 2001 %%','#kalle ','%s');
// Display the values on top of each bar
$bplot->SetShadow();
$bplot->value->SetFormat(" $ %2.1f",70);
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$bplot->value->SetColor("blue");
$bplot->value->Show();
$graph->Add($bplot);
// Create a big "button" that has an image map action
$txt1 = new Text("A simple text with\ntwo rows");
$txt1->SetFont(FF_ARIAL);
$txt1->SetBox('lightblue','black','white@1',5);
$txt1->SetParagraphAlign('center');
$txt1->SetPos(40,50);
$txt1->SetCSIMTarget('#88','Text element');
$graph->Add($txt1);
// Add image map to the graph title as well (you can do this to the
// sub- and subsub-title as well)
$graph->title->Set("Image maps barex1");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->title->SetCSIMTarget('#45','Title for Bar');
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
// Setup the axis title image map and font style
$graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD);
$graph->yaxis->title->SetCSIMTarget('#55','Y-axis title');
$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
$graph->xaxis->title->SetCSIMTarget('#55','X-axis title');
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('titlecsimex01.php');
?>
+
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/exframes/topxaxisex1.html b/html/includes/jpgraph/docs/html/exframes/topxaxisex1.html
new file mode 100644
index 0000000000..26c2778ce7
--- /dev/null
+++ b/html/includes/jpgraph/docs/html/exframes/topxaxisex1.html
@@ -0,0 +1,3 @@
+
+<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
// Some data
$datay = array(25,29,29,39,55);
$graph = new Graph(400,200,'auto');
$graph->img->SetMargin(40,40,40,20);
$graph->SetScale("linlin");
$graph->SetShadow();
$graph->title->Set("Top X-axis");
// Start at 0
$graph->yscale->SetAutoMin(0);
// Add some air around the Y-scale
$graph->yscale->SetGrace(100);
// Use built in font
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Adjust the X-axis
$graph->xaxis->SetPos("max");
$graph->xaxis->SetLabelSide(SIDE_UP);
$graph->xaxis->SetTickSide(SIDE_DOWN);
// Create the line plot
$p1 = new LinePlot($datay);
$p1->SetColor("blue");
// Specify marks for the line plots
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
// Show values
$p1->value->Show();
// Add lineplot to graph
$graph->Add($p1);
// Output line
$graph->Stroke();
?>
+
\ No newline at end of file
diff --git a/html/includes/jpgraph/docs/html/img/alphabarex1.png b/html/includes/jpgraph/docs/html/img/alphabarex1.png
new file mode 100644
index 0000000000000000000000000000000000000000..39f4552d8a12c7d961403002215f223851a17c17
GIT binary patch
literal 143464
zcmV)=K!m@EP)