diff --git a/includes/jpgraph/README b/includes/jpgraph/README new file mode 100644 index 0000000..83e90b4 --- /dev/null +++ b/includes/jpgraph/README @@ -0,0 +1,66 @@ +README FOR JPGRAPH 3.5.x +========================= + +This package contains the JpGraph PHP library Pro version 3.5.x + +The library is Copyright (C) 2000-2010 Asial Corporatoin 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://jpgraph.net/pro/ +http://jpgraph.net/download/ + +* -------------------------------------------------------------------- +* PHP4 IS NOT SUPPORTED IN 2.x or 3.x SERIES +* -------------------------------------------------------------------- + +Requirements: +------------- +Miminum: +* PHP 5.1.0 or higher +* GD 2.0.28 or higher +Note: Earlier versions might work but is unsupported. + +Recommended: +* >= PHP 5.2.0 +* PHP Builtin GD library + +Installation +------------ +1. 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" + +2. 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. + +3. Check that the default directory paths in jpg-config.inc.php + 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. + + +Documentation +------------- +The installation includes HTML documentation and reference guide for the +library. The portal page for all documentation is +/docs/index.html + + +Bug reports and suggestions +--------------------------- +Should be reported using the contact form at + +http://jpgraph.net/contact/ + diff --git a/includes/jpgraph/VERSION b/includes/jpgraph/VERSION new file mode 100644 index 0000000..4654da6 --- /dev/null +++ b/includes/jpgraph/VERSION @@ -0,0 +1 @@ +Version: v3.5.0b1 diff --git a/includes/jpgraph/docs/chunkhtml/admon-bug.png b/includes/jpgraph/docs/chunkhtml/admon-bug.png new file mode 100644 index 0000000..aea6446 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-bug.png differ diff --git a/includes/jpgraph/docs/chunkhtml/admon-bug2.png b/includes/jpgraph/docs/chunkhtml/admon-bug2.png new file mode 100644 index 0000000..36b52e5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-bug2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/admon-bug2_small.png b/includes/jpgraph/docs/chunkhtml/admon-bug2_small.png new file mode 100644 index 0000000..96ac6ae Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-bug2_small.png differ diff --git a/includes/jpgraph/docs/chunkhtml/admon-caution.png b/includes/jpgraph/docs/chunkhtml/admon-caution.png new file mode 100644 index 0000000..ecdc0f9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-caution.png differ diff --git a/includes/jpgraph/docs/chunkhtml/admon-note.png b/includes/jpgraph/docs/chunkhtml/admon-note.png new file mode 100644 index 0000000..4ffa19c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-note.png differ diff --git a/includes/jpgraph/docs/chunkhtml/admon-tip.png b/includes/jpgraph/docs/chunkhtml/admon-tip.png new file mode 100644 index 0000000..a25faae Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-tip.png differ diff --git a/includes/jpgraph/docs/chunkhtml/admon-warning.png b/includes/jpgraph/docs/chunkhtml/admon-warning.png new file mode 100644 index 0000000..ecdc0f9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/admon-warning.png differ diff --git a/includes/jpgraph/docs/chunkhtml/apa.html b/includes/jpgraph/docs/chunkhtml/apa.html new file mode 100644 index 0000000..d135e08 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apa.html @@ -0,0 +1,117 @@ +Appendix A. How this manual was produced

Appendix A. How this manual was produced

+ +

Unfortunately we couldn't locate any off-the-shelf system for producing this fairly + large manual with some special requirements like automatic inclusion of PHP source that + should be highlighted and in addition rendered by running the scripts and automatically + include the resulting images in the resulting manual. To solve this we have based our + solution around a DocBook5 setup with some custom steps that are described below.

+

DocBook5

+

The source for the manual is written as a number of split DocBook5 XML compliant documents using + XInclude to bring them + together into one master document.

+

The transformation of the XML source files was done by the means of a DocBook XSL + stylesheet using the xsltproc XSL processor. (see libxslt) The DocBook5 + style sheets can directly produce either single file HTML or chunked (many files) HTML + (or XHTML).

+

In addition there is a style sheet to produce FO (Formatted Objects) output which can + be further refined to PDF with the help of the fop processor (see + Apache FOP). + Unfortunately some formatting instructions in the source are lost in the transformation + to PDF output. This means that some aspects of the manual doesn't come out perfect in + the PDF output. For this reason the PDF version of the documentation should only be seen + as a complementary documentation. The master output format is the chunked HTML.

+

+

Note

+

In formatting the chunked output we have prioritized to keep down the number + of files to avoid many pages with only a small amount of text on them. Our view + is that documentation which breaks the pages down to very low levels are + extremely tiresome to read.

+

+

+

Phing based build system

+

The overall build process is drive by a Phing XML build script. + Phing (See http://phing.info/trac/ ) is most easily described as a PHP version of the + Java build system Ant. It has several advantages compared with a more + traditional make setup, the build files are all written in clear XML + which makes them easy to read and maintain. In addition there are a number of built-in + commands that makes deploying and handling of files extremely easy compared with a + traditional make system which must rely on external tools to do everything.

+

Syntax highlighting of example code

+

The syntax highlighting and handling of the numerous example images initially posed a + small problem since there are no off-the-shelf good support for handling this. As a + basic requirement we needed all PHP scripts to be runnable and kept in the normal + example directories and then automatically included when the DocBook source was + processed.

+

What was needed was some easy way by which we could just mark in the DocBook source + (and still maintain valid DocBook XML) that we wanted a particular named example + included and either show just the image, just the source or both. In addition we + required the source to be syntax highlighted.

+

To handle this we had to write some custom tasks to extend Phing. In principal our + build system works as follows.

+
  1. +

    When a new example have been added or an old one removed a special target in + our build file are run which extracts all scripts from the example sections in + the *.XML files. The name of each found example script in the XML source + corresponds to an existing PHP script in the Example directory in the JpGraph + distribution. A batch file is then automatically created which is subsequently + run and all generated images stored on disk.

    +
  2. +

    When the normal DocBook XSL processing is done all the special example markups + in the XML source is replaced with XML tags to include the image and make sure + that the referred script is a proper PHP file name.

    +
  3. +

    After the XSL process has been run all programlisting tags will have a special + token, for example "\#\#example0.php\#\#" this then instructs a + custom Phing task to replace the name in the double "#" tags + with the corresponding source (in the resulting HTML code). At the same time + this source is included it is also passed through the custom syntax highlight + filter so that it comes out as proper marked up source which is inserted + directly in the resulting HTML file.

    +
+

The overall build system is illustrated in Figure A.1. The documentation build process

+

Figure A.1. The documentation build process

+ +
The documentation build process
+

+

The way the special markup works is that whenever we want a full example (source and + image) we create a <programlisting> tag with the file name and title within (single) + "#" characters. For example to include the very first example in this manual we have the + following tags in the docbook XML source

+

+

<programlisting>#example0|The very first example#</programlisting>

+

+

The first part (before the "|") is the file name without extension that we want to + include and the second part (after the "|") is the title we want to use. This markup + will include both the source as well as the generated graph/image directly in the + resulting HTML.

+

When new examples have been added the examples target in our build file is run and + that extracts all the example script used in the book (in the above example + "example0.php") and creates a batch file which is then run to create + all the images used in the examples.

+

The syntax highlighting is handled by a custom written filter extensions to + Phing which internally uses the PEAR package + Pear::Text_Highlight.

+

Notes:

+

+

  1. +

    In the current setup a regular expression in the Phing build script is + responsible for replacing the markup in the programlisting with a + <figure> tag and a new <programlisting>. This should be done with a + custom XSL layer instead and we will update this for the next major + revision.

    +
  2. +

    Since the syntax highlighting makes use of HTML markup code for the colors + the PDF output does not support syntax highlighting

    +
  3. +

    For the reference manual we still use our old DB based documentation + system which stores all the methods and classes in a DB augmented with + source documentation. (We actually prefer this in front of adding a lot of + end user documentation with PHPDoc comment sin the source which have a + tendency of cluttering up the code as well as making it prone to error since + the source files have to be modified in order to update a simple typo in the + documentations. Our next step is therefor to update that old system to be + able to produce DocBook5 compliant XML for further formatting and + processing.

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/apb.html b/includes/jpgraph/docs/chunkhtml/apb.html new file mode 100644 index 0000000..e60edfd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apb.html @@ -0,0 +1,73 @@ +Appendix B. JpGraph Professional License

Appendix B. JpGraph Professional License

+ +

Single License

+ +
  1. +

    The JpGraph Professional License will be referred to as "The license" in the + remainder of this text.

    +
  2. +

    This irrevocable, perpetual license covers versions 1.x & 2.x of + JpGraph

    +
  3. +

    This license gives the holder right to install JpGraph libraries on One Server + which can run one or several virtual HTTP servers.

    +
  4. +

    The license holder is allowed to make modifications to the JpGraph sources but + in no event will the original copyright holders of this library be held + responsible for action or actions resulting from any modifications of the + source.

    +
  5. +

    The license holder is not required to publicize or otherwise make available + any software used in conjunction with JpGraph.

    +
  6. +

    The license holder may not re-distribute the library on it's own or versions + thereof to third party without prior written permission of the copyright + holder.

    +
  7. +

    JpGraph License does not allow the library to be redistributed as part of + another product.

    +
  8. +

    In no event shall the copyright notice in any of the source files supplied in + JpGraph be removed or modified.

    +
  9. +

    The names "JpGraph" or "Aditus" must not be used to endorse or promote + products derived from this software without prior written permission.

    +
  10. +

    The license may be transferred to another server by removing all installed + files from the old server.

    +
  11. +

    The wording of this license may change without notice for future versions of + JpGraph.

    +
  12. +

    By acquiring a license the licensee agrees to all terms and conditions in this + license text.

    +
  13. +

    Limitations of Liability

    +

    In no event, except for intellectual property claim, 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.

    +

    In addition, in no event does this license authorize you to use JpGraph in + applications or systems where JpGraphs failure to perform can reasonably be + expected to result in a physical injury, loss of life or any economical damage. + Any such use by the licensee is entirely at the licensees own risk, and the + licensee agrees to hold the original copyright holders of JpGraph harmless from + any claims or losses relating to any such unauthorized use.

    +
  14. +

    Limited Warranty

    +

    JpGraph warrants that licensor is owner of the software with authority to + license the software to licensee and that the software does not infringe third + party intellectual property rights. Licensor agrees to indemnify, defend and + hold harmless licensee from any claims either that licensor does not own the + software or that the software infringes a third party's intellectual + property.

    +

    THE SOFTWARE AND THIS LICENSE DOCUMENT ARE PROVIDED AS IS. THE FOREGOING + WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, OF ANY KIND, + INCLUDING WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE.

    +
+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/apbs02.html b/includes/jpgraph/docs/chunkhtml/apbs02.html new file mode 100644 index 0000000..2a7f273 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apbs02.html @@ -0,0 +1,64 @@ +Bulk (Re-seller license)

Bulk (Re-seller license)

+ +
  1. +

    The JpGraph Professional License will be referred to as "The license" in the + remainder of this text.

    +
  2. +

    This irrevocable, perpetual license covers versions 1.x & 2.x of + JpGraph

    +
  3. +

    This license gives the licensee the right to distribute the JpGraph libraries, + as part of its product portfolio and to use the Jpgraph libraries with its + hosted service offerings. Specifically this license gives the licensee the right + to deploy an unlimited number of JpGraph installations as part of their product + portfolio and offer an unlimited number of hosted services that use the JpGraph + libraries to an unlimited number of users.

    +
  4. +

    The license holder is allowed to make modifications to the JpGraph sources but + in no event will the original copyright holders of this library be held + responsible for action or actions resulting from any modifications of the + source.

    +
  5. +

    JpGraph libraries is only licensed to be redistributed as a part of the + licensees products. Specifically it may not be sold or re-distributed on it's + own.

    +
  6. +

    In no event shall the copyright notice in any of the source files supplied in + JpGraph be removed or modified.

    +
  7. +

    The names "JpGraph" or "Aditus" must not be used to endorse or promote + products derived from this software without prior written permission.

    +
  8. +

    The wording of this license may change without notice for future versions of + JpGraph.

    +
  9. +

    By acquiring a license the licensee agrees to all terms and conditions in this + license text.

    +
  10. +

    Limitations of Liability

    +

    In no event, except for intellectual property claim, 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.

    +

    In addition, in no event does this license authorize you to use JpGraph in + applications or systems where JpGraphs failure to perform can reasonably be + expected to result in a physical injury, loss of life or any economical damage. + Any such use by the licensee is entirely at the licensees own risk, and the + licensee agrees to hold the original copyright holders of JpGraph harmless from + any claims or losses relating to any such unauthorized use.

    +
  11. +

    Limited Warranty

    +

    JpGraph warrants that licensor is owner of the software with authority to + license the software to licensee and that the software does not infringe third + party intellectual property rights. Licensor agrees to indemnify, defend and + hold harmless licensee from any claims either that licensor does not own the + software or that the software infringes a third party's intellectual + property.

    +

    THE SOFTWARE AND THIS LICENSE DOCUMENT ARE PROVIDED AS IS. THE FOREGOING + WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, OF ANY KIND, + INCLUDING WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE.

    +
+
diff --git a/includes/jpgraph/docs/chunkhtml/apc.html b/includes/jpgraph/docs/chunkhtml/apc.html new file mode 100644 index 0000000..d31498e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apc.html @@ -0,0 +1,1324 @@ +Appendix C. FAQ

Appendix C. FAQ

+
C.1. Where should I install the library?
C.2. Can I use JpGraph with Windows/Unix/Linux etc?
C.3. My Web-admin does not allow PHP any write permissions and hence I can't use + the cache feature of JpGraph. Is there any way to completely turn off the + caching feature?
C.4. After installation all I get is an empty page when I try any of the + examples?
C.5. How can I send the generated graph to both the browser and a file at the same + time?
C.6. What is this 'auto' I see in all the Graph() creating in the Examples + directory? Do I need it?
C.7. The Client side image map examples does not work on my machine?
C.8. When I run 'testsuit_jpgraph.php' I get a warning "Due to insufficient + permission the source files can't be automatically created"
C.9. How can I pass data to my image generating script?
C.10. How can I use data from an Excel spreadsheet?
C.11. How do I pass data from a Database (e.g. MySQL) to a script to produce a + graph?
C.12. I change my data but my image does not get updated? The old image is still + send back to the browser?
C.13. Can I run JpGraph in batch-mode just outputting an image directly to a file + and not streamed back to the browser?
C.14. Is there a mailing list for JpGraph?
C.15. Do you offer a commercial version of JpGraph with full support and no + QPL?
C.16. Some of my script just return a blank image and no error messages?
C.17. I can see the generated image fine in the browser but I can't print it? +
C.18. How can I generate an image directly to disk without streaming it back to the + browser?
C.19. When I try to plot graphs with many 1000:s of data points I only get a blank + page. Is there a limit in JpGraph to the number of data points you can plot? +
C.20. How can I use an image in a dynamically created PDF?
C.21. How can I force the user to get a question to download the generated image + instead of just displaying it in the browser?
C.22. How can I open up a CSIM link in a graph in a separate window?
C.23. No TTF fonts are displayed.
C.24. All my TTF fonts are yellow no matter what color I specify?
C.25. I get an error "This PHP build has not been configured with TTF support. You + need to recompile your PHP installation with FreeType support."
C.26. I get an error "Fatal error: Font cant be + found"
C.27. I get the error "Can't find font file + FONT_PATHarial.ttf" (or some other font)
C.28. I get an error "Font file ... is not readable or does not + exist"
C.29. How can I install additional TTF font families?
C.30. How can I display special characters that isn't available on the + keyboard?
C.31. When I put a text object on a graph and use Set90AndMargin() it doesn't + show?
C.32. I get an error "Error: Cannot add header information + - headers already sent ..." +
C.33. I get an error "Unknown function + imagecreate"
C.34. I get an error "Unknown function + imagecreatejpeg"
C.35. I get an error "Warning: MkDir failed (Permission + denied) in jpgraph.php on line XXXX"
C.36. I get an error "Fatal error: Undefined class name + "parent" in jpgraph.php on line xxxx"
C.37. I get an error "Your data contains non-numeric + values."
C.38. I get an error "Date is outside specified scale + range" trying to create a Gantt chart
C.39. I get an error "Invalid file handle in jpgraph.php at + line XXXX"
C.40. I get an error "Fatal error: Call to undefined + function: getcsimareas() ..." +
C.41. I get an error "Fatal error: Call to undefined + function: imagetypes()"
C.42. I get an error saying something like "Error: + 'parent::' not valid in context..."
C.43. I get an error "Image cannot be displayed because it + contains errors.."
C.44. When I use PHP5 + JpGraph 2.x I get "A plot has an + illegal scale..."
C.45. I try to mix bar and line graphs and the bars doesn't get centered and the + labels are not correctly aligned?
C.46. How do I turn off anti-aliasing for TTF fonts?
C.47. The auto-scaling algorithm chooses very tight limits around my Y-values. How + do I get more "space" between the end of the scale and the min/max values? +
C.48. I want to use autoscaling to handle the maximum value but I always want the + Y-axis to start at 0 regardless of the actual minimum value?
C.49. I want the position of the X-axis to be at the bottom of the Y-scale and not + always at the position Y=0?
C.50. I specify color X in the image but the color displayed is not exactly what I + specified?
C.51. Can I have labels at an arbitrary angle on the X-axis?
C.52. How do I invert the Y-scale so that it has the minimum value on top and the + largest value at the bottom?
C.53. Can I have the auto-scaling algorithm restrict itself to whole + numbers?
C.54. Is it possible to have horizontal bar graphs?
C.55. Line weight does not seem to work in my graphs? I specify a thick line but + still get a thin line?
C.56. How can I have more space between the Y-axis and the title?
C.57. How can I display both X and Y values above each data point in a line, bar or + scatter plot?
C.58. Can I display stock box-charts (open, close, high, low) with JpGraph?
C.59. Is there any way to specify a newline in the legend box for a specific + legend?
C.60. How can I print unicode characters?
C.61. My background images doesn't display properly. It just shows a black solid + square?
C.62. How do I make each bar in a bar plot have it's own color?
C.63. How can I adjust the position of the axis title?
C.64. How can I change the image format, i.e jpeg, gif or png?
C.65. How do I specify the font for legends?
C.66. When I rotate text and labels the text is not rotated correctly?
C.67. When I rotate a paragraph (multi-line) text the paragraph is always left + aligned even though I have specified another alignment. It seems fine for + non-rotated paragraphs though. What is the problem?
C.68. I have a huge number of data points and I only want labels (which I want to + specify as text string) and ticks on every n:th data. Can I do this?
C.69. How can I make the labels have a 1000 comma separator?
C.70. The Y2 axis is no longer positioned at the right side of the graph
C.71. How can I include several graphs in the same image?
C.72. How can I have an exploded slice with 3D pie plots?
C.73. How can I display values for each slice close to the pie?
C.74. How can I change between percentage and absolute values for pie slices? +
C.75. Can I display the actual value as labels on the pie bar instead of the + percentage?
C.76. How can I adust the start angle of the first slice?
C.77. When I use IE v5 or v6 I can only save the generated graph image in the + browser as a BMP file even if it was generated as a JPEG or PNG encoded + image?
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

C.1.

Where should I install the library?

The simple answer is: Anywhere You like! Since the necessary library files + are included in Your own script with an "include" (or more likely a + require_once) statement it doesn't matter where You put the library as long as + Your scripts can access it. A common place is to store the library is in a + directory where PHP searches for include files (as specified in Your + php.ini file), for example in + "/usr/share/php" or perhaps + "/usr/local/php" depending on Your PHP configuration.

An even simpler way is to just store the library in a directory where Your + scripts are executed from. However , this is not really recommended.

C.2.

Can I use JpGraph with Windows/Unix/Linux etc?

Yes. The library itself is OS-agnostic. As long as you have a WEB server + which supports PHP 4.3.x (or above) and have the GD library. Please note though + that the behavior of PHP/Apache on Unix and Windows seems to have some subtle + differences which might affect things like path specification using '/' or '\'.

+

Caution

+

The library does not support any 64bit OS and there are known issues + with running the library on a 64bit OS (either Unix or Windows). There + are currently no plans to address this in the near future.

+

+

C.3.

My Web-admin does not allow PHP any write permissions and hence I can't use + the cache feature of JpGraph. Is there any way to completely turn off the + caching feature?

Yes, set the constant "USE_CACHE" to FALSE in + jpg-config.php. This way will skip writing file even if a filename has been + submitted in the Graph() creation call. You can also accomplish this by not + having any file name at all in the call to Graph().

C.4.

After installation all I get is an empty page when I try any of the + examples?

If the HTTP server response is truly absolutely empty (verify that by looking + at the source of the page that gets returned to the browser) then the only + answer is that the HTTP server has crashed. Most likely it is the PHP process + within the server that has crashed. Even though PHP is fairly stable there are + still ways of crashing it. To investigate this further You might try to:

  • +

    ... investigate the system log for traces of a server + crash.

    +
  • +

    ... try increase the maximum allowed memory for PHP in php.ini. As + a rule it should be a minimum of 32MB (and preferable 64MB)

    +
  • +

    ... upgrade PHP to the latest stable version (and use the compile + options shown further down in this FAQ.

    +
  • +

    ... upgrade PHP to the latest stable version (and use the compile + options shown further down in this FAQ.

    +
  • +

    ... enable all errors and warning for PHP (in php.ini) to help + track down the problem.

    +
  • +

    ... disable output buffering to get errors send back to the + browser as soon as possible (in php.ini)

    +

C.5.

How can I send the generated graph to both the browser and a file at the same + time?

This is not directly supported by means of any particular option or setting + in the library but with small "trick" this is easy enough to accomplish.

The idea is to use the _IMG_HANDLER option that forces the + Graph::Stroke() to just return the image handler and then stop. + We can then manually first send the image to the chosen file and then stream it + back to the browser using some internal methods in the library.

The following code snippet shows how this is done

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
<?php
+$graph = new Graph(400,300);  
+<... code to generate a graph ...>  
+// Get the  handler to prevent the library from sending the 
+// image to the browser
+$gdImgHandler = $graph->Stroke(_IMG_HANDLER);
+  
+// Stroke image to a file and  browser  
+// Default is PNG so use ".png" as suffix 
+$fileName = "/tmp/imagefile.png"; $graph->img->Stream($fileName);  
+ 
+// Send it back to browser 
+$graph->img->Headers(); 
+$graph->img->Stream();
+?>

C.6.

What is this 'auto' I see in all the Graph() creating in the Examples + directory? Do I need it?

No. The third argument in the graph call is an optional cache file name and + is not necessary unless You want to use the caching feature of JpGraph. By + specifying 'auto' the filename is automatically created based on the name of the + script file.

C.7.

The Client side image map examples does not work on my machine?

In order to run the examples the code generates HTML to read the image from + the cache directory as Apache sees it. You must adjust the image tag to have the + correct path to your cache directory.

C.8.

When I run 'testsuit_jpgraph.php' I get a warning "Due to insufficient + permission the source files can't be automatically created"

This is not a serious problem. When the testsuit is run it tries to create a + symbolic link with the same base name as the individual testfile but with + extension ".phps". This is just so it is possible to click on an image and then + view the source syntax colored. If Apache doesn't have write permissions to the + directory where 'testsuit_jpgraph.php' is executed from you will get this + warning.

If you want to use this feature just change the permissions so Apache may + write to the directory.

C.9.

How can I pass data to my image generating script?

There are basically three(four) ways:

  • +

    Read the data from a file

    +
  • +

    Read the data from a DB

    +
  • +

    Pass the data in the <img> tag using URL + parameter passing. For example <img + src="myimg.php?d1=2&d2=7&d3=12" border=0> + This method is not suitable for large data sets since there is + an upper bound to the length of an URL specification (around 255 + characters)

    +
  • +

    A fourth way might be to use session variables to pass the data + between different scripts. For large data sets the only practical way is + to read the data from a file or from a DB to construct the data + vectors.

    +

C.10.

How can I use data from an Excel spreadsheet?

Export the data from Excel as a CSV (Comma separated Values) file to be able + to easily read the file. Then either write your own routine to read and parse + the data from that file or use the utility class "ReadCSV" in + "jpgraph_utils.php".

A basic example on how to do this for a line graph assuming the name of the + data file is "data.csv".

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
<?php include ("../jpgraph.php"); 
+include ("../jpgraph_line.php"); 
+include ("../jpgraph_utils.inc");  
+$n = ReadFileData::FromCSV('data.csv',$datay); 
+if( $n == false ) {     
+    die("Can't read data.csv."); 
+}  
+ 
+// Setup the graph $graph = new Graph(400,300);
+$graph->title->Set('Reading CSV file with '.$n.' data points');
+$graph->SetScale("intlin");  
+ 
+$l1 = new LinePlot($datay); 
+$graph->Add($l1);
+$graph->Stroke(); 
+?>

C.11.

How do I pass data from a Database (e.g. MySQL) to a script to produce a + graph?

By adding some SQL statements in Your graph scripts that creates the data + arrays from the DB.

Watch out for empty values and strings. JpGraph doesn't know how to plot + strings. Any value passed into JpGraph should be only valid numeric data. See + the online discussions on populating from a DB Populating DB or the discussion + on how to read data from file Reading from file.

See How to + populate arrays from mySQL +

C.12.

I change my data but my image does not get updated? The old image is still + send back to the browser?

What you are seeing is a cached version of Your image. Depending on your + setup it could either be that the browser has a cached image or You are using + the built-in cache system in the library by accident.

+ Fixing the browser cache Since the script from + the browser point of view is the same it just displays the old image. To fix + this you need to turn of the browser image caching.

Another "trick" that can be used since normally it is impossible to control + the browser for the end user is ot add a "dummy" URL argument which changes. + This way the browser will always see a new URL and then always reload that file. + This could be done for example as:

1
+
echo ('<img src="graphscript.php?' .microtime().'">');

+ Fixing the library cache

The other reason might be that You have enabled the built-in cache feature in + JpGraph. To turn it of You can either

  • +

    Not specify a cache name in the call to Graph(). Just call new + Graph(200,200) for example.

    +
  • +

    Turn off the reading from the cache by setting READ_CACHE to + false (in jpg-config.inc)

    +
  • +

    Turn off the reading and writing from the cache by setting + USE_CACHE to false (in jpg-config.php)

    +
  • +

    Use the cache but with a timeout so that the image will be + re-generated if the cached image is older then the specified timeout + value in the call to Graph().

    +

C.13.

Can I run JpGraph in batch-mode just outputting an image directly to a file + and not streamed back to the browser?

Yes. Just specify an absolute file name in the call to Graph::Stroke(). To + store the image in the local temp directory use:

1
+
$myGraph->Stroke("/tmp/myimage.png");

Caution

+

Note: You must match the file ending Yourself to the format you have + chosen to generate the image in.

+

C.14.

Is there a mailing list for JpGraph?

No, but there is a user community forum at + http://jpgraph.intellit.nl/index.php where users discuss various + aspects of the library.

C.15.

Do you offer a commercial version of JpGraph with full support and no + QPL?

Yes, For commercial (non-open-source) you will need to get the "JpGraph + Professional License". This allows you you deploy JpGraph in a commercial + context. Further details upon contact.

C.16.

Some of my script just return a blank image and no error messages?

This could potentially be a lot of things depending on which browser you are + using. One thing you might want to check is that your script doesn't take to + long time. In that case they might hit the time limit for running a PHP script + as specified in php.ini. You can adjust that time limit with a call to + set_time_limit().

If You are seeing just an empty page (really empty) then this is a sign that + Your server has crashed. Most likely an old version of PHP is being used which + has taken down the HTTP server process.

C.17.

I can see the generated image fine in the browser but I can't print it? +

This is again browser dependent. Some browser does not like to print an image + which is generated on-line and does exist as a *.jpg, *.png etc file. No good + workaround has been identified short of changing browser. Some browsers (and + versions) can print others not. The only real safe way (if you need printing) is + to generate the image on disk and then have the browser read the image from + there.

C.18.

How can I generate an image directly to disk without streaming it back to the + browser?

Two ways: (Preferred way) If you supply a filename in the call to + $graph->Stroke() the image will be written to that file and not be streamed back + to the browser. If you prefer to have the image going to the cache directory but + not streamed back then you could just set the '$aInlineFlag' in the initial call + to Graph() (fifth argument) to false as in +

1
+
$mygraph = new Graph(200,200,"auto",0,false);

+ The "auto" argument makes an automatic file name in the cache based on the + script name. The 0 indicates that we have no timeout. The advantage with this + method is that you can specify a timeout to avoid having the image generated to + often.

C.19.

When I try to plot graphs with many 1000:s of data points I only get a blank + page. Is there a limit in JpGraph to the number of data points you can plot? +

No, there is no such limit. The problem is most likely that your script takes + so long time that the PHP execution limit (as specified in php.ini) aborts the + script. If you have more than 10,000 data points JpGraph will work but doing + this kind of heavy data analysis on a WEB-server extension is probably not a + good idea to start with.

The other reason could be that the script exhausts the allowed memory limit + for PHP as specified in the "php.ini" file. By default this is often set to 8Mb + which is to low for a complex JpGraph script. Try increasing the memory limit to + a minimum of 16Mb. For very complex graphs with 1000s of data points there might + be a need to increase the memory even further.

C.20.

How can I use an image in a dynamically created PDF?

You can do this in two ways, you can either stroke the image created with the + library directly to a file where it can be used with Your PDF library of choice. + For example, using FPDF (www.fpdf.org) the Image() function would have to be used to read an + image from the filesystem.

If You are using the PDF library (APIs included in the PHP distribution but + the library itself might require a license depending on Your usage.) you can + avoid the storage of the file by getting the image handler for the image + directly and use it with PDF.

With the PDF library you must first open the in memory image with a call to + pdf_open_memory_image($pdf, $im). The following script places + an image from JpGraph directly into a PDF page that is returned when running + this script.

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php  
+ 
+$graph = new Graph(...);  
+ 
+// Code to create the graph 
+// .........................
+ 
+// Put the image in a PDF page 
+$im = $graph->Stroke(_IMG_HANDLER);  
+$pdf = pdf_new(); 
+pdf_open_file($pdf, '');  
+ 
+// Convert the GD image to somehing the 
+// PDFlibrary knows how to handle 
+$pimg = pdf_open_memory_image($pdf, $im);
+ 
+pdf_begin_page($pdf, 595, 842); 
+pdf_add_outline($pdf, 'Page 1');
+pdf_place_image($pdf, $pimg, 0, 500, 1); 
+pdf_close_image($pdf, $pimg);
+pdf_end_page($pdf); 
+pdf_close($pdf);  
+ 
+$buf = pdf_get_buffer($pdf); 
+$len =strlen($buf);  
+ 
+// Send PDF mime headers 
+header('Content-type: application/pdf');
+header("Content-Length: $len"); 
+header("Content-Disposition: inline; filename=foo.pdf");  
+ 
+// Send the content of the PDF file 
+ 
+echo $buf;  
+ 
+// .. and clean up 
+pdf_delete($pdf);  
+?>

C.21.

How can I force the user to get a question to download the generated image + instead of just displaying it in the browser?

Change your code for creating the image:

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php
+$im=$graph->Stroke(_IMG_HANDLER); $filename="chart"; 
+$file_type = "image/png";
+$file_ending = "png"; 
+$filename=$filename.".".$file_ending;
+ 
+header("Content-Type: application/$file_type"); 
+header("Content-Disposition:attachment; filename=".$filename); 
+header("Pragma: no-cache"); 
+header("Expires:0"); 
+ImagePNG($im); 
+?>

A html link, which directs to the php page (assuming the filename is + chart.php): Download Then, if you click on the link, a download dialog appears + and you can download the "chart.png".

Note

+

If you directly open chart.php, the image is directly streamed to the + browser and the download dialog will not open.

+

C.22.

How can I open up a CSIM link in a graph in a separate window?

To open a target CSIM (drill down) in a separate window some javascript in + the target link is necessary since this action must be performed in the browser. + The target URL needs top be in the form of an action to open up a window (with + any optional URL argument that might be needed). For example, assume we have a + bar graph and that theb user can click on each bar to get more details. When the + user clicks on a bar we open up the detaails witha call to the helper script + "bar_details.php" and send the parameter "id" to the script to separate the + individual bars. We would then use the following URL link (with javascript)

1
+
"javascript:window.open('bar_details.php?id=%d','_new','width=500,height=300');void(0)"

Where the '%d' placeholder must be replaced by the appropriate Id for each + bar. To assign the appropriate id we could use the following construct

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+// Create targets for the image maps so that the details are opened 
+// in a separate window 
+$fmtStr = "javascript:window.open('bar_details.php?id=%d','_new','width=500,height=300');
+void(0)";  
+$n = count($datay); 
+$targ=array();
+$alts=array(); 
+for($i=0; $i < $n; ++$i) {     
+    $targ[$i] = sprintf($fmtStr,$i+1);     
+    $alts[$i] = 'val=%d'; 
+}
+                    
+$bplot->SetCSIMTargets($targ,$alts); 
+$graph->Add($bplot); 
+... 
+// Send back the HTML page to browser 
+$graph->StrokeCSIM();  
+?>

It should be noted that in the above Javascript code we have used the special + window name '_new' which means that a new window will be opened each time a user + clicks on a bar. By giving the window a specific name the same window would be + re-used every time.

C.23.

No TTF fonts are displayed.

There are potentially many reasons for this Please start by trying the + following bare bones PHP script to see if basic TTF support is available in the + PHP setup.

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php 
+// Change this defines to where Your fonts are stored 
+DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/"); 
+ 
+// Change this define to a font file that You know that You have
+DEFINE("TTF_FONTFILE","arial.ttf"); 
+ 
+// Text to display 
+DEFINE("TTF_TEXT","Hello World!");  
+ 
+$im = imagecreatetruecolor (400, 100); 
+$white = imagecolorallocate($im, 255, 255, 255); 
+$black = imagecolorallocate ($im, 0, 0, 0);
+ 
+imagefilledrectangle($im,0,0,399,99,$white); 
+imagettftext ($im, 30, 0, 10, 40,$black, TTF_DIR.TTF_FONTFILE,TTF_TEXT);  
+header ("Content-type: image/png");
+imagepng ($im); 
+?>

The above script when run should produce an image with a black text string on + a white background. If this doesn't work then there is a setup problem with PHP + + TTF.

As a first step to resolve this recompile Your PHP4 setup using the following + basic configuration (depending on the local conditions some options/path might + have to be changed). The critical options are marked in bold.

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
./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-mysql \ 
+<span class="bold"><strong>--with-gd \ 
+--enable-gd-imgstrttf \ 
+--enable-gd-native-ttf \
+--with-ttf-dir=/usr/lib \ 
+--with-freetype-dir=/usr/lib \
+--with-zlib-dir=/usr/lib \ 
+--with-png-dir=/usr/lib \
+--with-jpeg-dir=/usr/lib \
+</strong></span>--with-xpm-dir=/usr/X11R6 \
+--with-tiff-dir=/usr/lib \ 
+--enable-memory-limit --enable-safe-mode \
+--bindir=/usr/bin \ 
+--enable-bcmath -enable-calendar \ 
+--enable-ctype --with-ftp \ 
+--enable-magic-quotes \ 
+--enable-inline-optimization \ 
+--with-iconv

If there is still no TTF fonts displayed then the next step is to upgrade + Your TTF libraries to the latest version. The FreeType version 2.1.9 is known to + work well.

C.24.

All my TTF fonts are yellow no matter what color I specify?

You have a old buggy version of the FreeType library, most likely the old + FreeType I library is being used. Please upgrade to the latest version of + FreeType II.

C.25.

I get an error "This PHP build has not been configured with TTF support. You + need to recompile your PHP installation with FreeType support."

This error is reported if the built-in PHP/GD function "imagettfbbox()" is not available. This is a crucial method to make + TTF fonts work with JpGraph. The most likely reason for this problem is that the + PHP configuration is faulty and does not have correct support for TTF fonts. + Please recompile PHP as shown above and make sure that the built-in version of + GD is being used and not the stand-alone library.

C.26.

I get an error "Fatal error: Font cant be + found"

You have either not specified a correct path where your fonts are stored (see + top of jpg-config.inc) or you have tried to use a font you do not have + installed.

C.27.

I get the error "Can't find font file + FONT_PATHarial.ttf" (or some other font)

You are most likely running on Windows. This seems to be caused by a bug in + PHP/Apache (or PHP/IIS) specifically on Windows. The problem seems to be that + PHP doesn't remember a DEFINE() setting across two or more include directive. A + simple workaround is to hard-code the font path in class TTF in file + jpgraph.php. Note: If you have this problem you will most likely also have a + problem with the path to the cache directory.

C.28.

I get an error "Font file ... is not readable or does not + exist"

This error is caused by the inability of PHP/JpGraph to read the font file. + This could have several reasons:

  • +

    The file path or name is wrong and the file really doesn't exist. + Please check that the file and path (as shown in the error message) + really exists.

    +
  • +

    If the file exists it might still not be possible for PHP to read the + file due to permission problem. Please make sure that PHP can read a + file in the TTF directory. This can be verified with the following short + script

    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +
    <?php 
    +// Change this defines to where Your fonts are stored 
    +DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/");
    + 
    +// Change this define to a font file that You know that You have
    +DEFINE("TTF_FONTFILE","arial.ttf");  
    + 
    +$f = TTF_DIR.TTF_FONTFILE; 
    +if( file_exists($f) === false || is_readable($f) === false ) {     
    +    echo "FAIL: Can not read font file \"$f\"."; 
    +} else {     
    +    echo "PASS: Successfully read font file \"$f\"."; 
    +} 
    +?>
    +

    If the script reports FAIL then it must be + investigated whether the file names or permissions are wrong.

    +

C.29.

How can I install additional TTF font families?

See the Adding additional TTF font + families section on this site for a full explanation of the necessary + steps.

C.30.

How can I display special characters that isn't available on the + keyboard?

By using the standard "&#dddd" encoding of the symbol in a text string. + For example, to get the character for the "copyright" symbol &copy; which + has the numeric code "00A9" (in Hex)

1
+
$copy = sprintf('&#%04d;',hexdec('00A9'));

In a similar way this can be used to show Greek letters, for example + "&#0946;" (beta) is displayed by

1
+
$beta = sprintf('&#%04d;',hexdec('03B2'));

Tip

+

Use the class "SymChar" defined in jpgraph_utils.php to get + easy access to greek and special mathematical symbols. This class allow the + specification of common symbols by name. Some examples:

+
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
// &#0948; (delta)
+$gamma = SymChar::Get('delta'); 
+ 
+// &#0956; (mu) 
+$mu = SymChar::Get('mu'); 
+ 
+// &#0960; (pi) 
+$pi = SymChar::Get('pi'); 
+ 
+// &#0955; (lambda) 
+$lambda = SymChar::Get('lambda'); 
+ 
+// &#8747; (integral sign) 
+$integral = SymChar::Get('int'); 
+ 
+// &#8776; (approximation sign) 
+$approx = SymChar::Get('approx');
+

C.31.

When I put a text object on a graph and use Set90AndMargin() it doesn't + show?

The main cause for this behaviour is that the text object position is rotated + 90 degrees. For example, putting a text object at Pos(0,0) it will become + "invisible". The reason for this behaviour is that the texts position (not the + text itself) is rotated around the center of the image 90 degrees clockwise.

For example, assuming the image is WxH in size. Rotating position (0,0) which + is the top left corner of the image gives the rotated position:

+ (0,0) => rotate 90 degrees => (W,0) +

Now, if a string was put at position (W,0) it will be drawn outside the image + and hence become invisible.

If You need to position text with rotated images just keep this in mind and + swap the meaning of the X and Y position since the X-position will become the Y + position and vice versa after a 90 degree rotation. Some experiments will soon + allow You to get the hang of it.

Tip

+

Start with an image that is equal in W and H since this makes it easier to + understand the rotation.

+

C.32.

I get an error "Error: Cannot add header information + - headers already sent ..." +

First, this is not a problem with JpGraph per se. What has happened is that + your PHP file which produces the image has already returned some data to the + browser before the image has been sent. This is most often caused by one or more + spaces before the first "<?php" The browser will now implicitly set the + header to plain text.

When later JpGraph tries to send the correct image header the browser gets + confused since it has already received a header for the current document. (Each + document can only have one and only one type). Check your files for any output + (even a single space) before the call to Graph::Graph() (or Graph::Stroke())

If you are running on Windows this problem could be caused by a blank line at + the end of any of the jpgraph_*.php files. All files in jpgraph ends in a + newline which some configurations on Windows doesn't like. Remove the newline so + that the file ends just after the final "?>"

Also remember that when you include external file using include/include_once + and so on Php include the whole content of the file; this content of the file + also include any potential carriage return/line feed or "blank" space before + "<?php" and after "?>" These "dirty characters" will stop the JpGraph + being properly sent back because they are included in the image streaming. +

C.33.

I get an error "Unknown function + imagecreate"

You have not compiled PHP with support for the GD graphic library. See PHP + documentation for details. Note that you also need to configure PHP to use GD + and/or TTF fonts to get JpGraph full functionality

C.34.

I get an error "Unknown function + imagecreatejpeg"

You have not compiled PHP with support for the JPG format. See PHP + documentation for details

C.35.

I get an error "Warning: MkDir failed (Permission + denied) in jpgraph.php on line XXXX"

This is a permission problem. To use the cache Apache/PHP must have write + permission to the cache directory. Make sure that Apache/PHP have sufficient + permissions to write to the specified cache directory.

C.36.

I get an error "Fatal error: Undefined class name + "parent" in jpgraph.php on line xxxx"

You are using an older version of PHP. JpGraph 1.x requires at least PHP + 4.3

+

Note

+

Remember that JpGraph 1.x has reached its end of life and is no longer + maintained.

+

+

C.37.

I get an error "Your data contains non-numeric + values."

Most likely Your data really contains non-numeric data which You need to + further investigate (for example by printing out the array with a + var_dump(). One additional thing to watch out for is if the + data looks like ".56" (or "-.56") which is a shortform of "0.56". The problem is + that the number starts with an "." (dot) which is non-numeric. The solution is + to replace the single dot with a "0."

C.38.

I get an error "Date is outside specified scale + range" trying to create a Gantt chart

As the error says, you start or end date for a activity is larger/smaller + than the max/min value in the scale. If you get this error and you are using + automatic scale then you are probably using a null value (empty string "") as + start or end date. Check your data

C.39.

I get an error "Invalid file handle in jpgraph.php at + line XXXX"

This is a permission problem. Check that your cache directory has the right + permissions to let JpGraph access and write to it.

C.40.

I get an error "Fatal error: Call to undefined + function: getcsimareas() ..." +

You have enabled the DEFINE("JPG_DEBUG",true) in jpgraph.php. + This is an internal debug flag which should always be left untouched.

C.41.

I get an error "Fatal error: Call to undefined + function: imagetypes()"

You have not installed the core GD library correct. imagetypes() + is a standard GD function. Please refer to the installation section in the + manual for more information on how to verify You setup.

C.42.

I get an error saying something like "Error: + 'parent::' not valid in context..."

You are most likely using the Zend cache. There is a bug with some versions + of the Zend cache together with the "parent" meta class. If the referenced + parent class is in another file that is included this problem seems to occur. + The workaround seems to be to put all classes in the same physical file or + upgrade the Zend cache to a more recent version.

C.43.

I get an error "Image cannot be displayed because it + contains errors.."

First of all this is an error message from the browser and not the library. + There could be various reasons for this but the most likely scenario is that + Your installation of PHP has both enabled output buffering and enabled strict + error checking.

What could now happen is that with output buffering enabled PHP will buffer + up any text error messages. This could for example be som "Notice:" warnings if + You have forgotten to initialize some variables. When then the library adds the + proper image header and the buffered error messages together with the image gets + sent back the browser it all falls apart.

The browser tries to interpret both the error messages and the image data as + an image and it of course fails and gives this error message. Why? Because the + textual error messages that was buffered is interpreted as if they would belong + to the image which of course is nonsense.

The solution is to disable output-buffering until You are convinced that Your + code is without any problem. On a development server it is recommended to always + have output buffering disabled.

C.44.

When I use PHP5 + JpGraph 2.x I get "A plot has an + illegal scale..."

There have been a few reports of this problem and it seems to be due to a + faulty PHP 5.x installation. For example a standard SuSE 9.3 PHP5 installation + gives this problem. The exact reason for the problem has not been established + but it all points to a PHP5 problem since it can be solved by adjusting the PHP + installation without any change in the library.

Step 1:

First check that Your php.ini file have compatibility mode turned off (in + php.ini)

1
+
zend.ze1_compatibility_mode=off

+ Step 2:

If turning the compatibility mode off still doesn't solve the problem the + only remaining solution is to re-compile PHP 5. For example on our development + servers we use the following configuration Note: We place "php.ini" in + "/etc/php5/apache2" and You might want to change this to suit Your specific + setup.

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
./configure
+--prefix=/usr/share --datadir=/usr/share/php \
+--with-apxs2=/usr/sbin/apxs2-prefork \ 
+--libdir=/usr/share
+--includedir=/usr/include \ 
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php5/apache2 \ 
+--enable-mbstring --enable-mbregex \
+--with-mysql  \ 
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-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

C.45.

I try to mix bar and line graphs and the bars doesn't get centered and the + labels are not correctly aligned?

This is a known problem. The best way to partly solve this is to make sure + you add the bar plot as the last plot to the graph. The reason behind this + problem is that plot that gets added to the graph internally makes modification + to the alignment of the plot. Since each plot does not know what other plot has + been added it will happily overwrite previous plots settings in the graph. Hence + the workaround by adding the bar last. conflicting settings.)

C.46.

How do I turn off anti-aliasing for TTF fonts?

There is not any built in support in JpGraph to do this. Since the whole + purpose of TTF fonts is to provide a smooth font experience there is really no + point in wanting to do this. If you want non-aliased fonts you should use the + built-in bitmap fonts.

C.47.

The auto-scaling algorithm chooses very tight limits around my Y-values. How + do I get more "space" between the end of the scale and the min/max values? +

Use the SetGrace() to specify some extra space (as percentage of + the scale) between the min/max value and the limits of the scale. For example + $graph->yscale->SetGrace(10) gives 10% extra space at the + ends.

C.48.

I want to use autoscaling to handle the maximum value but I always want the + Y-axis to start at 0 regardless of the actual minimum value?

Use the SetAutoMin() method. For example as in

1
+2
+3
+4
+5
+
...
+$graph = new Graph(400,350); 
+$graph->SetScale("intlin");
+$graph->yaxis->scale->SetAutoMin(0); 
+...

Tip

+

If you need to limit the maximum value but auto-scale the minimum value + use the SetAutoMax() method.

+

C.49.

I want the position of the X-axis to be at the bottom of the Y-scale and not + always at the position Y=0?

To adjust the position of the Axis Use the Axis::SetPos() + method. The argument to this method can be either the numerical scale value on + the Y-axis where the X-axis should be positioned or it can be one of the two + special value "min" or "max". In the latter case the axis will be positioned on + either the minimum or the maximum value of the scale. For example +

1
+2
+3
+
...
+$graph->xaxis->SetPos("min"); 
+...

+ Will put the X-axis at the lowest value of the Y-axis.

Note

+

The same positioning is possible for the Y-axis.

+

C.50.

I specify color X in the image but the color displayed is not exactly what I + specified?

This is a result of a finite color palette for GIF, PNG formats. If you are + using anti-aliasing, perhaps a background image or even gradient fill you might + exhaust the color palette supported in the GD library. Try set the constant + USE_APPROX_COLORS to false and generate the picture again. If + you now get an error message saying that no more colors can be allocated this is + the problem. There is no good workaround if you are using GD 1.x since for PNG + the GD 1.x library does not support "True-color".

The only real solution is to upgrade to GD 2.x to get full true-color + support. If you are using a background image try to "degrade" it to have a + smaller color palette or turn of anti-aliasing and you might have enough free + palette entries to cater for all the colors you want and still use GD 1.x

Note

+

This problem is only seen in very, very old installations that use GD 1.x + library which has been deprecated since around 2005

+

C.51.

Can I have labels at an arbitrary angle on the X-axis?

Yes, almost any text can be stroked at an arbitrary angle. For example to + have the labels at 45 degrees angle use

1
+2
+3
+4
+
...
+$graph->xaxis->SetTickLabels($labels);
+$graph->xaxis->SetLabelAngle(45); 
+...

Note

+

Internal fonts support 0 and 90 degrees text. If you need to use, say 45 + degree (or any other arbitrary angle), you must use TTF fonts.

+

C.52.

How do I invert the Y-scale so that it has the minimum value on top and the + largest value at the bottom?

The easiest way to do this is by following a two step process

a) Negating all Your values and then

b) Create a callback function for the Y-axis that negates all the display + values.

What will happen now is that after the negative values have been feed into + the graph it will create a scale starting at the lowest value, say -8, then go + up to the highest, say -1. If these values are then inverted when printed it + will in affect achieve the inverted axis appearance. The code snippet below + shows a basic example of this technique.

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
... // Callback to negate the argument
+function _cb_negate($aVal) {     
+    return round(-$aVal); 
+}  // A fake depth curve
+$ydata = ....  
+// Negate all data 
+$n = count($ydata); 
+for($i=0; $i<$n; ++$i) {     
+    $ydata[$i] = -$ydata[$i]; 
+}  
+ 
+// Basic graph setup 
+$graph = new Graph(400,300); 
+$graph->SetScale("linlin");  
+ 
+// Setup axis
+$graph->yaxis->SetLabelFormatCallback("_cb_negate"); 
+$plot = new LinePlot($ydata,$xdata); 
+$graph->Add($plot); 
+$graph->Stroke();

Two scripts that uses this technique can be found in the + Examples/ directory in the distribution, + "inyaxisex1.php" and + "inyaxisex2.php".

C.53.

Can I have the auto-scaling algorithm restrict itself to whole + numbers?

Yes, use the "int" scale specification, for example + $graph->SetScale('inttext') will make the Y-axis have an + integer scale and the X-axis a text-scale

C.54.

Is it possible to have horizontal bar graphs?

Yes, Just create a normal bar and call the method + Set90AndMargin() to rotate the graph.

C.55.

Line weight does not seem to work in my graphs? I specify a thick line but + still get a thin line?

You have probably enabled Anti-aliasing. If anti-aliasing is enabled setting + line-weight will have no affect.

C.56.

How can I have more space between the Y-axis and the title?

Use the Axis::SetTitleMargin() method. For example to have a 25 + pixels margin for the Y-title you could use: +

1
+
$mygraph->yaxis->SetTitleMargin(25);

C.57.

How can I display both X and Y values above each data point in a line, bar or + scatter plot?

You need to use a value formatting callback. The callback function is called + for each data point and is passed the Y-value as argument. This means that if + You also need to display the x-value it must be available in the callback + function,perhaps as a global data array.

Something along the lines of

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+$datay = array(...); 
+$datax = array(...);
+$idx=0; 
+ 
+function xyCallback($yval) {   
+    global $datax, $idx;   
+    return '('.$datax[$idx++].", $yval)"; 
+} 
+ 
+// Some more code ... 
+ 
+$graph = new Graph(...);
+$graph->SetScale("intlin"); 
+$p1 = new LinePlot($datay,$datax);
+$p1->value->SetFormatCallback('xyCallback'); 
+$p1->value->Show(); 
+ 
+// Some more code ... 
+ 
+$graph->Stroke(); 
+?>

C.58.

Can I display stock box-charts (open, close, high, low) with JpGraph?

Yes, just create a StockPlot() graph.

C.59.

Is there any way to specify a newline in the legend box for a specific + legend?

Yes. From version 1.8 full multi-line text paragraphs are supported. Just + make sure that your text uses double-quotes and a newline character.

C.60.

How can I print unicode characters?

Use &#XXXX; format in your strings where XXXX is the decimal value for + the unicode character. You may find a list of Unicode characters and there + encodings at www.unicode.org Please observe that the encoding in the lists are + given in hexadecimal and these values must be converted to decimal.

Note: If You are working in an UTF-8 environment then the characters may be + input directly.

C.61.

My background images doesn't display properly. It just shows a black solid + square?

You are using a very old GD version (probably 2.0.1). Background images only + work with a truecolor image, (enable the USE_TRUECOLOR constant). Some people + have reported that it works as long as the background image is not in PNG + format. The drawback with truecolor images is that truefont doesn't work + properly in GD versions < 2.0.8

C.62.

How do I make each bar in a bar plot have it's own color?

Specify an array as argument to BarPlot::SetColor() as in +

1
+
$mybarplot->SetColor(array("red","green","blue","gray"));

C.63.

How can I adjust the position of the axis title?

You can add an alignment parameter when you specify the title. You specify + one of "high", "low" or "center" as in

1
+2
+3
+
$mygraph->xaxis->SetTitle("mytitle","high");
+$mygraph->xaxis->SetTitle("mytitle","center");
+$mygraph->xaxis->SetTitle("mytitle","low");

C.64.

How can I change the image format, i.e jpeg, gif or png?

Use the Image::SetImgFormat() method at runtime. You can also + change the default value with the DEFAULT_GFORMAT define in + jpg-config.php. This is normally set to 'auto' format which means that JpGraph + will automatically choose the format depending on what is available.

For example to use the JPEG format :

1
+
$graph->img->SetImgFormat('jpeg');

C.65.

How do I specify the font for legends?

Use the Legend::SetFont() method. As in

1
+
$graph->legend->SetFont(FF_FONT1,FS_BOLD);

C.66.

When I rotate text and labels the text is not rotated correctly?

Red Hat 7.2 has a bug in it's TTF libraries (FreeType 2.0.3) that comes with + the distribution. Upgrade to FreeType 2.0.9.

C.67.

When I rotate a paragraph (multi-line) text the paragraph is always left + aligned even though I have specified another alignment. It seems fine for + non-rotated paragraphs though. What is the problem?

This is a limitation with the current implementation. (The reason is that GD + does not support inter-paragraph alignment so all that logic is done within the + libraries string-layout engine.

At the moment the logic only implements this paragraph alignment for + non-rotated paragraphs.) For rotated paragraphs left-alignment will always be + used regardless of specified paragraph alignment.

C.68.

I have a huge number of data points and I only want labels (which I want to + specify as text string) and ticks on every n:th data. Can I do this?

Yes. What most users stumble on is the fact that the label array must still + contain data for all the data points even though only every n:th data label is + displayed.

This means that if your original data array only contains just the display + values it is necessary first to augment the label array with padding spaces to + fill it out.

It is then possible to use the method + Axis::SetTextTickInterval() to specify that only every n:th + tick+label should be displayed. Something like: +

1
+2
+3
+
// Setup the X-axis 
+$graph->xaxis->SetTickLabels($datax);
+$graph->xaxis->SetTextTickInterval( ... );

C.69.

How can I make the labels have a 1000 comma separator?

The easiest way is to use the PHP built-in function + "number_format()" as a callback (see php manual. number_format())

For example, to have the line plot display values using this format first + setup and install the callback function as:

1
+
$lineplot->value->SetFormatCallback("number_format");

If you instead want the Y-axis label to use this kind of formatting install + the callback using

1
+
$graph->yaxis->SetLabelFormatCallback("number_format");

C.70.

The Y2 axis is no longer positioned at the right side of the graph

This will happen after that You have manually specified the sclae and/or the + tick spacing. If the user manipulates the default scale the library defaults to + setting the position of the Y2 axis to the 0 X-position. It is easy to re-adjust + the Y2 axis position by calling SetPos() as the following code snippet + demonstrates +

1
+2
+
$graph->y2axis->SetPos('max');
+$graph->y2axis->SetTitleSide('right');

C.71.

How can I include several graphs in the same image?

This can be solved by a bit of extra GD code since the library by default do + not directly support this functionality. The easiest way to solve this is to + manually create a big enough empty graph with plain GD commands. Then get the + image handles from the Stroke() methods in the graphs that should be included. + It is then possible to use these handles together with the GD copy command and + copy the individual graphs to the previously created empty large GD image.

This is illustrated in the following code snippet. In the example below we + assume that graph1 is the same size as the final combined graph we would like to + create. This way our combined graph get a background and color as specified in + the first graph.

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
// Assume we would like to combine graph1,2 and 3 
+ 
+// ...... create graph 1 here....... 
+$handle1 = $graph1->Stroke( _IMG_HANDLER);  
+ 
+// ...... create graph 2 here.......
+$handle2 =  $graph2->Stroke( _IMG_HANDLER);  
+ 
+// ...... create graph 3 here....... 
+$handle3 = $graph3->Stroke( _IMG_HANDLER);   
+ 
+// Now create the "melting graph" which should contain all three graphs 
+// $WIDTH1 and $HEIGHT1 are width and height of graph 1 ($handle1) 
+// $WIDTH2 and $HEIGHT2 are width and height of graph 2 ($handle2) 
+// $WIDTH3 and $HEIGHT3 are width and height of graph 3 ($handle3) 
+// $x2,$x3 and $y2,$y3 shift from top left of global graph (ie position of 
+// graph2 and graph3 in global graph)  
+$image = imagecreatetruecolor($WIDTH1,$HEIGHT1); 
+imagecopy($image, $handle1,0, 0, 0, 0, $WIDTH1,$HEIGHT1); 
+imagecopy($image, $handle1,$x1,$y1,0,0,$WIDTH2,$HEIGHT2);
+imagecopy($image, $handle1,$x2,$y2,0,0,$WIDTH3,$HEIGHT3);  
+ 
+// Stream the result back as a PNG 
+image header("Content-type: image/png"); 
+imagepng ($image);

C.72.

How can I have an exploded slice with 3D pie plots?

Use either Pi3DPLot::ExplodeSlice() or + Pie3DPlot::Explode() +

C.73.

How can I display values for each slice close to the pie?

Use the method PiePlot::value::Show()

C.74.

How can I change between percentage and absolute values for pie slices? +

Use PiePlot::SetValueType($aType) where $aType is + either PIE_VALUE_ABS or PIE_VALUE_PERCENTAGE. To + hide/show values on the pie you access the value property of the plot (just like + in line plots) If you want some special format of the string you also need to + specify a format string. By default just a number gets printed. If you (for + example) want percent with a "%" sign you should use a format string like "%d%%" + (assuming you just want to display whole numbers) +

1
+2
+3
+
$mypieplot->value->SetFormat("%d%%");
+$mypieplot->value->Show(); // Defaults to TRUE
+$mypieplot->SetValueType(PIE_VALUE_PERCENTAGE);

C.75.

Can I display the actual value as labels on the pie bar instead of the + percentage?

Yes, use +

1
+
$pieplot->SetLabelType(PIE_LABEL_ABS);

and + make sure labels are not hidden.

C.76.

How can I adust the start angle of the first slice?

Use

1
+
$pieplot->SetStartAngle(45);

C.77.

When I use IE v5 or v6 I can only save the generated graph image in the + browser as a BMP file even if it was generated as a JPEG or PNG encoded + image?

This is a bug in the way IE handles HTTP headers. By default the library + sends no-cache headers to instruct the browser to always make a HTTP request to + the server. This is necessary since graph scripts normally have the same name + but the graphs may change over time and we don't want the browser to be fooled + by thinking it has already fetched the graph before.

The only known workaround is to tell the library not to send back any + no-cache headers as illustrated below.

1
+2
+
$graph->img->SetExpired(false);                     
+$graph->Stroke();

The SetExpired(false) call instructs the library to not send + back any has-expired headers.

+
diff --git a/includes/jpgraph/docs/chunkhtml/apd.html b/includes/jpgraph/docs/chunkhtml/apd.html new file mode 100644 index 0000000..a00d44e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apd.html @@ -0,0 +1,8 @@ +Appendix D. Named color list

Appendix D. Named color list

+ +

See Chapter 7. Color handling for a discussion on how to specify colors + for graphic objects in the graph.

+

Table D.1. Named color list

+
Color name RGB Triple Hex Color
AntiqueWhite1(255,239,219)#ffefdb COLOR
AntiqueWhite2(238,223,204)#eedfcc COLOR
AntiqueWhite3(205,192,176)#cdc0b0 COLOR
AntiqueWhite4(139,131,120)#8b8378 COLOR
aliceblue(240,248,255)#f0f8ff COLOR
antiquewhite(250,235,215)#faebd7 COLOR
aqua(0,255,255)#00ffff COLOR
aquamarine(127,255,212)#7fffd4 COLOR
aquamarine1(127,255,212)#7fffd4 COLOR
aquamarine2(118,238,198)#76eec6 COLOR
aquamarine3(102,205,170)#66cdaa COLOR
aquamarine4(69,139,116)#458b74 COLOR
azure(240,255,255)#f0ffff COLOR
azure1(240,255,255)#f0ffff COLOR
azure2(224,238,238)#e0eeee COLOR
azure3(193,205,205)#c1cdcd COLOR
azure4(131,139,139)#838b8b COLOR
beige(245,245,220)#f5f5dc COLOR
bisque(255,228,196)#ffe4c4 COLOR
bisque1(255,228,196)#ffe4c4 COLOR
bisque2(238,213,183)#eed5b7 COLOR
bisque3(205,183,158)#cdb79e COLOR
bisque4(139,125,107)#8b7d6b COLOR
black(0,0,0)#000000 COLOR
blanchedalmond(255,235,205)#ffebcd COLOR
blue(0,0,255)#0000ff COLOR
blueviolet(138,43,226)#8a2be2 COLOR
brown(165,42,42)#a52a2a COLOR
brown1(255,64,64)#ff4040 COLOR
brown2(238,59,59)#ee3b3b COLOR
brown3(205,51,51)#cd3333 COLOR
brown4(139,35,35)#8b2323 COLOR
burlywood(222,184,135)#deb887 COLOR
burlywood1(255,211,155)#ffd39b COLOR
burlywood2(238,197,145)#eec591 COLOR
burlywood3(205,170,125)#cdaa7d COLOR
burlywood4(139,115,85)#8b7355 COLOR
cadetblue(95,158,160)#5f9ea0 COLOR
cadetblue1(152,245,255)#98f5ff COLOR
cadetblue2(142,229,238)#8ee5ee COLOR
cadetblue3(122,197,205)#7ac5cd COLOR
cadetblue4(83,134,139)#53868b COLOR
chartreuse(127,255,0)#7fff00 COLOR
chartreuse1(127,255,0)#7fff00 COLOR
chartreuse2(118,238,0)#76ee00 COLOR
chartreuse3(102,205,0)#66cd00 COLOR
chartreuse4(69,139,0)#458b00 COLOR
chocolate(210,105,30)#d2691e COLOR
chocolate1(255,127,36)#ff7f24 COLOR
chocolate2(238,118,33)#ee7621 COLOR
chocolate3(205,102,29)#cd661d COLOR
chocolate4(139,69,19)#8b4513 COLOR
coral(255,127,80)#ff7f50 COLOR
coral1(255,114,86)#ff7256 COLOR
coral2(238,106,80)#ee6a50 COLOR
coral3(205,91,69)#cd5b45 COLOR
coral4(139,62,47)#8b3e2f COLOR
cornflowerblue(100,149,237)#6495ed COLOR
cornsilk(255,248,220)#fff8dc COLOR
cyan(0,255,255)#00ffff COLOR
cyan1(0,255,255)#00ffff COLOR
cyan2(0,238,238)#00eeee COLOR
cyan3(0,205,205)#00cdcd COLOR
cyan4(0,139,139)#008b8b COLOR
darkblue(0,0,139)#00008b COLOR
darkcyan(0,139,139)#008b8b COLOR
darkgoldenrod(184,134,11)#b8860b COLOR
darkgoldenrod1(255,185,15)#ffb90f COLOR
darkgoldenrod2(238,173,14)#eead0e COLOR
darkgoldenrod3(205,149,12)#cd950c COLOR
darkgoldenrod4(139,101,8)#8b6508 COLOR
darkgray(100,100,100)#646464 COLOR
darkgreen(0,100,0)#006400 COLOR
darkkhaki(189,183,107)#bdb76b COLOR
darkmagenta(139,0,139)#8b008b COLOR
darkolivegreen(85,107,47)#556b2f COLOR
darkolivegreen1(202,255,112)#caff70 COLOR
darkolivegreen2(188,238,104)#bcee68 COLOR
darkolivegreen3(162,205,90)#a2cd5a COLOR
darkolivegreen4(110,139,61)#6e8b3d COLOR
darkorange(255,140,0)#ff8c00 COLOR
darkorange1(255,127,0)#ff7f00 COLOR
darkorange2(238,118,0)#ee7600 COLOR
darkorange3(205,102,0)#cd6600 COLOR
darkorange4(139,69,0)#8b4500 COLOR
darkorchid(153,50,204)#9932cc COLOR
darkorchid1(191,62,255)#bf3eff COLOR
darkorchid2(178,58,238)#b23aee COLOR
darkorchid3(154,50,205)#9a32cd COLOR
darkorchid4(104,34,139)#68228b COLOR
darkred(139,0,0)#8b0000 COLOR
darksalmon(233,150,122)#e9967a COLOR
darkseagreen(143,188,143)#8fbc8f COLOR
darkseagreen1(193,255,193)#c1ffc1 COLOR
darkseagreen2(180,238,180)#b4eeb4 COLOR
darkseagreen3(155,205,155)#9bcd9b COLOR
darkseagreen4(105,139,105)#698b69 COLOR
darkslateblue(72,61,139)#483d8b COLOR
darkslategray(47,79,79)#2f4f4f COLOR
darkslategray1(151,255,255)#97ffff COLOR
darkslategray2(141,238,238)#8deeee COLOR
darkslategray3(121,205,205)#79cdcd COLOR
darkslategray4(82,139,139)#528b8b COLOR
darkturquoise(0,206,209)#00ced1 COLOR
darkviolet(148,0,211)#9400d3 COLOR
deepindigo(138,43,226)#8a2be2 COLOR
deeppink(255,20,147)#ff1493 COLOR
deeppink1(255,20,147)#ff1493 COLOR
deeppink2(238,18,137)#ee1289 COLOR
deeppink3(205,16,118)#cd1076 COLOR
deeppink4(139,10,80)#8b0a50 COLOR
deepskyblue(0,191,255)#00bfff COLOR
deepskyblue1(0,191,255)#00bfff COLOR
deepskyblue2(0,178,238)#00b2ee COLOR
deepskyblue3(0,154,205)#009acd COLOR
deepskyblue4(0,104,139)#00688b COLOR
dimgray(105,105,105)#696969 COLOR
dodgerblue(30,144,255)#1e90ff COLOR
dodgerblue1(30,144,255)#1e90ff COLOR
dodgerblue2(28,134,238)#1c86ee COLOR
dodgerblue3(24,116,205)#1874cd COLOR
dodgerblue4(16,78,139)#104e8b COLOR
eggplant(144,176,168)#90b0a8 COLOR
electricindigo(102,0,255)#6600ff COLOR
firebrick(178,34,34)#b22222 COLOR
firebrick1(255,48,48)#ff3030 COLOR
firebrick2(238,44,44)#ee2c2c COLOR
firebrick3(205,38,38)#cd2626 COLOR
firebrick4(139,26,26)#8b1a1a COLOR
forestgreen(34,139,34)#228b22 COLOR
gainsboro(220,220,220)#dcdcdc COLOR
gold(255,215,0)#ffd700 COLOR
gold1(255,215,0)#ffd700 COLOR
gold2(238,201,0)#eec900 COLOR
gold3(205,173,0)#cdad00 COLOR
gold4(139,117,0)#8b7500 COLOR
goldenrod(218,165,32)#daa520 COLOR
goldenrod1(255,193,37)#ffc125 COLOR
goldenrod2(238,180,34)#eeb422 COLOR
goldenrod3(205,155,29)#cd9b1d COLOR
goldenrod4(139,105,20)#8b6914 COLOR
gray(190,190,190)#bebebe COLOR
gray1(10,10,10)#0a0a0a COLOR
gray2(40,40,30)#28281e COLOR
gray3(70,70,70)#464646 COLOR
gray4(100,100,100)#646464 COLOR
gray5(130,130,130)#828282 COLOR
gray6(160,160,160)#a0a0a0 COLOR
gray7(190,190,190)#bebebe COLOR
gray8(210,210,210)#d2d2d2 COLOR
gray9(240,240,240)#f0f0f0 COLOR
green(0,255,0)#00ff00 COLOR
greenyellow(173,255,47)#adff2f COLOR
honeydew(193,205,193)#c1cdc1 COLOR
hotpink(255,105,180)#ff69b4 COLOR
hotpink1(255,110,180)#ff6eb4 COLOR
hotpink2(238,106,167)#ee6aa7 COLOR
hotpink3(205,96,144)#cd6090 COLOR
hotpink4(139,58,98)#8b3a62 COLOR
indianred(205,92,92)#cd5c5c COLOR
indianred1(255,106,106)#ff6a6a COLOR
indianred2(238,99,99)#ee6363 COLOR
indianred3(205,85,85)#cd5555 COLOR
indianred4(139,58,58)#8b3a3a COLOR
indigo(75,0,130)#4b0082 COLOR
indigodye(0,65,106)#00416a COLOR
ivory(255,255,240)#fffff0 COLOR
ivory1(255,255,240)#fffff0 COLOR
ivory2(238,238,224)#eeeee0 COLOR
ivory3(205,205,193)#cdcdc1 COLOR
ivory4(139,139,131)#8b8b83 COLOR
khaki(240,230,140)#f0e68c COLOR
khaki1(255,246,143)#fff68f COLOR
khaki2(238,230,133)#eee685 COLOR
khaki3(205,198,115)#cdc673 COLOR
khaki4(139,134,78)#8b864e COLOR
lavender(230,230,250)#e6e6fa COLOR
lavenderblush(255,240,245)#fff0f5 COLOR
lavenderblush1(255,240,245)#fff0f5 COLOR
lavenderblush2(238,224,229)#eee0e5 COLOR
lavenderblush3(205,193,197)#cdc1c5 COLOR
lavenderblush4(139,131,134)#8b8386 COLOR
lawngreen(124,252,0)#7cfc00 COLOR
lemonchiffon(255,250,205)#fffacd COLOR
lemonchiffon1(255,250,205)#fffacd COLOR
lemonchiffon2(238,233,191)#eee9bf COLOR
lemonchiffon3(205,201,165)#cdc9a5 COLOR
lemonchiffon4(139,137,112)#8b8970 COLOR
lightblue(173,216,230)#add8e6 COLOR
lightblue1(191,239,255)#bfefff COLOR
lightblue2(178,223,238)#b2dfee COLOR
lightblue3(154,192,205)#9ac0cd COLOR
lightblue4(104,131,139)#68838b COLOR
lightcoral(240,128,128)#f08080 COLOR
lightcyan(224,255,255)#e0ffff COLOR
lightcyan1(224,255,255)#e0ffff COLOR
lightcyan2(209,238,238)#d1eeee COLOR
lightcyan3(180,205,205)#b4cdcd COLOR
lightcyan4(122,139,139)#7a8b8b COLOR
lightgoldenrod(238,221,130)#eedd82 COLOR
lightgoldenrod1(255,236,139)#ffec8b COLOR
lightgoldenrod2(238,220,130)#eedc82 COLOR
lightgoldenrod3(205,190,112)#cdbe70 COLOR
lightgoldenrod4(139,129,76)#8b814c COLOR
lightgoldenrodyellow(250,250,210)#fafad2 COLOR
lightgray(211,211,211)#d3d3d3 COLOR
lightgreen(144,238,144)#90ee90 COLOR
lightpink(255,182,193)#ffb6c1 COLOR
lightpink1(255,174,185)#ffaeb9 COLOR
lightpink2(238,162,173)#eea2ad COLOR
lightpink3(205,140,149)#cd8c95 COLOR
lightpink4(139,95,101)#8b5f65 COLOR
lightred(211,167,168)#d3a7a8 COLOR
lightsalmon(255,160,122)#ffa07a COLOR
lightsalmon1(255,160,122)#ffa07a COLOR
lightsalmon2(238,149,114)#ee9572 COLOR
lightsalmon3(205,129,98)#cd8162 COLOR
lightsalmon4(139,87,66)#8b5742 COLOR
lightseagreen(32,178,170)#20b2aa COLOR
lightskyblue(135,206,250)#87cefa COLOR
lightskyblue1(176,226,255)#b0e2ff COLOR
lightskyblue2(164,211,238)#a4d3ee COLOR
lightskyblue3(141,182,205)#8db6cd COLOR
lightskyblue4(96,123,139)#607b8b COLOR
lightslateblue(132,112,255)#8470ff COLOR
lightslategray(119,136,153)#778899 COLOR
lightsteelblue(176,196,222)#b0c4de COLOR
lightsteelblue1(202,225,255)#cae1ff COLOR
lightsteelblue2(188,210,238)#bcd2ee COLOR
lightsteelblue3(162,181,205)#a2b5cd COLOR
lightsteelblue4(110,123,139)#6e7b8b COLOR
lightyellow(255,255,200)#ffffc8 COLOR
lime(0,255,0)#00ff00 COLOR
limegreen(50,205,50)#32cd32 COLOR
linen(250,240,230)#faf0e6 COLOR
magenta(255,0,255)#ff00ff COLOR
magenta1(255,0,255)#ff00ff COLOR
magenta2(238,0,238)#ee00ee COLOR
magenta3(205,0,205)#cd00cd COLOR
magenta4(139,0,139)#8b008b COLOR
maroon(176,48,96)#b03060 COLOR
maroon1(255,52,179)#ff34b3 COLOR
maroon2(238,48,167)#ee30a7 COLOR
maroon3(205,41,144)#cd2990 COLOR
maroon4(139,28,98)#8b1c62 COLOR
mediumaquamarine(102,205,170)#66cdaa COLOR
mediumblue(0,0,205)#0000cd COLOR
mediumorchid(186,85,211)#ba55d3 COLOR
mediumorchid1(224,102,255)#e066ff COLOR
mediumorchid2(209,95,238)#d15fee COLOR
mediumorchid3(180,82,205)#b452cd COLOR
mediumorchid4(122,55,139)#7a378b COLOR
mediumpurple(147,112,219)#9370db COLOR
mediumpurple1(171,130,255)#ab82ff COLOR
mediumpurple2(159,121,238)#9f79ee COLOR
mediumpurple3(137,104,205)#8968cd COLOR
mediumpurple4(93,71,139)#5d478b COLOR
mediumred(140,34,34)#8c2222 COLOR
mediumseagreen(60,179,113)#3cb371 COLOR
mediumslateblue(123,104,238)#7b68ee COLOR
mediumspringgreen(0,250,154)#00fa9a COLOR
mediumturquoise(72,209,204)#48d1cc COLOR
mediumvioletred(199,21,133)#c71585 COLOR
midnightblue(25,25,112)#191970 COLOR
mintcream(245,255,250)#f5fffa COLOR
mistyrose(255,228,225)#ffe4e1 COLOR
mistyrose1(255,228,225)#ffe4e1 COLOR
mistyrose2(238,213,210)#eed5d2 COLOR
mistyrose3(205,183,181)#cdb7b5 COLOR
mistyrose4(139,125,123)#8b7d7b COLOR
moccasin(255,228,181)#ffe4b5 COLOR
navajowhite(255,222,173)#ffdead COLOR
navajowhite1(255,222,173)#ffdead COLOR
navajowhite2(238,207,161)#eecfa1 COLOR
navajowhite3(205,179,139)#cdb38b COLOR
navajowhite4(139,121,94)#8b795e COLOR
navy(0,0,128)#000080 COLOR
oldlace(253,245,230)#fdf5e6 COLOR
olivedrab(107,142,35)#6b8e23 COLOR
olivedrab1(192,255,62)#c0ff3e COLOR
olivedrab2(179,238,58)#b3ee3a COLOR
olivedrab3(154,205,50)#9acd32 COLOR
olivedrab4(105,139,34)#698b22 COLOR
orange(255,165,0)#ffa500 COLOR
orange1(255,165,0)#ffa500 COLOR
orange2(238,154,0)#ee9a00 COLOR
orange3(205,133,0)#cd8500 COLOR
orange4(139,90,0)#8b5a00 COLOR
orangered(255,69,0)#ff4500 COLOR
orangered1(255,69,0)#ff4500 COLOR
orangered2(238,64,0)#ee4000 COLOR
orangered3(205,55,0)#cd3700 COLOR
orangered4(139,37,0)#8b2500 COLOR
orchid(218,112,214)#da70d6 COLOR
orchid1(255,131,250)#ff83fa COLOR
orchid2(238,122,233)#ee7ae9 COLOR
orchid3(205,105,201)#cd69c9 COLOR
orchid4(139,71,137)#8b4789 COLOR
palegoldenrod(238,232,170)#eee8aa COLOR
palegreen(152,251,152)#98fb98 COLOR
palegreen1(154,255,154)#9aff9a COLOR
palegreen2(144,238,144)#90ee90 COLOR
palegreen3(124,205,124)#7ccd7c COLOR
palegreen4(84,139,84)#548b54 COLOR
paleturquoise(175,238,238)#afeeee COLOR
paleturquoise1(187,255,255)#bbffff COLOR
paleturquoise2(174,238,238)#aeeeee COLOR
paleturquoise3(150,205,205)#96cdcd COLOR
paleturquoise4(102,139,139)#668b8b COLOR
palevioletred(219,112,147)#db7093 COLOR
palevioletred1(255,130,171)#ff82ab COLOR
palevioletred2(238,121,159)#ee799f COLOR
palevioletred3(205,104,137)#cd6889 COLOR
palevioletred4(139,71,93)#8b475d COLOR
papayawhip(255,239,213)#ffefd5 COLOR
peachPuff1(255,218,185)#ffdab9 COLOR
peachpuff(255,218,185)#ffdab9 COLOR
peachpuff2(238,203,173)#eecbad COLOR
peachpuff3(205,175,149)#cdaf95 COLOR
peachpuff4(139,119,101)#8b7765 COLOR
peru(205,133,63)#cd853f COLOR
pigmentindigo(75,0,130)#4b0082 COLOR
pink(255,192,203)#ffc0cb COLOR
pink1(255,181,197)#ffb5c5 COLOR
pink2(238,169,184)#eea9b8 COLOR
pink3(205,145,158)#cd919e COLOR
pink4(139,99,108)#8b636c COLOR
plum(221,160,221)#dda0dd COLOR
plum1(255,187,255)#ffbbff COLOR
plum2(238,174,238)#eeaeee COLOR
plum3(205,150,205)#cd96cd COLOR
plum4(139,102,139)#8b668b COLOR
powderblue(176,224,230)#b0e0e6 COLOR
purple(160,32,240)#a020f0 COLOR
purple1(155,48,255)#9b30ff COLOR
purple2(145,44,238)#912cee COLOR
purple3(125,38,205)#7d26cd COLOR
purple4(85,26,139)#551a8b COLOR
red(255,0,0)#ff0000 COLOR
rosybrown(188,143,143)#bc8f8f COLOR
rosybrown1(255,193,193)#ffc1c1 COLOR
rosybrown2(238,180,180)#eeb4b4 COLOR
rosybrown3(205,155,155)#cd9b9b COLOR
rosybrown4(139,105,105)#8b6969 COLOR
royalblue(65,105,225)#4169e1 COLOR
royalblue1(72,118,255)#4876ff COLOR
royalblue2(67,110,238)#436eee COLOR
royalblue3(58,95,205)#3a5fcd COLOR
royalblue4(39,64,139)#27408b COLOR
saddlebrown(139,69,19)#8b4513 COLOR
salmon(250,128,114)#fa8072 COLOR
salmon1(255,140,105)#ff8c69 COLOR
salmon2(238,130,98)#ee8262 COLOR
salmon3(205,112,84)#cd7054 COLOR
salmon4(139,76,57)#8b4c39 COLOR
sandybrown(244,164,96)#f4a460 COLOR
seagreen(46,139,87)#2e8b57 COLOR
seagreen1(84,255,159)#54ff9f COLOR
seagreen2(78,238,148)#4eee94 COLOR
seagreen3(67,205,128)#43cd80 COLOR
seagreen4(46,139,87)#2e8b57 COLOR
seashell(255,245,238)#fff5ee COLOR
seashell1(255,245,238)#fff5ee COLOR
seashell2(238,229,222)#eee5de COLOR
seashell3(205,197,191)#cdc5bf COLOR
seashell4(139,134,130)#8b8682 COLOR
sienna(160,82,45)#a0522d COLOR
sienna1(255,130,71)#ff8247 COLOR
sienna2(238,121,66)#ee7942 COLOR
sienna3(205,104,57)#cd6839 COLOR
sienna4(139,71,38)#8b4726 COLOR
silver(192,192,192)#c0c0c0 COLOR
skyblue(135,206,235)#87ceeb COLOR
skyblue1(135,206,255)#87ceff COLOR
skyblue2(126,192,238)#7ec0ee COLOR
skyblue3(108,166,205)#6ca6cd COLOR
skyblue4(74,112,139)#4a708b COLOR
slateblue(106,90,205)#6a5acd COLOR
slateblue1(131,111,255)#836fff COLOR
slateblue2(122,103,238)#7a67ee COLOR
slateblue3(105,89,205)#6959cd COLOR
slateblue4(71,60,139)#473c8b COLOR
slategray(112,128,144)#708090 COLOR
slategray1(198,226,255)#c6e2ff COLOR
slategray2(185,211,238)#b9d3ee COLOR
slategray3(159,182,205)#9fb6cd COLOR
slategray4(108,123,139)#6c7b8b COLOR
snow1(255,250,250)#fffafa COLOR
snow2(238,233,233)#eee9e9 COLOR
snow3(205,201,201)#cdc9c9 COLOR
snow4(139,137,137)#8b8989 COLOR
springgreen(0,255,127)#00ff7f COLOR
springgreen1(0,255,127)#00ff7f COLOR
springgreen2(0,238,118)#00ee76 COLOR
springgreen3(0,205,102)#00cd66 COLOR
springgreen4(0,139,69)#008b45 COLOR
steelblue(70,130,180)#4682b4 COLOR
steelblue1(99,184,255)#63b8ff COLOR
steelblue2(92,172,238)#5cacee COLOR
steelblue3(79,148,205)#4f94cd COLOR
steelblue4(54,100,139)#36648b COLOR
tan(210,180,140)#d2b48c COLOR
tan1(255,165,79)#ffa54f COLOR
tan2(238,154,73)#ee9a49 COLOR
tan3(205,133,63)#cd853f COLOR
tan4(139,90,43)#8b5a2b COLOR
teal(0,128,128)#008080 COLOR
thistle(216,191,216)#d8bfd8 COLOR
thistle1(255,225,255)#ffe1ff COLOR
thistle2(238,210,238)#eed2ee COLOR
thistle3(205,181,205)#cdb5cd COLOR
thistle4(139,123,139)#8b7b8b COLOR
tomato(255,99,71)#ff6347 COLOR
tomato1(255,99,71)#ff6347 COLOR
tomato2(238,92,66)#ee5c42 COLOR
tomato3(205,79,57)#cd4f39 COLOR
tomato4(139,54,38)#8b3626 COLOR
turquoise(64,224,208)#40e0d0 COLOR
turquoise1(0,245,255)#00f5ff COLOR
turquoise2(0,229,238)#00e5ee COLOR
turquoise3(0,197,205)#00c5cd COLOR
turquoise4(0,134,139)#00868b COLOR
violet(238,130,238)#ee82ee COLOR
violetred(208,32,144)#d02090 COLOR
violetred1(255,62,150)#ff3e96 COLOR
violetred2(238,58,140)#ee3a8c COLOR
violetred3(205,50,120)#cd3278 COLOR
violetred4(139,34,82)#8b2252 COLOR
wheat(245,222,179)#f5deb3 COLOR
wheat1(255,231,186)#ffe7ba COLOR
wheat2(238,216,174)#eed8ae COLOR
wheat3(205,186,150)#cdba96 COLOR
wheat4(139,126,102)#8b7e66 COLOR
white(255,255,255)#ffffff COLOR
whitesmoke(245,245,245)#f5f5f5 COLOR
yellow(255,255,0)#ffff00 COLOR
yellow1(255,255,0)#ffff00 COLOR
yellow2(238,238,0)#eeee00 COLOR
yellow3(205,205,0)#cdcd00 COLOR
yellow4(139,139,0)#8b8b00 COLOR
yellowgreen(154,205,50)#9acd32 COLOR
+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ape.html b/includes/jpgraph/docs/chunkhtml/ape.html new file mode 100644 index 0000000..f09562a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ape.html @@ -0,0 +1,78 @@ +Appendix E. Available plot marks

Appendix E. Available plot marks

+ +

Plot marks can be added to almost all linear (cartesian) graph types. They are used to + emphasise the actual data points in the graph. The plot mark property is available as the + instance variable "$mark" for the plot types that support plot marks.

+

Built in basic plot marks

+ +

To embellishment a line plot with one of the built-in basic plot marks, say a a red + diamond mark, at each data point the following line has to be added to the graph + script

+

+

1
+2
+3
+4
+
<?php
+$lineplot->mark->SetType(MARK_DIAMOND);
+$lineplot->mark->SetFillColor('red');
+?>

+

+

The rest of the basic plot marks are handled analogues.

+

+

Table E.1. Built in line based plot marks

+ +
Displayed plot markSymbolic name
+

+
+

MARK_SQUARE

+
+

+
+

MARK_UTRIANGLE

+
+

+
+

MARK_DTRIANGLE

+
+

+
+

MARK_DIAMOND

+
+

+
+

MARK_CIRCLE

+
+

+
+

MARK_FILLEDCIRCLE

+
+

+
+

MARK_CROSS

+
+

+
+

MARK_STAR

+
+

+
+

MARK_X

+
+

+
+

MARK_LEFTTRIANGLE

+
+

+
+

MARK_RIGHTTRIANGLE

+
+

+
+

MARK_FLASH

+
+


+

+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/apes02.html b/includes/jpgraph/docs/chunkhtml/apes02.html new file mode 100644 index 0000000..07b0ad2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apes02.html @@ -0,0 +1,88 @@ +Built in image plot marks

Built in image plot marks

+ +

Since the image based plot marks only supports some colors (since there has to be a + unique image for each color) the following sections shows for each major image plot mark + what colors are available. The image shows the natural size of the plot mark, i.e. the + scale factor is =1. Only the round balls ar available natively in three different sizes. + Even though it is possible to scale up all the images arbitrarily it will cause the + images to become pixelated.

+

To use one of the built in image plot mark two parameters has to be given to the + SetType() method. The basic class of plot mark and the wanted color. + For example to use a green square as plot marks the following line would have to be + added

+

+

1
+2
+3
+
<?php
+$lineplot->mark->SetType(MARK_IMG_SQUARE,'green');
+?>

+

+

If a non-supported color is specified an error will be thrown.

+

Image plot mark: Balls

+ +

+

Figure E.1. Small size

+ +
Small size
+


+

+

+

Figure E.2. Medium size

+ +
Medium size
+


+

+

+

Figure E.3. Large size

+ +
Large size
+


+

+
+

Image plot mark: Squares

+ +

+

Figure E.4. Standard size

+ +
Standard size
+


+

+
+

Image plot mark: Diamonds

+ +

+

Figure E.5. Standard size

+ +
Standard size
+


+

+
+

Image plot mark: Stars

+ +

+

Figure E.6. Standard size

+ +
Standard size
+


+

+
+

Image plot mark: Bevels

+ +

+

Figure E.7. Standard size

+ +
Standard size
+


+

+
+

Image plot mark: Pushpins

+ +

+

Figure E.8. Standard size

+ +
Standard size
+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/apf.html b/includes/jpgraph/docs/chunkhtml/apf.html new file mode 100644 index 0000000..b767772 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apf.html @@ -0,0 +1,79 @@ +Appendix F. List of all country flags

Appendix F. List of all country flags

+ +

All country flags are included in a pre-compiled efficient format with the library. In + addition the flags can be scaled arbitrarily and used as either background images or as plot + marks. Flags are specified by either it's index or by the using the whole or a unique part + of the country name.

+

The list of all flags are in simple alphabetical order, i.e. by the full name including + governance prefix e.g. "Republic". The size of the flags in this table has been chosen as + FLAGSIZE2 +

+

Caution

+

The dynamics of world politics and geographic boundaries will no doubt make the list + of included countries obsolete almost at the same time the library is released. The + intention is that all currently known country and similar geographic entities should be + included. Any missing flags shall and can not be interpreted as any political stand it + is merely a consequence of political changes since the library was released or a + possible oversight or simply a mistake either human or algorithmically in how the + country flags are produced.

+
+

For more information on how to use country flags see Adding images and country flags to the background of the graph

+

It is also possible to easily create a flags for usage outside graphs. The following + script takes an index and flag core size as URL arguments and returns the chosen flag.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php
+require_once 'jpgraph.php';
+require_once 'jpgraph_flags.php';
+ 
+if( empty($_GET['size']) ) {
+    $size = FLAGSIZE1;
+}
+else {
+    $size = $_GET['size'];
+}
+ 
+if( empty($_GET['idx']) ) {
+    $idx = 'swdn';
+}
+else {
+    $idx = $_GET['idx'];
+}
+ 
+ 
+$flags = new FlagImages($size) ;
+$img = $flags->GetImgByIdx($idx);
+header ("Content-type: image/png");
+ImagePng ($img);
+?>

+

+

+

Table F.1. List of all country flags sorted by country name

+ +
Country nameShort nameIndexFlag
Afghanistan"afgh"0
Alderney"alde"3
Antarctica"anta"8
Arab Republic of Egypt"egyp"63
Argentine Republic"arge"9
Aruba"arub"12
Autonomous Region of Tibet"tibe"210
Azerbaijani Republic"azer"15
Bangladesh"bngl"16
Barbados"brbd"28
Belize"blze"24
Bolivarian Republic of Venezuela"venz"231
British Antarctic Territory"bant"17
British Indian Ocean Territory"brin"29
British Overseas Territory of Anguilla"angu"7
British Overseas Territory of Bermuda"berm"19
British Overseas Territory of Montserrat"mont"138
British Overseas Territory of the Cayman Islands"cyis"55
British Overseas Territory of the Falkland Islands"fais"71
British Overseas Territory of the Pitcairn Islands"piis"171
Brunei Darussalam"brun"30
Caribbean Community"cari"39
Central African Republic"cafr"35
Commonwealth"comn"49
Commonwealth of Australia"astl"13
Commonwealth of Dominica"domn"60
Commonwealth of Independent States"cins"45
Commonwealth of Puerto Rico"purc"174
Commonwealth of the Bahamas"bhms"20
Commonwealth of the Northern Mariana Islands"nmar"155
Cook Islands"ckis"46
Democratic Republic of Congo"zare"233
Democratic Socialist Republic of Sri Lanka"srla"196
Democratic and Popular Republic of Algeria"alge"4
Dominican Republic"dore"61
Dominion of Canada"cana"38
England"engl"65
Ethiopia"ethp"69
European Union"euun"70
Federal Republic of Germany"germ"81
Federal Republic of Nigeria"ngra"151
Federated States of Micronesia"micr"133
Federation of Malaysia"mals"126
Federative Republic of Brazil"braz"27
French Republic"fran"76
Gabonese Republic"gabn"78
Gibraltar"gibr"83
Grand Duchy of Luxembourg"luxe"120
Hashemite Kingdom of Jordan"jord"108
Hellenic Republic"grec"84
Hong Kong Special Administrative Region"hokn"92
Independent State of Papua New Guinea"pang"167
International Committee of the Red Cross"icrc"96
International Federation of Vexillological Associations"fiav"72
International Olympic Committee"olym"163
Islamic Republic of Mauritania"maur"130
Islamic Republic of Pakistan"paks"165
Isle of Man"isma"102
Italian Republic"ital"104
Jamaica"jama"105
Japan"japa"106
Kingdom of Bahrain"bhrn"21
Kingdom of Belgium"belg"18
Kingdom of Cambodia"camb"36
Kingdom of Denmark"denm"58
Kingdom of Lesotho"lest"116
Kingdom of Morocco"morc"139
Kingdom of Nepal"nepa"148
Kingdom of Norway"norw"158
Kingdom of Saudi Arabia"saar"179
Kingdom of Spain"span"194
Kingdom of Swaziland"szld"204
Kingdom of Sweden"swdn"201
Kingdom of Thailand"thal"209
Kingdom of Tonga"tong"214
Kingdom of the Netherlands"neth"149
Kyrgyz Republic"kyrg"113
League of Arab States"arle"10
Lebanese Republic"leba"115
Macao Special Administrative Region"maca"121
Midway Islands"miis"134
Netherlands Antilles"nean"147
New Zealand"nwze"160
Niue"niue"154
Nordic Council"nord"157
Nordic Sami Conference"sami"181
North Atlantic Treaty Organization"nato"144
Organization of African Unity"oaun"162
Organization of American States"oast"161
Organization of the Islamic Conference"isco"101
Oriental Republic of Uruguay"urgy"226
Overseas Department of French Guiana"frgu"77
Overseas Department of Guadeloupe"guad"86
Overseas Department of Martinique"mart"129
Overseas Territory of the British Virgin Islands"bvis"34
Peoples Republic of China"chin"43
Principality of Andorra"andr"6
Principality of Liechtenstein"liec"118
Principality of Monaco"mona"136
Principality of Seborga"sebo"184
Province of Northern Ireland"noir"156
Republic of Albania"alba"2
Republic of Angola"agla"1
Republic of Armenia"arme"11
Republic of Austria"aust"14
Republic of Belarus"blru"22
Republic of Benin"bnin"25
Republic of Bolivia"blva"23
Republic of Botswana"bots"26
Republic of Bulgaria"bulg"32
Republic of Burkina"bufa"31
Republic of Burundi"buru"33
Republic of Cameroon"came"37
Republic of Cape Verde"cave"40
Republic of Chad"chad"41
Republic of Chile"chil"42
Republic of China"taiw"205
Republic of Colombia"clmb"47
Republic of Costa Rica"corc"52
Republic of Croatia"croa"53
Republic of Cuba"cuba"54
Republic of Cyprus"cypr"56
Republic of Djibouti"djib"59
Republic of Ecuador"ecua"62
Republic of El Salvador"elsa"64
Republic of Equatorial Guinea"eqgu"66
Republic of Estonia"estn"68
Republic of Fiji"fiji"73
Republic of Finland"finl"74
Republic of Georgia"geor"80
Republic of Ghana"ghan"82
Republic of Guatemala"guat"88
Republic of Guinea"guin"90
Republic of Haiti"hait"91
Republic of Honduras"hond"93
Republic of Hungary"hung"94
Republic of Iceland"icel"95
Republic of India"inda"97
Republic of Indonesia"indn"98
Republic of Iraq"iraq"99
Republic of Ireland"irel"100
Republic of Kazakhstan"kazk"109
Republic of Kenya"keny"110
Republic of Kiribati"kirb"111
Republic of Korea"skor"188
Republic of Latvia"latv"114
Republic of Liberia"libe"117
Republic of Lithuania"lith"119
Republic of Macedonia"mace"122
Republic of Madagascar"mada"123
Republic of Malawi"malw"128
Republic of Mali"mali"125
Republic of Malta"malt"127
Republic of Mauritius"mrts"141
Republic of Moldova"mold"135
Republic of Mongolia"mong"137
Republic of Mozambique"moza"140
Republic of Namibia"namb"143
Republic of Nauru"naur"145
Republic of Nicaragua"nica"152
Republic of Niger"nigr"153
Republic of Palau"pala"166
Republic of Paraguay"para"168
Republic of Peru"peru"169
Republic of Poland"pola"172
Republic of Portugal"port"173
Republic of Rwanda"rwan"178
Republic of San Marino"sama"180
Republic of Serbia"serb"185
Republic of Sierra Leone"sile"186
Republic of Singapore"sing"187
Republic of Slovenia"slva"189
Republic of Somaliland"smld"191
Republic of South Africa"soaf"192
Republic of Suriname"surn"199
Republic of Tajikistan"tajk"207
Republic of Tunisia"tuns"217
Republic of Turkey"turk"218
Republic of Uganda"ugan"221
Republic of Uzbekistan"uzbk"228
Republic of Vanuatu"vant"230
Republic of Yemen"yemn"232
Republic of Zimbabwe"zbwe"234
Republic of the Congo"cong"51
Republic of the Gambia"gamb"79
Republic of the Marshall Islands"mais"124
Republic of the Philippines"phil"170
Republic of the Sudan"suda"198
Romania"rmna"177
Russian Federation"russ"176
Saint Lucia"stlu"197
Sark"sark"182
Scotland"scot"183
Secretariat of the Pacific Community"spco"195
Slovak Republic"svka"200
Solomon Islands"sois"193
Somali Republic"smla"190
State of Eritrea"erit"67
State of Grenada"gren"85
State of Israel"isra"103
State of Kuwait"kuwa"112
State of Qatar"qata"175
State of the Vatican City"vacy"229
Sultanate of Oman"oman"164
Swiss Confederation"swit"202
Syrian Arab Republic"syra"203
Taiwan"taiw"206
Territorial Collectivity of Mayotte"mayt"131
Territory of American Samoa"amsa"5
Territory of Christmas Island"chms"44
Territory of Cocos Islands"cois"48
Territory of French Polynesia"fpol"75
Territory of Guam"guam"87
Territory of New Caledonia and Dependencies"nwca"159
Territory of Norfolk Island"nfis"150
The Bailiwick of Guernsey"guer"89
The Bailiwick of Jersey"jers"107
The Czech Republic"czec"57
Togolese Republic"togo"212
Tokelau"toke"213
Tristan da Cunha"trdc"215
Tromelin"tris"216
Turkish Republic of Northern Cyprus"ncyp"146
Turkmenistan"tkst"211
Tuvalu"tuva"219
Ukraine"ukrn"222
Union of Myanmar"myan"142
Union of the Comoros"como"50
United Arab Emirates"uaem"220
United Kingdom of Great Britain"unkg"223
United Mexican States"mexc"132
United Nations"unna"224
United Republic of Tanzania"tanz"208
United States of America"unst"225
Virgin Islands of the United States"usvs"227
+


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/apg.html b/includes/jpgraph/docs/chunkhtml/apg.html new file mode 100644 index 0000000..4e911f9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apg.html @@ -0,0 +1,201 @@ +Appendix G. List of files included in the library

Appendix G. List of files included in the library

+ +

In the distribution these files are stored directly under the src directory in the + distribution.

+

In the pro-version of the library there are also two alternative directories which + contains variations of the core src directory. These additional + directories are:

+

+

stripped-src
+

These file are suitable to be deployed on a production server. No examples + or demo applications are included here and in addition all files have white + spaces and comments stripped which makes them significantly smaller and + hence reduce the load time of the files on a productions server.

+
phpExpress-src
+

These files are intended to be used with the PHP Accelerator from + NuSpehere. This accelerometer can be downloaded free of charge from NuSphere corporation. For a + production server this is the recommended installation since it + significantly reduces the load on the production server. See Chapter 11. NuSphere PHP accelerator for information on how to install + the freely available PHP Accelerator.

+

+

+

Table G.1. List of files included in the library

+ +
File nameOnly Pro Version Description
+ flags.dat + + Raw data for country flag in maximum size
+ flags_thumb100x100.dat + + Raw data for country flag in size 100x100
+ flags_thumb35x35.dat + + Raw data for country flag in size 35x35
+ flags_thumb60x60.dat + + Raw data for country flag in size 60x60
+ gd_image.inc.php + + Interface classes to the low level GD library
+ imgdata_balls.inc.php + + Stored image data for marker images
+ imgdata_bevels.inc.php + + Stored image data for marker images
+ imgdata_diamonds.inc.php + + Stored image data for marker images
+ imgdata_pushpins.inc.php + + Stored image data for marker images
+ imgdata_squares.inc.php + + Stored image data for marker images
+ imgdata_stars.inc.php + + Stored image data for marker images
+ jpg-config.inc.php + + Configuration file for the library
+ jpgraph_antispam-digits.php + + Image data for CAPTCHA digits
+ jpgraph_antispam.php + + Extension module: CAPTCHA figures
+ jpgraph_bar.php + + Extension module: Bargraphs
+ jpgraph_canvas.php + + Extension module: Canvas graphs
+ jpgraph_canvtools.php + + Extension module: Tools for canvas graphs
+ jpgraph_date.php + + Extension module: Date scale handling
+ jpgraph_errhandler.inc.php + + Core module: Error handler
+ jpgraph_error.php + + Extension module: Error plots
+ jpgraph_flags.php + + Extension module: Country flags
+ jpgraph_gantt.php + + Extension module: Gantt chart
+ jpgraph_gb2312.php + + Extension module: GB2312 (Chinese) encoding
+ jpgraph_gradient.php + + Extension module: Gradient fill
+ jpgraph_iconplot.php + + Extension module: Icon images in plots
+ jpgraph_imgtrans.php + + Extension module: Image transformation
+ jpgraph_led.php + + Extension module: LED digits/numbers
+ jpgraph_legend.inc.php + + Core module: Legend handling
+ jpgraph_line.php + + Extension module: Line plot
+ jpgraph_log.php + + Extension module: Log scale
+ jpgraph_mgraph.php + + Extension module: Multigraph canvas
+ jpgraph.php + + Core module: JpGraph core module
+ jpgraph_pie3d.php + + Extension module: 3D Pie plot
+ jpgraph_pie.php + + Extension module: 2D Pie plot
+ jpgraph_plotband.php + + Extension module: Plot bands (filled areas in graphs)
+ jpgraph_plotmark.inc.php + + Extension module: Plotmark for line plots
+ jpgraph_polar.php + + Extension module: Polar plots
+ jpgraph_radar.php + + Extension module:: Radar plot
+ jpgraph_regstat.php + + Extension module: Spline and Bezier curves
+ jpgraph_rgb.inc.php + + Core module: Color handling
+ jpgraph_scatter.php + + Extension module:: Scatter plot
+ jpgraph_stock.php + + Extension module:: Stock charts
+ jpgraph_text.inc.php + + Core module: Text handling
+ jpgraph_ttf.inc.php + + Core module: TTF font handling
+ jpgraph_utils.inc.php + + Extension module:: Various utility classes
+ jpgraph_layout_vh.inc.php + + Extension utility: classes for automatic layout classes
+ jpgraph_odo.php + *Extension module: Odometer plot
+ jpgraph_windrose.php + *Extension module:: Windrose plots
+ jpgraph_table.php + *Extension module:: Graphic tables
+ jpgraph_barcode.php + *Extension module: 1D Barcodes
+ jpgraph_matrix.php + *Extension module: Matrix plots
+

+

In addition to the files above the distribution contains the following directories

+

Table G.2. List of subdirectories in main src directory

+ +
DirectoryOnly Pro VersionDescription
+ Examples + + JpGraph Example directory
+ lang + + Localized error messages
+ barcode + *1D Barcodes
+ datamatrix + *2D Barcode Datamatrix directory
+ pdf417 + *2D Barcode PDF417 directory
+ QR + *2D Barcode QR (Quick response) directory
+ table_examples + *Table examples
+ windrose_examples + *Windrose examples
+ odometer_examples + *Odometer examples
+ matrix_examples + *Matrix plot examples
+

+
diff --git a/includes/jpgraph/docs/chunkhtml/aph.html b/includes/jpgraph/docs/chunkhtml/aph.html new file mode 100644 index 0000000..937e9b6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/aph.html @@ -0,0 +1,22 @@ +Appendix H. Error messages

Appendix H. Error messages

+ +

This list have all error messages that can be thrown by the library. In addition to the + English locale there is also a German translation (See Localizing error messages). Most error messages takes one (or several + argument that gives additional specific information and the placeholder in the error + messages shows where this additional information should be placed.

+

For more general information on error handling we refer to Chapter 6. Error handling

+ +

Core error messages

+ +

The following tables lists all error messages that can be generated by standard core + graphs types

+

+

Table H.1. English error messages

+ +
Error code Error message
10<table border="1"><tr><td style="color:darkred; font-size:1.2em;"><b>JpGraph Error:</b> +HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at line <b>%d</b>.</td></tr><tr><td><b>Explanation:</b><br>HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).<p>Most likely you have some text in your script before the call to <i>Graph::Stroke()</i>. If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser. <p>For example it is a common mistake to leave a blank line before the opening "<b>&lt;?php</b>".</td></tr></table>
11No path specified for CACHE_DIR. Please specify CACHE_DIR manually in jpg-config.inc
12No path specified for TTF_DIR and path can not be determined automatically. Please specify TTF_DIR manually (in jpg-config.inc).
13The installed PHP version (%s) is not compatible with this release of the library. The library requires at least PHP version %s
1001Unknown encoder specification: %s
1002Data validation failed. Can't encode [%s] using encoding "%s"
1003Internal encoding error. Trying to encode %s is not possible in Code 128
1004Internal barcode error. Unknown UPC-E encoding type: %s
1005Internal error. Can't encode character tuple (%s, %s) in Code-128 charset C
1006Internal encoding error for CODE 128. Trying to encode control character in CHARSET != A
1007Internal encoding error for CODE 128. Trying to encode DEL in CHARSET != B
1008Internal encoding error for CODE 128. Trying to encode small letters in CHARSET != B
1009Encoding using CODE 93 is not yet supported.
1010Encoding using POSTNET is not yet supported.
1011Non supported barcode backend for type %s
2001Number of colors is not the same as the number of patterns in BarPlot::SetPattern()
2002Unknown pattern specified in call to BarPlot::SetPattern()
2003Number of X and Y points are not equal. Number of X-points: %d Number of Y-points: %d
2004All values for a barplot must be numeric. You have specified value nr [%d] == %s
2005You have specified an empty array for shadow colors in the bar plot.
2006Unknown position for values on bars : %s
2007Cannot create GroupBarPlot from empty plot array.
2008Group bar plot element nbr %d is undefined or empty.
2009One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the GroupBar plot from an array of BarPlot or AccBarPlot objects. (Class = %s)
2010Cannot create AccBarPlot from empty plot array.
2011Acc bar plot element nbr %d is undefined or empty.
2012One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects. (Class=%s)
2013You have specified an empty array for shadow colors in the bar plot.
2014Number of datapoints for each data set in accbarplot must be the same
2015Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates
3001It is only possible to use either SetDateAlign() or SetTimeAlign() but not both
4002Error in input data to LineErrorPlot. Number of data points must be a multiple of 3
5001Unknown flag size (%d).
5002Flag index %s does not exist.
5003Invalid ordinal number (%d) specified for flag index.
5004The (partial) country name %s does not have a corresponding flag image. The flag may still exist but under another name, e.g. instead of "usa" try "united states".
6001Internal error. Height for ActivityTitles is < 0
6002You can't specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension.
6003Invalid format for Constrain parameter at index=%d in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)
6004Invalid format for Progress parameter at index=%d in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)
6005SetScale() is not meaningful with Gantt charts.
6006Cannot autoscale Gantt chart. No dated activities exist. [GetBarMinMax() start >= n]
6007Sanity check for automatic Gantt chart size failed. Either the width (=%d) or height (=%d) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.
6008You have specified a constrain from row=%d to row=%d which does not have any activity
6009Unknown constrain type specified from row=%d to row=%d
6010Illegal icon index for Gantt builtin icon [%d]
6011Argument to IconImage must be string or integer
6012Unknown type in Gantt object title specification
6015Illegal vertical position %d
6016Date string (%s) specified for Gantt activity can not be interpretated. Please make sure it is a valid time string, e.g. 2005-04-23 13:30
6017Unknown date format in GanttScale (%s).
6018Interval for minutes must divide the hour evenly, e.g. 1,5,10,12,15,20,30 etc You have specified an interval of %d minutes.
6019The available width (%d) for minutes are to small for this scale to be displayed. Please use auto-sizing or increase the width of the graph.
6020Interval for hours must divide the day evenly, e.g. 0:30, 1:00, 1:30, 4:00 etc. You have specified an interval of %d
6021Unknown formatting style for week.
6022Gantt scale has not been specified.
6023If you display both hour and minutes the hour interval must be 1 (Otherwise it doesn't make sense to display minutes).
6024CSIM Target must be specified as a string. Start of target is: %d
6025CSIM Alt text must be specified as a string. Start of alt text is: %d
6027Progress value must in range [0, 1]
6028Specified height (%d) for gantt bar is out of range.
6029Offset for vertical line must be in range [0,1]
6030Unknown arrow direction for link.
6031Unknown arrow type for link.
6032Internal error: Unknown path type (=%d) specified for link.
6033Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)
7001Unknown gradient style (=%d).
8001Mix value for icon must be between 0 and 100.
8002Anchor position for icons must be one of "top", "bottom", "left", "right" or "center"
8003It is not possible to specify both an image file and a country flag for the same icon.
8004In order to use Country flags as icons you must include the "jpgraph_flags.php" file.
9001Value for image transformation out of bounds. Vanishing point on horizon must be specified as a value between 0 and 1.
10001LinePlot::SetFilled() is deprecated. Use SetFillColor()
10002Plot too complicated for fast line Stroke. Use standard Stroke()
10003Each plot in an accumulated lineplot must have the same number of data points.
11001Your data contains non-numeric values.
11002Negative data values can not be used in a log scale.
11003Your data contains non-numeric values.
11004Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.
11005Specifying tick interval for a logarithmic scale is undefined. Remove any calls to SetTextLabelStart() or SetTextTickInterval() on the logarithmic scale.
12001You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x it is necessary to enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.
12002Incorrect file name for MGraph::SetBackgroundImage() : %s Must have a valid image extension (jpg,gif,png) when using auto detection of image type
12003Unknown file extension (%s) in MGraph::SetBackgroundImage() for filename: %s
12004The image format of your background image (%s) is not supported in your system configuration.
12005Can't read background image: %s
12006Illegal sizes specified for width or height when creating an image, (width=%d, height=%d)
12007Argument to MGraph::Add() is not a valid GD image handle.
12008Your PHP (and GD-lib) installation does not appear to support any known graphic formats.
12009Your PHP installation does not support the chosen graphic format: %s
12010Can't create or stream image to file %s Check that PHP has enough permission to write a file to the current directory.
12011Can't create truecolor image. Check that you really have GD2 library installed.
12012Can't create image. Check that you really have GD2 library installed.
13001Unknown needle style (%d).
13002Value for odometer (%f) is outside specified scale [%f,%f]
14001Pie3D::ShowBorder() . Deprecated function. Use Pie3D::SetEdge() to control the edges around slices.
14002PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees.
14003Internal assertion failed. Pie3D::Pie3DSlice
14004Slice start angle must be between 0 and 360 degrees.
14005Pie3D Internal error: Trying to wrap twice when looking for start index
14006Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking.
14007Width for 3D Pie is 0. Specify a size > 0
15001PiePLot::SetTheme() Unknown theme: %s
15002Argument to PiePlot::ExplodeSlice() must be an integer
15003Argument to PiePlot::Explode() must be an array with integer distances.
15004Slice start angle must be between 0 and 360 degrees.
15005PiePlot::SetFont() is deprecated. Use PiePlot->value->SetFont() instead.
15006PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]
15007PiePlot::SetFontColor() is deprecated. Use PiePlot->value->SetColor() instead.
15008PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not %d).
15009Illegal pie plot. Sum of all data is zero for Pie Plot
15010Sum of all data is 0 for Pie.
15011In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.
15012PiePlot::SetTheme() is no longer recommended. Use PieGraph::SetTheme()
16001Density for pattern must be between 1 and 100. (You tried %f)
16002No positions specified for pattern.
16003Unknown pattern specification (%d)
16004Min value for plotband is larger than specified max value. Please correct.
17001Polar plots must have an even number of data point. Each data point is a tuple (angle,radius).
17002Unknown alignment specified for X-axis title. (%s)
17004Unknown scale type for polar graph. Must be "lin" or "log"
18001Client side image maps not supported for RadarPlots.
18002RadarGraph::SupressTickMarks() is deprecated. Use HideTickMarks() instead.
18003Illegal scale for radarplot (%s). Must be 'lin' or 'log'
18004Radar Plot size must be between 0.1 and 1. (Your value=%f)
18005RadarPlot Unsupported Tick density: %d
18006Minimum data %f (Radar plots should only be used when all data points > 0)
18007Number of titles does not match number of points in plot.
18008Each radar plot must have the same number of data points.
19001Spline: Number of X and Y coordinates must be the same
19002Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.
19003Bezier: Number of X and Y coordinates must be the same
20001Fieldplots must have equal number of X and Y points.
20002Fieldplots must have an angle specified for each X and Y points.
20003Scatterplot must have equal number of X and Y points.
21001Data values for Stock charts must contain an even multiple of %d data points.
22001Total percentage for all windrose legs in a windrose plot can not exceed 100%% !\n(Current max is: %d)
22002Graph is too small to have a scale. Please make the graph larger.
22004Label specification for windrose directions must have 16 values (one for each compass direction).
22005Line style for radial lines must be on of ("solid","dotted","dashed","longdashed")
22006Illegal windrose type specified.
22007To few values for the range legend.
22008Internal error: Trying to plot free Windrose even though type is not a free windrose
22009You have specified the same direction twice, once with an angle and once with a compass direction (%f degrees)
22010Direction must either be a numeric value or one of the 16 compass directions
22011Windrose index must be numeric or direction label. You have specified index=%d
22012Windrose radial axis specification contains a direction which is not enabled.
22013You have specified the look&feel for the same compass direction twice, once with text and once with index (Index=%d)
22014Index for compass direction must be between 0 and 15.
22015You have specified an undefined Windrose plot type.
22016Windrose leg index must be numeric or direction label.
22017Windrose data contains a direction which is not enabled. Please adjust what labels are displayed.
22018You have specified data for the same compass direction twice, once with text and once with index (Index=%d)
22019Index for direction must be between 0 and 15. You can't specify angles for a Regular Windplot, only index and compass directions.
22020Windrose plot is too large to fit the specified Graph size. Please use WindrosePlot::SetSize() to make the plot smaller or increase the size of the Graph in the initial WindroseGraph() call.
22021It is only possible to add Text, IconPlot or WindrosePlot to a Windrose Graph
23001This marker "%s" does not exist in color with index: %d
23002Mark color index too large for marker "%s"
23003A filename must be specified if you set the mark type to MARK_IMG.
24001FuncGenerator : No function specified.
24002FuncGenerator : Syntax error in function specification
24003DateScaleUtils: Unknown tick type specified in call to GetTicks()
24004ReadCSV2: Column count mismatch in %s line %d
25001This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)
25002Your PHP installation does not seem to have the required GD library. Please see the PHP documentation on how to install and enable the GD library.
25003General PHP error : At %s:%d : %s
25004General PHP error : %s
25005Can't access PHP_SELF, PHP global variable. You can't run PHP from command line if you want to use the 'auto' naming of cache or image files.
25006Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).
25007You are trying to use the locale (%s) which your PHP installation does not support. Hint: Use '' to indicate the default locale for this geographic region.
25008Image width/height argument in Graph::Graph() must be numeric
25009You must specify what scale to use with a call to Graph::SetScale()
25010Graph::Add() You tried to add a null plot to the graph.
25011Graph::AddY2() You tried to add a null plot to the graph.
25012Graph::AddYN() You tried to add a null plot to the graph.
25013You can only add standard plots to multiple Y-axis
25014Graph::AddText() You tried to add a null text to the graph.
25015Graph::AddLine() You tried to add a null line to the graph.
25016Graph::AddBand() You tried to add a null band to the graph.
25017You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x it is necessary to enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.
25018Incorrect file name for Graph::SetBackgroundImage() : "%s" Must have a valid image extension (jpg,gif,png) when using auto detection of image type
25019Unknown file extension (%s) in Graph::SetBackgroundImage() for filename: "%s"
25020Graph::SetScale(): Specified Max value must be larger than the specified Min value.
25021Unknown scale specification for Y-scale. (%s)
25022Unknown scale specification for X-scale. (%s)
25023Unsupported Y2 axis type: "%s" Must be one of (lin,log,int)
25024Unsupported Y axis type: "%s" Must be one of (lin,log,int)
25025Unsupported Tick density: %d
25026Can't draw unspecified Y-scale. You have either: 1. Specified an Y axis for auto scaling but have not supplied any plots. 2. Specified a scale manually but have forgot to specify the tick steps
25027Can't open cached CSIM "%s" for reading.
25028Apache/PHP does not have permission to write to the CSIM cache directory (%s). Check permissions.
25029Can't write CSIM "%s" for writing. Check free space and permissions.
25030Missing script name in call to StrokeCSIM(). You must specify the name of the actual image script as the first parameter to StrokeCSIM().
25031You must specify what scale to use with a call to Graph::SetScale().
25032No plots for Y-axis nbr:%d
25033 
25034Can't draw unspecified X-scale. No plots specified.
25035You have enabled clipping. Clipping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (=%d degrees) or disable clipping.
25036Unknown AxisStyle() : %s
25037The image format of your background image (%s) is not supported in your system configuration.
25038Background image seems to be of different type (has different file extension) than specified imagetype. Specified: %s File: %s
25039Can't read background image: "%s"
25040It is not possible to specify both a background image and a background country flag.
25041In order to use Country flags as backgrounds you must include the "jpgraph_flags.php" file.
25042Unknown background image layout
25043Unknown title background style.
25044Cannot use auto scaling since it is impossible to determine a valid min/max value of the Y-axis (only null values).
25045Font families FF_HANDWRT and FF_BOOK are no longer available due to copyright problem with these fonts. Fonts can no longer be distributed with JpGraph. Please download fonts from http://corefonts.sourceforge.net/
25046Specified TTF font family (id=%d) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/
25047Style %s is not available for font family %s
25048Unknown font style specification [%s].
25049Font file "%s" is not readable or does not exist.
25050First argument to Text::Text() must be a string.
25051Invalid direction specified for text.
25052PANIC: Internal error in SuperScript::Stroke(). Unknown vertical alignment for text
25053PANIC: Internal error in SuperScript::Stroke(). Unknown horizontal alignment for text
25054Internal error: Unknown grid axis %s
25055Axis::SetTickDirection() is deprecated. Use Axis::SetTickSide() instead
25056SetTickLabelMargin() is deprecated. Use Axis::SetLabelMargin() instead.
25057SetTextTicks() is deprecated. Use SetTextTickInterval() instead.
25058Text label interval must be specified >= 1.
25059SetLabelPos() is deprecated. Use Axis::SetLabelSide() instead.
25060Unknown alignment specified for X-axis title. (%s)
25061Unknown alignment specified for Y-axis title. (%s)
25062Labels at an angle are not supported on Y-axis
25063Ticks::SetPrecision() is deprecated. Use Ticks::SetLabelFormat() (or Ticks::SetFormatCallback()) instead
25064Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem
25065Tick positions must be specified as an array()
25066When manually specifying tick positions and labels the number of labels must be the same as the number of specified ticks.
25067Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tick marks.
25068A plot has an illegal scale. This could for example be that you are trying to use text auto scaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only '-' or 'x')
25069Grace must be larger then 0
25070Either X or Y data arrays contains non-numeric values. Check that the data is really specified as numeric data and not as strings. It is an error to specify data for example as '-2345.2' (using quotes).
25071You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.
25072You have specified a max value with SetAutoMax() which is smaller than the minimum value used for the scale. This is not possible.
25073Internal error. Integer scale algorithm comparison out of bound (r=%f)
25074Internal error. The scale range is negative (%f) [for %s scale] This problem could potentially be caused by trying to use \"illegal\" values in the input data arrays (like trying to send in strings or only NULL values) which causes the auto scaling to fail.
25075Can't automatically determine ticks since min==max.
25077Adjustment factor for color must be > 0
25078Unknown color: %s
25079Unknown color specification: %s, size=%d
25080Alpha parameter for color must be between 0.0 and 1.0
25081Selected graphic format is either not supported or unknown [%s]
25082Illegal sizes specified for width or height when creating an image, (width=%d, height=%d)
25083Illegal image size when copying image. Size for copied to image is 1 pixel or less.
25084Failed to create temporary GD canvas. Possible Out of memory problem.
25085An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.
25086You only seem to have GD 1.x installed. To enable Alphablending requires GD 2.x or higher. Please install GD or make sure the constant USE_GD2 is specified correctly to reflect your installation. By default it tries to auto detect what version of GD you have installed. On some very rare occasions it may falsely detect GD2 where only GD1 is installed. You must then set USE_GD2 to false.
25087This PHP build has not been configured with TTF support. You need to recompile your PHP installation with FreeType support.
25088You have a misconfigured GD font support. The call to imagefontwidth() fails.
25089You have a misconfigured GD font support. The call to imagefontheight() fails.
25090Unknown direction specified in call to StrokeBoxedText() [%s]
25091Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead.
25092There is either a configuration problem with TrueType or a problem reading font file "%s" Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try upgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library.
25093Can not read font file "%s" in call to Image::GetBBoxTTF. Please make sure that you have set a font before calling this method and that the font is installed in the TTF directory.
25094Direction for text most be given as an angle between 0 and 90.
25095Unknown font font family specification.
25096Can't allocate any more colors in palette image. Image has already allocated maximum of %d colors and the palette is now full. Change to a truecolor image instead
25097Color specified as empty string in PushColor().
25098Negative Color stack index. Unmatched call to PopColor()
25099Parameters for brightness and Contrast out of range [-1,1]
25100Problem with color palette and your GD setup. Please disable anti-aliasing or use GD2 with true-color. If you have GD2 library installed please make sure that you have set the USE_GD2 constant to true and truecolor is enabled.
25101Illegal numeric argument to SetLineStyle(): (%d)
25102Illegal string argument to SetLineStyle(): %s
25103Illegal argument to SetLineStyle %s
25104Unknown line style: %s
25105NULL data specified for a filled polygon. Check that your data is not NULL.
25106Image::FillToBorder : Can not allocate more colors
25107Can't write to file "%s". Check that the process running PHP has enough permission.
25108Can't stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP.
25109Your PHP (and GD-lib) installation does not appear to support any known graphic formats. You need to first make sure GD is compiled as a module to PHP. If you also want to use JPEG images you must get the JPEG library. Please see the PHP docs for details.
25110Your PHP installation does not support the chosen graphic format: %s
25111Can't delete cached image %s. Permission problem?
25112Cached imagefile (%s) has file date in the future.
25113Can't delete cached image "%s". Permission problem?
25114PHP has not enough permissions to write to the cache file "%s". Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.
25115Can't set permission for cached image "%s". Permission problem?
25116Cant open file from cache "%s"
25117Can't open cached image "%s" for reading.
25118Can't create directory "%s". Make sure PHP has write permission to this directory.
25119Can't set permissions for "%s". Permission problems?
25120Position for legend must be given as percentage in range 0-1
25121Empty input data array specified for plot. Must have at least one data point.
25122Stroke() must be implemented by concrete subclass to class Plot
25123You can't use a text X-scale with specified X-coords. Use a "int" or "lin" scale instead.
25124The input data array must have consecutive values from position 0 and forward. The given y-array starts with empty values (NULL)
25125Illegal direction for static line
25126Can't create truecolor image. Check that the GD2 library is properly setup with PHP.
25127The library has been configured for automatic encoding conversion of Japanese fonts. This requires that PHP has the mb_convert_encoding() function. Your PHP installation lacks this function (PHP needs the "--enable-mbstring" when compiled).
25128The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.
25129Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines.
25130Too small plot area. (%d x %d). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.
25131StrokeBoxedText2() only supports TTF fonts and not built-in bitmap fonts.
25500Multibyte strings must be enabled in the PHP installation in order to run the LED module so that the function mb_strlen() is available. See PHP documentation for more information.
26000PDF417: The PDF417 module requires that the PHP installation must support the function bcmod(). This is normally enabled at compile time. See documentation for more information.
26001PDF417: Number of Columns must be >= 1 and <= 30
26002PDF417: Error level must be between 0 and 8
26003PDF417: Invalid format for input data to encode with PDF417
26004PDF417: Can't encode given data with error level %d and %d columns since it results in too many symbols or more than 90 rows.
26005PDF417: Can't open file "%s" for writing
26006PDF417: Internal error. Data files for PDF417 cluster %d is corrupted.
26007PDF417: Internal error. GetPattern: Illegal Code Value = %d (row=%d)
26008PDF417: Internal error. Mode not found in mode list!! mode=%d
26009PDF417: Encode error: Illegal character. Can't encode character with ASCII code=%d
26010PDF417: Internal error: No input data in decode.
26011PDF417: Encoding error. Can't use numeric encoding on non-numeric data.
26012PDF417: Internal error. No input data to decode for Binary compressor.
26013PDF417: Internal error. Checksum error. Coefficient tables corrupted.
26014PDF417: Internal error. No data to calculate codewords on.
26015PDF417: Internal error. State transition table entry 0 is NULL. Entry 1 = (%s)
26016PDF417: Internal error: Unrecognized state transition mode in decode.
27001GTextTable: Invalid argument to Set(). Array argument must be 2 dimensional
27002GTextTable: Invalid argument to Set()
27003GTextTable: Wrong number of arguments to GTextTable::SetColor()
27004GTextTable: Specified cell range to be merged is not valid.
27005GTextTable: Cannot merge already merged cells in the range: (%d,%d) to (%d,%d)
27006GTextTable: Column argument = %d is outside specified table size.
27007GTextTable: Row argument = %d is outside specified table size.
27008GTextTable: Column and row size arrays must match the dimensions of the table
27009GTextTable: Number of table columns or rows are 0. Make sure Init() or Set() is called.
27010GTextTable: No alignment specified in call to SetAlign()
27011GTextTable: Unknown alignment specified in SetAlign(). Horizontal=%s, Vertical=%s
27012GTextTable: Internal error. Invalid alignment specified =%s
27013GTextTable: Argument to FormatNumber() must be a string.
27014GTextTable: Table is not initilaized with either a call to Set() or Init()
27015GTextTable: Cell image constrain type must be TIMG_WIDTH or TIMG_HEIGHT
28001Third argument to Contour must be an array of colors.
28002Number of colors must equal the number of isobar lines specified
28003ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)
28004ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)
28005ContourPlot Internal Error: isobarVCrossing: Row index too large (%d)
28006ContourPlot Internal Error: isobarVCrossing: Col index too large (%d)
28007ContourPlot interpolation factor is too large (>5)
29201Min range value must be less or equal to max range value for colormaps
29202The distance between min and max value is too small for numerical precision
29203Number of color quantification level must be at least %d
29204Number of colors (%d) is invalid for this colormap. It must be a number that can be written as: %d + k*%d
29205Colormap specification out of range. Must be an integer in range [0,%d]
29206Invalid object added to MatrixGraph
29207Empty input data specified for MatrixPlot
29208Unknown side specifiction for matrix labels "%s"
29209CSIM Target matrix must be the same size as the data matrix (csim=%d x %d, data=%d x %d)
29210CSIM Target for matrix labels does not match the number of labels (csim=%d, labels=%d)
+


+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/aphs02.html b/includes/jpgraph/docs/chunkhtml/aphs02.html new file mode 100644 index 0000000..186adee --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/aphs02.html @@ -0,0 +1,203 @@ +QR 2D Barcode error messages

QR 2D Barcode error messages

+ +

+

Note

+

These error messages are not yet localized

+

+

+

+

Table H.2. English error messages

+ +
Error code Error message
+ 1000 + Tilde processing is not yet supported for QR + Barcodes.
+ 1001 + Inverting the bit pattern is not supported + for QR Barcodes.
+ 1002 + Cannot read data from file %s
+ 1003 + Cannot open file %s
+ 1004 + Cannot write QR barcode to file %s
+ 1005 + Unsupported image format selected. Check + your GD installation
+ 1006 + Cannot set the selected barcode colors. + Check your GD installation and spelling of color + name
+ 1007 + +

+ JpGraph Error: HTTP headers have + already been sent. +

+

Caused by output from file %s at line %d.

+

Explanation: HTTP headers have already been sent back + to the browser indicating the data as text before the + library got a chance to send it's image HTTP header to + this browser.

+

This makes it impossible for the library to send back + image data to the browser (since that would be + interpreted as text by the browser and show up as junk + text). Most likely you have some text in your script + before the call to Graph::Stroke(). If this texts gets + sent back to the browser the browser will assume that + all data is plain text. Look for any text, even spaces + and newlines, that might have been sent back to the + browser. For example it is a common mistake to leave a + blank line before the opening

+
+ 1008 + Could not create the barcode image with + image format=%s. Check your GD/PHP installation.
+ 1009 + Cannot open log file %s for writing.
+ 1010 + Cannot write log info to log file + %s.
+ 1100 + Internal error: Illegal mask pattern + selected
+ 1101 + Internal error: Trying to apply masking to + functional pattern.
+ 1102 + Internal error: applyMaskAndEval(): Found + uninitialized module in matrix when applying mask + pattern.
+ 1200 + Internal error: Was expecting %d bits in + version %d to be placed in matrix but got %d bits
+ 1201 + Internal error: Trying to position bit + outside the matrix x=%d, y=%d, size=%d, bIdx=%d
+ 1202 + Internal error: Trying to put data in + initialized bit.
+ 1203 + Internal error: Mask number for format bits + is invalid. (maskidx=%d)
+ 1204 + Internal error: Found an uninitialized bit + [val=%d] at (%d,%d) when flattening matrix
+ 1300 + Internal error: QRCapacity::getFormatBits() + Was expecting a format in range [0,31] got %d
+ 1301 + Internal error: QRCapacity::getVersionBits() + Was expecting a version in range [7,40] got %d
+ 1302 + Internal error: QRCapacity::_chkVerErr() Was + expecting version in range [1,40] and error level in range + [0,3] got (%d,%d)
+ 1303 + Internal error: + QRCapacity::getAlignmentPositions() Expected %d patterns but + found %d patterns (len=%d).
+ 1304 + Internal error: QRCapacity::%s Was expecting + a version in range [1,40] got %d
+ 1400 + QR Version must be specified as a value in + the range [1,40] got %d
+ 1401 + Input data to barcode can not be + empty.
+ 1402 + Automatic encodation mode was specified but + input data looks like specification for manual + encodation.
+ 1403 + Was expecting an array of arrays as input + data for manual encoding.
+ 1404 + Each input data array element must consist + of two entries. Element $i has of $nn entries
+ 1405 + Each input data array element must consist + of two entries with first entry being the encodation + constant and the second element the data string. Element %d + is incorrect in this respect.
+ 1406 + Was expecting either a string or an array as + input data
+ 1407 + Manual encodation mode was specified but + input data looks like specification for automatic + encodation.
+ 1408 + Input data too large to fit into one QR + Symbol
+ 1409 + The selected symbol version %d is too small + to fit the specified data and selected error correction + level.
+ 1410 + Trying to read past the last available + codeword in block split.
+ 1411 + Internal error: Expected 1 or 2 as the + number of block structures.
+ 1412 + Internal error: Too many codewords for + chosen symbol version. (negative number of pad + codewords).
+ 1413 + Internal error: splitInBytes: Expected an + even number of 8-bit blocks.
+ 1414 + Internal error: getCountBits() illegal + version number (=%d).
+ 1415 + Manually specified encodation schema + MODE_NUMERIC has no data that can be encoded using this + schema.
+ 1416 + Manually specified encodation schema + MODE_ALPHANUM has no data that can be encoded using this + schema.
+ 1417 + Manually specified encodation schema + MODE_BYTE has no data that can be encoded using this + schema.
+ 1418 + Unsupported encodation schema specified + (%d)
+ 1419 + Found character in data stream that cannot + be encoded with the selected manual encodation mode.
+ 1420 + Encodation using KANJI mode not yet + supported.
+ 1421 + Internal error: Unsupported encodation mode + doAuto().
+ 1422 + Found unknown characters in the data stream + that can't be encoded with any available encodation + mode.
+ 1423 + Kanji character set not yet + supported.
+ 1424 + Internal error: DataStorage:: Unsupported + character mode (%d) DataStorage::Remaining()
+ 1425 + Internal error: DataStorage:: Trying to + extract slice of len=%d (with type=%d) when there are only + %d elements left
+ 1426 + Internal error: DataStorage:: Trying to read + past input data length.
+ 1427 + Expected either DIGIT, ALNUM or BYTE but + found ASCII code=%d
+ 1428 + Internal error: DataStorage::Peek() Trying + to peek past input data length.
+


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/aphs03.html b/includes/jpgraph/docs/chunkhtml/aphs03.html new file mode 100644 index 0000000..e993678 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/aphs03.html @@ -0,0 +1,121 @@ +Datamatrix 2D barcode error messages

Datamatrix 2D barcode error messages

+ +

+

Note

+

These error messages are not yet localized

+

+

+

+

Table H.3. English error messages

+ +
Error code Error message
+ 1 + Data is too long to fit specified symbol + size
+ 2 + The BASE256 data is too long to fit + available symbol size
+ 3 + Data must have at least three characters for + C40 encodation
+ 4 + Data must have at least three characters for + TEXT encodation
+ 5 + Internal error: (-5) Trying to read source + data past the end
+ 6 + Internal error: (-6) Trying to look ahead in + data past the end
+ 7 + Internal error: (-7) Logic error in TEXT/C40 + encodation (impossible branch)
+ 8 + The given data can not be encoded using X12 + encodation.
+ 9 + The "tilde" encoded data is not + valid.
+ 10 + Data must have at least three characters for + X12 encodation
+ 11 + Specified data can not be encoded with + datamatrix 000 140
+ 12 + Can not create image
+ 13 + Invalid color specification
+ 14 + Internal error: (-14) Index for 140 bit + placement matrix out of bounds
+ 15 + This PHP installation does not support the + chosen image encoding format
+ 16 + Internal error: (-16) Cannot instantiate + ReedSolomon
+ 20 + The specification for shape of matrix is out + of bounds (0,29)
+ 21 + Cannot open the data file specifying bit + placement for Datamatrix 200
+ 22 + Datafile for bit placement is corrupt, crc + checks fails.
+ 23 + Internal error: (-23) Output matrice is not + big enough for mapping matrice
+ 24 + Internal error: (-24) Bit sequence to be + placed is too short for the chosen output matrice
+ 25 + Internal error: (-25) Shape index out of + bounds for bit placement
+ 26 + Cannot open the data file specifying bit + placement for Datamatrix 140
+ 30 + The symbol size specified for ECC140 type + Datamatrix is not valid
+ 31 + Data is to long to fit into any available + matrice size for datamatrix 140
+ 32 + Internal error: (-32) Cannot instantiate + MasterRandom
+ 33 + Internal error: (-33) Failed to randomize + 140 bit stream
+ 34 + Cannot open file %s for writing
+ 35 + Cannot write to file %s
+ 99 + EDIFACT encodation not implemented
+ 100 + +

+ JpGraph Error: HTTP headers have + already been sent. +

+

Caused by output from file %s at line %d.

+

Explanation: HTTP headers have already been sent back + to the browser indicating the data as text before the + library got a chance to send it's image HTTP header to + this browser.

+

This makes it impossible for the library to send back + image data to the browser (since that would be + interpreted as text by the browser and show up as junk + text). Most likely you have some text in your script + before the call to Graph::Stroke(). If this texts gets + sent back to the browser the browser will assume that + all data is plain text. Look for any text, even spaces + and newlines, that might have been sent back to the + browser. For example it is a common mistake to leave a + blank line before the opening

+
+


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/api.html b/includes/jpgraph/docs/chunkhtml/api.html new file mode 100644 index 0000000..2717532 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/api.html @@ -0,0 +1,126 @@ +Appendix I. Compiling PHP

Appendix I. Compiling PHP

+ +

Usually the included PHP version is adequate but if problems persists it is a good idea to + be able to compile PHP yourself. This way you will also be able to more quickly upgrade to + newer version of PHP which might have fix for a particular nasty bug that may have crept + in.

+

In the following sections we give examples of Unix shell scripts that will show typical + compile configuration for a downloaded PHP distribution. These compile configuration scripts + will make both the GD and FreeType libraries included in the executable.

+

In order to compile your downloaded PHP distribution first copy and save these scripts to + a local file and make that file runnable. Then run one of the selected configurations below + and do a normal "make".

+

Tip

+

When running make you can speed up the compilation by telling make to use + a number of parallel compile processes. Since most modern system have at least two cores + a typical invocation of make would be to make use of three parallel compile time + processes. This is done by using the -j argument. For example as +

make -j3
+
+

It is possible to compile PHP into (at least) three variants

+
  1. +

    as a command line tool

    +
  2. +

    as a Apache extension module (this is probably the most common variant)

    +
  3. +

    as a CGI module to be used by a HTTP server (this is slower than running PHP + as a module since it needs to be read from disk and the process created every + time a PHP script needs to be executed.)

    +

There is one crucial difference of importance when using PHP to generate + images. Both the CGI module and the client variant are both standalone executables so what + is the difference? The crucial difference is that the CGI module will by default output a + MIME header before it outputs data while the client version will not.

+

The following sections have one compile script for each of the three major + versions.

+

Caution

+

You should make sure that the proposed directory paths in the scripts match your + particular server setup as this can vary from system to system.

+
+

Compiling PHP4

+ +

Client version

+ +
#! /bin/sh
+./configure --prefix=/usr/share --datadir=/usr/share/php \
+--libdir=/usr/share/php --includedir=/usr/include \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php4/cli \
+--with-config-file-scan-dir=/etc/php4/cli \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-dir=/usr/lib \
+--enable-ftp \
+--enable-memory-limit \
+--enable-bcmath -enable-calendar \
+--enable-ctype --with-ftp \
+--enable-magic-quotes \
+--enable-inline-optimization \
+--with-bz2 \
+--with-iconv
+
+
+
+

Apache module

+ +
#! /bin/sh
+./configure --prefix=/usr/share --datadir=/usr/share/php --with-apxs2=/usr/sbin/apxs2 \
+--libdir=/usr/share --includedir=/usr/include \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php4/apache2 \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-dir=/usr/lib \
+--enable-ftp \
+--enable-memory-limit \
+--bindir=/usr/bin \
+--enable-bcmath \
+--enable-calendar \
+--enable-ctype \
+--with-ftp \
+--enable-magic-quotes \
+--enable-inline-optimization \
+--with-bz2 \
+--with-iconv
+
+
+
+

CGI extension

+ +
#! /bin/sh
+./configure --prefix=/usr/share --datadir=/usr/share/php \
+--libdir=/usr/share --includedir=/usr/include \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php4/apache2 \
+--with-config-file-scan=/etc/php4/apache2 \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-dir=/usr/lib \
+--enable-ftp \
+--enable-memory-limit \
+--bindir=/usr/bin \
+--enable-bcmath \
+--enable-calendar \
+--enable-ctype \
+--with-ftp \
+--enable-magic-quotes \
+--enable-inline-optimization \
+--with-bz2 \
+--with-iconv
+
+
+
+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/apis02.html b/includes/jpgraph/docs/chunkhtml/apis02.html new file mode 100644 index 0000000..334c152 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apis02.html @@ -0,0 +1,98 @@ +Compiling PHP5

Compiling PHP5

+ +

Client version

+ +
#! /bin/sh
+# mkphp5-cli
+# Build a command line version of PHP5
+./configure \
+--prefix=/usr/share/php5 \
+--datadir=/usr/share/php5 \
+--libdir=/usr/share/php5 \
+--includedir=/usr/include/php5 \
+--enable-force-cgi-redirect \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php5/cli \
+--with-config-file-scan-dir=/etc/php5/cli \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-dir=/usr/lib \
+--enable-ftp \
+--enable-memory-limit \ 
+--enable-safe-mode \
+--enable-bcmath -enable-calendar \
+--enable-ctype \
+--with-ftp \
+--enable-magic-quotes \
+--enable-inline-optimization \
+--enable-tokenizer \
+--with-bz2 \
+--with-iconv \
+--with-pear=/usr/share/php5
+
+
+
+

Apache module

+ +
#! /bin/sh
+# mkphp5-sapi
+# Build a SAPI (Apache module) version of PHP5
+./configure --prefix=/usr/share \
+--datadir=/usr/share/php --with-apxs2=/usr/sbin/apxs2 \
+--libdir=/usr/share --includedir=/usr/include \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php5/apache2 \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-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
+
+!#
+
+

CGI extension

+ +
#! /bin/sh
+# mkphp5-cgi
+# Build a CGI version of PHP5
+./configure --prefix=/usr/share \
+--datadir=/usr/share/php \
+--libdir=/usr/share --includedir=/usr/include \
+--enable-force-cgi-redirect \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php5/apache2 \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--with-gd --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-freetype-dir=/usr/lib \
+--enable-ftp \
+--enable-safe-mode \
+--bindir=/usr/bin \
+--enable-bcmath -enable-calendar \
+--enable-ctype \
+--enable-magic-quotes \
+--enable-inline-optimization \
+--enable-tokenizer \
+--with-bz2 \
+--with-iconv
+
+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/apj.html b/includes/jpgraph/docs/chunkhtml/apj.html new file mode 100644 index 0000000..76f397a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apj.html @@ -0,0 +1,86 @@ +Appendix J. Setting up PHP5 in parallel with PHP4 in SuSE 10.1

Appendix J. Setting up PHP5 in parallel with PHP4 in SuSE 10.1

+ +

Even though PHP4 is officially deprecated and is no longer actively maintained a large + number of existing installations are stiil (and will be) using PHP4. For this reason it can + be important to be able to test scripts running both PHP4 and PHP5. This section shows how + to do this on Linux SuSE 10.1 installation. Other Linux dialects can use similar but not + identical setups.

+

SuSE 10.1 ships with Apache2 and PHP5 as standard. In order to install PHP4 in parallel + some extra work is therefore required. This chapter explains how to setup both PHP4 and PHP5 + on the same server by configuring Apache2 using virtual hosts.

+

We will show how to maintain a simultaneous installation of both PHP4 and PHP5 at the same + time without the need to run a switching script to select which PHP version to activate. In + this setup we have opted to configure Apache with two virtual hosts based on IP-address, one + host running PHP4 as a SAPI module and the other virtual host running PHP5 as a CGI + module.

+

Configuration files and directories for Apache2 in SuSE 10.1

+ +

Before we start we give a short overview of where important configuration files and + directories for Apache2 are located in SuSE

+

+

Note

+

The configuration files setup by SuSE is slightly different from the standard + one-single "/etc/httpd.conf" used by other systems. The way SuSE does it is to + create a hierarchy of setup files under "/etc/apache2/". While this might look + complicated at first sight it has several advantages specially when You consider + that some script have to modify and add configurations to Apache2. Doing + automatic (and safe) edits in a large config file that can also be manually + edited is almost impossible to guarantee.

+

+

+

+

Dir: /etc/apache2/
+

General configuration directory for Apache2, this is where the + "httpd.conf" lives.

+
Dir: /etc/apache2/conf.d/
+

Module configuration files for loaded modules, for example php4.conf. + All the configuration files in this directory will be automatically read + by the main httpd.conf by means of an + "include conf.d/*.conf" command so the exact name + doesn't really matter as long as the file ends in "*.conf". +

+
Dir: /etc/apache2/vhosts.d/
+

Virtual host configuration files. All files in this directory will be + automatically read by the main httpd.conf the exact + name doesn't really matter as long as the file ends in + "*.conf". Note: When yast2 is used to edit + virtual hosts it will add its "yast2_*.conf" in + this directory. Unfortunately the virtual host configuration in yast2 in + not without problem (bugs) for IP based virtual hosts so we prefer to + create the configuration files manually. This will be shown later on in + this article.

+
File: /etc/sysconfig/apache2
+

This is the main Apache2 configuration file. This file is the one that + is really used to configure apache when it is started. This is also the + file that the "Yast2" HTTPD-module edits.

+

From our point of view the most important thing is that this is the + place where we tell Apache2 what external modules to load.

+

In the SuSE configuration this is done by listing all the modules in + the string variable APACHE_MODULES. In the SuSE + configuration there are no static "AddModule" directives in any of the + configuration files for Apache. Instead this is dynamically generated + each time apache is started (for example by /etc/init.d/apache2 start)

+

The generation of the actual module file names is quite clever in that + the script looks at the core module name in the + APACHE_MODULE variable and automatically determines the + name of the file name of the load modules. This means that for PHP we + only have to give the name "php4" or "php5" as the name of the module.

+

The script will then discover that the name of the file load module is + in fact "libphp4.so" or + "libphp5.so" automatically. The dynamically + created list of load modules will be written to + "/etc/apache2/sysconfig/loadmodule.conf" just + before the startup script activates apache2 daemon which will then read + the modules from this file which is included from the main + "httpd.conf" file.

+

+

+
+ + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/apjs02.html b/includes/jpgraph/docs/chunkhtml/apjs02.html new file mode 100644 index 0000000..c385024 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs02.html @@ -0,0 +1,21 @@ +Making sure you have the correct Apache2 setup

Making sure you have the correct Apache2 setup

+ +

PHP is only guaranteed to work with the Apache2 "Prefork MPM" + (Multi-Processing-Module) and you need to have apache2-prefork installed. This also + means that the APACHE_MPM in /etc/sysconfig/apache2 must NOT be set to "worker". You can + read more about the reasons for this issues in the Apache + Documentation : Thread Safety For general information about MPMs please see + Apache Documentation : + MPM +

+

If you use Yast2 to install Apache2 and the prefork module then all this will be + automatically setup. Before continuing please make sure that You have successfully + installed Apache2 on your server. For example by directing your favorite browser to + "http://localhost/"

+

+

Note

+

There is no need to install the default SuSE PHP5 module since we must replace + that anyway with our own CGI version of PHP5.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/apjs03.html b/includes/jpgraph/docs/chunkhtml/apjs03.html new file mode 100644 index 0000000..e92bd66 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs03.html @@ -0,0 +1,40 @@ +Approaches to running multiple PHP versions

Approaches to running multiple PHP versions

+ +

There are two fundamental ways of running multiple versions of PHP on the same server.

+

+

  1. +

    Running multiple instances of the HTTPD demon where each instance listens + on separate addresses and/or ports.

    +

    Advantage: This is the only way to run + multiple versions of PHP as (SAPI) modules in Apache2. In addition this has + some better security since potential crashes will be isolated and not effect + the other HTTPD demons.

    +

    Drawback: Running multiple HTTPD + instances will need more system resources in terms of memory and file + handlers.

    +
  2. +

    Running one instance of the HTTPD demon which is configured to serve + multiple virtual hosts. This is the approach we have chosen.

    +

    Advantage: Minimum system overhead and + relatively easy to setup.

    +

    Drawback: Only one PHP version can be run + as a (SAPI) Apache module the other PHP versions must be + configured/installed as CGI modules. This has a slight performance impact + and might not be suitable for heavily loaded production sites. (Note: that + could be overcome with the use of fast-cgi which works by pre-loading an + instance of PHP in memory which will then be used by the Apache process. See + Apache2 documentation regarding fast-cgi for more details).

    +

    +

    Note

    +

    There are actually two versions of virtual hosts with apache. By + name pr by IP-address. In this example we have chosen to match the + virtual hosts by IP address since for a development server we want + to be able to use plain IP addresses and not have the added + complexity of setting up a full DNS server. For more details about + other differences please see the excellent Apache2 documentation. +

    +

    +

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/apjs04.html b/includes/jpgraph/docs/chunkhtml/apjs04.html new file mode 100644 index 0000000..d27b987 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs04.html @@ -0,0 +1,28 @@ +Outline of the remainder of the chapter

Outline of the remainder of the chapter

+ +

The approach we will use is to setup PHP4 as a (SAPI) Apache module on the default + server address and setup PHP5 as a CGI module on a virtual host.

+

+

Part I - Installing PHP4 as a SAPI module in Apache.
+

Part 1 Installing PHP4 as a SAPI module in Apache. This sections + details how to configure and compile PHP4 as a SAPI module and then do + the necessary Apache configuration modifications to enable this new + module. By the end of this section we will have the ability to run PHP4 + scripts on our server.

+
Part II - Creating a virtual host
+

By assigning an alias IP-address on the server we can configure Apache + with a virtual server based on this address. This new virtual server + will have its own "cgi-bin/" as well as "htdocs/" directories. This part + shows how to enable this by adding suitable configurations in Apache. By + the end of this section our server will accept HTTP calls on a secondary + IP-Address and use the specified document root for this new IP-address. +

+
Part III - Installing PHP5 as a CGI module on the virtual host.
+

This final part shows how to configure and compile PHP5 as a CGI + module that we then make available for the newly created virtual host in + part 2. By the end of this module we will have PHP4 running on the + default server address and PHP5 running on the secondary virtual host. +

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/apjs05.html b/includes/jpgraph/docs/chunkhtml/apjs05.html new file mode 100644 index 0000000..f8b36e7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs05.html @@ -0,0 +1,219 @@ +Part I - Installing PHP4

Part I - Installing PHP4

+ +

Step one; Compiling PHP4 as a module for Apache2

+ +

First download the latest PHP4 tar-ball from php.net or the closest mirror and + unpack it in a temporary directory.

+

Since we will compile PHP4 ourself we need first to make sure a number of + libraries and the corresponding header files are installed in the system in order to + be able to compile PHP4. This is done by installing a number of "*-devel.rpm" on + your server. Depending your wanted configuration different development libraries + must be made available.

+

At the very minimum you will need the "apache2-devel.rpm" which provides the + "/sbin/apxs2" (Apache eXtenSion 2) command used to build modules with Apache2. Other + modules you might need are

+

+

  • +

    jpeg-devel.rpm

    +
  • +

    png-devel.rpm

    +
  • +

    mm-devel.rpm

    +
  • +

    xml2-devel.rpm

    +
  • +

    mysql-devel.rpm

    +
  • +

    ...

    +

+

+

Before you compile PHP4 you need to configure it by running the "./configure" + command with the options you want to be included in PHP4.

+

We use a small shell script called "mkphp4-sapi" to avoid having to re-type all + the options each time we compile a new version of PHP. The options we use for a + typical development server are (you might want to use other options)

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
#! /bin/sh
+./configure --prefix=/usr/share \
+--datadir=/usr/share/php4 \
+--with-apxs2=/usr/sbin/apxs2 \
+--libdir=/usr/share \
+--includedir=/usr/include \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php4/apache2 \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-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

+

+

However there are one thing You should take notice of. We have specified the + config file path (where the php.ini resides) to "/etc/php4/apache2/" as You can + probably guess from this naming convention it will make it possible to have + different ini files for both PHP4 and PHP5. In fact we have four different ini files + according to

+

+

  1. +

    "/etc/php4/apache2/php.ini" Used by the apache + SAPI module version of PHP4

    +
  2. +

    "/etc/php4/cli/php.ini" Used by the standalone + client version of PHP4 (/usr/bin/php4)

    +
  3. +

    "/etc/php5/apache2/php.ini" Used by the apache + CGI version of PHP5

    +
  4. +

    "/etc/php5/cli/php.ini" Used by the standalone + client version of PHP5 (/usr/bin/php5)

    +

+

+

When you run this you might get some errors saying that the configuration file + cannot find some library. This is a sign that you might have the library installed + but not yet have the "*-devel" RPM version added to your system which is needed + since this is where all the usual header files needed for compilation would be.

+

So for example if you get an error like "Cannot find PNG libraries. Please check + your that the corresponding "png-devel" library is installed and if not go back to + Yast2 and install the needed "*-devel.rpm" versions of the libraries.

+

When You have been able to successfully run the ./configuration command it is time + to compile. Type "make" as usual but do not type "make install", now wait until the + compilation finishes.

+

+

Note

+

If you are on a Pentium4 HT or on a real dual CPU machine you can speed up + the compilation by instead giving the "make -j3" command which will start up + 3 concurrent compilation processes.

+

+

+

Again; Do not run "make install" since this will try to modify the + configuration files in a way that isn't SuSE friendly.

+

The resulting PHP4 that you have built can be found in + ".libs/libphp4.so". Now we only want to copy this file to + the location of the other Apache2 modules.

+

+

Note

+

Again, PHP is only guaranteed to work with the non-threaded version of + Apache2, which means that you should have installed the "apache2-prefork" + MPM and NOT the "apache2-worker" MPM.

+

+

+

If you have correctly installed the prefork MPM several existing modules should + now be installed in "/usr/lib/apache2-prefork/".

+

So the only thing that now remains is to copy + ".libs/libphp4.so" to + "/usr/apache2-prefork/" in order for Apache to find PHP4 as + a module.

+
+

Step two; Enable the PHP4 module in the Apache2 configuration

+ +

There are three steps to needed to enable PHP4 in Apache.

+

+

  1. +

    Add php4 to the APACHE_MODULE string in "/etc/sysconfig/apache2" in + order so that the startup script in SuSE will add the appropriate + LoadModule statement so that Apache will load PHP4 as a module. In our + case our module string will look like

    +

    +

    1
    +2
    +3
    +
    APACHE_MODULES="access actions alias auth auth_dbm autoindex cgi \
    +dir env expires include log_config mime negotiation setenvif ssl \
    +suexec userdir dav dav_svn php4 "

    +

    +
  2. +

    Telling Apache to run files ending in *.php through the PHP4 module. + This is done by specifying the MIME type which the PHP4 module + registered itself with. In addition we also tell Apache to search for + the appropriate PHP index files in case a directory name is given as the + URL. We do this by creating a file "php4.conf" with + the following content

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +
    <IfModule sapi_apache2.c>
    +   AddType application/x-httpd-php .php3
    +   AddType application/x-httpd-php .php4
    +   AddType application/x-httpd-php .php
    +   AddType application/x-httpd-php-source .php3s
    +   AddType application/x-httpd-php-source .php4s
    +   AddType application/x-httpd-php-source .phps
    +   DirectoryIndex index.php3
    +   DirectoryIndex index.php4
    +   DirectoryIndex index.php
    +</IfModule>

    +

    +

    and place it in the "/etc/apache2/conf.d/" + directory. This will guarantee that it will be read upon startup. The + "IfModule" statement in the beginning is just to avoid + the statements to be executed in case the PHP4 module is not loaded (we + test this by checking if the "sapi_apache2.c" has been + activated in Apache).

    +
  3. +

    The final step now is to restart Apache by doing (as root)

    +

    +

    1
    +
    $> /etc/init.d/apache2 restart

    +

    +

+

+

In order to verify that PHP has been enabled run a standard PHP script; for + example by copying the following script to "/srv/www/htdocs/"

+

+

1
+2
+3
+
<?php 
+phpinfo(); 
+?>

+

+

and name it as "phpinfo.php" . If you now go to your favorite + browser and run this script as "http://localhost/phpinfo.php" you should get the + standard PHP4 information presented as a quite big table.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/apjs06.html b/includes/jpgraph/docs/chunkhtml/apjs06.html new file mode 100644 index 0000000..53139e7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs06.html @@ -0,0 +1,107 @@ +Part II - Creating a virtual host

Part II - Creating a virtual host

+ +

Step 1; Adding an alias IP-address to Your server

+ +

In this example we will assume that the server is called "gamma" and have the + primary address "192.168.0.50". The virtual host will be called "gamma2" and will be + located at address "192.168.0.51". The easiest way to add another address alias is + to use yast2 and the network configuration module and simple add a new alias. +

+
+

Step 2; Creating different document and cgi roots

+ +

In preparation of the new virtual host we want it to have a separate document and + cgi (where we will store the PHP5 binary) roots compared with the standard server. + For this purpose we add two new directories "/srv/www/gamm2-htdocs/" and + "/srv/www/gamma2-cgi-bin/" on the server.

+
+

Step 3; Configure Apache with a virtual host

+ +

For his we add a new small config file named "gamma2_vhost.conf" (the exact name + is not important as long as it ends in *.conf) in the "/etc/apache2/vhosts.d/" + directory. The script we add is

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
# Setup gamma2 on secondary IP-address
+<VirtualHost 192.168.0.51>
+ 
+ DocumentRoot /srv/www/gamma2-htdocs/
+ ServerName gamma2
+ ServerAdmin root@localhost
+ 
+ # We use a separate CGI directory
+ ScriptAlias /cgi-bin/ /srv/www/gamma2-cgi-bin/
+ 
+ # For good measure we also add recognition of PHP5 index
+ DirectoryIndex index.php5
+ 
+ # This is the two critical statement for this virtual
+ # host we activate PHP5 as a CGI module
+ Action php5-cgi /cgi-bin/php
+ AddHandler php5-cgi .php5 .php
+ 
+ <Directory /srv/www/gamma2-cgi-bin/>
+  AllowOverride None
+  Options +ExecCGI -Includes
+  Order allow,deny
+  Allow from all
+ </Directory>
+ 
+ <Directory "/srv/www/gamma2-htdocs/">
+  Options None
+  AllowOverride None
+  Order allow,deny
+  Allow from all
+  DirectoryIndex index.html index.php
+ </Directory>
+ 
+ UserDir public_html
+ 
+</VirtualHost>

+

+

We do not go into any more detail of this configuration since it should be fairly + easy to understand. For details we refer to the Apache documentation.

+

What we have accomplished with this file is that when we call the server on the + second address any php file will be recognized by apache as a file to be handled by + the "php5-cgi" action. This in turn means that whenever Apache encounters a *.php5 + (or *.php) file it will run the program "/cgi-bin/php". This path in turn will be + expanded to " /srv/www/gamma2-cgi-bin/php".

+

In the next section we will show how to compile PHP5 and put the executable CGI + version in this directory.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/apjs07.html b/includes/jpgraph/docs/chunkhtml/apjs07.html new file mode 100644 index 0000000..08391c7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs07.html @@ -0,0 +1,65 @@ +Part III - Installing PHP5

Part III - Installing PHP5

+ +

We are now ready for the last step which means compiling PHP5 as a CGI module for + Apache. This follows the same principle as the compilation for PHP4 as described above. + Again, we use a small configuration script "mkphp5-cgi" which is + shown below.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
#! /bin/sh
+./configure --prefix=/usr/share \
+--datadir=/usr/share/php \
+--libdir=/usr/share --includedir=/usr/include \
+--enable-force-cgi-redirect \
+--bindir=/usr/bin \
+--with-config-file-path=/etc/php5/apache2 \
+--enable-mbstring --enable-mbregex \
+--with-mysql  \
+--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 --with-ttf-dir=/usr/lib \
+--with-freetype-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

+

+

Notice that as we said before we have a different configuration path for PHP5 compared + with PHP4 as shown above. Also note that in order to build the CGI module we do not + configure the "apxs2" option. After successful configuration type + "make" but do not type "make install" in order + to compile PHP5.

+

After the compilation have finished copy "sapi/cgi/php" to + "/srv/www/gamma2-cgi-bin/php" since this is the place where our + virtual host expects to find the PHP5 CGI module.

+
diff --git a/includes/jpgraph/docs/chunkhtml/apjs08.html b/includes/jpgraph/docs/chunkhtml/apjs08.html new file mode 100644 index 0000000..a01c777 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apjs08.html @@ -0,0 +1,66 @@ +Part IV - Verifying the setup

Part IV - Verifying the setup

+ +

The only small thing remaining, in case You haven't done so already, is to create + suitable "php.ini" scripts that are copied to the previous + specified PHP4 and PHP5 config file directories, + "/etc/php4/apache2/" and + "/etc/php5/apache2/".

+

+

Note

+

It is recommended to enable all warnings and errors in each php.ini file + unless You have very, very good reasons not to do this. Use the default php.ini + files in the PHP distribution as the initial template. For use with JpGraph it + is recommended to do the following modifications:

+

+

  1. +

    Increase maximum allowed memory to 32MB

    +
  2. +

    Increase maximum allowed script running time to 30s

    +
  3. +

    Set full error reporting

    +

+

+

+

+

Assuming the IP-addresses shown in the configuration above we are now ready to test + out setup. In order to do this make sure that each document root have the "phpinfo.php" + test script (see above).

+

We can now test the different setups by using the URLs

+

+

  1. +

    http://192.168.0.50/phpinfo.php +

    +

    This URL would send back configuration showing that the server is running + PHP4. Verify that the config path used is set to + "/etc/php4/apache2/".

    +
  2. +

    http://192.168.0.51/phpinfo.php +

    +

    This URL would send back configuration showing that the server is running + PHP5 Verify that the config path used is set to + "/etc/php5/apache2/".

    +

+

+

Troubleshooting

+ +

+

  1. +

    If your browser asks you to download content with mime-type + "mime/x-httpd-application" when you try to visit the + PHP script it means that Apache does not yet run PHP as a module (now + module have accepted to handle the x-http-application mime type). Make + sure you have included the "php4" in the APACHE_MODULES + string as described above and that you added the + "php4.conf" file in the + "/etc/apache2/conf.d/" directory.

    +
  2. +

    We had some issues with FireFox insisting on downloading + "phpinfo.php" as a file even when other browser + showed the page properly, using "etherreal" we could + confirm that Firefox was using a previous cached version before we had + enabled PHP in the apache configuration. To solve this we had to clear + the Firefox cache.

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/apk.html b/includes/jpgraph/docs/chunkhtml/apk.html new file mode 100644 index 0000000..ac0d025 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apk.html @@ -0,0 +1,13 @@ +Appendix K. Why it is not possible to add a SVG backend to JpGraph

Appendix K. Why it is not possible to add a SVG backend to JpGraph

+ +

Background

+ +

We have received many suggestions to add SVG as output from the library to achieve + better quality in off-screen reproduction of graphs. Adding SVG output would + significantly enhance the print quality as well as adding the possibility of + seamless zooming in graphs. For this reason we have done a brief pre-study on the + feasibility of such a backend. This short note will describe our findings.

+
+ + +
diff --git a/includes/jpgraph/docs/chunkhtml/apks02.html b/includes/jpgraph/docs/chunkhtml/apks02.html new file mode 100644 index 0000000..6fb2fd6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apks02.html @@ -0,0 +1,13 @@ +Summary of findings

Summary of findings

+ +

To our surprise we have to conclude that with the current SVG standard 1.1 as well + as with the upcoming 1.2 (based on SVG-T) it will not be possible to implement a + full backend in SVG.

+

The primary hinder is the lack of adequate text manipulation in the current SVG + standard. In addition the implementation of the text supporting feature in current + SVG viewers range from poor and erroneous to non-existing.

+

The only way to solve this would be to drastically reduce some functionality of + the library in regards to text handling and require the user of the library to + supply text sizes to be used in many places of the library where that is needed. +

+
diff --git a/includes/jpgraph/docs/chunkhtml/apks03.html b/includes/jpgraph/docs/chunkhtml/apks03.html new file mode 100644 index 0000000..f52477f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apks03.html @@ -0,0 +1,122 @@ +Detailing the issue

Detailing the issue

+ +

The core problem

+ +

It all boils down to one critical issue:

+

With the current SVG 1.1 (and draft 1.2) standard there is no way to + statically find out the bounding box of an arbitrary text string for later usage + in the SVG script.

+

This very surprising omission in the SVG standard makes it in principal + impossible to even do such a simple thing as drawing a frame around a text + programatically since there is no easy way to find out the size, in the given + coordinate system, of the string.

+

Since the actual bounding box is dependent on both font, style, size, etc as + well as the actual SVG viewer text-layout engine implementation this calculation + cannot be done outside the viewer. It must be part of the SVG standard elements.

+

Note

+

Now, anyone who are familiar with SVG would jump in here and point out + that this is not entirely correct. For the specific case of a frame around a + text it would be possible to use a filter function as specified by the + standard but that is a special case that just could be used to draw an + effect that looks like a frame around a text (using the objectBoundingBox + property). It is still not possible to find out the bounding box.

+

The second approach would be to to add some DOM Javascript code in the SVG + script which upon execution of the script could in theory find out the + bounding box and adjust suitable attributes in the script.

+
+
+

Why is this a problem ?

+ +

There are many places in the library where it is absolutely essential to find + out the bounding box of a text string to adjust the position of other object in + the graph. For example margins for titles, column width in gantt charts and + legends and so on. Without this functionality it will be impossible to add SVG + output without significantly reducing the functionality and in essence create a + new version of the library suitable for this reduced functionality that is + brought upon us by the use of SVG.

+
+

Possible workarounds

+ +

Looking at this from a more positive view instead of explaining why it cannot + be done there are in principal only two workarounds (neither which is a 100% + solution)

+
  1. +

    Using a single fixed font. Restricting the library to one specific + fixed font would make it possible to calculate the bounding box for the + string. Due to differences in the existing viewers it would be necessary + to have some safety margins built in when doing this calculation. + However this would significantly impact the visual appearance of the + graphs.

    +
  2. +

    Using heuristics By establishing some "good enough" heuristics for a + plain font we can try to find a guesstimate of the size of the string. + Unfortunately it is a big difference in length between "iiiii" and + "wwwww" even though they have the same number of characters. So without + fully implementing the same algorithm as some SVG viewer text-layout + engine uses this method cannot guarantee that the text will always fit + without making the box fit the worst case. In addition this method will + have some difficulty in handling rotated text strings.

    +
+
+

What would be required ?

+ +

What would be required in the standard to solve this is a new basis element + which could be used to record the bounding box of a particular text string for + later reference. To just give some idea on what is needed some "pseudo-SVG" that + we would need is something along the lines of:

+
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<def>
+  <boundingbox id="bb1" 
+               text="This is a text" style=" />
+</def>
+<rect x="50+#bb1.x1-10" y="50+#bb1.y1-10" 
+      width="#bb1.width+20" 
+      height="#bb1.height+20" />
+<text x="50" y="50" >
+  <tref xlink:href="#bb1" />
+</text>
+

The basic idea is that in the def-section all text strings to later be used in + the script is defined together with the font (and any other formatting + applicable). These text strings are defined in the new SVG element "boundingbox" + which will calculate the bounding box of the given text. These text string is + later referenced in the actual text with a standard tref element. The bounding + box attributes can then be used in the positioning of the text with a "#" + reference based on the id of the new introduced element "boundingbox" The above + script would then draw a text string positioned at (50,50) with a frame around + it with a 10 units margin all around.

+
+

DOM scripting and GetBBox()

+ +

Since we make no claim to be experts in all aspects of the SVG standard (which + is fairly big) it might be possible that there is some way to still solve this + that has eluded us so we would be very interested in getting a second opinion of + these findings. We are aware of the SVG method GetBBox() but this would not work + in the library very well. The reason is that this is not a static function but + requires the context of a DOM script. This would require a substantially rewrite + of the library since there are graphs where every single coordinate would have + to be back-patched in the end (possible in multiple passes - since the + calculation of one bounding box would be needed to adjust another element).

+

This means that the script would no longer be static but would require the + library to generate "self-modifying" DOM script at the end. The logic of the + library assumes that the bounding box of text can be found out at the place of + creation and then this bounding box can be used to adjust subsequent + coordinates.

+

So to summarize this we do not feel that the potential back patching of every + single element in the SVG image at the end in a DOM script is a solution. +

+
+

A final comment

+ +

Since we still find it very hard to believe this giant oversight in the + standard we would be happy to receive comments on these conclusions.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/apl.html b/includes/jpgraph/docs/chunkhtml/apl.html new file mode 100644 index 0000000..1bb2a41 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apl.html @@ -0,0 +1,267 @@ +Appendix L. The JpGraph configuration file

Appendix L. The JpGraph configuration file

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
<?php
+//=======================================================================
+// File:        JPG-CONFIG.INC
+// Description: Configuration file for JpGraph library
+// Created:     2004-03-27
+// Ver:         $Id: jpg-config.inc.php 1839 2009-09-25 12:36:15Z ljp $
+//
+// Copyright (c) Aditus Consulting. All rights reserved.
+//========================================================================
+ 
+ 
+//------------------------------------------------------------------------
+// Directories for cache and font directory.
+//
+// CACHE_DIR:
+// The full absolute name of the directory to be used to store the
+// cached image files. This directory will not be used if the USE_CACHE
+// define (further down) is false. If you enable the cache please note that
+// this directory MUST be readable and writable for the process running PHP.
+// Must end with '/'
+//
+// TTF_DIR:
+// Directory where TTF fonts can be found. Must end with '/'
+//
+// The default values used if these defines are left commented out are:
+//
+// UNIX:
+//   CACHE_DIR /tmp/jpgraph_cache/
+//   TTF_DIR   /usr/share/fonts/truetype/
+//   MBTTF_DIR /usr/share/fonts/truetype/
+//
+// WINDOWS:
+//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
+//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
+//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
+//
+//------------------------------------------------------------------------
+// define('CACHE_DIR','/tmp/jpgraph_cache/');
+// define('TTF_DIR','/usr/share/fonts/truetype/');
+// define('MBTTF_DIR','/usr/share/fonts/truetype/');
+ 
+//-------------------------------------------------------------------------
+// Cache directory specification for use with CSIM graphs that are
+// using the cache.
+// The directory must be the filesysystem 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' ddirectory.
+// 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 ususal this directory must be writeable by the PHP process.
+define('CSIMCACHE_DIR','csimcache/');
+define('CSIMCACHE_HTTP_DIR','csimcache/');
+ 
+//------------------------------------------------------------------------
+// Various JpGraph Settings. Adjust accordingly to your
+// preferences. Note that cache functionality is turned off by
+// default (Enable by setting USE_CACHE to true)
+//------------------------------------------------------------------------
+ 
+// Deafult locale for error messages.
+// This defaults to English = 'en'
+define('DEFAULT_ERR_LOCALE','en');
+ 
+// Deafult graphic format set to 'auto' which will automatically
+// choose the best available format in the order png,gif,jpeg
+// (The supported format depends on what your PHP installation supports)
+define('DEFAULT_GFORMAT','auto');
+ 
+// 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.
+define('USE_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.
+define('READ_CACHE',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.
+define('USE_IMAGE_ERROR_HANDLER',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.
+define('CATCH_PHPERRMSG',true);
+ 
+// Determine if the library should also setup the default PHP
+// error handler to generate a graphic error mesage. 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.
+define('INSTALL_PHP_ERR_HANDLER',false);
+ 
+// Should usage of deprecated functions and parameters give a fatal error?
+// (Useful to check if code is future proof.)
+define('ERR_DEPRECATED',true);
+ 
+// The builtin GD function imagettfbbox() fuction which calculates the bounding box for
+// text using TTF fonts is buggy. By setting this define to true the library
+// uses its own compensation for this bug. However this will give a
+// slightly different visual apparance than not using this compensation.
+// Enabling this compensation will in general give text a bit more space to more
+// truly reflect the actual bounding box which is a bit larger than what the
+// GD function thinks.
+define('USE_LIBRARY_IMAGETTFBBOX',true);
+ 
+//------------------------------------------------------------------------
+// The following constants should rarely have to be changed !
+//------------------------------------------------------------------------
+ 
+// 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.
+define('CACHE_FILE_GROUP','www');
+ 
+// What permissions should the cached file have
+// (Set to '' will give the default persmissions for the 'PHP-user')
+define('CACHE_FILE_MOD',0664);
+ 
+?>
+
diff --git a/includes/jpgraph/docs/chunkhtml/apm.html b/includes/jpgraph/docs/chunkhtml/apm.html new file mode 100644 index 0000000..b707e73 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apm.html @@ -0,0 +1,72 @@ +Appendix M. Theme class

Appendix M. Theme class

+ +

Theme class

+ +
  1. +

    Theme class test.

    +
  2. +

    This irrevocable, perpetual license covers versions 1.x & 2.x of + JpGraph

    +
  3. +

    This license gives the holder right to install JpGraph libraries on One Server + which can run one or several virtual HTTP servers.

    +
  4. +

    The license holder is allowed to make modifications to the JpGraph sources but + in no event will the original copyright holders of this library be held + responsible for action or actions resulting from any modifications of the + source.

    +
  5. +

    The license holder is not required to publicize or otherwise make available + any software used in conjunction with JpGraph.

    +
  6. +

    The license holder may not re-distribute the library on it's own or versions + thereof to third party without prior written permission of the copyright + holder.

    +
  7. +

    JpGraph License does not allow the library to be redistributed as part of + another product.

    +
  8. +

    In no event shall the copyright notice in any of the source files supplied in + JpGraph be removed or modified.

    +
  9. +

    The names "JpGraph" or "Aditus" must not be used to endorse or promote + products derived from this software without prior written permission.

    +
  10. +

    The license may be transferred to another server by removing all installed + files from the old server.

    +
  11. +

    The wording of this license may change without notice for future versions of + JpGraph.

    +
  12. +

    By acquiring a license the licensee agrees to all terms and conditions in this + license text.

    +
  13. +

    Limitations of Liability

    +

    In no event, except for intellectual property claim, 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.

    +

    In addition, in no event does this license authorize you to use JpGraph in + applications or systems where JpGraphs failure to perform can reasonably be + expected to result in a physical injury, loss of life or any economical damage. + Any such use by the licensee is entirely at the licensees own risk, and the + licensee agrees to hold the original copyright holders of JpGraph harmless from + any claims or losses relating to any such unauthorized use.

    +
  14. +

    Limited Warranty

    +

    JpGraph warrants that licensor is owner of the software with authority to + license the software to licensee and that the software does not infringe third + party intellectual property rights. Licensor agrees to indemnify, defend and + hold harmless licensee from any claims either that licensor does not own the + software or that the software infringes a third party's intellectual + property.

    +

    THE SOFTWARE AND THIS LICENSE DOCUMENT ARE PROVIDED AS IS. THE FOREGOING + WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, OF ANY KIND, + INCLUDING WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE.

    +
+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/apms02.html b/includes/jpgraph/docs/chunkhtml/apms02.html new file mode 100644 index 0000000..aa81530 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/apms02.html @@ -0,0 +1,64 @@ +Bulk (Re-seller license)

Bulk (Re-seller license)

+ +
  1. +

    The JpGraph Professional License will be referred to as "The license" in the + remainder of this text.

    +
  2. +

    This irrevocable, perpetual license covers versions 1.x & 2.x of + JpGraph

    +
  3. +

    This license gives the licensee the right to distribute the JpGraph libraries, + as part of its product portfolio and to use the Jpgraph libraries with its + hosted service offerings. Specifically this license gives the licensee the right + to deploy an unlimited number of JpGraph installations as part of their product + portfolio and offer an unlimited number of hosted services that use the JpGraph + libraries to an unlimited number of users.

    +
  4. +

    The license holder is allowed to make modifications to the JpGraph sources but + in no event will the original copyright holders of this library be held + responsible for action or actions resulting from any modifications of the + source.

    +
  5. +

    JpGraph libraries is only licensed to be redistributed as a part of the + licensees products. Specifically it may not be sold or re-distributed on it's + own.

    +
  6. +

    In no event shall the copyright notice in any of the source files supplied in + JpGraph be removed or modified.

    +
  7. +

    The names "JpGraph" or "Aditus" must not be used to endorse or promote + products derived from this software without prior written permission.

    +
  8. +

    The wording of this license may change without notice for future versions of + JpGraph.

    +
  9. +

    By acquiring a license the licensee agrees to all terms and conditions in this + license text.

    +
  10. +

    Limitations of Liability

    +

    In no event, except for intellectual property claim, 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.

    +

    In addition, in no event does this license authorize you to use JpGraph in + applications or systems where JpGraphs failure to perform can reasonably be + expected to result in a physical injury, loss of life or any economical damage. + Any such use by the licensee is entirely at the licensees own risk, and the + licensee agrees to hold the original copyright holders of JpGraph harmless from + any claims or losses relating to any such unauthorized use.

    +
  11. +

    Limited Warranty

    +

    JpGraph warrants that licensor is owner of the software with authority to + license the software to licensee and that the software does not infringe third + party intellectual property rights. Licensor agrees to indemnify, defend and + hold harmless licensee from any claims either that licensor does not own the + software or that the software infringes a third party's intellectual + property.

    +

    THE SOFTWARE AND THIS LICENSE DOCUMENT ARE PROVIDED AS IS. THE FOREGOING + WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, OF ANY KIND, + INCLUDING WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE.

    +
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01.html b/includes/jpgraph/docs/chunkhtml/ch01.html new file mode 100644 index 0000000..6a43ce6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01.html @@ -0,0 +1,29 @@ +Chapter 1. About the library

Chapter 1. About the library

+ +

+ What you will learn in this chapter.  + This chapter will go through what the library is, the licensing model, how it is + typically used and the detailed steps of installing it. This chapter will not + explain how to use the API in the library. It will help answering typical questions + such as "Should I use this library?", "Is the library + suitable for use in my particular environment?, "Do I have + enough knowledge to use this library?" +

+

What is JpGraph?

+ +

The JpGraph library is a 2D graph plotting library for PHP4 and PHP5. It is meant + to significantly simplify the creation of dynamic graphs using PHP scripting. The + libray can be used on its own or as an embedded part of a large WEB development + undertaking. In addition the library allows images to be created using the command + line version of PHP (the cli version).

+
+ + + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s02.html b/includes/jpgraph/docs/chunkhtml/ch01s02.html new file mode 100644 index 0000000..ce4dc92 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s02.html @@ -0,0 +1,20 @@ +Software license

Software license

+ +

JpGraph is released under a dual license. For non-commercial usage the library is + released under QPL 1.0 (Qt-License) and for professional use it is released under + the JpGraph Professional License. See Appendix B. JpGraph Professional License for more details regarding the exact wording of + the license. The goal the license have is to be simple, fair and help recover some + of the development cost and hosting services that the library development brings + with it.

+

Broadly speaking commercial use is defined as

+

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 in an intranet in a company with more than 2 + employees

+

One license entitles the user to install the library on one single physical + machine which may run one or several logical servers. In addition it also entitles + the license holder to install one version of the library on a separate development + server. The professional license is perpetual and is valid for one major + version.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s03.html b/includes/jpgraph/docs/chunkhtml/ch01s03.html new file mode 100644 index 0000000..d9b0c5f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s03.html @@ -0,0 +1,39 @@ +Versions of the library covered

Versions of the library covered

+ +

This manual covers versions up to v3.1 of JpGraph. There are three main branches + of the library:

The "1.x.y" branch
+

The 1.x.y series is only intended for PHP4 and is not compatible + with PHP5 running in strict mode. If you are running an older + installation with only PHP4 you must use this branch of the library. + In addition you must use this branch if for some obscure reason only + the very old GD 1.x library is available in the installation (teh GD + library is the low level graphic primitives library used by JpGraph + and available in PHP).

+

Caution

+

The 1.x.y series is since 31 Dec 2008 no longer maintained and + should be considered deprecated. There will be no more + maintenance releases made on this branch.

+
+
The "3.x.y" branch
+

The "3.x.y" series is the current one and is only intended to run + on PHP5. This code is optimized for use both with PHP5 as well as + the new (and bundled version) of the GD 2.x library. Hence this will + not work if you only have the older GD 1.x graphic primitive library + installed. However, all modern PHP installations since 2006 have + shipped with GD 2.x so this should not in reality be any + problem.

+

Caution

+

Please note that it is not possible to run the "3.x.y" series + on PHP4. If you need to run on PHP4 then you must use the 1.x version of the + library.

+
+
The "3.x.y-p" branch (The pro-version)
+

This is in principle the same as the "3.x.y" branch with the + difference that the pro-version includes a number of additional + modules (see Part V. Additional graph types available in the professional version) not available in the free + version. This includes both some additional graph types as well as + 1D and 2D barcodes. In addition the professional license gives three + months of email support for installing and configuring the + library.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s04.html b/includes/jpgraph/docs/chunkhtml/ch01s04.html new file mode 100644 index 0000000..7fe2a85 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s04.html @@ -0,0 +1,88 @@ +Purpose and usage

Purpose and usage

+ +

The purpose of the library is to make it possible to (very) easily create dynamic + images (a.k.a. graphs) using PHP scripting. The library hides as much as possible + all the details necessary to create dynamic images. Strictly speaking all the basic + low level functionality to draw images are already available in PHP since PHP comes + with the core GD library which is the very lowest layer to create images. The GD + library has graphic primitives to create lines, circles, points etc. but it has no + built-in intelligence to handle scales, labelling , colors etc. This logically makes + JpGraph library a higher type library more easily accessible than the raw GD + library.

+

Figure 1.1. JpGraph and PHP

+ +
JpGraph and PHP
+

+

There are several possible usage scenario for the library and it's different + parts.

+

The most common usage is most likely to visualize numeric data by creating basic + charts (for example line, bar or pie charts) that is included dynamically in a + WEB-page via a straight forward <img> tag. The details on how to + create dynamic graphs will be fully covered in later sections of this manual The + library itself is agnostic to where the data comes from so it could for example be + retrieved from a database, from a plain text file or perhaps from some WEB-service. + In addition to this scenario the library could be used as a tool to create dynamic + charts that are stored as image files in a directory. This makes it possible to use + the library in an off-line batch mode from the command line (most likely using the + cli =command line version of PHP). For an example of using JpGraph in batch mode see Chapter 34. Showing SPAM statistics.

+

In addition to these basic usage scenarios both the free and the slightly more + advanced pro-version of the library includes a multitude of additional functionality + which includes for example more advanced graph types (like spider graphs, polar + plots, contour plots etc.) and some non graph capabilities like the possibility to + create barcodes (only available in the pro-version) or to create Gantt-charts. The + usage of all of these types of graphs are explained in this manual.

+

+

Caution

+

In order to use JpGraph the PHP installation must have support for the GD + libraries enabled. See Chapter 2 and 3 for details on checking the + installation.

+

+

+

In order to get a quick feel for how the library can be used we have included in Example 1.1. This is the very first example (example0.php) a very basic type of line graph. Don't worry + right now about the details, the message here is that it only takes six lines of + real script code to create a basic graph. Have a look at the example and see just + how much of the script makes sense without us even having discussed any API + yet.

+

Example 1.1. This is the very first example (example0.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>

Figure 1.2. This is the very first example (example0.php)

This is the very first example (example0.php)

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s05.html b/includes/jpgraph/docs/chunkhtml/ch01s05.html new file mode 100644 index 0000000..77a0c68 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s05.html @@ -0,0 +1,21 @@ +Prerequisites for running the library

Prerequisites for running the library

+ +

+

  • +

    Any 32bit operating system capable of running PHP5

    +
  • +

    PHP5, requires version >= 5.1.0 (it might work with earlier versions + but this is not officially supported)

    +
  • +

    Enabled GD 2.x library in PHP installation. This is normally bundled + with the PHP5 distribution. It is strongly recommended that you use the + included version of GD with PHP5 and not try to install it + separately.

    +

+

+

Caution

+

There are known issues so running the library under a 64 bit OS so the library + does not officially support any 64 bit OS:es

+
+

For more detailed information on PHP settings in php.ini see Verifying the PHP/GD installation

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s06.html b/includes/jpgraph/docs/chunkhtml/ch01s06.html new file mode 100644 index 0000000..e6816b4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s06.html @@ -0,0 +1,10 @@ +Who can use the library

Who can use the library

+ +

Even though the library hides a lot of details it needs to be pointed out that + this is still a programmers library. It is assumed that the user of the library has + basic skills in programming PHP and is familiar, at least to a basic extent, with + the concept of objects and object oriented programming since the entire library is + built around this paradigm. Fully understanding basic concepts such as classes, + methods, class instances and class inheritage will substantially help in trying to + understand how to use the library.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s07.html b/includes/jpgraph/docs/chunkhtml/ch01s07.html new file mode 100644 index 0000000..1e19d39 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s07.html @@ -0,0 +1,33 @@ +What you can do with the library

What you can do with the library

+ +

One should probably differentiate between the two basic usage scenarios

+

+

  1. +

    Online. That is, the image is dynamically + generated when a user is viewing a particular WEB-page. This means that + the time it takes to generate the image will add to the delay the user + is experiencing when trying to view the page. (The library supports a + caching mechanism to reduce the number of times an image has to + generated, see Efficient graph generation using the built-in cache subsystem for a thorough + discussion). For this scenario one should probably keep the images as + basic as possible in order to have as small latency as possible.

    +

    In practice this means that the number of data points to visualize + should be kept in the order of hundreds and not thousands. In later + sections we will discuss in details what can be done to improve the + performance of the library.

    +

    +
  2. +

    Offline. That is, the images are generated by + some "batch" processing (possible command line based). In this scenario + the delay is not an issue and one could create much more complicated + images and process many more data points. Even though the library in + itself does not impose any restriction of the number of data points to + process the memory and time limits set for PHP will.

    +

    In practice if you need to process images with sizes above 2000x2000 + pixels resulting from processing 500,000 data points then it is probably + better to find a more suitable way to produce these graphs rather than a + PHP script (unless you are prepared to give PHP a couple of 100 MB of + allowed memory)

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s08.html b/includes/jpgraph/docs/chunkhtml/ch01s08.html new file mode 100644 index 0000000..9899ec9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s08.html @@ -0,0 +1,32 @@ +What you shouldn't or cannot do with this library

What you shouldn't or cannot do with this library

+ +

If the primary usage is heavy scientific processing where you need to visualize + complex 2D/3D scenarios then this library is not for you. In this case it is + probably better to use one of the scientific tools like Matlab or Maple.

+

In addition, if you for example intend to implement a large scale project planning + tool with several thousand activities that you want to manipulate and display using + the support Gantt charts in this library this is probably stretching it a bit too + far. Again, this is probably better done with more dedicated tools like MS Project.

+

In addition may we again point out that the library does not officially support + any 64bit OS due to issues with PHP/GD.

+

+

Note

+

Some of the 2D barcodes will simply not work in a 64bit OS. This is + consequence of the computation of the error correcting codes which in some + instances assumes 32bit integers. For the basic graphs there is no known + issues but since the library is not verified on a 64bit OS we do not + officially support this.

+

+

+

There is also a question on sever load that should be taken into account. Due to + the CPU intensive nature of image processing the complexity of the generated images + needs to be kept as low as possible for any sites that would expect heavy load. + Since it is normally necessary to increase the allowed memory for PHP (see Setting up your php.ini file) when working with images this could + easily make the server hit it's physical memory limit if the load is very high.

+

For example, the practical lowest memory that should be set for PHP when working + with images is 32MB (recommended is at least 64MB), if your system must cope with 50 + simultaneous users it means that the HTTP processes alone will need roughly 1.6GB + just to secure the basics. Handling 50 simultaneous executing image scripts will + also require some heavy processing and the server needs to have a CPU capacity to + handle this. Some discussions about dimensioning a server can be found in Efficient graph generation using the built-in cache subsystem.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s09.html b/includes/jpgraph/docs/chunkhtml/ch01s09.html new file mode 100644 index 0000000..1e410b2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s09.html @@ -0,0 +1,368 @@ +Feature-matrix for the library

Feature-matrix for the library

+ +

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 are + required to draw graphs with a pleasing esthetic look.

+

The following list makes no claim to be complete but it will give a birds view of some of + the main (and in some cases unique) features of the library. The list will also illustrate + the difference between the free and the pro-version.

+

+

Table 1.1. Feature matrix for JpGraph library

+ +
FeatureFree versionPro-version
Supports PNG, GIF, JPG image formats +

+

+
+

+

+
Flexible scales, supports text-lin, text-log, lin-lin, lin-log, + log-lin and log-log and integer scales +

+

+
+

+

+
Supports both PNG, GIF and JPG graphic formats. Note that the + available formats are dependent on the specific PHP installation where + the library is used. +

+

+
+

+

+
Supports caching of generated graphs to lessen burden of a HTTP + server. +

+

+
+

+

+
Supports batch mode to only generate images to a file +

+

+
+

+

+
Supports client side image maps which makes it easy to produce drill + down images. +

+

+
+

+

+
Intelligent auto-scaling which gravitates towards esthetic values, + i.e. multiples of 2:s and 5:s +

+

+
+

+

+
Fully supports manual scaling, with fine grain control of position of + ticks. +

+

+
+

+

+
Multiple Y-axes (and scales) and multiple data series in the same + graph +

+

+
+

+

+
Supports background images with different formatting options +

+

+
+

+

+
User specified grace for auto-scaling +

+

+
+

+

+
Supports unlimited number of y-axes, +

+

+
+

+

+
Supports, line-plots, filled line-plots, accumulated line-plots, bar + plots, accumulated bar plots, grouped bar plots, error plots, line error + plots, scatter plots, gantt-charts, radar plots, 2D and 3D pie charts. +

+

+
+

+

+
Supports unlimited number of plots in each graph, makes it easy to + compose complex graph which consists of several plot types +

+

+
+

+

+
User specified position of axis +

+

+
+

+

+
Designed as a flexible OO framework which makes it easy to add new + types of plots +

+

+
+

+

+
Supports automatic legend generation with custom formatting +

+

+
+

+

+
Supports both vertical and horizontal grids +

+

+
+

+

+
Supports anti-aliasing of lines +

+

+
+

+

+
Supports background images as well as unlimited number of icons in + the graph +

+

+
+

+

+
Supports rotation of linear graphs +

+

+
+

+

+
More then 400 named colors +

+

+
+

+

+
Designed modularly - you don't have to include code which isn't used +

+

+
+

+

+
Supports user specified callback for fine tuning scale labels +

+

+
+

+

+
Support for text augmentation of graphs +

+

+
+

+

+
Support for PHP Accelerator +

+

+
+

+

+
Support for a large set of 1D barcodes (EAN-128, ...) +

+

+
+

+

+
Support for Windrose plots +

+

+
+

+

+
Support for discontinuities in graphs +

+

+
+

+

+
Enhanced anti-aliasing for PieCharts +

+

+
+

+

+
More advanced formatting of graph titles including 3D Bevel effects. +

+

+
+

+

+
Additional 3D Bevel formatting feature for the entire Graph +

+

+
+

+

+
Footer text on all graph types +

+

+
+

+

+
Full support for color alpha blending +

+

+
+

+

+
Advanced interpolation with cubic splines to get smooth curves from + just a few data points. +

+

+
+

+

+
Several different fill styles for line plots +

+

+
+

+

+
Some image 3D effects built-in without external image manipulation + programs +

+

+
+

+

+
Additional built-in images for plot marks including 3D rendered + markers like diamonds, squares, bevels, balls, pins etc +

+

+
+

+

+
Support for calculation of linear regression +

+

+
+

+

+
Text strings can be added to the plot using scale coordinates +

+

+
+

+

+
Support for all primitive URL parameter types with CSIM graphs. +

+

+
+

+

+
Hare/Niemeyer Integer compensation for Pie Plots +

+

+
+

+

+
Possibility to use Vertical Gradient fill for line plots. +

+

+
+

+

+
Improved error handling. The visual appearance of the error handling + now tries to mimic any windows system window (in graphic) +

+

+
+

+

+
Builtin support to display over 200 country flag and the possibility + to use them as icons or markers in the graphs. All the flag images are + builtin with JpGraph in an efficient pre-compiled data format. +

+

+
+

+

+
Support for both Chinese and Japanese character sets +

+

+
+

+

+
Support for custom TTF fonts +

+

+
+

+

+
Support for 2D contour plots of 3D functions +

+

+
+

+

+
Unlimited number of data points (up to memory and CPU limit of + server) +

+

+
+

+

+
Windrose plots + +

+

+
Odometer plots + +

+

+
Graphic excel like tables + +

+

+
1D Linear barcodes (e.g. EAN8,13,128, Code39, 128, 2of5, Code-11, + Codabar etc) + +

+

+
2D-Barcode PDF417 + +

+

+
2D-Barcode Datamatrix + +

+

+
2D-Barcode QR-code + +

+

+
Matrix visualization + +

+

+
+


+

+

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.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch01s10.html b/includes/jpgraph/docs/chunkhtml/ch01s10.html new file mode 100644 index 0000000..caab06a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch01s10.html @@ -0,0 +1,79 @@ +Where to find additional information

Where to find additional information

+ +

The primary source for information is this manual together with theJpGraph web site which also + contains further links to many external sources of information.

+

Manuals and distributed documentation

+ +

+

  1. +

    The JpGraph user manual (this document)

    +
  2. +

    The JpGraph API reference manual. This reference contains details + about all public APIs available together with the classes.

    +
  3. +

    JpGraph UML static class diagram. This is an experimental + documentation which shows the static class dependency between all + classes in the library.

    +
  4. +

    The JpGraph + community forum. This is a discussion board for users of + the JpGraph library where users both give examples on how they have + used the library as well as asking and answering generic and + specific questions.

    +
  5. +

    The FAQ. This is available both on-line and in Appendix C. FAQ to this manual.

    +

+

+
+

On-line documentation and resources

+ +

The JpGraph document portal can be be found at http://jpgraph.net/doc/ + in addition to the distributed documentation there are several "HowTo" sections + which explains with some larger examples how to accomplish some specific type of + graphs and solve common problems.

+

In addition to the JpGraph Web site there are + a number of external sites with tutorials and examples on how JpGraph has been + used. This is not a complete list (nor will it ever be) but it lists a few of + the tutorials/examples that we are aware of. The following is a partial list of + known external tutorial showing more or less advanced examples on how to use + specific features of the library.

+

+

Caution

+

Usual caveats apply in that we can take no responsibility for the + correctness of these tutorials since we have no influence over + them.

+

+

+

+

Table 1.2. External JpGraph tutorial

+ +
Name/LinkDescription
Chart Dog Application.Application example
+ http://www.jimwrightonline.com/php/chartdog_2_0/chartdog.php
Découverte de la librairie Php + JpGraphFrench tutorial
+ http://eric-pommereau.developpez.com/tutoriels/decouverte-jpgraph/
Einführung zu JPGraphGerman tutorial
+ http://www.binnendijk.net/jpgraph/index.php
Des graphes en Php avec + JpGraphFrench tutorial
+ http://www.journaldunet.com/developpeur/tutoriel/php/011121php_jpgraph.shtml
Developing Professional Quality Graphs with + PHPEnglish tutorial
+ http://devzone.zend.com/article/1260-Developing-Professional-Quality-Graphs-with-PHP
PHPHacks.com Posts Creating charts with + JPGraphEnglish tutorial
+ http://devzone.zend.com/article/994-PHPHacks.com-Posts-Creating-charts-with-JPGraph
Simple linear regression with + PHPIBM developer works article
+ http://www.ibm.com/developerworks/web/library/wa-linphp2/
Dreamweaver ArticleHow to integrate with Dreamweaver
+ http://www.adobe.com/devnet/dreamweaver/articles/php_graphics_11.html
JPGraph Library V2.2 + TutorialTypo3 integration
+ http://typo3.org/documentation/document-library/extension-manuals/rt_jpgraphtutor/current/
Introduction to JPGraph (Part + I)Basic introduction
+ http://www.devtutorials.info/articles/1334_Introduction_to_JPGraph__Part_I_.asp
PHP Graphics With JpGraph + Downloadable tutorials
+ http://rosihanari.net/web-tutorial/php-graphics/
JpGraph: PHP Graphs & Charts + On-The-FlyBasic introduction
+ http://www.communitymx.com/abstract.cfm?cid=2AB8E
Using JpGraphJpGraph and Cake
+ http://bakery.cakephp.org/articles/view/using-jpgraph
Create High Quality Graphs with + JpgraphBasic introduction
+ http://phpkitchen.com/2002/05/create-high-quality-graphs-with-jpgraph/
JpGraph tutorial Integration with Prado
+ http://www.pradosoft.com/wiki/index.php/JpGraph_tutorial
+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch02.html b/includes/jpgraph/docs/chunkhtml/ch02.html new file mode 100644 index 0000000..4fd640f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch02.html @@ -0,0 +1,72 @@ +Chapter 2. The Short Version: Installing the library (for PHP/Apache experts)

Chapter 2. The Short Version: Installing the library (for PHP/Apache experts)

+ +

+ What you will learn in this chapter.  + This chapter will show you how to unpack the library and lists the minimum + prerequisites that is needed to get the library running. It is assumed that your are + familiar with adjusting the PHP configuration file php.ini and + that you already have a working PHP installation. +

+

Installing

+ +

Please follow the steps below:

+

+

  1. +

    Either download the free library from http://jpgraph.net/download/ + or use your license information and download the pro-version from + http://jpgraph.net/pro/login.php. The download + is just a packed zip (or tar.gz) of php files. There are no automatic + installation scripts.

    +
  2. +

    Unpack the library where you normally store PHP libraries. This should + be in your PHP include path. When you unpack the library it will be + named "jpgraph-3.x" (where x corresponds to the version you have + downloaded).

    +
  3. +

    Now either rename the unpacked the directory to just jpgraph or if the + system us Unix based create a soft symbolic link, for example

    +

    ln -s jpgraph-2.x jpgraph

    +

    This will allow you to access the library files in your own program + for with a require_once('jpgraph/jpgraph.php')

    +
  4. +

    Make sure that the GD extension is enabled in your + php.ini file (check the output from + phpinfo() )

    +
  5. +

    [Optional] Verify that the paths defined in + jpg-config.inc.php corresponds to the server + setup. The path to your TTF fonts must be correct. If you get an error + saying that some TTF fonts cannot be found or read then the path needs + to be adjusted in this configuration file.

    +
  6. +

    [Optional] Check that you have sufficient memory and execution time + set in your php.ini file. It is recommended to + allow at least 32Mb memory for PHP if you intend to run anything else + than very basic graph scripts.

    +
  7. +

    [Optional] To allow for better debugging in conjunction with graph + scripts the output buffering should also be disabled in + php.ini

    +
  8. +

    [Optional] To avoid warning messages it might be necessary to set the + default timezone in php.ini if this has not already + been done. Starting with PHP 5.2 a warning is generated if the timezone + for PHP is not set.

    +

+

+

Tip

+

When you install the library on a production server then you should not + install the library in the document root. Instead it should be installed so that + only the script can directly access the library files (somewhere in the PHP + path).

+

If you have the pro-version you really should install the pre-compiled version + of the library (available under directory PhpExpress-src. + This will significantly increase the performance of the library. The only + prerequisite is that you also need to install the (free) PhpExpress PHP + Accelerator from NuSphere Corporation. See Chapter 11. NuSphere PHP accelerator for information on how to install the + freely available PHP Accelerator.

+
+
+ + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch02s02.html b/includes/jpgraph/docs/chunkhtml/ch02s02.html new file mode 100644 index 0000000..f3cc71b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch02s02.html @@ -0,0 +1,14 @@ +Running the examples

Running the examples

+ +

The best way to verify that the installation is working is to run one of the + included example scripts. Assuming that the library is installed locally in the + document root on the HTTP server under jpgraph/ pointing the + browser to "http://localhost/jpgraph/Examples/example0.php" + should show the same image as can be seen in Example 1.1. This is the very first example (example0.php) .

+

In order to generate all the examples available there is a "meta script" that will + just do this. Point the browser to

+

"http://localhost/jpgraph/Examples/testsuit.php"

+

just note that this will generate a page with more than 300 examples. Depending on + the capacity of the server it might take a few seconds before this script is + done.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch02s03.html b/includes/jpgraph/docs/chunkhtml/ch02s03.html new file mode 100644 index 0000000..c12185b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch02s03.html @@ -0,0 +1,27 @@ +Basic trouble shooting

Basic trouble shooting

+ +

If none of the examples above to work there is a couple of things that needs to be + checked. If not any of these quick fixes solves the problem then it is best to read + the long version of the installation instructions before continuing the trouble shooting.

  1. +

    Verify that the GD library is really working by running + phpinfo() and check that your output includes a GD + section which should show similar information as the image below

    +

    +

    Figure 2.1. phpinfo() GD sections

    + +
    phpinfo() GD sections
    +


    +

    +
  2. +

    Make sure you have enabled strict error checking and disabled output + buffering in php.ini. This might not solve the + problem by itself but it will enable (better) error messages to trouble + shoot the installation.

    +
  3. +

    Make sure that you are using a recent version of PHP (e.g. ≥ + PHP 5.2.x)

    +
  4. +

    Make sure that the path to the TTF directories are correctly specified + in jpg-cnfig.inc.php

    +
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch03.html b/includes/jpgraph/docs/chunkhtml/ch03.html new file mode 100644 index 0000000..625e5f5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03.html @@ -0,0 +1,83 @@ +Chapter 3. The Long Version: Installing the Library

Chapter 3. The Long Version: Installing the Library

+ +

+ What you will learn in this chapter.  + You will learn in detail how to configure and setup an environment to be able to + run the JpGraph library. The chapter will explain all configuration necessary in + great details and will also list some more extensive trouble shooting steps if you + encounter problems trying to get the library running. The only assumption is that + you have a working PHP installation together with your HTTP server. +

+

Downloading the library

+ +

+

Downloading the free version
+

Point the browser to + "http://jpgraph.net/download/" + and select the 3.x series if your are running PHP5 and the 1.x + series if you are still running a PHP4 installation.

+

+

Note

+

The 1.x series of the library is no longer maintained so + in case you have not yet upgraded top PHP5 you should + strongly consider this.

+

+

+
Downloading the pro version
+

+

  1. +

    Locate your license file that was sent to you when you + purchased the library. You will need both the license + number as well as the registered license mail as stated + in the license. Your license information should look + similar to:

    +

    +

    ----------------------------------------------------------
    +: Your license key : JPGP-0920-1234657  
    +:  Name on license : A. JpGraph User 
    +:           E-mail : jpgraph-user@example.com
    +----------------------------------------------------------
    +

    +

    +
  2. +

    Point the browser to + http://jpgraph.net/pro/login.php + and enter your licence email and key on the + website.

    +

    +

    Figure 3.1. Pro-login dialogue on JpGraph Website

    + +
    Pro-login dialogue on JpGraph Website
    +


    +

    +
  3. +

    Depending on your system you should now download + either the 1.x or the (preferred) 3.x series. There is a + choice to either download the library as a "*.zip" file + or as a compressed "*.tar.gz" file (which is the + preferred format in a Unix environment). Save the + downloaded file to a temporary directory of your + choice.

    +
  4. +

    [Optional] Verify your downloaded file against the + given MD5 sum on the website. On a Unix system this can + be done by running the md5 program + and give the downloaded library as the argument.

    +

    For example: $> + md5 + jprgaph-3.0.0p.tar.gz

    +
  5. +

    Unpack the library to a suitable directory that is in + your PHP include path as is described in Installing the library

    +

+

+

+

+
+ + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch03s02.html b/includes/jpgraph/docs/chunkhtml/ch03s02.html new file mode 100644 index 0000000..a70bcc0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03s02.html @@ -0,0 +1,296 @@ +Necessary system requirements for the library

Necessary system requirements for the library

+ +

In order to run the JpGraph library there are some prerequisites that must be + fulfilled. The PHP installation must have the low level graphic primitive library + "GD" enabled and if TTF fonts shall work in the graphs the FreeType 2.x library must + be enabled and installed in the PHP setup. Most modern PHP systems (since at least + 2006) usually have these extensions enabled and installed by default which means it + is usually rather simple to get the library working.

+

However, there are many systems out there and some older non-standard systems will + require some manual intervention to work correctly.

+

Caution

+

One more time; The library is not guaranteed to run on a 64Bit OS. We will + point out this several more time during this manual.

+
+

Verifying the PHP/GD installation

+ +

The first and most important step is to make sure that your PHP installations + has the GD library enabled. The easiest way to find out if this has been enabled + or not is to create a one line PHP program that has only one instruction, + phpinfo()

+

+

1
+
<?php phpinfo(); ?>

+

+

Store this basic program as phpinfo.php in the document + root. Then point the browser to

+

+ http://localhost/phpinfo.php +

+

If the steps above was followed the browser should now show a lot of + information about the PHP installation. In order to find out if the GD have been + installed and enabled look for the GD section in the output. The figure below + shows a typical output of this section

+

Figure 3.2. phphinfo() GD-Information

+ +
phphinfo() GD-Information
+


There are three important points to notice here.

  1. +

    The GD Version. It should be 2.0.x. The GD version has been + shipped with PHP for the last four years so this should not really + be a problem. If for some odd reason the system only have GD 1.x + installed then JpGraph 2.x, and 3.x cannot be used but it is still + possible to use JpGraph 1.x.

    +

    In addition the "bundled" version of GD should be used. This + version is maintained together with PHP and is usually much more up + to date then the stand alone GD version.

    +
  2. +

    FreeType version. This is required in order to use TTF fonts. This + should be at least version 2.3.x Previous versions of the FreeType + library have had known issues which has caused issues when used + together with JpGraph.

    +
  3. +

    The final point worth checking is what type of image encoding the + installation supports. The most common formats are PNG and JPEG. By + default the library uses the PNG encoding format so it is important + to check that the line that says "PNG Support" has "enabled" as + value. As a rule of thumb PNG usually gives the smallest sizes of + graph (best compression) so this is the recommended format. The only + exception to this rule might be if a photo is used as background in + the graph. Then it is possible that JPEG encoding gives a better + compression since this is a destructive format (while PNG is a + lossless format).

    +

    For legacy reason it is also possible to use GIF encoding if the + server supports this but if PNG is installed there are no good + technical reasons to use GIF compression format. (The only possible + usage of GIF is the ability to create an animated image by + concatenating a number of GIF images which are then displayed in + sequence. This is not possible with the (old) PNG standard.)

    +
+

In order to remove any remaining doubts that the installation works as + intended the following PHP script that only uses the GD library primitives + should be run. This allows troubleshooting the installation without involving + the additional complexity of JpGraph to make sure that the basics are in + place.

+

Store the script in Example 3.1. Verifying the GD installations (checkgd.php) your document root as + "checkgd.php"

+

Example 3.1. Verifying the GD installations (checkgd.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php // content="text/plain; charset=utf-8"
+$im = @imagecreate (200, 100) or die ( "cannot create a new gd image.");
+$background_color = imagecolorallocate ($im, 240, 240, 240);
+$border_color = imagecolorallocate ($im, 50, 50, 50);
+$text_color = imagecolorallocate ($im, 233, 14, 91);
+ 
+imagerectangle($im,0,0,199,99,$border_color);
+imagestring ($im, 5, 10, 40, "a simple text string", $text_color );
+header ("content-type: image/png");
+imagepng ($im);
+?>

Figure 3.3. Verifying the GD installations (checkgd.php)

Verifying the GD installations (checkgd.php)

+

Now point the browser to this file and fetch the script. This should show an + image in the browser with the text "a simple text string" similar to what is + shown in Figure 3.3. Verifying the GD installations (checkgd.php)

+

In order to be really sure that the GD 2.x version of the GD library is + installed (as opposed to just GD 1.x) we need to use a slightly more advanced + script that makes use of some features available in GD 2.x but not in GD 1.x. + The largest difference is the support for TrueColor images in GD 2.x so we + create a script that makes use of a truecolor canvas..

+

Example 3.2. Verifying GD2 (checkgd2.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php // content="text/plain; charset=utf-8"
+$im =  imagecreatetruecolor ( 300, 200);
+$black = imagecolorallocate ($im,  0, 0, 0);
+$lightgray = imagecolorallocate ($im,  230, 230, 230);
+$darkgreen = imagecolorallocate ($im,  80, 140, 80);
+$white = imagecolorallocate ($im,  255, 255, 255);
+ 
+imagefilledrectangle ($im,0,0,299,199 ,$lightgray);
+imagerectangle ($im,0,0,299,199,$black);
+imagefilledellipse ($im,150,100,210,110,$white);
+imagefilledellipse ($im,150,100,200,100,$darkgreen);
+header ("Content-type: image/png");
+imagepng ($im);
+?>

Figure 3.4. Verifying GD2 (checkgd2.php)

Verifying GD2 (checkgd2.php)

+

In the same way as before store this file on the server and point the browser + to it. The result should be the same image as is shown in Figure 3.4. Verifying GD2 (checkgd2.php)

+

In order to use the library it is absolutely necessary that the + above two scrips works as described. If this is not the case the + php.ini file needs to be checked as described in + the next section.

+
+

Enabling GD library in php.ini for PH5

+ +

If neither of the two example above worked and the GD section didn't exist in + the output from phpinfo() the chances are that the GD library has + not been enabled in the php.ini file.

+

The first problem to solve is therefore to locate the + php.ini file in the installation. Depending on the type + of server (and OS) this can be in different places. If the system is running on + a Unix server the php.ini file is most likely stored in + either /etc/php.ini , /etc/php/php.ini + , /etc/php5/php.ini or + /etc/php5/apache/php.ini +

+

+

Tip

+

Check the output of phpinfo() to find out what + php.ini file the installation is + reading.

+

+

+

On a windows server there is no standard location since it completely depends + on how the installation of the HTTP server and PHP was done. For example if the + WAMP server was installed and put in the top directory + c:\wamp\ the php.ini file is + installed under c:\wamp\bin\apache\apache2.2.11\bin\php.ini +

+

Open php.ini in a editor and locate the line

+

extension_dir = <some-path-here>

+

The directory path specified above is the directory where all PHP extension + modules are stored. On a Unix system this is typically specified as + /usr/lib/php5/extensions now examine that directory and + check if an extension called "gd.so" (for Unix) or + "gd.dll" (for Windows) exists (and is un-commented). If + this extension cannot be found then this extension needs to be installed. For + example, many Unix/Linux installation requires that the extra modules in PHP is + manually enabled/installed through the appropriate Packet manager as the example + below shows.

+

+

Example 3.3. Installing GD through RPM packet manager

+ +

+

$/> sudo zypper install php5-gd

+

+


+

+
+

Verifying TTF fonts

+ +

This section is only intended to verify if that support exists for TTF fonts. + If this does not work or if it is already known that there are no support for + TTF fonts then please go directly to Installing and configuring Font support

+

In order to check if basic TTF font support is available create the following + script in the document root and name it checkttf.php +

+

Then it is necessary to locate on the system exactly where the TTF fonts are + stored and update the defines for the paths and/or the name of the TTF fonts + that is know to exist.

+

+

Example 3.4. Verifying TTF with a known font (checkttf.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+// Change this defines to where Your fonts are stored
+DEFINE("TTF_DIR","/usr/share/fonts/truetype/");
+ 
+// Change this define to a font file that You know that You have
+DEFINE("TTF_FONTFILE","arial.ttf");
+ 
+// Text to display
+DEFINE("TTF_TEXT","Hello World!");
+ 
+$im = imagecreatetruecolor (400, 100);
+$white = imagecolorallocate ($im, 255, 255, 255);
+$black = imagecolorallocate ($im, 0, 0, 0);
+$border_color = imagecolorallocate ($im, 50, 50, 50);
+ 
+imagefilledrectangle($im,0,0,399,99,$white);
+imagerectangle($im,0,0,399,99,$border_color);
+imagettftext ($im, 30, 0, 90, 60, $black, TTF_DIR.TTF_FONTFILE,TTF_TEXT);
+ 
+header ("Content-type: image/png");
+imagepng ($im);
+?>


Figure 3.5. Verifying TTF with a known font (checkttf.php)

Verifying TTF with a known font (checkttf.php)


+

+

As usual point the browser to this script and fetch the image. If thing works + an image identical to what is shown in Figure 3.5. Verifying TTF with a known font (checkttf.php) should be visible.

+

Name of TTF font files

+ +

The library has built in support for large number of TTF fonts, this + includes both the standard MS WEB core fonts as well as Vera and DejaVu + fonts. In addition a number of non-latin fonts are supported. This includes + both Japanese, Chinese, Hebrew and Russian fonts. See Using non-latin based fonts with JpGraph and Character encoding for more on how to use non-latin + fonts and encodings.

+

In order for the fonts to be usable by the library the font files must + have the following names (these are the standard names)

+

More information on how to use TTF fonts in scripts can be found in Chapter 8. Text and font handling

+

+

Table 3.1. Latin TTF font file names

+ +
Font family nameSymbolic nameNormal, FS_NORMALBold, FS_BOLDItalic, FS_ITALICBold italic, FS_BOLDITALIC
CourierFF_COURIERcour.ttfcourbd.ttfcouri.ttfcourbi.ttf
GeorgiaFF_GEORGIAgeorgia.ttfgeorgiab.ttfgeorgiai.ttf 
TrebucheFF_TREBUCHEtrebuc.ttftrebucbd.ttftrebucit.ttftrebucbi.ttf
VerdanaFF_VERDANAverdana.ttfverdanab.ttfverdanai.ttf 
Times romanFF_TIMEStimes.ttftimesbd.ttftimesi.ttftimesbi.ttf
ComicFF_COMICcomic.ttfcomicbd.ttf  
ArialFF_ARIALarial.ttfarialbd.ttfariali.ttfarialbi.ttf
VeraFF_VERAVera.ttfVeraBd.ttfVeraIt.ttfVeraBI.ttf
Vera monoFF_VERAMONOVeraMono.ttfVeraMoBd.ttfVeraMoIt.ttfVeraMoBI.ttf
Vera serifFF_VERASERIFVeraSe.ttfVeraSeBd.ttf  
(Chinese) SimsunFF_SIMSUNsimsun.ttcsimhei.ttf  
ChineseFF_CHINESEbkai00mp.ttf   
(Japanese) MinchoFF_MINCHOipamp.ttf   
(Japanese) P MinchoFF_PMINCHOipamp.ttf   
(Japanese) GothicFF_GOTHICipag.ttf   
(Japanese) P GothicFF_PGOTHICipagp.ttf   
(Hebrew) DavidFF_DAVIDDAVIDNEW.TTF   
(Hebrew) MiriamFF_MIRIAMMRIAMY.TTF   
(Hebrew) AhronFF_AHRONahronbd.ttf   
DejaVu Sans SerifFF_DV_SANSSERIFDejaVuSans.ttfDejaVuSans-Bold.ttf, DejaVuSans-Oblique.ttfDejaVuSans-BoldOblique.ttf
DejaVu Sans Serif MonoFF_DV_SANSSERIFMONODejaVuSansMono.ttfDejaVuSansMono-Bold.ttfDejaVuSansMono-Oblique.ttfDejaVuSansMono-BoldOblique.ttf
DejaVu Sans Serif CondensedFF_DV_SANSSERIFCONDDejaVuSansCondensed.ttfDejaVuSansCondensed-Bold.ttfDejaVuSansCondensed-Oblique.ttfDejaVuSansCondensed-BoldOblique.ttf
DejaVu SerifFF_DV_SERIFDejaVuSerif.ttfDejaVuSerif-Bold.ttfDejaVuSerif-Italic.ttfDejaVuSerif-BoldItalic.ttf
DejaVu Serif CondensedFF_DV_SERIFCONDDejaVuSerifCondensed.ttfDejaVuSerifCondensed-Bold.ttfDejaVuSerifCondensed-Italic.ttfDejaVuSerifCondensed-BoldItalic.ttf
+


+

+

+

Note

+

For the DejaVu fonts there are actually two common sets of name in + usage depending on how long it has been since the fonts where + installed. The library knows of both sets of names and will try them + in order selecting to use the first one available.

+

+

+
+
+

Support for different image formats

+ +

By default the standard GD image library supports the PNG graphic format.

+

Hence by default only PNG is supported. If JPEG support is needed this might + require additional libraries that must be installed and enabled for usage by + PHP/GD (in the php.ini file), 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 that there should be very good reasons to choose any + other image encoding formats than PNG. By default the image format is set to + "auto". This means that JpGraph automatically chooses the best available image + encoding format using the preferred order "PNG", "GIF" and "JPG".

+

No support for SVG

+ +

We have received may requests to add support for SVG image output. + Unfortunately we have investigated this and concluded that it is + (surprisingly!) not technically possible to do this. The main reason is that + with the current standard there is no way to statically determine the + bounding boxes for texts. This is further described in Appendix K. Why it is not possible to add a SVG backend to JpGraph

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch03s03.html b/includes/jpgraph/docs/chunkhtml/ch03s03.html new file mode 100644 index 0000000..5301094 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03s03.html @@ -0,0 +1,444 @@ +Installing the library

Installing the library

+ +

When you have verified the necessary preconditions as described in the previous + paragraphs it is time to install the library. The "installing" part is nothing more + than copying the files in the distribution to a place in the directory structure + where you script can find the library files. On a Unix system it is common to + install PHP libraries under "/usr/share/php/". On a windows + system there is really no standard path for installing PHP libraries so you have to + decide your self.

+

The important thing here is that the path to the library is included in the PHP + search path, i.e. it is in one of the paths that PHP searches when it tries to + resolve a "require_once" or "include" statements. + Furthermore, the included examples and demo applications (included in the pro + version) assumes that the library is installed under the directory + "jpgraph/".

+

As an example the following commands will install a specific version of the + library on a Unix server. If we assume that you have downloaded the library to the + "/tmp/" directory and are already standing in this + directory the following commands will setup the library to be used

+

+

root:/tmp> tar xzf jpgraph-2.5.tar.gz
+root:/tmp> cp -r jpgraph-2.5 /usr/shar/php/
+root:/tmp> ln -s /usr/shar/php/jpgraph-2.5 /usr/shar/php/jpgraph

+

+

The last line makes a symbolic link from "jpgraph" to the actual version of the + library. This way you can try out different versions of the library without having + to make any changes in your scripts. You just point out a different version of the + library in the symbolic link.

+

Configuring JpGraph/PHP on a development server

+ +

Setting up your php.ini file

+ +

+

Tip

+

To find the location of your php.ini file + create and run a script with the single line <?php + phpinfo(); ?> . The look at the output for a line saying + "php.ini file used" and you will see which + php.ini file is used.

+

+

+

Setting the memory limits

+

In many default configuration the allowed memory for PHP is not enough for + complex graph script since they (as many other image manipulation programs) + can require a lot of memory. On a development server there should be at + least 32MB memory allowed for the HTTP/PHP process. To verify this do the + following

+

+

  1. +

    Open php.ini for editing.

    +
  2. +

    Locate the line saying

    +

    memory_limit = xx

    +

    where "xx" is some number. Now make sure that you have at + least 32MB allowed by making sure the line reads

    +

    memory_limit = 32M

    +

    Note that fore very large images this might not be enough. + Consider the following example.

    +

    Assume you need to create an 1200x1024 image in true color. + Just the plain image in itself will require 1200x1020x4 bytes, + which is roughly 4.7MB RAM during internal processing the + library can need up to three times that amount of memory so this + means that just for the image the library needs around of ~15MB + of RAM. If we then take the memory needed to load PHP as well as + the entire JpGraph library and dynamically execute and parse the + library it can easily consume another ~15MB RAM. If the image is + very complex and requires a huge number of objects to be created + (a typical example is a large Gantt chart) it might be necessary + to double the allowed memory to 64MB RAM.

    +

+

+

+

Setting maximum allowed run time

+

By default many installations have very short maximum run time for the PHP + scripts. Common figures are 10s. For normal interactive use involving plain + text processing this is usually adequate. However, producing large and + complex images might take considerable time (as do all images processing). + For this reason the maximum time limit for PHP should be increased to a + minimum of 20s (depending on the complexity of your images as well as any + associated data processing it might be necessary to allow up to + 30-40s).

+

The allowed running time is controlled by the php.ini + setting

+

max_execution_time = xx

+

where "xx" is some number. Recommended setting is therefore

+

max_execution_time = 30

+

+

Disabling output buffer

+

The next part of the php.ini file that might need + changing is the output buffer. In short this should be disabled and we will + shortly explain why. To check this do the following

+
  1. +

    Open php.ini for editing

    +
  2. +

    Locate the line saying

    +

    output_buffering = xx

    +

    where "xx" is some number. Make sure that this line is + commented out, i.e. it reads

    +

    ; output_buffering = xx

    +

This reason we want this to be commented out is that during + development we want to be able to see the potential error messages produced + by the library and having the output buffering enabled will actually prevent + this. Fully understanding why this is the case is good first step into the + added complexity of producing images with PHP compared with just outputting + text. Understanding this requires us to understand a few basic principles + about the HTTP protocol. Especially how MIME encodings of data works.

+

The following explanation is slightly simplified since a full description + of the HTTP protocol would bring us a bit to far in this manual

+
  1. +

    A client (e.g. browser) requests data from the server by + issuing a GET (or possible a POST) command to the server. This + is what happens when you enter a URI i the address bar in the + browser.

    +
  2. +

    The server replies with a data stream (or an error if the + requested data wasn't available). This data stream is prepended + with header (MIME header) that tells the client (e.g. the + browser) how to interpret the data that follows. The most common + type (and the default type if no header is sent by a faulty + server) is "text/html" . This tells the client to interpret the + data as plain text with embedded HTML encoding.

    +

    When the data is to be interpreted as an image the header will + instead be one of the image headers, for example + "image/png" or "image/jpeg". When + the client receives this header it will Interpret all the + following data as an image encoded in the indicated format.

    +

    The important thing to keep in mind here is that each server + reply can have one and only one MIME type. This is the key to + further understanding the specific issues with dynamic image + generation. This explains why if a PHP script running on the + server sends a header first indicating that the following data + it sends should be interpreted by the client as an image it + cannot send both image data and some text.

    +

We are now in a position to explain how output buffering would + make debugging more difficult.

+

Normally all output from a PHP script is sequentially, i.e. the header + must first be sent and then the data. If no header is sent or plain text is + sent without a header the client will interpret this as + "text/html". One purpose with "output_buffer" it to + circumvent this to allow a certain amount of output to be put in a buffer + for a while and later when some processing has determined what header should + be sent the data is prepended with the correct header and the rest of the + data is then sent.

+

What could now happen is the following (not unlikely scenario):

+
  1. +

    The scripts starts executing and the image starts to be + build.

    +
  2. +

    Your script has some minor issues which produces some warnings + from PHP. These warning does not get sent directly back to the + client (the browser) to allow you to act on these warnings + instead they will be put into the output buffer. When later the + scripts starts outputting the proper image header and the image + data it gets added to the output buffer where your previous + textual PHP warning already are stored.

    +
  3. +

    Your client now receives the header that indicates that the + following data should be interpreted as an image but since that + image data is mixed with the textual warning messages it will + fail to decode the data (since it is not proper image data) and + will typical just show the image as a square with a red-cross + (FireFox) or some message along the lines of "Cannot decode image". This is all + depending on how a certain client handles a corrupt + image.

    +

The above scenario makes it impossible to debug your script + since it will give no clue to what caused or where in your script these + warnings were generated. The way to counteract this scenario is to disable + output buffering. In this way the warning will be sent back to the client as + soon as they are generated by PHP and will allow you to act on them.

+

+

Enabling adequate error checking

+

The final part of the php.ini file that should be + adjusted (and this is not only for the JpGraph library) is the error level. + To ensure maximum interoperability of the developed scripts they should all + run completely silent no matter what error levels are set on the server. + This means that development of all scripts should always be done with + maximum error checking enabled. The JpGraph library can safely run + completely silent even when all error checking is enabled.

+

The error checking should therefore be specified as

+

error_reporting = E_ALL | E_STRICT

+

to enable the highest degree of PHP error checking

+

+

+

Tip

+

In addition to the above setting it is a good idea to also to + makes sure that the following options are set

+

zend.ze1_compatibility_mode = Off

+

Zend engine 1 compatibility might cause problems with the + library

+

implicit_flush = On

+

This can reduce the performance and shouldn't be used on a + production server but will make all outputs sent back to the client + as soon as possible and will aid in debugging.

+

allow_call_time_pass_reference = Off

+

This is just a general good idea since call time pass references + is deprecated in PHP 5.0 and higher

+

display_errors = On

+

This makes sure all error are displayed

+

display_startup_errors = On

+

This makes sure that any initial errors thrown by PHP will be + reported

+

+

+

Setting default timezone

+

Starting with PHP 5.2 a warning will now be generated unless a default + time zone is explicitly specified in php.ini. To set + this find the line date.timezone in the + [Date]section and set this to valid zone. For example to + specify GMT+1 one could specify

+

date.timezone = Europe/Paris

+

Note: There should be no citation signs around the time zone.

+

+

Caution

+

In order to use the LED module (See LED bill boards) the PHP installation must + have multi-byte strings enabled so that the function + mb_strlen() is available. This is normally + enabled at compile time for PHP by specifying the options + --enable-mbstring --enable-mbregex when configuring + the compile options.

+

+

+

+

Caution

+

In order to use the PDF417 barcode module (See Chapter 25. PDF417 (2D-Barcode)) it is necessary for the PHP + installation to support the function bcmod(). + This is enabled when compiling PHP by making sure that the option + --enable-bcmath is given when configuring PHP at + compile time.

+

+

+
+

Setting up your jpg-config.inc.php

+ +

Apart from the standard configuration described in Installing and configuring Font support and Adapting and customizing the installation there is only one important + configuration that is specific for a development server and that is the + localization setting for error messages.

+

As of version 3.0.0 there are three localization options

+
  1. +

    English error messages ("en")

    +
  2. +

    German error messages ("de")

    +
  3. +

    Production error messages ("prod"). This is not really a + localization but a different set of error messages which does + not give detailed error messages but a generic message suitable + for a production server where the end user is not helped by + detailed graph script errors. Instead a generic message is shown + together with an error code that corresponds to the detailed + error. ("prod")

    +

In order to specify the error message localization the + following define in jpg-config.inc.php must be set the

+

define('DEFAULT_ERR_LOCALE','en');

+

The possible options are

+

+

  1. +

    "en", English locale

    +
  2. +

    "de", German locale

    +
  3. +

    "prod", The production version of the error messages.

    +

+

+

+

Tip

+

In addition to specifying the locale in the + jpg-config.inc.php file it can also be + specified dynamically in each script by calling

+

+

1
+
JpGraphError::SetErrLocale($aLocale);

+

+

+

+
+
+

Configuring JpGraph/PHP on a production server

+ +

Setting up your php.ini file

+ +

Apart from what is applicable to a development server as described in Configuring JpGraph/PHP on a development server the following changes should be + considered in a production environment.

+

+ Setting the memory limits +

+

The one thing to keep in mind here is that each active connection will + spawn a unique PHP instance (HTTP process). This means that the memory limit + set per PHP process can cause a very high memory demand on a busy server + with many simultaneous connections. For this reason it is important that + during system test (before going into production) the actual needed memory + limit is determined.

+

For a busy server it is not uncommon to dimension it so it can handle 100 + simultaneous connections. If the limit of r each PHP process is set to 32MB + this means that the server needs at least ~3.2GB memory just to handle the + PHP processes (if they are all using there maximum allowed memory).

+

+ Setting maximum allowed run time +

+

The same principle applies to a the allowed run time. For a production + server with high load and many simultaneous users it might be necessary to + increase the maximum allowed execution time just to be sure no process is + terminated due to it reaching its maximum allowed run time. When that + happens the PHP process will be killed an no output sent back to the client + (e.g. the browser).

+

+ Disabling output buffer +

+

The output buffer should be disabled on the production server as well + since enabling this will slow down the PHP and put a higher demand on the + memory requirements.

+

+ Enabling adequate error checking +

+

On a production server it is not a good idea to display all PHP error + messages to the end user so the display of error messages should be disabled + and the error messages should only be logged to a file.

+

Tip

+

On a production server it is also a good to idea to have the + following settings:

+

+ display_errors = Off +

+

This makes sure that now PHP errors are displayed

+

+ display_startup_errors = Off +

+

This makes sure that any initial errors thrown by PHP is not displayed + to the end user

+

log_errors = On

+

error_log = <name-of-log-file>

+

This makes sure all server PHP errors are logged to a specified + file

+
+
+

Setting up your jpg-config.inc.php

+ +

On a production server it is best not to show detailed error messages to + an end user. Instead it is better to have a generic error message that + indicates a server problem and give an error code which can be decoded by + looking it up in the table in Appendix H. Error messages Using a generic error message is achieved by + setting the following define:

+

define('DEFAULT_ERR_LOCALE','prod');

+
+
+

Adjusting PHP include path

+ +

As was mentioned before the library should be installed somewhere in the PHP + include path. There are two ways of configuring the include path:

+

+

  1. +

    setting the include path in php.ini

    +

    include_path = <file-path>

    +
  2. +

    adjusting the include path directly in the code by using the PHP + command php_ini_set() at the top of the script

    +

+

+

The library examples assume that the library is available under a directory + called "jpgraph/" . This will allow the scripts to include + the library files by, for example, writing "include" or + "require_once" statements such as

+

require_once( 'jpgraph/jpgraph.php')

+
+

Using Apache2 alias configuration during development

+ +

+

Note

+

This section only discusses alias setting using the Apache HTTP server + so this section can be skipped at first time reading the manual without + loss of continuation.

+

+

Note

+

More detailed information on the alias directive is also available in + the official Apache documentation at http://httpd.apache.org/docs/2.2/mod/mod_alias.html

+

+

+

When accessing examples and test code through a regular bowser during + development the scripts must be available in document root (or somewhere beneath + that root) the root is traditionally named /htdocs. Having a + development code/repository directly under this root directory is not a good + idea. For example, write access to a document root (even on a development + server) should be restricted, in addition the paths given to a test team should + be the same whatever version is currently under test so storing different + versions with different names under the root is also a poor setup.

+

A much better and easy, approach is to use the powerful concept of alias in + Apache. This is a way of mapping a URL to a specific directory on the server. + For example if Eclipse-PDT + is used as an IDE to develop PHP it is mandatory to have a workspace setup where + all the working files resides. Assuming that a local developer has his workspace + directly in his home directory, say ~joe/workspace, we + could configure an alias so that the workspace is accessible by the alias + "http://localhost/ws/" by adding the following + configuration in the Apache setup file(s)

+
1
+2
+3
+4
+5
+
Alias /ws /home/joe/worksapce
+<Directory /home/joe/workspace>
+  Order allow,deny
+  Allow from all
+</Directory>
+

In this particular setup we use very liberal settings, allowing basically + everyone with server access to access the directory. Using this approach makes + it very easy to use the same test setup but allow testing of different + branches/versions of the code.

+

Depending on the system these configurations can reside in different places. + However, a very common structure is to keep all these small configuration files + under /etc/apache/conf.d/ The main Apache configuration + then reads all the files (regardless of there name) that are stored under this + directory.

+

As a final example we show a further slightly more complex example (which + actually shows how most of our developers have there systems setup for PHP5 + development). This example adds options to do directory listing and allows the + server to follow symbolic links. More information on available argument for the + directive option is available in the official Apache documentation http://httpd.apache.org/docs/2.2/mod/core.html#options

+

+

Example 3.5. Alias configuration for a development server running Apache with + Eclipse-PDT

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
# Configuration for Eclipse workspace
+#
+<IfModule mod_php5.c>
+      Alias /ws/ /home/joe/workspace/
+      <Directory /home/joe/workspace/>
+             Options         +Indexes +Multiviews +FollowSymLinks
+             order allow,deny
+             allow from all
+      </Directory>
+</IfModule>
+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch03s04.html b/includes/jpgraph/docs/chunkhtml/ch03s04.html new file mode 100644 index 0000000..9a2198f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03s04.html @@ -0,0 +1,178 @@ +Installing and configuring Font support

Installing and configuring Font support

+ +

JpGraph supports two types of fonts, bitmap and TTF fonts. The advantage with + bitmap fonts are that they are supported from within the library without further + configuration. TTF fonts require some configuration and possible installation of the + actual TTF font specification file. (For more on installing TTF fonts see Configuring TTF fonts.)

+

The drawbacks, on the other hand, with bitmap fonts are quite a few

+

+

  • +

    they look quite crude and are only available in a few sizes

    +
  • +

    italic font style is not supported for bitmap fonts

    +
  • +

    they only support 7-bit ASCII characters

    +
  • +

    they only support 0 and 90 degree rotated text

    +

+

+

You can read more about how to use and select among the different fonts in Chapter 8. Text and font handling

+

Configuring TTF fonts

+ +

+

Note

+

This could be considered an optional section since the library will + work even without TTF fonts. However, for th reasons listed previously + it is strongly recommended that TTF support is configured.

+

+

+

In the following we will assume that the FreeType library is enabled and + verified in the PHP installation (See Figure 3.2. phphinfo() GD-Information)

+

Due to various legal issues no TTF fonts are included in the distribution of + JpGraph since many commonly used TTF font files are copyrighted and there + distribution restricted. For the most commonly used WEB-fonts (the Microsoft + Core Fonts) the status is unclear. For many years Microsoft distributed them + freely but they are no longer available from Microsofts home page. Instead they + are available from http://corefonts.sourceforge.net/ +

+

There are however a fair amount of freely available high quality TTF fonts + (see below). The first thing needed is to make sure that the path defines in the + file jpg-config.inc.php corresponds to the server setup (so + that the library can find the font files)

+
  1. +

    Open jpg-config.inc.php for editing

    +
  2. +

    Locate the define TTF_DIR (this is the define that + possible needs updating depending on your system). By default this path + will have a sensible values depending on if the library is installed on + a Windows or a Unix system.

    +
  3. +

    If you are on a Windows platform you can just point the TTF directory + path in JpGraph to use the standard Window font directory (e.g + C:\windows\fonts\)

    +
  4. +

    If you are on a Unix platform, which may not have any TTF fonts + installed, you can download and install the core MS WEB-initiative fonts + from http://corefonts.sourceforge.net/ + many Linux distributions also have automatic ways to install these + fonts. These fonts were put in the public domain by the Microsoft + Corporation but they are no longer available directly from + Microsoft.

    +
  5. +

    You can also chose to install the freely available Vera Bitstream TTF + fonts available from http://www.gnome.org/fonts/

    +
  6. +

    You can also chose to install the freely available DejaVu TTF fonts http://sourceforge.net/projects/dejavu

    +
+

JpGraph uses a standard naming convention for the TTF font files in order to + be able to find the correct font file that correspond to a particular font + family. This naming convention follows the standard naming of the available font + files from the distributions listed above.

+

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 in + modern installations are "/usr/share/fonts/truetype/" (In + older installations it was common to put the truetype fonts under + "/usr/X11R6/lib/X11/fonts/truetype/".)

+

Finally we note that it is possible to install additional fonts not natively + supported by the library by using the SetUserFont() family of + methods. (In theory it is also possible to patch the jpgraph source files to + include support for other font files natively but since this requires code + modifications of the library we do not discuss this further here in the + introduction.)

+

Freely available TTF fonts can be found, for example, from

+

+

+

+
+

Using non-latin based fonts with JpGraph

+ +

In addition to European fonts it is also possible to use non-latin based fonts + such as Cyrillic, Japanese, Chinese, Hebrew and Greek. For any of these + languages a suitable TTF font that supports the non-latin based language must be + made available to the library. Some specific rules also applies to each of the + supported languages due to the necessary character encoding needed due to + different convention when writing the character for some languages.

+

+

  • +

    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 of the ordinary font. This setting + combined with the CYRILLIC_FROM_WINDOWS and + LANGUAGE_CHARSET is used to fine tune the handling + cyrillic input. The rules are as follows:

    +

    +

    1. +

      If LANGUAGE_CYRILLIC is false no specific handling of + Cyrillic characters at all will be done.

      +
    2. +

      If CYRILLIC_FROM_WINDOWS is true then it will be assumed + the input coding by default is encoded using WINDOWS-1251.

      +

      The conversion is then done via a call to + convert_cyr_string($aTxt, 'w', 'k') + where $aTxt is replaced with the input + string to be encoded.

      +
    3. +

      If CYRILLIC_FROM_WINDOWS is false then it will be assumed + the input coding by default is encoded using KOI8-R.

      +

      The conversion is then done via the sequence of + callls

      +

      +

      1
      +2
      +3
      +4
      +
      <?php
      +$isostring = convert_cyr_string($aTxt, "k", "i");
      +$unistring = LanguageConv::iso2uni($isostring);
      +?>

      +

      +

      in oder to get a proper utf-8 internal encoding + (internally the library only uses utf-8 encoding)

      +
    4. +

      LANGUAGE_CHARSET can be used to + dynamically adjust the conversion of the input character + set when using cyrillic characters. This constant is + used to auto-detect whether cyrillic conversion is + really necessary if enabled (via the If + LANGUAGE_CYRILLIC=true) . This constant + can be set to a variable containing the currently used + character input set .A typical such string would be + 'UTF-8' or 'utf-8' (the comparison is case-insensitive). + If this charset is not 'koi8-r' nor 'windows-1251' + derivate then no conversion is done.

      +

    +

    +

    +
  • +

    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.

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch03s05.html b/includes/jpgraph/docs/chunkhtml/ch03s05.html new file mode 100644 index 0000000..01bbd5e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03s05.html @@ -0,0 +1,42 @@ +Adapting and customizing the installation

Adapting and customizing the installation

+ +

All configuration of the library is done in the file + jpg-config.inc.php. Each option in the file is extensively + documented in Appendix L. The JpGraph configuration file Here we will only cover the most important + configuration that it likely to have to be customized in order to successfully run + the library.

+

+

Note

+

All configuration settings comes with default values that should in normal + cases be enough for a "standard" system. However for a production system you + might want to fine tune this according to your specific system setup.

+

+

Tip

+

During development (and to some extent even on a production server) it + might be necessary to adjust some parameters in your + php.ini file. For more on this see Installing the library

+

+

+

Setting up necessary paths

+ +

There are three categories of directory paths that can be specified. The + categories are:

+

+

  1. +

    Font directories, this we already touched upon in Configuring TTF fonts.

    +
  2. +

    Cache directory, the cache feature of the library is extensively + discussed in Chapter 9. Using the JpGraph cache system. The important thing to notice + here is that whatever directory you chose to use as a cache + directory it must be a directory that is writable for the process + running PHP (normally the HTTP server process, e.g. Apache)

    +
  3. +

    CSIM Cache directory (if CSIM cache feature is used). CSIM stands + for Client Side Image Maps and is a way to construct client side + drill down charts. (Today this is the only inpractice used image + mapping method but it is also possible to have Server Side Image + Maps).

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch03s06.html b/includes/jpgraph/docs/chunkhtml/ch03s06.html new file mode 100644 index 0000000..4df6552 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03s06.html @@ -0,0 +1,30 @@ +Verifying the library installation

Verifying the library installation

+ +

After installing the library a good check that everything works is to run the + included example scripts. Worth noting is that some of the examples uses TTF fonts. + This means that if you try to run those examples on an installation that does not + have any TTF fonts configured an error message will be displayed.

+

Running your first example

+

If we assume that you have installed the library directly under the document root + on the HTTP server in a directory named "jpgraph/" you can access the + examples in the "jpgraph/Examples/" directory by pointing your + browser for example to "jpgraph/Examples/example0.php" . This + should then show the same image as is displayed in Figure 1.2. This is the very first example (example0.php)

+

If the above example works correctly you can run all the included examples by + pointing the browser to the script + "jpgraph/Examples/testsuit.php". This will automatically + generate all non-CSIM examples (for an explanation of CSIM graphs see ??) and show + them in one long list. Note that since this has more than 300 images it can take + some time to generate all example images.

+

+

Tip

+

In order to generate all CSIM examples you can run the testsuit with the + URL argument ?type=2

+

jpgraph/Examples/testsuit.php?type=2

+

You will then get a number of examples of so called drill-down charts + where a number of areas of the graphs a re hotspots which can be clicked to + open a specified URL. However, in these examples all the click-URL have just + dummy values which points back to the same file.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch03s07.html b/includes/jpgraph/docs/chunkhtml/ch03s07.html new file mode 100644 index 0000000..10437f1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch03s07.html @@ -0,0 +1,122 @@ +Troubleshooting the installation

Troubleshooting the installation

+ +

Unfortunately there are many parameters in a server installation that may affect + the execution of PHP so the steps below can only give some indications of how to + further investigate some potential problems.

+

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. So before starting trouble shooting the scripts please make sure that you + have an up to date PHP installation with the bundled version of the GD library (as + describe in the previous sections) and a working FreeType library installed.

+
  1. +

    No image is displayed.

    +

    The first thing you should do is to isolate the problem by calling + your graph script directly in the browser. There are then two variants + of this problem.

    +

    +

    1. +

      No data is sent back from the server.

      +

      You can verify this by calling your graph script directly + in the browser and then check the source (click "view + source" menu item in the browser). If this is a truly blank + image then no data was sent back from the browser.

      +

      This means that the PHP process has been terminated + prematurely before it could send any data back. This could + be caused by either the PHP process crashing (due to a bug + in either PHP or your HTTP server) or the HTTP server + crashed. This is often due to a broken PHP installation and + more than often a problem with the True Type libraries.

      +

      It could also be caused by the PHP script running longer + than the maximum allowed execution time (as specified in + php.ini). The first thing you + should do is to increase the maximum allowed execution time. + If this does not solve the problem you should look in the + log files for both your HTTP server and PHP to try to find + clues to if the PHP process really crashed. Another + possibility is that the PHP process uses more than the + maximum allowed memory (as set in + php.ini) and then it is terminated. + So a good first step is to put some really high values for + memory and time just to take away these parameters.

      +
    2. +

      The data sent back is corrupt.

      +

      Depending on your browser this can show up differently but + a common symptom is a "red X" in the browser. In order to + debug this you should make sure that you have followed the + steps in Configuring JpGraph/PHP on a development server to make sure you + have output buffering disabled and have maximum error + checking enabled in PHP. The most common cases for this type + of problem is having enabled output buffering and some minor + errors in the script which causes PHP to emit warnings which + gets included in the image data.

      +

      A very common mistake is to have some white spaces in the + script before the opening "<?php". This + white space will be added to the output buffer and then get + mixed up with the image data causing the image data to be + corrupt. A similar problem can occur if multiple newlines + are added after the final "?>" +

      +

    +

    +
  2. +

    An error message saying "Fonts are not available or not + readable"

    +

    When an image contains TTF fonts you might get an error message saying + that the fonts are not available or not readable. If this is the case it + is first necessary to check that the font files really exist in the + directory that is specified in jpg-config.inc.php + and that they are also readable by the HTTP/PHP process. If this is the + case then it is necessary to check that the names of the font files are + the one that JpGraph assumes, see Name of TTF font files. Another problem can be if + the PHP installation is running in "safe mode" (See PHP + Manual: Security and safe mode) and has enabled strict + directory policy via an "open_basedir" restriction. This + will prevent the PHP process from reading any files outside the + specified base directory. If this is enabled there is no way around for + PHP to read any files outside this restriction and any TTF files + necessary must be moved so that they can be accessed within the realms + of the specified basedirectory.

    +

    If you are running IIS and Win2k and get the error "Can't find font" + when trying to use TTF fonts then try to change the paths to UNIX style, + i.e. "/usr/local/fonts/ttf/". Remember that the + path is absolute and not relative to the htdocs + catalogue.

    +

    If you are running on Unix server please keep in mind that file names + are case sensitive.

    +
  3. +

    An error message saying "Headers have already been + sent"

    +

    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 + data 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".

    +

    Make sure that your script has no white space before the opening + "<?php" statement or a number of blank lines after + the concluding "?>"

    +
  4. +

    Issues specific to Windows and IIS

    +

    Some windows installations seems to have a problem with a PHP script + ending in more than one newline (This newline seems to be sent to the + browser and will cause a Header already sent error). To correct this + problem check all your scripts for more than one empty newline after the + ending "?>" statement. All files provided with the library + end in exactly one final newline and should not be a problem.

    +
  5. +

    TTF fonts are not displayed correctly

    +

    If the TTF fonts only shows up as yellow then the installation is used + a buggy (too old) installation of the FreeType font library and the only + thing to do is to re-install and setup PHP+GD again with a newer version + of the FreeType library. Another symptom of a an (old) buggy FreeType + library is that the fonts are not correctly rotated (the text string is + rotated but not the individual characters).

    +

As a final advise you should read the FAQ (available in this manual + see Appendix C. FAQ) or on the JpGraph website at http://jpgraph.net/doc/faq.php

+

Depending on your sever it might also help to recompile PHP yourself instead of + the version included with the system. You can find typical configuration scripts to + compile PHP4 and PHP5 in the appendices, see Appendix I. Compiling PHP +

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch04.html b/includes/jpgraph/docs/chunkhtml/ch04.html new file mode 100644 index 0000000..276750f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch04.html @@ -0,0 +1,26 @@ +Chapter 4. Your first graph script

Chapter 4. Your first graph script

+ +

+ What you will learn in this chapter.  + This chapter will illustrate how a basic line and bar graph can be created and it + will also show how input data should be prepared so it can be read and used by the + library. +

+

Some words of caution

+ +

In order to quickly show a very first example we will create both a basic line + graph and a basic bar graph that depicts the number of sun spots (a.k.a. solar + flares) during the 19th century. The goal of this example is not to show every + possible configuration and parameter supported by the library but rather show how + simple it is to create a basic graph.

+

In the sections following this one we will describe more in details the + idiosyncrasies about dynamic graph generation and JpGraph so even if you don't fully + understand all the detail it will give a flavor of what is to come. As with all + complex libraries one has to start somewhere and sometimes accept some practices + without yet fully understand them. However, the goal of this manual is that after + reading it through you will fully understand every single detail shown in this + script.

+

So, without further due, let's start.

+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/ch04s02.html b/includes/jpgraph/docs/chunkhtml/ch04s02.html new file mode 100644 index 0000000..937f8fb --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch04s02.html @@ -0,0 +1,573 @@ +Graphing the number of sun spots during the 19th Century

Graphing the number of sun spots during the 19th Century

+ +

The historic data

+ +

It is a well known fact that sun spots have a certain pattern and regularity. + The cause of these regular patterns are not currently fully understood (even + though investigation into this phenomenon has been made since beginning of the + 17:th century). The fact that solar storms affects the earth in terms of + interference with radio traffic and other sensitive electronic devices makes it + very interesting to keep careful records of the suns activities.

+

For this reason the data of solar storm is readily available and makes an + interesting first example. The data used here is taken from SIDC (The Solar + Influences Data Analysis Center) in Belgium (http://sidc.oma.be/sunspot-data/SIDCpub.php). + In this example we will use the summary historical data that shows the total + number of sun spots per year since 1700..

+
+

Preparing the data

+ +

The first step is to get the data into our PHP script which makes for a first + good discussion since all graphs needs to get data from some source. The library + itself is agnostic in regards to from where the data is collected and only needs + (and requires) data stored in a PHP array of numbers (integers or floats).

+

In principle the data to be plotted in the graph can come from :

+

+

  1. +

    Hard-coded data in the script. This is the least flexible and can + only really be recommended for examples and really static + data.

    +
  2. +

    Data stored in plain text files. (This is what we will use in this + example.)

    +
  3. +

    Data stored in binary format in flat files.

    +
  4. +

    Data stored in a database

    +
  5. +

    Data sent to the script via URI parameter passing (either GET or + POST HTTP constructs can be used).

    +

+

+

What is common among all these methods is that the creator of the script has + to read the data into one (or several) data arrays that can be used by the + library. For our example the data of sunspots are stored in a plain text file in + two columns, one column for the year (with a ".5" added which indicates the + average of the year) and one column for the number of sunspots for the + corresponding year. As illustration the first 10 lines of data is shown in Figure 4.1. The first ten rows of data of sunspot activities from year + 1700.

+

+

Figure 4.1. The first ten rows of data of sunspot activities from year + 1700

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
1700.5   5.0  
+1701.5  11.0  
+1702.5  16.0  
+1703.5  23.0  
+1704.5  36.0  
+1705.5  58.0  
+1706.5  29.0  
+1707.5  20.0  
+1708.5  10.0  
+1709.5   8.0
+


+

+

From this data we need to create two arrays, one with the number of sunspots + and one with the corresponding years. If we assume that the data is stored in a + text file named "yearssn.txt" in the same directory as the + script file the function in Figure 4.2. Reading numeric tabulated sunspot data from a filewill read the data into two arrays

+

+

Figure 4.2. Reading numeric tabulated sunspot data from a file

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+?>
+


+

+

In the function above we have deviated from the common practice of not + including even the most basic error handling in examples by adding an exception + in case the data file could not be read. This is to emphasize that graph scripts + which reads data from potentially disconnected sources must have real quality + error and exception handling. As this is the first example we will not discuss + the details of the error handling other than saying that the library provides + one exception class JpGraphException that is meant to be used by + clients to signal unrecoverable errors in the code. The full details on error + handling in the library is discussed in Chapter 6. Error handling

+

+

Tip

+

In the library there is an auxiliary utility class + ReadFileData to help read data from text files. In this + class there are methods to read data from a file in either of the + following formats

+

+

  • +

    CSV (Comma Separated Values) format. + ReadFileData::FromCSV()

    +
  • +

    two column format (almost) as we did manually above with + ReadFileData::From2Col()

    +
  • +

    one column format + ReadFileData::From1Col()

    +

+

+

+

+

Armed with the data in the two arrays $year and + $ydata we will now plot the data in a basic line graph with + some variations and then show the data in a bar graph.

+
+

A basic line graph

+ +

As the very first start we will create a line graph which shows sun spots as a + line graph. To keep the code focused on the graph we do not include the previous + function to read the data again in the code snippet shown below. Before we get + into the code we start by briefly discuss how your script can include the + necessary library files.

+

All graph scripts must include at least two files, + jpgraph.php and some plot module. If we want to create + a line plot we must include jpgraph_line.php. Slightly + depending on the server setup and what paths are defined for PHP include files + (as discussed in Adjusting PHP include path) the include paths for the + library might look a bit different. However, we recommend that you install the + library files so they can be accessed, for example using, + require_once('jpgraph/jpgraph.php') (since this is what is + assumed by the library examples). Furthermore, we would recommend that the + require_once() construct is used to avoid including the same + file multiple times.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>

+

+

Before we explain this code in some more detail it is a good idea to visualize + what we get when we execute this as script. The result of running this script is + shown in Figure 4.3. Line plot showing the number of sun spots since 1700 (sunspotsex1.php)

+

+

Figure 4.3. Line plot showing the number of sun spots since 1700 (sunspotsex1.php)

Line plot showing the number of sun spots since 1700 (sunspotsex1.php)


+

+

+

Tip

+

You can always click on the filename in the title of a figure to view + the complete source code.

+

+

+

Let us now walk through this code in some details.

+

+

Line 1-12
+

The size of the graph must always be specified so the first + thing to do is to create a new graph object and set the width + and height of the overall graph. All graph scripts will need to + create at least one instance of the Graph() class. + By convention in all our scripts we will name the created + instance of the Graph class "$graph"..

+

The second thing that all graph scripts must specify is what + kind of scales should be used. The library supports linear, + integer, logarithmic, text and date scales. Since we know that + our data consist of only integers we keep things simple and set + both the X and the Y axis scale to be integers. The scale is + specified as a string where the first half of the string + denominates the X-axis scale and the second half denominates the + Y-axis scale. So in our example we specify + 'intint'. With this explanation you can probably + guess what 'intlog' or 'linlog' would + do. Why not try it ?

+
Line 13-21
+

These lines sets some different text labels. By the naming + convention used in the library you can probably guess what all + those lines are doing. They set the overall graph title as well + as the X- and Y-axis titles. To keep the example as lean as + possible we use the default font and default size and color of + the text strings.

+
Line 22-27
+

Each graph must have at least one plot (data series) that is + added to the graph. In our case we wanted to create a line graph + so we must create an instance of the class + 'LinePlot'. We create a new instance of this + class and as a parameter use the data for the data series we + want to create the line plot from, in our case the data array + with the sun spot numbers.

+
Line 29
+

Understanding this single line is key to understanding dynamic + graph generation with PHP. This line instructs the library to + actually create the graph as an image, encode it in the chosen + image format (e.g. png, jpg, gif, etc) and stream it back to the + browser with the correct header identifying the data stream that + the client receives as a valid image stream. When the client + (most often a browser) calls the PHP script it will return data + that will make the browser think it is receiving an image and + not, as you might have done up to now from PHP scripts, text.

+

This is something that can be conceptually difficult to fully + understand at first and that is why we are spending the entire + next chapter Chapter 5. Fundamentals of dynamic graph generation on further exploring + this. But for now please accept that this works and by calling + the script above in your browser (it is available in the + "Examples/" directory in the + distribution as 'sunspotsex1.php') you + should get the exact same image as shown above in Figure 4.3. Line plot showing the number of sun spots since 1700 (sunspotsex1.php)

+

+

+

Let's now make a small variation of the above line graph. Let's make it a + filled line graph. instead. In order to do this we only have to add one single + line

+

+

1
+2
+3
+
<?php
+$lineplot->SetFillColor('orange@0.5');
+?>

+

+

The line above actually does two things. First it sets the basic color to + 'orange' and then it modifies this color to be 50% opaque (0.5) which makes the + grid line shine through the fill color to some extent. The whole color handling + in the library is further describe both in Appendix D. Named color list as well as in Chapter 7. Color handling. The result of adding the line above is + shown in Figure 4.4. Displaying sun spots with a semi filled line graph (sunspotsex2.php)

+

+

Figure 4.4. Displaying sun spots with a semi filled line graph (sunspotsex2.php)

Displaying sun spots with a semi filled line graph (sunspotsex2.php)


+

+

Adding tick labels to the X-axis

+ +

+

Note

+

This section can be skipped at first reading since it contains + some slightly more advanced material. The reason why we have + included this section already now is that some of the issues + discussed here is an often repeated question among newcomers to the + library.

+

+

+

There is one bit of the available data that we haven't used yet and that + is the actual years. In the example above we can only see the count from + 1700. (If we just want to look at the cyclic behaviour of the number of + sunspots this is fine since what year a specific number of sunspots appeared + is not relevant.) To make it easier to see what year corresponds to the + different sunspot numbers we must change the label on the X-axis scale to + show the years instead.

+

There is actually a couple of ways to do this. The easiest way is to just + add the labels we have ($years) on the X-axis and instruct the + library to use them instead. This is done with a call to the method + SetTickLabels() on the X-axis. This method call takes an + array as argument and uses the values in that array to populate all labels + on major tick marks. In order to make adequate room for the scale the + library automatically selects a suitable distance between each major tick + mark.

+

+

1
+2
+3
+
<?php
+$graph->xaxis->SetTickLabels($year);
+?>

+

+

Adding this line to our previous graph will generate the graph shown in Figure 4.5. Adding tick labels to the graph (sunspotsex3.php)

+

+

Figure 4.5. Adding tick labels to the graph (sunspotsex3.php)

Adding tick labels to the graph (sunspotsex3.php)


+

+

However, there is a problem in the graph above. There are valid years on + the X-axis up to "2000" but then there is a single label "320".

+

What is going on here? Have we already discovered + a bug in the library?

+

No, not really. In the way we have setup the graph we have not provided + the library with enough labels. What has happened is that the integer scale + has chosen a suitable interval between each tick label to have enough space + to be able to show the labels. As can be seen from the figure the distance + chosen with this particular graph seems to be 20 years between each tick. + The way the default labeling works is that the end tick should be labelled + and hence be an even multiple of 20 years (in this case).

+

Since the library needs to have tick labels for all ticks it uses the + labels we supplied as far as they go (up to 2008) but since we didn't supply + data more than up to "2008" (in the $year array) the library + does what it can do and continues with the ordinal numbers where we failed + to provide enough labels.

+

Now, there are a some standard ways of correcting this abomination.

+

+

  1. +

    We can set a manual scale to make sure the scale ends exactly + at 2008, i.e. the scale is exactly as long as our data. This is + done by submitting the wanted scale min/max as additional + argument in the SetScale() method. First the + min/max for the Y-axis and then the min/max for the X-scale. + Since we still want the Y-scale to be fully automatically + determined we just put a "0" for both min and max on the Y-scale + and specify 0 for the min x-value and then the exact number of + sunspots we have measured as the maximum x-value.

    +

    +

    1
    +2
    +3
    +
    <?php
    +$graph->SetScale('intint',0,0,0,max($year)-min($year)+1);
    +?>

    +

    +

    The result of this is shown in Figure 4.6. Manually specifying the X scale to use just the supplied X values (sunspotsex4.php)

    +

    +

    Figure 4.6. Manually specifying the X scale to use just the supplied X values (sunspotsex4.php)

    Manually specifying the X scale to use just the supplied X values (sunspotsex4.php)


    +

    +
  2. +

    An alternative way to get labels is to use a callback function + to specify the labels. This works so that the library calls the + user specified function and as argument passes the label (or the + value of the label) that the library intends to put on a tick. + The library will then use as the actual label whatever string + value we return from our function. Since we know that the + integer label 0 (the first tick) corresponds to the first value, + i.e. "1700" we can simply take whatever label we get as + argument, add "1700" and return that value. This way all labels + will be properly named and even if the scale extends far beyond + where we have data a sensible tick label will be shown.

    +

    A suitable callback function together with the method to + instruct the library to use this callback would be

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +
    <?php
    +// ...
    + 
    +// Label callback
    +function year_callback($aLabel) {
    +    return 1700+(int)$aLabel;
    +}
    + 
    +// ...
    + 
    +$graph->xaxis->SetLabelFormatCallback('year_callback');
    + 
    +// ...
    + 
    +?>

    +

    +

    and the result can be seen in Figure 4.7. Using a callback to get correct values on the x axis (sunspotsex5.php)

    +

    +

    Figure 4.7. Using a callback to get correct values on the x axis (sunspotsex5.php)

    Using a callback to get correct values on the x axis (sunspotsex5.php)


    +

    +
  3. +

    There is one more way to handle this issue which we will not + cover in detail yet. This is to use a "text" scale. The + "text"scale can be used when there is no need to show numeric + values on the axis. A typical use for text scale would be to add + labels to mark bar graphs. Of course a text can contain numeric + strings that would make it visually indistinguishable from a + "real" numeric value.

    +

    For text scales every label counts. So by default the library + will assign a tick mark for each ordinal so that every label is + used. In some cases this will just be two dense and then the + tick and the labelling can be adjusted by calling the two + methods Axis::SetTextTickInterval() and + Axis::SetTextLabelInterval() to get to a wanted + result. But for now we do not discuss this technique further + here since it would bring too far.

    +

+

+
+
+

A basic bar graph

+ +

As a final illustration we will show how easy it is to change the plot type. + We will make a small modification of the previous script and display the sun + spots as a bar graph instead. In order to do this we take the code from Figure 4.4. Displaying sun spots with a semi filled line graph (sunspotsex2.php) and just change the creation of an instance + of the LinePlot() class to instead be an instance of the + BarPlot() class (to make the code more readable we also change + the name of the variable where we store the instance so it makes more sense). In + order to use this class we must also change the include statement so that the + bar module is included by adding the statement + require_once('jpgraph/jpgraph_barplot.php'). The changed code + would now look like this

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php
+// ...
+ 
+// Create the bar plot
+$barplot=new BarPlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($barplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>

+

+

and would result in the graph displayed in Figure 4.8. Changing the plot type to a bar plot instead (sunspotsex6.php)

+

+

Figure 4.8. Changing the plot type to a bar plot instead (sunspotsex6.php)

Changing the plot type to a bar plot instead (sunspotsex6.php)


+

+

Since there are so many bars in small space we cannot see the individual bars + in the example in Figure 4.8. Changing the plot type to a bar plot instead (sunspotsex6.php) . So lets modify the script so that it only + shows the last 20 years of measurements so that we can see the individual bars. + To set this up there are two things we must do

+

+

  1. +

    Change the scale ot a text scale since we want to make sure each + value is displayed. In addition the text scale actually changes one + more thing that we haven't mentioned. Using a text scale also + changes the alignment of the labels. For linear, integer, + logarithmic scales the labels are placed cantered below the tick + marks. For text labels they are instead place in between the tick + marks. This is the most common way of displaying bar graphs. This is + one more reason to think of text scales as a special scale mostly + suitable for bar graphs.

    +
  2. +

    Add two lines of code to "chop off" the extra not wanted data in + the input data arrays.

    +

+

+

The following code snippet shows the necessary modifications to the previous + script

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php
+// Just keep the last 20 values in the arrays
+$year = array_slice($year, -20);
+$ydata = array_slice($ydata, -20);
+ 
+// ...
+ 
+// Specify what scale we want to use,
+// text = txt scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('textint');
+ 
+// ...
+?>

+

+

The final graph with the "zoomed" last 20 years can now be seen in

+

+

Figure 4.9. Sunspots zoomed to only show the last 20 years (sunspotsex7.php)

Sunspots zoomed to only show the last 20 years (sunspotsex7.php)


+

+

Since the scale is larger we can now actually see the individual bars. By + default the library choses a light blue color to fill the interior. (Try to see + what happens if you add the method call + "$barplot->SetFillColor('orange@0.5');" just after the + "$barplot" variable has been assigned the new BarPlot + object.)

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch05.html b/includes/jpgraph/docs/chunkhtml/ch05.html new file mode 100644 index 0000000..403837d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch05.html @@ -0,0 +1,51 @@ +Chapter 5. Fundamentals of dynamic graph generation

Chapter 5. Fundamentals of dynamic graph generation

+ +

+ What you will learn in this chapter.  + 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 a very common + error when generating dynamic images with PHP it is probably safe to skip this + chapter. Otherwise it might be wise to read through this chapter at least + once. +

+

Making sense of HTTP streams and MIME types

+ +

The following explanation is slightly simplified since a full description of the + HTTP protocol would bring us a bit too far in this manual

  1. +

    A client (e.g. browser) requests data from the server by issuing a GET + (or possible a POST) command to the server. This is what happens when + you enter a URI in the address bar in the browser.

    +
  2. +

    The server replies with a data stream (or an error if the requested + data wasn't available). This data stream is prepended with header (MIME + header) that tells the client (e.g. the browser) how to interpret the + data that follows. The most common type (and the default type if no + header is sent by a faulty server) is "text/html" . This tells the client to + interpret the data as plain text with embedded HTML encoding.

    +

    When the data is to be interpreted as an image the header will instead + be one of the image headers, for example "image/png" or "image/jpeg". When the client receives this + header it will interpret all the following data as an image encoded in + the indicated format.

    +

    The important thing to keep in mind here is that each server reply + (initiated by a call from the client) can only have one and only one + MIME type. This is the key to further understanding the specific issues + with dynamic image generation. This explains why if a PHP script running + on the server sends a header first indicating that the following data it + sends should be interpreted by the client as an image it cannot also + include text since only one header can be used for one HTTP stream. +

    +
+

What happens on a WEB-page with, for example, multiple <img> + tags is that the browser issues a separate GET command for each of these images. So + even though it can look like a fetching a single WEB-page can have different content + each individual request to the server only have one single MIME type.

+
+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch05s02.html b/includes/jpgraph/docs/chunkhtml/ch05s02.html new file mode 100644 index 0000000..ba1a9ff --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch05s02.html @@ -0,0 +1,49 @@ +What is an image?

What is an image?

+ +

This might be strange question and you might already now the answer but having a + true understanding will help. An image is simply a data stream of octets (bytes) + specifying the exact color of a number of pixels. A typical image uses 32 bits to + specify the color which means it can encode 2^32 different colors (Homework: How + many gray levels is possible with 32 bits?). It would be perfectly possible to send + this data stream as it is and indeed this is how the bitmap (BMP) format specifies + the data. However, image data usually have a lot of redundancies that can be used to + reduce the size of the data that needs to be transmitted to specify any given image. + These compression formats are what is more commonly known as for example PNG, JPEG + or GIF type of images. So it is actually more correct, in our view, to look upon + these formats as different compression techniques rather than as true image formats.

+

Contrary to popular belief it is not the suffix on a file per se that identifies a + particular file as an image on a HTTP server but rather the mapping on the server + that instructs the server to send back a particular header for a particular file + type (as identified by the file suffix), the MIME type. This might not seem like an + important distinction to make but keeping this in mind will help understanding how + images are created with a PHP script.

+

A normal PHP scripts sends back character data (or more likely HTML encoded + character data) that is displayed by the browser. However it is nothing that stops + the PHP script from sending back data that instead should be interpreted as an image + assuming of course we know how to create such data..

+

How the client (i.e. the browser) should interpret the data sent is all controlled + by the header that is sent before the data. So this now leads us to the idea that if + our PHP script by some means constructs a valid image, compressed in a known format + (say PNG), we can tell the client to interpret the data we send back as an image by + just making sure we first send a header indicating that the data is an image.

+

This could now lead us to the perhaps surprising but crucial insight that if we + call our script that sends back valid image data "myimage.php" + and open it in a browser, for example by opening the local URI + "http://localhost/myimage.php" for the browser this is no + different then opening an image directly (for example + "http://localhost/myimage.png")

+

The only difference is that in the first case (our PHP script) we create the + header and data our self and in the second case the HTTP server looks up the file + suffix (*.png) to find out what kind of header to send before reading the file and + just passing on the data to the client.

+

Armed with this new knowledge we realize that our PHP script is an image for all practical purposes and intent from + a clients point of view. So we could safely name our PHP script as a target for an + <img> tag. This gives us the final and most common way to + call a graph script in a HTML page.

+

<img src="myimage.php">

+

in exactly the same way as we would do with the old type of images. The "*.php" + suffix is no problem since the client (e.g. the browser) don't care what the file + ending is. It only cares about what header the server returns. If that header tells + the browser that the data received should be interpreted as a PNG image it will do + so regardless of the name of the source file on the server.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch05s03.html b/includes/jpgraph/docs/chunkhtml/ch05s03.html new file mode 100644 index 0000000..7f9b8b3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch05s03.html @@ -0,0 +1,23 @@ +Static vs dynamic images

Static vs dynamic images

+ +

Having understood how we can generate images using a PHP script a new idea might + be forming. There is nothing that says that we have to create the same image using + the same data every time the graph script is called. We could for example randomly + select a pre-stored image in a directory and every time we call (the same) graph + script and new image is returned. Hence, with PHP scripts we can create dynamic + images that generate different images depending on some yet to be specified + parameters even though the script name stays the same. This is a new behaviour + compared with our normal images.

+

This could also lead to a new, and very real, problem which has to do with the + local caching most browsers do in order to avoid re-fetching already fetched objects + such as images. Normally a browser will check the time stamp on the file on the + server and compare with the latest fetched version it has stored locally. If the + browser sees that the file on the server is older than what it already has it will + not re-fetch the file.

+

Since a dynamic image is produced by a script and the script will stay the same + even if the produced image is changing (due to new data) the browser might still + think that the image has not changed since the script is the same and will not + bother re-fetching it again. The exact behavior of the browser cache is usually + adjustable by the end user and hence out of control for us who writes the script. A + simple way to always force the client to re-fetch the dynamic image is described in Forcing the browser to update your graph

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch05s04.html b/includes/jpgraph/docs/chunkhtml/ch05s04.html new file mode 100644 index 0000000..61a4611 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch05s04.html @@ -0,0 +1,36 @@ +Dynamic images on the command line

Dynamic images on the command line

+ +

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.

+

This could be an effective way to make an efficient web-site by having some + automatic creation of images at regular interval (perhaps using some kind of + cron-job) that are referenced as usual (with an + <img> tag) in the scripts. This will avoid having to + re-generate the image every time a visitor hits the site.

+

Please make sure that you run the command line version of PHP (cli). Using the CGI + SAPI version of PHP 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 + adding the '-q' option.

+

+

+

You can easily check the version installed by the command line

+

+

$/> php --version

+

+

this should give a reply with something like

+
PHP 4.3.8 (cli) (built: Aug 29 2004 18:48:13) 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 should match the format in + which the image is generated.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch05s05.html b/includes/jpgraph/docs/chunkhtml/ch05s05.html new file mode 100644 index 0000000..916634f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch05s05.html @@ -0,0 +1,380 @@ +How to generate images with JpGraph library

How to generate images with JpGraph library

+ +

The two common steps for creating and using a Graph on your Web-page are

+

+

  1. +

    Create a script that constructs the graph, by getting the data and + specifying how the graph should look, the size, what colors to use, what + fonts to use and specifying other augmentations on the graph.

    +
  2. +

    On the HTML page where the graph(s) should be displayed include add + one or more <img> tags which links to the PHP graphs + script. Of course it is perfectly possible to call the image script + directly in the browser to just display the generated image in the + browser. This way it is possible to include any number of graphs on the + Web-page.

    +

+

+

Tip

+

One further thing to keep in mind is 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 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 directly, 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. This is further + discussed in ?? (Getting hold of the data to be displayed)

+
+

The standard steps of setting up a graph

+ +

When it comes to the structure of your imaging script they will generally have + the following structure

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+// ... Include necessary headers 
+require_once 'jpgraph.php';
+require_once '....';
+ 
+// Create the graph instance
+$graph = new Graph($width,$height, ...); 
+ 
+// Specify what scale should be used in the graph
+$graph->SetScale('...');
+ 
+// ... code to construct the graph details and plot objects
+ 
+// Add one or many plot objects to the graph
+$graph->Add(..); 
+ 
+// ... and send back the graph to the client
+$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 (CSIM). In that case the final + method will be Graph::StrokeCSIM()

+

+

Caution

+

As discussed in Making sense of HTTP streams and MIME types no text can be + returned from an image script. Beware!

+

+

+

In addition to this standard usage pattern you can also choose to:

+

+

  1. +

    ... send the graph directly to a file. This is done by specifying + a filename as parameter to the final Stroke() method + call. See Writing the image directly to a file for more detailed + information.

    +
  2. +

    ... access the GD image handler for further image processing (also + needed to include the image in an PDF file, see Appendix C. FAQ)

    +
  3. +

    ... make use of the built-in cache system to send back a + previously generated image. The cache system, which lessens the + burden of the PHP server, works by avoiding running 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 file to the + browser. The filename used for the image can be either manually + selected or automatically created based on the script name. In + addition it is also possible to specify a timeout value in the + initial call to the Graph() constructor to indicate how long the + image in the cache directory should be considered valid before a new + image is generated. A full description of the JpGraph cache system + is available in Efficient graph generation using the built-in cache subsystem.

    +

    +

    Note

    +

    The cache system by default is disabled and must be + enabled by setting the proper define in the file + "jpg-config.inc"

    +

    +

    +
  4. +

    ... combine several graphs in the same image using the + MGraph() class (Multi-Graph). This is an advanced + technique described in ??.

    +

+

+
+

Choosing the image compression format for JpGraph

+ +

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 the system + the library is installed on. There are two ways you can influence the way the + graphic format is chosen:

+

+

  1. +

    Change the default graphic format by changing the DEFINE (in + jpg-config.inc.php)

    +

    DEFINE('DEFAULT_GFORMAT','auto')

    +

    For example; if you by default want all your images to be + generated with JPG encodation the define should be changed to

    +

    DEFINE('DEFAULT_GFORMAT','jpg')

    +
  2. +

    By dynamically (in your script) select the wanted compression + format with a call to

    +

    Image::SetImgFormat()

    +

    For example; if you want your image to use the JPEG format

    +

    + $graph->img->SetImgFormat('jpeg')

    +

    (The above line assume that you have called your variable that + holds the instantiated Graph() object + "$graph"

    +

+

+
+

Sending back the image to the browser

+ +

The very last statement in almost all graph scripts is the line

+

+

$graph->Stroke();

+

+

+

Note

+

Actually there are some valid exceptions to this when you do some more + advanced graph generation involving caching together with the CSIM + functionality.

+

+

+

This line starts the actual graph creation. All method calls up to this stage + has just been to set the scene for the library and specify all necessary + parameters. It is first when you make the call to the Stroke() + method the library actually starts to build the image. Assuming there are no + errors detected when the image is generated the library will now take the + following steps in principle:

+

+

  1. +

    Start building the image in memory. This is done by analyzing the + specified parameters and making use of the supplied data in order to + create the various plots that have been specified.

    +
  2. +

    Check what headers are needed, i.e. what image compression are + used for the graph, and send that header back to the client.

    +

    The library also have to check how the library was called since if + it was called from the command line no MIME headers should be sent + back at all, just the raw image data. Running the command line + version of PHP will allow you to dynamically create images without + using a HTTP server.

    +
  3. +

    Send the actual image data representing the built up image back to + the client

    +

+

+

The dreaded: Headers has already been sent error

+ +

This is an error that everyone, and we really mean everyone, will see one + time or the other when producing dynamic images with PHP.

+

First, this is not a problem with JpGraph per se. What has happened is + that your PHP script which produces the image has already returned some data + to the client before the image header has been sent.

+

This is most often caused by one or more spaces before the first + "<?php" statement. What happens is that the server + normally sends back all data it finds in the files it reads. Since the + server no sees a space, a perfectly valid character, it will send that data + back to the client. However, before it does that it will automatically + generate a header. Since it has seen a normal character data it will + generate a header telling the client to expect a data stream of + characters.

+

When later JpGraph tries to send its image header the server will detect + that a header has already been sent and since each HTTP data stream can only + have one type (and hence only one header) it will generate an error message + which is sent back to the client.

+

To correct this error check your files for any output (even a single + space) before the call to Graph::Graph() (or + Graph::Stroke()) If you are running on older version of a + Windows server this problem could also be caused by blank line at the end of + the files. On some older Windows versions together with PHP4 it might also + be called by a file ending in a newline (which all the JpGraph library files + does) Remove the newline so that the file ends just after the final + "?>" Also remember that when you include external file + using include/include_once and so on PHP includes the whole + content of the file; this content of the file also includes any potential + carriage return/line feed or "blank" space before "<?php" + and after "?>" These "dirty characters" will cause the problem + just described.

+
+
+

Writing the image directly to a file

+ +

In addition to just streaming the file back to the browser it is also possible + to write the file directly to a named file. The file name is given as an + argument to the Graph::Stroke() method. For example as

+

$graph->Stroke('/tmp/myimage.png');

+

There are three important things to note here

  1. +

    The PHP process must have write permission on the directory you + are trying to write the image file on. If you are running PHP + through your browser this means that the HTTP server process must + have write permission on that directory.

    +
  2. +

    The file suffix (e.g. '.png') should match the image + compression type used.

    +
  3. +

    If the image is streamed directly to a file and not back to the + browser the script can of course return ordinary text.

    +
+

Writing the image to both a file and stream it back to the + browser

+ +

In this case you should instead use the method + Graph::StrokeStore($aFileName) which was introduced in + version 2.5 of the library. If you are on a previous version and for various + reasons cannot upgrade then you can use the following "trick" to achieve + this.

+

The idea is to use the _IMG_HANDLER option that forces the + Graph::Stroke() to just return the image handler and then + stop. We can then manually first send the image to the chosen file and then + stream it back to the browser using some internal methods in the library. + The following code snippet shows how this is done. +

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+ 
+// ... necessary includes ...
+ 
+$graph = new Graph(400,300);
+ 
+// ... code to generate a graph ...
+ 
+// Get the handler to prevent the library from sending the
+// image to the browser
+$gdImgHandler = $graph->Stroke(_IMG_HANDLER);
+ 
+// Stroke image to a file and browser
+ 
+// Default is PNG so use ".png" as suffix
+$fileName = "/tmp/imagefile.png";
+$graph->img->Stream($fileName);
+ 
+// Send it back to browser
+$graph->img->Headers();
+$graph->img->Stream();
+?>
+
+
+

Alternatives to streaming or storing the image

+ +

There are also two predefined filenames which have special meaning when + supplied as argument ot the Stoke() method.

+

+

_IMG_AUTO
+

This will create a file in the same directory as the script + with the same name as the script but with the correct image + extension.

+
_IMG_HANDLER
+

Specifying this filename will not create a an image to file + nor stream it back to the browser. Instead it will instruct the + Stroke() method to just return the handle for + the GD image. This is useful if you later want to manipulate the + image in ways that are not yet supported by JpGraph. For example + include the image in a dynamically generated PDF file. See Appendix C. FAQ for a detailed example how to + include an image in a PDF generated with the "fpdf" + library.

+

+

+
+

Forcing the browser to update your graph

+ +

Some browser may not send back a request to the HTTP server unless the user + presses "Refresh" (F5 - in most browsers). This can lead to problems that the + user is seeing old data since the file stamp of the script might not change but + the data the script is using to create the image/graph is. A simple trick is to + add a dummy time argument which is not used in the script.

+

For example

+

<img src="myimagescript.php?dummy=\'.now()."> +

+

Since the dummy argument will be a new number whenever the browser checks it + the browser understands that it must re-fetch the script and force the image to + be reloaded and redisplayed.

+

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 (since the script is the same) and if the browser + already has issued a previous GET request and has the data cached it will not + send a new GET if the time stamp on the file is the same since it then believes + it should and can use the old browser cached version.

+
+

Printing the generated image

+ +

Some browsers, most notable IE (< v7) can have issues printing a dynamic + image. This is because the designers of IE assumed that all images are + traditional images that are available as static image files. Not that they could + be dynamically generated. This unfortunately have some implications.

+

+

  1. +

    IE will often (always?) re-fetch the page when preparing to print. + This means that a new image will be generated and is perhaps very + different from what the user thinks he is printing (if the data is + changing rapidly).

    +
  2. +

    Some older versions of IE simply refuses to print dynamic images + if they are not available as a static "*.png", "*.jpg" etc. file. + The only known workaround is to make sure to use static + images.

    +

+

+

There is one final reported problem to be aware of. Normally most browsers + will support "right-clicking" on an image to download the image locally. + However, some older versions of IE will become very confused when dynamic images + are used. This could manifest itself as that the file type is not the wanted, + for example, trying to download a "*.png" image could cause the file to be saved + as a "*.bmp" file instead.

+

Newer versions of IE seems to be able to handle dynamic images much + better.

+

It should also be mentioned that some older versions of FireFox (< v3) + could in some circumstances fetch a dynamic image twice causing unnecessary load + on the server (See FireFox + Bugzilla). However, there are no known issues with dynamic images in + current versions of FireFox and IE (i.e. IE v8).

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch05s06.html b/includes/jpgraph/docs/chunkhtml/ch05s06.html new file mode 100644 index 0000000..aa258f9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch05s06.html @@ -0,0 +1,77 @@ +Efficient graph generation using the built-in cache subsystem

Efficient graph generation using the built-in cache subsystem

+ +

The full explanation of how to use the JpGraph cache system is deferred to Chapter 9. Using the JpGraph cache system so this early section is just to explain the + principles and why you probably want to read through the full chapter later + on.

+

The core problem is that generating images can require a lot of CPU time. If we + combine this with the interpreted nature of PHP we can get a potential lethal + performance mixture. For example, if a web page uses one dynamically generated graph + and at its peak the site has 50 hits per second this means that the PHP graph script + also has to be called 50 times a second. On a high end server a typical graph takes + in the range of 0.02s up to 0.2s (and some complex graph, for example an + anti-aliased Contour-plot, can take up to 1s) to generate using a plain + non-accelerated installation (see more on supported PHP Accelerators in Chapter 11. NuSphere PHP accelerator).

+

If we furthermore makes the realistic assumption that the site needs to run some + database services and generate other content as well the graph script itself might + not be allowed to use more than 50% of the available CPU bandwidth. It is now easy + to see that we are in trouble.

+

Continuing with the example. Assuming our graph is medium complex and takes a + whole 0.04s to generate. This means that if the server does not do anything more + than just creating images then we can crank out 1/0.04 or 25 graphs per second per + core at maximum. If we then take the 50% load into account it means that we could + only be allowed to generate ~12 graphs per second per core and remember that this + was on a high end server. If we now have more than 12 hits per second or have a more + average server with a less powerful CPU we are heading directly for a seriously + under dimensioned server.

+

If we assume we are running our server on a dual-core CPU this gives us an upper + practical limit of 24 graphs per second per server.

+

There are a couple of ways to counteract this problem but none is a 100% + solution.

+
  1. +

    Introduce load balancing among several servers. This is a common way + to dynamically adjust to varying loads but without some serious + investments into a server farm it is still possible to overload the + system.

    +
  2. +

    Reduce the complexity of the graphs. However there is still a limit, + even very simple and basic graphs takes in the order of 0.02s on a high + end server due partly to the cost PHP parsing of all the library files. + This means that the upper limit is still valid.

    +
  3. +

    Make use of a PHP accelerator. If you are running a professional + server this is a must. We would go so far as to say that running a + professional PHP server without using any of the available PHP + accelerators borders on gross misconduct on the behalf of the + information architect that did the logical server design. Using a PHP + accelerator we can normally expect to get an almost 100% improvement. + Taking the previous example as a case we can probably expect an upper + limit of ~24 graphs per second per core instead of the normal + ~12.

    +
  4. +

    Make use of the built in cache system in JpGraph. This system if set + up correctly will avoid the problem by not having to generate the same + (or almost the same) image over and over again. The core idea of the + system is the observation that the majority of the data presented on a + WEB page is changing only very slowly compared with the hits a server + gets.

    +

    For example, if a server has a graphical overview of defects by + showing inflow/outflow there is probably a good case to state that the + data change sufficiently slowly that it is probably not necessary to + re-generate the graph more than 6 times per day (or perhaps even just + once per day).

    +

    The JpGraph cache system allows you to do just that. What you do is + specify a timeout. When the server calls the graph script the script + first checks if a previous image has been generated. If that is the case + it then checks how old the image is and if it is newer than the timeout + limit then the existing image is sent back. It is just in the case that + there isn't already any image (the script has never been run) or that + the existing image is too old (older than the specified timeout limit) + that the image gets generated again.

    +

    You could of course do all of this manually but the library has built + in support for this that will allow you to use the system without + changing a single line in your existing scripts. It is all taken care of + in the background.

    +

For a production server the recommended setup is to use a combination + of load balancing, a suitable PHP accelerator and enabling the JpGraph cache + system.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch06.html b/includes/jpgraph/docs/chunkhtml/ch06.html new file mode 100644 index 0000000..01ce5db --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch06.html @@ -0,0 +1,67 @@ +Chapter 6. Error handling

Chapter 6. Error handling

+ +

The problem with error messages and images

+ +

Why a whole chapter on error handling? The answer is that error handling with + scripts that produces images requires a slightly different approach than normal + error messages. In order to appreciate the added complexity one needs to consider + how a graph script is called. Usually a graph script is called from an + <img> tag. This means that the client (e.g. the browser) + expect image data to be sent from the script. If we instead send a textual error + message the browser will not be able to display anything. It was expecting a stream + with image data and the data received was a representation of an error message which + of course cannot be interpreted as an image.

+

To handle this problem the error messages produced by the library are normally + generated as an image. A typical error message can be seen in Figure 6.1. Typical image error message

+

Figure 6.1. Typical image error message

+ +
Typical image error message
+

+

There is one exception to this rule and that is in the case of the "Headed already + sent" error message. This means that the client has already received an header and + with probability bordering on certainty this is a text header. Hence in this case it + does not make sense to send an image so this, and only this, error message is sent + as a normal "text/html" type message. A typical example how this message is shown in + the browser can be seen in Figure 6.2. The "Header already sent error message"

+

Figure 6.2. The "Header already sent error message"

+ +
The "Header already sent error message"
+

+

When you get this error (and we mean when - not if) take a very close look at the + text in red. This will tell you in what file and what line the erroneous output + started. In most cases this will be an innocent looking space or a tab character. It + could also be caused by multiple newlines at the end of a file. Since by definition + these mistakes can be hard to spot since spaces and tabs are not normally visible in + an editor so take care!

+

Catching errors in other parts of the system while creating images

+ +

The problem described in the previous section will also apply to error + messages that are generated directly from PHP as well. In order to be able to + see any potential error messages during development it is possible to instruct + the library to intercept PHP error messages and convert them to image messages + instead. This is controlled by the two defines + INSTALL_PHP_ERR_HANDLER and CATCH_PHPERR define in + jpg-config.inc.php +

+

+

INSTALL_PHP_ERR_HANDLER
+

Setting this define to true will make the library install a + custom error handler which will catch all PHP error messages and + convert them into an image like what can be seen in Figure 6.1. Typical image error message.

+

By default this is disabled.

+
CATCH_PHPERR
+

This defines control whether the library shall check for any + generated error message that are stored in the global PHP + pre-defined variable php_errmsg. This can be very + useful during development if an error has occurred prior to + calling the graph script. This error will then be displayed as + an image.

+

By default this is enabled.

+

+

+
+
+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch06s02.html b/includes/jpgraph/docs/chunkhtml/ch06s02.html new file mode 100644 index 0000000..c1ac2e8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch06s02.html @@ -0,0 +1,78 @@ +Available error messages

Available error messages

+ +

All error messages that can be generated by the library are listed in Appendix H. Error messages

+

Localizing error messages

+ +

The library includes two (actually two and one pseudo) localizations of the + error messages. As of version 2.5 the library supports English and German error + messages. The choice of which localization of error messages that should be used + can be done in two ways; either by specifying a global define in + jpg-config.inc.php or

+

As of version 2.5 there are three localization options

+
  1. +

    English error messages ("en")

    +
  2. +

    German error messages ("de")

    +
  3. +

    Production error messages. This is not really a localization but a + different set of error messages which does not give detailed error + messages but a generic message suitable for a production server + where the end user is not helped by detailed graph script errors. + Instead a generic message is shown together with an error code that + corresponds to the detailed error. ("prod")

    +

In order to specify the error message localization the following + define in jpg-config.inc.php must be set the

+

define('DEFAULT_ERR_LOCALE','en');

+

The possible (string) options are

+
  1. +

    "en", English locale

    +
  2. +

    "de", German locale

    +
  3. +

    "prod", The production version of the error messages.

    +

It is also possible to dynamically set the localization of error + messages by calling the static method + JpGraphErr::SetErrLocale($aLocaleString) .For example, in order + to dynamically change to German locale the following method call would be + used:

+

JpGraphErr::SetErrLocale('de');

+

As an example of the German locale the "Header Already Sent" error message localized in + German are shown in Figure 6.3. The "Header already sent" error message using German locale

+

Figure 6.3. The "Header already sent" error message using German locale

+ +
The "Header already sent" error message using German locale
+

+

Note

+

There is one potential issue with specifying the locale dynamically. Since + the call to set the locale happens in the script at a certain point this + means that if the error occur before that point the locale change has not + yet happened and the default locale specified in + jpg-config.inc.php will be used.

+
+
+

Error messages on a production server

+ +

On a production server it is common not to show detailed specific error + messages to the public which could potentially give a away security + vulnerabilities. For this purpose there is a "pseudo" locale of the error + messages. This is specified by setting the locale (as described above) to the + string "prod". If this is done a generic error message with an error code will + be shown instead. The custom support receiving information on this error can + then pass on the detailed error code to the development team for further + investigation. In Figure 6.4. Using the production "pseudo" locale the same error as is shown in Figure 6.1. Typical image error message is displayed using the "prod" locale. As you + can see in this case only a more end-user appropriate message together with the + error code is displayed.

+

Figure 6.4. Using the production "pseudo" locale

+ +
Using the production "pseudo" locale
+

+

The problem number corresponds to the error codes that are listed in Appendix H. Error messages

+

+

Tip

+

It is possible to customize this "production" error message by + changing the actual text in the file + "lang/prod.inc.php"

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch06s03.html b/includes/jpgraph/docs/chunkhtml/ch06s03.html new file mode 100644 index 0000000..2c96015 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch06s03.html @@ -0,0 +1,148 @@ +Using PHP Exceptions

Using PHP Exceptions

+ +

Starting with version v2.5 the library now have full support for PHP5 style + exceptions. The library provides an exception class named + JpGraphException which is slightly different compared with + traditional exception classes in that this class can not only return an text string + as error but also an image. This is necessary in order to handle the case where a + script has an error and is called from within an <img> tag. The + only data that can then be displayed in a browser is image data and hence it is + necessary for the error to be formatted as an image.

+

In addition to providing an exception class the library also installs its own + default exception handler to properly display an image. This default exception + handler will be automatically called whenever an "uncaught" exception would + otherwise be generated. This means that it is strictly not necessary to use + "try {} catch() {}" blocks around the library scripts.

+

When an exception is generated the default exception handler first validates that + the exception is a proper descendant of JpGraphException and if so, + generates the image by calling the JpgraphException::Stroke() method. + If the exception is not a JpGraphException based exception then the + handler re-raises the error. This means that in script that you create that is meant + to be called from within an <img> tag all exception should be a + derivate of JpGraphException in order to properly generate an error + image.

+

A typical example on how to raise an exception in your own code is shown in Example 6.1. Throwing a JpGraph exception

+

+

Example 6.1. Throwing a JpGraph exception

+ +
1
+2
+3
+
<?php
+throw new JpGraphException(' ... some error message ...');
+?>
+


+

+

In case you need to handle the exception in a "try {} catch() {}" + block (perhaps in order to do necessary cleanup) it is important to remember to call + the Stroke() method which will create and stream the error message back + to the browser. An example of this is shown in Example 6.2. Catching a JpGraph exception and sending it back as an image to the + client

+

+

Example 6.2. Catching a JpGraph exception and sending it back as an image to the + client

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+try {
+ 
+    $graph = new Graph($width,$height);
+ 
+    // ... Code to setup the graph
+ 
+    if( /* some error condition */ ) {
+        throw new JpGraphException(' ... some error message ...');
+    }
+ 
+} catch ( JpGraphException $e ) {
+    // .. do necessary cleanup
+ 
+    // Send back error message
+    $e->Stroke();
+}
+?>
+


+

+

+

Tip

+

Another typical augmentation of the exception handling might be to also + log an error to some logging server or plain log file. This should be done + before the call to Stroke() since that call will never + return.

+

+

+

An example of real life error handling with exception is shown in listing Preparing the data in the introductory example with Sun + spots.

+

Selecting between text and image based error handling

+ +

By default an exception that occurs in the library will create an error image + as shown in the previous section. However there might be circumstance where a + text based error handling is preferred (usually when graph are created from the + command line).

+

This could be accomplished in two ways. By catching the exception in the + script and handle it accordingly or we could slightly modify the default + behavior of the default exception handler in the library. How this is done will + now be described.

+

In order to enable a text based error handler we just need to disable the + image based error handler. This is done with a call to the method

+

+

  • +

    JpGraphError::SetImageFlag($aFlag)

    +

+

+

Since the error handling have global scope this is a static function which can + be called as the following example shows

+

+

1
+
JpGraphError::SetImageFlag(false); // Enable text based error handling

+

+

Adding the line above to a graph script will cause any error to be printed to + STDERR when the script is called from the command line. This is + a very convenient way to show errors when command line constructions like

+

+

$> php mygraph.php > mygraph.png

+

+

is used since writing the error to STDOUT will cause the error + message to be sent back to the console since the call above only redirected + STDOUT and not STDERR.

+

When the script is called from PHP embedded in a HTTP server (e.g. Apache) + there is no concept of a STDERR and the error message will just be + sent back as normal text to the browser.

+
+

Writing error message to a log file (or system logger)

+ +

In addition to the option of having the error sent back as a string to the + client it can instead be written to a named log file. The log file name is + specified with a call to the (static) method

+

+

  • +

    JpGraphError::SetLogFile($aFileName)

    +

+

+

The file needs to be writable by the PHP process. All error messages are + appended to the end of the file and each error message is prepended by the date + and time (in RFC 2822 formatted + date).

+

If the filename is given as the string 'syslog' then the error + message will be written to the default system logger instead. When a script is + run from, for example, Apache this is normally on Unix + '/var/log/apache2/error_log'

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch06s04.html b/includes/jpgraph/docs/chunkhtml/ch06s04.html new file mode 100644 index 0000000..aade9b0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch06s04.html @@ -0,0 +1,22 @@ +Adding a new locale

Adding a new locale

+ +

All error messages are stored in an array with a specific index that cannot be + changed. This index is used in the library to reference a specific error message.

+

Since error messages can also have additional parameters the error messages also + includes count that specifies how many arguments must be handled to enable some + error checking when using the error message in the code (to make sure we have enough + arguments).

+

The arguments are formatted in the error text in the same way as parameters in the + printf() family of functions.

+

To create a localized error resource file You should first copy the + "en.inc.php" to a temporary file, rename it according to + the locale you are creating and then translate each error message according to the + locale. The make sure that the file is stored under the + "jpgraph/lang/" catalogue and the new localized error + messages can be used.

+

For example. To create a French version of the error messages the + lang/en.inc.php should be copied to + lang/fr.inc.php and the error messages translated. The + French locale can then be used by using the string "fr" as identified + in SettErrLocale() as described above.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch07.html b/includes/jpgraph/docs/chunkhtml/ch07.html new file mode 100644 index 0000000..58f8228 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch07.html @@ -0,0 +1,40 @@ +Chapter 7. Color handling

Chapter 7. Color handling

+ +

An important part of creating visually clear graphs is the use of appropriate colors. + In order to simplify color handling JpGraph supports several ways to adjust and + manipulate color both by value and by name.

+

Almost all color setting methods (with basically only one exception) for all objects + in the graph has one of two names

+
  • +

    SetColor(), Sets the outline color or if the object only have + one color (e.g. a font) it sets this color

    +
  • +

    SetFillColor(), Specifies the area fill color for objects + which has a concept of an area.

    +

Both variants of methods take one argument which identifies the color by + one of the available color specification methods as described below.

+

Specifying colors by name

+ +

There are a number of "standard colors" known by (more or less) illustrative + names. A list of all color names that can be used as well as actual color can be + found in Appendix D. Named color list.

+

For example:

+

+

  • +

    SetColor('white');

    +
  • +

    SetFillColor('orange');

    +

+

+

+

Tip

+

Always use single quotes for strings when you do not need variable + substitution since this is faster.

+

+

+
+ + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch07s02.html b/includes/jpgraph/docs/chunkhtml/ch07s02.html new file mode 100644 index 0000000..6947ffa --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch07s02.html @@ -0,0 +1,21 @@ +Specifying colors by RGB triples

Specifying colors by RGB triples

+ +

Using the named colors will of course be restricted to the colors known by the + library. If some other colors are needed then they must be specified + manually.

+

The first variant uses the RGB values for the color, i.e. the Red, Green and Blue + component of a color. Each component is specified as an integer in the range [0,255] + and the triple is specified as an array.

+

For example:

+

+

  • +

    SetColor( array(255,255,255));

    +
  • +

    SetColor( array(0xff,0xff,0xff));

    +
  • +

    SetFillColor( array(0x44,0x54,0xa4));

    +

+

+

As usual a value of array(0,0,0) specifies black and a value of + array(255,255,255) specifies white.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch07s03.html b/includes/jpgraph/docs/chunkhtml/ch07s03.html new file mode 100644 index 0000000..13a9a04 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch07s03.html @@ -0,0 +1,18 @@ +Using HTML color specifications

Using HTML color specifications

+ +

The second variant is more a less a the same as the RGB triples but instead of an + array the RGB triple is specified as a string with the hexadecimal RGB values. This + is commonly known as the "HTML color specification" since this form often used when + creating WEB pages (for example in CSS sheets).

+

For example:

+

+

  • +

    SetColor('#333'), note that this is a short form for + SetColor('#333333')

    +
  • +

    SetColor('#12be7a')

    +
  • +

    SetFillColor('#99eff5')

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch07s04.html b/includes/jpgraph/docs/chunkhtml/ch07s04.html new file mode 100644 index 0000000..4062333 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch07s04.html @@ -0,0 +1,103 @@ +Fine tuning the color

Fine tuning the color

+ +

Specifying the alpha channel (color transparency)

+ +

Colors can also be made semi-transparent by specifying a transparency value + (or as it is also known an alpha channel value). This will instruct the + library to mix the foreground color with a certain amount of the background + colors creating a "shine-through" effect.

+

The alpha channel is specified as a real number in the range [0.0, 1.0] where + 0.0 means no transparency and 1.0 means full transparency (i.e. only the + background color is shown). The transparency is added as a postfix to the color + specification separated by a '@' (at) character. It is often most used with area + fills (i.e. when using SetFillColor())

+

For example the following are valid alpha channel modifiers

+

+

  • +

    SetFillColor('red@0.2'), A slightly transparent red + color

    +
  • +

    SetFillColor('red@0.8'), An almost completely + transparent color

    +

+

+

The result of using different alpha modifiers are shown in Figure 7.1. Using alpha channel modifiers where the blue color is made more and more + transparent to allow the red bar in the background to become more and more + visible.

+

+

Figure 7.1. Using alpha channel modifiers

+ +
Using alpha channel modifiers
+


+

+

As a final example of how to use transparency we show a graph in Figure 7.2. Making use of transparency to combine two plots (barlinealphaex1.php) that uses transparency to allow an area + plot to be mixed with a bar graph.

+

+

Figure 7.2. Making use of transparency to combine two plots (barlinealphaex1.php)

Making use of transparency to combine two plots (barlinealphaex1.php)


+

+

Tip

+

For all graph examples shown in this manual you can always click on the + file name in the title of the graph to view the actual source that created + the graph.

+
+
+

Adjusting the brightness

+ +

Since all colors that can be displayed on a computer can be modeled with the + appropriate RGB triple the above ways will allow you to specify any colors you + might need. However, conceptually it might be easier to think of colors in terms + of "a light blue" instead of a modified RGB triple so the library allows you to + take a basic color and apply a brightness correction factor.

+

The brightness factor is a postfix to the color string separated from the core + color with a ':' (colon) character. The brightness factor is a real number in + the range of [0.0, 2.0]. Using a brightness factor of 0.0 means that the color + will be black (no brightness at all) and a factor of 2.0 means that the color is + white (maximum brightness). Using a factor of 1 will leave the original color + untouched.

+

The brightness factor can be specified for named and HTML colors, see Figure 7.3. Adjusting brightness of named color specifier and Figure 7.4. Adjusting brightness of a HTML color specifier for more examples how the factor adjusts + the color.

+

For example, the following code snippets show valid color brightness + modifiers

+

+

  • +

    SetColor('red:0.8');, A slightly darker red + color

    +
  • +

    SetColor('red:1.5');, A brighter red color

    +
  • +

    SetColor('#3485a9:1.8);, A bright blue-greenish + color

    +

+

+

Figure 7.3. Adjusting brightness of named color specifier

+ +
Adjusting brightness of named color specifier
+

+

Figure 7.4. Adjusting brightness of a HTML color specifier

+ +
Adjusting brightness of a HTML color specifier
+

+

Note

+

The brightness factor is a purely linear factor but due to the human eyes + non-linear sensitivity for colors the perceived difference between (for + example) "red:1.1" and "red:1.2" than between + "red:0.2" and "red:0.3" even though the + relative difference is the same.

+
+
+

Combining brightness and transparency adjustment

+ +

It is also possible to combine the two previous discussed modifiers. This is + done by first adding the transparency specifier and then the brightness + adjustment as the following examples demonstrates.

+

+

  • +

    SetColor('red@0.7:1.2'), A highly transparent + slightly bright red color

    +
  • +

    SetFillColor('#4545aa@0.3:1.5'), A bright blueish + semi transparent color

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch07s05.html b/includes/jpgraph/docs/chunkhtml/ch07s05.html new file mode 100644 index 0000000..38d9892 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch07s05.html @@ -0,0 +1,19 @@ +Additional color handling

Additional color handling

+ +

Some plot types have additional color handling to facilitate easier handling and + differentiation between data sets.

+

+

Pie plots
+

Pie plots support the concept of color-themes. A color theme is + simple a set of colors used for consecutive slices within the Pie. + How to specify color-themes is further discussed in Specifying slice colors and using themes.

+
Color maps
+

Matrix (Only available in the Pro-version) and contour plots also + have the concept of color maps. This is a range of colors used to + indicate the data in the plot. Examples of color maps can be found + in Built in color maps. (Color maps are defined + and implemented in + "jpgraph_colormap.inc.php").

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08.html b/includes/jpgraph/docs/chunkhtml/ch08.html new file mode 100644 index 0000000..237cf39 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08.html @@ -0,0 +1,97 @@ +Chapter 8. Text and font handling

Chapter 8. Text and font handling

+ +

Before reading this chapter please make sure that your installation supports TTF fonts + if you intend to use them (See Necessary system requirements for the library). The rest of this chapter assumes that a working + installation with TTF fonts is available when needed.

+

+

Note

+

It is highly recommended to create a setup where TTF fonts work since the + visual quality is significantly better than for the built-in bitmap fonts. In + addition the bitmap fonts are restricted to only display plain 7-bit ASCII + characters which means that no accented characters can be displayed, for example + the Scandinavian characters "åäö".

+

+

+

+

Note

+

All files in the library are encoded in utf-8.

+

+

+

Different types of fonts

+ +

The library supports two fundamental types of fonts.

+

+

  1. +

    Bitmap fonts

    +

    There are three built in bitmap fonts. They are available as font + families FF_FONT0, FF_FONT1 and + FF_FONT2. The advantage with bitmap fonts is that they + are always available in all installations of GD. However, bitmap fonts + only supports 7-bit ASCII so if you need to display any character from + the extended character set it is not possible to use bitmap fonts. The + available sizes of the bitmap fonts are also limited, the three + available size corresponds to the three families where + FF_FONT0 is the smallest and FF_FONT2 the + largest available bitmap font.

    +

    Bitmap fonts also has a more "rugged" look since they do not use + anti-aliasing.

    +

    Example: + The following script lines shows a typical use of bit + map font specified for the title of a graph

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +
    <?php
    +$graph = new Graph(....);
    + 
    +//  Adjust the title to use the largest built-in bitmap font in bold face
    +$graph->title->SetFont(FF_FONT2,FS_BOLD);
    +?>

    +

    +

    The remainder of this chapter will describe this in more + details.

    +
  2. +

    TTF Fonts (True Type Fonts)

    +

    True Type Fonts (TTF) give a much better visual quality of the text. + They are available in all sizes and there are many more font family to + choose from. All font family specification apart from the three bitmap + fonts are TTF fonts. In order to use these fonts the installation must + be configured in the right way which is described in Necessary system requirements for the library. It is necessary to use TTF fonts in + order to display extended character sets (outside the traditional 7-bit + ASCII). TTF fonts must also be used when inserting unicode entities as + described in Inserting Unicode entities

    +

    In order to be able to use TTF fonts it is necessary to check if the + installations supports this. See Necessary system requirements for the library

    +

    Example: + The following script lines shows a typical use of the + Arial TTF fonts for the title of a graph

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +
    <?php
    +$graph = new Graph(....);
    + 
    +//  Adjust the title to use 14pt Arial bold face
    +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
    +?>

    +

    +

+

+
+ + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s02.html b/includes/jpgraph/docs/chunkhtml/ch08s02.html new file mode 100644 index 0000000..fd6640e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s02.html @@ -0,0 +1,113 @@ +Font families and font styles

Font families and font styles

+ + +

Default TrueType Font

+ +

Prior to ver. 3.5, bitmap fonts are used by default which can specified from FF_FONT0 to FF_FONT2. From version 3.5, default fonts are now set to one of the open-source TrueType DejaVu font (FF_DV_SANSSERIF, DejaVuSans.ttf). This TrueType font is included in JpGraph source code (src/fonts), and there is no need to specify font for this one.

+ +

You can change default font family by changing FF_DEFAULT defined in jpgraph_ttf.inc.php. You have to prepare your own font file as well in order to use another font.

+ +

If Freetype library is not usable in your PHP configuration, original BITMAP font will be used for compatibility.

+

All graph objects that uses text allows you to specify the font to be used by + calling a SetFont() method and specifying three parameters.

+
+ +

+

  1. +

    The font family. This could for example be "Arial", "Times roman" for + TTF fonts or "Bitmap font medium size" when using bit-mapped fonts. The + font family is specified by using a symbolic constant that starts with + the prefix "FF_" (for Font Family). A list of all supported font + families are shown in Table 8.2. Supported Latin Font family specifiers.

    +
  2. +

    The font style. This specifies if the font should be emphasized as + italic, bold, or bold-italic. By default all fonts are rendered with the + "normal" style. The fonts style is specified with a symbolic constant + that starts with the prefix "FS_" (for Font Style). The supported font styles are:

    +

    +

    Table 8.1. Supported Font Styles

    + +
    Font style specifierDescription
    FS_NORMALNormal font style
    FS_BOLDBold font style
    FS_ITALICItalic font style
    FS_BOLDITALICBold + Italic style for font families that + support this
    +


    +

    +

    Please note that not all font families support all available styles. +

    +
  3. +

    The font size. This is specified as an integer and depicts the size of + the font given in typographic points (pt).

    +

+

+

+

Table 8.2. Supported Latin Font family specifiers

+ +
Font family nameTypeCommentBoldItalicBI
FF_FONT0BitmapA very small font
FF_FONT1BitmapA medium sized font
FF_FONT2BitmapThe largest bit mapped font
FF_ARIALTTFArial font
FF_VERDANATTFVerdana font
FF_COURIERTTFFixed pitched Courier new font
FF_BOOKTTFBookman
FF_COMICTTFComic sans 
FF_TIMESTTFTimes New Roman
FF_GEORGIATTFGeorgia
FF_TREBUCHETTFTrebuche
FF_VERATTFGnome Vera font. All Vera family fonts are available from http://www.gnome.org/fonts/ +
FF_VERAMONOTTFGnome Vera Mono font
FF_VERASERIFTTFGnome Vera Serif font 
FF_DV_SANSSERIFTTFDejaVu Font family. The DejaVu fonts are modifications of the + Bitstream Vera fonts designed to extend this original for + greater coverage of Unicode, as well as providing more styles. + These fonts are available from http://dejavu-fonts.org/ +
FF_DV_SANSSERIFMONOTTFDejaVu Font family.
FF_DV_SANSSERIFCONDTTFDejaVu Font family.
FF_DV_SERIFTTFDejaVu Font family.
FF_DV_SERIFCONDTTFDejaVu Font family.
FF_CHINESE, FF_BIG5TTF +

Chinese font + (both symbolic names can be used).

+

The actual font file name used for the Chinese font is + "bkai00mp.ttf". The name of this + file can be changed in the define + CHINESE_TTF_FONT available in the library + file jpgraph_ttf.inc.php +

+
FF_SIMSUNTTF +

Chinese font. +

+

The actual font file name is + "simsun.ttc"

+
FF_MINCHOTTF +

Japanese + font.

+

The actual font file name is + "ipam.ttf"

+
FF_PMINCHOTTF +

Japanese + font.

+

The actual font file name is + "ipamp.ttf"

+
FF_GOTHICTTF +

Japanese + font.

+

The actual font file name is + "ipag.ttf"

+
FF_PGOTHICTTF +

Japanese + font.

+

The actual font file name is + "ipagp.ttf"

+
FF_DAVIDTTF +

Hebrew + font.

+

The actual font file name is + "DAVIDNEW.TTF"

+
FF_MIRIAMTTF +

Hebrew + font.

+

The actual font file name is + "MRIAMY.TTF"

+
FF_AHRONTTF +

Hebrew + font.

+

The actual font file name is + "ahronbd.ttf"

+
+


+

+

+

Note

+

Depending on what versions of the DejaVu fonts are installed on the system + there are two naming conventions for the font files in common practice. The + library will try both naming convention to see if it can find the font + files.

+

+

+

In Figure 8.1. List of all latin TTF fonts. (listfontsex1.php) all latin fonts are shown.

+

+

Figure 8.1. List of all latin TTF fonts. (listfontsex1.php)

List of all latin TTF fonts. (listfontsex1.php)


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s03.html b/includes/jpgraph/docs/chunkhtml/ch08s03.html new file mode 100644 index 0000000..6f32d65 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s03.html @@ -0,0 +1,48 @@ +Understanding text alignment and anchor point

Understanding text alignment and anchor point

+ +

When a text string position is specified that screen (or scale) position by + default gets aligned with the top left corner of the strings bounding box. We say + that the top left corner is the anchor point of the text string. The alignment of the + anchor point can be adjusted with a call to Text::SetAlignment($aHorAlign, + $vertAlign). The two arguments are given as text strings and the + admissible values for each argument are:

+

+

Horizontal alignment
+

'left', 'center', + 'right'

+
Vertical alignment
+

'bottom', 'center' (or + 'middle') , 'top'

+

+

+

Caution

+

Even though from an API perspective both bitmap fonts and TTF fonts share the + same user API the implementation is vastly different. There are a number of + subtle differences in the way built-in bit-map fonts and TrueType fonts are + rendered to the screen. This means for example that the alignment of, say the + bottom of the text string, is not pixel-perfect between bitmap and TrueType + fonts However, JpGraph, abstracts away 99.9% of the differences so it will be, + for all practical uses of the library completely transparent to switch between + the different font types.

+
+

Manually setting the alignment for the anchor point is mostly useful when adding + Text object to the graph to get the wanted alignment. You can see an example of how + the anchor point changes depending on how the combination of alignments are used in Figure 8.2. Illustration of anchor point alignment (textalignex1.php)

+

+

Figure 8.2. Illustration of anchor point alignment (textalignex1.php)

Illustration of anchor point alignment (textalignex1.php)


+

+

+

Note

+

It might seem strange to have the method name + "SetAlignment()" when it really should make more sense to use + the name "SetAnchor()". We agree. This naming scheme is due to + historical reasons.

+

+

+

+

Note

+

The graph legend box also have an anchor point that is specified as the + 3:rd and 4:th argument to Legend::SetPos()

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s04.html b/includes/jpgraph/docs/chunkhtml/ch08s04.html new file mode 100644 index 0000000..85c2259 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s04.html @@ -0,0 +1,33 @@ +Rotating text

Rotating text

+ +

Both bit map and TTF fonts supports rotating text to different extent. With bit + map fonts it is only possible to use horizontal or vertical text, i.e. 0 or 90 + degree rotation. TTF fonts supports arbitrary angles. If you are using a bit map + font and specifies an angle other than 0 or 90 then an error will be + displayed.

+

The most common usage for rotating text is probably to adjust the labels on the + x-axis so they are at 45 degrees angle. To rotate the label of an axis the method + Axis::SetLabelAngle() should be used. Figure 8.3. Example of how to use rotated labels (bargradex1.php) shows an example of this (click on the filename + to view the actual code).

+

+

Figure 8.3. Example of how to use rotated labels (bargradex1.php)

Example of how to use rotated labels (bargradex1.php)


+

+

In addition to axis label it is also possible to + rotate almost every other text object with the exception of graph titles which is + always horizontal. For text objects (the class Text) that can be added + to arbitrary positions on the graph the method Text::SetAngle() can be + used to specify the wanted text angle. Another common place where text labels are + rotated is when individual data points are marked with labels. This could be done + for most plot types and in Figure 8.4. Example of using rotated data point values (example20.3.php) we show an example of using this for adding + labels to a basic bar plot (click on the filename to view source).

+

+

Figure 8.4. Example of using rotated data point values (example20.3.php)

Example of using rotated data point values (example20.3.php)


+

+

+

Caution

+

When rotating text paragraph the alignment (within the paragraph) will + always be reset to "left". It is not possible to use "center" or "right" + paragraph alignment in rotated texts.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s05.html b/includes/jpgraph/docs/chunkhtml/ch08s05.html new file mode 100644 index 0000000..8c9bbd8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s05.html @@ -0,0 +1,50 @@ +Formatting text paragraphs

Formatting text paragraphs

+ +

The text rendering engine within the library offers some basic text paragraph + formatting.

+

+

  • +

    It is possible to use multi line text combined as a paragraph

    +
  • +

    It is possible to adjust the text alignment within the paragraph to be + left, right or center adjusted. This works in the same way as you would + expect in a word-processor.

    +
  • +

    If enabled the text rendering will support automatic line breaks at a + certain column. The line breaks are intelligent not to break words in + the middle.

    +

+

+

All text handling is centralized to the class Text (defined in file + jpgraph_text.inc.php) which is used both to add arbitrary + text to the graph as well as internally within the library to manipulate text on + labels and titles. All such texts are an instance of the Text class.

+

The paragraph alignment is controlled by the method + Text::SetParagraphAlign($aAlignment). The argument is a text string + that should be one of 'left', 'right' or + 'center'.

+

+

Note

+

Unfortunately the library does not support an "even" paragraph alignment + which in word processors adjust the kerning between individual characters to + make the text have even left and right sides. Implementing this would + require a much higher complexity than can be motivated for the type of text + needed in a graph library.

+

+

+

In the Figure 8.5. The different types of paragraph alignments (textpalignex1.php) the same text paragraph is rendered with the + possible paragraph alignments.

+

+

Figure 8.5. The different types of paragraph alignments (textpalignex1.php)

The different types of paragraph alignments (textpalignex1.php)


+

+

Inserting a newline character "\n" in text will cause the text line to break and + start on the next row. Note that the newline must be surrounded with double-quotes + and not single quotes.

+

+

Note

+

Bitmap fonts that are rotated, i.e. vertical, does not support automatic + line breaking. If line breaking is needed with vertical text then one of the + TTF fonts muts be used.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s06.html b/includes/jpgraph/docs/chunkhtml/ch08s06.html new file mode 100644 index 0000000..0196744 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s06.html @@ -0,0 +1,41 @@ +Adding custom TTF fonts

Adding custom TTF fonts

+ +

In addition to the predefined fonts it is possible to easily use up to three + custom fonts. This is done by first specifying the name of the font file that should + be used and then specifying the font family as either FF_USERFONT1, + FF_USERFONT2 or FF_USERFONT3. A new font is installed + by calling one or more of the methods

+

+

  • +

    Graph::SetUserFont1($aNormal,$aBold,$aItalic,$aBoldIt) + (or the synonym SetUserFont() )

    +
  • +

    Graph::SetUserFont2($aNormal,$aBold,$aItalic,$aBoldIt)

    +
  • +

    Graph::SetUserFont3($aNormal,$aBold,$aItalic,$aBoldIt)

    +

+

+

The argument to these methods should be the full font file name (including full + path) for the normal, bold, italic and/or bolditalic variant of the font family. All + arguments apart from "$aNormal" are optional.

+

An example on how this can be used to use a special font for the title of a graph + is shown in + Example 8.1. Specifying and installing a user specified font

+

Example 8.1. Specifying and installing a user specified font

+ +
1
+2
+3
+4
+5
+6
+7
+
<?php
+// ...
+$graph->SetUserFont('/usr/share/fonts/ttf/digital.ttf');
+$graph->title->SetFont(FF_USERFONT,FS_NORMAL,12);
+$graph->title->Set('Test title '.$pi);
+// ...
+?>
+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s07.html b/includes/jpgraph/docs/chunkhtml/ch08s07.html new file mode 100644 index 0000000..69822ba --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s07.html @@ -0,0 +1,101 @@ +Inserting Unicode entities

Inserting Unicode entities

+ +

One reason for using TTF fonts is the possibility to inserting unicode + character/entities. With this we mean characters from the extended range that are + not normally available on West european keyboards. This could for example be + classical Greek characters often used in mathematics, for example the symbol for + "pi". In order to make these and other commonly used "special" characters more + accessible the library provides a utility class that makes it easy to use these + characters without having to look up the corresponding unicode entities every + time.

+

In order to specify characters not available on the keyboard the normal way is to + specify there unicode code and included it in the text string with the prefix + "&#". For example the unicode for the character "pi" is "03C0" in hex so to + include this character in a text string you would have to write "This is pi + &#0960;" note that the code should be given in decimal encoding in the string + and always use 4 digits (pre-padded with 0:s as necessary). Since it is very tedious + to lookup and encode special characters the library offers a simpler way. The + SymChar class.

+

+

Note

+

This section can be skipped at first reading without loss of + continuity.

+

+

+

The utility class "SymChar"

+ +

As described above it is tedious to have to lookup all the character codes. To + simplify this the SymChar class allows you to find these characters with the + english common name of these symbols instead. For example to create a string + with the Greek character "pi" one would have to write the code as shown + in.

+

Example 8.2. Using the SymChar class to display the Greek letter "pi"

+ +
1
+2
+3
+4
+5
+6
+
<?php
+// ...
+$pi = SymChar::Get('pi');
+$graph->title->Set('Test is pi'.$pi);
+// ...
+?>
+

+

All supported entities with there symbolic names are listed in Table 8.3. Supported character entities in class SymChar. The first argument to the static method + SymChar::Get() should be the name of the entity and if the + second optional argument is true then the capital version (if it exists) of the + symbol should be returned.

+

+

Table 8.3. Supported character entities in class SymChar

+ +
NameUnicode Unicode capitalComment
"alpha"03B10391Greek character
"beta"03B20392Greek character
"gamma"03B30393Greek character
"delta"03B40394Greek character
"epsilon"03B50395Greek character
"zeta"03B60396Greek character
"ny"03B70397Greek character
"eta"03B80398Greek character
"theta"03B80398Greek character
"iota"03B90399Greek character
"kappa"03BA039AGreek character
"lambda"03BB039BGreek character
"mu"03BC039CGreek character
"nu"03BD039DGreek character
"xi"03BE039EGreek character
"omicron"03BF039FGreek character
"pi"03C003A0Greek character
"rho"03C103A1Greek character
"sigma"03C303A3Greek character
"tau"03C403A4Greek character
"upsilon"03C503A5Greek character
"phi"03C603A6Greek character
"chi"03C703A7Greek character
"psi"03C803A8Greek character
"omega"03C903A9Greek character
"euro"20AC Monetary symbol
"yen"00A5 Monetary symbol
"pound"20A4 Monetary symbol
"approx"2248 Mathematical
"neq"2260 Mathematical
"not"2310 Mathematical
"def"2261 Mathematical
"inf"221E Mathematical
"sqrt"221A Mathematical
"int"222B Mathematical
"copy"00A9 Misc symbols
"para"00A7 Misc symbols
"tm"2122 Misc symbols
"rtm"00AE Misc symbols
+


+

+

Figure 8.6. Rendered symbol characters corresponding to + + and Figure 8.7. Rendered capital symbol characters corresponding to Table 8.3. Supported character entities in class SymChar. shows how these symbol look when + they are rendered with the TTF font Times Roman 14pt. The symbols are in the same order + as in the table above and are visually grouped by there category as specified in + the column "Comment" in the table above.

+

+

Figure 8.6. Rendered symbol characters corresponding to + +

+ +
Rendered symbol characters corresponding to
+


+

+

+

Figure 8.7. Rendered capital symbol characters corresponding to Table 8.3. Supported character entities in class SymChar.

+ +
Rendered capital symbol characters corresponding to .
+


+

+
+

Graph example with Greek labels

+ +

In Figure 8.8. Specifying manual ticks as fraction of Pi. (manualtickex2.php) we have used the previous discussed + SymChar class to more readily insert "π" characters in the + X-axis label. We highlight some functionality that we haven't yet discussed in + detail

+

+

  1. +

    We use a utility class (FuncGenerator available in + "jpgraph_utils.inc.php") to help create + plot values from a mathematical expression. This will help create a + set of (x,y) points that can later on be used as the base for a data + series.

    +
  2. +

    The x-axis labels and the position of the tick marks on the x-axis + are manually positioned and specified to be positioned at "even" + fractions of π.

    +

+

+

+

Figure 8.8. Specifying manual ticks as fraction of Pi. (manualtickex2.php)

Specifying manual ticks as fraction of Pi. (manualtickex2.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch08s08.html b/includes/jpgraph/docs/chunkhtml/ch08s08.html new file mode 100644 index 0000000..86de054 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch08s08.html @@ -0,0 +1,127 @@ +Character encoding

Character encoding

+ +

Note

+

If you are not using Japanese, Chinese, Cyrillic , Greek or Hebrew + languages then this section can be safely skipped.

+

The core problem for the library is that it has no way of knowing in what + input encoding the string given to the library is using. Hence it is necessary to, + sometime, tell the library what input encoding is being used in order for the + library to do necessary character encoding conversion to generate UTF-8 (or UTF-16) + as needed to properly render the TTF fonts. The specific encoding options for each + major supported locale are explained below.

+

By default all JpGraph library files and examples are encoded in UTF-8

+

All defines mentioned below can be found in the file + "jpgraph_ttf.inc.php"

+

Japanese encoding options

+ +

There is only one possible option that can be specified.

+

+

Table 8.4. Japanese encoding options

+ +
Symbolic definePossible values Description
ASSUME_EUCJP_ENCODINGtrue/falseAssumes that Japanese text have been entered in EUC-JP + encoding. If this define is true then conversion from EUC-JP + to UTF8 is done automatically in the library using the + mbstring module in PHP. Note that the + multibyte extension in PHP is not normally enabled.
+


+

+

Otherwise it is assumed that the input characters are encoded in UTF-8. + Remember that to show the Japanese character sets (Kanji, Hiragana and Katakana) + one of the Japanese font families (FF_MINCHO, + FF_PMINCHO, FF_GOTHIC or FF_PGOTHIC) + must be specified.

+

An example of using Japanese locale together with Windrose plots can be seen + in Localizing the default names for the compass directions.

+
+

Chinese encoding options

+ +

There are no specific settings that control the encoding. The following rules + are used depending on the font is specified.

+

+

  1. +

    If the font is specified as FF_SIMSUN the built-in + library conversion from GB2312 to UTF-8 will be used. This + translation table is stored in the file + jpgraph_gb2312.inc.php.

    +
  2. +

    If the font is specified as FF_CHINESE then no + conversion is made since it is assumed that the input character + string is already in UTF-8 This only has the effect of changing the + font to the default Chinese font family.

    +
  3. +

    If the font is specified as FF_BIG5 then it is + assumed that the input character string is encoded in BIG5 and the + internal translation to UTF-8 is done by the iconv() + function. This means that PHP must be built with + iconv() support. By default this is not compiled + into PHP (needs the "--width-iconv" when configured). + For more on building PHP with the right options see Appendix I. Compiling PHP. If this method is not present + the library will generate the following an error message.

    +

+

+

An example of using Chinese encoding with Windrose plots can be seen in Figure 21.11. Using chinese fonts (windrose_ex6.1.php) +

+
+

Cyrillic encoding options

+ +

In order to do proper translation to unicode from cyrillic the + LANGUAGE_CYRILLIC define should be set to true. If you are + running the library in multiuser environment it might be necessary to also + adjust the LANGUGAE_CHARSET define as described below.

+

+

Table 8.5. Cyrillic encoding options

+ +
Symbolic definePossible values Description
LANGUAGE_CYRILLICtrue/false +

Special unicode cyrillic language support

+
CYRILLIC_FROM_WINDOWStrue/false +

If you are setting this config to true the conversion + will assume that the input text is encoded in windows + 1251, if false it will assume koi8-r

+
LANGUAGE_CHARSETstring +

This constant is used to auto-detect whether cyrillic + conversion is really necessary if enabled. Just specify + the encoding used, e.g. 'windows-1251', with a variable + containing the input character encoding string of your + application calling JpGraph.

+

A typical such string would be 'UTF-8' or 'utf-8'. The + comparison is case-insensitive. If this charset is not a + 'koi8-r' or 'windows-1251' derivate then no conversion + is done. This constant can be very important in + multi-user multi-language environments where a cyrillic + conversion could be needed for some cyrillic people and + resulting in just erroneous conversions for non cyrillic + language based people.

+

Example: In the free project management software + dotproject.net $locale_char_set is + dynamically set by the language environment the user has + chosen.

+

Usage: define('LANGUAGE_CHARSET', + $locale_char_set); where + $locale_char_set is a GLOBAL (string) + variable from the application including JpGraph.

+
+


+

+
+

Hebrew encoding options

+ +

There are no user adjustable settings. The conversion is made from iso to + unicode with the help of the PHP method "hebrev()" which is used to + convert logical Hebrew text to visual text. This conversion is done + automatically when the font is one of FF_DAVID, + FF_MIRIAM or FF_AHRON

+
+

Greek encoding options

+ +

In order to do proper translation to unicode from greek the + LANGUAGE_GREEK define should be specified to true.

+

+

Table 8.6. Greek encoding options

+ +
Symbolic definePossible values Description
LANGUAGE_GREEKtrue/falseSpecial unicode greek language support
GREEK_FROM_WINDOWStrue/falseIf you are setting this define to true the conversion of + greek characters will assume that the input text is windows + 1251
+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch09.html b/includes/jpgraph/docs/chunkhtml/ch09.html new file mode 100644 index 0000000..c4e548e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch09.html @@ -0,0 +1,62 @@ +Chapter 9. Using the JpGraph cache system

Chapter 9. Using the JpGraph 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. The library supports + two primary ways of significantly increase performance, using the built in cache system + described in this section and the use of a PHP accelerator described in Chapter 11. NuSphere PHP accelerator

+

Depending on the complexity of the image script, for example if it is doing several DB + lookups, the use of the library cache system (which will avoid running the graph scripts + completely if possible) can make a for very drastic performance increase.

+

Figure 9.1. Library cache principleshows an overview of the cache system in the library.

+

+

Figure 9.1. Library cache principle

+ +
Library cache principle
+


+

+

The rationale behind this is the observation that very few graphs are really + real-time, i.e. needs to be updated absolutely every time the graphing script is called. + For many graphs in a WEB-environment one can often get good precision by restricting the + graphs to only be updated, say, a few times each day. Of course, if truly live data is + what is needed then the cache system can not be used since then, by the nature of live + data, the graph script must be called at each instance to get the latest available data, + most probably from a database.

+

Enabling the library cache system

+ +

The enabling and disabling of the cache system is controlled by three defines in + jpg-config.php

+

+

  1. +

    DEFINE("USE_CACHE",true)

    +
  2. +

    DEFINE("READ_CACHE",true)

    +
  3. +

    DEFINE("CACHE_DIR","/tmp/jpgraph_cache/")

    +

+

+

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 a 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.

+

The third define is not really a switch but a directory specification that tells + the library what directory to use as the cache directory (where the cached images + are stored).

+

The cache directory (CACHE_DIR) can be set to an arbitrary directory + but the important thing to keep in mind is that the cache directory must be read and + writable for the process running PHP.

+

+

Note

+

The directory name given should be an absolute directory path and not a file path relative to the document + root.

+

+

+
+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch09s02.html b/includes/jpgraph/docs/chunkhtml/ch09s02.html new file mode 100644 index 0000000..4da8bf6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch09s02.html @@ -0,0 +1,25 @@ +Permission settings for the cache files

Permission settings for the cache files

+ +

Note: This section is only applicable to a Unix derivate + system which have the concepts of group and file + ownership.

+

There are two additional settings that will allow the control of the group and + file permission settings

+

+

  1. +

    DEFINE('CACHE_FILE_GROUP','www')

    +
  2. +

    DEFINE('CACHE_FILE_MOD',0664)

    +

+

+

The CACHE_FILE_GROUP specifies what group should be set on the cached + image file. If this is left empty then the group will be the same as the process + running PHP.

+

The CACHE_FILE_MOD specifies the file permissions for the image file. + If this is left empty the default permissions used by PHP will be set on the + file.

+

When PHP is run from the command line (using the PHP CLI version) then the file + permission and group will normally be set to the one of the suer running PHP. Keep + in mind that normally ordinary users are not allowed to change the group to + 'www' (the default Apache2 group).

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch09s03.html b/includes/jpgraph/docs/chunkhtml/ch09s03.html new file mode 100644 index 0000000..e9466c6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch09s03.html @@ -0,0 +1,188 @@ +Using the cache in your script

Using the cache in your script

+ +

The principle of the library cache is as follows when it is enabled.

+

+

  1. +

    The first time the graph script is called everything will be as usual, + the script will run and in the end the script sends back the image to + the browser. However if the caching is enabled JpGraph will + automatically have stored a copy of the generated image in the cache + directory.

    +
  2. +

    When the graph script is executed the next time it checks to see if an + image corresponding to this graph script has already been generated and + is available in the cache directory.

    +
  3. +

    If the image is available in the cache directory the library check to + see how old the image is. If the images is older than a specified limit + than it assumes that the image is out dated and runs the graph script as + usual and makes sure the newly generated image is stored in the cache + directory. Hence replacing the outdated image.

    +
  4. +

    If the image in the cache directory was current (i.e. not too old) it + is read and send back to the clients (e.g. Web-browser) without the rest + of the graph script being executed.

    +

+

+

From the above description there are a couple of parameters that should be + specified, the name to use when the image is stored and the timeout value when the + image is considered too old, i.e. how long was it since the image was + generated.

+

The first parameter, the filename, can be either manually specified or the library + can create a filename based on the name of the graph script.

+

Both these parameters are specified in the initial Graph() call where + a new graph instance is created. A basic example of this is shown in Example 9.1. Using an automatic cache filename and a 60min timeout of the cached + images..

+

+

Example 9.1. Using an automatic cache filename and a 60min timeout of the cached + images.

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+// ... includes
+ 
+$graph = new Graph($width, $height, 'auto', 60);
+ 
+// ... rest of the graph script
+ 
+$graph->Stroke();
+?>
+


+

+

The code in Example 9.1. Using an automatic cache filename and a 60min timeout of the cached + images.. will use an automatic filename for + the cached image and a make the image valid for 60 minutes. This means that if the + script is called again, within 60minutes, it will return the image just after the + initial Graph() call and not execute any more lines of code in the + script.

+

For basic usage this is all that is necessary, enable the cache in the settings + and supply a filename and a timeout value. The rest of the logic is handled by the + library.

+

+

Tip

+

If you want the timeout value to be "forever" then you can specify a + "0" as the timeout value (or leave the parameter blank). To + regenerate the image you will have to manually remove the image files from + the cache. This removal could for example be handled by a nightly + cron-job.

+

+

+

There is however one caveat which must be understood when using the above + construction. The image/graph store in the cached file will be returned to the + browser as a side effect of the initial $graph = new Graph(). This also + means that:

+

No lines after the initial Graph() call will be executed in the + image script in case the image exists in the cache directory.

+

This is the expected behaviour since this means that no unnecessary code will be + executed in the graph script in case the image has been found in the image + cache.

+

However, for the case where some more control of exactly how a cached image is + sent back it is necessary to add some complexity by doing things less automatically. + This gives greater control but also is slightly more complex and is described in the + next section.

+

Manually controlling the cached image

+ +

+

Note

+

These utility functions were added in v3.0.5 of the library. It is still possible + to do this in previous versions but then some more code is needed to + duplicate what these methods does. If this feature is wanted then it is + strongly advised to upgrade to this or later version.

+

+

+

There are two parts to doing this manually.

+

+

  1. +

    Check if the cached image exists in the cache and is valid (i.e. + not too old)

    +
  2. +

    Stream the cached image file back to the browser in that + case

    +

+

+

If the cached image is not valid then we just need to construct the graph as + usual and it will be stored in the cache automatically.

+

The following code example shows how this is done in principle in a graph + script where we use automatic naming i.e. the cached file name will get a name + based on the script name. This is done with the library utility function + GenImgName() which constructs a suitable image name from the + script name and with a proper image compression format (i.e png, jpg or + gif).

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php
+$width = ...;
+$height = ...;
+$cachefilename = GenImgName();
+$graph = new Graph($width,$height);
+ 
+// Check if the cache file exists and is valid
+$valid = $graph->cache->IsValid($cachefilename);
+ 
+if( $valid ) {
+    // The cached file is valid and we can now do any necessary
+    // processing and then send it back to the client
+    doSomeProcessingIfNecessary();
+ 
+    $graph->cache->StreamImgFile($graph->img,$cachefilename);
+ 
+} else {
+    
+    // The cache file is not valid or does not exists so we
+    // must construct the graph as normal
+ 
+    // Tell the graph that we want to cache this image
+    $timeout = ...;
+    $graph->SetupCache($cachefilename,$timeout);
+ 
+    // The remainder of a normal graph script
+ 
+    ...
+ 
+    // .. and send back the image as usual (this will also store
+    // a copy of the image in the cache directory)
+    $graph->Stroke();
+}

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch09s04.html b/includes/jpgraph/docs/chunkhtml/ch09s04.html new file mode 100644 index 0000000..5e0dcbc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch09s04.html @@ -0,0 +1,115 @@ +Using the cache with Client Side Image Maps (CSIM)

Using the cache with Client Side Image Maps (CSIM)

+ +

(See Chapter 10. Using CSIM (Client side image maps) for a full description on the usage of CSIM + together with the library)

+

You can also use the cache system for images that uses image maps (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 added complexity with CSIM scripts not sending back an image but rather a + pre-formatted HTML page. The two major differences from the non-CSIM cache + is:

+

+

  1. +

    The cached version will not be stored in the previous defined cache + directory. It uses a different cache directory.

    +
  2. +

    The script that want to make use of the cache system together with + CSIM must call an extra method, CheckCSIMCache(), to check + the cache.

    +

+

+

+

Note

+

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 (it can be manually or automatic) + 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. The file name must be specified + as a relative name.

+

For example "myimage" or perhaps + "firstpage/image3".

+

The reason for his is that a script that uses CSIM does not send back an image. + Instad it sends back a HTML page which includes the image map coordinates and has an + included "<img href=" ... ">" tag which references the image + script recursively in normal cases but if the image is found in the cache this + reference will be to a static image instead.

+

Depending on the installation of the library this will now end up in the directory + specified in the CSIMCACHE_DIR define. This must also be a directory + accessible by the normal HTTP/PHP process. By default, if nothing else is specified, + a directory called "csimcache" will be created in the same + directory as the image script itself.

+

The default value has the drawback that the directory from where the script is + executed must also be writable by the process running PHP. Best practice here 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, requires that the PHP and HTTP setup is such that the cache + directory is 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 core graph instance, i.e. + $graph = Graph($width,$height) and before any heavy work is done to + create the image so that no unnecessary work is done in case a cached image + image + map is found.

+

The general structure of a script that uses CSIM and cache should follow the + template shown in

+

+

Example 9.2. General structure for a CSIM script that uses CSIM

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php
+require_once( 'jpgraph.php');
+ 
+// ... any necessary includes
+ 
+$width = ...
+$height = ...
+$graph = new Graph($width,$height);
+ 
+// Check cache and use a 10 min timeout
+$graph->CheckCSIMCache('csim_image1',10);
+ 
+// If a cached version exists, execution halts here
+// and the cached HTML image map is sent back
+ 
+// ... construct and format the graph
+ 
+// ... finally send back the image map HTML script
+$graph->StrokeCSIM();
+?>
+


+

+

Please note that it is not necessary to pass any argument to the final call of + StrokeCSIM()

+

+

Note

+

The CSIM caching works by storing two files in the cache directory. One + file being the image and the other file being the corresponding image map as + a pure HTML file. The HTML file will reference the static image.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch10.html b/includes/jpgraph/docs/chunkhtml/ch10.html new file mode 100644 index 0000000..60624f4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch10.html @@ -0,0 +1,59 @@ +Chapter 10. Using CSIM (Client side image maps)

Chapter 10. Using CSIM (Client side image maps)

+ +

Image maps makes it possible to create images with "active" areas that will react for + a mouse-click. It is then up to the designer to decide what actions should be taken. + Image map is often used to create drill-down charts where it is possible to dynamically + zoom into an image. Image maps is part of the HTML standard.

+

There are actually two types of images maps, client and server-side. This refers to + where the actual processing of the image click happens. Without doubt the best (and most + commonly used) type is the client side. This is also what the library supports. In the + remainder of this manual this will be referred to as CSIM, Client Side Image Maps.

+

The principles

+ +

Image maps works so that each hotspot area in the graph that should be used must + have an associated URL. When the user clicks somewhere in that particular hotspot + area the browser will open the specified URL. Typical hotspot areas in the graphs + are

+

+

  1. +

    Texts, for example titles

    +
  2. +

    Markers in line graphs

    +
  3. +

    Slices in pie graphs

    +
  4. +

    Legends

    +
  5. +

    Bars in barplots

    +
  6. +

    etc.

    +

+

+

The way the CSIM HTML standard works is that the HTML page must have a section + with coordinates that defines the various hotspots together with the associated URL + that should be called. Each section of coordinates are connected to a specific image + that is included with a standard <img> by a common id. This will + now add some complexity since the library must return an HTML page for the + coordinates and not image data as normal for the library. How this is done is the + topic of the next section.

+

A number of examples of CSIM graphs are included in the + Examples/ directory. Some of the available examples are + listed in Table 10.1. CSIM Examples (in Examples/ directory)

+

+

Table 10.1. CSIM Examples (in Examples/ directory)

+ +
CSIM Examples (in Examples/ directory)
bar_csimex1.phpbar_csimex2.php
bar_csimex3.phpbarline_csimex1.php
barlinefreq_csimex1.phpboxstockcsimex1.php
ganttcsimex01.phpganttcsimex02.php
imgmarkercsimex1.phppie3d_csimex1.php
piec_csimex1.phppie_csimex1.php
scatter_csimex1.phptitlecsimex01.php
+


+

+

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.

+
+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch10s02.html b/includes/jpgraph/docs/chunkhtml/ch10s02.html new file mode 100644 index 0000000..634cb66 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch10s02.html @@ -0,0 +1,39 @@ +The basic structure of an image map script

The basic structure of an image map script

+ +

The basic structure for a HTML page using client side image maps will have the + following layout

+

+

// 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.

+

+

  1. +

    Use the preferred "builtin" way using the modified + Stroke() method StrokeCSIM() instead of + the standard Graph::Stroke() method.

    +
  2. +

    Directly use the Graph::GetHTMLImageMap() which gives you + fine control at the expense of more complex coding. This is necessary if + several image map graphs are needed on the same page.

    +

+

+

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 means that it is necessary to treat an image map returning image script + differently from a non-CSIM image script, for example it is not posible to use it + directly as the target for the "src" attribute of the + <IMG> tag since it sends back a HTML page containing both an + image tag together with an image map.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch10s03.html b/includes/jpgraph/docs/chunkhtml/ch10s03.html new file mode 100644 index 0000000..a8c492a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch10s03.html @@ -0,0 +1,37 @@ +Specifying targets for image map plots

Specifying targets for image map plots

+ +

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. CSIM is supported by all graph + types.

+

To specify a URI link for each hotspot the SetCSIMTargets() method is + used on the graph object that should be given a hotspot.

+

There are two arguments to this method

+

+

  1. +

    $aTargets, an array of valid URL targets. One URL per hot + spot, for example if you have a 10 values bar plot you need 10 URLs. If + the SetCSIMTarget() is applied to, for example, a text then + only one URL target should be specified.

    +
  2. +

    $aAlts, an array of valid alt-texts. Many browsers (but + not all) will show this text string if the mouse hovers over a + hotspot.

    +

+

+

Creating popup-windows as targets for CSIM

+ +

URL targets specified will be opened by the browser as usual, i.e. it will + replace the current HTML page. Another common usage pattern is to opena popup + window, perhaps with a zoomed version of a graph. This can be done by adding + some javascript in the target URL. If the URL, for example, is specified + as

+

+

$target = "..."; 
+$targetURL = "javascript:window.open('$target?id=%d','_new','width=500,height=300');void(0)"

+

+

clicking on a target will now open a separate window with the specified width + and height. The $target variable must be set to the wanted + URL.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch10s04.html b/includes/jpgraph/docs/chunkhtml/ch10s04.html new file mode 100644 index 0000000..b333e53 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch10s04.html @@ -0,0 +1,130 @@ +Using StrokeCSIM()

Using StrokeCSIM()

+ +

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

+
  1. +

    Use the CSIM image script as the target in a standard anchor reference, + for example

    +

    +

    <a href="mycsimscript.html"> 

    +

    +

    This has the drawback that the image page will only contain the image and + nothing else.

    +
  2. +

    The other way will allow the image script to be included in an arbitrary + HTML page by just including the image script at the wanted place in the HTML + page using any of the standard "include" php statement. For example

    +

    +

    <h2> This is an CSIM image </h2>
    +
    +<?php include "mycsimscript.php" ?>

    +

    +
+

Note: If there are several CSIM images on the same page it is necessary to use + "include_once" in the scripts for the inclusion of + "jpgraph.php" and the other jpgraph library files since the + files will be included multiple times on the same page and one or more "Already defined error" will be displayed.

+

The process to replace Stroke() with StrokeCSIM() is + strait forward. Replace all existing calls to Stroke() with the + equivalent calls to StrokeCSIM().

+

Optional argument to StrokeCSIM()

+ +

Once difference compared with Stroke() is that if a filename is supplied to + the StrokeCSIM() method it does not specify a file to write an + image to as is the case with Stroke(). The signature for the method is

+

+

StrokeCSIM($aScriptName='auto', $aCSIMName='', $aBorder=0)

+

+

The first (optional) argument is the name of the actual image script file + including the extension. So for example if the image script is called + "mycsimscript.php" the call should be

+

+

 $graph -> StrokeCSIM ( 'mycsimscript.php' ) 

+

+

By using the predefined name 'auto'. This will be done automatically.

+

+

Note

+

Why does the script name need to be used as the first parameter? The + reason is that in the creation of the HTML page which is sent back we + need to refer to the script in the image tag. In older versions of PHP + there where no 100% way of getting hold of the actual script name in all + circumstances and it was then necessary to specify it here. In PHP5 (and + newer version of PHP4) this is no longer a problem but this parameter is + still kept for backward compatibility.

+

+

+

The other arguments to StrokeCSIM() are optional as well. The + second argument specifies the id that connect the map with the corresponding + image. Please note that if several CSIM images are used in the same HTML page it + is 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.

+

The final argument specifies whether the image should have border or + not.

+
+

How does StrokeCSIM() work?

+ +

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 GET argument which is + passed on automatically when we use the image script name in the + <img>-tag.

+

A look at the generated HTML from StrokeCSIM() will make this clear. In Figure 10.1. Example of generated HTML code for StrokeCSIM() the resulting HTML code after + running the example script bar_csimex1.php is shown. The + argument to the src-property of the image tag is not simply the script name but + the script name with a additional argument, ?_jpg_csimd=1. This + argument is passed on to the library which then will run the script again but + this time only generate the image and not the HTML. (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.)

+

+

Note

+

The actual string name of this parameter is defined by a + DEFINE statement in JpGraph, + _CSIM_DISPLAY.

+

+

+

+

Figure 10.1. Example of generated HTML code for StrokeCSIM()

+ +
<map name="__mapname1828__" id="__mapname1828__" >
+<area shape="poly" coords="74, 210, 74, 165, 92, 165, 92, 210"  href="bar_clsmex1.php#1" title="val=12" alt="val=12"  />
+<area shape="poly" coords="118, 210, 118, 112, 136, 112, 136, 210"  href="bar_clsmex1.php#2" title="val=26" alt="val=26"  />
+<area shape="poly" coords="162, 210, 162, 176, 180, 176, 180, 210"  href="bar_clsmex1.php#3" title="val=9" alt="val=9"  />
+<area shape="poly" coords="206, 210, 206, 146, 224, 146, 224, 210"  href="bar_clsmex1.php#4" title="val=17" alt="val=17"  />
+<area shape="poly" coords="250, 210, 250, 93, 268, 93, 268, 210"  href="bar_clsmex1.php#5" title="val=31" alt="val=31"  />
+</map>
+<img src="bar_csimex1.php?_jpg_csimd=1" ismap="ismap" usemap="#__mapname1828__" border="0" width="310" height="250" alt="" />
+
+


+

+

+

Note

+

As the astute reader has come to realize CSIM scripts has a + performance impact in that each script has to be run twice. Once to get + hold of all the coordinates and generate the image and a second time via + the <img> tag in generated HTML. The library is intelligent enough to + minimize the code to run so that it only runs what is absolutely + necessary. This means that roughly 75% has to be run which yields a + total overhead of around 1.75 times when generating a CSIM image.

+

+

+
+

Image maps and the cache system

+ +

For version 1.9 and later the cache system has been extended to include the + CSIM maps as well. 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.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch10s05.html b/includes/jpgraph/docs/chunkhtml/ch10s05.html new file mode 100644 index 0000000..ded8aa2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch10s05.html @@ -0,0 +1,34 @@ +Getting hold of the image map

Getting hold of the image map

+ +

There are at least two cases where the basic StrokeCSIM() method will not work. + Basically this is limited to only showing the graph in one HTML page and nothing + more. So the cases where this needs to be handled differently are

+

+

  1. +

    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. +

    +
  2. +

    In order to include multiple CSIM images ona a WEB-page. (This is not + entirely true though, it is possible to include several CSIM graph + images with the use of the <iframe> tag. This in + effect creates it's own WEB page within the WEB page but we will not + discuss this further here.

    +

+

+

To get hold of the image map the function Graph::GetHTMLImageMap() + should be used. This returns the coordinates for the hotsposts

+

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.

+

+

1
+2
+3
+4
+
$graph -> Stroke ( "/usr/local/httpd/htdocs/img/image001.png" );
+ 
+echo  $graph -> GetHTMLImageMap ( "myimagemap001" );
+echo  "<img src=\"img/image001.png\" ISMAP USEMAP=\"#myimagemap001\" border=0>" ;

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch10s06.html b/includes/jpgraph/docs/chunkhtml/ch10s06.html new file mode 100644 index 0000000..1cf719b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch10s06.html @@ -0,0 +1,575 @@ +Mixing several CSIM images in an HTML page with text

Mixing several CSIM images in an HTML page with text

+ +

As was mentioned above using StrokeCSIM() is very simple but it has + the drawback that it returns a single HTML page without any possibilities to add + additional text which makes its use fairly limited in real life situation where the + graph is part of a complex WEB-page. In this section we will discuss some best + practice to do this.

+

In principle there are two ways to do this

+

+

  1. +

    Store both the image map and the image in files which are later read + back in the HTML page. This has the advantage of being simple but the + drawback that it increases the processing time since writing and reading + from a file takes time.

    +
  2. +

    Avoiding the use of temporary file by mimicking the way + StrokeCSIM() works and od the steps + StrokeCSIM() does internally but in the script + directly. In the remainder of this section we will show how this can be + setup. That part will also introduce the method + StrokeCSIMImage() which is key to include CSIM graphs + in HTML pages.

    +

+

+

Caution

+

Some of the described methods in this section was added in version 2.5 of the + library. In earlier versions more of this has to be done manually.

+
+

Adding one CSIM graph in a HTML page

+ +

The library has been designed to make this as painless as possible but due to + the way CSIM works there are some manual work that cannot be avoided. We will + start slowly and in detail walk through an example where we include one CSIM + graph in an arbitrary HTML page. There are a few things to keep in mind, the + rest will be taken care of automatically by the library

+

+

  1. +

    In the HTML page the CSIM map must be semi-manually included. (It + doesn't matter where)

    +
  2. +

    The <img> tag for rendering the image must be + semi-manually created

    +
  3. +

    The original graph script needs a minor augmentation since it + should no longer end by calling StrokeCSIM()

    +
  4. +

    Some care needs to be taken to specify what the URL:s to be called + should be

    +

+

+

The library provides suitable functions for step 1 & 2 above so the only + thing that needs to be done in the HTML page is calling these functions at + suitable places. In principle the HTML page should have the structure shown in Example 10.1. Principles of including CSIM graph in a HTML page

+

+

Example 10.1. Principles of including CSIM graph in a HTML page

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
<html>
+<body>
+<?php
+// The name of the graph script file (change as needed!)
+$_graphfilename = 'mycsimgraph.php';
+ 
+// This is the filename of this HTML file
+global $_wrapperfilename;
+$_wrapperfilename = basename (__FILE__);
+ 
+// Create a random mapname used to connect the image map with the image
+$_mapname = '__mapname'.rand(0,1000000).'__';
+ 
+// This is the actual graph script
+require_once ($_graphfilename);
+ 
+// Get hold of the image map to include it in the HTML page
+$imgmap = $graph->GetHTMLImageMap($_mapname);
+echo $imgmap;
+?>
+ 
+<p>Some arbitrary HTML text .... </p>
+ 
+<?php
+// We now create the <img> tag
+$imgtag = $graph->GetCSIMImgHTML($_mapname,$_graphfilename);
+echo $imgtag;
+?>
+ 
+</body>
+</html>
+


+

+

Before we discuss the HTML code in detail lets first show what augmentation is + needed in the graph script.

+

Normally the graph script will end with a call to either + Graph::Stroke() or Graph::StrokeCSIM(). However, + with CSIM style graph the complication is that we need to call the script twice. + Once to get the image map and once (in the final <img> tag) to actually + generate the image. In order to separate these two cases we make use of a URL + argument which will be used as a flag so that we know how to behave in the graph + script. In conjunction with HTML skeleton shown in Example 10.1. Principles of including CSIM graph in a HTML page we need to change the graph script so that + it instead uses the method Graph::StrokeCSIMImage() so that the + last line will be changed to

+

+

1
+2
+3
+
...
+$graph->StrokeCSIMImage();
+?>

+

+

This method will only stroke the image when the "secret" flag is passed as a + URL argument (which will be added automatically when the <img> tag is + constructed in the call to GetCSIMImgHTML() . This means that the + first time this function gets called when we do the initial + require_once() in the top of the HTML page this method will do + nothing, which is exactly what we want since we only want to include the graph + script in order to be able to do the call to GetHTMLImageMap() + later down in the script.

+

We are now in position to discuss the HTML script above.

+

+

Line 1-2
+

This is the standard HTML opening tags (by choice we keep this + very simple and sloppy in these example.)

+
Line 3-20
+

This is where we include the graph script. In addition we must + also create a map name that will be used to connect an image map + with the <img> tag. We have chosen to create + a random name since the actual name is not significant. The only + criteria is that the name must be unique if there are multiple + maps in the same HTML page.

+

In addition we also record the name of the actual HTML page in + the variable "$wrapperfilename". This is so we can + potentially use it as a target in the image script. We could + then have targets that redisplays the same page but with + potential additional or changed URL argument.

+
Line 21-22
+

This is just an illustration that it is possible to add + arbitrary HTML markups and text on the page.

+
Line 23-27
+

This is where we generate the needed <img> tag that should + be included in the page. It is illustrative to view how the + <img> tag actually looks.

+

+

1
+2
+
<img src="mycsimgraph.php?_jpg_csimd=1" ismap="ismap" 
+usemap="#__mapname987066__" border="0" width="400" height="250" alt="" />

+

+

The name of the image is the specified graph name (which was + given as the second argument). As can bee seen a URL argument + "flag _jpg_csimd=2" has been added. This is the + "secret" flag that instructs StrokeCSIMImage() to + actually send back the image. The second thing to notice is the + map name. This is the random name we constructed that is used to + connect to the map we wanted to use with this image.

+
Line 28-30
+

The closing HTML tags

+

+

+

What remains is to discuss how the actual CSIM targets in the graph script + should be constructed. Again there are some choices to be made on what should + happen when a user clicks on the gaph.

+

+

  1. +

    Clicking on a graph should open a "popup" window

    +
  2. +

    Clicking on a graph should open the same HTML page but with some + additional URL arguments

    +
  3. +

    Clicking on a graph should open a fresh page in the browser

    +
  4. +

    Clicking on the graph should open in an existing browser + window

    +

+

+

Earlier in this chapter we have shown how to handle case 1 so in the following + we will concentrate on cases 2-4. Before we start we need to discuss the third, + not yet mentioned, argument to the method SetCSIMTargets(). To + remind ourself this method is used on the various objects in a graph that can + act as hotspots. The full signature for this method is

+

+

1
+
SetCSIMTargets($aURLTargets,$aAltTexts,$aWinTargets);

+

+

The first argument specifies the URLs. Depending on the actual object this is + either a string or an array of strings.

+

The second argument specified the HTML "alt" texts. In most browser this is + shown as a popup text if the mouse pointer hovers over a hotspot area.

+

The final argument specifies the URL target window (where the link should + open). Most browser recognizes a few special targets here

  • +

    "_blank" . This will open the URL in a new browser window

    +
  • +

    "_top". Will break out of a frameset and display the target window + at top

    +
  • +

    "" (empty). Will open the target in the current window

    +
  • +

    "namedWindow". Will open the target in the named window

    +
+

In the discussions below we will assume that the graph is a basic barplot so + the URLs we specify are connected to each individual bar in the plot and are + specified with a call similar to

+

+

1
+
$bplot->SetCSIMTargets($targets,$altnames,$wintargets)

+

+

+

Case 2: Opening the same page but with some different URL + arguments.

+

To do this we make use of the name of the HTML wrapper file we stored in + $_wrapperfilename . We can then construct the targets as shown + in Example 10.2. Creating CSIM URL targets to open in same browser window

+

+

Example 10.2. Creating CSIM URL targets to open in same browser window

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php
+...
+global $_wrapperfilename;
+$n = .. ; // Number of bars
+$targ = array(), $alt = array(); $wtarg = array();
+for( $i=0; $i < $n; ++$i ) {
+    $urlarg = urlencode( ... );
+    $targ[] = $_wrapperfilename.'?'.$urlarg;
+    $alt[] = 'val=%d';
+    $wtarg[] = '';
+}
+$bplot->SetCSIMTargets($targ,$alt,$wtarg);
+...
+?>
+


+

+

+

Caution

+

Remember to not include the "&" or the "=" used when constructing + the URL argument in the call to urlencode(). Otherwise they + will become part of the data and not separators in the URL argument + string.

+

+

+

Case 3: Open a fresh page in the browser

+

The following example opens the plain browser script in a fresh window. In + order to get hold of the script name we use the predefined PHP constant + __FILE__ . The target can of course be changed to any + URL.

+

+

Example 10.3. Creating CSIM URL targets to open in a fresh window

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php
+...
+$n = .. ; // Number of bars
+$targ = array(), $alt = array(); $wtarg = array();
+for( $i=0; $i < $n; ++$i ) {
+    $urlarg = urlencode( ... );
+    $targ[] = __FILE__.'?'.$urlarg;
+    $alt[] = 'val=%d';
+    $wtarg[] = '_blank';
+}
+$bplot->SetCSIMTargets($targ,$alt,$wtarg);
+...
+?>
+


+

+

Case 4: Open in an existing window/frame

+

By modifying the $wtarg[] line in the example above to

+

+

1
+2
+3
+
<?php 
+$wtarg[] = '';
+?>

+

+

The target will open in the existing window.

+

In the "Example/" directory you can find the above a + fully working script as "csim_in_html_ex1.php" (HTML + script) and "csim_in_html_graph_ex1.php" (Graph + script).

+
+

Adding multiple CSIM graphs in a HTML page

+ +

Having laid the foundation for inclusion of CSIM graphs in Adding one CSIM graph in a HTML page it is now a simple exercise to + extend this to include multiple CSIM graphs in the same HTML page. The only + modifications we have to do is to make sure that:

+

+

  1. +

    Each image map has a unique name

    +
  2. +

    The graph scripts must create unique instances of the main Graph + class, i.e. they cannot both have an instance called + "$graph"

    +
  3. +

    Include each graph script in turn and get the corresponding HTML + map

    +
  4. +

    Get the proper image tag for each graph

    +

+

+

In Example 10.4. Example of HTML page that includes two Graph CSIM scripts + ("Examples/csim_in_html_ex2.html") we show a complete HTML script that + includes two graphs, one bar (the same as in the previous example) and one Pie + graph. For illustrative purposes we use class PieGraphC variant + which is a Pie graph with a circular middle. The result of calling this HTML + page is shown in ??

+

+

Example 10.4. Example of HTML page that includes two Graph CSIM scripts + ("Examples/csim_in_html_ex2.html")

+ +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+
<html>
+<body>
+ 
+<?php
+// The names of the graph scripts
+$_graphfilename1 = 'csim_in_html_graph_ex1.php';
+$_graphfilename2 = 'csim_in_html_graph_ex2.php';
+ 
+// This is the filename of this HTML file
+global $_wrapperfilename;
+$_wrapperfilename = basename (__FILE__);
+ 
+// Create a random mapname used to connect the image map with the image
+$_mapname1 = '__mapname'.rand(0,1000000).'__';
+$_mapname2 = '__mapname'.rand(0,1000000).'__';
+ 
+// Get the graph scripts
+require_once ($_graphfilename1);
+require_once ($_graphfilename2);
+ 
+// This line gets the image map and inserts it on the page
+$imgmap1 = $graph->GetHTMLImageMap($_mapname1);
+$imgmap2 = $piegraph->GetHTMLImageMap($_mapname2);
+echo $imgmap1;
+echo $imgmap2;
+ 
+?>
+ 
+<h2>This is an example page with CSIM graphs with arbitrary HTML text</h2>
+ 
+<?php
+if( empty($_GET['clickedon']) ) {
+   echo '<b style="color:darkred;">Clicked on bar: &lt;none></b>';
+}
+else {
+   echo '<b style="color:darkred;">Clicked on bar: '.$_GET['clickedon'].'</b>';
+}
+echo '<p />';
+if( empty($_GET['pie_clickedon']) ) {
+   echo '<b style="color:darkred;">Clicked on pie slice: &lt;none></b>';
+}
+else {
+   echo '<b style="color:darkred;">Clicked on pie slice: '.$_GET['pie_clickedon'].'</b>';
+}
+echo '<p />';
+?>
+ 
+<p>First we need to get hold of the image maps and include them in the HTML
+  page.</p>
+<p>For these graphs the maps are:</p>
+<?php
+// The we display the image map as well
+echo '<small><pre>'.htmlentities($imgmap1).'</pre></small>';
+?>
+<p>
+and
+</p>
+<?php
+// The we display the image map as well
+echo '<small><pre>'.htmlentities($imgmap2).'</pre></small>';
+?>
+ 
+<?php
+// Construct the <img> tags for Figure 1 &amp; 2 and rebuild the URL arguments
+$imgtag1 = $graph->GetCSIMImgHTML($_mapname1,$_graphfilename1);
+$imgtag2 = $piegraph->GetCSIMImgHTML($_mapname2,$_graphfilename2);
+?>
+<p>The graphs are then displayed as shown in figure 1 &amp; 2. With the following
+  created &lt;img> tags:</p>
+<small><pre>
+<?php 
+echo htmlentities($imgtag1); 
+echo htmlentities($imgtag2); 
+?>
+</pre></small>
+ 
+<p>
+Note: For the Pie the center is counted as the first slice.
+</p>
+ 
+<p>
+<table border=0>
+<tr><td valign="bottom">
+<?php
+echo $imgtag1;
+?>
+<br><b>Figure 1. </b>The included Bar CSIM graph.
+</p>
+</td>
+<td valign="bottom">
+<?php
+echo $imgtag2;
+?>
+<br><b>Figure 2. </b>The included Pie CSIM graph.
+</p>
+</td>
+</tr>
+</table>
+</body>
+</html>
+


+

+

+

Figure 10.2. Browser window after calling HTML page in Example 10.4. Example of HTML page that includes two Graph CSIM scripts + ("Examples/csim_in_html_ex2.html") (Note: The image has been + scaled down to better fit this manual.)

+ +
Browser window after calling HTML page in (Note: The image has been scaled down to better fit this manual.)
+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch11.html b/includes/jpgraph/docs/chunkhtml/ch11.html new file mode 100644 index 0000000..107cde5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch11.html @@ -0,0 +1,26 @@ +Chapter 11. NuSphere PHP accelerator

Chapter 11. NuSphere PHP accelerator

+ +

+

Caution

+

The NuSphere encoded variant of the library is only included in the JpGraph + pro version.

+

+

+

Introduction and purpose

+ +

One of the best way to increase the performance of large and complex PHP scripts + is to install one of the available PHP accelerators. JpGraph supports NuSphere PhpExpress accelerator. In order to take + advantage of this accelerator you must install the version of the library that is + encoded for use with the accelerator. This version is included in the Pro-version of + the library under the directory src-encoded/.

+

If you have the Pro-version of the library there is really no good reason not to + use the accelerated version of the library. It will reduce the load on your server + as well as significantly decrease the run time for graph scripts. In addition it + will also reduce some of the memory requirements needed since the parsing process + (translating PHP to bytecode) for the library can be avoided. Furthermore NuSphere PhPExpress also implements a caching mechanism + which means that often executed scripts will be kept in memory to avoid re-reading + them from disk each time they are needed. This applies to both encoded and + non-encoded script files.

+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/ch11s02.html b/includes/jpgraph/docs/chunkhtml/ch11s02.html new file mode 100644 index 0000000..f5c9bbe --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch11s02.html @@ -0,0 +1,31 @@ +Installing PhpExpress

Installing PhpExpress

+ +

NuSphere PhpExpress is a regular PHP extension, which makes it easy to install and + deploy. You can download PhpExpress freely from

+

http://www.nusphere.com/products/phpexpress.htm

+

To install NuSphere PhpExpress do the following:

+

+

  1. +

    Open your php.ini file for editing

    +
  2. +

    Add line + zend_extension_ts=c:\full\path\to\phpexpress-php-x.x.dll + if you are deploying on Windows, or + zend_extension=/full/path/to/phpexpress-php-x.x.so if + you are deploying on Unix, Linux or Mac OS operating systems

    +
  3. +

    Copy phpexpress-php-x.x.dll or + phpexpress-php-x.x.so in the PHP extensions + directory specified in php.ini file.

    +
  4. +

    Stop and Start Apache if you are running PHP as Apache module.

    +
  5. +

    [Optional] Execute call to phpinfo() function and make + sure that PhpExpress is properly installed Once PhpExpress is installed + on the server, you can execute PHP Scripts encoded with Nu-Coder as well + as regular, not encoded PHP scripts. In both cases you will gain an + improved performance in the execution of the scripts.

    +

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch12.html b/includes/jpgraph/docs/chunkhtml/ch12.html new file mode 100644 index 0000000..72216ea --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch12.html @@ -0,0 +1,105 @@ +Chapter 12. Commonalities for all graphs

Chapter 12. Commonalities for all graphs

+ +

All graph scripts follow, to some extent, the same structure. All scripts must start + by creating an instance of the Graph class. The Graph class represent the entire graph + and can have one or more plots build up from the data series. Almost all methods that + are used to control the appearance of the graph are methods of this class.

+

In order to give a feel for common objects we show examples of two of the most + commonly used graph types, cartesian graphs and pie graphs in the following two + sections.

+

Common objects for cartesian graphs (x-, y-graphs)

+ +

In all documentation of the library the convention is that the instance of the + Graph class will be stored in a variable named "$graph". Most of the + parts that make up a graph are available as instance variables of the Graph class. + In order to illustrate some of the commonly used instance variables Figure 12.1. Commonly used objects in a graph (common-obj-graph.php) shows a basic graph with a number of the + objects that can be manipulated in the graph scripts.

+

+

Figure 12.1. Commonly used objects in a graph (common-obj-graph.php)

+ +
Commonly used objects in a graph (common-obj-graph.php)
+


+

+

We note a few things in Figure 12.1. Commonly used objects in a graph (common-obj-graph.php) +

  • +

    All graphs will start by including the necessary library files via one + or more "require_once" PHP statements

    +
  • +

    All graph scripts (for 2D linear type graphs) will have the following + two method calls

    +

    +

    1
    +2
    +
    $graph = new Graph($width, $height);
    +$graph->SetScale('...');

    +

    +

    These two calls create the necessary instance of the core Graph class + that represents the entire graph and specifies what scale should be used + for the y- and x-axis. In Figure 12.1. Commonly used objects in a graph (common-obj-graph.php) we + are also using a second -axis so in this case the script will also + contain a call to

    +

    +

    1
    +
    $graph->SetY2Scale('...');

    +

    +
  • +

    Most graphs will also adjust the left, right, top and bottom margin. + In Figure 12.1. Commonly used objects in a graph (common-obj-graph.php) the margins are shown with + red arrows. The margins are specified with the method

    +

    +

    1
    +
    $graph->SetMargin($left,$right,$top,$bottom);

    +

    +
  • +

    All text objects (e.g. graph and axis titles) are instances of the + common Text class. This means that the text, font, color are specified + in the same way. For example the code to set the title and subtitle in + the graph above is

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +
    $graph->title->SetFont(FF_ARIAL, FS_BOLD, 14);
    +$graph->title->Set("Using JpGraph Library");
    +$graph->title->SetMargin(10);
    + 
    +$graph->subtitle->SetFont(FF_ARIAL, FS_BOLD, 10);
    +$graph->subtitle->Set('(common objects)');

    +

    +

    In a similar way the code to set the titles of the axis are

    +

    +

    1
    +2
    +3
    +4
    +5
    +
    $graph->xaxis->title->SetFont(FF_ARIAL, FS_BOLD, 10);
    +$graph->xaxis->title->Set("X-title");
    + 
    +$graph->yaxis->title->SetFont(FF_ARIAL, FS_BOLD, 10);
    +$graph->yaxis->title->Set("Y-title");

    +

    +
  • +

    The graph uses a legend in two rows to name each data series. The + position of the legend is controlled by the script and in Figure 12.1. Commonly used objects in a graph (common-obj-graph.php) we placed it on the right side. + It is also possible to in detail to adjust the layout of the names in + the data series. For example we could change the layout of the legend to + position all the names of the data series in one row as opposed to one + column which is the default. The number of columns and/or rows is user + settable.

    +
  • +

    Finally all graphs will end with a call to Stroke() or + one of its variants (StrokeCSIM(), + StrokeCSIMIMage()). As was described in Part II this + will send back the constructed image to the client, usually a + browser.

    +
+

For other types of graphs (for example Gantt charts) some of the above standards + still apply but since they have a very different usage and layout the instance + variables will be different.

+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/ch12s02.html b/includes/jpgraph/docs/chunkhtml/ch12s02.html new file mode 100644 index 0000000..18403f0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch12s02.html @@ -0,0 +1,60 @@ +Common object for Pie Graphs

Common object for Pie Graphs

+ +

For pie plots there are no concepts of axis or scales. Instead Pieplots have a + size and position within the graph. Figure 12.2. Commonly used objects in Piegraphs ( + common-obj-piegraph.php) + shows the common objects for a typical Pie graph

+

+

Figure 12.2. Commonly used objects in Piegraphs ( + common-obj-piegraph.php)

+ +
Commonly used objects in Piegraphs ( common-obj-piegraph.php)
+


+

+

The following should be noted.

+

+

  • +

    Instead of an instance of class Graph and instance of + class PieGraph must be used

    +

    +

    1
    +
    $graph = new PieGraph($width,$height);

    +

    +
  • +

    The title and subtitle has the same semantics as for cartesian + graphs

    +
  • +

    The pieplot is an instance of the class PiePlot which is + given the data to be used in the pieplot as first and only + argument

    +

    +

    1
    +
    $pieplot = new PiePlot($data);

    +

    +
  • +

    The size of the pieplot radius is given as fractions of the minimum of + the width and height of the graph

    +
  • +

    The position of the center of the pieplot is given as factions (width, + height) of the graph

    +
  • +

    The legend is controlled in the same way as for cartesian graphs by + accessing the instance variable "legend". In the Piegraph + in Figure 12.2. Commonly used objects in Piegraphs ( + common-obj-piegraph.php) we have changed the + layout of the legend by the two lines

    +

    +

    1
    +2
    +
    $graph->legend->SetPos(0.5,0.97,'center','bottom');
    +$graph->legend->SetColumns(3);

    +

    +

    These two method calls adjust the position and the internal layout of + the legend. The first line instructs the library to place the legend at + a point (defined in fractions of width and height) (0.5, 0.97) and align + that point with the (center, bottom) anchor point in the graph box. The + second lines specifies the number of columns to use int the + legend.

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch13.html b/includes/jpgraph/docs/chunkhtml/ch13.html new file mode 100644 index 0000000..63f7e13 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13.html @@ -0,0 +1,50 @@ +Chapter 13. Getting hold of the data to be displayed

Chapter 13. Getting hold of the data to be displayed

+ +

The initial obstacle that must be negotiated is to get hold of the data to be + displayed since the library itself is completely agnostic to where the data comes from. + The library will use data supplied in one or more arrays and it is up to the user of the + library to get hold of the data to populate these arrays with proper data. In principle + the data can come from one of the following places

+

+

  1. +

    Hard-coded data in the script. This is the least flexible and can only + really be recommended for examples and really static data.

    +
  2. +

    Data stored in plain text files.

    +
  3. +

    Data stored in binary format in flat files.

    +
  4. +

    Data stored in a database

    +
  5. +

    Data sent to the script via URI parameter passing (either GET or POST HTTP + constructs can be used).

    +

+

+

In the following sections we will shortly discuss each of these methods.

+

+

Caution

+

The library assumes that the data available in an array that starts with index + 0

+

+

+

Static data

+ +

This is the simplest way and consists of only specifying the data in one or + several usual PHP arrays directly in the graph script. For example to specify data + for a Pieplot one could use the following constructions

+

+

1
+2
+
$data = array(1,8,5,4,12,18);
+$pieplot = new PiePlot ($data);

+

+

This is the method used for all examples under the "Example/" + directory.

+
+ + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch13s02.html b/includes/jpgraph/docs/chunkhtml/ch13s02.html new file mode 100644 index 0000000..c57aaaf --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13s02.html @@ -0,0 +1,164 @@ +Reading data from a file

Reading data from a file

+ +

The second method in order of complexity is to read the data from plain text + files. An example on how to use this was shown in Preparing the data. The library contains utility + methods to ease reading of plain textual data in one of the following + formats:

+

+

  1. +

    One column

    +
  2. +

    Two columns

    +
  3. +

    Comma separated values, CSV

    +

+

+

The utility class to handle this is called Class ReadFileData and + contains three utility methods corresponding to the list above, they are + ReadFileData::From1Col(), ReadFileData::From2Col(), + ReadFileData::FromCSV() and + ReadFileData::FromCSV2().

+

These methods are described shortly below

+

+

ReadFileData::From1Col($aFileName, $aCol1)
+

Reads data from a text file with one column of data and stores in + the supplied $aCol1 vector.

+

Typical data looks like

+

+

1
+2
+3
+
123
+14.5
+19.2

+

+

which would result in

+

+

1
+
$aCol == array(123, 14.5, 19,2)

+

+
ReadFileData::From2Col($aFile, $aCol1, $aCol2, $aSepChar=' + ')
+

Reads data from a text file with two columns separated by the + specified character.

+

Typical data looks like

+

+

1
+2
+3
+
12,15
+13,34
+14,27

+

+

which would result in

+

+

1
+2
+
$aCol1 == array(12,13,14);
+$aCol2 == array(15,34,27);

+

+
ReadFileData::FromCSV($aFile,&$aData,$aSepChar=',',$aMaxLineLength=1024)
+

This method reads comma separated values from a specified file. + The values are all separeted by the specified character. This method + can be seen as a generalization of From1Col() method.

+

Typical data looks like

+

+

1
+
12,34,56,18,19.7,55

+

+

which would result in

+

+

1
+
$aData == array(12,34,56,18,19,7,55)

+

+
ReadFileData::FromCSV2($aFile, &$aData, $aOptions = + array())
+

This method also reads comma separated values from a file but with + more advanced options to control how the data is read. This can be + seen as a generalization of From2Col() method.

+

The possible options and there default values for this method + are

+

+

  • +

    'separator' => ','

    +
  • +

    'enclosure' => '"'

    +
  • +

    'readlength' => 1024

    +
  • +

    'ignore_first' => false

    +
  • +

    'first_as_key' => false

    +

+

+

Typical data (using the default values)

+

+

1
+2
+3
+
10,55
+12,78
+15,98

+

+

would result in

+

+

1
+2
+3
+4
+
$aData = array(
+  0 => array(10,12,15),
+  1 => array(55,78,98)
+);

+

+

If 'first_as_key'=>true and the data looks looks like

+

+

1
+2
+3
+4
+
"key","value"
+10,55
+12,78
+15,98

+

+

the data would instead be read as

+

+

1
+2
+3
+4
+
$aData = array(
+  "key"   => array(10,12,15),
+  "value" => array(55,78,98)
+);

+

+
ReadFileData::FromMatrix($aFile,$aSepChar=' ')
+

This method is especially suited o read matrix data from a file + for use with the Matrix visualization (described in Chapter 22. Matrix graphs). Each line in the file + corresponds to one row in the matrix.

+

Typical data can look like

+

+

1
+2
+3
+
13,87,12
+15,99,33
+19,86,61

+

+

Which wold return a matrix looking like

+

+

1
+2
+3
+4
+5
+
array( 
+  array(13,87,12),
+  array(15,99,33),
+  array(19,86,61)
+);

+

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch13s03.html b/includes/jpgraph/docs/chunkhtml/ch13s03.html new file mode 100644 index 0000000..d1d9a46 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13s03.html @@ -0,0 +1,371 @@ +Sending data to a graph script with URI arguments (GET and POST)

Sending data to a graph script with URI arguments (GET and POST)

+ +

In order to send data between different HTML pages (or to a specific page) there + are two ways to do this. Either by including the parameters in the URI directly, + (e.g. http://localhost/mygraph.php?d1=12) or by creating a POST request + and send to a page. The details of these two methods are discussed below.

+

+

Note

+

There might be some confusion when to use the '&' and + when to use '&amp;' to separate variables in GET or POST + requests.

+

When writing URL in HTML the string should always be written with a full + entity encoding since the '&' is a special character + indicating the start of an entity that ends with an ';'. So for + example writing a URI in a HTML page should look like.

+

<a + href="myscript.php?idx=1&amp;start=2009&amp;end=2010">

+

the browser will then correctly convert the URI to single + '&' which is what should be sent to the server. When + typing URI directly in the browser (or in any plain text file) one should of + course always just use a single '&' +

+

+

+

+

Tip

+

Use the method http_build_query() to build http queries from + an array with keys and values.

+

+

+

Using GET arguments

+ +

GET arguments are the arguments that can be added as part of the URI. For + example as

+

+

http://localhost/mygraph.php?id=12&start=20081223&end=20090115

+

+

PHP automatically places all given arguments in the "super global" array + variable $_GET as an associative array.

+

There are a couple of things to note here

+

+

  • +

    The values in the argument string in the URI must be URL encoded, + this can easily be done with the PHP function + urlencode() (See + PHP Manual)

    +
  • +

    When the arguments are read from $_GET the must be un-quoted with + a call to urldecode()

    +
  • +

    Some browsers restrict the length of the URI that they will read + (typically < 2048bytes) which means that there is a limit on how + much data can be send as URI arguments

    +
  • +

    Some browsers will allow the syntax + "a[0]=10&a[1]=11&a[2]=12" i order to send + the array (10,11,12)

    +

+

+

This way of specifying the argument string is mostly useful when

+

+

  • +

    The arguments are short

    +
  • +

    When the user should be able to bookmark an URI

    +
  • +

    When the data is not sensitive (since it can be seen in the + URI)

    +
  • +

    When the graph should be viewable by clicking on a link (more on + this when we compare the GET method with the POST method + below)

    +

+

+

The "best practice" of using this method is to send a short key (or id) to the + graph script and the graph script itself will use this id to extract the real + data from a DB (or a plain text file). This way the same core graph script can + be used in various context to display wanted data.

+
+

Using a POST request

+ +

+

Warning

+

This is a fairly advanced topic and it is recommended to use the other + methods of sending data to a script unless the specifications explicitly + demands that a POST request is constructed. Furthermore this requires a + very good understanding of HTTP request headers and the difference + between server side and browser side so if you are not sure that you + have the necessary background we strongly recommend to stay away from + this method.

+

+

+

Two of the obvious restrictions with the GET method is that a) the length of the data is restricted and b) the data is visible directly in the URI. The other + way to send data as part of the HTTP request is to use the POST method.

+

Unfortunately this is not as easy as just doing some magic and then we get the + same functionality as with the GET method. Even some authors get this wrong in + some very prominent PHP text books. Unfortunately it will take us too far to + discuss all the details of HTTP request headers (as described in RFC2616) + but we will explain the very basics.

+

First. let's state what an HTTP request is

+

+

  • +

    A POST HTTP request is used to send data to a specified URI from a + client. A client is normally a WEB-browser but can also (as we will + use it) be a script that sends the request to the same or to another + server. The data is URL encoded and passed in the body of the + request. There is no theoretically limit on the length of the + data.

    +

+

+

A further common misunderstanding is that it is possible to use the PHP method + header() in order to create a POST request. This is even given + as an example in the notes to the header() method in the PHP manual + (See PHP + Manual). This is wrong. It is + not possible to use the + header() method to send a POST header. Trying to do this + reveals a basic misunderstanding of the role of a server and client.

+

+

  • +

    The header() method is used to send one or more + headers from the server to the + client (i.e. WEB-browser)

    +
  • +

    The HTTP POST request goes from the client (i.e. WEB-browser) + to the server

    +

+

+

Figure 13.1. Post vs. header() data direction

+ +
Post vs. header() data direction
+

Note that the image is greatly simplified to help illustrate the + vital point on data direction. For example the post request shown to + originate from a browser could originate from any client, for + example another script taking the role of a client.

+
+

+

Hence it is never possible to "simulate" a POST call with the use of the + header() function. There are basically three (correct) ways to + simulate a POST request as described below.

+

Before we continue lets first recapitulate the most common use of a POST + request, i.e. in a HTML form submission. When data is entered in a form on a + HTML page and the user presses the "Submit" button the data from the form is + packed as a POST request which is sent to the server at the specified URI (the + action URI). The server will the reply back to the POST request (with the data + sent back from the target of the post request) and the browser will show the + reply in the window in place of the original HTML form page.

+

However there is a crucial difference when we do this manually from a script + (running on the server) compared with the original form post data from the + browser to the server. After issuing a POST request (originating from a HTML + form) the browser automatically replaces the current page with the reply from + the POST request as a "new" page (by default using the same target window as the + request was made from).

+

This is not possible to do when sending a "fake" post request to a page since + we are not the browser. Instead what we will see in the browser is the page + sending the POST request, and not the + target of the post request. The best we can accomplish is to show the reply + inline in the calling page which are then shown in the browser.

+

This means that it is not possible to create a POST request and then somehow + directly show the reply as the resulting image. Instead what we can do is to + send the data to a image script (via a POST header) and then the graph script + can write the image to a file that is accessible from the server.

+

So to summarize. What we can do with a post request is to send the data to a + script b.php from a script a.php. The + b.php can then execute some statements, for example + creating a graph and store it on the server. This stored image can later be read + by the a.php script, for example via a <img> + tag.

+

How to create a POST request

+

There are in principle three ways of constructing a POST request to send data + to a specified URI as shown below.

+

After we have made the request (with any of the three methods shown below) the + server will reply back with the response created by the URI. This response is + any output sent by the script we are sending our request to. Normally this + should just be a return code indicating if the request was successful or + not.

+

Remember that these are calls made from the script a.php + running on server A to a script + b.php running on server B. There are no browser involved in these calls apart from the + initial request to run a.php. The figure below illustrates + the first phase when the request is sent to the B side

+

+

Figure 13.2. The request phase of a POST header

+ +
The request phase of a POST header
+

1. The request is initially made by calling the a.php script, + e.g. http://localhost/a.php in the browser

+

2. When the a.php script is executed it will create the POST + header and call script b.php o the server B (could possibly be + the same server). Since the browser is displaying script a.php + we can never change that directly but we can display the reply + from b.php in the page displayed by a.php

+
+


+

+

Figure 13.3. The reply phase of a POST request

+ +
The reply phase of a POST request
+

3. The b.php returns a reply by fir example echoing back a reply + code

+

4. The script running the browser receives its final data (which + is the reply from the b.php script) and then finish the original + request started in step 1.

+
+

+

Note: All the sendPostData_vX() + methods below assumes that the data is already urlencoded.

+

+

  1. +

    Create a stream request.

    +

    The advantage with this method is that it is available by default + in PHP >= 4.3 and of course in PHP5,6 without the need to install + additional libraries.

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +
    <?php
    +function sendPostData_v1($url, $data) { 
    +  $opts = array('http' => array(
    +    'method' => 'POST', 
    +    'header' => 
    +        "Content-type: application/x-www-form-urlencoded\r\n".
    +        "Content-Length: ".strlen($data)."\r\n".
    +    'content' => $data,
    +    ); 
    +  $stream = stream_context_create($opts); 
    +  $fp = fopen($url, 'rb', false, $stream); 
    +  if (!$fp) { // Some error handling } 
    + 
    +  // Find out what the page returns as its body 
    +  $reply = stream_get_contents($fp); 
    +  if ($reply === false) { // Some error handling } 
    + 
    +  return $reply; 
    +} 
    +?>

    +

    +
  2. +

    Open a socket directly and write to it +

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +
    <?php
    +function sendPostData_v2($url,$data,$port=80) { 
    +  $errno=-1;
    +  $errstr=''; 
    +  $fs = fsockopen($url,$port,$errno,$errstr); 
    +  if( $fs === false ) { // Some error handling } 
    + 
    +  $header = "POST $url HTTP/1.0\r\n"; 
    +  $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; 
    +  $header .= "Content-Length: " . strlen($data) . "\r\n\r\n"; 
    +  fputs($fs, $header . $data ); 
    + 
    +  // Find out what the page returns as its body 
    +  $reply = ''; 
    +  while( !feof($fs) ) { 
    +    $reply .= fgets($fp,8192); 
    +  } 
    +  return $reply; 
    +} 
    +?>

    +

    +
  3. +

    Use CURL to handle all the necessary + details

    +

    Note 1: This requires that curl + libraries are installed and that curl is enabled in the PHP + installations.

    +

    Note 2: Depending on the + application there might be many more options that needs to be + tweaked. The one used below are just the bare necessities.

    +

    Note 3: Using CURL is the most + general way to handle POST requests and simplifies the additional + complexity if we want to add encryption (i.e. HTTPS) in the + connection handling.

    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +
    <?php
    +function sendPostData_v3($url,$data)
    +{
    +  // Initialize and get the curl handle
    +  $ch = curl_init();
    + 
    +  // Include possible headers in the reply from the server as well
    +  curl_setopt( $ch, CURLOPT_HEADER, true );
    + 
    +  // Return the reply as a string from curl_exec() instead of directly to stdout
    +  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
    + 
    +  // The URI we want to send the post data to
    +  curl_setopt($ch, CURLOPT_URL, $url);
    + 
    +  // Use the POST method
    +  curl_setopt($ch, CURLOPT_POST, true);
    + 
    +  // All the data to be sent
    +  curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
    + 
    +  $reply = curl_exec ($ch);
    + 
    +  curl_close($ch);
    +  return $reply;
    +}
    +?>
    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch13s04.html b/includes/jpgraph/docs/chunkhtml/ch13s04.html new file mode 100644 index 0000000..1569321 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13s04.html @@ -0,0 +1,35 @@ +Reading data from a database

Reading data from a database

+ +

Since there are so many databases and so many ways to organize data in tables it + is impossible to give generic examples. Instead we point out some common pitfalls + when gathering data from a database.

+

+

  • +

    Make sure the data is valid numeric data. It is a common mistake to + read NULL (or empty strings "") values and try to plot + them. Beware that the PHP function empty() also will return + true for 0 and "0" values so it is not enough to just test with + empty() since this will also remove all values that + happens to be valid 0 values. To avoid this use the following modified + empty method.

    +

    +

    1
    +2
    +3
    +4
    +5
    +
    function empty0($aValue){
    +    if ( !is_numeric(trim($aValue)) ) 
    +        return empty($aValue);
    +    return false;
    +}

    +

    +
  • +

    Some databases (e.g. MySQL) returns a column with decimal type values + as string in a SELECT statement which normally is handled by automatic + conversion in PHP but since PHP has different interpretation of "0.00" + and 0.00 in respect to what is interpreted as empty or not this needs to + be carefully handled.

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch13s05.html b/includes/jpgraph/docs/chunkhtml/ch13s05.html new file mode 100644 index 0000000..c83b6f7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13s05.html @@ -0,0 +1,22 @@ +Reading binary data from a file

Reading binary data from a file

+ +

This can be potentially dangerous since the exact format for the binary data can + differ depending on convention and system. The advantage is that it usually gives + smaller data files and is usually not as suspect to data corruption since it is not + easy to read directly into a text editor and change. In PHP a variable can be stored + in a binary format using the serialize() function and read back from a + file with unserialize()

+

+

Tip

+

It is also possible to store binary data in a text file as a string. One + way of doing this is to do a base64 encoding of the binary data. This will + guarantee that the encoded data will only be printable characters which can + be stored in a normal string. One thing to remember is that this will + enlarge the data by roughly 30%. Another example on when base64 encoding is + useful is to store binary images in a text file. This is the way for example + all built-in images are stored in the library. The image is the re-created + from the string by first decoding the base64 data and then read in the data + with the GD function imagecreatefromstring() .

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch13s06.html b/includes/jpgraph/docs/chunkhtml/ch13s06.html new file mode 100644 index 0000000..c40e86e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13s06.html @@ -0,0 +1,69 @@ +Different types of NULL data handling

Different types of NULL data handling

+ +

In some data there might be data points missing. For example if some experimental + data is to be graphed there can be data points where the equipment was faulty and + not valid values exist. The library offers to way to handle this.

+

+

  1. +

    Leave the data point empty and leave a whole in the graph, for example + a break in a line plot. This happens iof the null value is specified as + either one of the following values

    +

    +

    • +

      'x' - A single character 'x'

      +
    • +

      '' - An empty string

      +
    • +

      NULL - The NULL value

      +

    +

    +
  2. +

    Ignore the data point and connect the previous and next data point + with the line in a line graph. This is accomplished by specifying the + null value as

    +

    +

    • +

      '-' - A single hyphen character

      +

    +

    +

+

+

In Example 13.1. Illustration of different types of NULL values in graphs an example with the different types of + null values are shown. In these graphs the third data point is set to null with the + two different null values.

+

+

Example 13.1. Illustration of different types of NULL values in graphs

+ +
+
+

Figure 13.4. Original graph with all values

+ +
Original graph with all values
+

+
+

Figure 13.5. Value at x=2 as ''

+ +
Value at x=2 as ''
+

+
+

Figure 13.6. Value at x=2 as '-'

+ +
Value at x=2 as '-'
+

+
+
+


+

+

+

Caution

+

If all values in a line plot are null values an error will be shown since + this is not considered to be a valid plot.

+

+

Figure 13.7. Error when only null values are specified

+ +
Error when only null values are specified
+


+

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch13s07.html b/includes/jpgraph/docs/chunkhtml/ch13s07.html new file mode 100644 index 0000000..308a58a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch13s07.html @@ -0,0 +1,47 @@ +Troubleshooting input data

Troubleshooting input data

+ +

There are two common mistakes that causes problems with input data.

+

+

  1. +

    The indexes in the data array has missing keys. The library assumes + that the data array has consecutive values indexed from 0 and upwards. + This means that the following data array specification is illegal

    +

    +

    1
    +
    $data = array( 1 => 23, 2 => 14, 3 => 17 ) ;

    +

    +

    The problem with the array above is that it lacks the 0 key. A similar + problem is to have a missing index, such as

    +

    +

    1
    +
    $data = array( 0 => 23, 2 => 14, 3 => 17 ) ;

    +

    +

    If E_NOTICE is not enabled in + php.ini then this mistake will give the + (slightly misleading) error message shown in Figure 13.7. Error when only null values are specified. If full error checking is + enabled in php.ini then these types of problem will give the standard + PHP error message shown in Figure 13.8. PHP (HTML) error when missing data keys. This shows a PHP setup + which has HTML errors enabled. Note the JpGraph textual error string at + the bottom of the second PHP error message box.

    +

    +

    Figure 13.8. PHP (HTML) error when missing data keys

    + +
    PHP (HTML) error when missing data keys
    +


    +

    +
  2. +

    Another typical mistake caused by "faulty data" is different + convention for specifying decimal data. PHP and the library assumes that + decimal data used "." (point) to separate the integer from the decimal + part of a number. Some locales uses "," (comma) to do this separation. + This means that the following code will not work.

    +

    +

    1
    +
    $data = array( 0 => '12,0', 1 => '18,0', 2 => '15,0' ) ;

    +

    +

    Again, if E_NOTICE is not enabled in + php.ini then this mistake will give the + (slightly misleading) error message shown in Figure 13.7. Error when only null values are specified

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14.html b/includes/jpgraph/docs/chunkhtml/ch14.html new file mode 100644 index 0000000..5e2d09d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14.html @@ -0,0 +1,436 @@ +Chapter 14. Common features for all Cartesian (x,y) graph types

Chapter 14. Common features for all Cartesian (x,y) graph types

Table of Contents

14.1. The definition of linear graphs
14.1.1. Axis and coordinate systems
14.1.2. Adjusting the axis look and feel
14.1.3. Adding grid lines in the plot
14.1.4. Predefined scientific axis setups
14.1.5. Other possible ways to position the axis
14.2. Specifying and formatting the overall displayed graph
14.2.1. Adjusting size, margins and frame
14.2.2. Adding drop shadow to the graph
14.2.3. Formatting and specifying the titles of the graph
14.2.4. Specifying the image format to use
14.2.5. Generic line formatting
14.2.6. Adding a footer to the graph
14.2.7. Adding timing of graphs
14.3. Adjusting the look and feel of the plot area
14.3.1. Plot area and margin areas
14.3.2. Clipping to the plot area
14.4. Adjusting the position and layout of the legend
14.5. Other formatting options of the axis
14.5.1. Adjusting and positioning titles on the axis
14.5.2. Adjusting the font and color of the title
14.6. Using multiple y-axis
14.6.1. Adding additional y-axis
14.6.2. Using CSIM together with multiple y-axis
14.6.3. Restrictions with multiple y-axis
14.7. Understanding and using different scales on the axis
14.7.1. Different scale types
14.7.2. Manual vs automatic scale handling
14.7.3. Major and minor ticks
14.8. Adjusting the appearance of the scale labels
14.8.1. Adjusting the position
14.8.2. Adjusting font and color
14.8.3. Adjusting the background of the labels
14.8.4. Hiding and rotating labels
14.8.5. Fine tuning the automatic scales
14.8.6. Manually altering the appearance of tick marks
14.8.7. Manually specifying scale labels
14.8.8. Emphasize of parts of the scale
14.8.9. Adding static lines for specific scale values in the graph
14.9. Using a logarithmic scale
14.10. Using a date/time scale
14.10.1. Specifying the input data
14.10.2. Adjusting the start and end date alignment
14.10.3. Manually adjusting the ticks
14.10.4. Adjusting the label format
14.10.5. Adjusting the automatic density of date labels
14.10.6. Creating a date/time scale with a manual label call-back
14.10.7. Using the "DateScaleUtils" class to make manual date scale
14.10.8. When to use manual and when to use automatic date scale?
14.11. Adding shearing image transformation to the graph
14.12. Rotating graphs
14.12.1. Free rotation of the plot area
14.12.2. Rotating the plot area 90 degree
14.13. Using anti-aliasing in the graph generation
14.13.1. Anti-aliasing for line drawing graphs
14.13.2. Anti-aliasing in pie graphs
14.13.3. Anti-aliasing in Windrose plots
14.13.4. Anti-aliasing for Contour plots
14.14. Adding icons (and small images) to the graph
14.15. Adding images and country flags to the background of the graph
14.15.1. Using country flags as backgrounds
14.16. Using background gradients
14.16.1. Generating gradient background off-line
14.17. Adding arbitrary texts to the graph
+ +

The definition of linear graphs

+ +

With cartesian graphs we refer to all plots which have orthogonal x and y axis. + The library support the option of multiple y-scales (when applicable) but only on + x-axis can be used.

+

The following principle linear graph types are supported as of v2.5 (note that + some graph types may have additional subtypes that are not shown in this + overview.)

+

+

Figure 14.1. Supported principle linear graph types in the library

+ +
+
+

Supported principle linear graph types in the library

+

a) Line plot

+

(See Creating a line graph)

+
+

Supported principle linear graph types in the library

+

b) Area plot

+

(See Creating a filled line graphs (a.k.a. area plots))

+
+

Supported principle linear graph types in the library

+

c) Bar plot

+

(See Bar graphs)

+
+

Supported principle linear graph types in the library

+

a) Field plot

+

(See Field plots)

+
+

Supported principle linear graph types in the library

+

b) Error plot

+

(See Error plot graphs)

+
+

Supported principle linear graph types in the library

+

c) Stock plot

+

(See Stock graphs)

+
+

Supported principle linear graph types in the library

+

a) Geo-map plot

+

(See Creating Geo-maps)

+
+

Supported principle linear graph types in the library

+

b) Impuls (stem) plot

+

(See Scatter graphs)

+
+

Supported principle linear graph types in the library

+

c) Spline plot

+

(See Constructing smooth line plots with Cubic Splines)

+
+

Supported principle linear graph types in the library

+

a) Balloon plot

+

(See Balloon plots)

+
+

Supported principle linear graph types in the library

+

b) Scatter plot

+

(See Scatter graphs)

+
+

Supported principle linear graph types in the library

+

c) Contour plot

+

(See Contour graphs )

+
+
+


+

+

Each of these graph types have there own section where more details can be found + by following the link under the corresponding graph icon.

+

Axis and coordinate systems

+ +

The x and y axis each in a graph has an associated scale, labels, titles, grid + lines, colors and position. The axis properties are accessed as objects of the + axis instance variables in the main graph class. The axis can be access vi the + following instance variables.

+

+

  • +

    Graph::xaxis, The x-axis, (by default on the + bottom)

    +
  • +

    Graph::yaxis, The y-axis, (by default on the left + side)

    +
  • +

    Graph::y2axis, The second y-axis (by default on the + right side)

    +

+

+

In addition the library also supports the use of multiple y-axis and they are + accessed via an instance array

+

+

  • +

    Graph::ynaxis[]

    +

+

+

All axis in turn are instances of class Axis and hence share + common properties. The only two property that can be publicly accessed on the + axis are

+

+

  • +

    Axis::scale. The scale of the axis. An instance of + either LinearScale, LogScale or + DateScale. This rarely needs to be accessed + directly.

    +
  • +

    Axis::title. The axis title. On the x-axis this is + horizontal by default and on the y-axis the title is vertical by + default

    +

+

+

On the other hand there are a large amount of methods that can be used on the + axis to adjust various properties. Some examples of commonly used methods are + given below. The full description of each method is given in the API + reference.

+

+

  • +

    Adjusting the labels

    +

    +

    • +

      Axis::SetLabelFormatString($aFormStr,$aDateFormat=false). + Specifies the labels format string assuming + printf() format if $aDate + is false and in date() format if + $aDate is true.

      +
    • +

      Axis::SetLabelFormatCallback($aCallbackFunc)

      +
    • +

      Axis::SetLabelAlign($aHorAlign, $aVertAlign='top',$aParagraphAlign='left')

      +
    • +

      Axis::HideLabels($aHide=true)

      +
    • +

      Axis::SetTicklabels($aLabels, $aLabelColors=null)

      +
    • +

      Axis::SetLabelMargin($aMargin)

      +
    • +

      Axis::SetLabelSide($aSide)

      +
    • +

      Axis::SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10)

      +
    • +

      Axis::SetLabelAngle($aAngle). Species the + angle of the label. Note: It is only possible to use + arbitrary angles if the font is a true type font. The + built in bit map fonts only supports 0 and 90 degree + text strings.

      +

    +

    +
  • +

    Adjusting the tick marks

    +

    +

    • +

      Axis::SetTickSide($aSide)

      +
    • +

      Axis::SetTickPositions($aMajPos,$aMinPos=NULL,$aLabels=NULL)

      +
    • +

      Axis::HideTicks($aHide)

      +

    +

    +
  • +

    Adjusting the actual axis

    +

    +

    • +

      Axis::HideLine($aHide=true), ONly hide + the axis but whos the labels

      +
    • +

      Axis::Hide($aHide), Hide both axis and + labels

      +
    • +

      Axis::SetWeight($aWeight), Set the weight + in pixels of the axis

      +
    • +

      Axis::SetPos($aPositionOnOtherScale) + Specifies the position of the axis on the other scale. + The position is given the scale of the other axis. There + are two special values (strings) that can be given and + those are

      +

      +

      • +

        'min' - Will position the axis + at the minimum value of the other scale

        +
      • +

        'max' - Will position the axis + at the maximum value of the other scale

        +

      +

      +

    +

    +
  • +

    Adjusting the title

    +

    +

    • +

      Axis::SetTitle($aTxt)

      +
    • +

      Axis::SetTitleMargin($aMargin)

      +
    • +

      Axis::SetTitleSide($aSide)

      +
    • +

      Axis::SetColor($aColor,$aLabelColor)

      +

    +

    +

+

+

The above methods are valid for all possible axis. So for example the + following line sets the font for the labels on the x-axis

+

+

1
+
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,12);

+

+

and the follwing code set the font for the y-axis

+

+

1
+
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,12);

+

+
+

Adjusting the axis look and feel

+ +

The two major ways to adjust the look and feel of the axis are adjustments of + the color and the weight (i.e. width) and this can be done with the appropriate + methods as described above.

+

+

  • +

    Axis::SetColor($aColor,$aLabelColor), For example + $graph->xaxis->SetColor('teal'). Please note that + by default the color for the labels will be that of the line if the + label color is not explicitly specified.

    +
  • +

    Axis::SetWeight($aWeight). Specify the weight (in + pixels of the axis)

    +

+

+
+

Adding grid lines in the plot

+ +

+

Note

+

The possibility of a having different styles, colors and weight for + minor and major grid lines was added in 3.0.4 and is not available in + earlier releases.

+

+

+

Grid lines will make it easier to see where the data points are in the graph. + The grid lines are access by the properties "xgrid" and + "ygrid"of the Graph class. By default only the y-axis grid are + enabled by default. The following code example enables the major grids for both + the x- and y-axis.

+

+

1
+2
+
$graph_>xgrid->Show();
+$graph->ygrid->Show();

+

+

The grid lines are instances of Class Grid. and supports the + following methods

+

+

  • +

    Grid::SetColor($aMajColor,$aMinColor=false). Specify + the color for the major an minor grid lines

    +
  • +

    Grid::SetWeight($aMajorWeight,$aMinorWeight=1). + Specify the weight of the line for the major and minor grid + line

    +
  • +

    Grid::Show($aMajGid=true,$aMinGrid=false). Determine + which grid lines should be shown

    +
  • +

    Grid::SetLineStyle($aMajorType,$aMinorType) This + method makes it possible to adjust the line style of the grid lines + (both major and minor separately). The line style is specified as a + string and can have one of the following values

    +

    +

    • +

      "solid"

      +
    • +

      "dotted"

      +
    • +

      "dashed"

      +
    • +

      "longdashed"

      +

    +

    +
  • +

    Grid::SetFill($aFlg=true,$aColor1='lightgray',$aColor2='lightblue')

    +

+

+

The last method needs an explanation. The fill refers to the possibility to + fill the space between the grid lines with alternating colors as specified in + the method call. Figure 14.2. Using alternating fill colors in the grid (filledgridex1.php) shows an example on how + this can be used to make it easier to read a plot.

+

+

Figure 14.2. Using alternating fill colors in the grid (filledgridex1.php)

Using alternating fill colors in the grid (filledgridex1.php)


+

+

In the above example we have also used the possibility of using alpha-blending + (for example on the shadow on the legend box).

+

The example below shows how to use different styles for the major and minor + grid lines

+

+

Figure 14.3. Using different grid styles for major and minor grids (gridstylesex1.php)

Using different grid styles for major and minor grids (gridstylesex1.php)


+

+
+

Predefined scientific axis setups

+ +

In order to make it easier to setup a couple of typical axis configuration + used in science plots there are four predefined configurations as shown in Figure 14.4. Predefined scientific axis positions .

+

+

Figure 14.4. Predefined scientific axis positions

+ +
+
+
Predefined scientific axis positions
+
+
Predefined scientific axis positions
+
+
Predefined scientific axis positions
+
+
Predefined scientific axis positions
+
AXSTYLE_BOXOUTAXSTYLE_BOXINAXSTYLE_YBOXINAXSTYLE_YBOXOUT
+
+


+

+

The styles can easily be setup with a call to the method

+

+

  • +

    Graph::SetAxisStyle($aStyle)

    +

+

+

An example of using this setup of the axis is shown in Figure 14.5. Example of AXSTYLE_BOXIN axis style (funcex2.php)

+

+

Figure 14.5. Example of AXSTYLE_BOXIN axis style (funcex2.php)

Example of AXSTYLE_BOXIN axis style (funcex2.php)


+

+
+

Other possible ways to position the axis

+ +

The axis can be manually positioned with a call to

+

Axis::SetPos($aPos)

+

The argument $aPos is normally the coordinate position on the + "other" axis where the crossing of this and the other axis should be. There are + also two special positions which are given as strings. They are + 'min' and 'max'. Not surprisingly these special + positions will always refer to the min and max scale value of the other + axis.

+

The position given is the scale position on the "other"axis, i.e. for the + x-axis the position specifies the crossing of the y-axis and vice versa.

+

Since it is possible to manually specify all aspects of the axis the table + below shows some typical common setups and the principle calls needed to achieve + the illustrated affect.

+

+

Table 14.1. Axis configurations

+ +
+

+
+

This is the default setup and not extra configurations + are needed and it is the same as

+

+

1
+
$graph->SetAxisStyle(AXSTYLE_SIMPLE);

+

+
+

+
+

This setup is configured by moving the x-axis to the + top

+

+

1
+2
+3
+
$graph->xaxis->SetPos('max');
+$graph->xaxis->SetLabelSide(SIDE_UP);
+$graph->xaxis->SetTickSide(SIDE_DOWN);

+

+
+

+
+

This is the standard style but with an added box + around the plot area.

+

+

1
+2
+
$graph->SetAxisStyle(AXSTYLE_SIMPLE);
+$graph->SetBox();

+

+
+

+
+

+

1
+2
+3
+4
+
$graph->xaxis->SetPos('max');
+$graph->xaxis->SetLabelSide(SIDE_UP);
+$graph->xaxis->SetTickSide(SIDE_DOWN);
+$graph->SetBox();

+

+
+

+
+

This configuration locks the x- and y-axis at the + origin

+

+

1
+2
+
$graph->xaxis->SetPos(0);
+$graph->yaxis->SetPos(0);

+

+
+

+
+

With an added box around the plot area

+

+

1
+2
+3
+
$graph->xaxis->SetPos(0);
+$graph->yaxis->SetPos(0);
+$graph->SetBox();

+

+
+


+

+
+
+ + + + + + + + + + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s02.html b/includes/jpgraph/docs/chunkhtml/ch14s02.html new file mode 100644 index 0000000..a63a5c0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s02.html @@ -0,0 +1,526 @@ +Specifying and formatting the overall displayed graph

Specifying and formatting the overall displayed graph

+ +

The overall look and feel of the graph can be adjusted in a number of ways.

+

+

  • +

    color of the plot area

    +
  • +

    color of the margin

    +
  • +

    size of the margin (and hence the position of the plot area)

    +
  • +

    title(s) of the graph, a graph can have both a "title", "subtitle" and + a "subsubtitle"

    +
  • +

    drop shadow around the graph

    +
  • +

    adding how long time it took to generate the graph

    +

+

+

Adjusting size, margins and frame

+ +

The overall size of the graph is specified in the initial creation of the + "$graph" instance. This is mandatory.

+

+

1
+
$graph = new Graph($width,$height);

+

+

The margin determines the space between the edges of the plotarea and edge of + the graph. Please note that the edge does not include the frame around the + entire graph area, i.e. whatever weight the frame edge has it doesn't impact on + the margin area. The margin is specified in the order left,right,top and bottom + margin and the size is specified in pixels.

+

+

1
+
$graph->SetMargin(30,10,40,20);

+

+

The default margin will be as narrow as possible but still have enough space + to show the titles and labels. The final adjustments is wheter or not the graph + will have a frame or not. There are two distinctions to be made here. No frame + meaning that the margin area will not be colored (i.e. painted) and no frame as + in no edge around the graph area. The first case is achieved by calling the + SetFrame() method on the Graph class

+

+

1
+
$graph->SetFrame(false);

+

+

and the second case is achieved by setting the frame edge to have weight zero. + Since the weight is given as the third argument we wtill have to put in valid + "dummy" argument for the on/off flag and the frame color parameter.

+

+

1
+
$graph->SetFrame(true,'black',0);

+

+

Refer to Figure 12.1. Commonly used objects in a graph (common-obj-graph.php) for definitoin of plot aea + and margin.

+
+

Adding drop shadow to the graph

+ +

A graph can have a drop shadow specified with the method + SetShadow() which has the signature

+

+

1
+
SetShadow($aShowShadow=true,$aShadowWidth=5,$aShadowColor=array(102,102,102))

+

+

by default there will be no dropshadow. Note that the drop shadow is a + straight simple shadow and has no Gaussian blur.

+
+

Formatting and specifying the titles of the graph

+ +

There are three possible standard titles in the graph

+

+

  1. +

    $graph->title

    +
  2. +

    $graph->subtitle

    +
  3. +

    $graph->subsubtitle

    +

+

+

Each title is an instance of the Text class which means it supports the + standard text adjusting methods SetFont(), Set(), + SetColor() etc. The title s will be centered on the top of the + graph area with the title highest up, subtitle below and finally the subsubtitle + below that as shown in Figure 14.6. The various titles in a graph (titleex1.php)

+

+

Figure 14.6. The various titles in a graph (titleex1.php)

The various titles in a graph (titleex1.php)


+

+

In addition to the above standard titles there is also another type of graph + titles called the "Tabular title". This is a title that sits directly on the + plot area looking like a "tab" in a sorting cabinet. Figure 14.7. Tabtitle and gradient background (gradbkgex1.php) and Figure 14.8. Tabtitle and image marker in a line plot (imgmarkerex1.php) + shows examples of this.

+

+

+
+

Figure 14.7. Tabtitle and gradient background (gradbkgex1.php)

Tabtitle and gradient background (gradbkgex1.php)

+
+

Figure 14.8. Tabtitle and image marker in a line plot (imgmarkerex1.php)

Tabtitle and image marker in a line plot (imgmarkerex1.php)

+
+

+

+

These type of titles are created by using the

+

+

1
+
$graph->tabtitle

+

+

property in the Graph class. For example the tabtitle in Figure 7.2. Making use of transparency to combine two plots (barlinealphaex1.php) was generated by adding the lines

+

+

1
+2
+
$graph->tabtitle->Set('Year 2003');
+$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10);

+

+

Adding special background to the title

+ +

There is one more way to make the graph title stand out that. This feature + is probably one of the least known ways to adjust the graph title and is + used to put a lot of emphasis on the title by having a separate color (and + style) for the background of the graph title.

+

+

Note

+

This feature was added by the request of one of our users who had + a company design policy that demanded these type sof formatting + options for graphs.

+

+

+

The two methods used to control this style are

+

+

  • +

    Graph::SetTitleBackground($aBackColor='gray', + $aStyle=TITLEBKG_STYLE1, $aFrameStyle=TITLEBKG_FRAME_NONE, + $aFrameColor='black', $aFrameWeight=1, $aBevelHeight=3, + $aEnable=true)

    +

    This method is the basic method to specify a solid color + background with the defined style and type of framing. The first + style paramatere specifies the extension of the background and + how it interacts with the frame around the image.

    +

    +

    • +

      TITLEBKG_STYLE1, The title frame will + be drawn inside the overall graph frame

      +
    • +

      TITLEBKG_STYLE2, The title frame will + extend all the way to the edge of the graph and + overwrite any graph frame

      +
    • +

      TITLEBKG_STYLE3, This is the same as + TITLEBKG_STYLE2 apart from when it is used together + with framestyle TITLEBKG_FRAME_BEVEL then the bevel + frame border is on top of the title frame + border

      +

    +

    +
  • +

    Graph::SetTitleBackgroundFillStyle($aStyle,$aColor1='black',$aColor2='white')

    +

    The method determines adjusts the way the background of the + title is filled by allowing a simple pattern filling to be set. + This pattern filling is either horizontal or vertical stripes + (lines) with user selectable colors. The possible patterns + are

    +

    +

    • +

      TITLEBKG_FILLSTYLE_HSTRIPED, The + background will have horizontal stripes with + $aColor1 on a background with + $aColor2

      +
    • +

      TITLEBKG_FILLSTYLE_HSTRIPED, The + background will have vertical stripes with + $aColor1 on a background with + $aColor2

      +
    • +

      TITLEBKG_FILLSTYLE_SOLID, The + background will only have one color specified as + $aColor1

      +

    +

    +

+

+

To better show the effect of the possible combinations the table below + shows a matrix of the possible combinations and the resulting styles. To + keep the table small only the relevant top are of the graph with the title + is shown.In addition to keep the style simple we have only used shades of + gray.

+

+

+
Frame/Fill + style +

TITLEBKG_FILLSTYLE_HSTRIPED

+
+

TITLEBKG_FILLSTYLE_VSTRIPED

+
+

TITLEBKG_FILLSTYLE_SOLID

+
+

TITLEBKG_STYLE1,

+

TITLEBKG_FRAME_NONE

+
+

+
+

+
+

+
+

TITLEBKG_STYLE2,

+

TITLEBKG_FRAME_NONE

+
+

+
+

+
+

+
+

TITLEBKG_STYLE3,

+

TITLEBKG_FRAME_NONE

+
+

+
+

+
+

+
+

TITLEBKG_STYLE1,

+

TITLEBKG_FRAME_FULL

+
+

+
+

+
+

+
+

TITLEBKG_STYLE2,

+

TITLEBKG_FRAME_FULL

+
+

+
+

+
+

+
+

TITLEBKG_STYLE3,

+

TITLEBKG_FRAME_FULL

+
+

+
+

+
+

+
+

TITLEBKG_STYLE1,

+

TITLEBKG_FRAME_BOTTOM

+
+

+
+

+
+

+
+

TITLEBKG_STYLE2,

+

TITLEBKG_FRAME_BOTTOM

+
+

+
+

+
+

+
+

TITLEBKG_STYLE3,

+

TITLEBKG_FRAME_BOTTOM

+
+

+
+

+
+

+
+

TITLEBKG_STYLE1,

+

TITLEBKG_FRAME_BEVEL

+
+

+
+

+
+

+
+

TITLEBKG_STYLE2,

+

TITLEBKG_FRAME_BEVEL

+
+

+
+

+
+

+
+

TITLEBKG_STYLE3,

+

TITLEBKG_FRAME_BEVEL

+
+

+
+

+
+

+
+

+

+

Note

+

There is a change in the behaviour of the latest GD library that + causes style 2 and style 3 in JpGraph 2.x to be more or less visually + identical as can be seen above. Using 1.x will more clearly show the + difference. The reason is that with JpGraph 2.x we rely more heavily on + the GD built in functions while in 1.x many of the functions where + instead implemented in the library (since they weren't earlier available + in GD 1.x). The change in JpGraph 2.x was made to increase the + performance, unfortunately some minor differences exist in the way GD + 2.x handles border line cases as how to handle pixel-by-pixel accuracy + (or convention). Over time these changes will become less and less as + parts of the library will be adjusted to the new GD 2.x + behaviour.

+

A typical example of changed behaviour is how rectangles with + thickness > 1 are positioned. The library assumes that the top left + (0,0) corner is the very top left part of the rectangle. This is not so + with GD 2.x. Instead (0,0) is the center point on the line. If the line + has thickness=1 they are identical but not if the line has a thickness > + 1

+
+
+
+

Specifying the image format to use

+ +

As described in Necessary system requirements for the library the actual image compression + available depends on the system setup. Assuming the needed sewtup is done then + the image format can be specified by using the method + Graph::SetImgFormat() and specifying the wanted format as a + string. For example as

+

+

1
+
$graph->SetImgFormat('jpg',80);

+

+

The method call above selects JPEG image compression algorithm and tells the + algorithm to set the quality parameter to 80%. This additional parameter is only + applicable together with JPG formatting.

+
+

Generic line formatting

+ +

Any lines in the library can have a number of formatting option. Attributes + that can be adjusted are

+

+

  • +

    Lineweight (thickness). The weight is specified in pixels and can + be any integer values

    +
  • +

    Linestyle , (dashed, dotted, solid etc). The style is specified as + a string using the line method SetLineStyle().

    +

    The available line styles are

    +

    +

    • +

      'solid', A solid line

      +
    • +

      'dotted', A line with dots

      +
    • +

      'dashed', A line with short hyphens

      +
    • +

      'longdashed', A line with long hyphens

      +

    +

    +

    For example to following method call set the y-grid to use the + "dotted" style

    +

    +

    1
    +
    $graph->ygrid->SetLineStyle('dotted');

    +

    +

    The image in Figure 14.9. Different line formatting shows + example of different line formatting styles

    +

    +

    Figure 14.9. Different line formatting

    + +
    +
    +

    Different line formatting

    +

    Standard

    +
    +

    Different line formatting

    +

    Anti-aliased

    +
    +

    Different line formatting

    +

    Thick (3 pixels)

    +
    +

    Different line formatting

    +

    Dashed

    +
    +

    Different line formatting

    +

    Long-dash

    +
    +

    Different line formatting

    +

    Dotted

    +
    +
    +


    +

    +
  • +

    Color. The line color is (as usual) adjusted with the method + SetColor().

    +

    For example the following line sets the color of the x-grid to + lightblue.

    +

    +

    1
    +
    $graph->xgrid->SetColor('lightblue');

    +

    +

+

+

Note

+

If anti-aliasing is enabled (see ??.) then all line weights will always be + interpreted as having weight 1 regardless.

+
+

+

Tip

+

To avoid drawing a line set the line weight to 0

+

+

+
+

Adding a footer to the graph

+ +

It is possible to add a footer to the graph as well. The footer can have a + left, center and right part. The footer is accessed trough the footer property + of the Graph class and its three parts "left", "right" and "center". These parts + are instances of the Text class and hence all normal text + formatting c an be applied to each part of the footer. The following code + snippet shows how the footer parts can be set.

+

+

1
+2
+3
+
$graph->footer->left->Set('Left footer');
+                        $graph->footer->center->Set('Center footer');
+                        $graph->footer->right->Set('Right footer');

+

+

An example of using a footer is shown in Figure 14.11. Adding a left,right and center footer (footerex1.php)

+

+

Figure 14.10. Using a footer in a graph

+ +

Figure 14.11. Adding a left,right and center footer (footerex1.php)

Using a footer in a graph

+


+

+
+

Adding timing of graphs

+ +

The footer in the bottom of the graph can also be used to show an + approximative timing of the graph generation. This is done with the help of + class JpgTimer. This timer class offers two methods

+

+

  1. +

    JpgTimer::Push(), Starts a new timer and puts it at + the top of the timer stack

    +
  2. +

    JpgTimer::Pop(), Pops the timer at the top of the + stack and returns the time (in ms) since the timer was pushed

    +

+

+

(The stack based design makes it possible to have multiple timers running at + the same time without interfering each other.)

+

The footer class (Adding a footer to the graph) have a special + provision to handle an instance of the timer class

+

+

  • +

    Footer::SetTimer($aTimer,$aSuffix='')

    +

    $aTimer, an instance of JpgTimer

    +

    $aSuffix, an optional suffix string that will be + added at the end of the timing value

    +

+

+

At the end of the graph generation the specified timer will be sent the sign + pop and the resulting timer value will be stored in the right footer of the + graph (appended to any previous value in the footer). For example the following + simple lines would time the graph generation.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php
+// Create a new timer instance
+$timer = new JpgTimer();
+ 
+// Start the timer
+$timer->Push();
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(300,200);
+$graph->SetScale("textlin");
+ 
+// Make the bottom margin large enough to hold the timer value
+$graph->SetMargin(40,20,20,60);
+ 
+$graph->title->Set("Timing a graph");
+$graph->footer->right->Set('Timer (ms): ');
+$graph->footer->right->SetFont(FF_COURIER,FS_ITALIC);
+$graph->footer->SetTimer($timer);
+ 
+// The rest of the script as normal ..

+

+

+

Note

+

Remember to make the bottom margin large enough.

+

+

+

Figure 14.12. Adding a timer to the graph (in the footer) (example11.php) shows an example of using a timer to add + the time (in ms) it took to generate the graph

+

+

Figure 14.12. Adding a timer to the graph (in the footer) (example11.php)

Adding a timer to the graph (in the footer) (example11.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s03.html b/includes/jpgraph/docs/chunkhtml/ch14s03.html new file mode 100644 index 0000000..10a945a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s03.html @@ -0,0 +1,78 @@ +Adjusting the look and feel of the plot area

Adjusting the look and feel of the plot area

+ +

The graph area can be divided in two parts.

+

+

  1. +

    The margin area

    +
  2. +

    The plot area

    +

+

+

These areas can have individual background colors as well as edges of user + settable size and color. In addition it is possible to use an image as background + with different formatting options.

+

Plot area and margin areas

+ +

The plot area is where the plot is drawn and the margin area is everything + outside. Methods that affect the format of the plot area are

+

+

  1. +

    Graph::SetMargin() , This will adjust the size (and + position) of the plot area

    +
  2. +

    Graph::SetBox($aDrawPlotFrame=true,$aPlotFrameColor=array(0,0,0),$aPlotFrameWeight=1), + This will adjust tyhe format of the edge around the plot area. By + default this is disabled.

    +

+

+

In a similar way the margin areas peroperties can be adjusted with the + methods

+

+

  1. +

    Graph::SetMargin() , same as above

    +
  2. +

    Graph::SetMarginColor($aColor)

    +
  3. +

    Graph::SetFram($aDrawImgFrame=true,$aImgFrameColor=array(0,0,0),$aImgFrameWeight=1)

    +
  4. +

    Graph::SetFrameBevel($aDepth=3,$aBorder=false,$aBorderColor='black',$aColor1='white@0.4',$aColor2='darkgray@0.4',$aFlg=true)

    +

+

+
+

Clipping to the plot area

+ +

When auto scaling is used no data points will ever be outside the plot area + since the scaling will make sure it covers the dynamic range of the data. + However, when setting the scale manually there is always the risk that some data + points are outside the specified scale. This could then lead to the result shown + in Figure 14.13. Original plot without clipping (clipping_ex1.php) To avoid this situation it is possible + to enable clipping to the plot region by calling the method

+

+

  • +

    Graph::SetClipping($aFlg)

    +

+

+

This will "cut away" all parts of the plot that would otherwise be stroked + outside the plot area.Figure 14.14. Plot with clipping enabled (clipping_ex2.php) shows the result + after clipping has been enabled.

+

+

+
+

+

Figure 14.13. Original plot without clipping (clipping_ex1.php)

Original plot without clipping (clipping_ex1.php)


+

+
+

+

Figure 14.14. Plot with clipping enabled (clipping_ex2.php)

Plot with clipping enabled (clipping_ex2.php)


+

+
+

+

+

+

Note

+

By default clipping is disabled since it will slightly increase the + CPU load and the time to generate the graphs.

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s04.html b/includes/jpgraph/docs/chunkhtml/ch14s04.html new file mode 100644 index 0000000..27af6db --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s04.html @@ -0,0 +1,110 @@ +Adjusting the position and layout of the legend

Adjusting the position and layout of the legend

+ +

While it is not strictly necessary to use a legend in the graph ti describe the + various data series potted it is usually a good idea. With the library there are + three basic types of formatting you can do with the legend.

+

+

  1. +

    Adjusting basic parameters such as color and width of the edges + (frame) around the plot box as well as adding/removing a drop shadow on + the legend box.

    +
  2. +

    Adjusting the position of the legend in the graph

    +
  3. +

    Adjusting the number of columns that should be used for the internal + layout in the legend box. As default the legend uses one column.

    +

+

+

In Figure 14.15. Some example of ways to position the legend box in the graph we have shown some ides on + how the legend can be positioned in the graph to give some ideas on the options + available.

+

+

Figure 14.15. Some example of ways to position the legend box in the graph

+ +
+
Some example of ways to position the legend box in the graphSome example of ways to position the legend box in the graphSome example of ways to position the legend box in the graph
Some example of ways to position the legend box in the graphSome example of ways to position the legend box in the graphSome example of ways to position the legend box in the graph
Some example of ways to position the legend box in the graphSome example of ways to position the legend box in the graphSome example of ways to position the legend box in the graph
Some example of ways to position the legend box in the graphSome example of ways to position the legend box in the graphSome example of ways to position the legend box in the graph
Some example of ways to position the legend box in the graphSome example of ways to position the legend box in the graph +
+
+


+

+

The way the legend is positioned is by calling one of the two methods

+
  • +

    Legend::SetPos($aX,$aY,$aHAlign='right',$aVAlign='top')

    +
  • +

    Legend::SetAbsPos($aX,$aY,$aHAlign='right',$aVAlign='top')

    +

The first method specifies the position in fraction of the width and + height and the second method specifies the position in absolute pixels where (0,0) + is the top left corner. The anchor point for the legend box, i.e. the point in the + legend box that should be aligned with the specified positoin, is given with the + following two parameters. The line below gives an example of specifying the legend + position

+

+

1
+
$graph->legend->SetPos(0.5,0.98,'center','bottom');

+

+

The line above will position the legend centered horizontally and the bottom of + the legend just above the the bottom edge of the graph.

+

+

Tip

+

The legend box can also have a drop shadow. By specifying the color to be + alpha-blended it is possible create a very nice drop shadow affect onto the + graph. See Figure 14.2. Using alternating fill colors in the grid (filledgridex1.php) or Figure 14.16. Some example of different legend layouts for some examples on how this + looks.

+

+

+

+

Tip

+

By default the ordering of the texts in te legend will be the same as the + order the plots are added to the graph. It is also possible to reverse this + order in the legend with a call to the method + Legend::Revers()

+

+

+

The layout of the legend box can also be adjusted by specifying how many columns + the legends should use. By default one column is used which means that all legend + texts will be on top of each other. The number of columns to be used in the legend + is specified with a call to the method

+

+

  • +

    Legend::SetColumns($aNbr)

    +

+

+

Figure 14.16. Some example of different legend layouts shows four examples how setting different + values for the number of columns will change the layout of the legend.

+

Figure 14.16. Some example of different legend layouts

+ +
Some example of different legend layouts
+

+

As two special cases the one column layout (a.k.a. vertical layout) which is the + default, and the "unlimited number of columns" a.k.a. horizontal layout can also be + specified with the method

+

+

  • +

    Legend::SetLayout($aLayout)

    +

    $aLayout is either LEGEND_VERT or + LEGEND_HOR

    +

+

+

+

Caution

+

Either SetLayout() or SetColumns() should be + used but not both since the method last called will be the one that is + used.

+

+

+

+

Tip

+

The vertical margin between two legend texts can be adjusted with a call + to the method

+

+

  • +

    Legend::SetVColMargin($aSpacing)

    +

+

+

by default the margin is quite small. Note. Since the bounding box for TTF fonts and bitmapped + texts are slightly different the distance between legend texts when using a + bitmap font (the default) will be visually larger than for TTF fonts. The + default value is optimized for TTF fonts.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s05.html b/includes/jpgraph/docs/chunkhtml/ch14s05.html new file mode 100644 index 0000000..8efb515 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s05.html @@ -0,0 +1,81 @@ +Other formatting options of the axis

Other formatting options of the axis

+ +

Adjusting and positioning titles on the axis

+ +

Each title of the graph can have a title of there own. By default the x-axis + has the title on the right and the y-axis have the title in vertical at the top + of the graph. The title of the axis is accessed by the title property of the + axis for the x- and y-axis as in

+

Graph::xaxis::title

+

Graph::yaxis::title

+

As a continence the following there methods are provided

+

+

  • +

    Axis::SetTitle($aTitle,$aAdjustAlign)

    +

    This method sets the title text string and the alignnemt of the + title. For the x-axis the alignment is pecified as one of the + folliwng three strings

    +

    +

    • +

      "left"

      +
    • +

      "center"

      +
    • +

      "right"

      +

    +

    +

    For an y-axis the alignment is set with one of the following three + strings

    +

    +

    • +

      "bottom"

      +
    • +

      "middle"

      +
    • +

      "top"

      +

    +

    +
  • +

    Axis::SetTitleMargin($aMargin)

    +

    The margin is specifies as the number of pixels distance from the + axis to the title

    +
  • +

    Axis::SetTitleSide($aSideOfAxis)

    +

    The side specifies for a horizontal axis (x-axis) if the title + should be above or below the axis and for a vertical axis (y-axis) + if the title should be on the left or the right of the axis.

    +

    Y-axis defines:

    +

    +

    1. +

      SIDE_LEFT

      +
    2. +

      SIDE_RIGHT

      +

    +

    +

    X-axis defines

    +

    +

    1. +

      SIDE_TOP

      +
    2. +

      SIDE_BOTTOM

      +

    +

    +

+

+
+

Adjusting the font and color of the title

+ +

Since the title property can be easily accessed all usual Text class property + can be used. This includes the color property. To set the font and color of the + title for the x-axis the following methods are used

+

+

  • +

    Graph::xaxis::title::SetFont()

    +
  • +

    Graph::xaxis::title::SetColor()

    +

+

+

For the y- and y2-axis the fonts and colors are set completely + analogues.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s06.html b/includes/jpgraph/docs/chunkhtml/ch14s06.html new file mode 100644 index 0000000..23aa889 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s06.html @@ -0,0 +1,120 @@ +Using multiple y-axis

Using multiple y-axis

+ +

With this feature an arbitrary number of Y-axis can be added to the right side of + the graph. The library itself doesn't impose any restrictions on the number of extra + Y-axis but from a practical concern it is most likely very difficult to interpret a + graph with more than 2-3 extra y-axis.

+

If there is only need for one more Y axis then the concept of the additional Y2 + axis is available as a convenient shortcut for this the most common use of an extra + y-axis. The Y2 axis is also a first class citizen in the library meaning it has all + the properties available to the "normal" Y-axis.

+

These extra axis inherits most of the properties of the normal Y-axis (but not + all) and the few restrictions imposed are described in Restrictions with multiple y-axis below.

+

Figure 14.17. Basic example of multiple y-axis (mulyaxisex1.php) shows a basic example of how to use this + feature. The color encoding maps a specific line to the corresponding axis.

+

+

Figure 14.17. Basic example of multiple y-axis (mulyaxisex1.php)

Basic example of multiple y-axis (mulyaxisex1.php)


+

+

Adding additional y-axis

+ +

Adding additional Y-axis is very similar to the way standard Y axis work. The + Y-axis are numbered [0..n] where the 0:th axis is the Y-axis furthest to the + left. At the same time as these additional Y-axis are used it is also possible + to add a Y2 axis. The difference being that the Y2 axis can have all the same + options as the Y axis.

+

For basic usage only three new methods are needed

+

+

  1. +

    Graph::SetYScale($aNbr,$aScaleType,$aMin,$aMax) +

    +

    Specifies the type of scale ('lin', 'int' or 'log') to use for the + axis number '$aNbr' +

    +
  2. +

    Graph::AddY($aNbr,$aPlot)

    +

    Add a plot to axis number '$aNbr'

    +
  3. +

    Graph::SetYDeltaDist($aDistance)

    +

    This is an optional method that if used specifies the default + number of pixels between each additional Y-axis. This value will be + used unless a specific position for the N:th axis has been + specified. By default the additional Y-axis are separated with 50 + pixels (which is what is used in Figure 14.17. Basic example of multiple y-axis (mulyaxisex1.php) +

    +

+

+

In order to initialize the extra y-axis the method SetYScale() must be called. + In Figure 14.17. Basic example of multiple y-axis (mulyaxisex1.php) the following lines are used

+

+

1
+2
+3
+
$graph->SetYScale(0,'lin');
+$graph->SetYScale(1,'lin');
+$graph->SetYScale(2,'lin');

+

+

Once setup these additional Y-axis are accessed through the array

+

Graph::ynaxis[]

+

The axis are numbered from 0. By accessing the axis through this array most of + the same method as for the usual Y and Y2 axis are available. For example, the + line below will set the color of axis number 1

+

+

1
+
$graph->ynaxis[1]->SetColor('red');

+

+

Finally the plots are added to a specific axis with a call to the method + AddY() (as opposed to the regular Add() or + AddY2() methods). The first argument must be an ordinal that + specified the number of the axis that the plot should be added to.

+
+

Using CSIM together with multiple y-axis

+ +

Client Side Image Maps is fully supported and is used in the same way as CSIM + for the basic Y-axis. A short example will clarify this. The following code + snippet shows a line plot where we have added some oversized markers (in the + shape of diamonds) that will act as the image map areas for each data + series

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+...
+$lp2 = new LinePlot($datay2);
+$lp2->mark->SetType(MARK_DIAMOND);
+$lp2->mark->SetWidth(15);
+$lp2->SetCSIMTargets($targ2,$alts2);
+$graph->AddY(0,$lp2);
+...
+?>

+

+

As usual the targets for the image maps are specified with a call to + Plot::SetCSIMTargets(). An example of CSIM with multiple y-axis + is included in the Example directory and the resulting image is reproduced in + Figure 14.18. Illustration of mulyaxiscsimex1.php (but just as an image not as + a CSIM image)

+

+

Figure 14.18. Illustration of mulyaxiscsimex1.php

+ +
Illustration of mulyaxiscsimex1.php
+


+

+
+

Restrictions with multiple y-axis

+ +

+

  • +

    Only standard plots can be added to the extra Y-axis, this means + no Text objects, no PlotBand, no PlotLines, no Icons etc

    +
  • +

    No Grid lines can not be added to the extra Y-axis

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s07.html b/includes/jpgraph/docs/chunkhtml/ch14s07.html new file mode 100644 index 0000000..fae4c6c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s07.html @@ -0,0 +1,363 @@ +Understanding and using different scales on the axis

Understanding and using different scales on the axis

+ +

Different scale types

+ +

The scale of the graph axis are controlled by either

+

+

  • +

    Graph::SetScale() which can take on of the following + strings as argument

    +

    "intint", "intlin", "intlog", "linint", "linlin", "linlog", + "logint", "loglin", "loglog", "textint", "textlin", "textlog", + "datint","datlin","datlog"

    +

    The first half of the string argument specifies the x-axis scale + and the second half of the string specifies the y-axis scale. When + an y2 or multiple y-scales (see ??

    +

+

+

Numerical scale types

+ +

The scale for a basic graph is specified with a call to + Graph::SetScale() and supplying the wanted scales for the + x- and y-axis. For numeric data there are three basic scales + available

+

+

  1. +

    Integer scale "int"

    +
  2. +

    Linear scale (a.k.a decimal labels)

    +
  3. +

    Logarithmic scales

    +

+

+

The choice of scale will affect how the autoscaling is done and how the + labels will look. Choosing an integer scale will, as the name suggests, + restrict the labels to integer and integer interval between the scale step + (at each tick mark). The linear scale has no such restriction and can be + considered a superset of the integer scale (even though the implementation + is done in rather the opposite way). Labels for linear scale can have + fraction intervals and will shows the decimal values by default in the + labels. Finally the logarithmic scale will create a deca - logarithmic + scale.

+

The style of the labels can be formatted in two ways

+

+

  1. +

    By specifying a format string (in printf() + format) to be used by calling the method + Axis::SetLabelFormatString() The format string + is interpretated according to the second parameter. If that + parameter is "true" then the format string will be + assumed to give a date format as expected by the + date() function. This is an easy way to + translate timestamp values to proper time/date labels.

    +
  2. +

    By specifying a callback function. The callback + function/method will be called with the label as the only + argument and must return the label that should be printed + Axis::SetLabelFormatCallback()

    +

    For example. An easy way to get 1000' separators for numbers + is to add the PHP function number_format() as callback to the + wanted y-axis as in

    +

    +

    1
    +
    $graph->yaxis->SetLabelFormatCallback('number_format');

    +

    +

    Another example of using a callback function is to "revert" + the y-axis. By default the y-axis grows from the bottom and up. + But what if we want the y-axis to grow from top to bottom, i.e. + the 0-value should be at the top and the largest value at the + bottom?

    +

    The way to accomplish this is to use a negative y-scale which + the plot is made against (by negating all the data values in the + data serie). This would then give the appearance that we want + apart from the act that all labels will have a minus sign in + front of them. By creating a callback function that just returns + the absolute value of the label we can adjust that and we get + the effect that we want. Figure 14.19. Inverted y-scale to show a dive profile (inyaxisex2.php) + shows an example of a "dive-curve" where the sea-level is at the + top of the graph to give better connection to this particular + use-case.

    +

    +

    Figure 14.19. Inverted y-scale to show a dive profile (inyaxisex2.php)

    Inverted y-scale to show a dive profile (inyaxisex2.php)


    +

    +

    +

    Note

    +

    The dive profile in Figure 14.19. Inverted y-scale to show a dive profile (inyaxisex2.php) is an actual dive of one of the authors dives in the + Gulf of + Bothnia

    +

    +

    +

+

+
+

Textual scale types

+ +

There is only one pure textual scale type

+

+

  1. +

    Text scale ("text")

    +

+

+

This type of scale is exclusively used for the x-axis.

+

The primary use of this scale is to label bars in a bar graph. However, as + will be shown this can also be used at other occasions to achieve various + wanted effects. There is no concept of autoscaling for text scales. Instead + the whole purpose of this type of scale is for the user to manually supply + the wanted labels in an array using the method + Axis::SetTickLabels().

+

The other key difference for a text scale as compared to the numeric + scales is that the labels are positioned in between the tick marks and not + directly under them. This is the common practice to label bar graphs and + hence this is the way text scale works.

+
+

Date scale types

+ +

This scale type only has one valid scale

+

+

  1. +

    Date scale ("dat")

    +

+

+

This specific scale type will assume that the data values are timestamps + and will properly format them to give "even" steps (in a time/date + sense).

+
+
+

Manual vs automatic scale handling

+ +

Normally the scale is determined automatically in the library by analyzing the + input data and making sure that a suitable scale is established that fulfill the + following criteria:

+

+

  1. +

    The full dynamic scope of the data series can be displayed

    +
  2. +

    The step size between major tick marks (tick marks that have a + label) is a multiple of either (1, 2, 5, 10 ) * 10 ^n, where the + size of 'n' is determined by the dynamic range of the data.

    +
  3. +

    In addition the number of labels is dependent on the size of the + graph. A smaller graph will have fewer labels since there is + "physically" not enough room to show too many labels.

    +

+

+

+

Note

+

Internally the auto scaling algorithm has fair amount of intelligence + to try to make the scale in the same way a human would so ti. For + example the origin has a specially strong attraction meaning that the + autoscaling will try hard to make sure 0 is included in the scale as + long as it "makes sense".

+

+

+

Usually this works fine in most cases but there are always exception where + exact control over the scale is wanted. For example to be able to compare + several graphs that might otherwise get different scales. There are two ways of + manually adjusting the scales.

+

+

  1. +

    Manual min/max values but with the tick + marks automatically determined

    +

    In this case the exact min/max value of the scale is submitted to + the SetScale() method call to set either (or both) of the x- and + y-scale. Since the first two argument after the scale type + determines the y min/max and the fourth and fifth argument specifies + the x min/max this means that in order to specify the x scale the y + scale must have some values. If the y axis should be left alone + (i.e. to be autoscaled) then just put the "dummy" values (0,0) as + placeholder in the method call. The following examples clarifies + this.

    +

    +

    • +

      $graph->SetScale('intlin',0,0,-10,20);

      +

      Y-scale is autoscaled and the x-scale is set to + [-10,20]

      +
    • +

      $graph->SetScale('intlin',0,50);

      +

      Automatic x-scale and manual y-scale with range + [0,50]

      +
    • +

      $graph->SetScale('intlin','-10,10,-20,20);

      +

      Manual x- and y-scale

      +

    +

    +
  2. +

    Semi automatic (or semi + manual)

    +

    This is a away to lock either the min or max value and let the + auto scaling algorithm determine a suitable corresponding max and + min value. This can be very useful to make sure that for example the + 0 value is always includeded even if the minimal value is so high + that the autoscaling algorithm have chosen to start at a larger + value. These two locked down values are set with the two + methods

    +

    +

    • +

      Scale::SetAutoMin()

      +

      Example: + $graph->yaxis->scale->SetAutoMin(0); + This will lock the y-min to 0

      +
    • +

      Scale::SetAutoMax()

      +

      Example: + $graph->xaxis->scale->SetAutoMax(1000); + This will lock the x.max to 0

      +

    +

    +

+

+
+

Major and minor ticks

+ +

The final step in understanding the scaling is to understand tick marks. There + are two types of tick marks, major and minor. Major tick marks are tick marks + that have a label associated. Up to now we have assumed that the library adjusts + where the tick marks are positioned and the inter spacing between tick marks.

+

The tick object is available as an instance variable of the scale class which + means that you can access and adjust the tick mark properties by + accessing:

+

$Graph::Axis::Scale::ticks

+

For further fine control of the scale it is possible to manually adjust the + major and minor ticks using one of the three methods

+

+

  1. +

    Adjusting how dense the auto scaling + algorithm should put the tick marks.

    +

    Even when using a fully automatic scaling it is possible to adjust + how many tick marks that the algorithm should try to place on the + scale. This is controlled with the method

    +

    +

    • +

      Graph::SetTickDensity($aYDensity, + $aXDensity)

      +

    +

    +

    The y- and x-scale density can be set to one of the following + (symbolic) values

    +

    +

    • +

      TICKD_DENSEk

      +
    • +

      TICKD_NORMAL

      +
    • +

      TICKD_SPARSE

      +
    • +

      TICKD_VERYSPARSE

      +

    +

    +

    By default the density for all scales are set to + TICKD_NORMAL +

    +

    As a comparison Figure 14.21. Fully automatic not so good scaling (manscaleex2.php) is the exact + same as Figure 14.20. Setting tick density to TICKD_DENSE (manscaleex3.php) with the difference + that in this figure the density for the y-scale has been set to + TICKD_DENSE

    +

    +

    Figure 14.20. Setting tick density to TICKD_DENSE (manscaleex3.php)

    Setting tick density to TICKD_DENSE (manscaleex3.php)


    +

    +
  2. +

    Manually specifying the step size between + each minor and major tick.

    +

    This is done using the method

    +

    LinearTicks::Set($aMajStep,$aMinStep=false)

    +

    please note that this is a method of the Tick class which is + available as an instance variable in the scale class

    +

    Example: + $graph->xaxis->scale->ticks->Set(20,5);

    +

    This type of manual positioning of the tick marks might be useful + if the scale has been set to some non-multiples of 1,2,5,10. The + following examples will clarify this. In ?? the left graph is what + we get after manually specifying the y min/max values to (3,35). In + this case the auto scaling algorithm fails to assign "nice" steps to + the y-axis so that the tick marks starts and begins at the min/max + of the scale. If we manually set the tick distance to be (8,2), i.e. + we set the major tick marks 8 units apart and the minor + (non-labeled) tick marks 2 steps apart we get the much nicer result + as shown in the right graph in ??

    +

    +

    +
    +

    +

    Figure 14.21. Fully automatic not so good scaling (manscaleex2.php)

    Fully automatic not so good scaling (manscaleex2.php)


    +

    +
    +

    +

    Figure 14.22. Manually specified tick distance which gives a much better appearance (manscaleex1.php)

    Manually specified tick distance which gives a much better appearance (manscaleex1.php)


    +

    +
    +

    +

    +

    +

    Caution

    +

    The major tick step must be an even multiple of the minor + tick step. If this is not the case the library will + automatically adjust the major step size to be the closest + multiple of the minor step size.

    +

    +

    +
  3. +

    Specify the exact position for each single + tick mark

    +

    This is often used to position only the major tick marks to be + able to have labels at very specific points in the graph. One + example of how to use this was shown in Figure 8.8. Specifying manual ticks as fraction of Pi. (manualtickex2.php) where the tick marks were + positioned at factions of π. Another typical example is to place a + label at exactly the beginning of a month. Since months have + different lengths there is no other way if 100% precision is wanted. + An example of this is shown in Figure 14.23. Manually specifying the tick position for each month (manualtickex1.php) +

    +

    +

    Figure 14.23. Manually specifying the tick position for each month (manualtickex1.php)

    Manually specifying the tick position for each month (manualtickex1.php)


    +

    +

    +

    Caution

    +

    When the tick position is manually set there should also + be a corresponding array of labels to be put at these + positions.

    +

    +

    +
  4. +

    Adjusting the size and on what side the tick + marks should be drawn

    +

    The side on the axis which has the tick marks is adjusted with a + call to

    +

    +

    • +

      Axis::SetTickSide($aTickSide)

      +

      Possible options for the tick side are

      +

      +

      • +

        SIDE_UP

        +
      • +

        SIDE_DOWN

        +
      • +

        SIDE_LEFT

        +
      • +

        SIDE_RIGHT

        +

      +

      +

    +

    +

    For example, the following lines added to a script would change + side of the labels and tick marks for the x-axis.

    +

    +

    1
    +2
    +3
    +4
    +
    <?php
    +$graph->xaxis->SetLabelPos( SIDE_UP );
    +$graph->xaxis->SetTickSide( SIDE_DOWN ); 
    +?>

    +

    +

    This technique can for example be used to put the x-axis at the + top of the graph as the following example shows.

    +

    +

    Figure 14.24. Adjusting the side which have the tick marks and position the x-axis at the top (topxaxisex1.php)

    Adjusting the side which have the tick marks and position the x-axis at the top (topxaxisex1.php)


    +

    +

+

+

In passing we mention that there are additional ways to adjust the look and + feel of the tick marks which is discussed in the next section (Adjusting the appearance of the scale labels) in detail.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s08.html b/includes/jpgraph/docs/chunkhtml/ch14s08.html new file mode 100644 index 0000000..2be3518 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s08.html @@ -0,0 +1,550 @@ +Adjusting the appearance of the scale labels

Adjusting the appearance of the scale labels

+ +

Since scale labels play such an important part of producing a visually pleasing + graph there are a number of ways to fine tune this appearance. In the section below + we have tried to logically group the different options to make it easier to get an + overview.

+

+

Adjusting the position

+ +

The exact position of the labels can be adjusted with the methods

+

+

  • +

    Axis::SetLabelAlign($aHAlign,$aVAlign='top',$aParagraphAlign='left')

    +

    With this method the anchor point for the labels can be adjusted. + The labels are positioned straight below (or on the side for + vertical axis) the corresponding tick mark and by adjusting the + anchor point in the label different effect can be achieved. By + default labels on the x-axis there anchor point on the top side in + the center. For y-axis (on the left) the anchor point is middle of + the right edge of the label.

    +
  • +

    Axis::SetLabelMargin($aMargin)

    +

    This method adjusts the distance between the corresponding tick + mark and the label it self.

    +
  • +

    Axis::SetLabelSide($aSidePos)

    +

    This method will adjust on what side the labels will be + positioned. For a horizontal axis it cna be either above or below + the axis and for a vertical axis it can be on the left or right + side. The position is defined by one of the following + self-explaining defines

    +

    +

    • +

      SIDE_LEFT

      +
    • +

      SIDE_RIGHT

      +
    • +

      SIDE_TOP

      +
    • +

      SIDE_BOTTOM

      +

    +

    +

+

+
+

Adjusting font and color

+ +

By default the color of the labels will be the same as for the axis but it is + possible to use a different color for the labels by supplying a second argument + to the SetColor() method for the axis.

+

+

  • +

    Axis::SetColor($aColor,$aLabelColor=false)

    +

    There is actually a special twist to the color specification here. + If the color is specified as a single value this color value will be + used for all labels. However, if the color is specified with an + array then those colors will be used for the labels in turn. If + there are more labels then colors specified then the colors will be + used in a wrap around fashion.

    +

+

+

The font family for the labels can be specified with

+

+

  • +

    Axis::SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10)

    +

+

+

By default a bitmap font is used for the labels (since those are the only + fonts guaranteed to be available everywhere)

+

+

Example 14.1. Adjusting the axis font and color

+ +
1
+2
+
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xaxis->SetColor('black','blue');
+


+

+
+

Adjusting the background of the labels

+ +

As a kind of a very special formatting it is also possible to set a specific + background for just the labels on the graph. This is most often used when there + is background image that risks of hiding the clarity of the labels. In those + cases it can be suitable to have a some lighter background to make it easier to + read the labels.

+

+

Tip

+

This feature can also come in handy when using the more advanced + feature of combining several graphs to amke the labels stand out.

+

+

+

The method that controls this is

+

+

  • +

    SetAxisLabelBackground($aType,$aXFColor='lightgray',$aXColor='black',$aYFColor='lightgray',$aYColor='black')

    +

    Possible values of the type of background are:

    +

    +

    1. +

      LABELBKG_NONE

      +
    2. +

      LABELBKG_XAXIS

      +
    3. +

      LABELBKG_YAXIS

      +
    4. +

      LABELBKG_XAXISFULL

      +
    5. +

      LABELBKG_YAXISFULL

      +
    6. +

      LABELBKG_XY

      +
    7. +

      LABELBKG_XYFULL

      +

    +

    +

+

+

The way these possible background types works is best described by viewing the + example figures below

+

+

+
+

+

Figure 14.25. LABELBKG_NONE (axislabelbkgex01.php)

LABELBKG_NONE (axislabelbkgex01.php)


+

+
+

+

Figure 14.26. LABELBKG_XAXIS (axislabelbkgex02.php)

LABELBKG_XAXIS (axislabelbkgex02.php)


+

+
+

+

Figure 14.27. LABELBKG_YAXIS (axislabelbkgex03.php)

LABELBKG_YAXIS (axislabelbkgex03.php)


+

+
+

+

Figure 14.28. LABELBKG_YAXISFULL (axislabelbkgex04.php)

LABELBKG_YAXISFULL (axislabelbkgex04.php)


+

+
+

+

Figure 14.29. LABELBKG_XAXISFULL (axislabelbkgex05.php)

LABELBKG_XAXISFULL (axislabelbkgex05.php)


+

+
+

+

Figure 14.30. LABELBKG_XYFULL (axislabelbkgex06.php)

LABELBKG_XYFULL (axislabelbkgex06.php)


+

+
+

+

Figure 14.31. LABELBKG_XY (axislabelbkgex07.php)

LABELBKG_XY (axislabelbkgex07.php)


+

+
  
+

+

+
+

Hiding and rotating labels

+ +

For the x-axis it is common to rotate the label to better fit long text + labels. This is done with a call to

+

+

  • +

    Axis::SetLabelAngle($aAngle)

    +

    Remember that in order to set an arbitrary angel on the labels the + font family must be one of the TTF font families. Bitmap fonts only + support horizontal and vertical rotation.

    +

+

+

There are actually five variant for hiding the aaxis

+

+

  • +

    Axis::HideLabels($aHide=true)

    +

    This will hide all the labels on the axis

    +
  • +

    Axis::HideFirstLastLabels($aHide=true)

    +

    Will hide the first and last label

    +
  • +

    Axis::HideFirstLabels($aHide=true)

    +

    Will hide the first label

    +
  • +

    Axis::HideLastLabels($aHide=true)

    +

    Will hide the last label

    +
  • +

    Axis::HideZeroLabel($aHide=true)

    +

    This will avoid printing a "0.00" label. This can be useful when + the axis are set to be crossing at the origin. This was for example + used in Figure 14.5. Example of AXSTYLE_BOXIN axis style (funcex2.php)

    +

+

+
+

Fine tuning the automatic scales

+ +

By default the auto-scaling algorithm tries ot find as tight upper and lower + bands as possible as long as they are even multiple of the chosen major step + size. In some instances some more space is needed. For example to have extra + room at the top of the graph to show data labels. In order to have some extra + space the method

+

+

  • +

    LinearScale::SetGrace($aGraceTop,$aGraceBottom=0)

    +

+

+

should be used. This method will adjust the autos calling algorithm by adding + the specified extra "grace"at the minimum and maximum value of the scale. The + grace value is specified as an integer [0,100] and specifies a percentage to add + to the min and max value before the auto scaling is made. Depending on the scale + step and overall scale several scale values might give the same resulting scale. + For example

+

+

1
+
$graph->yscale->scale->SetGrace(20,20);

+

+

will add 20% extra values on the top and bottom values of the data series + before the auto scale is determined. The following four examples shows how this + can be used in practice. In Figure 14.32. The original graph (grace_ex0.php) a bar graph + without grace value is created. As can be seen since the scale is very tight the + labels of the individual bars are almost out of the graph plot area. In the + following three plots results of using different values for grace are + shown.

+

+

+
+

+

Figure 14.32. The original graph (grace_ex0.php)

The original graph (grace_ex0.php)


+

+
+

+

Figure 14.33. Using a 10% grace (grace_ex1.php)

Using a 10% grace (grace_ex1.php)


+

+
+

+

Figure 14.34. Using a 50% grace (grace_ex2.php)

Using a 50% grace (grace_ex2.php)


+

+
+

+

Figure 14.35. Using a 100% grace (grace_ex3.php)

Using a 100% grace (grace_ex3.php)


+

+
+

+

+

We finish this section by noting that adding a large grace value might + sometimes make it necessary to move one or both of the axis manually. To explain + this we start with the graph in Figure 14.36. The original line graph (example3.2.php)

+

+

Figure 14.36. The original line graph (example3.2.php)

The original line graph (example3.2.php)


+

+

as can be seen the added plot marks (see ??) are outside the boundary of the + plot area and to solve this problem we add the line

+

+

1
+
$graph->yaxis->scale->SetGrace( 10 , 10 );

+

+

to the script. This now gives the result shown in Figure 14.37. Adding grace values. Note x-axis position at y=0 (example3.2.1.php)

+

+

Figure 14.37. Adding grace values. Note x-axis position at y=0 (example3.2.1.php)

Adding grace values. Note x-axis position at y=0 (example3.2.1.php)


+

+

The problem is now apparent. Since the x-axis is placed at y=0 by default the + x-axis is no longer at the bottom of the plot as was probably the intention. To + remedy this situation we have to manually place the x-axis at the minimum + y-scale position. This is done by adding the line

+

+

1
+
$graph->xaxis->SetPos( 'min' );

+

+

to the previous script. Doing this gives us back the wanted position of the + x-axis as shown in Figure 14.38. Adjusting the position of the x-axis manually (example3.2.2.php)

+

+

Figure 14.38. Adjusting the position of the x-axis manually (example3.2.2.php)

Adjusting the position of the x-axis manually (example3.2.2.php)


+

+
+

Manually altering the appearance of tick marks

+ +

To adjust the appearance of the tick marks the following three methods can be + used

+

+

  • +

    Axis::SetTickSide($aSide)

    +

    For x-axis this specifies if the tick should be drawn above or + below the axis and for the y-axis it specifies if the tick marks + should be on the left or on the right of the axis. Possible values + of the side parameter are one of the following defines

    +

    +

    • +

      SIDE_LEFT

      +
    • +

      SIDE_RIGHT

      +
    • +

      SIDE_TOP

      +
    • +

      SIDE_BOTTOM

      +

    +

    +
  • +

    Axis::HideTicks($aHideMinor=true,$aHideMajor=true)

    +

    Calling this method will make it possible to hide either noe of or + both the minor or the major tick marks.

    +
  • +

    Axis::SetTickSize($aMajSize,$aMinSize=3)

    +

    This specifies the size (in pixels) of the major and minor tick + marks.

    +

+

+
+

Manually specifying scale labels

+ +

As was mentioned before it is perfectly possible to manually specify the scale + labels. This is normally done for "text" scales that are most commonly used with + bar graphs.

+

Specifying a text scale for the axis (normally the x-axis) will "reserve" a + position for every data value that must be manually set. In some ways this is + the same as having a linear scale with major and minor step size set to 1.

+

As a very basic example of a text scale with a bar graph Figure 14.40. Manual text scale with month labels (manual_textscale_ex1.php) shows some fictive values for each + month of the year. In that example the scale has been set to a text scale and + each value has been specified as an array containing all the names of the + months.

+

Tip

+

An easy way to get hold of the names of the months is to use the library + global instance $gDateLocale of class DateLocale. + This class has several utility methods. For example the two methods

+

+

  • +

    GetShortMonthName($aNbr)

    +
  • +

    GetLongMonthName($aNbr)

    +

+

+

will return the proper month names (in either short or short or long + format) in the current locale. For more details see Figure 14.40. Manual text scale with month labels (manual_textscale_ex1.php) +

+
+

+

Figure 14.39. Manual text scale example

+ +

Figure 14.40. Manual text scale with month labels (manual_textscale_ex1.php)

Manual text scale example

+


+

+

Since the manual text scale sets a scale label for every single data point + this would give problem for the case where we have a large number of data points + where it is not possible to label every data point. In order to control this the + following two methods are used

+

+

  • +

    Axis::SetTextTickInterval($aStep,$aStart=0)

    +

    This method controls the interval between the tick marks for a + text scale. Since by default every tick will have a label it also + specifies how dense the labels will be. The following examples + clarifies how this works

    +

    +

    Example 14.2. Adjusting manual text tick interval

    + +

    Figure 14.41. Setting text tick interval=2 (manual_textscale_ex2.php)

    Setting text tick interval=2 (manual_textscale_ex2.php)

    +


    +

    +

    In the above example only ever second text tick mark is set and + since the labels are also placed at every tick marks only every + second label are shown.

    +
  • +

    Axis::SetTextLabelInterval($aStep)

    +

    This method complements the previous method. This method + exclusively determines where the labels are place. This makes it + possible to have more tick marks than labels. The previous example + Figure 14.41. Setting text tick interval=2 (manual_textscale_ex2.php) look a bit + strange since there are no tick-marks between every second bar. A + better solution in this case would be to have tick marks between + each bar but only label every second tick mark. This is exactly what + can be done with this method. It specifies that every n:th tick mark + should have a label.

    +

    In Figure 14.42. Labels at every 2:nd tick mark (manual_textscale_ex3.php) we have used + this method instead.

    +

    +

    Example 14.3. Adjusting the interval for the labels

    + +

    Figure 14.42. Labels at every 2:nd tick mark (manual_textscale_ex3.php)

    Labels at every 2:nd tick mark (manual_textscale_ex3.php)

    +


    +

    +

+

+

Finally we show an example where there is a need to combine the above two + methods to get a reasonable looking scale. This happens when there are so many + data points that it is not possible to show every tick marks. To show that text + scales can also be used with other plot types than bar we have chosen to show a + line graph where we show data that has 40 data points per month (480 data points + per year). Let us assume that in this application we want to have tick marks at + every 40 points (i.e. a total of 12 tick marks) and have labels only on every + 2:th tick label (i.e. a total of 6 labels).

+

+

Caution

+

The label array must have labels for every tick mark even if they are + not shown.

+

+

+

+

Example 14.4. Adjusting both text tick mark and label interval

+ +

Figure 14.43. Tick marks every 40 points and labels every 2:nd tick mark (manual_textscale_ex4.php)

Tick marks every 40 points and labels every 2:nd tick mark (manual_textscale_ex4.php)

+


+

+

In addition to the text scale is it in principle also possible to use a manual + scale with integer scale as shown in Graphing the number of sun spots during the 19th Century

+

+

Note

+

It is also perfectly legal to override the default labels for the Y + (and Y2) axis in the same way as we have shown for the x-axis but this + is probably a less used scenario.

+

+

+

+

Caution

+

Please note that the supplied labels will be applied to each major + tick label. If there are insufficient number of supplied labels the + non-existent positions will have the ordinal number of the label.

+

+

+
+

Emphasize of parts of the scale

+ +

Sometimes it is a good idea to emphasize part of the scale. It can be on + either the x- or the y-axis. The library offers the possibility to add a band + with a separate background color for part of the scale in either x, y (or both) + directions.

+

A plotband is defined as an instance of class PlotBand that is + added to the graph in the same way as normal plots. A plot band can have a + number of different styles to achieve the wanted affect and it can be placed + either on top or behind the plot.

+

An instance is created and added to the graph as shown by the following + example

+

+

1
+2
+3
+4
+
// Add a horizontal band
+$band = new PlotBand(HORIZONTAL,BAND_RDIAG,15,35,'khaki4');
+$band->ShowFrame(false); // No border around the plot band
+$graph->Add($band);

+

+

The code snippet above adds a horizontal band with a diagonal pattern (from + top left to bottom right). The horizontal band is shown between the y-scale + values [15,35].

+

The types of plotbands supported by the library is shown in the table + below

+

+

Example 14.5. Different densities for plot bands

+ +
+
+

+

Figure 14.44. BAND_RDIAG (smallstaticbandsex1.php)

BAND_RDIAG (smallstaticbandsex1.php)


+

+
+

+

Figure 14.45. BAND_LDIAG (smallstaticbandsex2.php)

BAND_LDIAG (smallstaticbandsex2.php)


+

+
+

+

Figure 14.46. BAND_DIAGCROSS (smallstaticbandsex10.php)

BAND_DIAGCROSS (smallstaticbandsex10.php)


+

+
+

+

Figure 14.47. BAND_HLINE (smallstaticbandsex7.php)

BAND_HLINE (smallstaticbandsex7.php)


+

+
+

+

Figure 14.48. BAND_VLINE (smallstaticbandsex6.php)

BAND_VLINE (smallstaticbandsex6.php)


+

+
+

+

Figure 14.49. BAND_HVCROSS (smallstaticbandsex5.php)

BAND_HVCROSS (smallstaticbandsex5.php)


+

+
+

+

Figure 14.50. BAND_3DPLANE (smallstaticbandsex4.php)

BAND_3DPLANE (smallstaticbandsex4.php)


+

+
+

+

Figure 14.51. BAND_SOLID (smallstaticbandsex3.php)

BAND_SOLID (smallstaticbandsex3.php)


+

+
+

+

+
+
+


+

+

For some of these patterns it is also possible to specify an additional + density parameter via the method PlotBand::SetDensity() that + specifies how dense the pattern should be. For example Example 14.6. Different densities for various plot bands shows three variants of the 3D plane + with different density parameters.

+

+

Example 14.6. Different densities for various plot bands

+ +
+
+

+

Figure 14.52. SetDensity(10) (plotbanddensity_ex0.php)

SetDensity(10) (plotbanddensity_ex0.php)


+

+
+

+

Figure 14.53. SetDensity(40) (plotbanddensity_ex1.php)

SetDensity(40) (plotbanddensity_ex1.php)


+

+
+

+

Figure 14.54. SetDensity(80) (plotbanddensity_ex2.php)

SetDensity(80) (plotbanddensity_ex2.php)


+

+
+
+


+

+

Tip

+

3D planes actually carry another possible modification. You can specify + the vanish point to change the perspective used. You can't access the method + to change the horizon directly but you can access it through

+

+

1
+
 $band ->prect->SetHorizon( $aHorizon)

+

+

assuming that the band is a 3D plane.

+
+

To finish this section we show one slightly more creative use of background + plot bands in Figure 14.56. Creative use of plot bands (staticbandbarex7.php)

+

+

Figure 14.55. Creative use of plot bands

+ +

Figure 14.56. Creative use of plot bands (staticbandbarex7.php)

Creative use of plot bands

+


+

+
+

Adding static lines for specific scale values in the graph

+ +

In addition to the plot band it is possible to add static lines to emphasize a + specific scale value. A pot line is added to the graph by creating an instance + of the class PlotLine in much the same way as for plot bands. The + following code snippets show how this can be done

+

+

1
+2
+3
+
// Add mark graph with static lines
+$line = new PlotLine(HORIZONTAL,10,"black",2);
+$graph->AddLine($line);

+

+

The above code snippets adds a black plot line (weight=2) at scale position + y=10.

+

In addition to using this feature to show min/max values (or perhaps critical + limits) another usage can be to show a zero-line as the following example in + Figure 14.58. Adding a static line at y=0 to simulate an extra 0-axis (impulsex4.php) shows.

+

+

Figure 14.57. Use of a static line to simulate an extra x-axis at y=0

+ +

Figure 14.58. Adding a static line at y=0 to simulate an extra 0-axis (impulsex4.php)

Use of a static line to simulate an extra x-axis at y=0

+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s09.html b/includes/jpgraph/docs/chunkhtml/ch14s09.html new file mode 100644 index 0000000..a04a9d3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s09.html @@ -0,0 +1,107 @@ +Using a logarithmic scale

Using a logarithmic scale

+ +

In all the previous discussion we have used linear scales. Another option is to + use a logarithmic scale. This is often used when there is a need to display both + very small and very large values in the same graph. The library supports the use of + logarithmic scales on both the x- and y-axis (as well as the optional extra + y-axis).

+

The logarithmic scale support is defined in the module file + "jpgraph_log.php" so this must be included in order to + access this feature.

+

To illustrate the use of a logarithmic scale we will make a graph which uses two + y-axis and make the second y-axis have a logarithmic scale (we will actually take + the graph in Figure 15.16. Adding and adjusting the position of the legend box (example6.php) and change the second y-axis to be a + logarithmic scale instead).

+

In order to use a logarithmic scale on the second (Y2) axis we only need to + change

+

+

1
+
$graph->SetY2Scale('lin');

+

+

to

+

+

1
+
$graph->SetY2Scale('log');

+

+

and the library will take care of the rest. The result of this is shown in Figure 14.59. Changing the Y2 scale from linear to logarithmic (example7.php)

+

+

Figure 14.59. Changing the Y2 scale from linear to logarithmic (example7.php)

Changing the Y2 scale from linear to logarithmic (example7.php)


+

+

By default only the major grid lines on the y-axis are shown. By adding the + lines

+

+

1
+2
+
$graph->ygrid->Show(true,true);
+$graph->xgrid->Show(true,false);

+

+

We can enable both the x-grid lines as well as the minor grid lines on the y-axis + to get the result shown in Figure 14.60. Enabling minor grid lines on the y-axis and also grid lines on the x-axis (example8.php) below

+

+

Figure 14.60. Enabling minor grid lines on the y-axis and also grid lines on the x-axis (example8.php)

Enabling minor grid lines on the y-axis and also grid lines on the x-axis (example8.php)


+

+

In addition to using a logarithmic scale on the y-axis to generate what is + commonly known as a "lin-log" scale it is also possible to use a logarithmic scale + on the x-axis to get a "log-log" plot (as is often used in electrical engineering). + An example of this is shown in Figure 14.61. An example of a log-log plot (where both the y- and x-axis use a logarithmic scale) (loglogex1.php)

+

+

Figure 14.61. An example of a log-log plot (where both the y- and x-axis use a logarithmic scale) (loglogex1.php)

An example of a log-log plot (where both the y- and x-axis use a logarithmic scale) (loglogex1.php)


+

+

+

Note

+

The example in Figure 14.61. An example of a log-log plot (where both the y- and x-axis use a logarithmic scale) (loglogex1.php) also makes use of + scatter plots which we have not yet introduced but is a way to draw a plot + of a number of data points specified by both there x- and + y-coordinates.

+

+

+

+

Tip

+

If you think the first value of the Y-axis is to close to the first label + of the X-axis you have the option of either increasing the margin (with a + call to SetLabelMargin() ) or to hide the first label (with a + call to Axis::HideFirstTickLabel() )

+

+

+

As a final example of using a logarithmic scale we show how to combine a text + scale for the x-axis and a logarithmic scale for the y-axis. As we already shown in + Graphing the number of sun spots during the 19th Century it is possible to manually specify + the labels that should be used on the axis with a call to Axis::SetTickLabels(). + Let's make use of this and the built-in library super global variable + "$gDateLocale" which is an instance of a date utility class to get + a list of the name of all the months in a localized fashion.

+

To use the name of the months on the x-axis we haev to add the following two lines + to the previous example

+

+

1
+2
+3
+4
+
<?php
+$montnames = $gDateLocale->GetShortMonth();
+$graph->xaxis->SetTickLabels( $montnames ); 
+?>

+

+

The result of adding these two lines are shown in Figure 14.62. Using a text-log scale (example9.php) below

+

+

Figure 14.62. Using a text-log scale (example9.php)

Using a text-log scale (example9.php)


+

+

Since the name of the months are quite close we can change what labels should be + displayed as was discussed in Manually specifying scale labels to + only show every second label. Doing this change gives the result shown in Figure 14.63. Adjusting the text scale so that only every second labels are displayed. (example9.1.php)

+

+

Figure 14.63. Adjusting the text scale so that only every second labels are displayed. (example9.1.php)

Adjusting the text scale so that only every second labels are displayed. (example9.1.php)


+

+

Another option if we think that the labels are too close is to rotate them. In + Figure 14.64. Rotating the x-axis labels 90 degree (example9.2.php) we have kept all labels but rotated them 90 + degree.

+

+

Figure 14.64. Rotating the x-axis labels 90 degree (example9.2.php)

Rotating the x-axis labels 90 degree (example9.2.php)


+

+

+

Caution

+

Remember that the built-in bitmap fonts only supports 0 and 90 degree + text. TTF fonts support texts at an arbitrary angle.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s10.html b/includes/jpgraph/docs/chunkhtml/ch14s10.html new file mode 100644 index 0000000..554140d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s10.html @@ -0,0 +1,724 @@ +Using a date/time scale

Using a date/time scale

+ +

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 then specify the + scale, for example as "datlin" in the call to + Graph::SetScale() as the following code snippet shows.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+require_once( "jpgraph/jpgraph.php" );
+require_once( "jpgraph/jpgraph_line.php" );
+require_once( "jpgraph/jpgraph_date.php" );
+...
+$graph = new Graph ( ... );
+$graph->SetScale( 'datlin' );
+... 
+?>

+

+

It is possible to use a selectable degree of automation when dealing with date + scales. The easiest way is to let the library deal with all the details and make it + own decision on how to format the scale. Unfortunately this might not always be + exactly what was intended and hence it is also possible to give the library hints on + how the formatting should be done or specify to a great details the exact formatting + needed.

+

Bot the y- and the x-axis can have a date scale but the most common case is to + only use date scale on the x-axis.

+

Specifying the input data

+ +

No matter how the formatting is done the input data is assumed to be a + timestamp value, i.e. the number of seconds since epoch (as defined on the local + system executing the graph). 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.One vector for the Y-data and one vector for the x-data. The following line + of code prepares a line plot for the use with a date scale

+

+

1
+
$lineplot = new LinePlot( $ydata , $xdata );

+

+

+

Caution

+

Note the order of the data vectors. The Y-data always comes + first.

+

+

+

A first example is shown in Figure 14.65. A first date scale example (dateaxisex2.php) where we + have created a number of random points with a sample interval of 240s (chosen + completely arbitrary)

+

+

Figure 14.65. A first date scale example (dateaxisex2.php)

A first date scale example (dateaxisex2.php)


+

+

Please review the script that creates this graph before continuing since we + will base all further examples on this.

+
+

Adjusting the start and end date alignment

+ +

As can be seen from the example in Figure 14.65. A first date scale example (dateaxisex2.php) the + scale starts slightly before the first data point.

+

Why?

+

This is of course by purpose in order to make the first time label start on an + "even" value, in this case on an hour. Depending on the entire interval of the + graph the start value will dynamically adjust to match the chosen date/time + interval, this could for example be on an even minute, even 30min, even hour, + even day, even week and so on. It all depends on the scale.

+

The alignment of the start (and end) date can also be adjusted manually by + using the two methods

+

+

  • +

    DateScale::SetTimeAlign($aStartAlign,$aEndAlign)

    +

    The following symbolic constants can be used to define the time + alignment

    +

    +

    1. +

      Alignment on seconds

      +

      +

      • +

        MINADJ_1, Align on a single second (This is + the lowest resolution)

        +
      • +

        MINADJ_5, Align on the nearest 5 + seconds

        +
      • +

        MINADJ_10, Align on the nearest 10 + seconds

        +
      • +

        MINADJ_15, Align on the nearest 15 + seconds

        +
      • +

        MINADJ_30, Align on the nearest 30 + seconds

        +

      +

      +
    2. +

      Alignment on minutes

      +

      +

      • +

        MINADJ_1, Align to the nearest minute

        +
      • +

        MINADJ_5, Align on the nearest 5 + minutes

        +
      • +

        MINADJ_10, Align on the nearest 10 + minutes

        +
      • +

        MINADJ_15, Align on the nearest 15 + minutes

        +
      • +

        MINADJ_30, Align on the nearest 30 + minutes

        +

      +

      +
    3. +

      Alignment on hours

      +

      +

      • +

        HOURADJ_1, Align to the nearest hour

        +
      • +

        HOURADJ_2, Align to the nearest two + hour

        +
      • +

        HOURADJ_3, Align to the nearest three + hour

        +
      • +

        HOURADJ_4, Align to the nearest four + hour

        +
      • +

        HOURADJ_6, Align to the nearest six + hour

        +
      • +

        HOURADJ_12, Align to the nearest tolw + hour

        +

      +

      +

    +

    +
  • +

    DateScale::SetDateAlign($aStartAlign,$aEndAlign)

    +

    The following symbolic constants can be used to define the date + alignment

    +

    +

    1. +

      Day alignment

      +

      +

      • +

        DAYADJ_1, Align on the start of a day

        +
      • +

        DAYADJ_7, Align on the start of a + week

        +
      • +

        DAYADJ_WEEK, Synonym to DAYADJ_7

        +

      +

      +
    2. +

      Monthly alignment

      +

      +

      • +

        MONTHADJ_1, Align on a month start

        +
      • +

        MONTHADJ_6, Align on the start of + halfyear

        +

      +

      +
    3. +

      Yearly alignment

      +

      +

      • +

        YEARADJ_1, Align on a year

        +
      • +

        YEARADJ_2, Align on a bi-yearly basis

        +
      • +

        YEARADJ_5, Align on a 5 year basis

        +

      +

      +

    +

    +

+

+

Some examples will clarify the use of these methods.

+

+

Example 14.7. We want the time adjustment to start on an even quarter of an hour, + i.e. an even 15 minute period.

+ +
1
+
$graph->xaxis->scale->SetTimeAlign( MINADJ_15 );
+


+

+

+

Example 14.8. We want the time to start on an even 2 hour

+ +
1
+
$graph->xaxis->scale->SetTimeAlign( HOURADJ_2 );
+


+

+
+

Manually adjusting the ticks

+ +

Since a date scale is special case of an integer scale (the underlying format + of dates a timestamps which are large integers) it is perfectly possible to + manually adjust the interval between each label. The interval is specified in + seconds with a call to the usual

+

LinearTicks::Set($aMajorTicks,$aMinorTick)

+

as the following code snippet shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php
+$graph->SetScale('datint');
+ 
+// Adjust the start time for an "even" 5 minute, i.e. 5,10,15,20,25, ...
+$graph->xaxis->scale->SetTimeAlign(MINADJ_5);
+ 
+// Force labels to only be displayed every 5 minutes
+$graph->xaxis->scale->ticks->Set(5*60);
+ 
+// Use hour:minute format for the labels
+$graph->xaxis->scale->SetDateFormat('H:i');
+?>

+

+

In the above example the scale will start on an "even" 5 minute boundary and + then have labels every 5 minutes exactly. Of course strictly speaking the + adjustment with MINADJ_5 is not necessary but will avoid that the + scale starts on whatever happens to be the initial value of the data (which will + control how the first label is placed).

+

The graph in Figure 14.66. Manually adjusting the tick labels for a date scale (datescaleticksex01.php) shows an example + where an online auction is displaying how the bids are increasing from each + participant every 5 minutes. The example also shows how to adjust the label + format on the y-axis to show currency values with 1000' separator by using a + label callback (using the PHP function number_format() ).

+

+

Figure 14.66. Manually adjusting the tick labels for a date scale (datescaleticksex01.php)

Manually adjusting the tick labels for a date scale (datescaleticksex01.php)


+

+
+

Adjusting the label format

+ +

The default label format always tries to use the shortest possible unique + string. To manually set a label format the method

+

+

  • +

    DateScale::SetDateFormat($aFormatString)

    +

    The format string uses the same format convention as the PHP + function date()

    +

+

+

is used. For example

+

+

1
+
$graph->xaxis->scale->SetDateFormat( 'H:i' );

+

+

will display the hour (24h) and minutes in the label separated by a colon + (':'). Using this format string together with the modified start/end alignment

+

+

1
+
$graph->xaxis->scale->SetTimeAlign(MINADJ_10);

+

+

with our previous date example will give the result shown in Figure 14.67. Adjusting label formatting of a date scale (dateaxisex4.php)

+

+

Figure 14.67. Adjusting label formatting of a date scale (dateaxisex4.php)

Adjusting label formatting of a date scale (dateaxisex4.php)


+

+
+

Adjusting the automatic density of date labels

+ +

As with the linear scale it is possible to indicate what density of scale + ticks is needed. This is (as usual) specified with a call to + Graph::SetTickDensity($aMajDensity, $aMinDensity) for example + as

+

+

1
+
$graph->SetTickDensity( TICKD_DENSE );

+

+
+

Creating a date/time scale with a manual label call-back

+ +

In the following we will assume that all data points are specified by a tuple + (time-value, date-value) where the + date/time is specified as a timestamp in seconds in the same format as is + returned by the PHP function time().

+

+

Caution

+

Be careful if data is gathered from a different time zone and whether + it is given in UTC ot in the local time/date.

+

+

+

A label formatting callback routine will get called each time a label is to be + drawn on the scale. The one parameter given to the callback function is the + current time value. The returned string is then used as a label.

+

What we do is that we specify that the x-scale should be an ordinary integer + "int" scale (remember that the data values are timestamps which + are integers). We then install our custom label formatting callback (with a call + to Graph::SetLabelFormatCallback()) which given a timestamp returns + a suitable label as a string.

+

In our example we will use the PHP function date() to convert + between the time stamp value and a suitable textual representation of the + time/date value.

+

The callback we use is

+

+

1
+2
+3
+4
+
// 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 graph shown in Figure 14.68. Manually creating a date scale (dateaxisex1.php)

+

+

Figure 14.68. Manually creating a date scale (dateaxisex1.php)

Manually creating a date scale (dateaxisex1.php)


+

+

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 to + not leave gaps (as discussed above) between the data and the start/end of the + scale.

+

The defined callback function will be called for each of the displayed labels. + Since we are using an integer scale the labels will be set according to an + suitable scale when the time stamp values are interpretated as integers.

+

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 time stamp values.

+

The best way to solve this is to use an integer x-scale together with 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.

+

+

Example 14.9. Manually creating a date/time scale (timestampex01.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
<?php // content="text/plain; charset=utf-8"
+// Example on how to treat and format timestamp as human readable labels
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+?>


+

+
+

Using the "DateScaleUtils" class to make manual date scale

+ +

In this section we will show a very common use case where the x-axis have the + unit of timestamps and where the start of each month is labeled. This is + difficult (impossible) to do with the automatic tick marks since this requires + the distance between consecutive tick marks to be different.

+

+

Warning

+

To use manual tick marks the basic scale should be an integer scale + since the underlying data are integer time stamps, for example + SetScale('intlin').

+

+

+

+ Figure 14.69. Adding a label at the start of every month (manualtickex1a.php) shows a basic example of what we want + to achieve

+

+

Figure 14.69. Adding a label at the start of every month (manualtickex1a.php)

Adding a label at the start of every month (manualtickex1a.php)


+

+

To use the manual tick marks two steps are required

+

+

  1. +

    Determine where the tick marks should be. Both major (which can + have a label and grid marks) and minor ticks can be specified. + Optionally if complex labels, which cannot be calculated by a format + string (either as date or printf() format) needs to be + created.

    +
  2. +

    Call the appropriate method to set the tick marks and optional + labels.

    +

+

+

We remind the reader that the following methods (in class Axis) are available + to set the tick marks

+

+

  • +

    Axis::SetTickPositions($aMajTickPos,$aMinTickPos=NULL,$aLabels=NULL)

    +
  • +

    Axis::SetMajTickPositions($aMajTickPos,$aLabels=NULL)

    +

+

+

The second method above is strictly speaking not necessary, it is just a + convenience function for those cases where only major ticks and labels should be + set.

+

The following related method will also be used in this example

+

+

  • +

    Axis::SetLabelFormatString($aFormat,$aIsDateFormat=FALSE)

    +

+

+

This method has been available for a long time in the library but it has + recently gained the second argument. With this argument it is possible to tell + if the formatting string should be interpretated as format according to the + standard printf() format or if it should be interpretated as a + format string to be used with the date() function.

+

Finally we will use a utility function that is available in + "jpgraph_utils.inc.php" in the class + DateScaleUtils

+

+

  • +

    DateScaleUtils::GetTicks($aData,$aType==DSUTILS_MONTH1)

    +

    Possible values for the second argument ($aType) are

    +

    +

    +
    Date typeDescription
    DSUTILS_MONTHMajor and minor ticks on a monthly basis +
    DSUTILS_MONTH1Major and minor ticks on a monthly + basis
    DSUTILS_MONTH2Major ticks on a bi-monthly basis
    DSUTILS_MONTH3Major ticks on a tri-monthly basis
    DSUTILS_MONTH6Major on a six-monthly basis
    DSUTILS_WEEK1Major ticks on a weekly basis
    DSUTILS_WEEK2Major ticks on a bi-weekly basis
    DSUTILS_WEEK4Major ticks on a quad-weekly basis
    DSUTILS_DAY1Major ticks on a daily basis
    DSUTILS_DAY2Major ticks on a bi-daily basis
    DSUTILS_DAY4Major ticks on a quad-daily basis
    DSUTILS_YEAR1Major ticks on a yearly basis
    DSUTILS_YEAR2Major ticks on a bi-yearly basis
    DSUTILS_YEAR5Major ticks on a five-yearly basis
    +

    +

    +

+

+

The DateScaleUtils::GetTicks() is a utility function that given + an array of timestamps returns an array of major and minor tick mark positions + that marks the start and middle of each month when we use the + DSUTILS_MONTH1 type specifier.

+

To make the graph in figure 1 we first note that it is probably a good idea to + specify the min and max value of the X-axis ourself rather than letting the auto + scale algorithm do that. Since the timestamps are possibly quite large values + and the auto scaling algorithm will try to make the start and end values be + "even" (for example multiples of 5,10,100, .. and so on).

+

Secondly we need to chose what scale we will use. In this case it doesn't + really matter if we chose a integer (int) or a linear (lin) scale. But since + timestamps by definition are integers we select an int scale for the X-axis.

+

Finally we need to decide what format to have on the labels. For this example + we chose to show it as "Dec05" to indicate "December 2005". The format string + needed to select this is "My" which we will use as argument for the + SetLabelFormatString() method. Since the width of the label is + medium wide we add some empty space on each side of the graph after we + positioned the ticks to avoid the first label "hitting" the Y-axis labels. This + could happen if the start of the first month on the axis is very near the X-Y + axis conjunction.

+

We will now walk through the code to create the image in Figure 14.69. Adding a label at the start of every month (manualtickex1a.php) and explain each step.

+

First we create some random data for the X and Y axis

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+$datay = array();
+$datax = array();
+$ts = time();
+$n=15; // Number of data points
+for($i=0; $i < $n; ++$i ) {
+    $datax[$i] = $ts+$i*700000; 
+    $datay[$i] = rand(5,60);
+}
+?>

+

+

Then we get the tick positions for the start of the months

+

+

1
+2
+3
+
<?php
+list($tickPositions, $minTickPositions) = DateScaleUtils::GetTicks($datax);
+?>

+

+

We also add a bit of space "grace value" at the beginning and end of the axis

+

+

1
+2
+3
+4
+5
+
<?php
+$grace = 400000;
+$xmin = $datax[0]-$grace;
+$xmax = $datax[$n-1]+$grace;
+?>

+

+

It is now time to add the standard code to setup a basic graph. We also set + the previously calculated tick positions and the label formatting string we want + to use.

+

Note that we are careful at making sure the x-axis always start at the minimum + y-value (by calling SetPos() ), by default the x-axis is otherwise + positioned at y=0 and if the y-scale happens to start at, say y=10, then the + x-axis is not shown.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+$graph = new Graph(400,200);
+$graph->SetScale('intlin',0,0,$xmin,$xmax);
+$graph->title->Set('Basic example with manual ticks');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12);
+$graph->xaxis->SetPos('min');
+$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+$graph->xaxis->SetLabelFormatString('My',true);
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+?>

+

+

Finally we create and add the plot to the graph and send back the graph to the + browser.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$p1 = new LinePlot($datay,$datax);
+$p1->SetColor('teal');
+$graph->Add($p1);
+$graph->Stroke();
+?>

+

+
+

When to use manual and when to use automatic date scale?

+ +

The previous sections showed how to make use of the utility class + DateScaleUtils to manually set the tick marks. The astute + reader will also recall the possibility to use a "date" scale, i.e. specifying + the scale for example as

+

+

1
+2
+3
+4
+
<?php
+// Use a date-integer scale
+$graph->SetScale('datint'); 
+?>

+

+

So what is the difference and when should this be used?

+

The answer is that the functionality to some extent overlap but with the + manual scale creation there is the possibility to more exact specify the + distance between the label marks. By using the "Date" scale the library will + automatically adjust the labels to have a suitable distance depending on the + span of the data and the size of the graph. This is "easier" but will give + little control over the intervals.

+

With the manual scale, on the other hand, it is possible to exactly specify + the distance (e.g. every three month) between each label on the expense of a few + more lines of code.

+

There is also one more important difference an that is that with a "date" + scale the tick marks will always be adjusted so that the end and beginning of + the scale falls on a major tick marks. If the data to be visualized doesn't + completely cover this span there might be "gaps" in the data at the beginning + or/and at the end of the x-scale. With a manual scale it is possible to set the + min and max x-scale value to match exactly the min/max x-values in the data and + have the plot begin and end at exactly the beginning and end of the x-axis. This + is not possible to guarantee with a date scale.

+

Let's put this knowledge to use and compare "side by side" the difference + between these two ways of creating a date scale by creating a graph with the + same data but using these two different methods.

+

In the first example (shown in Figure 14.70. Manually specified date scale (dateutilex01.php) ) we use + a manually set tick scale with an explicitly set min/max value for the x-axis. + The labels on the graph are formatted with a call to

+

+

1
+
$graph->xaxis->SetLabelFormatString('M, Y',true);

+

+

the second parameter ('true') will make the library interpret the + format string as specifying a date format string.

+

+

Figure 14.70. Manually specified date scale (dateutilex01.php)

Manually specified date scale (dateutilex01.php)


+

+

The second variant will use the exact same data but this time we will use a + date scale. This is accomplished by first including the necessary support module + jpgraph_date.php and then specifying the scale as

+

+

1
+
$graph->SetScale('datlin');

+

+

In order to make the two graphs have exactly the same label format we also use + the same format string as in the previous graph, i.e. + $graph->xaxis->SetLabelFormatString('M, Y',true);. The result + of formatting is shown in Figure 14.71. Using an automatic date scale (dateutilex02.php) .

+

+

Figure 14.71. Using an automatic date scale (dateutilex02.php)

Using an automatic date scale (dateutilex02.php)


+

+

Comparing Figure 14.71. Using an automatic date scale (dateutilex02.php) . and Figure 14.70. Manually specified date scale (dateutilex01.php) we can see that with the automatic scaling + the tick marks match the beginning and ending of the x-scale but at the expense + of a small gap at the end of the data since the data doesn't extend quite as far + as the scale.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s11.html b/includes/jpgraph/docs/chunkhtml/ch14s11.html new file mode 100644 index 0000000..32f2bf2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s11.html @@ -0,0 +1,88 @@ +Adding shearing image transformation to the graph

Adding shearing image transformation to the graph

+ +

As a final "touch" on the image it is possible to apply a shearing transformation + to the generated image. This can be used to give the image a "3D" perspective. The + transformation is done by the method Graph::Set3DPerspective() It + should be noted that since these transformations are all done in PHP they are (as + all image processing) quite processor intensive.

+

In order to get access to the transformation functionality the module + "jpgraph_imgtrans.php" must first be included in the + script.

+

In Figure 14.72. Different types of shearing transformation the original image is shown in the + middle and the four types of shearing is shown around in positions indicating the + type of shearing. The symbolic name for the type of shearing is shown below each + image.

+

+

Figure 14.72. Different types of shearing transformation

+ +
+
+

Different types of shearing transformation

+

SKEW3D_UP

+
+

Different types of shearing transformation

+

SKEW3D_LEFT

+
+

Different types of shearing transformation

+

[Original graph]

+
+

Different types of shearing transformation

+

SKEW3D_RIGHT

+
+

Different types of shearing transformation

+

SKEW3D_DOWN

+
+
+


+

+

The transformation is specified with the method

+

+

  • +

    Graph::Set3DPerspective($aDir,$aAlpha=100,$aShear=120,$aQuality=false,$aFillColor='#FFFFFF',$aBorder=false,$aMinSize=true,$aHorizonPos=0.5)

    +

+

+

+

Figure 14.73. Explaining the shearing parameters

+ +
Explaining the shearing parameters
+


+

+

The different parameters that effect the transformation can now be explained with + the help of Figure 14.73. Explaining the shearing parameters +

+

+

$aDir
+

This is the symbolic constant to define which of the four basic + types of transformation as shown in Figure 14.72. Different types of shearing transformation +

+
$aAlpha
+

This defines the distance from the bottom of the image to the + artificial horizon

+
$aShear
+

This defines from the perspective vanish point on the artificial + horizon to the crossing of the "shearing line" on the artificial + horizon..

+
$aHorizPos
+

This specifies the distance from the left edge of the image to the + perspective vanish point

+
$aQuality
+

With this parameter set to true + the algorithm will do additional image interpolation to increase the + quality of the resulting transformation on the expense of further + processing time.

+
$aFillColor
+

Specifies the background fill color to be used. A value of false + (the default) indicates no fill

+
$aBorder
+

Add a border around the transformed image

+
$aMinSize
+

The transformed image is usually smaller than the original image + and if this parameter is set to true then the resulting image will + be as small as it can be. If it is false then the original image + size will be kept.

+

+

+

This might be regarded as "gimmick" factor but has proven useful in batch + (off-line) processing to produce a sequence of images that gives the appearance of a + graph that rotates into place.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s12.html b/includes/jpgraph/docs/chunkhtml/ch14s12.html new file mode 100644 index 0000000..7fa1f8d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s12.html @@ -0,0 +1,146 @@ +Rotating graphs

Rotating graphs

+ +

The library supports an arbitrary rotation of a the plot area as well as some + special convenience method to rotate the plot area 90 degree which most often is + used to draw a horizontal bar graph instead of a (standard) vertical bar + graph.

+

+

Caution

+

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. The library tries to mitigate this as + much as possible by using a pre-calculated transformation matrix and also + makes further optimizations for the special case of 90 degree + rotations.

+

+

+

+

Caution

+

Any background images (see Adding images and country flags to the background of the graph) will not be rotated with the graph. This limitation exists since the + performance and memory usage of doing real image transformation in PHP would + be too poor. Any background images needing rotation must be rotated outside + in some image manipulation program (e.g. Gimp, IrfanView).

+

+

+

When a plot area is rotated there are two things to be aware of

+

+

  1. +

    individual labels on the axis are not + rotated

    +

    The design decision behind this is that bit mapped fonts cannot be + arbitrarily rotated and rotating TTF fonts will decrease (in general) + the readability. If angle rotation is needed on the labels it is still + possible to use the method Axis::SetLabelAngle()

    +

    +

    Note

    +

    Since the anchor point for labels is by default the optimum + for graph at 0 degree the anchor point and alignment for the + labels on the axis should probably be adjusted to get a better + visual appearance on the rotated graph. This is accomplished by + the method Axis::SetLabelAlign() +

    +

    +

    +
  2. +

    any background image or background gradient is + not rotated

    +

    The design decision behind this is purely computational Doing a full + image rotation would be excruciating CPU intensive using PHP.

    +

+

+

Free rotation of the plot area

+ +

The rotation of the plot area is controlled with the following two methods

+

+

  • +

    Image::SetAngle($aAngle)

    +

    "$Angle" = Angle of rotation specified in degrees. A + positive angle specifies a clockwise rotation.

    +
  • +

    Image::SetCenter($aX, $aY)

    +

    Specifies the center of rotation

    +

+

+

The Image class is the lowest graphic layer in the library and it is access + through the instance variable "$img" of the Graph class. So for + example to rotate a plot are 45 degree the following line has to be added

+

+

1
+
$graph->img->SetAngle(45);

+

+

By default the center of rotation will be the center point of the plot area. + The following examples will clarify this. We will use the (very) basic graph + shown in Figure 14.74. Original unrotated graph (rotex0.php) to demonstrate rotation.

+

+

Figure 14.74. Original unrotated graph (rotex0.php)

Original unrotated graph (rotex0.php)


+

+

In Figure 14.75. Rotating the plot area 45 degrees (rotex1.php) and Figure 14.76. Rotating the plot area 90 degrees (rotex2.php) we + have rotated the plot area around (the default) the center of the plot + area

+

+

+
+

+

Figure 14.75. Rotating the plot area 45 degrees (rotex1.php)

Rotating the plot area 45 degrees (rotex1.php)


+

+
+

+

Figure 14.76. Rotating the plot area 90 degrees (rotex2.php)

Rotating the plot area 90 degrees (rotex2.php)


+

+
+

+

+

In the above two example the center of the rotation was the center point of + the plot area. If we instead change the center of rotation to be the center of + the entire graph we get the result shown in Figure 14.77. Rotating the plot area 45 degrees (rotex3.php) and + Figure 14.78. Rotating the plot area 90 degrees (rotex4.php) .

+

+

+
+

+

Figure 14.77. Rotating the plot area 45 degrees (rotex3.php)

Rotating the plot area 45 degrees (rotex3.php)


+

+
+

+

Figure 14.78. Rotating the plot area 90 degrees (rotex4.php)

Rotating the plot area 90 degrees (rotex4.php)


+

+
+

+

+

As a final example in Figure 14.79. Rotating the plot area -30 degree around the bottom left corner (rotex5.php) we show the result of + rotating the plot area -30 degree around the bottom left point in the + graph

+

+

Figure 14.79. Rotating the plot area -30 degree around the bottom left corner (rotex5.php)

Rotating the plot area -30 degree around the bottom left corner (rotex5.php)


+

+
+

Rotating the plot area 90 degree

+ +

As can be seen above in Figure 14.76. Rotating the plot area 90 degrees (rotex2.php) and Figure 14.78. Rotating the plot area 90 degrees (rotex4.php) the rotation does not alter the overall size and + margin of the graph even though we probably should do so in order to better + accommodate the rotated plot areas topography. It is of course perfectly + possible to adjust the size of the graph manually.

+

The slight complication with general rotation is that the margins also + rotates, this means that if the graph is rotated 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 the + center of the rotation will move with the margin (since the specify the exact + location of the plot area)..

+

So for the case of rotating a graph 90 degree the library provides a + convenience method to do both the rotation and specifying the margin at the same + time (to avoid the mental exercise described above) by providing the + method

+

+

  • +

    Set90AndMargin(($aLeft=0,$aRight=0,$aTop=0,$aBottom=0) +

    +

    Rotates the plot area 90 degrees and sets the graph margin + areas

    +

+

+

This method is probably most commonly used with bar graphs to create + horizontal instead of vertical bars. See the section on bar graphs, ??, for more + example on this.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s13.html b/includes/jpgraph/docs/chunkhtml/ch14s13.html new file mode 100644 index 0000000..c9bd57f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s13.html @@ -0,0 +1,165 @@ +Using anti-aliasing in the graph generation

Using anti-aliasing in the graph generation

+ +

The library have partial support for the use of anti-aliasing when crating graphs. + The level of support is different depending on the actual graph type and there are + some caveats to be aware of.

+

+

Note

+

One question that is often asked is why does the library not support full + anti-aliasing in every type of graphs? The answer is that since neither GD + graphic library does not support real anti-aliasing this is done in the + library itself most of the time. Doing full image anti-aliasing is very CPU + intensive and can for large graph easily take four times longer than no + anti-aliasing. In addition the way full image anti-aliasing is done is by + creating larger canvas which the graph is drawn on and then do a smoothing + operation, basically scale the image to the correct size puts some + limitation on the details resolution. For example text needs special + handling since the TTF fonts are already anti-aliased and cannot be + re-anti-aliased a second time.

+

+

+

Anti-aliasing for line drawing graphs

+ +

This applies to all graphs that makes use if line drawing. For example line + plots and radar charts. This is the only "true" anti-aliasing done in the + library.

+

This anti aliasing is enabled by calling the method

+

+

  • +

    Image::SetAntiAliasing($aFlg=true)

    +

+

+

As a concrete example the following line can be used to enable anti-aliasing + for both line and wind rose plots

+

+

1
+
$graph->img->SetAntiAliasing();

+

+

The algorithm used for line anti-aliasing makes a gradient color transition + between foreground line color and background while plotting a line using a + standard mid-point line algorithm. To achieve best visual result always use a + dark line color on a light colored background.

+

The images below shows the difference between a plain graph on the left and + the same graph drawn with anti-aliasing enabled on the right.

+

+

+
+

Figure 14.80. Plain radar plot (radarex8.php)

Plain radar plot (radarex8.php)

+
+

Figure 14.81. Anti-aliased radar plot (radarex8.1.php)

Anti-aliased radar plot (radarex8.1.php)

+
+

+

+

There are a number of limitations with the current implementation that should + be noted. The reason these limitation exists is that for reasons of CPU load we + have chosen not to implement full anti-aliasing for arbitrary shapes.

+

+

  1. +

    Speed! Doing anti-aliased lines in PHP is not cheap. Anti-aliased + line drawing is roughly 6-8 times slower then lines without + anti-aliasing So using anti-aliasing isn't suitable together with + high-load often updated graphs. Remember to use the caching feature + (see Efficient graph generation using the built-in cache subsystem.)

    +
  2. +

    Lines will ignore any width and only have a single line-width of + approximately=1. It is not possible to set the line width when + anti-alias is used. (This would require a full implementation of + anti-aliased polygons which is not implemented.)

    +
  3. +

    The colors will be a little bit "weaker" since they will now not + consist of one dominant color but rather being made up by at least + two different colors.

    +
  4. +

    Anti-aliasing does not work very well together with background + images since it assumes a the same solid color on each side of the + line. Doing a more advanced anti-aliasing algorithm would simple + take to much processing power.

    +
  5. +

    Even when anti-aliasing is enabled fast line-drawing will be used + for horizontal, vertical and diagonal lines since these get sampled + at high enough frequency anyway and doesn't benefit from + anti-aliasing. This optimization has a slight visual impact, as can + be seen in Figure 14.81. Anti-aliased radar plot (radarex8.1.php) The vertical line + appear to the human eye to have a slightly different color and looks + a bit thinner.

    +

+

+

+

Note

+

The difference between a standard line and one line with anti-aliasing + is shown in large magnification in ??. The approach used in the library + roughly corresponds to an even weighted 3x3 Bartlett-filter. It would be + possible to apply some more advanced filtering techniques to achieve an + even better result but doing high-intensive 2D signal processing on a + HTTP-server is not a brilliant idea. The algorithm used in the library + is a reasonable trade-off between visual appearance and + efficiency.

+

+

Figure 14.82. Anti-aliasing up-close. The figure shows the difference + between a standard line (on-top) and the corresponding + anti-aliased line (on-the bottom)

+ +
+
+

Anti-aliasing up-close. The figure shows the difference between a standard line (on-top) and the corresponding anti-aliased line (on-the bottom)

+
+
+


+

+

+

+

+
+

Anti-aliasing in pie graphs

+ +

For Pie plots a full image anti-aliasing algorithm is used. The original image + is scaled to twice it's specified with and then down sampled to the required + size. This will give a low pass filtering effect which takes the edges away from + the image and gives a smooth appearance. However the filtering is quite + processor intensive.

+

Anti-aliasing for pie plots are enabled by calling

+

+

  • +

    PieGraph::SetAntiAlising($aFlg=true)

    +

+

+

as the following code snippet shows

+

+

1
+
$piegraph->SetAntiAliasing();

+

+

There is inherent limitation using this method and that is that edges on the + Pie can not be used.

+

The figure below shows the visual impact the anti-aliasing have on both 2D and + 3D Pie plots.

+

+

Figure 14.83. Affects of using anti-alias for Pie-graphs

+ +
+
+

Affects of using anti-alias for Pie-graphs

+
+

Affects of using anti-alias for Pie-graphs

+
+

Affects of using anti-alias for Pie-graphs

+
+

Affects of using anti-alias for Pie-graphs

+
+
+


+

+
+

Anti-aliasing in Windrose plots

+ +

This uses the same algorithm as the Pie plots with similar restrictions and + limitations.

+
+

Anti-aliasing for Contour plots

+ +

This uses almost the same algorithm as Pie plots. The additional feature here + is that it is possible to specify the size of the over-sampling. This can be + value between 2-5. However, using an oversampling larger than 3 has very little + additional visual improvement but will significantly increase the processing + time.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s14.html b/includes/jpgraph/docs/chunkhtml/ch14s14.html new file mode 100644 index 0000000..8735291 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s14.html @@ -0,0 +1,83 @@ +Adding icons (and small images) to the graph

Adding icons (and small images) to the graph

+ +

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 defined in the module + "jpgraph_iconplot.php". The image which is the base of the + icons can be

+

+

  1. +

    an arbitrary image from a file

    +
  2. +

    one of the built-in country flags

    +

+

+

The basic structure of adding an icon somewhere on the graph is to first create an + instance of the IconPlot class and then position the icon at the wanted x,y-position + on the graph and finally add the object to the graph using the standard + Graph::Add() method. The constructor for the IconPlot class have + the following signature

+

+

  • +

    __construct($aFile='',$aX=0,$aY=0,$aScale=1.0,$aMix=100)

    +

    The parameters should be self explanatory. The $aMix + factor specifies the degree of alpha blending between the background and + the icon. A value of 100 means no blending and a value of 0 means that + the icon is not shown at all, only the background.

    +

+

+

Some useful methods in this class are

+

+

  • +

    SetCountryFlag($aFlag,$aX=0,$aY=0,$aScale=1.0,$aMix=100,$aStdSize=3)

    +

    This method specifies that the specified country flag should be + used

    +
  • +

    SetPos($aX,$aY)

    +

    Same as the optional arguments in th constructor. The coordinates are + specified as absolute pixels where (0,0) is the top left corner.

    +
  • +

    CreateFromString($aStr)

    +

    Creates the image from a string instead of reading it from a file. +

    +
  • +

    SetScalePos($aX,$aY)

    +

    Specifes the potision using the scale coordinate as specified by the + x- and y-scales

    +
  • +

    SetAnchor($aXAnchor='left',$aYAnchor='center')

    +

    Sets the anchor point of the icon, i.e. the position in the icon that + should be aligned with the specified icon position in the graph.

    +

+

+

The following short example shows how an icon is created and added to a + graph

+

+

1
+2
+3
+
$icon = new IconPlot('myimage.png',0.2,0.3,1,30);
+$icon->SetAnchor('center','center');
+$graph->Add($icon);

+

+

It is possible to control how much of the icon should be blended into the + background by specifying a percentage (1-100). The example below in Figure 14.84. Mixing an icon image into the background of the graph. The area plot in the graph uses alpha blending to achieve see-through affect (lineiconex1.php) shows how to mix in the picture of "Tux the + penguin" into the background of a filled line graph.

+

+

Figure 14.84. Mixing an icon image into the background of the graph. The area plot in the graph uses alpha blending to achieve see-through affect (lineiconex1.php)

Mixing an icon image into the background of the graph. The area plot in the graph uses alpha blending to achieve see-through affect (lineiconex1.php)


+

+

To specify any of the roughly 200 country flags as an icon the first step is to + create an empty Icon and then call the IconPlot::SetCountryFlag() + method with the appropriate parameters. This is illustrated below by adding the + Icelandic flag into the background as an icon.

+

+

Figure 14.85. Adding a country flag icon in the background (lineiconex2.php)

Adding a country flag icon in the background (lineiconex2.php)


+

+

+

Caution

+

Some older versions of PHP (< 4.3.3 using the built-in GD) have + problems rendering blended images. If you have this problem then you need to + upgrade to a more recent version of PHP.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s15.html b/includes/jpgraph/docs/chunkhtml/ch14s15.html new file mode 100644 index 0000000..b503464 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s15.html @@ -0,0 +1,125 @@ +Adding images and country flags to the background of the graph

Adding images and country flags to the background of the graph

+ +

The background can not only be a solid (or semi-transperant) color. It is also + possible to use images as backgrounds. These can be arbitrary user specified images + in any format (as determined by there file suffix). Since the library has a built in + support for all established countries (as of 20 Dec 2008) in regards to there flags + (all flags are encoded within the library) it is also possible to use a country flag + as a background. This could be considered a special case of the user defined image + background.

+

+

  1. +

    Graph::SetBackgroundImage($aFileName,$aBgType=BGIMG_FILLPLOT,$aImgFormat='auto')

    +
  2. +

    Graph::SetBackgroundImageMix($aMix)

    +
  3. +

    Graph::SetBackgroundImagePos($aXpos,$aYpos)

    +
  4. +

    Graph::SetBackgroundCountryFlag($aName,$aBgType=BGIMG_FILLPLOT,$aMix=100)

    +

+

+

For both background images and flags it is possible to define how the image should + be used on the page with the background type parameters. This parameter specifies + how the image should be placed on the graph. The following options are + available:

+

+

  • +

    BGIMG_FILLPLOT . This means that the background image will be scaled + to that it exactly fits the plot area

    +
  • +

    BGIMG_FILLFRAME . This means the the background image will be scaled + so that it exactly fits the entire graph

    +
  • +

    BGIMG_COPY . This means that the background image will be copied in + tis original size without and size adjustments

    +
  • +

    BGIMG_CENTER . Almost the same as BGIMG_COPY but this also means that + the image will be automatically centered in the graph

    +
  • +

    BGIMG_FREE, This is a variant of the BGIMG_COPY but in this case the + image will be free on its own and have no color blending with the margin + color

    +

+

+

To help explain these types of backgrounds they are illustrated below by adding + the image in Figure 14.87. Background image (a closeup of our burnt + server) as a background + to the plain graph in Figure 14.86. The graph that will be used to add backgrounds + to. In order not + to have the background image take to much emphasis in the graph we specify the + mixing to 25% with a call to

+

+

1
+
$graph->SetBackgroundImageMix(25);

+

+

+

+
+

Figure 14.86. The graph that will be used to add backgrounds + to

+ +
The graph that will be used to add backgrounds to
+

+
+

Figure 14.87. Background image (a closeup of our burnt + server)

+ +
Background image (a closeup of our burnt server)
+

+
+

+

+

In the table below the various options for adjusting the size and position of the + background image are shown

+

+

+
+

+

Figure 14.88. BGIMG_COPY (background_type_ex0.php)

BGIMG_COPY (background_type_ex0.php)


+

+

BGIMG_COPY

+
+

+

Figure 14.89. BGIMG_CENTER (background_type_ex1.php)

BGIMG_CENTER (background_type_ex1.php)


+

+

BGIMG_CENTER

+
+

+

Figure 14.90. BGIMG_FREE (background_type_ex2.php)

BGIMG_FREE (background_type_ex2.php)


+

+

BGIMG_FREE

+
+

+

Figure 14.91. BGIMG_FILLPLOT (background_type_ex3.php)

BGIMG_FILLPLOT (background_type_ex3.php)


+

+

BGIMG_FILLPLOT

+
+

+

Figure 14.92. BGIMG_FILLFRAME (background_type_ex4.php)

BGIMG_FILLFRAME (background_type_ex4.php)


+

+

BGIMG_FILLFRAME

+
 
+

+

+

+

Using country flags as backgrounds

+ +

The method Graph::SetBackgroundCountryFlag($aName,$aBgType,$aMix) + makes it possible to use an of the built-in country flags as a background i the + same way as any other user specified background image. All included country + flags as of Dec 2008 are listed in Appendix F. List of all country flags. The + background country flag is specified by its short name as listed in Appendix F. List of all country flags.

+

+

Caution

+

The dynamics of world politics and geographic boundaries will no doubt + make the list of included countries obsolete almost at the same time the + library is released. The intention is that all currently known country + and similar geographic entities should be included. Any missing flags + shall and can not be interpreted as any political stand it is merely a + consequence of political changes since the library was released or a + possible oversight or simply a mistake either human or algorithmically + in how the country flags are produced.

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s16.html b/includes/jpgraph/docs/chunkhtml/ch14s16.html new file mode 100644 index 0000000..6edc1e5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s16.html @@ -0,0 +1,95 @@ +Using background gradients

Using background gradients

+ +

A color gradient background will change the color from a start color to a finish + color in even steps (the number of steps depends on the size of the graph). The + direction of the gradient is controlled by specifying a style parameter for the + gradient. The signature for the gradient background method is

+

+

  1. +

    Graph::SetBackgroundGradient($aFrom='navy',$aTo='silver',$aGradType=2,$aStyle=BGRAD_FRAME)

    +

+

+

The last style par mater specified where in the graph the gradient style should be + applied and the different options are

+

+

  • +

    BGRAD_FRAME, The entire graph frame will be filled +

    +
  • +

    BGRAD_MARGIN, Only the margin area (the graph area + outside the plot area) will be filled

    +
  • +

    GRAD_PLOT, Only the plot area will be filled

    +

+

+

This is illustrated in Figure 14.93. What area of the graph the gradient should affect

+

+

Figure 14.93. What area of the graph the gradient should affect

+ +
+
+

What area of the graph the gradient should affect

+

BGRAD_FRAME

+
+

What area of the graph the gradient should affect

+

BGRAD_MARGIN

+
+

What area of the graph the gradient should affect

+

BGRAD_PLOT

+
+
+


+

+

The different types of gradient fills are shown in Figure 14.94. Different types of gradient fills where the gradient from color is + "white" and the to color is "orange"

+

+

Figure 14.94. Different types of gradient fills

+ +
+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
+

Different types of gradient fills

+
 
+
+


+

+

Generating gradient background off-line

+ +

A drawback of using gradient backgrounds is that they are processing intensive + and since they are generated each time the graph is generated it can take + substantive amount of time for large graphs. To help with this the library + offers a small (very simple) utility that can be tun to create gradient images + off line. These images can later on be used as (static) background images. In + the distribution there is a small utility in the + "Examples/" directory called + "mkgrad.php". Pointing the browser to this script will + show a basic form as shown in Figure 14.95. The "mkgrad" utiliy to create gradient images. The script will + allow the creation of a gradient images using any of the predefined colors and + gradient types.

+

+

Figure 14.95. The "mkgrad" utiliy to create gradient images

+ +
The "mkgrad" utiliy to create gradient images
+


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch14s17.html b/includes/jpgraph/docs/chunkhtml/ch14s17.html new file mode 100644 index 0000000..8b1425c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch14s17.html @@ -0,0 +1,74 @@ +Adding arbitrary texts to the graph

Adding arbitrary texts to the graph

+ +

In much the same was as icon images can be added to the plot so can arbitrary text + strings be added. This is done by creating an or several instances of the Text class + (one per string that is needed). This feature is typically used to add + clarifications or other information related to the actual graph.

+

These text instances are then added to the graph via the normal + Graph::Add() method.

+

The position of the text in the image/graph can be given as either absolute + pixels, fractions of the width/height of the graph or as scale values according to + the specified (or automatically determined) scale.

+

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 there default value. We do this by adding te following lines

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
<?php
+// Create an instance of the Text class and set the string at the same time
+$txt = new Text('This is a text');
+ 
+// Position the string at absolute pixels (0,20).
+// ( (0,0) is the upper left corner )
+$txt->SetPos(0, 20);
+ 
+// Set color and fonr for the text
+$txt->SetColor('red');
+$txt->SetFont(FF_FONT2,FS_BOLD);
+ 
+// ... and add the text to the graph
+$graph->AddText($txt); 
+?>

+

+

Teh resulting graph can be seen in Figure 14.96. Adding a text object to a graph (example25.php)

+

+

Figure 14.96. Adding a text object to a graph (example25.php)

Adding a text object to a graph (example25.php)


+

+

Let's make the text stand out a bit more by having a background color, framing the + text box and adding a drop shadow by using the method Text::SetBox() + The resulting graph can be seen in Figure 14.97. Making the text stand out a bit more by adding a background color and frame (example25.1.php)

+

+

Figure 14.97. Making the text stand out a bit more by adding a background color and frame (example25.1.php)

Making the text stand out a bit more by adding a background color and frame (example25.1.php)


+

+

In order to use a text with several lines each line needs to be separated by a + newline ("\n'"character). The default paragraph alignment is left edge but as was + discussed in ?? paragraph alignment can be adjusted.

+

In our final example we a text with several line are place in the middle of the + plot area.

+

+

Figure 14.98. Adding a text object with multiple rows of text. Paragraph alignment is set to "center" (example25.2.php)

Adding a text object with multiple rows of text. Paragraph alignment is set to "center" (example25.2.php)


+

+

Tip

+

To set the position of the text using scale positions instead use the + method

+

+

  • +

    Text::SetScalePos($aX,$aY)

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15.html b/includes/jpgraph/docs/chunkhtml/ch15.html new file mode 100644 index 0000000..4a210b9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15.html @@ -0,0 +1,1821 @@ +Chapter 15. Different types of linear (cartesian) graph types

Chapter 15. Different types of linear (cartesian) graph types

Table of Contents

15.1. Basic Line and area graphs
15.1.1. Creating a line graph
15.1.2. Automatic interpolation of unknown data
15.1.3. Adding marks to the plot (a.k.a. plot marks)
15.1.4. Displaying the values at the data points
15.1.5. Adding several data series to the same graph
15.1.6. Adding a second Y-axis
15.1.7. Adding a legend box to the graph
15.1.8. Changing the style of the line plot - using the step-style
15.1.9. Optimizing line plot using "fast drawing"
15.1.10. Creating a filled line graphs (a.k.a. area plots)
15.1.11. Partially filled area graphs
15.1.12. Filled lines with NULL values
15.1.13. Accumulated line graphs
15.1.14. Accumulated line graphs with given X-labels
15.1.15. Constructing smooth line plots with Cubic Splines
15.2. Bar graphs
15.2.1. Accumulated bar plots
15.2.2. Grouped bar plots
15.2.3. Grouped accumulated bar graphs
15.2.4. Horizontal bar graphs
15.2.5. Adjusting the appearance of bar graphs
15.3. Error plot graphs
15.3.1. Line error plots
15.4. Stock graphs
15.4.1. Stock plot variant: Boxplot
15.4.2. Image maps for Box and Stock charts
15.5. Scatter graphs
15.5.1. Combining marks with a line
15.5.2. Creating impulse (or stem) - plots
15.5.3. Field plots
15.5.4. Balloon plots
15.5.5. Creating Geo-maps
15.6. Contour graphs
15.6.1. Input data for contour graphs
15.6.2. Creating a contour graph
15.6.3. Adjusting the color and number of isobar lines
15.6.4. Understanding mesh interpolation
15.7. Combining several different plot types in the same graph
15.8. Creating several graphs in the same image
15.8.1. Creating a combined graph
15.8.2. Adding background images
15.8.3. Creating rotated combined graphs
15.8.4. Some caveats when using MGraph
+ +

+

Figure 15.1. Supported linear graph types in the library

+ +
+
+

Supported linear graph types in the library

+

a) Line plot

+

(See Creating a line graph)

+
+

Supported linear graph types in the library

+

b) Area plot

+

(See Creating a filled line graphs (a.k.a. area plots))

+
+

Supported linear graph types in the library

+

c) Bar plot

+

(See Bar graphs)

+
+

Supported linear graph types in the library

+

a) Field plot

+

(See Field plots)

+
+

Supported linear graph types in the library

+

b) Error plot

+

(See Error plot graphs)

+
+

Supported linear graph types in the library

+

c) Stock plot

+

(See Stock graphs)

+
+

Supported linear graph types in the library

+

a) Geo-map plot

+

(See Creating Geo-maps)

+
+

Supported linear graph types in the library

+

b) Impuls (stem) plot

+

(See Scatter graphs)

+
+

Supported linear graph types in the library

+

c) Spline plot

+

(See Constructing smooth line plots with Cubic Splines)

+
+

Supported linear graph types in the library

+

a) Balloon plot

+

(See Balloon plots)

+
+

Supported linear graph types in the library

+

b) Scatter plot

+

(See Scatter graphs)

+
+

Supported linear graph types in the library

+

c) Contour plot

+

(See Contour graphs )

+
+
+


+

+

Basic Line and area graphs

+ +

Line graphs (we will use the term line graph to refer to an entire graph and the + term line plot to refer to a single data series in a line graph) is together with + bar graphs the simplest and perhaps the most commonly used graph type. In Graphing the number of sun spots during the 19th Century we have already shown an example of a + line graph without explaining to much of the details. The remainder of the section + will go into some more details on the options available when creating a line + graph.

+

Creating a line graph

+ +

A line graph always make use of one or several instances of the class + LinePlot which represent one plotted data series in the graph. In all + our example we follow the naming convention to always name the instance of the + LinePlot class as "$lineplot"

+

The absolutely simplest line graph that is possible to create is shown in + Figure 15.2. The most simple line graph (example0-0.php)

+

+

Example 15.1. The most simple line graph (example0-0.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>


Figure 15.2. The most simple line graph (example0-0.php)

The most simple line graph (example0-0.php)


+

+

There are a number of things to point out here

+

+

  • +

    Both the X and Y axis have been automatically scaled and since we + didn't provide any x-scale the data point have been numbered + automatically starting at 0

    +
  • +

    By default the Y-grid is enabled and displayed in a "soft" + color

    +
  • +

    By default the overall graph has a black bordered and a light gray + margin

    +
  • +

    By default the size of the margin around the plot area is + automatically calculated

    +

+

+

While the above example is a perfectly fine graph it looks a bit poor and we + could probably make use of a graph title as well as titles on the axis to + explain the units we are working with. So lets change the simple graph in Figure 15.2. The most simple line graph (example0-0.php) by adding a few lines to set some titles and + get the modified graph shown in Figure 15.3. Adding some titles (example2.php)

+

+

Example 15.2. Adding some titles (example2.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>


Figure 15.3. Adding some titles (example2.php)

Adding some titles (example2.php)


+

+

Worth noting in this example are

+

+

  • +

    The main graph class instance ($graph) is used as the base to + access most properties of the overall graph

    +
  • +

    The margins have been slightly increased to account for the titles + of the axis

    +
  • +

    The default position for the title of the x-axis is on the far + right and for the y-axis it is placed centered in the middle and + rotated in a 90 angle (vertical).

    +

+

+

A nice change would now be to have the titles of the axis in a bold font and + the line plot a little bit thicker and in blue color. Let's do that by adding + the lines

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+$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 
+?>

+

+

As was explained in Chapter 8. Text and font handling this will adjust + the fonts of the titles to make use of a bold variant of the built-in bitmap + fonts. Please note the consistent naming conventions used in the library. Most + objects support a common set of basic methods to adjust font, size and colors + wherever such concepts make sense.

+

The result of adding these lines are shown in Figure 15.4. Changing fonts of the axis titles and adjusting plot weight (example3.php) (click on the link in the title to see the full source).

+

+

Figure 15.4. Changing fonts of the axis titles and adjusting plot weight (example3.php)

Changing fonts of the axis titles and adjusting plot weight (example3.php)


+

+

As a final touch lets make the y-axis have the same color as the data series + to stronger show the connection between the data and the scale. At the same time + we take the opportunity to add a drop shadow to the overall graph. We do both of + these things by adding the following two lines at appropriate places in the + script

+

+

1
+2
+3
+4
+
<?php
+$graph->SetShadow();
+$graph->yaxis->SetColor('blue');
+?>

+

+

The results is shown in Figure 15.5. Adding drop shadow and changing axis color (example3.0.1.php) below

+

+

Figure 15.5. Adding drop shadow and changing axis color (example3.0.1.php)

Adding drop shadow and changing axis color (example3.0.1.php)


+

+

+

Tip

+

Remember that the library has multiple ways to handle null data values + as described in Different types of NULL data handling

+

+

+
+

Automatic interpolation of unknown data

+ +

Line graphs supports automatic linear interpolation of missing data point if + the missing data point is replaced by a '-' (hyphen character) for more on + handling of NULLs in the input data see Different types of NULL data handling.

+

+

+
+

Figure 15.6. Original null values (example3.0.3.php)

Original null values (example3.0.3.php)

+
+

Figure 15.7. Using '-' to get interpolated lines (example3.0.2.php)

Using '-' to get interpolated lines (example3.0.2.php)

+
+

+

+

There is one option to control the behavior of the interpolation together with + accumulated line plots and that is how to handle the case where the initial or + ending data are unknown.

+

For accumulated line plots (see below) this is especially critical since each + value is plotted with an offset of the "previous" plot and hence all values must + be known. By default if the first data value is unknown it will be set to the + same value as the first found non-null value. It is also possible, for + accumulated line plots, to force the first and last unknown value to be equal to + 0 (zero). This is controlled by the method

+

+

  • +

    AccLinePlot::SetInterpolateMode($aForceZero)

    +

    A value of true for the for the argument will force any first or + last unknown values to be interpreted as 0 for an accumulated line + plot.

    +

+

+
+

Adding marks to the plot (a.k.a. plot marks)

+ +

Another common embellishment of plots is to add markers for each data point. + The library supports a large number of built-in plot marks as well as the + ability to use arbitrary images as plot marks. Plot marks are instantiated as an + instance of class PlotMark defined in the module + "jpgraph:plotmark.inc.php"

+

There are three types of built-in plot marks

+

+

  1. +

    Line based.

    +

    These marks are drawn directly by the library at the appropriate + places in the graph. These marks are simple rectangles, squares, + stars etc The size and colors (both edge and fill) are user + adjustable.

    +
  2. +

    Image based symbols.

    +

    These marks look much more "refined" and are actually small + built-in images that are scaled and placed (copied) to the + appropriate position in the graph. Since these are predefined images + they are only available in a certain number of colors and shapes. +

    +
  3. +

    Country flags

    +

    As was previously discussed the library supports (as of Dec 2008) + all known countries and it is possible to use the country flags both + as background in the graphs as well as plot marks.

    +

+

+

A full list of all available built-in plot marks and there symbolic names are + given in Appendix E. Available plot marks.

+

For now lets keep things simple and just add a small triangle at each of the + specified data points by adding the lines

+

+

1
+2
+3
+4
+5
+
<?php
+$lineplot->mark->SetType(MARK_UTRIANGLE);
+$lineplot->mark->SetColor('blue');
+$lineplot->mark->SetFillColor('red');
+?>

+

+

+

Caution

+

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 SetColor() for the line + since the marks color will always be reset to the lines color when you + set the line color.

+

+

+

The result after making these modifications are shown in Figure 15.8. Adding basic plot marks to the plot (example3.1.php)

+

+

Figure 15.8. Adding basic plot marks to the plot (example3.1.php)

Adding basic plot marks to the plot (example3.1.php)


+

+

+

Tip

+

In addition to the built in plot marks it is also possible to use a + user specified image as a plot mark. See Figure 14.11. Adding a left,right and center footer (footerex1.php) for an example of how to use this + feature. To use this feature the plot mark type is specified as + MARK_IMG and the file name of the image is given. For + example the following line will us the image file "myimage.jpg" as plot + marks and scale the image to 50% of its original size

+

+

1
+
$lineplot->mark->SetType(MARK_IMG,'myimage.jpg','0.5');

+

+

+

+

As a final example we show an example of using one of the built-in image marks + by adding the line

+

+

1
+
$lineplot->mark->SetType(MARK_IMG_DIAMOND,'red',0.5);

+

+

This will add a red diamond mark scaled to 50% of its original size to better + fit the overall size of the graph. The result of adding this is shown in Figure 15.9. Using one of the built-in images as plot mark, MARK_IMG_DIAMOND (example3.1.1.php)

+

+

Figure 15.9. Using one of the built-in images as plot mark, MARK_IMG_DIAMOND (example3.1.1.php)

Using one of the built-in images as plot mark, MARK_IMG_DIAMOND (example3.1.1.php)


+

+

+

Tip

+

Note that some of the built in images are available in different + sizes. The reason is that even though it is possible to n 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 appearance.

+

+

+

In order to use one of the available country flags the type is specified as + MARK_FLAG1, MARK_FLAG2, MARK_FLAG3 or + MARK_FLAG4 which represent the native size of the flag (in + increasing order). The second argument to SetType() is either the + ordinal index number of the country flag or its short name (as listed Appendix F. List of all country flags). The following example illustrates both + these methods of specifying the country flags. The two critical lines are

+

+

1
+2
+3
+4
+
<?php
+$p1->mark->SetType(MARK_FLAG1,197);
+$p2->mark->SetType(MARK_FLAG1,'united states');
+?>

+

+

and the result of creating a graph with some data using country flags as data + markers are shown in Figure 15.10. Using country flags as plot marks (markflagex1.php)

+

+

Figure 15.10. Using country flags as plot marks (markflagex1.php)

Using country flags as plot marks (markflagex1.php)


+

+

In addition the plot mark formatting shown above plot marks also supports + formating through the use of a callback function. The callback function will be + passed the y-value as its only argument and the callback function must return an + array consisting of three value, weight, color and fill-color. This could be + used to for example alter the colors of the plot marks depending on the actual + value. A common use of this feature is to create "balloon" scatter plot where a + variable sized filled circle is positioned at specific data points. This is a + way t create a 2D plot which conveys three values at each data point, x,y and + size. In the section on Scatter plot (see Scatter graphs) we show an example of + this.

+
+

Displaying the values at the data points

+ +

Lets continue the previous example by making some minor adjustments to also + show the values at each data point. The data label at each data point is + represented by the instance variable "$value". This is an instance of the + class DisplayValue and all normal text attributes can be + adjusted (e.g. color, size, fonts etc). The value is applied to all + labels.

+

In addition to the usual text formatting it is also possible to adjust how the + numeric data labels is formatted. This is done by one of two ways.

+

+

  1. +

    by submitting a suitable format string. This format string follows + the same syntax as the printf() format string.

    +
  2. +

    by specifying a format callback function. This callback function + must take exactly one argument (which is the data value) and return + the wanted string that should be displayed.

    +

+

+

In order to display the values the first thing that must happen is to enable + the values. This is done by a call to

+

+

1
+
$lineplot->value->Show();

+

+

The result of adding this line is shown in Figure 15.11.  (example3.3.php)

+

+

Figure 15.11.  (example3.3.php)

(example3.3.php)


+

+

We can now modify the appearance of the labels by changing the font and + changing the way the labels are formatted. We do this by adding the following + lines to the previous example

+

+

1
+2
+3
+4
+5
+
<?php
+$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
+$lineplot->value->SetColor('darkred');
+$lineplot->value->SetFormat('(%d)');
+?>

+

+

The resulting graph can be seen in Figure 15.12. Changing the appearance of data labels (example3.4.php)

+

+

Figure 15.12. Changing the appearance of data labels (example3.4.php)

Changing the appearance of data labels (example3.4.php)


+

+

+

Tip

+

To get 1000' separators use the PHP function number_format() as a + callback function

+

+

+

+

Tip

+

To use method in classes as callback the callback method has to be + specified as an array with two string entries. The first entry must be + the class and the second entry must be the method name. Note that + callback method should be static as no instance context can be + created.

+

+

+

As a final example we make use of a callback function to format the values as + Roman Numerals . The result of this can + be seen in Figure 15.13. Formatting display values as roman numerals (example3.4.1.php)

+

+

Figure 15.13. Formatting display values as roman numerals (example3.4.1.php)

Formatting display values as roman numerals (example3.4.1.php)


+

+
+

Adding several data series to the same graph

+ +

Up to now all examples we have shown have only had one data series. As was + mentioned in the introduction a graph can have an unlimited number of data + series (plots) although from a practical consideration (and "viewability") it is + probably best to restrict the number of data series in one graph to less than + 5-6.

+

The steps to do this is exactly a repetition of what the examples have shown + up to now. The only thing that is needed is to create the second data series, by + creating a new instance of a the LinePlot class, set the attributes, and finally + add it to the graph.

+

The following lines show how to create the new data series/plot and add it to + the graph (we only show the new lines - not the full script)

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+$ydata2  = array( 1 , 19 , 15 , 7 , 22 , 14 , 5 , 9 , 21 , 13 );
+ 
+// Create a new data series with a different color
+$lineplot2 = new  LinePlot ( $ydata2 );
+$lineplot2->SetWeight ( 2 );
+ 
+// Also add the new data series to the graph
+$graph->Add( $lineplot2 );

+

+

Making these additions will create the graph in Figure 15.14. Adding a second data series (example4.php)

+

+

Figure 15.14. Adding a second data series (example4.php)

Adding a second data series (example4.php)


+

+

There are two things to note here

+

+

  1. +

    The Y-scale has changed to accommodate the larger range of + Y-values for the second graph.

    +
  2. +

    The colors for each successive data series is allocated + automatically but of course it is also possible to set the color + manually.

    +
  3. +

    If you add several plots to the same graph they should contain the + same number of data points. This is not a requirement (the graph + will be automatically scaled to accommodate the plot with the + largest number of points) but it will not look very good since one + of the plot end in the middle of the graph.

    +

+

+

+

Caution

+

Do not mix both manually and automatically assigned colors. When the + library assigns colors to a new line plot it will not check if a certain + color has been previously manually set and used.

+

+

+
+

Adding a second Y-axis

+ +

As was discussed in Using multiple y-axis it is possible + to add multiple y-axis to a graph. The most common use of this feature is to + just use one extra y-axis with a different scale on the right side of the graph. + To make this common case as easy as possible to manage the library provides some + convenience method to work with one second y-axis (and scale).

+

The second y-axis is accessed through the "$y2axis" property of + the Graph class and its use is completely analogue to the primary y-axis + ("$yaxis").

+

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 accommodate for the bigger dynamic range of + the second plot. (One other way of solving this particular problem could be to + use a logarithmic y-scale).

+

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 adding the lines

+

+

1
+2
+3
+4
+
<?php
+$y2data = array(354 , 200 , 265 , 99 , 111 , 91 , 198 , 225 , 293 , 251);
+$graph->SetY2Scale('lin');
+?>

+

+

To instruct the library to add this data series to the second y-axis we have + to make use of the method

+

+

  • +

    Graph::AddY2()

    +

+

+

which is used in analogy with the usual Graph::Add()

+

To make the graph easier to read we set the color of the second y-axis to be + the same as the second data series. The result of this is shown in Figure 15.15. Adding a second y-axis to the graph (example5.php) below.

+

+

Figure 15.15. Adding a second y-axis to the graph (example5.php)

Adding a second y-axis to the graph (example5.php)


+

+
+

Adding a legend box to the graph

+ +

Once we have multiple data series there is a need to separate them and that is + usually done by adding a legend box with suitable titles. As was shown in Adjusting the position and layout of the legend it is possible to both add a + legend box and adjusts its position. Lets now continue the previous example by + adding a suitable legend box to separate the two data series.

+

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 previous example we + have been working with so far we need to add the two lines

+

+

1
+2
+3
+4
+
<?php
+$lineplot->SetLegend('Plot 1');
+$lineplot2->SetLegend('Plot 2');
+?>

+

+

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 graph. 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 in the right margin area. We will also enlarge the overall + image so the plot area doesn't get too squeezed.

+

The legend properties is accessed through the '$legend' property + of the graph. So in order to adjust the position (as was described in Adjusting the position and layout of the legend ) we add the line

+

+

1
+
$graph->legend->SetPos(0.05, 0.5, 'right', 'center');

+

+

This will then give the graph shown in Figure 15.16. Adding and adjusting the position of the legend box (example6.php)

+

+

Figure 15.16. Adding and adjusting the position of the legend box (example6.php)

Adding and adjusting the position of the legend box (example6.php)


+

+

As a reminder we briefly discuss the working of the SetPos() + method.

+

The position is specified as a fraction of the overall width and height of the + entire graph. This makes it possible for to resize the graph without disturbing + the relative position of the legend. The second two arguments specifies the + anchor point in the legend box that should be aligned with the specified + position.

+

As can be seen in Figure 15.16. Adding and adjusting the position of the legend box (example6.php) the legends are by + default placed in a column. It is also possible to adjust this by calling either + the Legend::SetLayout() method or specifically set the number of + columns to use by calling Legend::SetColumns() . Lets change the + layout so the legend texts are set in one row and place the legend box at the + bottom of the graph. If we do this we get the result shown in Figure 15.17. Adjusting the layout of the texts in the legend box (example6.1.php)

+

+

Figure 15.17. Adjusting the layout of the texts in the legend box (example6.1.php)

Adjusting the layout of the texts in the legend box (example6.1.php)


+

+

As a final example lets combine what we have learnt up to now, i.e. adding + plot marks, adding multiple data series to the same graph and adding a legend + box into one example. In Figure 15.18. Using plot marks with several data series and a legend (builtinplotmarksex1.php) we have + in addition used the feature with "tabbed" titles which is an alternative way to + put titles on graph (as discussed in Formatting and specifying the titles of the graph).

+

+

Figure 15.18. Using plot marks with several data series and a legend (builtinplotmarksex1.php)

Using plot marks with several data series and a legend (builtinplotmarksex1.php)


+

+
+

Changing the style of the line plot - using the step-style

+ +

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 at that instance. This is also known as + "zero-order hold" (as compared with the first-order hold which is an alternative + name for combining each data point with a straight line). Enabling step stylöe + is done by calling the method

+

+

+

+

In Figure 15.19. Using the "Step style" for line plots (example6.2.php) we have enabled the step style for a + basic line graphs to illustrate this concept.

+

+

Figure 15.19. Using the "Step style" for line plots (example6.2.php)

Using the "Step style" for line plots (example6.2.php)


+

+
+

Optimizing line plot using "fast drawing"

+ +

For line plots with a large amount of data point that is drawn with a solid + line it is possible to speed up the construction of the graph by calling the method:

  • +

    LinePlot::SetFastStroke($aFlg=true)

    +
+

This will avoid some of the overhead associated with drawing lines of + arbitrary style. The limitations with this optimization is

+

+

  1. +

    Only solid lines, no styles on the lines are allowed (including no + step-style)

    +
  2. +

    No plot marks

    +
  3. +

    No value labels

    +
  4. +

    No area plot , i.e. no filled line graphs and no filled partial + areas

    +

+

+

For line plots with a large amount of data point the savings can be quite + substantially and in the order of 40-50% speedup.

+
+

Creating a filled line graphs (a.k.a. area plots)

+ +

A filled line plot (also known as an area plot) can be created in two ways + depending on whether automatic color handling is sufficient or there is a need + to manually specify the color.

+
  1. +

    Case 1: Using automatic fill + color

    +

    In this case there is only need to tell that we want t filled line + graph by calling the method

    +

    +

    • +

      LinePlot::SetFilled($aFlg=true)

      +

    +

    +

    The color assigned to the filled area will be set + automatically

    +
  2. +

    Case 2: Setting a manual fill + color

    +

    In this case the method called to set the fill color will make an + implicit call to SetFilled(). Setting the fill color is + done by the method

    +

    +

    • +

      LinePlot::SetFillColor($aColor)

      +

    +

    +

In Figure 15.20. A basic filled line graph (filledlineex01.php) a basic filled line + graph is shown which also have plot marks and an adjusted color so that the line + and the fill have different colors.

+

+

Figure 15.20. A basic filled line graph (filledlineex01.php)

A basic filled line graph (filledlineex01.php)


+

+

There are a couple of thing worth noting

+

+

  • +

    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.

    +
  • +

    When using legends with filled line plot the legend will show the + fill color and not the bounding line color.

    +
  • +

    The area filled is the area between the x-axis at y=0 and the data + value

    +
  • +

    By default the line color will be the same as the fill color. This + means that if a different line color is needed then the call to + LinePlot::SetColor() must be after the call to + LinePlot::SetFillColor()

    +
  • +

    Grid lines are by default drawn behind the plot (or rather the + plot is drawn on top of the plot area). However, this can be + adjusted so that the grid lines will always be on top of the line + plots. This is done by calling the method

    +

    +

    • +

      Graph::SetGridDepth($aDepth) where + $aDepth is either + DEPTH_BACK or DEPTH_FRONT + symbolic defines

      +

    +

    +

    An alternative way of handling this is to make the fill color + semi-transparent by setting the alpha-blending for the fill color. + See Specifying the alpha channel (color transparency) and Figure 15.18. Using plot marks with several data series and a legend (builtinplotmarksex1.php) above for a real + example. Just making this grid depth adjustments will give the + result shown in Figure 15.21. Having the grid line on top of a filled line plot (filledlineex01.1.php)

    +

    +

    Figure 15.21. Having the grid line on top of a filled line plot (filledlineex01.1.php)

    Having the grid line on top of a filled line plot (filledlineex01.1.php)


    +

    +

+

+

Tip

+

By default the fill is only done between y=0 and the line plot. In some + cases it might be useful to have the fill go all the way down to whatever + the minimum y-value is (for example if the x-axis is always positioned at + the minimum y-value). This can be accomplished by calling the method

+

+

  • +

    LinePlot::SetFillFromYMin($aFlg=true)

    +

+

+
+

Filling from the top

+ +

As was mentioned in the previous paragraph the fill normally goes from the + bottom and up to the line specified by the data series. Another variant is + to have the fill go from the top of the plot area down to the line.

+

There is primary one use for this type of fill and that is to create a + "mask" for a background image to make the illusion that the area below the + line is filled with the image while the area above the line is the normal + plot background.

+

This is done by first telling the library the fill shall be from the top + with a call to the method

+

+

  • +

    LinePlot::SetFillFromYMax($aFlg=true)

    +

+

+

then we create the data series as usual but specify the fill color as the + wanted background color and also add the image we want as a background + image.

+

Since we only want to use the first plot as a mask we can also specify the + line weight to 0 (to avoid the edge lines of the plot going from the first + and last point to the top. To have a nice line we can just add a second line + plot which is not filled and is just used to draw the line in our specified + color and weight.

+

An example of how this can look is shown in Figure 15.22. Creating the effect of an area fill with an image (lineimagefillex1.php) below which shows a fictive growth + in education which is illustrated with an old class room photography.

+

+

Figure 15.22. Creating the effect of an area fill with an image (lineimagefillex1.php)

Creating the effect of an area fill with an image (lineimagefillex1.php)


+

+

+

Tip

+

To have the grid lines on top of the area plot (so they are + visible since they are vy default drawn at the bottom) the depth of + the grid lines can be set with a call to the method

+

+

  • +

    Graph::SetGridDepth($aDepth)

    +

+

+

For example as in

+

+

1
+
$graph->SetGridDepth(DEPTH_FRONT);

+

+

+

+
+

Filling from 0 or from bottom

+ +

As a complement to what was described in the previous section it is also + possible to fill from the bottom. By default an area is filled from the + 0-line to the boundary of the data series as is shown in Figure 15.23. Filling from the 0-line (The default) (manualtickex3.php) below

+

+

Figure 15.23. Filling from the 0-line (The default) (manualtickex3.php)

Filling from the 0-line (The default) (manualtickex3.php)


+

+

By making a call to

+

+

  • +

    LinePlot::SetFillFromYMin($aFlg=true)

    +

+

+

The area will instead be filled from the bottom as is shown in Figure 15.24. Filling from the bottom (manualtickex4.php)

+

+

Figure 15.24. Filling from the bottom (manualtickex4.php)

Filling from the bottom (manualtickex4.php)


+

+

+

Note

+

In Figure 15.23. Filling from the 0-line (The default) (manualtickex3.php) and Figure 15.24. Filling from the bottom (manualtickex4.php) we have used gradient fill in + both the plot area and the amrgin area. This is a feature that was + introduced in free-version3.0.5 and in pro-version 3.1.3p

+

+

+
+

Using gradient fills

+ +

In addition to the solid color fill it is also possible to use gradient + fills for are graphs. To specify a gradient fill for a line graph the + following method in LinePlot class is used

+

+

  • +

    LinePlot::SetFillGradient($aFromColor,$aToColor,$aNumColors=100,$aFilled=true)

    +

    $aFromColor, $aToColor, The starting + and ending color

    +

    $aNumColors=100, The number of colors to use in + the transition between from and to color

    +

    $aFilled=true, Enable/disable gradient + filling

    +

+

+

Some examples of typical use of this is shown below

+

+

Figure 15.25. A basic gradient fill using default values (gradlinefillex1.php)

A basic gradient fill using default values (gradlinefillex1.php)


+

+

The following two examples shows the effect of changing the number of + intermediate colors that are used to get from the "from color" and to the + "to color".

+

+

+
+

Figure 15.26. Using the default number of intermediate colors (gradlinefillex2.php)

Using the default number of intermediate colors (gradlinefillex2.php)

+
+

Figure 15.27. Only using 4 colors in total between start and finish color (gradlinefillex3.php)

Only using 4 colors in total between start and finish color (gradlinefillex3.php)

+
+

+

+
+
+

Partially filled area graphs

+ +

In addition to filling the entire area between the line plot and the x-axis + (at y=0) the library also offers the possibility to add areas limited by the + line and a specified interval on the x-axis. Several such areas can be added and + each area having a different color. In ?? a basic example of how this can look + is shown.

+

+

Figure 15.28. Adding two partially filled areas to a line plot (partiallyfilledlineex1.php)

Adding two partially filled areas to a line plot (partiallyfilledlineex1.php)


+

+

The areas (one or more) are created by calling the method

+

+

  • +

    LinePlot::AddArea($aMin=0,$aMax=0,$aFilled=LP_AREA_NOT_FILLED,$aColor="gray9",$aBorder=LP_AREA_BORDER)

    +

    The extension of the area along the x-axis is given by the + $aMin and $aMax values.

    +

    The third argument specifies whether the area should be filled or + not. This argument can have the values

    +

    +

    • +

      LP_AREA_FILLED

      +
    • +

      LP_AREA_NOT_FILLED

      +

    +

    +

    The fourth argument specifies the fill color and the fifth + argument specifies if the area should have a border (edge) or not. + If the area has a border it will be the same color as the line. The + values for the fourth argument can be

    +

    +

    • +

      LP_AREA_BORDER

      +
    • +

      LP_AREA_NO_BORDER

      +

    +

    +

+

+
+

Filled lines with NULL values

+ +

The NULL value handling follows the same principle as was described for line + plots. If the NULL value is specified as '-' the line will be interpretated but + if it is specified as 'x' it will be broken up as is shown in Figure 15.29. Area plot with 'x' NULL values (filledlineex03.php)

+

+

Figure 15.29. Area plot with 'x' NULL values (filledlineex03.php)

Area plot with 'x' NULL values (filledlineex03.php)


+

+
+

Accumulated line graphs

+ +

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.

+

An accumulated graph plot is represented by class AccLinePlot + which is a container class for line plots. This means that the + AccLinePlot needs to be "fed" a number of ordinary instances of + LinePlot.

+

Any number of ordinary line graphs may be added together (up to the limit of + readability of the plot).

+

For example, to add three line plots in an accumulated line plot graph the + following code is needed

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php
+// 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 ); 
+?>

+

+

Using some random data for the areas can produce the result shown in Figure 15.30. A basic accumulated area plot (example17.php)

+

+

Figure 15.30. A basic accumulated area plot (example17.php)

A basic accumulated area plot (example17.php)


+

+
+

Accumulated line graphs with given X-labels

+ +

Creating an accumulated line plot, (or a filled accumulated area plot), with + multiple data sets at given x-coordinates poses some specific problems when the + coordinates for the different data sets are not given at the same x-coordinates. + This is a generic problem and has nothing to do with library in particular. This + section wil deal with one possible way of handling this by making sure that + missing data points are created if they are "missing".

+

To understand the problem we will make one simplifications (that is of no real + consequence for the end result) that can be stated as

+

+

  1. +

    the X-coordinates for all data tuples are whole positive number. +

    +
  2. +

    the X-coordinates are in sorted order (non-descending)

    +

+

+

The core issue can be illustrate as follows. Lets assume that we want to make + an accumulated graph showing the two data sets

+

+

data set 1 == (0,5), (2,10), (3,10), (5,20)
+data set 2 == (0,7), (1,12), (2,5),  (5,10)
+

+

+

In the above notation the tuple (0,5) means a data point with X-coordinate = 0 + and Y-coordinate = 5.

+

What the library now needs to do is to first plot data set 1. No problem. When + it then becomes time to plot the second data set we face an issue. The only + points where we now the Y-value of data set 1 is at the given discrete points + (0,2,3,5).

+

Plotting the first tuple for data set 2 shown above gives an absolute starting + point at

+

+

(0,5+7) == (0,12)
+

+

+

The next data point we know for data set 2 is (1,12) so we need to plot this. + But now we can see that we do not know the value for data set 1 at X-coordinate + = 1. We only know the values at coordinates 0 and 2. This gives us a problem. We + need to know at what offset we should plot this data point in data set 2 and we + have no direct way of calculating this.

+

Now, one might argue that we could just interpolate between the data points + (0,5) and (2,10) the Y-value at X=1 (doing a linear interpolation this would + give the data point (1,7.5)) so why doesn't the library simply do this? It + surely could be done.

+

+

Note

+

In real life using this approach would be much more complex. First of + all we need to create a linear succession of all X-values used in all + data sets to create an ordered set and then fill in the blanks so that + all data sets have values at all given X-coordinates. Those of you + familiar with signal processing will recognize this as an (almost) + up-sampling of the original data sets followed by a low pass filter. +

+

+

+

However, by design the library doesn't do this. The crucial observation here + is that it can not be a graphic libraries responsibility to "create" missing + data points by making assumption that a particular polynomial interpolation is + valid (in this case a first degree approximation). What if a linear + interpolation is not representative for the data set given? Perhaps a second + degree approximation would be more accurate.

+

So, this kind of data preparation must be done in the domain of the given data + set where knowledge of the underlying data will allow an accurate preparation of + the input to a graphing script if we insist of plotting an accumulated graph. + One could argue that accumulated data plots can only be done for data series + with the same X-coordinates.

+

Preparing the input data

+ +

So what if we are still required to do an accumulated plot even when we + don't have all the data sets at the same X-coordinates? Going back to our + original two data sets, hereafter referrered to as DS1 and DS2 there are 2 + manual steps (as described above) that needs to happen.

+

+

  1. +

    Identify all X-data points that needs to exist

    +
  2. +

    Create values for all data sets at those points

    +

+

+

So, in DS1 and DS2 the union of the two data sets X-coordinates are

+

+

X_coordinates == union(DS1_x, DS2_x) == 0,1,2,3,5
+

+

+

This will force us to augment the two data sets as

+

+

data set 1 == (0,5), (1,??), (2,10), (3,10), (5,20)
+data set 2 == (0,7), (1,12), (2, 5), (3,??), (5,10)
+

+

+

Where I have added '??' to indicate values that needs to be computed in + order to draw an accumulated line/area plot at specific values. Now assume + that we are able to find the missing data for these points by some method to + be

+

+

data set 1 == (0,5), (1, 8), (2,10), (3,10), (5,20)
+data set 2 == (0,7), (1,12), (2, 5), (3, 2), (5,10)
+

+

+

Are we now ready to plot these data sets? Unfortunately not quite. The + remaining problem is that since the library only handles accumulated plots + without a given X-coordinate (using an X-coordinate for the individual line + plots will have no affect - and it's behaviour is undefined). This means + that the data points are assumed to be equ-distance apart - and this is + almost true for the data sets above. There is 1 unit between theme apart + from the two last tuples which in fact have a distance of 2 units. In fact + the library only plots data sets with a given Y-coordinate and then assumes + that the x-coordinate is a linear ordering of (0,1,2, ..)

+

So in order to create a linear equ-distance ordered set we need to further + augment the two data sets as

+

+

data set 1 == (0,5), (1, 8), (2,10), (3,10), (4,??), (5,20)
+data set 2 == (0,7), (1,12), (2, 5), (3, 2), (4,??), (5,10)
+

+

+

So this means that we need to manually calculate another interpolated + value. If we know we can make a linear interpolation (or perhaps find the + data at this point) it will give us

+

+

data set 1 == (0,5), (1, 8), (2,10), (3,10), (4,15), (5,20)
+data set 2 == (0,7), (1,12), (2, 5), (3, 2), (4, 6), (5,10)
+

+

+

This final data set is now ready to be sent to the + AccLinePlot class. It is left as a (non-trivial) exercise + to the reader to define and implement a function that performs the steps + outlined above to create proper data sets before reading on.

+
+

Creating plots with non-trivial X-coordinates

+ +

With non-trivial X-coordinates we mean for example timestamps or perhaps + real numbers. For timestamps it is not so difficult. What we need to do is + to identify the proper interval (in the original timestamp domain) and then + create a mapping between that domain and the natural numbers (0,1,2,3,...).

+

The reason for this is that the library only accepts Y-coordinates as + argument to the accumulated data series and will make the implicit + assumption that when it plots the data it will plot the data points at + consecutive values as if the X-coordinates had been given as (0,1,2,3,..). + Hence we need to manually prepare the data to match this format.

+

As the final step we manually set the labels for the X-axis according to + our interpretation. An example (with some code snippets) will make this + approach clear.

+

Example - using timestamps

+

Assume we have the two data sets with timestamps

+

+

DS1 == (1212199200,12), (1212210000,20), (1212213600,30)
+DS1 == (1212199200,12), (1212206400, 8)
+

+

+

and we now that the sampling interval between the data points are 7200s + (=2 min). Following the same principle as above we need to find the + additional values

+

+

DS1 == (1212199200,12), (1212206400,??), (1212210000,20), (1212213600,30)
+DS1 == (1212199200,12), (1212206400, 8), (1212210000,??), (1212213600,??)
+

+

+

further assuming that we (by some method) can find these value we can then + interpret this data as

+

+

DS1 == (1212199200,12), (1212206400,16), (1212210000,20), (1212213600,30)
+DS1 == (1212199200,12), (1212206400, 8), (1212210000, 0), (1212213600, 0)
+

+

+

In the above we have made the explicit assumption that unknown data points + at the end can be interpretated as 0 in this particular application.

+

We now have an ordered sequence of these tuples and we can imagine a + mapping that will allow us to write these sequences as

+

+

DS1 == (0,12), (1,16), (2,20), (3,30)
+DS1 == (0,12), (1, 8), (2, 0), (3, 0)
+

+

+

The mapping for this is xi=1212199200 + 7200*i, i=0..3 which + we use when we put the final labels in the graph.

+

The only steps that remain to handle timestamps is to manually replace the + X-scale (which in this case would be 0,1,2,3) with the calculated values + according to the mapping given above.

+

We do this by creating an array of the timestamps we need to plot and then + replace them - in situ - with an application of the standard PHP function + array_walk() which applies a user defined function to each + value in an array and replaces that value with the return value of the user + function. In this case we create a user function that implements the mapping + stated above with the additional twist that given an argument as a time + stamp it returns a suitable human format for that time stamp.

+

The following code fragments shows how this could be done

+

+

1
+2
+3
+4
+5
+6
+7
+8
+
// Some userdefined human readable version of the timestamp
+function formatDate(&$aVal) {
+    $aVal = date('Y-m-d H:i',$aVal);
+}
+ 
+$timeStamps = array(212199200,1212206400,1212210000,1212213600);
+ 
+array_walk($time,'formatDate');

+

+

when we now have the labels in a nice human readable format we can put + them on the scale labels with

+

+

1
+2
+
$graph->xaxis->SetTickLabels($timeStamps);
+$graph->xaxis->SetLabelAngle(90);

+

+

though strictly not necessary we have also tilted the labels 90 degrees in + order to minimize the risk the labels overwrite each other.

+

If we still think that the labels are too close together ea we can chose + to only label every second tick mark. We do this with a call to

+

+

1
+
$graph->xaxis->SetTextLabelInterval(2);

+

+

Example using real (i.e. floating point) + x-coordinates

+

In principle this is handled in the same way as what we shown above for + timestamps. The additional complexity here spells rounding errors. When we + establish the equidistant interval between each data point it will be a real + number, potentially an irrational number, which means that we cannot + represent it exactly and adding the interval repeated times might cause + rounding errors if we are not careful.

+

Secondly we need to find a mapping between the ordered sequence of the + real numbers we have as X-coordinates and the natural numbers which are the + implicit X-coordinates assumed by the library.

+
+

A full example

+ +

In the example below we artifically create some data sets where all the + sets have values at all specified timestamps with the following code

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
<?php
+//Create some test data
+$xdata = array();
+$ydata = array();
+ 
+// Timestamps - 2h (=7200s) apart starting 
+$sampling = 7200;
+$n = 50; // data points
+ 
+// Setup the data arrays with some random data
+for($i=0; $i < $n; ++$i ) {
+    $xdata[$i] = time() + $i * $sampling;
+    $ydata[0][$i] = rand(12,15);
+    $ydata[1][$i] = rand(100,155);
+    $ydata[2][$i] = rand(20,30);
+}
+?>

+

+

Since the xdata array is given as timestamps we need to make this more + human readable by converting the timestamp using the date() + function. To do this we create an axillary helper function and then use the + array_walk() standard array function to apply this + formatting to all existing values in the timestamp array as follows.

+

+

1
+2
+3
+4
+5
+6
+7
+
// Formatting function to translate the timestamps into human readable labels
+function formatDate(&$aVal) {
+    $aVal = date('Y-m-d H:i',$aVal);
+}
+ 
+// Apply this format to all time values in the data to prepare it to be display
+array_walk($time,'formatDate');

+

+

The core of the script can now be written. For a change we make some + adjustment from the default values of colors and tick mark positioning as a + reminder that there is a lot of flexibility in creating the graphs.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php
+// Create the graph. 
+$graph  = new Graph(700, 400);
+$graph->title->Set('Accumulated values with specified X-axis scale');
+$graph->SetScale('datlin');
+ 
+// Setup margin color
+$graph->SetMarginColor('green@0.95');
+ 
+// Adjust the margin to make room for the X-labels
+$graph->SetMargin(40,30,40,120);
+ 
+// Turn the tick marks out from the plot area
+$graph->xaxis->SetTickSide(SIDE_BOTTOM);
+$graph->yaxis->SetTickSide(SIDE_LEFT);
+ 
+$p0 =new LinePlot($a);
+$p0->SetFillColor('sandybrown');
+$p1 =new LinePlot($b);
+$p1->SetFillColor('lightblue');
+$p2 =new LinePlot($c);
+$p2->SetFillColor('red');
+$ap = new AccLinePlot(array($p0,$p1,$p2));
+ 
+$graph->xaxis->SetTickLabels($time);
+$graph->xaxis->SetTextLabelInterval(4);
+ 
+// Add the plot to the graph
+$graph->Add($ap);
+ 
+// Set the angle for the labels to 90 degrees
+$graph->xaxis->SetLabelAngle(90);
+ 
+// Send the graph back to the browser
+$graph->Stroke();
+?>

+

+

The resulting image will now look something like what is shown in + ??

+

+

Figure 15.31. Area plot with specified x coordinates (prepaccdata_example.php)

Area plot with specified x coordinates (prepaccdata_example.php)


+

+
+

Helper function to create interpolated data

+ +

The function InterpolateData() below takes two array of + arrays and one integer as arguments. The first array of arrays contains the + X-coordinates for each data set and the second array of arrays contains the + Y-coordinates for all the data sets. The final integer argument is the + distance (or sample rate) that should be assumed between each X-coordinate.

+

The function will return a tuple. The first element in the returned tuple + is a single array with all the X-values that should be used and the second + element is an array of arrays with all the Y-data sets with all data + specified for each X-coordinate. Any missing Y values are interpolated using + a linear interpolation schema.

+

So using our first example above as demonstration this would be handled as

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
<?php
+$datax = array( 
+    array(0,2,3,5),
+    array(0,1,2,5));
+ 
+$datay = array(
+    array(5,10,10,20),
+    array(7,12,5,10));
+ 
+list($datax, $datay) = InterpolateData($datax, $datay);
+ 
+// $datax = array(0,1,2,3,4,5)
+// $datay = array( array(5, 8,10,10,15,20),
+//                 array(7,12, 5, 2, 6,10));
+?>

+

+

One possible implementation of this function is given below. It has + primarily been written for clarity and not necessary high performance. To + interpolate the "missing" Y-values a linear approximation is assumed.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
<?php
+function InterpolateData($aXData,$aYData,$aSampleInterval=1) {
+ 
+    // First do some sanity checks on the input data
+    $nx = count($aXData);
+    $ny = count($aYData);
+    if( $nx != $ny )
+        return array(false,-1);
+        
+    for( $i=0; $i < $nx; ++$i ) {
+         if( count($aXData[$i]) != count($aYData[$i]) )
+             return array(false,-2);
+    }
+ 
+    // Create the sorted union of all X-coordinates
+    $unionx = array_union($aXData);
+    $length = count($unionx);
+ 
+    // We now have to make sure that the distance between all
+    // X-coordinates is 1 unit of the sample interval. If not
+    // we will have to insert suitable X-value
+    $i=1;
+    while( $i < $length ) {
+            $missing = 0;
+            $diff = $unionx[$i] - $unionx[$i-1];
+            if( $diff != $aSampleInterval ) {
+ 
+            // Sanity check to make sure sample interval is an even multiple
+            // of the distance between the gven X-coordinates
+            if( $diff % $aSampleInterval !== 0 ) {
+              return array(false,-4);
+            }
+ 
+                $missing = $diff / $aSampleInterval - 1;
+                $fill = array();
+                for( $j=0; $j < $missing; ++$j ) {
+                        $fill[$j] = $aSampleInterval*($j+1)+$unionx[$i-1];
+                }
+                $unionx = array_merge(
+                        array_slice($unionx,0,$i),$fill,array_slice($unionx,$i));
+             }
+             $i += $missing+1;
+             $length += $missing;
+    }    
+ 
+    if( $length != count($unionx) ) {
+        // Internal error check
+        return array(false,-3);
+    }
+ 
+    // Now loop through all the individual data sets and find out 
+    // which x-data is missing and hence needs to be interpolated
+    $n = count($aXData);
+ 
+    for( $i=0; $i < $n; ++$i ) {
+            $missing_values = array_diff($unionx, $aXData[$i]);
+ 
+            // Now find the position of each missing X-coordinate
+            // and use that position in the corresponding Y array
+            // to insert an interpolated value
+            $m = count($missing_values);
+            foreach( $missing_values as $key => $val ) {
+                $idx = array_search($val,$unionx);
+ 
+                // Now split the Y-array at that position and insert
+                // a new sentinel value
+                if( $idx >= 0 ) {
+                        $aYData[$i] = array_merge(
+                            array_slice($aYData[$i],0,$idx),
+                            array(NULL),
+                            array_slice($aYData[$i],$idx));
+                }
+            }
+ 
+            // The next step is to actually calculate an interpolated value
+            // for the Y-coordinates we don't have. As a special case any
+            // beginning or ending non-defined coordinates are set to 0
+    
+            // Set all beginning NULL to 0
+            for( $j=0; $j < $length; ++$j ) {
+                if( $aYData[$i][$j] !== NULL )
+                        break;
+                $aYData[$i][$j] = 0;
+            }
+ 
+            // Set all ending NULL to 0
+            for( $j=$length-1; $j >= 0; --$j ) {
+                if( $aYData[$i][$j] !== NULL )
+                        break;
+                $aYData[$i][$j] = 0;
+            }
+ 
+            // Calculate the remaingin missing values as a linear
+            // interpolation and keeping in mind that there might be
+            // multiple missing values in a row.
+            $j = 0;
+            while($j < $length ) {
+                if( $aYData[$i][$j] === NULL ) {
+                        // How many unknown values in a row?
+                        $cnt = 1;
+                        while( $j+$cnt < $length && $aYData[$i][$j+$cnt]===NULL ) {
+                            ++$cnt;
+                        }
+        
+                        if( $cnt == 1 ) {
+                            $aYData[$i][$j] = ($aYData[$i][$j-1]+$aYData[$i][$j+1])/2;
+                        }
+                        else {
+                            $step = ($aYData[$i][$j+$cnt] - $aYData[$i][$j-1])/($cnt+1);
+                            for( $k=1; $k <= $cnt; ++$k ) {
+                                    $aYData[$i][$j+$k-1] = $step*$k+$aYData[$i][$j-1];
+                            }
+                        }
+                }
+                ++$j;
+            }
+    }
+ 
+    return array($unionx,$aYData);
+}
+ 
+ 
+//------------------------------------------------------------------------
+// Helper function to create the union of two arrays
+//------------------------------------------------------------------------
+ 
+// Create the sorted union of all numeric arrays given as argument
+function array_union($a) {
+ 
+    $n = count($a);
+    $res = $a[0];
+    for( $i=1; $i < $n; ++$i) {
+            $res = _array2_union($res,$a[$i]);
+    }
+    sort($res);
+    return $res;
+};
+ 
+// Return the union between two numeric arrays
+function _array2_union($a,$b) {
+ 
+    if( $a == NULL ) return $b;
+    if( $b == NULL ) return $a;
+ 
+    // A standard "trick" to calculate the union of two arrays
+    return array_merge(
+            array_intersect($a,$b),
+            array_diff($a, $b),
+            array_diff($b, $a));
+}
+?>

+

+
+
+

Constructing smooth line plots with Cubic Splines

+ +

The library support interpolation between data point by the use of cubic + splines. This will make the implicit assumption that the underlying phenomenon + that is plotted can be represented by a 3:rd degree polynomial between the given + data points (also known as a control points).

+

Cubic splines have the property that the constructed line will pass through + all control points given.

+

To construct a spline you both the X and Y coordinates for the known data + points are needed since the library can make no assumption on the step size + between the data points.

+

The cubic spline functionality in the library is encapsulated in the + class Spline which is define the module + "jpgraph_regstat.inc.php" which must be added to the + included files in the script.

+

The first step is to construct new Spline instance. This class is instantiated + by calling the constructor with the two known data arrays (X and Y) as + follows.

+

+

1
+
$spline = new Spline( $xdata , $ydata );

+

+

This call initializes the spline with the data points given. 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. These new value are then used to make + the actual line plot. This way gives great flexibility in how to use the + interpolated data points.

+

To get the y- and x-axis data to be plotted we call the method + Spline::Get() to get an interpolated array containing a + specified number of points. So for example the line

+

+

1
+
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 points we specified when we created the + '$spline' object. These data arrays are then used to make the + actual plot just as for a "standard" plot. In Figure 15.32. Constructing a smooth spline curve from 8 control points (splineex1.php) we have used 8 control points to construct a spline.

+

+

Figure 15.32. Constructing a smooth spline curve from 8 control points (splineex1.php)

Constructing a smooth spline curve from 8 control points (splineex1.php)


+

+

In order to make the example more interesting we actually used two plots. + First a line plot to get the smooth curve and then a standard scatter plot + (discussed later in this manual) which is used to illustrate where the control + points are situated.

+

+

Note

+

The library also support the construction of Bezier curves which is built on a similar concept of + constructing a smooth line from a number of control points, The biggest + difference between cubic splines and Bezier curves is that while a cubic + spline is always guaranteed to pass through all control point a Bezier + curve will in general not pass through any control points. Instead the + Bezier control point are outside the curve and affects the curvature of + the curve. Bezier type curves are not in general used together with data + visualization but are instead used to create specific curves, usually + for CAD and 3D graphic purposes. In the discussion of Canvas graphs, see + Canvas graphs, we discuss this + further.

+

+

+
+
+ + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s02.html b/includes/jpgraph/docs/chunkhtml/ch15s02.html new file mode 100644 index 0000000..4853ffd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s02.html @@ -0,0 +1,604 @@ +Bar graphs

Bar graphs

+ +

The library supports 2D vertical and horizontal bar plots as was shown in the + introduction section . To use bar plots the bar plot module + "jpgraph_bar.php" must be included in the script.

+

There are eight fundamental types of bar graphs supported by the library. Examples + of the available types are shown in Figure 15.33. Different types of supported bar graphs

+

+

Figure 15.33. Different types of supported bar graphs

+ +
+
+

Different types of supported bar graphs

+

a) Vertical + bar

+
+

Different types of supported bar graphs

+

b) Horizontal + bar

+
+

Different types of supported bar graphs

+

c) Vertical + accumulated bar

+
+

Different types of supported bar graphs

+

d) Horizontal + accumulated bar

+
+

Different types of supported bar graphs

+

e) Vertical group + bar

+
+

Different types of supported bar graphs

+

f) Horizontal group + bar

+
+

Different types of supported bar graphs

+

g) Vertical group + accumulated bar

+
+

Different types of supported bar graphs

+

h) Horizontal group + accumulated bar

+
+
+


+

+

Using bar plots is straightforward and works in much the same way as line plots as + was discussed in the previous sections.

+

An instance of class BarPlot is created with the wanted data and is + then either added directly to the graph to create a basic bar plot or is enclosed in + with one of the container classes AccBarPlot or + GroupBarPlot which are then added to the graph.

+

There is however one crucial change that is usually made. The x-scale is usually + specified as a "text" type scale. The reasons this are primarily + two

+

+

  1. +

    to get the alignment of the labels to be between the tick marks and + not at the tick marks as is normal for line plots

    +
  2. +

    to get the bars to be aligned at the center between the tick + marks

    +

+

+

The following two examples shows the difference between using an integer scale in + Figure 15.34. Using "int" scale for the x-axis (example19.1.php) and a text sale in Figure 15.35. Using "text" scale for the x-axis (example19.php)

+

+

+
+

Figure 15.34. Using "int" scale for the x-axis (example19.1.php)

Using "int" scale for the x-axis (example19.1.php)

+
+

Figure 15.35. Using "text" scale for the x-axis (example19.php)

Using "text" scale for the x-axis (example19.php)

+
+

+

+

As can be seen in Figure 15.34. Using "int" scale for the x-axis (example19.1.php) the bars have there left + edge aligned with the data value and the tick mark (the tick mark can not be seen + since it is aligned exactly with the left edge of the bar). In contrast using a text + scale in Figure 15.35. Using "text" scale for the x-axis (example19.php) adjusts the alignment of tick marks and + labels in a way that is more commonly used with bar graphs.

+

Some other commonly used method to change the appearance of the bar graphs + are

+

+

  • +

    BarPlot::SetFillColor($aColor)

    +

    This is used to specify the fill color of the bar. The argument can + also be an array and in that case each color in the array is used for + individual successive bars.

    +
  • +

    BarPlot::SetFillGradient($aFromColor,$aToColor=null,$aStyle=null)

    +

    Specifies a gradient fill style for the bars. See ?? for + details.

    +
  • +

    BarPlot::SetPattern($aPattern, $aColor='black')

    +

    Specifies a pattern to be used to fill the bars. See ?? for + details

    +
  • +

    BarPlot::SetWidth($aWidth)

    +

    Specifies the width of the individual bars. Of this is an integer + value > 1 it is interpretated as the absolute width in pixels. If the + values instead is a real number in the range [0,1] it is interpretated + as the fraction of the width between the tick marks. By default the + width is set to 0.4

    +

+

+

Accumulated bar plots

+ +

Accumulated bar plots will show several data series stacked on top of each + other in each bar. They are the barplot variant of accumulated area plots as was + discussed previously.

+

An accumulated bar plot is made by aggregating one or more basic bar plots in + the container class AccBarPlot as the following code snippet + shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
<?php
+// Some data
+$data1y = ...
+$data2y = ...
+ 
+// Create two bar plots
+$b1plot = new BarPlot($data1y);
+$b1plot->SetFillColor('orange');
+$b2plot = new BarPlot($data2y);
+$b2plot->SetFillColor('blue');
+ 
+// Create the accumulated bar plot
+$gbplot = new AccBarPlot(array($b1plot,$b2plot));
+ 
+// Add the accumulated plot to the graph
+$graph->Add($gbplot);
+?>

+

+

An example of an accumulated bar plot is shown in Figure 15.36. An accumulated bar plot (example23.php)

+

+

Figure 15.36. An accumulated bar plot (example23.php)

An accumulated bar plot (example23.php)


+

+

There are some subtleties when it comes to the formatting of the frames a + round each bar in an accumulated bar plots that might be useful to know. The + basic ambiguity that exists is that when we stack the bars on top of each other + to create a new accumulated bar each individual bar has properties that was (or + could) be set when each individual barplot was created like the frame around the + plot.

+

For example, take the following basic accumulated bar plot (partial + script)

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
<?php
+// Create the first bar
+$bplot = new BarPlot($datay1);
+$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
+$bplot->SetColor('darkred');
+ 
+// And the second bar
+$bplot2 = new BarPlot($datay2);
+$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
+$bplot2->SetColor('darkgreen');
+ 
+// Join them in an accumulated (stacked) plot
+$accbplot = new AccBarPlot(array($bplot,$bplot2));
+$graph->Add($accbplot);
+?>

+

+

As you can see on line 5 and on line 10 we have set the frame color + differently in the two individual plots. However, the accumulated bar plot also + have a frame color property (and a weight as well) so what shall we use? If we + run a full example based on the lines above the result is shown in Figure 15.37. Accumulated bar with individual frame colors (accbarframeex01.php) below.

+

+

Figure 15.37. Accumulated bar with individual frame colors (accbarframeex01.php)

Accumulated bar with individual frame colors (accbarframeex01.php)


+

+

As can be seen from the graph the bar around each part has the color on th + frame that was set on the individual bar. There is one exception though. The + line that separates the two bars are shared and will always follow the color of + the top bar.

+

If we instead specify a frame for the accbar by adding the lines

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$accbplot = new AccBarPlot(array($bplot,$bplot2));
+$accbplot->SetColor('red');
+$accbplot->SetWeight(1);
+$graph->Add($accbplot);
+?>

+

+

The result would be as is shown in Figure 15.38. Accumulated bar with unit frame color (accbarframeex02.php) + and the properties of the accumulated bar takes precedence, again with one + exception. The divider lines inside the bar is still controlled by the + individual plot. By default the line weight on the accumulated bar is 0 which + means that it will not be drawn, that is why we have to set a line weight on + line 4 above.

+

+

Figure 15.38. Accumulated bar with unit frame color (accbarframeex02.php)

Accumulated bar with unit frame color (accbarframeex02.php)


+

+

If we instead were to set the individual line weight to zero, i.e.

+

+

1
+2
+3
+4
+
<?php
+$bplot->SetWeight(0);
+$bplot2->SetWeight(0);
+?>

+

+

and keep the overall frame the result would become as shown in Figure 15.39. Setting individual frames to weight=0 (accbarframeex03.php) below

+

+

Figure 15.39. Setting individual frames to weight=0 (accbarframeex03.php)

Setting individual frames to weight=0 (accbarframeex03.php)


+

+
+

Grouped bar plots

+ +

This uses the same principle as accumulated bar plots but instead of stacking + the data series on top of each other they are shown together for the same + x-value.

+

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 (or between if a text scale is + used). A grouped bar is created by aggregating two or more ordinary bar plots + and creating a GroupBarPlot +

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+// Some data
+$data1y = ...
+$data2y = ...
+ 
+// 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 ));
+ 
+// Add it to the graph
+$graph->Add ( $gbplot ); 
+?>

+

+

An example of this is shown in Figure 15.40. A grouped bar plot (example21.php)

+

+

Figure 15.40. A grouped bar plot (example21.php)

A grouped bar plot (example21.php)


+

+

If the SetWidth() method is used on the + GroupBarPlot() it 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% of the width between the tick marks in the + graph. In Figure 15.41. Adjusting the width of a group bar plot (example22.php) an example where the width is set + to 90% is shown.

+

+

Figure 15.41. Adjusting the width of a group bar plot (example22.php)

Adjusting the width of a group bar plot (example22.php)


+

+

The number of data points in each data series must be the same. This means + that if there are no available values they should be specified as 0. An example + of this is shown in Figure 15.42. All data series in a grouped bar graph must have the same number of data points (groupbarex1.php)

+

+

Figure 15.42. All data series in a grouped bar graph must have the same number of data points (groupbarex1.php)

All data series in a grouped bar graph must have the same number of data points (groupbarex1.php)


+

+
+

Grouped accumulated bar graphs

+ +

It is perfectly possible to combine the previous bar types to have a grouped + accumulated bar plot. This is done in a similar way by aggregating a number of + accumulated plots in a group bar plot. The following code snippte shows how this + can be done

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php
+// 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 ));
+ 
+// Add the combination to the graph
+$graph->Add( $gbplot ); 
+?>

+

+

An example of this is shown in Figure 15.43. A grouped accumulated bar graph (example24.php) + below

+

+

Figure 15.43. A grouped accumulated bar graph (example24.php)

A grouped accumulated bar graph (example24.php)


+

+
+

Horizontal bar graphs

+ +

If a large number of values to needs to be display in a bar graph it is often + better to rotated the bar graph 90 degree so that the bars are horizontal + instead. There is no special graph type for this so this is achieved by rotating + a standard vertical bar graph 90 degrees, usually with a call to

+

+

  • +

    Graph::Set90AndMargin()

    +

+

+

The orientation of the labels of the axis will be automatically adjusted for + bar graphs. A basic example is shown in Figure 15.44. A basic horizontal bar graph (horizbarex1.php) + below

+

+

Figure 15.44. A basic horizontal bar graph (horizbarex1.php)

A basic horizontal bar graph (horizbarex1.php)


+

+

The example in Figure 15.45. Using multiple line labels in a horizontal bar graph (horizbarex4.php) shows how to use multiple + lines as labels.

+

+

Caution

+

Note that we have to use quotation marks (") and not hyphens (') in + text string where we want to embed a newline character, i.e. "\n"

+

+

+

+

Figure 15.45. Using multiple line labels in a horizontal bar graph (horizbarex4.php)

Using multiple line labels in a horizontal bar graph (horizbarex4.php)


+

+
+

Adjusting the appearance of bar graphs

+ +

+

Adjusting the width and colors

+ +

The width of each individual bar can be specified in either an absolute + pixel size or as a fraction of the width between the major tick marks. The + method used for this is

+

+

  • +

    BarPlot::SetWidth($aWidth)

    +

    If $aWidth is an integer > 1 then it is + interpretated as an absolute width in pixels. If it is a + floating point number in the range [0,1] it will be + interpretated as a fraction of the width between the tick + marks.

    +

+

+

+
+

Using gradient fill

+ +

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. The library currently supports 8 different styles. All supported + styles are displayed in Figure 15.46. Supported gradient fills for bar plots + below.

+

+

Figure 15.46. Supported gradient fills for bar plots

+ +
+
+

Figure 15.47. GRAD_MIDVER (bargradsmallex1.php)

Supported gradient fills for bar plots

+
+

Figure 15.48. GRAD_MIDHOR (bargradsmallex2.php)

Supported gradient fills for bar plots

+
+

Figure 15.49. GRAD_HOR (bargradsmallex3.php)

Supported gradient fills for bar plots

+
+

Figure 15.50. GRAD_VER (bargradsmallex4.php)

Supported gradient fills for bar plots

+
+

Figure 15.51. GRAD_WIDE_MIDVER (bargradsmallex5.php)

Supported gradient fills for bar plots

+
+

Figure 15.52. GRAD_WIDE_MIDHOR (bargradsmallex6.php)

Supported gradient fills for bar plots

+
+

Figure 15.53. GRAD_CENTER (bargradsmallex7.php)

Supported gradient fills for bar plots

+
+

Figure 15.54. GRAD_RAISED_PANEL (bargradsmallex8.php)

Supported gradient fills for bar plots

+
+
+


+

+

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.

+

+

Caution

+

Gradient filling is computational expensive. Large plots with + gradient fill will take in the order of 6 times longer to fill then + for a normal one-color fill. This might to some extent be helped by + making use of the cache feature of JpGraph so that the graph is only + generated a few times.

+

+

+

As a final example we show an horizontal bar graph with gradient fill on + both the background and the bars in Figure 15.55. Horizontal bar graph with gradient fill (horizbarex6.php) +

+

+

Figure 15.55. Horizontal bar graph with gradient fill (horizbarex6.php)

Horizontal bar graph with gradient fill (horizbarex6.php)


+

+
+

Using pattern fills

+ +

As an alternative to solid and gradient fill the bars can also have a + number of patterns. This is useful for the case where black and white copies + needs to be printed. The library supports the following nine different + patterns as shown in Figure 15.56. Supported pattern fills for bar plots

+

+

Figure 15.56. Supported pattern fills for bar plots

+ +
+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+

Supported pattern fills for bar plots

+
+
+


+

+

To specify a pattern to be used the following method is used

+

+

  • +

    BarPlot::SetPattern($aPattern,$aColor='black')

    +

    $aPattern is one of the symbolic names as shown + in Figure 15.56. Supported pattern fills for bar plots If + $aPattern is an array then each specified + pattern will be used successively for each individual bar. If + there are more bars then pattern specified then pattern used + will be wrapped around.

    +

+

+
+

Displaying and formatting the value of the bar

+ +

In the same way as values could be displayed on line plots they can also + be displayed on bar graphs. The formatting options for bar graphs, apart + from the basic font,color and angle, also allows the specification on where + on the bar the values should be displayed. This can be

+
  • +

    at the bottom of the bar, "bottom"

    +
  • +

    at the middle of the bar, "middle"

    +
  • +

    at the maximum value (but still inside the bar). + "max"

    +
  • +

    at the top of the bar (outside the bar), + "top"

    +

The position is adjusted with a call to

+

+

  • +

    BarPlot::SetValuePos($aPos)

    +

+

+

using one of the above strings as value.

+

The value of the bar is enabled and controlled by accessing the "value" + property of the bar plot. The following line will enable the value (this is + done in exactly the same way as for line plots)

+

+

1
+
$barplot->value->Show();

+

+

By default the value is displayed at the top of the bar. In the same way + as for line plot it is possible to adjust the formatting of the data labels + by both using a format callback function as well as statically adjusting the + format, for example the angle of the label.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
// Callback function
+function separator1000_usd($aVal) {
+    return '$'.number_format($aVal);
+}
+ 
+// Must use TTF fonts if we want text at an arbitrary angle
+$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
+$bplot->value->SetAngle(45);
+$bplot->value->SetFormatCallback('separator1000_usd');
+ 
+// Black color for positive values and darkred for negative values
+$bplot->value->SetColor('black','darkred');
+$graph->Add($bplot);

+

+

There is one thing to take notice of here. The color of the label can be + different depending on whether the bar has a positive or a negative + value.

+

An example of using these formatting options for a bar graph is shown in + Figure 15.57. Using a callback to format the labels on a bar (barscalecallbackex1.php)

+

+

Figure 15.57. Using a callback to format the labels on a bar (barscalecallbackex1.php)

Using a callback to format the labels on a bar (barscalecallbackex1.php)


+

+
+

Adding a drop shadow to the bars

+ +

Each bar can also have a drop shadow. This is enabled by calling

+

+

  • +

    BarPlot::SetShadow($aColor="black",$aHSize=3,$aVSize=3,$aShow=true)

    +

    $aColor, The color of the drop shadow

    +

    $aHSize, Horizontal size of the shadow

    +

    $aVSize, Vertical size of the shadow

    +

    $aShow, true = enable the + shadow

    +

+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s03.html b/includes/jpgraph/docs/chunkhtml/ch15s03.html new file mode 100644 index 0000000..1486872 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s03.html @@ -0,0 +1,71 @@ +Error plot graphs

Error plot graphs

+ +

Error plots are used to visually indicate uncertainty in data points. This is done + by specifying both a min and and max value for each data point.

+

Before error plots can be used the module "jpgraph_error.php" + must be included.

+

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 instance of the ErrorPlot class in + much the same way as, for example, a normal line plot.

+

+

Figure 15.58. A basic error plot (example13.php)

A basic error plot (example13.php)


+

+

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 we can use the method ErrorPlot::SetCenter() which + will adjust the x-scale so it does not use the full width of the X-axis.

+

+

Figure 15.59. Making use of SetCenter() with error plots (example14.php)

Making use of SetCenter() with error plots (example14.php)


+

+

+

Line error plots

+ +

A variant of the error plot graph is to use an LineErrorPlot + instead. This is almost the same as the ErrorPlot but with the + added feature that each data point also has an middle value which a line is + drawn through. This can be thought of as a line plot combined with an error + plot.

+

Since this also uses a line the module "jpgraph_line.php" + must be included in addition to the error module.

+

To control the various properties of the line drawn the "line" property of the + error line plot may be accessed. So, for example, to set the line to have weight + of 2 pixels wide and with a blue color the following two lines are needed

+

+

1
+2
+3
+4
+
<?php
+$elplot->line->SetWeight ( 2 );
+$elplot->line->SetColor ( 'blue' ); 
+?>

+

+

An example of this is shown in Figure 15.60. A basic Line error plot (example15.php) . We could + now also add a legend to none, one or both of the line types(the plain line + and/or the error bar). So for example if we wanted the legend "Min/Max" for the + red error bars and a legend "Average" for the blue line the following lines + should be added

+

+

1
+2
+3
+4
+
<?php
+$errplot->SetLegend ( 'Min/Max' );
+$errplot->line->SetLegend ( 'Average' ); 
+?>

+

+

The result is shown in Figure 15.61. A line error plot with a legend (example16.php)

+

+

+
+

Figure 15.60. A basic Line error plot (example15.php)

A basic Line error plot (example15.php)

+
+

Figure 15.61. A line error plot with a legend (example16.php)

A line error plot with a legend (example16.php)

+
+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s04.html b/includes/jpgraph/docs/chunkhtml/ch15s04.html new file mode 100644 index 0000000..aa7deda --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s04.html @@ -0,0 +1,104 @@ +Stock graphs

Stock graphs

+ +

Stock charts are 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).

+

Stock plots are created as an instance of class StockPlot so the + module "jpgraph_stock.php" must first be included in the + script.

+

Figure 15.62. A stock graph (stockex1.php) illustrates a sample Stock chart plot

+

+

Figure 15.62. A stock graph (stockex1.php)

A stock graph (stockex1.php)


+

+

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 each bar as shown in ??.

+

+

+
+

Figure 15.63. Explaining stock graphs

+ +

+ Explaining stock graphs +

+

+
+

For this type of plot the y-data array must be consist of + a number of quadruples of data where each quadruple consists + of an even number 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 each bar as shown in + Figure 15.63. Explaining stock graphs.

+

Note that the data follows the rules

+

+

  • +

    min < max

    +
  • +

    min < min( open, close )

    +
  • +

    max > max( open, close )

    +

+

+
+

+

+

To separate the two cases where "open > close" or "open < close " two different + colors are used.

+

These colors are specified with the method

+

+

  • +

    StockPlot::SetColor($aFrame, $aFill='white', + $aFrameNeg='darkred', $aFillNeg='darkred')

    +

    $aFrame, $aFill, The frame and fill color + when open <= close

    +

    $aFrameNeg, $aFillNeg, The frame and fill + color when open > close

    +

+

+

StockPlot::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.

+

The final possible variation of stock plots is the option 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

+

+

  • +

    StockPlot::HideEndLines($aHide=true)

    +

+

+

Stock plot variant: Boxplot

+ +

A minor variation of stock charts is the BoxPlot plot type. this + is almost the same as StockPlot but with the very small difference + that in addition to the open,close,min, max values it is also possible to + specify a fifth, median value .

+

A box plot is created as in instance of class BoxPlot which is + defined in "jpgraph_stock.php"

+

The median lies between the open and close value and is illustrated as a + horizontal line within the bar. An example of this is shown in

+

+

Figure 15.64. A typical boxplot (boxstockex1.php)

A typical boxplot (boxstockex1.php)


+

+

The color of the median line can be modified with a call to

+

+

  • +

    BoxPlot::SetMedianColor($aColor)

    +

+

+
+

Image maps for Box and Stock charts

+ +

In the same way as for other plots it is possible to 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 the method

+

+

  • +

    BoxPlot::SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='')

    +

+

+

is used to set the URL:s for the hot areas

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s05.html b/includes/jpgraph/docs/chunkhtml/ch15s05.html new file mode 100644 index 0000000..0db4253 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s05.html @@ -0,0 +1,482 @@ +Scatter graphs

Scatter graphs

+ +

Scatter plots are used to display a number of data points given by there x- and + y-coordinate. The difference from a line plot is that the x-coordinate must always + be specified. 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.

+

To use a scatter plot the module "jpgraph_scatter.php" must + first be included in the script.

+

+

Note

+

Carefully reviewing the constructor for line plots shows that it also can + accept both a x- and y-array with coordinates. This means that a line plot + can also be used to create a scatter plot. However scatter plots have some + formatting options not available for line plots.

+

+

+

Even though the normal use of scatter plots is to supply both x- and y-coordinates + it is still perfectly possible to use a text- or int-scale for the x-coordinates to + just enumerate the points (the points will be placed along an imaginary integer + scale). This is especially useful when using the "Impulse" type of scatter plot as + shown below.

+

If no x-coordinates are specified each value will be placed at consecutive + x-coordinates [1,2,3,..]

+

A scatter plot is constructed by creating an instance of the class + ScatterPlot supplied with the proper arguments, i.e.

+

+

1
+
$scatterplot = new ScatterPlot($ydata, $xdata);

+

+

The following example shows a very basic scatter plot

+

+

Example 15.3. A basic scatter plot (scatterex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+ 
+?>


Figure 15.65. A basic scatter plot (scatterex1.php)

A basic scatter plot (scatterex1.php)


+

+

In the same way as we adjusted the look and feel for markers for line plot (see + ??) we can do the same here as shown in Figure 15.66. Adjusting the size and color of the marker (scatterex2.php)

+

+

Figure 15.66. Adjusting the size and color of the marker (scatterex2.php)

Adjusting the size and color of the marker (scatterex2.php)


+

+

The marks are accessed through the instance variable + ScatterPlot::mark (in complete analogy with line plots)

+

Combining marks with a line

+ +

It is possible to combine the individual data points with a line - a link. The + properties for this link can be accessed by using the instance variable + ScatterPlot::link.In order to enable the link the method + ScatterPlot::link::Show() must first be called.

+

+

Note

+

For historical reasons there is also a utility method + ScatterPlot::SetLinkPoints() where links can be enabled and adjusted. + However, this method will be removed in future versions of the + library.

+

+

+

The properties that can be adjusted are the normal line properties, i.e. + weight, color and line style. The following code snippet shows how to add a link + line with a dotted style drawn in black to scatter plot.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+// Enable the link lines
+$scatterplot->link->Show();
+ 
+// Set the properties
+$scatterplot->link->SetWeigth(1);
+$scatterplot->link->SetColor('black');
+$scatterplot->link->SetStyle('dotted');
+?>

+

+

In Figure 15.67. Combining data points with a dotted line (scatterlinkex3.php) and Figure 15.68. Combining data points with a red line (scatterlinkex4.php) there are two variants of adding a link + line to a scatter plot. For those figures we have also used two of the + predefined scientific axis styles (see Predefined scientific axis setups).

+

+

+
+

Figure 15.67. Combining data points with a dotted line (scatterlinkex3.php)

Combining data points with a dotted line (scatterlinkex3.php)

+
+

Figure 15.68. Combining data points with a red line (scatterlinkex4.php)

Combining data points with a red line (scatterlinkex4.php)

+
+

+

+
+

Creating impulse (or stem) - plots

+ +

A variant of scatter plots often used electrical engineering is the stem plot + as shown in Figure 15.56. Supported pattern fills for bar plots

+

+

Figure 15.69. Stem plot (impulsex1.php)

Stem plot (impulsex1.php)


+

+

This variant of the scatter plot is created by calling the method

+

+

1
+
$scatterplot->SetStem();

+

+

Tip

+

It is possible to create a stem graphs without any mark by specifying + the mark type as (-1) . That way only the impulse lines will be + drawn.

+

In order to adjust the look and feel of the stems the following methods + can be used

+

+

  • +

    ScatterPlot::SetWeight($aWeight)

    +
  • +

    ScatterPlot::SetColor($aColor)

    +

+

+

Another example of stem plot is shown in Figure 15.70. Adjusting the overall look and feel for the stem graph (impulsex3.php) + where we have adjusted both the look and feel of the stem plot as well as the + position of the x-axis.

+

+

Figure 15.70. Adjusting the overall look and feel for the stem graph (impulsex3.php)

Adjusting the overall look and feel for the stem graph (impulsex3.php)


+

+

There is also another complex impulse example shown in Figure 14.58. Adding a static line at y=0 to simulate an extra 0-axis (impulsex4.php) where we have used a PlotLine to + create a "virtual" x-axis.

+
+

Field plots

+ +

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 and angle).

+

A field plot is created as an instance of class FieldPlot with + three argument

+

+

  • +

    an array of y-coordinates

    +
  • +

    an array of x-coordinates

    +
  • +

    an array of angles

    +

+

+

as the following code snippet shows

+

+

1
+
$fieldplot = new FieldPlot($datay, $datax, $angle);

+

+

The size and color of each arrow in the field plot is controlled by accessing + the property FieldPlot::arrow and using the two methods

+

+

  • +

    FieldPlot::arrow->SetSize($aSize,$aArrowSize=2)

    +

    $aSize, Specifies the length (in pixels) of the + arrow

    +

    $aArrowSize, The arrow size is specified as an + integer in the range [0,9]. The possible arrow sizes are shown in + Figure 15.71. Possible sizes of arrow heads for field plots.

    +

    +

    Figure 15.71. Possible sizes of arrow heads for field plots

    + +
    Possible sizes of arrow heads for field plots
    +


    +

    +
  • +

    FieldPlot::arrow->SetColor($aColor)

    +

    The color of the arrow

    +

+

+

Another way to individually format each arrow is to use a callback method. The + callback method must have three arguments x- , y-coordinates and angle. The + callback method must return an array with three elements (color,size,arrow + size). The callback method is specified by calling

+

+

  • +

    FieldPlot::SetCallback($aFunc)

    +

+

+

Figure 15.72. A field plot (fieldscatterex1.php) shows a field plot with a callback + function.

+

+

Figure 15.72. A field plot (fieldscatterex1.php)

A field plot (fieldscatterex1.php)


+

+
+

Balloon plots

+ +

This is a variant of scatter plot where each data point is a filled circle and + the size of the circle is dynamically adjusted. This makes it possible to + display three values at each data point (x,y,"size"). There is no need for a + specific plot type for this since these types of plots can be constructed with + an ordinary scatter plot and a mark formatting callback.

+

In order to specify a callback for the marks the following method is + used

+

+

  • +

    ScatterPlot::mark::SetCallbackYX($aFunction)

    +

    The argument for the callback function is y- and x-value for the + data point. The return value should specify the format of the marker + as an array of (width, border_color, + fill_color, filename, image scale). All values must + be included.

    +

+

+

We can now create a balloon plot as follows.

+

+

  1. +

    Create a data array that specifies the data including both x- and + y-coordinate, color and size of the filled circle. For example + as:

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +
    $data = array(
    +    array(1,12,10,'orange'),
    +    array(3,41,15,'red'),
    +    array(4,5,19,'lightblue'),
    +    array(5,70,22,'yellow')
    +);

    +

    +
  2. +

    We must now convert this to some suitable data for a scatter plot. + The only thing to keep in mind is that we need to share the data + with the callback function and for that purpose we store the + formatting data in an external array indexed by the x,y-value.

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +
    $n = count($data);
    +for( $i=0; $i < $n; ++$i ) {
    +    
    +    $datax[$i] = $data[$i][0];
    +    $datay[$i] = $data[$i][1];
    + 
    +    
    +    $format[ strval($datax[$i]) ][ strval($datay[$i]) ] = array( $data[$i][2], $data[$i][3] );
    +    
    +}

    +

    +

    The callback function can now be specified as

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +
    function FCallback($aYVal,$aXVal) {
    +    // We need to access the global format array
    +    global $format;
    +    return array($format[ strval($aXVal) ][ strval($aYVal) ][0],'',
    +                 $format[ strval($aXVal) ][ strval($aYVal) ][1],'','');
    +}

    +

    +

    The callback function will now return the format value (size and + color) we specified originally depending on the x,y - coordinate. + The callback function can be installed with a call to

    +

    +

    1
    +
    $sp1->mark->SetCallbackYX('FCallback');

    +

    +
  3. +

    The final step is to create an ordinary scatter plot with a marker + that is specified as a filled circle

    +

    +

    1
    +2
    +
    $sp1 = new ScatterPlot($datay,$datax);
    +$sp1->mark->SetType(MARK_FILLEDCIRCLE);

    +

    +

+

+

As an optional additions we can also enable the display of the values at each + data point by calling

+

+

1
+2
+
$sp1->value->Show();
+$sp1->value->SetFont(FF_FONT1,FS_BOLD);

+

+

Putting all these together gives the result shown in Figure 15.73. Using format callback to create a balloon plot (balloonex2.php)

+

+

Figure 15.73. Using format callback to create a balloon plot (balloonex2.php)

Using format callback to create a balloon plot (balloonex2.php)


+

+
+

Creating Geo-maps

+ +

Geo-maps (a.k.a. Geo-charts, push-pin graphs) is used to illustrate locations + around the world by putting markers on a flat projection of the earth. A Geo-map + is done by adding a Worldmap background to a standard scatter graph. The library + includes a suitable background in the "Examples/" directory + "wordmap1.jpg". This can then be done as the following + example shows

+

+

Example 15.4. An example with geo maps (pushpinex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+DEFINE('WORLDMAP','worldmap1.jpg');
+ 
+function markCallback($y,$x) {
+    // Return array width
+    // width,color,fill color, marker filename, imgscale
+    // any value can be false, in that case the default value will
+    // be used.
+    // We only make one pushpin another color
+    if( $x == 54 ) 
+    return array(false,false,false,'red',0.8);
+    else
+    return array(false,false,false,'green',0.8);
+}
+ 
+// Data arrays
+$datax = array(10,20,30,40,54,60,70,80);
+$datay = array(12,23,65,18,84,28,86,44);
+ 
+// Setup the graph
+$graph = new Graph(400,270);
+ 
+// We add a small 1pixel left,right,bottom margin so the plot area
+// doesn't cover the frame around the graph.
+$graph->img->SetMargin(1,1,1,1);
+$graph->SetScale('linlin',0,100,0,100);
+ 
+// We don't want any axis to be shown
+$graph->xaxis->Hide();
+$graph->yaxis->Hide();
+ 
+// Use a worldmap as the background and let it fill the plot area
+$graph->SetBackgroundImage(WORLDMAP,BGIMG_FILLPLOT);
+ 
+// Setup a nice title with a striped bevel background
+$graph->title->Set("Pushpin graph");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
+$graph->title->SetColor('white');
+$graph->SetTitleBackground('darkgreen',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL);
+$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'blue','darkgreen');
+ 
+// Finally create the scatterplot
+$sp = new ScatterPlot($datay,$datax);
+ 
+// We want the markers to be an image
+$sp->mark->SetType(MARK_IMG_PUSHPIN,'blue',0.6);
+ 
+// Install the Y-X callback for the markers
+$sp->mark->SetCallbackYX('markCallback');
+ 
+// ...  and add it to the graph
+$graph->Add($sp);    
+ 
+// .. and output to browser
+$graph->Stroke();
+ 
+?>


Figure 15.74. An example with geo maps (pushpinex1.php)

An example with geo maps (pushpinex1.php)


+

+

Another example of using worldmaps with Pie graphs is shown in Adding background images to Pie graphs

+

+

Note

+

The library does not include any conversion utility to/from + Longitude/Latitude to UTM coordinates that could be used to + automatically position data marks on the Mercator projection map. The + options to stretch and scale the worldmap would make it rather + cumbersome to create a accurate conversion. For a good overview on this + kind of translation see Converting + Latitude/Longitude to Universal Transverse Mercator + (UTM)

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s06.html b/includes/jpgraph/docs/chunkhtml/ch15s06.html new file mode 100644 index 0000000..89aa8ff --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s06.html @@ -0,0 +1,436 @@ +Contour graphs

Contour graphs

+ +

In order to create Radar graphs the module + "jpgraph_contour.php" must first be included.

+

+

Note

+

The Pro-version (>= v3.1) also includes a module + "jpgraph_contourf.php" which is also supports + filled contour plots as well as labelling in the plots of the isobar lines. + The pro-version also uses a more advanced adaptive-mesh algorithm that give + better resolution without manual interpolation of the original data. Both + triangular and rectangular interpolation meshes are supported. The filled + contour is described in Chapter 23. Filled contour graphs +

+

+

+

Contour plots are used to plot the isobar lines (height curves) of a three + dimensional (3D) graph. The contour plot itself is only a two-dimensional plot and + looks like an ordinary topographic map. An example of a contour graph is shown in + Figure 15.75. A basic contour graph (basic_contourex01.php)

+

+

Figure 15.75. A basic contour graph (basic_contourex01.php)

A basic contour graph (basic_contourex01.php)


+

+

A contour graph is both similar and different from other types x-y graphs.

+

+

  • +

    A contour graph uses the standard x-y class Graph as + basic graph canvas

    +
  • +

    A contour graph has all the standard graph formatting options

    +
  • +

    The legend is automatically generated

    +
  • +

    The input data is a matrix and not an array

    +

+

+

There are primarily four main parameters that can be used to control the apparency + of the contour plots

+

+

  1. +

    the number of isobar lines, by + default 10 isobar lines are used

    +
  2. +

    the level of data grid interpolating, + i.e. to give the appearance of smoother isobar lines it is possible to + tell the library to create a number of intermediate points between the + given points in the input data matrix. It is important to note that this + does not create any further real information it only creates smoother + lines under the assumption that it is valid to assume linear + interpolation between the original data points.

    +

    The level of interpolation is specified as an integer in the practical + range 1 to 5. A level of 1 corresponds to just keeping the original + data, a level of 2 corresponds to subdividing the original data points + in two, i.e. one extra interpolated points is created in both x- and + y-direction and so on. A level of 3 corresponds to further sub-divding + the level 2 matrix one more time.

    +

    Even though it is theoretically possible to use an arbitrary + interpolation factor the library does not allow an interpolation factor + larger than 5. The reason is purely computational since the total number + of data points increases very quickly.

    +

    For example if the original grid has size 10x10 (=100 data points) + interpolating this grid with a factor of 5 will generate a new matrix of + size 145x145 (=21025 data points).

    +
  3. +

    flip around the Y-axis. By default + the first row in the input matrix corresponds to y=0, however this also + means that the plotted contour will be flipped compared with the input + matrix since y=0 is at the bottom of the graph. If for visual appearance + reason one wants the input data matrix to have the same orientation as + the resulting graph it is possible to have the library interpret the + last row in the input data matrix as y=0 instead

    +
  4. +

    the color of the isobar lines. By + default they will be assigned from the natural color spectra with pure + dark blue corresponding to the lowest point in the plot and pure red + corresponding to the highest isobar.

    +

+

+

The remaining possibilities to adjust the appearance of the contour plot + corresponds to the standard ways of changing the layout of the graph, for example + adding titles, adjusting colors and changing the type of axis to be + displayed.

+

The scale of the contour plot is by default the natural scale, i.e. the points are + assumed to be numbered (0..n) where n is the number of points in the corresponding + direction and also corresponds to each entry in the input data matrix.

+

Input data for contour graphs

+ +

The input data to a contour graph is a matrix. The value at each entry in the + matrix represents the heights at the specified (row,col) in the matrix. In all + of our example we will use the following data matrix

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php
+$data = array(
+            array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
+            array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
+            array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
+            array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
+            array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
+?>

+

+

By default the entry (0,0), i.e. row=0, col=0 will be positioned at graph + position (0,0), i.e. the lower left corner. Since this will represent an + inverted image compare to the data matrix. In order to have the graph oriented + in the same way as the data matrix, i.e. entry (0,0) positioned in the top left + corner the method

+

+

  • +

    ContourPlot::SetInvert($aFlg=true)

    +

+

+

In order to get a smooth contour plot it is necessary to have adequate number + of data points. What consists "adequate" number depends on the overall graph + size. The larger graph the more points are needed. To help crate smooth contour + plot the library offers automatic linear interpolation to specified depth. It is + important to note that this does not increase the accuracy. It merely creates + artificial point to draw smoother curves. This technique is described in detail + in Understanding mesh interpolation

+

Tip

+

If the data for the matrix is available in a file a convinient way to get + hold of the dat in the file is to use the utility class + ReadFileData to get hold of the data using the method + ReadFileData::FromMatrix($aFile,$aSeparator=' ') which read the + matrix from a file. Each row of the matrix must be a separate line and each + cell is separated with the character specified as the second argument. By + default a space is used as separator. All values read back are converted to + floating point numbers (double precision). The following short example shows + how easy this is to use

+

+

1
+
$data = ReadFileData::FromMatrix('matrixdata.txt');

+

+
+
+

Creating a contour graph

+ +

Figure 15.75. A basic contour graph (basic_contourex01.php) shows the most basic contour plot. + This is crated by first instantiating a graph and then creating an instance of + class ContourPlot which is added to the graph.

+

The constructor for class ContourPlot has the following + signature

+

+

  • +

    ContourPlot::__construct($aDataMatrix, $aIsobar=10, + $aFactor=1, $aInvert=false, + $aIsobarColors=array())

    +

    $aDataMatrix, The input data

    +

    $aIsobar, The number of isobars if the argument is an + integer or an array specifying the exact locations of each isobar if + the argument is an array

    +

    $aFactor, Grid interpolation factor

    +

    $aInvert, Invert the data matrix so the matrix entry + (0,0) corresponds to the top left corner

    +

    $aIsobarColors, Optional specification of isobar + colors

    +

+

+

This means that the common structure to create a basic contour plot will + be

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+$data = array ( array ( ... ) );
+ 
+// Basic contour graph
+$graph = new Graph($width,$height);
+$graph->SetScale('intint');
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+?>

+

+

Since the most common format for contour graphs is to show axis on all sides + we should add the line

+

+

1
+
$graph->SetAxisStyle(AXSTYLE_BOXOUT);

+

+

to our previous example so we get the effect shown in Figure 15.76. Adding axis on all sides (basic_contourex02.php) . To show the effect of flipping the + data around the center line we have to add the following line

+

+

1
+
$cp->SetInvert();

+

+

and get the result of adding this line is shown in Figure 15.77. Flipping the data around the center line (basic_contourex05.php)

+

+

+
+

Figure 15.76. Adding axis on all sides (basic_contourex02.php)

Adding axis on all sides (basic_contourex02.php)

+
+

Figure 15.77. Flipping the data around the center line (basic_contourex05.php)

Flipping the data around the center line (basic_contourex05.php)

+
+

+

+
+

Adjusting the color and number of isobar lines

+ +

As mentioned above the library uses 10 isobar lines by default. The number of + isobar lines can be adjusted by specifying a second integer argument to the + constructor of the contour plot. For example to use only 5 isobar lines the + construction of the contour plot would be changed to

+

+

1
+
$contourplot = new ContourPlot($data,5);

+

+

The result of changing this in the previous example is shown in Figure 15.78. Using only 5 isobar lines (basic_contourex04.php)

+

+

Figure 15.78. Using only 5 isobar lines (basic_contourex04.php)

Using only 5 isobar lines (basic_contourex04.php)


+

+

The values for the isobars are determined by finding the lowest and highest + point in the input data matrix and then spreading the isobars evenly between + these extreme points.

+

In some applications however it is necessary to have better control over where + exactly the isobars are placed and for this reason it is possible to tell the + library exactly at what values the isobars should be.

+

This is done by providing an array with the values of the isobars instead of a + single number in the creation of the contour plot as the following example + shows

+

+

1
+2
+3
+4
+
<?php
+$isoBars = array( 0.1,  0.2,  0.3,  0.4,  0.5,  0.6 )
+$cp = new ContourPlot($data, $isoBars); 
+?>

+

+

The isobar colors can be adjusted by specifying a color array that specifies + the color for each isobar.

+

However, there is some simpler changes that ca be made to change the colors + without having to go through the "trouble" of såspecifying a color array.

+

There are usually two reasons for changing the default color spectra.

+

+

  1. +

    to use more high contrast colors

    +
  2. +

    to use only black and white colors

    +

+

+

This can be accomplished with a call to the method

+

+

  • +

    ContourPlot::UseHighContrastColor($aFlg=true,$aBW=false) +

    +

+

+

as the following example shows

+

+

1
+2
+
$cp = new  ContourPlot( $data );
+$cp->UseHighContrastColor( true );

+

+

The above example will only use a blue to red color scale and avoid the + "low-contrast" greenish middle color spectrum colors.

+

By also setting the second argument to the high contrast method to true the + colors are restricted to only black and white. This will of course make it + impossible to exactly know the value each isobar represents but could be useful + for gaining some insight in the topography of a graph and would allow better + printing on black and white devices.

+

Specifying manual colors of the isobar can be done in two ways.

+

+

  1. +

    By specifying the color array as the fifth argument to the + constructor of ContourPlot as shown in Creating a contour graph

    +
  2. +

    By using the method + ContourPlot::SetIsobarColors($aColors)

    +

+

+

+

Caution

+

The number of colors specified must match the number of + isobars.

+

+

+
+

Understanding mesh interpolation

+ +

As mentioned above it is possible to use mesh interpolation to generate + smoother contour graphs. In order to better understand the effect of specifying + different interpolation factors we will show how what effect this have.

+

The data we will be using is given by the following data matrix

+

+

1
+2
+3
+4
+5
+6
+
$data = array(
+            array ( 12,7,3,15 ),
+            array ( 18,5,1, 9 ),
+            array ( 13,9,5,12),
+            array (  5,3,8, 9 ),
+            array (  1,8,5, 7 ));

+

+

A basic contour graph using the above data is shown in Figure 15.79. Interpolation factor=1 (basic_contourex03-1.php)

+

+

Figure 15.79. Interpolation factor=1 (basic_contourex03-1.php)

Interpolation factor=1 (basic_contourex03-1.php)


+

+

In order to specify a grid interpolation factor we need to specify this as the + third argument in the constructor for the contour plot. So in order to specify a + interpolation factor of 2 we would add the line

+

+

1
+
$contourplot = new ContourPlot($data,10,3);

+

+

To see the difference between different interpolation factor Figure 15.80. Interpolation factor=2 (basic_contourex03-2.php) and Figure 15.81. Interpolation factor=3 (basic_contourex03-3.php) shows the effect of using both a + grid interpolation factor of 2 and 3 on the example in Figure 15.79. Interpolation factor=1 (basic_contourex03-1.php)

+

+

+
+

Figure 15.80. Interpolation factor=2 (basic_contourex03-2.php)

Interpolation factor=2 (basic_contourex03-2.php)

+
+

Figure 15.81. Interpolation factor=3 (basic_contourex03-3.php)

Interpolation factor=3 (basic_contourex03-3.php)

+
+

+

+

We can now make two observations based on the above two figures

+

+

  1. +

    The lines get smoother the higher interpolation factor we + use

    +
  2. +

    The automatic scale has changed. This is not surprising since we + have in effect increase the number of data points each time we + increase the interpolation factor. The scale corresponds to the + matrix size (an entry in matrix at position (r,c) corresponds to the + point (x=c,y=r) in the graph.)

    +

    Initially we had a data matrix of size 5x4=20 data points, after + doing one interpolation (factor=2) the data matrix will have a size + of 9x7=63 data points and after doing one more interpolation + (factor=3) the data matrix will have a size of 17x13=221 data + points.

    +

    If we would have done one more interpolation we would have a data + matrix of size 33x25=825 data points.

    +

    The exponential growth of the total number of data point for a + 10x10 matrix is shown in Figure 15.82. The exponential growth of the data size due to grid interpolation factor (interpolation-growth.php) . This also makes a good + example of using a logarithmic y-scale. If the graph is a straight + line when plotted against a logarithmic scale this confirms our + suspicion that this is indeed a exponentially growing function. + Figure 15.83. The exponential growth of the data size due to the grid interpolation factor (log scale) (interpolation-growth-log.php) shows a + variant with a logarithmic y-scale (which confirms our + suspicion.)

    +

+

+

Tip

+

The helper class to do the actual interpolation can also be used directly + in other context. In order to create a new interpolated data matrix with a + specific interpolation factor the following code snippet can be used.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$dataMatrix = array( ... );
+$factor = ... ;
+$grid_interpolate = new Interpolate();
+$dataMatrix = $grid_interpolate->Linear($dataMatrix, $factor);
+?>

+

+
+

+

Tip

+

There is also a utility function + doMeshInterpolate(&$aData,$aFactor) that can be + sued to interpolate a matrix in place. This creates the necessary class, + interpolates its first argument and then fills the argument with the + interpolated data. By using call by reference some data copying is + avoided.

+

+

+

+

+
+

Figure 15.82. The exponential growth of the data size due to grid interpolation factor (interpolation-growth.php)

The exponential growth of the data size due to grid interpolation factor (interpolation-growth.php)

+
+

Figure 15.83. The exponential growth of the data size due to the grid interpolation factor (log scale) (interpolation-growth-log.php)

The exponential growth of the data size due to the grid interpolation factor (log scale) (interpolation-growth-log.php)

+
+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s07.html b/includes/jpgraph/docs/chunkhtml/ch15s07.html new file mode 100644 index 0000000..aef09f4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s07.html @@ -0,0 +1,61 @@ +Combining several different plot types in the same graph

Combining several different plot types in the same graph

+ +

It is perfectly legal to add several different plot types to the same graph. For + example to mix a line plot with a filled area plot. The different plots will be + stroked to the graph in the order they are added. This means that the plot (data + series) that should always be visible should be added last. In the example with the + filled area and a line the line should probably be added last since it otherwise + most likely will be overwritten by the filled area plot.

+

In Figure 15.84. Mixing a line and area plot in the same graph (example16.1.php) a basic example is shown where we have + combined a line plot with an area plot.

+

+

Figure 15.84. Mixing a line and area plot in the same graph (example16.1.php)

Mixing a line and area plot in the same graph (example16.1.php)


+

+

As can be seen from looking at the source to the example in Figure 15.84. Mixing a line and area plot in the same graph (example16.1.php) there is nothing special in doing this other + then to remember to include all necessary header files. So to add and mix scatter, + line, error and stock graphs are pretty straightforward.

+

However, when it comes to mixing bar plots and lines (or area plot) there is a + complication. By default bar plots are centered between the tick marks since this is the standard way of displaying + bar graphs since they normally have no specific x-scale. The bars are just in an + ordered sequence.

+

Let's just see what happens if we create a basic bar with a text scale on the + x-axis and then also add a line plot to the same graph.

+

+

Figure 15.85. Mixing a line and bar plot in the same graph (example16.3.php)

Mixing a line and bar plot in the same graph (example16.3.php)


+

+

As can be seen from Figure 15.85. Mixing a line and bar plot in the same graph (example16.3.php) the line is adjusted so + that each data point on the line coincides with the left edge of the barplot and the + bars are still positoined in the middle of the tick marks as could be expected. This + is the default behavior when combining a barplot with one of the other linear + plots.

+

If we instead wanted the line to be centered in the barplot (when using a text + scale) we would have to tell the line plot to position itself in the middle of the + bars with the method

+

+

  • +

    LinePlot::SetBarCenter()

    +

+

+

Using this method would then give the result shown in Figure 15.86. Centering the line plot in the middle of the bar (linebarcentex1.php) below

+

+

Figure 15.86. Centering the line plot in the middle of the bar (linebarcentex1.php)

Centering the line plot in the middle of the bar (linebarcentex1.php)


+

+

Please note that the above discussion is only valid when using a text scale. if we + instead would use (for example) an integer scale then both the bar and the line + would be positioned at the exact scale values (i.e. both bars and lines would be + left aligned) as can be seen in Figure 15.87. Mixing bar and line using an integer x-scale (example16.4.php)

+

+

Figure 15.87. Mixing bar and line using an integer x-scale (example16.4.php)

Mixing bar and line using an integer x-scale (example16.4.php)


+

+

+

Note

+

As can be seen in Figure 15.87. Mixing bar and line using an integer x-scale (example16.4.php) it is possible to + manually set the scale labels even if we use a linear scale like an integer + scale. We only have to keep in mind that we ned to supply labels for all the + scale labels and not just the one that are shown in case the scale is fro + example only displaying a label on every second tick.

+

+

+

An example on how to combine a scatter plot and a line plot is shown in Linear regression analysis where a linear regression + analysis is done.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch15s08.html b/includes/jpgraph/docs/chunkhtml/ch15s08.html new file mode 100644 index 0000000..2327a91 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch15s08.html @@ -0,0 +1,335 @@ +Creating several graphs in the same image

Creating several graphs in the same image

+ +

There are at least two reasons why one or several graphs should be combined into + the same image.

+
  • +

    To be able to create overall graphs that are strongly connected and + cannot be separated

    +
  • +

    To reduce the download time by only have to download one image for + several graphs

    +
  • +

    By convention, some types of graphs are always combined

    +

The library provides a convenience class , class MGraph + (for Multi Graph) that assists with this. In order to use this class the module file + "jpgraph_mgraph.php" must be included.

+

Figure 15.88. A combination of a line graph at top and a bar graph in the bottom (combgraphex1.php) shows an example of how this can be + used.

+

+

Figure 15.88. A combination of a line graph at top and a bar graph in the bottom (combgraphex1.php)

A combination of a line graph at top and a bar graph in the bottom (combgraphex1.php)


+

+

Creating a combined graph

+ +

In order to better understand what is involved in creating a combined graph we + will first show how this is done manually.

+

This is done by creating some PHP/GD code that creates a big enough empty + image with plain GD commands and then get the image handles from the graphs that + should be combined. The image handel can be returned from the + Graph::Stroke() methods in the graphs that should be included. + It is then possible to use these handles together with the GD image copy command + and copy the individual graph images onto the previously created empty large GD + image.

+

The following (almost complete) code shows how this can be done

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php
+// Assume we would like to combine graph1,2 and 3
+// ...... create graph 1 here.......
+$handle1 =  $graph1->Stroke( _IMG_HANDLER);
+ 
+// ...... create graph 2 here.......
+$handle2 =  $graph2->Stroke( _IMG_HANDLER);
+ 
+// ...... create graph 3 here.......
+$handle3 =  $graph3->Stroke( _IMG_HANDLER);
+ 
+ 
+// Now create the "melting graph" which should contain all three graphs
+// $WIDTH1 and $HEIGHT1 are width and height of graph 1 ($handle1)
+// $WIDTH2 and $HEIGHT2 are width and height of graph 2 ($handle2)
+// $WIDTH3 and $HEIGHT3 are width and height of graph 3 ($handle3)
+// $x2,$x3 and $y2,$y3 shift from top left of global graph (ie position of 
+// graph2 and graph3 in global graph)
+ 
+$image = imagecreatetruecolor($WIDTH1,$HEIGHT1);
+imagecopy($image, $handle1,0, 0, 0, 0, $WIDTH1,$HEIGHT1);
+imagecopy($image, $handle2,$x1,$y1,0,0,$WIDTH2,$HEIGHT2);
+imagecopy($image, $handle3,$x2,$y2,0,0,$WIDTH3,$HEIGHT3);
+ 
+// Stream the result back as a PNG image
+header("Content-type: image/png");
+imagepng ($image);
+?>

+

+

The advantages with this fully manual method are

+

+

  • +

    Absolute full control on a pixel level how the graphs are + combined

    +
  • +

    Full transparency on how the combination is done

    +

+

+

but on the other hand the disadvantages are

+

+

  • +

    Requires knowledge of the GD library

    +
  • +

    Requires re-inventing the wheel (since a lot of functionality to + manipulate the GD library is already available in the JpGraph + library)

    +

+

+

It is here the class MGraph comes in. It will allow you to very + easily create a combination of several graphs without knowing all the details on + the GD library or calculating pixel positions.

+

This helper class abstracts away all the details about copying images as well + as offering consistent interface (almost identical with the standard Graph + class). A basic example will quickly reveal the elegance of using this helper + class.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php
+//--------------------------------------
+// Graph 1
+//--------------------------------------
+$graph1 = new Graph(...);
+ 
+//... [Code to create graph1] ...
+ 
+//--------------------------------------
+// Graph 2
+//--------------------------------------
+$graph2 = new Graph(...);
+ 
+//... [Code to create graph2] ...
+ 
+//--------------------------------------
+// Create a combined graph
+//--------------------------------------
+$mgraph = new MGraph();
+$xpos1=3;$ypos1=3;
+$xpos2=3;$ypos2=200;
+$mgraph->Add($graph1,$xpos1,$ypos1);
+$mgraph->Add($graph2,$xpos2,$ypos2);
+$mgraph->Stroke();
+?>

+

+

The above example illustrates the most basic usage of the MGraph + class.

+

Each graph is added to the combined graph with a call to + MGraph::Add() which in addition to the graph argument also + takes the target X and Y coordinates where the graph will be placed in the + combined image. The target X and Y coordinates are relative to any optional + specified left and top margin.

+

In addition to adding graphs there are some basic formatting option for the + combined graph that are listed below. The core methods provided by the + MGraph class are

+

+

  • +

    MGraph::MGraph($aWidth,$aHeight).

    +

    Create a new instance of the MGraph class. If the + width and height are supplied as arguments they will override the + automatically determined width and height.

    +
  • +

    MGraph::Add($aGraph,$aToX,$aToY,$aFromX,$aFromY,$aWidth,$aHeight). +

    +

    Add a new subgraph with destination position + ($aToX,$aToY). By default the whole graph image is + used. It is also possible to only specify that part of the graph + should be used. The source rectangle is specified by ($aFromX, + $aFromY, $aWidth, $aHeight).

    +
  • +

    MGraph::SetFillColor($aColor).

    +

    Background color of the combined graphs.

    +

    Example: Setting an Orange background

    +

    +

    1
    +
    $mgraph->SetFillColor('orange');

    +

    +
  • +

    MGraph::SetFrame($aShow,$aColor,$aWeight)

    +

    Adding a frame to the combined graph.

    +

    Example: To add a blue frame with a 2 pixel width

    +

    +

    1
    +
    $mgraph->SetFrame(true,'blue ',2);

    +

    +
  • +

    MGraph::SetMargin($aLeft,$aRight,$aTop,$aBottom)

    +

    Adding a margin to the image. By default the minimum necessary + size for the combined graph to hold all the added subgraphs is used. + Use this method to add some space to the edges around the combined + image. When the individual graphs are positioned (in the + Add() method) the position is counted relative to + the left and top margin.

    +

    Example: Use 10 pixel left and right margin, 5 pixel top and + bottom margin

    +

    +

    1
    +
    $mgraph->SetMargin(10,10,5,5);

    +

    +
  • +

    MGraph::SetShadow($aShowShadow=true,$aShadowWidth=4,$aShadowColor='gray@0.3')

    +

    This adds a drop shadow to the MGraph in the same way as for the + usual graph class

    +

+

+

In the same way as the ordinary Graph class the MGraph class also + have a property $footer which allows the setting of a left, center and right + footer (see Adding a footer to the graph).

+

In addition the MGraph::Stroke() accepts a filename in the same + way as the normal Graph::Stroke()

+
+

Adding background images

+ +

In addition to the basic usage as shown above it is also possible to add a + background image in the combined graph. What is important to remember then is + that all the subgraphs are copied onto the combined graph so normally they will + be on top of the background image and hide it.

+

There are two ways of handling a background image

+

+

  1. +

    Do nothing and the background image will only "shine through" for + those areas of the combined graph that is not covered by any + subgraph.

    +
  2. +

    Specify a "blend" factor for the subgraphs that specifies how much + of the background image will be mixed with the subgraph. The blend + factor is as usual specified as an integer in the interval 0-100. + (Note: This is the same functionality as the standard + Graph::SetBackgroundImageMix() for ordinary + graphs.) A value of 0 means that 100% of the background is visible + and a value of 100 means that 0% of the background is visible.

    +

    To add a subgraphs with a blend factor the method + MGrahp::AddMix() is used. This behaves exactly as + the standard MGraph::Add() apart from the fact that the + 3:rd argument is the blend factor (after the two x and y + coordinates).

    +

    Example: Add a graph with 50% mix of the background

    +

    +

    1
    +
    $mgraph->AddMix($graph,0,0,50);

    +

    +

+

+

The background image itself is added with the method

+

+

  • +

    MGraph::SetBackgroundImage($aFile,$aCenter_aX=TRUE,$aY=NULL) +

    +

+

+

The filename specifies the full name of the background image (including + extension). Please note that the extension must be a valid image extension in + order for the library to determine the format of the image file.

+

The second argument can be either numeric or a boolean in which case it + specifies if the background image should be centered or if it should just be + copied from the top left position. If it is numerical it is interpretated as the + X-position for the optional X and Y coordinates specifying the position of the + top left corner of the background image.

+

Figure 15.89. Mixing a background image with two subgraphs. In this case the mixing factor was 85 for both subgraphs. (Note: To reduce load time the image is quite hard compressed in JPEG so there are some artifacts in high-frequency areas.) (combgraphex2.php) shows a variant of Figure 15.88. A combination of a line graph at top and a bar graph in the bottom (combgraphex1.php) where a centered background image is mixed + in with two subgraphs.

+

+

Figure 15.89. Mixing a background image with two subgraphs. In this case the mixing factor was 85 for both subgraphs. (Note: To reduce load time the image is quite hard compressed in JPEG so there are some artifacts in high-frequency areas.) (combgraphex2.php)

Mixing a background image with two subgraphs. In this case the mixing factor was 85 for both subgraphs. (Note: To reduce load time the image is quite hard compressed in JPEG so there are some artifacts in high-frequency areas.) (combgraphex2.php)


+

+
+

Creating rotated combined graphs

+ +

There are in principle no difference when combing graphs top/bottom or + left/right. ?? shows an example of creating a graph that illustrates the + changing weather conditions measure by Wind direction, speed and temperature in + one graph with a detailed vertical scale showing the time.

+

Since this follows exactly the same principle laid out above the script should + be fairly self explanatory. Note that we have suppressed the x-scale on two of + the graphs to make better use of the available image size and also to create a + stronger sense of "belonging" between the individual graphs.

+

+

Figure 15.90. Combining three graphs in one image (comb90dategraphex03.php)

Combining three graphs in one image (comb90dategraphex03.php)


+

+
+

Some caveats when using MGraph

+ +

There are some drawbacks using combined graphs

+

+

  • +

    CSIM Image maps can not be used with combined graphs.

    +
  • +

    Creating multiple graphs in the same script will require some + additional memory. Make sure that the memory limit in + "php.ini" is sufficient.

    +
  • +

    Adding background images can significantly increase the final size + of the image. Using the JPEG image format when photo like background + images are used gives better compressing than PNG (since JPEG is a + lossy format). For example setting the JPEG quality parameter to 60 + (default is 75).

    +

    +

    1
    +
    $mgraph->SetImgFormat('jpeg',60);

    +

    +

    +

    Tip

    +

    This setting can be used for ordinary Graphs as well. +

    +

    +

    +
  • +

    Compared with background images for ordinary graphs there is + currently no possibility for automatic re-sizing of the background + images.

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch16.html b/includes/jpgraph/docs/chunkhtml/ch16.html new file mode 100644 index 0000000..37bddd8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch16.html @@ -0,0 +1,890 @@ +Chapter 16. Non-Linear graph types

Chapter 16. Non-Linear graph types

Table of Contents

16.1. Pie graphs
16.1.1. Hare/Niemeyer Integer compensation for Pie Plots
16.1.2. 2D-Pie plots
16.1.3. 3D-Pie plots
16.1.4. Ring plots
16.1.5. Exploding pie slices
16.1.6. Specifying and adjusting labels on pie plots
16.1.7. Adding drop shadows to the slices
16.1.8. Adding background images to Pie graphs
16.1.9. Specifying slice colors and using themes
16.2. Radar graphs
16.2.1. Adding radar plots to a radar graph
16.2.2. Adding plot-marks to radar plots
16.2.3. Client Side Image maps
16.2.4. Adjusting the overall properties of the radar graph
16.2.5. Adjusting the axis formatting
16.2.6. Adjusting grid lines for the radar graph
16.2.7. Using a logarithmic scale
16.2.8. Enabling anti-aliasing for radar graphs
16.2.9. A final example
16.3. Polar graphs
16.3.1. Rotating the polar graph
16.3.2. Changing the angle direction
16.3.3. Adding polar plots to a polar graph
16.3.4. Adding plot-marks to polar plots
16.3.5. Client Side Image maps
16.3.6. Adjusting the radius scale
16.3.7. Adjusting the grid lines
16.3.8. Adjusting the labels
16.4. Gantt charts
16.4.1. The structure of a Gantt chart
16.4.2. Creating a Gantt graph
16.4.3. Adjusting the scale headers
16.4.4. Adding gantt objects to the chart
16.4.5. Additional formatting for activity bars (Gantt bars)
16.4.6. Adding visual indication of constraints between gantt objects
16.4.7. Grouping activities
16.4.8. Simplifying creation of basic Gantt charts
16.4.9. Using multiple title columns
16.4.10. Built-in icons for use in activity titles
16.4.11. More general Gantt formatting
16.4.12. Localizing the Gantt chart scale
16.4.13. CSIM Support in Gantt charts
16.4.14. Some final Gantt graph examples
+ +

All the plots we have discussed up to now have used some kind of x-y coordinate + system. The library supports a number of graph types that does not use rectangular axis + or scales. The supported graphs are shown below

+

+

+
+

+

Figure 16.1. Pie graphs

+ +
Pie graphs
+


+

+

(See 2D-Pie plots)

+
+

+

Figure 16.2. Pie3D graphs

+ +
Pie3D graphs
+


+

+

(See 3D-Pie plots)

+
+

+

Figure 16.3. Ring graphs

+ +
Ring graphs
+


+

+

(See Ring plots)

+
+

+

Figure 16.4. Radar graphs

+ +
Radar graphs
+


+

+

(See Radar graphs)

+
+

+

Figure 16.5. Polar graphs

+ +
Polar graphs
+


+

+

(See Polar graphs)

+
+

+

Figure 16.6. Gantt charts

+ +
Gantt charts
+


+

+

(See Gantt charts)

+
+

+

+

Pie graphs

+ +

The main difference compared to the previous discussed x-y plots is that to all + pie plots are added based on the class PieGraph instead of the + Graph class used for all x-y graphs.

+

Hare/Niemeyer Integer compensation for Pie Plots

+ +

A problem that sometimes occur with the use of integer values for Pie charts + is the problem with rounding error. Even with correct rounding of the individual + pie slices using only integers as display values have the problem that it + sometimes doesn't sum up to 100% as illustrated in Figure 16.7. Hare/Niemeyer pie plot integer compensation

+

This is in many circumstances not acceptable. The library includes the + Hare/Niemeyer compensation that can be enabled. This will adjust the integer + values so that it always sum up to 100%. The result of the compensation can be + seen in Figure 16.7. Hare/Niemeyer pie plot integer compensation

+

+

Figure 16.7. Hare/Niemeyer pie plot integer compensation

+ +
+
+

Hare/Niemeyer pie plot integer compensation

+

a) Problem with integer values

+
+

Hare/Niemeyer pie plot integer compensation

+

b) Hare/Niemeyer compensation

+
+
+


+

+

Note

+

To enable this compensation the label type should be specified as

+

+

1
+
$pieplot->SetLabelType(PIE_VALUE_ADJPERCENTAGE);

+

+
+
+

2D-Pie plots

+ +

In order to create Pie plots the module "jpgraph_pie.php" + must first be included.

+

The principle for creating Pie graphs follows the same structure as for line + graphs. First an instance of class PieGraph is created and then one + or several instances of class PiePlot is created and added to the + PieGraph instance as the following basic example shows

+

+

Example 16.1. A basic Pie graph (example26.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>


Figure 16.8. A basic Pie graph (example26.php)

A basic Pie graph (example26.php)


+

+

There are a few things to note here

+

+

  • +

    By default all pie slices have the percentage shown just outside + the slice.

    +
  • +

    The colors are automatically assigned to the slices.

    +
  • +

    The pie have the edges marked by default

    +
  • +

    The first slice start at 0 degrees (3 o'clock)

    +

+

+

It is possible to adjust most of the aspects of a pie graph. in addition to + the usual graph appearance adjustments discussed in Specifying and formatting the overall displayed graph the following methods can be + used to adjust the appearance of the individual plots.

+

+

  • +

    PiePlot::SetStartAngle($aAngle)

    +

    Change the angle for the first slice

    +
  • +

    PiePlot::ShowBorder($aFlg=true)

    +

    Show the border around and inside the pie

    +
  • +

    PiePlot::SetColor($aColor)

    +

    Specify the color of the border of the pie

    +
  • +

    PiePlot::SetSliceColors($aColor)

    +

    Specify the color of the slices

    +
  • +

    PiePlot::SetSize($aSize)

    +

    Set the size of the pie plot. This can be specified as either a + fraction of the minimum of the graph width and height or as a + absolute size in pixels.

    +
  • +

    PiePlot::SetCenter($aX, $aY)

    +

    Position the pie on the graph

    +
  • +

    PiePlot::value

    +

    +
  • +

    PiePlot::SetLabels($aLabels, + $aLblPosAdj="auto")

    +

    Specify the labels for each pie slice

    +
  • +

    PiePlot::SetLabelType($aType)

    +

    By default the label is displayed as percentage. Using this method + it is possible to change the automatic label to show the absolute + value instead.

    +

+

+

In order to show a basic addition we 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 result shown in Figure 16.9. Adding a legend to a pie plot (example26.1.php)

+

+

Figure 16.9. Adding a legend to a pie plot (example26.1.php)

Adding a legend to a pie plot (example26.1.php)


+

+

+

Note

+

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. The number passed on into this string is either the + absolute value of the slice or the percentage value. The same formatting can + also be used to format the legend labels.

+

Adding multiple pie plots to the same pie graph

+ +

This is done in complete analogy with the say multiple lines were added to + a line graph. The following code snippet shows the principle

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php
+$piegraph = new PieGraph($width,$height);
+ 
+$p1 = new PiePlot($data1);
+$p1->SetSize(0.2);
+$p1->SetCenter(0.3,0.6);
+ 
+$p2 = new PiePlot($data2);
+$p2->SetSize(0.2);
+$p2->SetCenter(0.7,0.6);
+ 
+$piegraph->Add($p1);
+$piegraph->Add($p2);
+?>

+

+

The positioning and sizing of the plots must be done manually. In the + following example we show an example where four pie plots are added to a + graph

+

+

Example 16.2. Adding several pie plots to the same pie graph (pieex3.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+// Some data
+$data = array(40,21,17,14,23);
+ 
+// Create the Pie Graph.
+$graph = new PieGraph(350,300);
+$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();
+ 
+?>


Figure 16.10. Adding several pie plots to the same pie graph (pieex3.php)

Adding several pie plots to the same pie graph (pieex3.php)


+

+
+

Adding guide lines to Pie Plots

+ +

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($aFlg=true, $aCurved=true, + $aAlways=false)

    +

+

+

the simplest usage of this would be to add the following line to a + script

+

+

1
+
$pieplot->SetGuideLines();

+

+

Figure 16.11. Adding guide lines to a pie labels (pielabelsex1.php) shows an example of this.

+

This basic use of guide lines is 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

+

+

1
+
$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 shown in Figure 16.12. Lining up guide lines vertically (pielabelsex2.php)

+

+

+
+

Figure 16.11. Adding guide lines to a pie labels (pielabelsex1.php)

Adding guide lines to a pie labels (pielabelsex1.php)

+
+

Figure 16.12. Lining up guide lines vertically (pielabelsex2.php)

Lining up guide lines vertically (pielabelsex2.php)

+
+

+

+

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. In ?? this distance is reduced to + '1.1' and as can be seen this yields much more compact labeling.

+

+

Figure 16.13. Adjusting the distance between the labels for guide lines (pielabelsex4.php)

Adjusting the distance between the labels for guide lines (pielabelsex4.php)


+

+

+

Note

+

Guide lines is only available for 2D Pie plots.

+

+

+
+
+

3D-Pie plots

+ +

In order to create 3D Pie plots both the modules + "jpgraph_pie.php" and + "jpgraph_pie3d.php" must be included.

+

Creating 3D pie plots is as simple as creating normal 2D pie plots. Instead of + creating the plots as an instance of class PiePlot the plots are + created as an instance of class PiePlot3D +

+

If we take the plot in Figure 16.8. A basic Pie graph (example26.php) and replace the + creation of an instance of class PiePlot with creating an instance + of class PiePlot3D , i.e. replace

+

+

1
+
$p1 = new PiePlot($data);

+

+

with

+

+

1
+
$p1 = new PiePlot3D($data);

+

+

The result of this is shown in Figure 16.14. A basic 3D pie plot (example27.php)

+

+

Figure 16.14. A basic 3D pie plot (example27.php)

A basic 3D pie plot (example27.php)


+

+

3D Pie plots have the same possibilities as the normal pie plots with the + added twist of a 3:rd dimension. It is possible to adjust the perspective angle + with the method SetAngle() So for example to make the pie more + "flat" the angle is made smaller angle. Setting the perspective angle to 20 + degrees in the previous example will give the following result.

+

+

Figure 16.15. Adjusting the perspective angle (example27.1.php)

Adjusting the perspective angle (example27.1.php)


+

+

To give a feel for the effect of adjusting the angle Figure 16.16. Affect of adjusting the perspective angle for a 3D pie plot below shows a number of different + angles,

+

+

Figure 16.16. Affect of adjusting the perspective angle for a 3D pie plot

+ +
+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=10

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=20

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=30

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=40

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=50

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=60

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=70

+
+

Affect of adjusting the perspective angle for a 3D pie plot

+

angle=10

+
+
+


+

+
+

Ring plots

+ +

There are two versions of the 2D pie plots. The normal pie plot is created as + an instance of class PiePlot. This variant is 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. An example of this is shown in ??

+

+

Figure 16.17. A ring plot (piecex1.php)

A ring plot (piecex1.php)


+

+

Since the PiePlotC is an extension to the basic pie plot all the + normal formatting for pie plots can also be done for a "ring" plot.

+

The additional formatting only concerns the filled middle circle. There are + options of adjusting size, fill color and all font properties. The following + methods are used for this

+

+

  • +

    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()

    +

+

+

A more complex formatting of a ring plot is shown in Figure 16.18. A ring graph with several formatting options adjusted (piecex2.php) . In this example we have:

+

+

  • +

    hidden the frame around the pie graph

    +
  • +

    exploded all the slices

    +
  • +

    added drop shadow to the individual slices (and the center filled + circle)

    +
  • +

    specified individual multi line labels.

    +
  • +

    changed the font for the title to a TTF font.

    +

+

+

+

Figure 16.18. A ring graph with several formatting options adjusted (piecex2.php)

A ring graph with several formatting options adjusted (piecex2.php)


+

+
+

Exploding pie slices

+ +

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

+

+

  • +

    PiePlot::Explode($aExplodeArr)

    +

    This method takes an array of one or more slices index to + explode

    +

    PiePlot::ExplodeAll($aRadius)

    +

    This explodes all slices in the pie

    +

    PiePlot::ExplodeSlice($aSlice, $aRadius)

    +

    This is used to explode one specific slice

    +

+

+

To explode one slice the default "explode" radius the following line has to be + added

+

+

1
+
$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 previous examples would result in + the following two figures

+

+

+
+

Figure 16.19. Exploding the second slice (example27.2.php)

Exploding the second slice (example27.2.php)

+
+

Figure 16.20. Exploding the second slice (example27.3.php)

Exploding the second slice (example27.3.php)

+
+

+

+
+

Specifying and adjusting labels on pie plots

+ +

By default the values shown just outside the pie for each slice are the + percentage value for each slice. If instead the absolute value should be + displayed the SetLabelType() method must be called. To show + absolute values the following line must be added

+

+

1
+
$pieplot->SetLabelType(PIE_VALUE_ABS);

+

+

Furthermore is is possible to adjust the display value by either using a + printf() style format string (using SetFormat() ) + or by providing a formatting function callback (using + PiePlot::SetFormatCallback() ) for doing more advanced + formatting.

+

It is also possible to 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 the library automatically determines the best position. The + following example illustrates the effect of specifying the position to 0.5, i.e. + in the middle of the radius.

+

+

Figure 16.21. Adjusting the position of the pie labels (pieex8.php)

Adjusting the position of the pie labels (pieex8.php)


+

+

If this formatting is not enough it is also possible to "manually" specify the + labels for each slice individually.

+

This is done by using the PiePlot::SetLabels() method. This will + allow specifying individual text strings for each label. In each specification + it is possible to 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 a shortcut to the + PiePlot::SetLabelPos() as described above. By default the + position will be set to 'auto' if not explicitly specified.

+

Note

+

The alignment of the labels will be different depending on whether they + are inside or outside the pie.

+

When the label is positioned inside the plot the center of the strings + will be aligned with the center of the slice at the specified fraction of + the radius. When positioned is outside the pie plot the alignment will + depend on the angle to avoid that the labels inadvertently writes over the + pie.

+
+

When labels are specified with the PiePlot::SetLabels() method it + is possible to also specify a format placeholder (in the normal style of + printf() this placeholder will be replaced by the value of the + slice. For example a label specified as "The apple slice\n%.1f%%" + would have the percentage value on the second row. The value will either be the + absolute or the percentage depending on the setting of the + SetLabelType().. The Pie chart in Figure 16.22. Pie chart with manually specified labels for each slice (pielabelsex5.php) below shows an example where the slices + have a label just outside the perimeter of the pie.

+

+

Figure 16.22. Pie chart with manually specified labels for each slice (pielabelsex5.php)

Pie chart with manually specified labels for each slice (pielabelsex5.php)


+

+
+

Adding drop shadows to the slices

+ +

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 shown in ??

+

+

Figure 16.23. Adding a drop shadow to exploded pie (pieex9.php)

Adding a drop shadow to exploded pie (pieex9.php)


+

+
+

Adding background images to Pie graphs

+ +

In the same way as every other graphs in the library it is possible to add a + background image to a Pie plot (see Adding images and country flags to the background of the graph). An example of this where we + have used multiple plots on a worldmap background is shown in Figure 16.24. Pie plots with a background image (piebkgex1.php)

+

+

Example 16.3. Pie plots with a background image (piebkgex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+require_once ('jpgraph/jpgraph_pie3d.php');
+ 
+// Some data
+$data = array(
+    array(80,18,15,17),
+    array(35,28,6,34),
+    array(10,28,10,5),
+    array(22,22,10,17));
+ 
+$piepos = array(0.2,0.4,0.65,0.28,0.25,0.75,0.8,0.75);
+$titles = array('USA','Sweden','South America','Australia');
+ 
+$n = count($piepos)/2;
+ 
+// A new graph
+$graph = new PieGraph(550,400,'auto');
+ 
+// Specify margins since we put the image in the plot area
+$graph->SetMargin(1,1,40,1);
+$graph->SetMarginColor('navy');
+$graph->SetShadow(false);
+ 
+// Setup background
+$graph->SetBackgroundImage('worldmap1.jpg',BGIMG_FILLPLOT);
+ 
+// Setup title
+$graph->title->Set("Pie plots with background image");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,20);
+$graph->title->SetColor('white');
+ 
+$p = array();
+// Create the plots
+for( $i=0; $i < $n; ++$i ) {
+    $d = "data$i";
+    $p[] = new PiePlot3D($data[$i]);
+}
+ 
+// Position the four pies
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->SetCenter($piepos[2*$i],$piepos[2*$i+1]);
+}
+ 
+// Set the titles
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->title->Set($titles[$i]);
+    $p[$i]->title->SetColor('white');
+    $p[$i]->title->SetFont(FF_ARIAL,FS_BOLD,12);
+}
+ 
+// Label font and color setup
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->value->SetFont(FF_ARIAL,FS_BOLD);
+    $p[$i]->value->SetColor('white');
+}
+ 
+// Show the percetages for each slice
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->value->Show();
+}
+ 
+// Label format
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->value->SetFormat("%01.1f%%");
+}
+ 
+// Size of pie in fraction of the width of the graph
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->SetSize(0.15);
+}
+ 
+// Format the border around each slice
+ 
+ 
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->SetEdge(false);
+    $p[$i]->ExplodeSlice(1);
+}
+ 
+// Use one legend for the whole graph
+$p[0]->SetLegends(array("May","June","July","Aug"));
+$graph->legend->Pos(0.05,0.35);
+$graph->legend->SetShadow(false);
+ 
+for( $i=0; $i < $n; ++$i ) {
+    $graph->Add($p[$i]);
+}
+ 
+$graph->Stroke();
+?>


Figure 16.24. Pie plots with a background image (piebkgex1.php)

Pie plots with a background image (piebkgex1.php)


+

+
+

Specifying slice colors and using themes

+ +

In addition to manually specifying the colors of each individual pie slice it + is possible to specify a color "theme" to be used. A color theme is nothing more + than a group of predefined colors that will be used for the slices. Each theme + is referred to by it's name (as a string) as argument for the method

+

+

  • +

    PiePlot::SetTheme($aTheme)

    +

+

+

By default the library offers four different color themes listed below with a + small example graph using that particular theme.

+

+

  1. +

    "earth" colors

    +

    +

    Figure 16.25.  (example28.1.php)

    (example28.1.php)


    +

    +
  2. +

    "pastel" colors

    +

    +

    Figure 16.26.  (example28.2.php)

    (example28.2.php)


    +

    +
  3. +

    "sand" colors

    +

    +

    Figure 16.27.  (example28.php)

    (example28.php)


    +

    +
  4. +

    "water" colors

    +

    +

    Figure 16.28.  (example28.3.php)

    (example28.3.php)


    +

    +

+

+

Color chart for each available theme is shown below.

+

Figure 16.29. Earth theme

+ +
Earth theme
+

+

Figure 16.30. Pastel theme

+ +
Pastel theme
+

+

Figure 16.31. Sand theme

+ +
Sand theme
+

+

Figure 16.32. Water theme

+ +
Water theme
+

+
+
+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch16s02.html b/includes/jpgraph/docs/chunkhtml/ch16s02.html new file mode 100644 index 0000000..2bcec2f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch16s02.html @@ -0,0 +1,494 @@ +Radar graphs

Radar graphs

+ +

In order to create Radar graphs the module + "jpgraph_radar.php" must first be included.

+

Radar 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). Radar plots are not suitable if high accuracy readings from the graph + are needed since, by it's nature, it can be difficult to read out very detailed + values.

+

Figure 16.33. A typical radar graph with two radar plots added (radarex7.php) shows a basic radar graph with two radar plots + added.

+

+

Figure 16.33. A typical radar graph with two radar plots added (radarex7.php)

A typical radar graph with two radar plots added (radarex7.php)


+

+

Radar graphs are created as an instance of class RadarGraph which + inherits all common formatting options from the standard class Graph + such as titles, background colors, background titles, etc.

+

+

Note

+

Tabbed titles cannot not be used for radar graphs since there is no + applicable concept of a plot area

+

+

+

The following facts applies to a radar graph

+

+

  • +

    There is one axis for each data point

    +
  • +

    Each axis may have an arbitrary title which is automatically + positioned

    +
  • +

    A radar plot may be filled or open

    +
  • +

    The first axis is always oriented vertical and is the only axis with + labels

    +
  • +

    Several radar plots can be combined in one radar graph

    +
  • +

    Axis can have either linear or logarithmic scale on the axis

    +

+

+

In addition all the normal formatting of labels, background colors, grid lines, + plot colors, fill colors etc. can be adjusted. The rest of this sections will show + some of the typical formatting options available.

+

Adding radar plots to a radar graph

+ +

The principle is exactly the same as for line plots but instead of an x-y + coordinate each data point represents a value on one of the axis. The number of + axis will automatically be the same as the number of data points. Even through + the library itself does not impose any restrictions on the number of axis there + is a practical limit so it is probably best to keep the number of data points + limited to around 10-12.

+

Typical data set for a radar plot is then given as

+

+

1
+
$data = array( axis<1>_value, axis<2>_value, ..., axis<n>_value );

+

+

The plot points are assigned to the axis in a counter-clockwise direction + starting at 12 a'clock. If clock-wise order is needed the input data must be + reversed.

+

Creation of a radar graph follows the now familiar steps of first creating an + instance of class RadarGraph and then adding one or several + instances of class RadarPlot as the following code snippet + shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php
+// Some data
+$data1 = array( ... ) ;
+$data2 = array( ... ) ;
+ 
+$width  = ... ;
+$height = ... ;
+ 
+// Setup a basic radar graph
+$graph = new RadarGraph($width,$height);
+$graph->SetScale('lin');
+ 
+// Add a title to the graph
+$graph->title->Set('Quality result');
+ 
+// .. add any other common graph formatting
+ 
+// Create the first radar plot with formatting
+$plot1 = new RadarPlot($data1);
+$plot1->SetLegend('Goal');
+$plot1->SetColor(̈́red', 'lightred');
+ 
+// Create the second radar plot
+$plot2 = new RadarPlot($data2);
+$plot2->SetLegend('Actual');
+$plot2->SetColor('blue', 'lightred');
+ 
+// Add the plots to the graph
+$graph->Add($plot2);
+$graph->Add($plot1);
+ 
+// and display the graph
+$graph->stroke()
+?>

+

+

As an illustration two very basic radar graphs with one radar plot each are + displayed below. The left figure uses only default values and the right figure + uses the ame data but adjusts a few properties to make the graph a bit more + interesting.

+

+

+
+

Figure 16.34. A basic radargraph with no formatting (radarex1.php)

A basic radargraph with no formatting (radarex1.php)

+
+

Figure 16.35. A basic radargraph with minimal formatting (radarex2.php)

A basic radargraph with minimal formatting (radarex2.php)

+
+

+

+

Each radar plot can also have a legend. As usual the text for the legend is + created by using the method

+

+

  • +

    RadarPlot::SetLegend($aText)

    +

+

+

The legend box is accessed through the "$legend" property of the graph and + this can be used to adjust the size, position and layout of the legend box (as + described in Adjusting the position and layout of the legend).

+
+

Adding plot-marks to radar plots

+ +

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 instance variable

+

+

  • +

    RadarPlot::mark

    +

+

+

(All available plot marks are listed in Appendix E. Available plot marks)

+

For example to add a red ball marker the following line must be added

+

+

1
+
$radarplot->mark->SetType(MARK_IMG_SBALL,'red');

+

+

In Figure 16.36. Adding plot marks to a radar graph (radarmarkex1.php) we show a radar graph with added + plot-marks. In addition we have also chosen to hide the tick marks on the axis + and adjust some of the default colors.

+

+

Figure 16.36. Adding plot marks to a radar graph (radarmarkex1.php)

Adding plot marks to a radar graph (radarmarkex1.php)


+

+
+

Client Side Image maps

+ +

(See Chapter 10. Using CSIM (Client side image maps) for a full description on the usage + of CSIM together with the library)

+

If markers are shown 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 snippet shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+// Start by specifying the proper URL targets
+$targets  = array( "#1" , "#2" , ....... );
+$radarplot = new RadarPlot( $data );
+$radarplot->mark->SetType( MARK_SQUARE );
+$radarplot->SetCSIMTargets( $targets );
+$graph->Add( $radarplot );
+$graph->StrokeCSIM(); 
+?>

+

+
+

Adjusting the overall properties of the radar graph

+ +

The scale of the axis can be either a linear or a logarithmic scale and is + specified with the method

+

+

  • +

    RadarGraph::SetScale($aScale, $aYMin=1, + $aYMax=1)

    +

    The scale is specified as a string and can be either + "lin" or "log"

    +

+

+

The size and position of the radar graph are adjusted by the two + methods

+

+

  • +

    RadarGraph::SetSize($aSize)

    +

    The size is specified as a fraction of min($weight,$height) and + indicates the length of the axis.

    +
  • +

    RadarGraph::SetCenter($aXPos, $aYPos=0.5)

    +

    The center of the graph can be specified as either a fraction of + the width/height or as an absolute position.

    +

+

+

The background color can be adjusted by

+

+

  • +

    RadarGraph::SetColor($aColor)

    +

+

+
+

Adjusting the axis formatting

+ +

All axis have the same formatting and the axis is access through the "$axis" + property of the RadarGraph class. For example make the axis 2 pixels wide the + following lines would be needed

+

+

1
+2
+
$radargraph = new RadarGraph($width,$height);
+$radargraph->axis->SetWeight(2);

+

+

The axis supports all the same formatting options as for standard x-y graphs. + Some of the more commonly used methods for the axis formatting are

+

+

  • +

    Axis::SetColor($aColor,$aLabelColor=false)

    +

    Set the color of the axis and (optional) the labels

    +
  • +

    Axis::SetWeight($aWeight)

    +

    Specifies width in pixels of the axis

    +
  • +

    Axis::SetLabelFormatString($aFormStr,$aIsDateFormat=false)

    +

    Specify the format string to be used for the labels

    +
  • +

    Axis::SetLabelFormatCallback($aFuncName)

    +

    Set the callback function to be used for the label + formatting

    +
  • +

    Axis::SetFont($aFamily,$aStyle,$aSize)

    +

    Sets the font property for the labels of the axis. Note that this + will not effect the font property + of the title of the axis.

    +

+

+

In order to specify the titles for each axis the method

+

+

  • +

    RadarGraph::SetTitles($aTitleArray)

    +

    The argument is an array with as many entries as there are axis + and where each entry specifies a text string which is the title of + the axis.

    +

    Example 16.4. Having the name of the months as title of the axis

    + +

    The easiest way to have the month name as titles is to use the + library global variable "$gDateLocale" as + follows

    +

    +

    1
    +2
    +
    $titles = $gDateLocale->GetShortMonth();
    +$radargraph->SetTitles( $titles );

    +

    +

    +

+

+

In order to adjust the property of the title for the axis the + "$title" property of the axis is used. For example, to set the + font and color for the titles of the axis the following two lines are + needed

+

+

1
+2
+3
+4
+
<?php
+$radargraph->axis->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$radargraph->axis->title->SetColor('darkred');
+?>

+

+

The tick marks can also be adjusted with the following methods

+

+

  • +

    RadarGraph::HideTickMarks($aFlag=true)

    +

    Hide all tick marks

    +
  • +

    RadarGraph::ShowMinorTickmarks($aFlag=true)

    +

    Enable/Disable tick marks

    +
  • +

    RadarGraph::SetTickDensity($aDensity=TICKD_NORMAL)

    +

    Adjust the tick density

    +

+

+
+

Adjusting grid lines for the radar graph

+ +

Each major tick mark can also be connected together to create a grid in the + graph. The grid is accessed through the '$grid' property of the + graph. To enable the grid and set the line style to "dotted" the following two + lines must be added

+

+

1
+2
+
$radargraph->grid->Show ();
+$radargraph->grid->SetLineStyle( 'dashed' );

+

+

An example of dashed grid lines are shown in Figure 16.37. Enabling a dashed grid line (radarex4.php) . By default the grid lines have a gray color and are drawn behind the radar + plot and hence part of the grid lines are obscured.

+

The property of the grid lines are adjusted by accessing the + "$grid" line. The available methods to format grid lines + are:

+

+

  • +

    RadarGraph::grid::Show($aShowMajor=true)

    +

    Enable grid lines

    +
  • +

    RadarGraph::grid::SetColor($aMajColor)

    +

    Set the color of the grid lines

    +
  • +

    RadarGraph::grid::SetWeight($aWeight)

    +

    Set the weight of the grid line

    +
  • +

    RadarGraph::grid::SetLineStyle($aType)

    +

    Set the line style, can be one of + "dotted","dashed","long-dash","solid"

    +

+

+

To make the grid lines in Figure 16.37. Enabling a dashed grid line (radarex4.php) more visible lets + change the color by using the SetColor() method on the grid. In + addition we can also adjust the background color. The result of this is shown in + Figure 16.38. Enabling a dashed grid line with red (radarex6.php)

+

+

+
+

Figure 16.37. Enabling a dashed grid line (radarex4.php)

Enabling a dashed grid line (radarex4.php)

+
+

Figure 16.38. Enabling a dashed grid line with red (radarex6.php)

Enabling a dashed grid line with red (radarex6.php)

+
+

+

+
+

Using a logarithmic scale

+ +

In order to change the (default) linear scale o the axis to use logarithmic + scale the following line must be added:

+

+

1
+
$graph->SetScale('log');

+

+

+ Figure 16.39. Using a logarithmic scale (radarlogex1.php) shows an example of a logarithmic radar + graph

+

+

Figure 16.39. Using a logarithmic scale (radarlogex1.php)

Using a logarithmic scale (radarlogex1.php)


+

+
+

Enabling anti-aliasing for radar graphs

+ +

Radar graph are an excellent example where enabling anti-alias can make a + large visual difference. In order to enable anti-aliasing the method

+

+

  • +

    RadarGraph::img::SetAntiAliasing($aFlg=true)

    +

+

+

must be called, for example as in

+

+

1
+
$radargraph->img->SetAntiAliasing();

+

+

To give an example of this Figure 16.40. Enabling anti-alias for the logarithmic radar example (radarlogex1-aa.php) shows an + anti-aliased version of Figure 16.39. Using a logarithmic scale (radarlogex1.php) . (Another + comparative example of enabling anti-aliasing is also given in Figure 14.80. Plain radar plot (radarex8.php) and Figure 14.81. Anti-aliased radar plot (radarex8.1.php) .)

+

+

Figure 16.40. Enabling anti-alias for the logarithmic radar example (radarlogex1-aa.php)

Enabling anti-alias for the logarithmic radar example (radarlogex1-aa.php)


+

+

+

Caution

+

Remember the limitation when using anti-aliasing that lines will be + given line weight=1 regardless of the specified weight.

+

+

+
+

A final example

+ +

As a final example we shown a radar graphs were we have adjusted many of the + available properties, such as specifying a manual scale, to achieve the result + shown in Figure 16.41. A more complex example of a radar graph with a manual scale (fixscale_radarex1.php)

+

+

Example 16.5. A more complex example of a radar graph with a manual scale (fixscale_radarex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+$graph = new RadarGraph(300,300);
+$graph->SetScale('lin',0,50);
+$graph->yscale->ticks->Set(25,5);
+$graph->SetColor('white');
+$graph->SetShadow();
+ 
+$graph->SetCenter(0.5,0.55);
+ 
+$graph->axis->SetFont(FF_FONT1,FS_BOLD);
+$graph->axis->SetWeight(2);
+ 
+// Uncomment the following lines to also show grid lines.
+$graph->grid->SetLineStyle('dashed');
+$graph->grid->SetColor('navy@0.5');
+$graph->grid->Show();
+ 
+$graph->ShowMinorTickMarks();
+ 
+$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'));
+ 
+$plot = new RadarPlot(array(12,35,20,30,33,15,37));
+$plot->SetLegend('Goal');
+$plot->SetColor('red','lightred');
+$plot->SetFillColor('lightblue');
+$plot->SetLineWeight(2);
+ 
+$graph->Add($plot);
+$graph->Stroke();
+ 
+?>


Figure 16.41. A more complex example of a radar graph with a manual scale (fixscale_radarex1.php)

A more complex example of a radar graph with a manual scale (fixscale_radarex1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch16s03.html b/includes/jpgraph/docs/chunkhtml/ch16s03.html new file mode 100644 index 0000000..ff92a62 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch16s03.html @@ -0,0 +1,313 @@ +Polar graphs

Polar graphs

+ +

In order to create Radar graphs the module + "jpgraph_polar.php" must first be included.

+

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 class PolarGraph. + The polar graph type inherits all the capabilities of ordinary x,y graphs, i.e they + can have background images, background gradients, formatted titles, using tabbed + titles etc.

+

There are two types of polar graphs, full 360 degree view or just 180 degree view. + The figures below show the difference between these two graph types.

+

+

+
+

Figure 16.42. A full 360 degree polar graph (polarex0.php)

A full 360 degree polar graph (polarex0.php)

+
+

Figure 16.43. A 180 degree (half) polar graph (polarex0-180.php)

A 180 degree (half) polar graph (polarex0-180.php)

+
+

+

+

The choice is controlled with the method

+

+

  • +

    PolarGraph::SetType($aType)

    +

    $aType is specified with the symbolic defines

    +

    +

    • +

      POLAR_360, The default

      +
    • +

      POLAR_180

      +

    +

    +

+

+

As an example of using some more of the available formatting that is discussed in + later sections Figure 16.44. A 360 polar plot with background gradient and alpha blending (polarex7-2.php) shown a full 360 degree plot + with both background gradient as well as using alpha blending for the fill of the + polar plot.

+

+

Figure 16.44. A 360 polar plot with background gradient and alpha blending (polarex7-2.php)

A 360 polar plot with background gradient and alpha blending (polarex7-2.php)


+

+

+

Rotating the polar graph

+ +

+

Caution

+

There is a bug in versions before v3.0.4 so that a rotated polar graph + must always have equal margins on all side to work as expected.

+

+

+

By default the start angle (angle=0) is located at the 3'a clock position. By + calling the method Graph::Set90AndMargin() it is possible to rotate + the graph so that the 0-angle position is at the 6'a clock position (straight + down). This is mostly used for full 360 degree graphs.

+
+

Changing the angle direction

+ +

+

Note

+

This is only available in v3.0.4 of the library and above.

+

+

+

By default the angle is counted counter-clockwise as is custom in most + application of polar plots. However, it is also possible to have the angles + counted clockwise. This is done by calling the method + Graph::SetClockwise().

+

In the following two examples we show a full 360 degree polar plots with + clockwise ordering in both a standard configuration and also as a 90 degrees + rotated graph.

+

+ + + + + + + +
+

Figure 16.45. Clockwise polar graph (polarclockex1.php)

Clockwise polar graph (polarclockex1.php)

+
+

Figure 16.46. Rotated clockwise polar graph (polarclockex2.php)

Rotated clockwise polar graph (polarclockex2.php)

+
+

+
+

Adding polar plots to a polar graph

+ +

The principle is exactly the same as for line plots but instead of an x-y + coordinate each point is represented by a angle and a radius to specify its + position. The data is given in the format

+

+

1
+
$data = array(angle1, radius1, angle2, radius2, ...)

+

+

Creation of a single polar plot follows the now familiar structure as shown in + the following code snippet

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+...
+// Setup the graph
+$graph = new PolarGraph($width,$height);
+ 
+// Set a logarithmic scale with 100 as the maximum value, i.e. 10^2
+$graph->SetScale('log',100);
+ 
+// Use a full 360 degree polar graph
+$graph->SetType(POLAR_360);
+ 
+// Create a plot with marks
+$polarplot = new PolarPlot($data);
+$polarplot->mark->SetType(MARK_SQUARE);
+ 
+// Add it to the graph
+$graph->Add($polarplot);
+...
+?>

+

+

Adding multiple polar plots follows the same pattern. Each polar plot is + created as an instance of class PolarPlot and then added to the + graph.

+
+

Adding plot-marks to polar plots

+ +

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 instance variable

+

+

  • +

    PolarPlot::mark

    +

+

+

(All available plot marks are listed in Appendix E. Available plot marks)

+

For example to add a square marker (with the default color) the following line + must be added

+

+

1
+
$polarplot->mark->SetType(MARK_SQUARE);

+

+

In Figure 16.47. Adding plot marks to a polar graph (polarex7-1.php) we show a polar graph with added + plot-marks. In addition we have added a gradient background.

+

+

Figure 16.47. Adding plot marks to a polar graph (polarex7-1.php)

Adding plot marks to a polar graph (polarex7-1.php)


+

+
+

Client Side Image maps

+ +

(See Chapter 10. Using CSIM (Client side image maps) for a full description on the usage + of CSIM together with the library)

+

If markers are shown 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 snippet shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+// Start by specifying the proper URL targets
+$targets  = array( "#1" , "#2" , ....... );
+$polarplot = new PolarPlot( $data );
+$polarplot->mark->SetType( MARK_SQUARE );
+$polarplot->SetCSIMTargets( targets );
+$graph->Add( $polarplot );
+$graph->StrokeCSIM(); 
+?>

+

+
+

Adjusting the radius scale

+ +

The radius axis can be shown in either a linear or logarithmic scale. This is + controlled by a call to

+

+

  • +

    PolarGraph::SetScale($aScale,$aRadiusMax=0)

    +

    Supported scale types for $aScale are the strings + "lin" or "log". The second argument is + an optional manual setting of the maximum scale value for the + radius.

    +

+

+

The two examples below show the same plot in either linear or logarithmic + scale for the radius

+

+

+
+

Figure 16.48. Linear scale for radius (polarex3-lin.php)

Linear scale for radius (polarex3-lin.php)

+
+

Figure 16.49. Logarithmic scale for radius (polarex3.php)

Logarithmic scale for radius (polarex3.php)

+
+

+

+

Please note that the maximum values of the scales are different.

+

By default the scale will be auto scaled depending on the data. It is also + possible to specify a manual scale by supplying an extra argument to the + SetScale() method.

+

The only difference from the manual scaling with the standard x-y-graphs is + that for polar graph only the maximum value is manually specified. 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.

+

+

Note

+

The plot is always clipped to the plot area.

+

+

+
+

Adjusting the grid lines

+ +

The graph allows several formatting option for the grid lines. For polar plots + there are two types of grid lines, the angle and the radius grid lines.

+

Grid lines format is controlled by

+

+

  • +

    PolarAxis::ShowGrid($aMajor=true,$aMinor=false,$aAngle=true)

    +

    Decide if the major,minor and angle grid line should be displayed +

    +
  • +

    PolarAxis::SetGridColor($aMajorColor,$aMinorColor='',$aAngleColor='')

    +

    Specify the color for the major,minor and angel grid

    +
  • +

    PolarAxis::SetAngleStep($aStep)

    +

    This specifies the angle distance between two consecutive angel + scale marks in degrees. By default the step size is 15 + degrees.

    +

+

+

The two example below shows a logarithmic plot with either just major grid + lines or both minor and major grid lines.

+

+

+
+

Figure 16.50. Logarithmic scale with only major grid lines (polarex4.php)

Logarithmic scale with only major grid lines (polarex4.php)

+
+

Figure 16.51. Logarithmic scale with both major and minor grid lines (polarex5.php)

Logarithmic scale with both major and minor grid lines (polarex5.php)

+
+

+

+
+

Adjusting the labels

+ +

It is possible to individually specify different fonts and colors for the + angle and the radius labels.

+

+

  • +

    PolarAxis::SetFont() +

    +

    Adjust the radius font

    +
  • +

    PolarAxis::SetAngleFont()

    +

    Adjust the radius font

    +
  • +

    PolarAxis::SetColor()

    +

    Adjust the radius color

    +

+

+

The following example specifies different color for the labels. it also shows + how to 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.

+

+

Figure 16.52. Different colors for labels, specifying both a tabbed title as well as a axis title (polarex9.php)

Different colors for labels, specifying both a tabbed title as well as a axis title (polarex9.php)


+

+

+

Note

+

As can be seen from the previous examples the angle labels have a + degree mark "°" by default if the font used is a TTF font (the degree + symbol is not available for bitmap fonts) after each label. It is + possible to select if this degree mark should be displayed or not with a + call to the method PolarAxis::SetAngleDegreeMark().

+

+

+

+

Note

+

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.

+

+

+

+

Note

+

A common modification for polar plots is to disable the display of 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 can be see this has been + used in some of the examples in this chapter.

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch16s04.html b/includes/jpgraph/docs/chunkhtml/ch16s04.html new file mode 100644 index 0000000..74a9f33 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch16s04.html @@ -0,0 +1,2383 @@ +Gantt charts

Gantt charts

+ +

Gantt charts are used to give an easy overview of the extension in time of one or several + activities (possible grouped). In addition the gantt chart can show an ordinal relation + between one or several activities such as "activity A needs to be + finished before activity B can start".

+

The shape of each activity can also be adjusted as well as color and size. Some of the + capabilities of the Gantt module in the library are listed below.

+

+

  • +

    Overall gantt graph features

    +

    +

    • +

      Visualization of constraints between activities, start-to-start, + start-to-end, end-to-start and end-to-end

      +
    • +

      Unlimited number of activities (up to memory and time constrains + of PHP)

      +
    • +

      Full support for independent CSIM for both labels and activity + bars

      +
    • +

      Support for visualization of grouped activities

      +
    • +

      Gantt charts can be automatically sized according to the number of + bars and scale used.

      +
    • +

      Supports title and subtitle with user specified font, size and + color

      +
    • +

      Supports vertical marker lines with text

      +
    • +

      Full support for CSIM (or drill down graphs)

      +
    • +

      Alternate row colors

      +

    +

    +
  • +

    Scale features

    +

    +

    • +

      Both automatic and fully automatic scale

      +
    • +

      Flexible scale with options to display up to 6 lines of scale + headers (year,month,week,day,hour,minute)

      +
    • +

      Supports platform independent Week number calculation according to + ISO:8601

      +
    • +

      Scales grids are intelligent not to overwrite smaller resolution + scales

      +
    • +

      Scale headers can be localized

      +
    • +

      Full user configurable scales

      +
    • +

      Each scale header is configurable in terms of font, size, color, + background, grid lines etc.

      +

    +

    +
  • +

    Activity bars

    +

    +

    • +

      can have multiple patterns and colors

      +
    • +

      can have progress indicators

      +
    • +

      can have drop shadow

      +
    • +

      titles can have individual fonts, colors and backgrounds

      +
    • +

      can have captions

      +
    • +

      can have specified left- and right end markers

      +
    • +

      heights can be specified in absolute pixels or in percent of the + activity line width

      +

    +

    +
  • +

    Milestones

    +

    +

    • +

      can have user selectable shape and color

      +
    • +

      titles can have individual fonts, colors and backgrounds

      +
    • +

      can have captions

      +

    +

    +

+

+

An example of a small Gantt chart is shown in Figure 16.53. A typical small Gantt chart (ganttmonthyearex2.php)

+

+

Figure 16.53. A typical small Gantt chart (ganttmonthyearex2.php)

A typical small Gantt chart (ganttmonthyearex2.php)


+

+

The remainder of this section will be used to discuss most of the formatting options for + Gantt charts.

+

Note

+

There is one restrictions of the date scale and that is that it cannot have any + "holes" the dates must be continues.

+
+

The structure of a Gantt chart

+ +

To understand the terminology used for Gantt chart Figure 16.54. Building block of a Gantt chart shows a typical chart with indications of + the name of each main building block of the chart.

+

+

Figure 16.54. Building block of a Gantt chart

+ +
Building block of a Gantt chart
+


+

+

In addition to the specific Gantt formatting that will be discussed in the following + sections all the previously explained graph embellishment like the options of adding + texts, icons, changing font and color of titles, adding footers etc. are also available + for Gantt charts.

+

A Gantt chart is made up of four distinct areas:

+

+

  1. +

    On the left side there is the activity title column.

    +
  2. +

    On the top there is the scale headers (up to six headers may be + displayed)

    +
  3. +

    The actual plot area where all the activity Gantt bars and markers are + placed

    +
  4. +

    The margin area, where for example the titles are shown

    +

+

+

The steps to crate a Gantt charts is similar to creating a cartesian plot. First an + instance of the main graph canvas is created (as an instance of class + GanttGraph) and then one or more "plots" are created an added to the graph. + For Gantt graph the "plots" that can be added are typically

+

+

  • +

    Activity bars (we will also use the name Gantt bars as synonym) that + indicates the length (and possible progress) of one activity. An activity + bar is created as an instance of class GanttBar

    +
  • +

    Milestone marks, this can be thought of as a special activity bar with + length = 0 and is often used to indicate a milestone or a deadline in the + Gantt chart. A milestone is created as an instance of class + Milestone

    +
  • +

    A phase divider, this is a vertical line that can be added at specific + dates and is often used to mark then end and beginning of phases i a + project. A divider is created as an instance of class + GanttVLine (for Gantt Vertical Line)

    +
  • +

    A background pattern for a specific date range, this is often used to + indicate holidays, public holidays or periods of special interest in the + project

    +
  • +

    An arbitrary icon, this is either a predefined image or one of the built + in markers in the library. This is created as an instance of class + IconImage

    +

+

+

All these objects may be extensively modified in terms of formatting., colors (both + fill- and frame color), size, titles, style and patterns etc. All objects have basic + default values so it is not strictly speaking necessary to adjust them. However, the + basic default values will give the charts a very simple look.

+
+

Creating a Gantt graph

+ +

In order to create a Gantt graph the module "jpgraph_gantt.php" + must be included together with the core module "jpgraph.php"

+

A Gantt graph is created as an instance of class GanttGraph which + inherits much of the same formatting options available for standard x-y graphs, for + example titles, backgrounds, adding icons, adding texts and so on.

+

There is one crucial difference between all the other graph types and Gantt charts and + that is the fact that for all other graphs both the height and width of the graph must + be specified. For Gantt graphs this is not true.

+

Gantt graphs can be either

+

+

  • +

    fully automatically sized

    +
  • +

    have the width specified but the height automatically determined by the + number of activities added to the graph

    +
  • +

    fully specified with both width and height

    +

+

+

This means that all the following gantt graph creations are valid

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+// Fully automatic
+$ganttgraph = new GanttGraph();
+ 
+// Semi automatic (automatically determined height)
+$ganttgraph = new GanttGraph(800);
+ 
+// Fully manual
+$ganttgraph = new GanttGraph(800,500);
+?>

+

+

+

Note

+

If the specified width and height is too small to have room for all the + activities specified the activities will be clipped to the specified date + range.

+

+

+

The creation of a full Gantt graph follows the now familiar pattern of

+

+

  1. +

    Create the graph (as shown above) and specify the overall formatting + options (e.g. titles, colors etc)

    +
  2. +

    Create the plot objects that should be added to the graph (e.g. activity + bars, milestones, icons, texts etc) and format them as wanted

    +
  3. +

    Add the object to the graph, with a call to + GanttGraph::Add(), i.e. the activities, milestones etc.

    +
  4. +

    Send the graph back to the client or save it directly to a file, with a + call to GanttGraph::Stroke()

    +

+

+

Note

+

Even though there is no limit for the size of the Gantt chart (apart from + available memory and execution time limit specified in + "php.ini") the library defines two constants + MAX_GANTTIMG_SIZE_W and MAX_GANTTIMG_SIZE_H that sets + the maximum allowed image size for a Gantt chart. This is primarily meant to + discover scripts gone wrong that tries to make very large images (perhaps by some + non-properly terminating loops). If the overall image size becomes larger than these + limit an error message will be shown.

+
+
+

Adjusting the scale headers

+ +

A gantt chart must always have at least one scale header and at most six scale headers + (see Figure 16.54. Building block of a Gantt chart). Usually it is not advisable to + use more than three scale headers at the same time. Having multiple scale headers allow + the specification of the same date range but with different resolutions.

+

The library makes six different scale headers available which is identified by a + symbolic constant that is logically combined to specify the wanted headers using the + method

+

+

  • +

    GanttGraph::ShowHeaders($aHeaderSelection)

    +

+

+

The $aHeaderSelection argument is a binary combination of one or more of + the following specifiers that indicates the interval used in the header

+

+

  1. +

    GANTT_HMIN, Minute interval header (See Minute scale for label format options)

    +
  2. +

    GANTT_HHOUR, Hour interval header (See Hour scale for label format options)

    +
  3. +

    GANTT_HDAY, Day interval header (See Day scale for label format options)

    +
  4. +

    GANTT_HWEEK, Week interval header (See Week scale for label format options)

    +
  5. +

    GANTT_HMONTH, Month interval header (See Month scale for label format options)

    +
  6. +

    GANTT_HYEAR, Year interval header (See Year scale for label format options)

    +

+

+

For example to show a year, month and week header the following line would be + used

+

+

1
+
$graph->ShowHeaders( GANTT_HYEAR | GANTT_HMONTH | GANTT_HWEEK );

+

+

Any combination of the listed headers above can be used. The scale headers will always + be drawn with the larger header rage on top ot a header with smaller range.

+

Scale headers week, day, hour , minute have a minimum span of 1 unit. This means that + if, for example, the week header is displayed the minimum width of the overall scale is + one week.

+

+

Caution

+

The overall minimum size of the scale regardless of what scale headers are + displayed is one day. This means that it is not possible to just create a Gantt + graph with , say 6 hour.

+

+

+

Specifying the wanted headers is the first step in controlling the header. The next + step is to specify the format that should be used to print the date label in each of the + selected headers. For example the week interval header will have a label at the start of + every week. This could for example be indicated as week number, day of month, full date + and so on. In order to adjust the headers the appropriate header instance variable must + be access. The header instance variables are

+

+

  1. +

    Graph::scale::minute

    +
  2. +

    Graph::scale::hour

    +
  3. +

    Graph::scale::day

    +
  4. +

    Graph::scale::week

    +
  5. +

    Graph::scale::month

    +
  6. +

    Graph::scale::year

    +

+

+

The connection with the scale headers are shown in Figure 16.55. The Gantt scale properties which shows a cut out part of a larger gantt + chart

+

+

Figure 16.55. The Gantt scale properties

+ +
The Gantt scale properties
+


+

+

All the headers are an instance of class HeaderProperty and supports the + following formatting methods

+

+

  • +

    HeaderProperty::SetFont($aFontFamily,$aFontStyle,$aFontSize)

    +

    Specify the font to be used for the label

    +
  • +

    HeaderProperty::SetFontColor($aColor)

    +

    Specify the font color to use

    +
  • +

    HeaderProperty::SetStyle($aStyle)

    +

    The style depends on the actual header and all available styles for each + header are shown below. The style specifies the format used for the scale + header label

    +
  • +

    HeaderProperty::SetBackgroundColor($aColor)

    +

    Set the header background color

    +
  • +

    HeaderProperty::SetFrameWeight($aWeight)

    +

    Specify the weight of the frame around the scale header

    +
  • +

    HeaderProperty::SetTitleVertMargin($aMargin)

    +

    Specifies the margin between this header and the next header (usually + there is no need to adjust this)

    +
  • +

    HeaderProperty::SetInterval($aInterval)

    +

    Specifies the interval between each scale label. For example specifying

    +

    +

    1
    +
    $graph->scale->hour->SetInterval(6);

    +

    +

    Will step the hour label 6 hours for each label

    +

+

+

So for example to set the font of the month header the following line would be + used

+

+

1
+
$ganttgraph->scale->month->SetFont(FF_ARIAL,FS_NORMAL,10);

+

+

In addition to these methods each scale also has the property '$grid' + which determines the appearance of grid lines for that specific scale. It is possible to + adjust the appearance of the grid lines by the "normal" line methods, i.e.

+

+

  • +

    SetColor($aColor), Set the grid color

    +
  • +

    SetWeight($aWeight), Set the grid line weight

    +
  • +

    SetStyle($aLineStyle), Set the grid line style, i.e. + "solid", "dotted", "dashed", + "long-dashed"

    +
  • +

    Show($aFlg=true), Enable the grid line

    +

+

+

So for example to enable the week grid line and set it to red color the following + lines would be needed

+

+

1
+2
+
$graph->scale->week->grid->Show();
+$graph->scale->week->grid->SetColor( 'red' );

+

+

The automatic grid lines have some "intelligence" so that higher resolution scales + will not cut through part ways of scale headers with lower resolution (such as a year + grid line cutting through the middle of a week).

+

+

Tip

+

It is possible to specify a zoom factor for the scale that adjusts how wide + the automatic sized header should be. See Adjusting the scale zoom factor + for more details.

+

+

+

Minute scale

+ +

Minute scale is enabled by adding the GANTT_HMIN in the + GanttGraph::ShowHeaders() call, for example as the following line + shows

+

+

1
+
$graph -> ShowHeaders ( GANTT_HDAY  |  GANTT_HHOUR  |  GANTT_HMIN );

+

+

The SetStyle($aStyle) method supports the following label + styles

+

+

  • +

    MINUTESTYLE_MM

    +

    This will display minutes as a two digit number with a leading zero if + necessary

    +
  • +

    MINUTESTYLE_CUSTOM

    +

    This will let you specify you own custom minute style by making a call + to HeaderProperty:: SetFormatString()

    +

    The format string is specified as a format string for the + date() function (See PHP + Manual)

    +

+

+
+

Hour scale

+ +

Minute scale is enabled by adding the GANTT_HHOUR in the + GanttGraph::ShowHeaders() call, for example as the following line + shows

+

+

1
+
$graph -> ShowHeaders ( GANTT_HDAY  |  GANTT_HHOUR  |  GANTT_HMIN );

+

+

The SetStyle($aStyle) method supports the following label + styles

+

+

  • +

    HOURSTYLE_HM24

    +

    Will display the only the hour in military time 0-24 , for example + 13:00

    +
  • +

    HOURSTYLE_H24

    +

    Will display the hour with both hour and minute in military time 0-24, + for example 13

    +
  • +

    HOURSTYLE_HMAMPM

    +

    Will display the hour and minutes with a suitable am/pm postfix, for + example 1:30pm

    +
  • +

    HOURSTYLE_HAMPM

    +

    Will display only the hour with a suitable am/pm postfix, for example + 1pm

    +
  • +

    HOURSTYLE_CUSTOM

    +

    Custom defined format as specified with a call to + HeaderProperty::SetFormatString()

    +

    The format string is specified as a format string for the + date() function (See PHP + Manual)

    +

+

+

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 a divisor of 24 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 custom colors

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$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 in Figure 16.56. Gantt chart with day and hour scale enabled (gantthourex1.php) below shows a gantt chart + with the day and hour scale enabled. In this example we have also added a gradient + background to show some formatting options.

+

+

Figure 16.56. Gantt chart with day and hour scale enabled (gantthourex1.php)

Gantt chart with day and hour scale enabled (gantthourex1.php)


+

+
+

Day scale

+ +

The SetStyle($aStyle) method supports the following label + styles

+

+

  • +

    DAYSTYLE_ONELETTER,

    +

    On letter week day. Example "M"

    +
  • +

    DAYSTYLE_LONG,

    +

    Full week day. Example "Monday"

    +
  • +

    DAYSTYLE_LONGDAYDATE1,

    +

    Day with date. Example "Monday 23 Jun"

    +
  • +

    DAYSTYLE_LONGDAYDATE2,

    +

    Day with date+year. Example "Monday 23 Jun 2003"

    +
  • +

    DAYSTYLE_SHORT,

    +

    Short date. Example "Mon"

    +
  • +

    DAYSTYLE_SHORTDAYDATE1,

    +

    Short date+date. Example "Mon 23/6"

    +
  • +

    DAYSTYLE_SHORTDAYDATE2,

    +

    Short date+date. Example "Mon 23 Jun"

    +
  • +

    DAYSTYLE_SHORTDAYDATE3,

    +

    Short date+date. Example "Mon 23"

    +
  • +

    DAYSTYLE_SHORTDATE1,

    +

    Short date. Example "23/6"

    +
  • +

    DAYSTYLE_SHORTDATE2,

    +

    Short date. Example "23 Jun"

    +
  • +

    DAYSTYLE_SHORTDATE3,

    +

    Short date. Example "Mon 23"

    +
  • +

    DAYSTYLE_SHORTDATE4,

    +

    Short date. Example "23"

    +
  • +

    DAYSTYLE_CUSTOM,

    +

    Custom specified formatting string. Example "%A"

    +

    The format string is specified as a format string for the + strftime() function (See PHP + Manual)

    +

    +

    Caution

    +

    Note that the day format string is a format string for + strftime() while the format string for hour and + minutes are given as a format string for the date() + function. This inconsistency purely exists for historic reasons + and is kept not to break existing scripts.

    +

    +

    +

+

+

Example:

+

+

1
+
$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.

+

+

  • +

    HeaderProperty::SetWeekendColor($aColor)

    +

    Set the background color for weekends. (Defaults to light gray)

    +
  • +

    HeaderProperty::SetSundayFontColor($aColor)

    +

    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 which is + the default. Since that is a property more of the whole plot this behavior is + modified with a call to the method

+

+

  • +

    GanttScale::UseWeekendBackground($aFlg=true)

    +

    Example:

    +

    +

    1
    +2
    +
    // Don't use background for weekend in the plot area
    +$graph->scale->UseWeekendBackground(false);

    +

    +

+

+

+

Note

+

The actual text displayed is dependent on the Locale used. See Localizing the Gantt chart scale

+

+

+
+

Week scale

+ +

Week scales, if enabled, by default shows the week number in range 1 to 53 (as + defined by ISO-8601)

+

+

Note

+

It might be worth pointing out here that the week number calculation is + carried out within the library and does not rely on the underlying OS date + libraries. This makes the behavior consistent over several OS:s (at least MS + Windows does not comply to ISO-8601 or supply any way of doing this through + the normal libraries, e.g. strftime())

+

+

+

The SetStyle($aStyle) method supports the following label + styles

+

+

  • +

    WEEKSTYLE_WNBR

    +

    Show week number. To further modify the formatting of the actual week + number it is possible to optionally supply a format string with a call + to

    +

    +

    • +

      HeaderProperty::SetLabelFormatString($aFormat)

      +

      The format for this string is the same format used for the + sprintf() function and formats the week + number given as an integer.

      +

      +

      Caution

      +

      Note that the day format string is a format string + for sprintf() while the format string + for hour and minutes are given as a format string + for the date() function. This + inconsistency purely exists for historic reasons and + is kept not to break existing scripts.

      +

      +

      +

    +

    +
  • +

    WEEKSTYLE_FIRSTDAY

    +

    Show date of first day in week.

    +
  • +

    WEEKSTYLE_FIRSTDAY2

    +

    Show date of first day in week and short month

    +
  • +

    WEEKSTYLE_FIRSTDAYWNBR

    +

    Show week number of first day in week.

    +
  • +

    WEEKSTYLE_FIRSTDAY2WNBR

    +

    Show week number of first day in week and month

    +

+

+

Example:

+

+

1
+
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);

+

+

+

Note

+

The actual text displayed for month is dependent on the Locale used. See + Localizing the Gantt chart scale

+

+

+
+

Month scale

+ +

The SetStyle($aStyle) method supports the following label + styles

+

+

  • +

    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

    +

+

+

Example:

+

+

1
+
$graph->scale->month->SetStyle(MONTHSTYLE_LONGNAME);

+

+
+

Year scale

+ +

Year scale has no extra formatting possibilities it is always displayed as a four + digit number , e.g. "2009"

+
+
+

Adding gantt objects to the chart

+ +

Gantt objects are primarily instances of one of two classes

+

+

  1. +

    class GanttBar

    +

    This is the main activity added to a Gantt chart to show the extension in + time of one activity, a gantt bar

    +
  2. +

    class Milestone

    +

    This activity is a special case of an activity with zero extension, + usually indicating a milestone or a deadline

    +
  3. +

    class VLine

    +

    This is similar so a millstone as it has no extension in time. Instead + this object is visually represented as a vertical line that crosses the + entire graph plot area. This is often used to mark, for example, phases in a + project.

    +

+

+

To add a Gantt objects there are two compulsory parameters that must be set. These + parameters specify on what row and at what date the activity should start at.

+

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 one could + imagine a number of "invisible" horizontal bands with a certain height. If the vertical + position is specifies as 0 the bar will be placed in the first band, specify 3 and the + bar will be placed in the fourth band and so on.

+

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:

+

+

  1. +

    If layout=GANTT_FROMTOP (the default and most common) the + height will equal the height (+ a margin) of the highest gantt bar. The + height calculation of each bar takes into account both the actual bar, the + title, and any left- right-marks (more about that later) that may be + present.

    +

    The name "fromtop" refers to that when the height is explicitly specified + the bars will usually be added from band 0 and onwards and hence being added + from the top. (This might leave empty space at the bottom of the plot area + in the graph if the height of the graph has been explicitly + specified).

    +
  2. +

    If layout=GANTT_EVEN the bars are evenly (hence the name) + spread out over the available height in the gantt chart and no consideration + is taken of the individual bars heights. Note that if you use automatic + sizing even layout cannot be used. (It just doesn't make sense). Even layout + is for those cases when a large area is specified and the bars should be + evenly distributed using the full height.

    +

+

+

So in summary each object must have two position parameters.

+

+

  1. +

    Which row the gantt object should be drawn + on.

    +

    This should be a positive integer in the range (0, ...), It is perfectly + legal to specify a large vertical position with no other object above as + shown in Figure 16.59. Specifying a large vertical position (ganttex03.php)

    +
  2. +

    Which start and end date (or dates) the object + should have.

    +

    Start of bars are given as a date string. The format depends on the + current locale. Examples of valid date strings are

    +

    +

    • +

      "2001-10-22"

      +
    • +

      "2001-10-22"

      +
    • +

      "22 Oct 2001"

      +

    +

    +

    Even if several format are supported it is recommended to use all numeric + dates, i.e in the form "2001-10-22".

    +

    +

    Caution

    +

    Watch our for the locale used since, for example, "2008-05-10" can + have two meanings.

    +

    +

    +

    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:

    +

    +

    • +

      "2001-11-15"

      +
    • +

      "15 Nov 2001"

      +
    • +

      22, (specifies duration of 22 days)

      +
    • +

      22.7, (specifies duration of 22.7 days)

      +

    +

    +

    Please note that duration must be specified as numerical values and not as + a string.

    +

+

+

Usually at least one or more of the following parameter is also specified

+

+

  1. +

    The title of the gantt object

    +
  2. +

    The caption of the object. This is a text string that is drawn beside the + object on the gantt chart

    +
  3. +

    Color and any optional patterns to separate different activities

    +
  4. +

    When applicable the state of a progress indicator (see Adding progress indicators)

    +

+

+

Adding Gantt activity bars

+ +

Instances of class GanttBar is created with the constructor

+

+

  • +

    GanttBar::__construct($aPos,$aLabel,$aStart,$aEnd,$aCaption="",$aHeightFactor=0.6)

    +

    $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]

    +

+

+

In order to illustrate this we will create a the most basic (and simple ) Gantt + chart possible. This will consist of just a chart with one activity bar.

+

+

Example 16.6. The simplest possible Gantt graph (ganttex00.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+// A new graph with automatic size
+$graph = new GanttGraph();
+ 
+//  A new activity on row '0'
+$activity = new GanttBar(0,"Activity 1","2001-12-21","2002-01-19");
+$graph->Add($activity);
+ 
+// Display the Gantt chart
+$graph->Stroke();
+?>


Figure 16.57. The simplest possible Gantt graph (ganttex00.php)

The simplest possible Gantt graph (ganttex00.php)


+

+

The example above will make use of just the default settings for all formatting + parameters but still manage to create a perfectly readable Gantt chart with only 4 + lines of real code. We can note a couple of things

+

+

  • +

    By default two scale headers are used, week and day resolution

    +
  • +

    Weekends will have a gray background

    +
  • +

    Sunday scale header uses red for the "Sunday"

    +

+

+

Lets now take the above simple graph and make a few small alterations.

+

+

  • +

    We will add graph titles

    +
  • +

    We will change the pattern and color of the activity bar

    +
  • +

    We will adjust the scale headers so er have three headers and use the + date of the start day for each week (in the week scale)

    +

+

+

+

Figure 16.58. Making some minor alterations to the Gantt graph (ganttex01.php)

Making some minor alterations to the Gantt graph (ganttex01.php)


+

+

To show the effect of row positioning Figure 16.59. Specifying a large vertical position (ganttex03.php) shows + the effect of adding a bar to row 7. This will as can be seen create graph that is + mostly empty sine row 0-6 have no specified gantt objects.

+

+

Figure 16.59. Specifying a large vertical position (ganttex03.php)

Specifying a large vertical position (ganttex03.php)


+

+

The height of the bars can also be adjusted. The horizontal spacing between each + bar is based on the highest single bar including the size of the title. By default + the height of the bar is 60% of the overall vertical size allocated to each row (all + the rows have the same height).

+

The height of the bar can be specified as either as an absolute number of pixels + or as a fraction of the row height. Since by default the bar height is 60% this + means that if any single line has, for example, a large title all the rows will be + adjusted to the same size and hence the bars will also be adjusted to fill 60% of + the new width.

+
+

Adding milestones

+ +

Instances of class Milestone is created with the constructor

+

+

  • +

    MileStone::__construct($aVPos,$aLabel,$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

+

+

1
+2
+
$ms4 = new MileStone(3, 'Code complete', '2001-12-01'); 
+$ms5 = new MileStone(3, 'Ready for test', '2002-01-06');

+

+

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 class PlotMark. See Adding markers to the Gantt bars.

+

To change the shape of a milestone to, say a triangle, you use the + SetType() method as in

+

+

1
+
$ms4->mark->SetType( MARK_DTRIANGLE );

+

+

An example of adding a milestone to a gantt graph is shown in Figure 16.60. Adding a milestone marker to a gantt graph (ganttex04.php)

+

+

Figure 16.60. Adding a milestone marker to a gantt graph (ganttex04.php)

Adding a milestone marker to a gantt graph (ganttex04.php)


+

+

We note that;

+

+

  • +

    By default the title of a milestone is set in a red color. To change + the title the "$title" property of the milestone must be + accessed. For example

    +

    +

    1
    +
    $milestone->title->SetColor('black');

    +

    +
  • +

    A milestone has a caption in exactly the same way as an ordinary gantt + bar

    +
  • +

    Milestones are added to the graph with the usual + GanttGraph::Add()

    +

+

+
+

Adding vertical lines (GanttVLine)

+ +

Instances of class GanttVLine is created with the constructor

+

+

  • +

    GanttVLine::__construct($aDate,$aTitle='',$aColor='darkred',$aWeight=2,$aStyle='solid')

    +

    $aDate Date for the milestone

    +

    $aTitle Title for the line. The title is displayed at the + bottom of the line

    +

    $aColor Color of the line

    +

    $aWeight Line width

    +

    $aStyle Line style, specified as a string + "dashed", "dotted" and so on

    +

+

+

By default a GanttVLine will cover the entire Gantt area from the top to the + bottom. It is also possible to restrict the area that the line is spanning by + specifying the start and stop row for the line with a call to the method

+

+

  • +

    GanttVLine::SetRowSpan($aStart, $aEnd)

    +

+

+

If the end row is left out the line will go all the way to the bottom.

+

+

Note

+

Since there is a small margin from the top header row to the first Gantt + row this means that specifying a start row of 0 (the very first gantt row) + will leave a small margin between the line and the header row. If this is + not desirable the start row can be specified as -1 in which case the line + will go all the way up to the header row.

+

+

+

Valid creations of lines are for example

+

+

1
+2
+3
+
$vline1 = new GanttVLine('2001-12-24', 'Phase 1'); 
+$vline2 = new GanttVLine('2001-12-28', 'Phase 1', 'darkred', 5, 'dotted'); 
+$vline2->SetRowSpan(3); // Start at row index=3 (fourth row) and go all the way to the bottom

+

+

In Figure 16.61. Adding a vertical line in the Gantt graph (ganttex06.php) we have created a line with

+

+

1
+2
+
$vline = new GanttVLine('2001-12-24', 'Phase 1' );
+$graph->Add( $vline );

+

+

+

Figure 16.61. Adding a vertical line in the Gantt graph (ganttex06.php)

Adding a vertical line in the Gantt graph (ganttex06.php)


+

+

We note the following

+

+

  • +

    The title of the vertical line is rendered at the bottom of the graph + in the margin.

    +
  • +

    By default the line is drawn at the beginning of the day of the + specified date and in a "dashed" style. This can be + modified so that the line is drawn/aligned anywhere in the specified + day. This is done by using the method + GanttVLine::SetDayOffset() with an argument specifying + the fraction of the width of a single day where the line should be + positioned.

    +

    For example, if we want to display the line in the middle of the day + we need to add the line

    +

    +

    1
    +
    $vline->SetDayOffset ( 0.5 );

    +

    +

    Adding this line to the example in Figure 16.61. Adding a vertical line in the Gantt graph (ganttex06.php) + gives the result shown in Figure 16.62. Adjusting the position of the vertical line within the day (ganttex07.php)

    +

+

+

+

Figure 16.62. Adjusting the position of the vertical line within the day (ganttex07.php)

Adjusting the position of the vertical line within the day (ganttex07.php)


+

+
+

Illustrating break in activities

+ +

Since the position of each activity is specified by row and date there is nothing + that prevents adding multiple activity bars to the same row. This observation makes + it possible to illustrate breaks in activities during a certain period. Figure 16.63. Adding several activity bars on the same row (gantt_samerowex1.php) shows an example of this

+

+

Figure 16.63. Adding several activity bars on the same row (gantt_samerowex1.php)

Adding several activity bars on the same row (gantt_samerowex1.php)


+

+

A common variant is to have some connection between the parts in the broken + activity. This can be accomplished by using a special variant of the gantt activity + available just for this purpose.

+

Gantt bars have the following method available

+

+

  • +

    + GanttBar::SetBreakStyle($aFlg=true, $aLineStyle='dotted', + $aLineWeight=1)

    +

+

+

This will draw the gantt bar almost hollow. It will just consist of the top and + bottom line of the bar. The idea to illustrate a break is to have a bar of this + style during the break. Figure 16.64. Adding a hollow "break" bar (gantt_samerowex2.php) shows an example + of this.

+

+

Figure 16.64. Adding a hollow "break" bar (gantt_samerowex2.php)

Adding a hollow "break" bar (gantt_samerowex2.php)


+

+
+
+

Additional formatting for activity bars (Gantt bars)

+ +

Adding markers to the Gantt bars

+ +

Each gantt bar can have a marker either at the left or to the right of the bar. + The markers are accessed through the properties

+

+

  • +

    GanttBar::leftMark

    +
  • +

    GanttBar::rightMark

    +

+

+

Since the markers are instances of class PlotMark all the features of + this class is available as described in Adding marks to the plot (a.k.a. plot marks) and + in Appendix E. Available plot marks.

+

To give a practical example of the usage of marks we will add a solid filled + circle with a title text to the right end of a activity bar by using the following + lines

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+// 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');
+?>

+

+

This would give the effect shown in Figure 16.65. Example of adding a right marker to the activity bar

+

+

Figure 16.65. Example of adding a right marker to the activity bar

+ +
Example of adding a right marker to the activity bar
+


+

+

Caution

+

Since the bar height is 60% of the row height this means that a large + marker will adjust the row size (since it must be large enough to make room + for the mark) and it might be necessary to compensate for this by calling + the GanttBar::SetHeight($aHeight). Remember that the reserved + height is the maximum height needed by any line. Figure 16.66. A large marker will force the row to become larger since it by default always fills 60% of the allocated height for each row (ganttex08.php) shows what happens with the bar height if + it is not adjusted.

+

.

+

+

Figure 16.66. A large marker will force the row to become larger since it by default always fills 60% of the allocated height for each row (ganttex08.php)

A large marker will force the row to become larger since it by default always fills 60% of the allocated height for each row (ganttex08.php)


+

+

+

Note

+

There are two special markers MARK_LEFTTRIANGLE and + MARK_RIGHTTRIANGLE not normally available that are used to + format the visual indication of a group bar header. See Grouping activities

+

+

+
+

Specifying a fill pattern for the activity bar

+ +

The pattern and color for an activity bar is specified with the method

+

+

  • +

    GanttBar::function + SetPattern($aPattern,$aColor="blue",$aDensity=95)

    +

+

+

The available patterns together with the symbolic names are given in Table 16.1. Gantt bar patterns.

+

+

Table 16.1. Gantt bar patterns

+ +
+

+

GANTT_LDIAG

+
+

+

GANTT_RDIAG

+
+

+

GANTT_HLINE

+
+

+

GANTT_VLINE

+
+

+

GANTT_SOLID

+
+

+

GANTT_HVCROSS

+
+

+

GANTT_DIAGCROSS

+
+

+

GANTT_3DPLANE

+
+


+

+

+

Note

+

In Table 16.1. Gantt bar patterns.we have used different + value for the $aDensity parameter to better show the pattern. + Depending on the pattern we have used a density in the range 85 to + 95.

+

+

+
+

Adding captions to activities

+ +

The caption text is a text string that is shown to the right of the activity bar. + It can have different usages, for example a common use is to show the initials of + the person (or persons) responsible for completing a specific activity.

+

The caption is accessed through the "$caption" property of the bar. + This property is an instance of the Text class and hence inherits all the common + text formatting options.

+

The following line sets the caption to the string "[AG]"

+

+

1
+2
+3
+4
+
<?php
+$activity->caption->Set('[AG]')
+$activity->caption->SetFont(FF_FONT2,FS_BOLD);
+?>

+

+

Figure 16.67. Adding a caption to a Gantt bar shows a small cut out from a gantt + chart that shows the typical appearance of a gantt bar caption.

+

+

Figure 16.67. Adding a caption to a Gantt bar

+ +
Adding a caption to a Gantt bar
+


+

+

In addition to specifying the caption as shown above the caption text can also be + specified directly when creating a gantt bar as the fifth parameter as the following + example shows

+

+

1
+
$activity = new GanttBar(0, 'Activity 1', '2001-11-21', '2001-12-20', '[BS,ER]') ;

+

+

In order to specify the distance between the Gantt object and the caption text the + method

+

+

  • +

    GanttPlotObject::SetCaptionMargin($aMargin)

    +

+

+

is used. For example, to increase the margin to 20 pixels for a gantt bar the + following line must be added

+

+

1
+
$activity->SetCaptionTitle(20);

+

+
+

Adding progress indicators

+ +

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 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 (0-1). As in

+

+

1
+
$activity->progress->Set( 0.4 )

+

+

In each activity uses the default format for the 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).

+

+

Figure 16.68. Adding progress bars ot the gantt chart (ganttex14.php)

Adding progress bars ot the gantt chart (ganttex14.php)


+

+

To specify a different format for the progress the following method is used

+

+

  • +

    Progress::SetPattern($aPattern,$aColor="blue",$aDensity=98)

    +

    The parameters follow the same structure as patterns for the activity + bars

    +

+

+

We can now modify the progress bar above, for example by adding the line

+

+

1
+
$activity->progress->SetPattern( BAND_RDIAG , "blue" );

+

+

and we then get the result shown in Figure 16.69. Modifying the format for the progress pattern (ganttex15.php)

+

+

Figure 16.69. Modifying the format for the progress pattern (ganttex15.php)

Modifying the format for the progress pattern (ganttex15.php)


+

+
+
+

Adding visual indication of constraints between gantt objects

+ +

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 some other activity has finished. The constrain is visualized as an arrow between + two gantt objects.

+

The library supports visualization of the following four types of constraints

+

+

+
+

+

Figure 16.70. Start to end constraint

+ +
Start to end constraint
+


+

+

Start to End

+
+

+

Figure 16.71. Start to start constraint

+ +
Start to start constraint
+


+

+

Start to Start

+
+

+

Figure 16.72. End to start constraint

+ +
End to start constraint
+


+

+

End to Start

+
+

+

Figure 16.73. End to end constraint

+ +
End to end constraint
+


+

+

End to End

+
+

+

+

To visualize a constrain the method SetConstrain() is called on the first + Gantt object that is the first part of the constraint. The signature for this method + is

+

+

  • +

    GanttObject::SetConstrain($aRow,$aType,$aColor='black',

    +

    $aArrowSize=ARROW_S2, $aArrowType=ARROWT_SOLID)

    +

    $aRow, The target row for the constrain

    +

    $aType, The type of constraints. Can be one of the following + symbolic defines

    +

    +

    • +

      CONSTRAIN_STARTSTART

      +
    • +

      CONSTRAIN_STARTEND

      +
    • +

      CONSTRAIN_ENDSTART

      +
    • +

      CONSTRAIN_ENDEND

      +

    +

    +

    $aColor, The color of the constraint arrow

    +

    $aArrowSize, The size of the constraint arrow. Can eb one of + the following symbolic defines

    +

    +

    • +

      ARROW_S1

      +
    • +

      ARROW_S2

      +
    • +

      ARROW_S3

      +
    • +

      ARROW_S4

      +
    • +

      ARROW_S5

      +

    +

    +

    $aArrowType, specifies the visual appearance of the arrow. + Can be one of the following symbolic defines

    +

    +

    • +

      ARROWT_SOLID, Using a solid arrow and arrow + head

      +
    • +

      ARROWT_OPEN, Using an outline arrow and outline + arrow head

      +

    +

    +

+

+

If we assume that the gantt chart have two activity bars (Gantt bars) defined as

+

+

1
+2
+
$activity1 = new GanttBar(0,'First activity','2001-01-01','2001-03-01');
+$activity2 = new GanttBar(1,'Second activity','2001-02-01','2001-04-15');

+

+

and that we need to visualize a end-to-start constraint from $activity1 + to $activity2 we must add the following statement

+

+

1
+
$activity1->SetConstrain(1,CONSTRAIN_ENDSTART);

+

+

+

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.

+

+

+
+

Grouping activities

+ +

It is common to group activities. 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 library provides two special types of marks that are handled slightly different + than other markers just to cater for illustrating groups of activities. If the left or + right marker (see the section on adding left and right markers) are of type + MARK_LEFTTRIANGLE or MARK_RIGHTTRIANGLE those triangles + will be drawn under the bars to give the effect show in the examples above.

+

It is also a good idea to make the grouping bars have slightly less height than normal + activity bars since the end triangles will visually "grow" the bar. Remember that the + size of the bar can be adjusted by adding an extra parameter in the creation of the bar + and can be specified as either an absolute or as a relative (0-1) value, see Adding Gantt activity bars

+

So to get the effect we want for a group bar we have to use the two lines

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$groupbar->leftMark->SetType( MARK_LEFTTRIANGLE );
+$groupbar->leftMark->Show();
+$groupbar->rightMark->SetType( MARK_RIGHTTRIANGLE );
+$groupbar->rightMark->Show();
+?>

+

+

to add the typical group markers at the left and right end of an otherwise standard + activity bar as can bee seen in Figure 16.74. Group markers

+

+

Figure 16.74. Group markers

+ +
Group markers
+


+

+

+

Note

+

Since 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.

+

+

+
+

Simplifying creation of basic Gantt charts

+ +

As we have shown in the previous examples constructing a Gantt chart consists of a + number of repetitive tasks; Create the individual activity bars, add possible + constraints, format them and finally add them to the graph.

+

Since many basic Gantt charts that doesn't need a very high degree of customization + and has an almost identical (but repetitive structure) the library offers a "wrapper" + method that takes a structured specification of the activities and implements most of + these repetitive tasks which will make the graphs scripts much simpler.

+

The only drawback is that in order to keep the specification simple (which is the + whole purpose) there are very limited options to format the activities.

+

The wrapper method has the following signature

+

+

  • +

    GanttGraph::function CreateSimple($aData, $aConstrains=array(), + $aProgress=array())

    +

    $aData, Specification of activities described below

    +

    $aConstraints, (optional) List of constraints

    +

    $aProgress, (optional) List of progress values

    +

+

+

The specification of the activities used for this wrapper method has the following + structure

+

+

1
+2
+3
+4
+5
+
$spec = array(
+    array( <act1_row>, <act1_type>, <act1_title>, <act1_start>, <act1_end>, <act1_caption>, <act1_csimtarget>, <act1_title_csimtarget> ),
+    array( <act2_row>, <act2_type>, <act2_title>, <act2_start>, <act2_end>, <act2_caption>, <act2_csimtarget>, <act2_title_csimtarget> ),
+    ...
+    array( <actN_row>, <actN_type>, <actN_title>, <actN_start>, <actN_end>, <actN_caption>, <actN_csimtarget>, <actN_title_csimtarget> ));

+

+

Each array within the specification creates one activity. The fields have the + following meaning

+
  • +

    <act_row>, Which row in the gantt chart this activity + shall be drawn on

    +
  • +

    <act_type>, What type of activity is this. The type is one + of the following symbolic defines

    +

    +

    • +

      ACTYPE_NORMAL, A standard activity bar

      +
    • +

      ACTYPE_MILESTONE, A milestone activity

      +
    • +

      ACTYPE_GROUP, Create a grouping activity bar by + adding start and end group marks

      +

    +

    +
  • +

    <act_title>, The title for the activity, can be either a + text string or an array to specify several title when several title columns + have been specified

    +
  • +

    <act_start>, <act_end>, Start and end date + for the activity. For ACTYPE_MILESTONE only the <act_start> shall be + specified.

    +
  • +

    <act_caption>, The optional caption text for the + activity

    +

The (optional) constraints specification has the following + structure

+

+

1
+2
+3
+4
+5
+
$constraints = array(
+    array(<act1_row>, <act2_row>, <type>),
+    array(<act1_row>, <act2_row>, <type>),
+    ...
+    array(<act1_row>, <act2_row>, <type>));

+

+

+

+

+

Finally the (optional) progress specification has the structure

+

+

1
+2
+3
+4
+5
+
$progress = array(
+    array( <act1_row>, <act1_progress> ),
+    array( <act2_row>, <act2_progress> ),
+    ...
+    array( <act2_row>, <act2_progress> ));

+

+

+

  • +

    <act_row>, The row that has the activity with the specified + progress

    +
  • +

    <act_progress>, The progress value for the activity at the specified + row

    +

+

+

This does perhaps not look like a simplification but the following example will show + that it really is.

+

The following example will create a gantt graph with two activities, one milestone and + all grouped together by a group bar. The specification for these activities will + be

+

+

1
+2
+3
+4
+5
+
 $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" ) );

+

+

Note that we use spaces to get a the titles indented according to the group + structure.

+

We now only need to create a very basic gantt chart with some selected scale headers + and perhaps also a title. We then call the CreateSimple() method with the + data specification above as the argument and that is all we must do.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
<?php
+// Create a basic graph and set a title
+$graph = new  GanttGraph ();
+$graph->title->Set( "Gantt Graph using CreateSimple()" );
+ 
+// Setup a 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 (); 
+?>

+

+

Compare this to all the $act = new GanttBar(..) etc. we would have had to + add and format using the "manual" method of adding activities to gantt graph. A complete + example of this is shown in Figure 16.75. Using the CreateSimple() wrapper method (ganttsimpleex1.php)

+

+

Figure 16.75. Using the CreateSimple() wrapper method (ganttsimpleex1.php)

Using the CreateSimple() wrapper method (ganttsimpleex1.php)


+

+

As we mentioned above the format options are very limited when using + CreateSimple() since that is the whole idea. However, there are two + methods to at least partially affect the format and the visual appearance of the + activities.

+

+

  • +

    GanttGraph::SetSimpleFont($aFont,$aSize)

    +

    $aFont, Font family for titles

    +

    $aSize, Font size for titles

    +
  • +

    GanttGraph::SetSimpleStyle($aPattern,$aColor,$aFillColor)

    +

    $aPattern, Specifies the pattern (if any) to use for filling + the activity bars

    +

    $aColor, The pattern color

    +

    $aFillColor, The fill color of the activity bar

    +

+

+
+

Using multiple title columns

+ +

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 how to use an arbitrary number of columns/titles for each gantt activity (gantt bar + or gantt milestone).

+

+

Figure 16.76. Using multiple columns as titles for activties (ganttmonthyearex3.php)

Using multiple columns as titles for activties (ganttmonthyearex3.php)


+

+

To use multiple columns there are two steps needed.

+

+

  1. +

    The number of columns to be used as titles together with the headings and + the headings properties like text, font and color are specified

    +
  2. +

    The second step is to add the proper titles to each activity to be + displayed in the specified columns

    +

+

+

To set the columns the "Activity information" property of the scale must be accessed. + To specify the headers of the title column the following method is used

+

+

  • +

    ActivityInfo::SetColTitles($aHeaderArray, $aMinWidths)

    +

+

+

The following code excerpt shows an example on how to do this

+

+

1
+2
+3
+
$graph->scale->actinfo->SetColTitles(
+    array( 'Note', 'Task', 'Duration', 'Start', 'Finish' ),
+    array( 30 , 100 ));

+

+

Furthermore it is possible to modify the background colors and the style and colors of + the vertical dividing grid lines. In the previous image we used the lines

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$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 is as usual specified with one of the strings be + "solid","dashed", "dotted" or + "longdashed" as in other line formatting contexts within the library.

+

It is also possible to specify if a small "3D" effect should be used in the titles. By + default this is enabled. You can easily turn this of with a call to

+

+

1
+
$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

+

+

1
+
$graph->scale->actinfo->SetColor('navy');

+

+

Once the format of the title column is set up the data in the columns (the texts) + needs to be entered.

+

This is done when the activity bars are added to the graph. By default only a single + columns is used as a title and then the title of the activity is specified as a string. + When multiple columns are used then the title of each activity is specified as an array + of texts, each entry in the array corresponding to one column.

+

Specifying two column titles could be done with the following creation of the activity + bar

+

+

1
+2
+3
+
$title1 = '...';
+$title2 = '...';
+$bar = new GanttBar(0 ,array( $title1 , $title2 ), "2003-11-23" , "2003-12-05" );

+

+ +

Adjusting the individual fonts for each column

+ +

Note: This feature is only available in versions >= 3.0.3 + of the library.

+

When using the method GanttBar::title::SetFont() the same font will + be applied to all columns for that particular activity. To specify individual fonts + for each column the method GanttBar::title::SetColumnFonts() must be + used.

+

This method accept an array of font arrays where each font array specifies the + font family, style and size for that particular column. If fewer fonts specification + than columns are given then the remaining columns will be using the default fonts + specification (as defined by the SetFont() method).

+

For example the two lines of code

+

+

1
+2
+3
+4
+
<?php
+$bar->title->SetFont(FF_ARIAL,FS_NORMAL,10);
+$bar->title->SetColumnFonts(array(array(FF_ARIAL,FS_BOLD,11)));
+?>

+

+

will cause the first column to be set in a bold font and the remaining columns + falling back to the default non-bold font style.

+

A complete example on how to use this is shown in Figure 16.77. Using different fonts for individual columns (ganttcolumnfontsex01.php) below.

+

+

Figure 16.77. Using different fonts for individual columns (ganttcolumnfontsex01.php)

Using different fonts for individual columns (ganttcolumnfontsex01.php)


+

+
+

Adding an overview title for all columns

+ +

It is possible to add a title that spans all the defined title columns. An example + of this is shown in Figure 16.78. Adding a spanning title over all title columns (ganttmonthyearex4.php) . 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.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$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 );
+?>

+

+

+

Figure 16.78. Adding a spanning title over all title columns (ganttmonthyearex4.php)

Adding a spanning title over all title columns (ganttmonthyearex4.php)


+

+

+

Caution

+

Remember that the overall height available for both title column header + and the spanning column title is limited to the height of the specified + scale header. This means that having only a single scale header will not + leave enough room to add a spanning title.

+

+

+
+
+

Built-in icons for use in activity titles

+ +

To assist in getting visual clues to how to interpret activities in the Gantt chart it + is possible to add icons in the title columns. These icons can also act as hot-spots in + CSIM graphs. The available built-in icons are listed in Figure 16.79. Built-in icons for Gantt charts together with there symbolic names.

+

In order to add an icon in a title column first an instance of class + IconPlot is created and it is then added in exactly the same was as a text + string. The signature for the constructor is

+

+

  • +

    IconPlot::__construct($aIcon,$aScale=1)

    +

    $aIcon, is either one of the symbolic names in Figure 16.79. Built-in icons for Gantt charts or a text string which is a filename of + an arbitrary image to use as icon.

    +

    $aScale, is the initial scaling of the image

    +

+

+

For example the following code snippet adds a "folder open image" in the first column + and scaling it to be 60% of its original size

+

+

1
+2
+3
+4
+5
+
<?php
+$iconopen = new  IconImage (GICON_FOLDEROPEN , 0.6);
+$title2 = '...' ;
+$bar  = new  GanttBar (0 ,array( $iconopen , $title2 ), '2003-11-23' , '2003-12-05' ); 
+?>

+

+

To instead use an arbitrary image as icon the code would have to be changed to

+

+

1
+2
+3
+4
+5
+
<?php
+$iconopen = new  IconImage ('myiconimage.jpg', 0.6);
+$title2 = '...' ;
+$bar  = new  GanttBar (0 ,array( $iconopen , $title2 ), '2003-11-23' , '2003-12-05' ); 
+?>

+

+

+

Figure 16.79. Built-in icons for Gantt charts

+ +
+
+

Built-in icons for Gantt charts

+

GICON_WARNINGYELLOW

+
+

Built-in icons for Gantt charts

+

GICON_WARNINGRED

+
+

Built-in icons for Gantt charts

+

GICON_TEXT

+
+

Built-in icons for Gantt charts

+

GICON_ENDCONS

+
+

Built-in icons for Gantt charts

+

GICON_STARTCONS

+
+

Built-in icons for Gantt charts

+

GICON_MAIL

+
+

Built-in icons for Gantt charts

+

GICON_CALC

+
+

Built-in icons for Gantt charts

+

GICON_MAGNIFIER

+
+

Built-in icons for Gantt charts

+

GICON_LOCK

+
+

Built-in icons for Gantt charts

+

GICON_STOP

+
+

Built-in icons for Gantt charts

+

GICON_FOLDEROPEN

+
+

Built-in icons for Gantt charts

+

GICON_FOLDER

+
+

Built-in icons for Gantt charts

+

GICON_TEXTIMPORTANT

+
  
+
+


+

+

An example of using icons in the titles is shown in Figure 16.80. Adding built in icons in titles (gantticonex1.php)

+

+

Figure 16.80. Adding built in icons in titles (gantticonex1.php)

Adding built in icons in titles (gantticonex1.php)


+

+
+

More general Gantt formatting

+ +

In this section we will show a few more ways by which you may customize the gantt + chart itself. This include among other thing

+

+

  • +

    Adding a table title (not to be confused with the graph title)

    +
  • +

    Adjusting appearance of the various lines in the bar chart

    +
  • +

    Adjusting the zoom factor for the width when using automatic + scaling

    +

+

+

Adjusting the scale zoom factor

+ +

By default the scale will be just wide enough to fit the chosen scale headers with + some small margins on each side. It is possible to adjust the width when using + automatic graph sizing by setting a zoom factor for the scale. The default width + corresponds to a zoom factor of 1.0.

+

The zoom factor is adjusted by the method

+

+

  • +

    GanttGraph::SetZoomFactor($aZoomFactor)

    +

    $aZoomFactor, A real number that specifies the zoom of + the date scale. A zoom factor of 2.0 will double the default horizontal + spacing.

    +

+

+

In the following two examples the same Gantt chart is first shown with a scale + factor of 0.7 (=70% of the original width) and in Figure 16.82. A zoom factor of 1.5 (ganttex13-zoom2.php) a zoom factor of 1.5 (=150%) is used.

+

+

Figure 16.81. A zoom factor of 0.7 (ganttex13-zoom1.php)

A zoom factor of 0.7 (ganttex13-zoom1.php)


+

+

+

Figure 16.82. A zoom factor of 1.5 (ganttex13-zoom2.php)

A zoom factor of 1.5 (ganttex13-zoom2.php)


+

+

+

Note

+

There is no limit for the zoom factor but from a practical point of view + the useful range is [0.5,3.0]

+

+

+
+

Adding a table title

+ +

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 code snippet shows.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$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. An + example of this is shown in Figure 16.83. Adding a table title in the top left corner (ganttex16.php) . As can be seen the + width of the left column which holds all the titles has been adjusted to make it + wide enough to fit the table title.

+

+

Figure 16.83. Adding a table title in the top left corner (ganttex16.php)

Adding a table title in the top left corner (ganttex16.php)


+

+
+

Modifying the divider lines

+ +

The vertical and horizontal lines between the activity titles and the plot area + and the bars can be modified by accessing the vertical divider + 'divider' and the horizontal divider 'dividerh' properties + of the scale. Figure 16.84. Gantt divider lines shows the exact location + of the divider lines.

+

+

Figure 16.84. Gantt divider lines

+ +
Gantt divider lines
+


+

+

Again, this is straightforward as the following code snippet shows.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$graph->scale->divider->SetWeight( 3 );
+$graph->scale->divider->SetColor( 'navy' );
+$graph->scale->dividerh->SetWeight( 3 );
+$graph->scale->dividerh->SetColor( 'navy' ); 
+?>

+

+

An example of this can be seen in Figure 16.85. Adjusting the plot box around the gantt chart (ganttex18.php)

+
+

Modifying the box around the plot

+ +

In a similar manner to the other plots in the library the Box around the plot can + be modified with the gantt graph method 'GanttGraph::SetBox()' . The + following line will result in a thicker plot box around the plot area as can be seen + in Figure 16.85. Adjusting the plot box around the gantt chart (ganttex18.php)

+

+

1
+
$graph->SetBox(true, 'navy', 3);

+

+

+

Figure 16.85. Adjusting the plot box around the gantt chart (ganttex18.php)

Adjusting the plot box around the gantt chart (ganttex18.php)


+

+
+

Horizontal grids and alternating line colors

+ +

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 alternating line colors the following method is used

+

+

  • +

    HorizontalGridLine::SetRowFillColor($aColor1,$aColor2='')

    +

    $aColor1, $aColor2, alternating color for + each activity line

    +

+

+

For example, to use an alternating blue background with blue grid line the + following lines would have to be added to the graph script

+

+

1
+2
+3
+4
+5
+6
+
<?php
+// Setup a horizontal grid
+$graph->hgrid->Show();
+$graph->hgrid->line->SetColor( 'lightblue' );
+$graph->hgrid->SetRowFillColor( 'darkblue@0.9' ); 
+?>

+

+

An example,of this is shown in Figure 16.86.  (gantthgridex1.php)

+
+

Adding icons to Gantt graphs

+ +

In the same way as for ordinary x-y graphs it is possible to add small images (or + icons) to a Gantt graph by creating an instance of class IconPlot and + then adding that instance to the graph.

+

For example the following line will add an icon (similar to what was shown in ??) + to a gantt chart with the result shown in Figure 16.86.  (gantthgridex1.php)

+

+

1
+2
+3
+4
+5
+
<?php
+$icon = new IconPlot('penguin.png' , 0.01 , 0.95 , 1 , 15 );
+$icon->SetAnchor('left', 'bottom');
+$graph->Add( $icon ); 
+?>

+

+

+

Figure 16.86.  (gantthgridex1.php)

(gantthgridex1.php)


+

+
+

Adjusting the vertical spacing between activity bars

+ +

By default the library adds 20% margin above and below each activity bar. In order + to set the activities closer or further away from each other the method

+

+

  • +

    GanttGraph::SetVMarginFactor($aFractionMargin)

    +

+

+

can be used. For example

+

+

1
+
$graph->SetVMarginFactor(0.0);

+

+

will cause the gantt bars to touch each other since there will be no margins. If + we instead use

+

+

1
+
$graph->SetVMarginFactor(1.0);

+

+

we will in effect get "double-line-spacing" since we add the width of one activity + height as margin. The default 40% corresponds to

+

+

1
+
$graph->SetVMarginFactor(0.4);

+

+
+

Adjusting the margins with auto-sizing

+ +

It is possible to use GanttGraph::SetMargin() to specify the margin + for a Gantt graph even when the vertical height is determined automatically. For + example to generate a graph with no left, right or bottom margin the following lines + would be needed

+

+

1
+2
+3
+4
+
<?php
+$graph = new GanttGraph ( 500 );
+$graph->SetMargin (0, 0, 30, 0); 
+?>

+

+
+

Limiting the date range for the Gantt chart

+ +

By default the scale will be wide enough to make room for all specified + activities. It is however possible to manually set the scale range to limit the size + of the Gantt chart.

+

This is done by calling the method

+

+

  • +

    GanttGraph::SetDateRange($aStartDate, $aEndDate)

    +

+

+

For example the following code snippet would set the specified start and end + date

+

+

1
+
$graph->SetDateRange('2001-12-20', '2002-01-20');

+

+
+

Specifying the first day in the week

+ +

By default Monday is the first day of the week. It is possible to manually set an + arbitrary start day by calling the method

+

+

  • +

    GanttScale::SetWeekStart($aStartDay)

    +

    $aStartDay, Specified as an integer in the range 0-6 + where 0=Sunday, 1=Monday, ..., 6=Saturday

    +

+

+
+

Adding plot icons to the graph

+ +

In the same way as was described in Adding icons (and small images) to the graph for x-y graphs it is possible to add icons and country flags to a Gantt chart. + The following code snippet adds a Norwegian flag to the top left corner of a + graph

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php
+// Setup the Gantt graph
+$graph = new GanttGraph();
+ 
+// Create some activities
+// ...
+ 
+$icon = new IconPlot();
+$icon->SetAnchor('left','top');
+$icon->SetCountryFlag('norway');
+$icon->SetPos(5,5);
+$icon->SetMix(50);
+$icon->SetScale(1.0);
+ 
+// The above four method calls could also have been done as
+// $icon->SetCountryFlag('norway', 5,5, 1.0, 50);
+ 
+$graph->Add($icon);
+ 
+// Any other gantt formatting
+// ...

+

+

The result of adding these lines to a typical Gantt chart is shown in Figure 16.87. Adding a country flag to the top left corner of the gantt graph (ganttex17-flag.php)

+

+

Figure 16.87. Adding a country flag to the top left corner of the gantt graph (ganttex17-flag.php)

Adding a country flag to the top left corner of the gantt graph (ganttex17-flag.php)


+

+

For more details on adding icons to a graph see Adding icons (and small images) to the graph .

+
+

Adding text strings to the graph

+ +

In exactly the same way as was described in Adding arbitrary texts to the graph it is also possible to add arbitrary + formatted text paragraphs to the gantt chart.

+

The position of the text strings is specified as either an absolute position in + pixels (as usual the top left corner is (0,0)) or the position can be specified as a + scale position with date and row index. The following two method of the text class + is used for this

+

+

  • +

    Text::SetPos($aPosX, $aPosY)

    +

    Set the absolute position for the text anchor point

    +
  • +

    Text::SetScalePos($aDate,$aRow)

    +

    Set the position for the text anchor point using the actual date scale + (as the horizontal position) and the row number as the vertical + position.

    +

+

+

For example the lines below show how to add one text with absolute scale position + in the top left corner and one text string at the second row at the date + "2002-01.01"

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+// Add text to top left corner of graph
+$txt1 = new Text();
+$txt1->SetPos(5,2);
+$txt1->Set("Note:\nEstimate done w148");
+$txt1->SetFont(FF_ARIAL,FS_BOLD,12);
+$txt1->SetColor('darkred');
+$graph->Add($txt1);
+ 
+// Add text to the top bar
+$txt2 = new Text();
+$txt2->SetScalePos('2002-01-01',1);
+$txt2->SetFont(FF_ARIAL,FS_BOLD,12);
+$txt2->SetAlign('left','center');
+$txt2->Set("Remember this!");
+$txt2->SetBox('yellow');
+$graph->Add($txt2);
+?>

+

+

The result of adding these lines to a typical gantt graph is shown in Figure 16.88. Adding two text objects to a Gantt graph (gantt_textex1.php)

+

+

Figure 16.88. Adding two text objects to a Gantt graph (gantt_textex1.php)

Adding two text objects to a Gantt graph (gantt_textex1.php)


+

+

Since there is no other changes in functionality we refer to Adding arbitrary texts to the graph for a full discussion of text + paragraph features.

+

+

Note

+

This feature was added in v2.5

+

+

+
+
+

Localizing the Gantt chart scale

+ +

Since the name of the week and months are constructed by the library it must be + possible to adjust which locale should be used to construct the names.

+

Depending on the server setup of PHP there might be support for several locales. By + default the locale is set to use the default locale on the server.

+

A specific locale is specified with the locale string, for example American English is + specified with the string 'EN_US', British English with 'EN_UK' 'nl_NL' for Dutch and so + on. If the server installation does not support the specified locale an error message + like the one shown in Figure 16.89. Error message when using an unsupported Locale in Gantt chart will be shown.

+

+

Tip

+

If the server is running on a Unix derivate the supported locales can be found + by the following command

+

$> locale -a

+

+

+

+

Figure 16.89. Error message when using an unsupported Locale in Gantt chart

+ +
Error message when using an unsupported Locale in Gantt chart
+


+

+

To set the locale the following method is used

+

+

  • +

    GanttScale::SetDateLocale($aLocaleString)

    +

+

+

For example to set the locale to swedish the following line would be needed

+

+

1
+
$graph->scale->SetDateLocale('sv_SE');

+

+

An example of using Swedish locale is shown in Figure 16.90. Using Swedish locale. Notice the L for Lordag instead of S for Saturday (ganttex19.php)

+

+

Figure 16.90. Using Swedish locale. Notice the L for Lordag instead of S for Saturday (ganttex19.php)

Using Swedish locale. Notice the L for Lordag instead of S for Saturday (ganttex19.php)


+

+

+

Note

+

Internally the library uses the PHP function setlocale() and only + affects the category LC_TIME

+

+

+
+

CSIM Support in Gantt charts

+ +

The generic description on how to use CSIM (Client side image maps) together with the + library is fully described in Chapter 10. Using CSIM (Client side image maps) .

+

Adding CSIM (Client side Image Maps) to Gantt charts

+ +

Gantt charts can have independent (different targets) hot spots in both the + activities and in the associated title (or titles) for each activity. For activities + both activity bars and milestones support CSIM functionality.

+

The targets and the associated "Alt" text for an activity bar is set by using one + or both of the methods

+
  • +

    GanttPlotObject::SetCSIMTarget($aTarget,$aAlt='', + $aWinTarget='')

    +
  • +

    GanttPlotObject::SetCSIMAlt($aAlt)

    +

The following code snippet sets CSIM targets fro bot the entire + activity bar as well as the title

+

+

1
+2
+
$bar->SetCSIMTarget( "http://localhost/abc/", "Alt Text for the bar" );
+$bar->title->SetCSIMTarget( "http://localhost/abc", "Alt Text for the title" );

+

+

The following properties of a Gantt object can have CSIM targets

+

+

  • +

    GanttPlotObject::title,

    +
  • +

    GanttPlotObject::leftmark, + BarPlot::rightmark

    +
  • +

    GanttPlotObject::caption

    +

+

+

+

Note

+

In the example directory there are several complete examples of how to use + CSIM together with Gantt charts.

+

+

+
+

Specifying CSIM entries for column titles

+ +

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.

+

+

1
+2
+3
+
$bar->title->SetCSIMTarget(
+    array('sometarget1.html', 'sometarget1.html'),
+    array('alttext1', 'alttext2'));

+

+
+
+

Some final Gantt graph examples

+ +

The example given below illustrates one or more of the features available for the + gantt graphs and shows how they may be combined to achive the wanted effect.

+

+

Examples of using hours and minute scales

+ +

+

Figure 16.91. Using multiple title columns with a scale of one day (gantthourminex1.php)

Using multiple title columns with a scale of one day (gantthourminex1.php)


+

+

+

Note

+

It is not possible to show less than one day in the scale. This is a + limitation of the library.

+

+

+
+

Adding multiple activities with markers and indenting titles

+ +

+

Figure 16.92. Using multiple markers and indenting titles in the Gantt chart (ganttex30.php)

Using multiple markers and indenting titles in the Gantt chart (ganttex30.php)


+

+
+

Using grouping of bars together with constraints

+ +

+

Figure 16.93. Using a grouping bar together with constraints (ganttconstrainex2.php)

Using a grouping bar together with constraints (ganttconstrainex2.php)


+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch17.html b/includes/jpgraph/docs/chunkhtml/ch17.html new file mode 100644 index 0000000..2ef29f1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch17.html @@ -0,0 +1,145 @@ +Chapter 17. Additional graph types

Chapter 17. Additional graph types

+ +

These chapter describes the types of graphs supported by the library that is not a + standard graph type used to display data series.

+

LED bill boards

+ +

This feature allows the creation of displayed letters (some) and digits which have the + look of a 4x7 LED display.

+

In order to use this feature the module "jpgraph_led.php" must be + included.

+

+

Caution

+

In order to use the LED module the PHP installation must have multi-byte + strings enabled so that the function mb_strlen() is available. This + is normally enabled at compile time for PHP by specifying the options + --enable-mbstring --enable-mbregex when configuring the compile + options.

+

+

+

The figures below shows some samples of the characters supported and the available + colors

+

+

+
+

Figure 17.1. LEDC_GREEN (ledex1.php)

LEDC_GREEN (ledex1.php)

+
+

Figure 17.2. LEDC_RED (ledex2.php)

LEDC_RED (ledex2.php)

+
+

Figure 17.3. LEDC_YELLOW (ledex3.php)

LEDC_YELLOW (ledex3.php)

+
+

Figure 17.4. LEDC_BLUE (ledex5.php)

LEDC_BLUE (ledex5.php)

+
+

Figure 17.5. LEDC_GRAY (ledex6.php)

LEDC_GRAY (ledex6.php)

+
+

Figure 17.6. LEDC_INVERTGRAY (ledex17.php)

LEDC_INVERTGRAY (ledex17.php)

+
+

Figure 17.7. LEDC_CHOCOLATE (ledex7.php)

LEDC_CHOCOLATE (ledex7.php)

+
+

Figure 17.8. LEDC_PERU (ledex8.php)

LEDC_PERU (ledex8.php)

+
+

Figure 17.9. LEDC_GOLDENROD (ledex9.php)

LEDC_GOLDENROD (ledex9.php)

+
+

Figure 17.10. LEDC_KHAKI (ledex10.php)

LEDC_KHAKI (ledex10.php)

+
+

Figure 17.11. LEDC_OLIVE (ledex11.php)

LEDC_OLIVE (ledex11.php)

+
+

Figure 17.12. LEDC_LIMEGREEN (ledex12.php)

LEDC_LIMEGREEN (ledex12.php)

+
+

Figure 17.13. LEDC_FORESTGREEN (ledex13.php)

LEDC_FORESTGREEN (ledex13.php)

+
+

Figure 17.14. LEDC_TEAL (ledex14.php)

LEDC_TEAL (ledex14.php)

+
+

Figure 17.15. LEDC_STEELBLUE (ledex15.php)

LEDC_STEELBLUE (ledex15.php)

+
+

Figure 17.16. LEDC_NAVY (ledex16.php)

LEDC_NAVY (ledex16.php)

+
+

+

+

A LED display is constructed by creating an instance of class DigitalLED47

+

+

  • +

    DigitalLED47::__construct($aRadius = 2, $aMargin= 0.6)

    +

    The first argument specifies the radius of each "led-light" and the second + argument the margin around each character. Adjusting the radius is the only + way to adjust the size of the LED characters.

    +

+

+

In order to generate the billboard the method

+

+

  • +

    DigitalLED47::Stroke($aValStr, $aColor , $aFileName = + '')

    +

    $aValStr, The string to be displayed

    +

    $aColor, one of the available colors as shown in the figures + above

    +

    $aFileName, An optional file name which specifies a file that + the image will be written to. No image will be streamed back to the browser + in this case.

    +

+

+

is called with the string to be displayed as the first argument. The following code + snippet shows how to create a green LED bill board

+

+

1
+2
+
$led = new DigitalLED74();
+$led->Stroke('0123456789. ABCDEFGHIJKL',LEDC_GREEN);

+

+

In order to improve visual quality of the LED display it uses super sampling + internally to achieve the anti-alias smoothing effect. The number of oversampling is + specified with

+

+

  • +

    DigitalLED47::SetSupersampling($aSuperSampling)

    +

    By default a 2:times super-sampling is used. Using any value higher than 4 + does not give any visual improvements

    +

+

+

In the three figures below different levels of super sampling is used, in the left + most image no super sampling is used (super sampling=1), in the middle figure super + sampling=2 (the default) and in the rightmost figure super sampling is set to 4

+

+

+
+

Figure 17.17. Supersampling=1 (ledex4.php)

Supersampling=1 (ledex4.php)

+
+

Figure 17.18. Supersampling=2 (default) (ledex4.1.php)

Supersampling=2 (default) (ledex4.1.php)

+
+

Figure 17.19. Supersampling=4 (ledex4.2.php)

Supersampling=4 (ledex4.2.php)

+
+

+

+

Cyrillic character support

+ +

In addition to most of the basic latin characters the library also have some + support for Cyrillic characters. Due to the limed resolution (4x7) some more complex + cyrillic characters are not rendered very faithfully. The available rendering for + the cyrillic alphabet is shown in Figure 17.20. LED 4x7 Cyrillic alphabet support

+

+

Figure 17.20. LED 4x7 Cyrillic alphabet support

+ +
+
+

LED 4x7 Cyrillic alphabet support

+
+

LED 4x7 Cyrillic alphabet support

+
+
+


+

+

+

Caution

+

Since the library internally uses utf8 character encoding it means that + the string passed on to the library must also be encoded in utf8. In case + the characters have another encoding, say cp1251, they must first be + converted to utf8. This could for example be done by the PHP function + iconv()..

+

+

+

(This is the only place in the library that is truly multi-byte text safe.)

+
+
+ + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch17s02.html b/includes/jpgraph/docs/chunkhtml/ch17s02.html new file mode 100644 index 0000000..1846298 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch17s02.html @@ -0,0 +1,109 @@ +Captcha generation

Captcha generation

+ +

Captcha is an acronym for "Completely Automated Public Turing + test to tell Computers and Humans Apart." and is often used to prevent + automatic sign-ups in various WEB-based applications.

+

The library support generation of a simple captchas based on hand drawn "ugly" letters + and digits. They are combined into a word which can be presented as an image.

+

+

Warning

+

It should be noted that with ample processing power and modern image analysis + it is probably not hat difficult to actually break these captchas so the usage + of these captchas in mission critical environments is entirely the + responsibility of the user.

+

+

+

The module in the library that is needed is + "jpgraph_antispam.php" and behaves as a simplified plot module.

+

?? showsn an example on how this can look

+

+

Figure 17.21. Sample illustration of captcha challenge (antispamex01.php)

Sample illustration of captcha challenge (antispamex01.php)


+

+

Captcha images have less functionality then the usual graphs generated with the + library in order to keep this utility reasonable small. The primary limitation is that + there are no 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 format.

+

Generating Captchas

+ +

There are two basic alternatives on how to generate the content of the + captcha

+

+

  1. +

    Submit a string that should be used

    +
  2. +

    Automatically generate a random string. If this alternative is chosen + then the user of the library should save the created string and compare + it to what the user enters.

    +

+

+

In order to write a script to generate a new challenge there are four steps to be + completed.

+

+

  1. +

    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.

    +

    +

    1
    +
    require_once "jpgraph_antispam.php";

    +

    +
  2. +

    a new instance of the class AntiSpam must be created

    +

    +

    1
    +
    $spam = new  AntiSpam();

    +

    +
  3. +

    the string to be used in the challenge must be specified. To + automatically generate a suitable string use

    +

    +

    1
    +2
    +
    // 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

    +

    +

    1
    +
    $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.

    +
  4. +

    output the image with a call the method Stroke() on the + created instance of the AntiSpam class.

    +

    +

    1
    +2
    +3
    +
    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().

    +

+

+

In order to practically use this module the challenge string is most likely passed + to the image script via a URL argument, saved to a file and the read back in the + HTML page that is providing the captcha challenge.

+

+

Warning

+

It should be pointed out on more time that modern image analysis + technology is fairly good at automatically read these types of images and + translate it back to the letters they represent so this type of captchas + does not provide any guarantee for automatic sign-ups. There are active + academic research on how to apply various types of artificial intelligence + to read many types of captchas.

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch17s03.html b/includes/jpgraph/docs/chunkhtml/ch17s03.html new file mode 100644 index 0000000..b1dd143 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch17s03.html @@ -0,0 +1,484 @@ +Canvas graphs

Canvas graphs

+ +

This is basically a free form blank canvas where any graphics can be drawn. Canvas + graphs area also used as the basic graph for graphic tables as described in Chapter 19. Graphical tables

+

The library provides two module files to aid with this + "jpgraph_canvas.php" and + "jpgraph_canvtools.php". The second module is strictly speaking + not necessary but provides a number of utility classes that makes it much easier to work + with canvas.

+

Canvas graphs is provided as a layer to make is easier to create arbitrary images and + still make use of some of the convenience methods available in the library (like font + and color support).

+

Canvas graphs makes it easy to use the low level graphic drawing primitives in the + library provided by the two classes

+

+

  1. +

    class Image

    +

    This is the basic low level class that encapsulates the GD library by + providing a complete framework for using graphic primitives with a coherent + API and many convenience methods.

    +
  2. +

    class RotImage

    +

    This is a descendant of class Image that in addition to the basic + primitives also provides support for rotation of graphs

    +

+

+

It is possible to work at different levels of abstraction when creating a + canvas.

+

+

  1. +

    By only using the basic Image and RotImage classes. This can be considered + one abstraction level above the most basic GD libraries

    +
  2. +

    By making use of the functionality provided by class + CanvasGraph and the supporting classes (e.g. class + CanvasScale). By using the canvas scale class it is possible to + defining a coordinate grid on the canvas. These coordinates can then be used + instead of absolute pixels which is necessary to us ethe basic Image and + RotImage classes.

    +

+

+

A concrete example of how canvas graphs can be used can be seen in Figure 8.1. List of all latin TTF fonts. (listfontsex1.php) where all the available fonts have been drawn on a + canvas.

+

Creating a simple canvas

+ +

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.

+

+

Example 17.1. A simple canvas graph to draw a text box (canvasex01.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex01.php,v 1.3 2002/10/23 08:17:23 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>


Figure 17.22. A simple canvas graph to draw a text box (canvasex01.php)

A simple canvas graph to draw a text box (canvasex01.php)


+

+

The example in Figure 17.22. A simple canvas graph to draw a text box (canvasex01.php) starts by creating a 400x200 + sized image.

+

The margins are then set to to get a frame around the image.

+

For canvases the margins has no effect in the way coordinates are entered. Top + left is (0,0) and bottom right (including any potential margin and shadow) is the + maximum. In this case the coordinate range are X:0-399, and Y:0-199

+

The InitFrame() method is then called which actually strokes the + margin and plotarea to the graph. Since everything is stroked in the order the + commands are given it is necessary to make sure that the graphical objects that + should be on top are stroked last. This is different from the other graph types + since they will hide these details and stroke the details in the graph 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.

+

The Text::Align() method specifies the anchor point of the text as + explained in Chapter 8. Text and font handling

+

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 the shadow color + is set 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 graphical context when stroking the text. The current graphic context is + always available in the "$img" property of the CanvasGraph + class.

+

This specification of the graphical context is needed to all Stroke method that is + external to the main graph class.

+
+

Adding lines and rectangles to a canvas

+ +

A canvas also makes a good background for using standard graphic primitives, for + example circles and lines. The first thing to remember is that this requires working + with absolute screen coordinates and secondly that all drawing primitives are found + in the Image Class accessible as a property of the Graph class.

+

This means that to draw a line between absolute coordinates (0,0) and (100,100) + the following code must be created

+

+

1
+
$graph->img->Line(0, 0, 100, 100);

+

+

The following example shows how to create some basic graphic shapes on a + canvas

+

+

Example 17.2. Drawing some basic geometric shapes on a canvas (canvasex02.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex02.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>


Figure 17.23. Drawing some basic geometric shapes on a canvas (canvasex02.php)

Drawing some basic geometric shapes on a canvas (canvasex02.php)


+

+
+

Using a canvas scale together with the shape class

+ +

The previous method using absolute coordinates works. But it gives very little + flexibility in, for example, scaling the image. Working with absolute coordinates is + therefore not very practical and gets tedious for complex figures.

+

To mitigate these issues the library offers a convenience class, class + CanvasScale, this will allow the creation of a suitable scale that will + make it easier to both create and scale the graph.

+

In order to use a canvas scale the module + "jpgraph_canvtools.php" must first be included. In addition + to the canvas scale class this module also provides the companion Shape + class. This companion shape class is used to draw shapes using the specified scale + onto the canvas.

+

Using the scale is quite simple and requires only two steps

+

+

  1. +

    An instance of the scale class is first created with the CanvasGraph + instance as the first parameter

    +
  2. +

    The wanted scale is then specified with the wanted x and y + scales

    +

+

+

The following code snippet shows how this is done

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+$graph = CanvasGraph(400,300);
+ 
+// ... other canvas formatting
+ 
+// Create a new scale
+$scale = new CanvasScale( $graph );
+$scale->Set($xmin, $xmax, $ymin, $ymax);
+ 
+// ...
+?>

+

+

The next step needed to be able to create geometric shapes is to create an + instance of class Shape and give the canvas graph and the scale as the two + parameters as the following line shows.

+

+

1
+2
+3
+
<?php
+$shape = new Shape($graph, $scale);
+?>

+

+

It is now possible to create arbitrary geometric shapes by using the provided + methods in the shape class. The shape class provides the following methods

+

+

  • +

    Shape::SetColor($aColor)

    +
  • +

    Shape::Line($x1,$y1,$x2,$y2)

    +
  • +

    Shape::Polygon($p,$aClosed=false)

    +
  • +

    Shape::FilledPolygon($p)

    +
  • +

    Shape::Bezier($p,$aSteps=40)

    +
  • +

    Shape::Rectangle($x1,$y1,$x2,$y2)

    +
  • +

    Shape::FilledRectangle($x1,$y1,$x2,$y2)

    +
  • +

    Shape::Circle($x1,$y1,$r)

    +
  • +

    Shape::FilledCircle($x1,$y1,$r)

    +
  • +

    Shape::RoundedRectangle($x1,$y1,$x2,$y2,$r=null)

    +
  • +

    Shape::FilledRoundedRectangle($x1,$y1,$x2,$y2,$r=null)

    +
  • +

    Shape::ShadowRectangle($x1,$y1,$x2,$y2,$fcolor=false,$shadow_width=null,$shadow_color=array(102,102,102))

    +
  • +

    Shape::SetTextAlign($halign,$valign="bottom")

    +
  • +

    Shape::StrokeText($x1,$y1,$txt,$dir=0,$paragraph_align="left")

    +
  • +

    Shape:: + IndentedRectangle($xt,$yt,$w,$h,$iw=0,$ih=0,$aCorner=3,$aFillColor="",$r=4)

    +

+

+

We can now show a complete example of using the shape class

+

+

Example 17.3. Creating a canvas graph with a scale and using the shape class (canvasex03.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex03.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/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();
+ 
+?>


Figure 17.24. Creating a canvas graph with a scale and using the shape class (canvasex03.php)

Creating a canvas graph with a scale and using the shape class (canvasex03.php)


+

+

To show the usefulness of using the scale class Figure 17.25. Changing the image size to create a smaller version of the previous example (canvasex04.php) shows the result after just changing the image size but keeping the code the + same. The relation between the shapes will remain the same but in a smaller format + to fit the new image size.

+

+

Figure 17.25. Changing the image size to create a smaller version of the previous example (canvasex04.php)

Changing the image size to create a smaller version of the previous example (canvasex04.php)


+

+

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 Figure 17.26. Keeping the image size but changing the scale (canvasex05.php)

+

+

Figure 17.26. Keeping the image size but changing the scale (canvasex05.php)

Keeping the image size but changing the scale (canvasex05.php)


+

+

We previously mentioned that the Shape class was a wrapper around the image class + with one exception. The exception is that it contains one 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 Figure 17.27. Example of using an indented rectangle (canvasex06.php) shows an example of using this shape.

+

+

Figure 17.27. Example of using an indented rectangle (canvasex06.php)

Example of using an indented rectangle (canvasex06.php)


+

+

As a final note we mention the utility class class + CanvasRectangleText This can be used to add a text with a rounded + rectangle (possibly filled) onto the canvas. Figure 8.1. List of all latin TTF fonts. (listfontsex1.php) + where all the available fonts were shown were using this class.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch18.html b/includes/jpgraph/docs/chunkhtml/ch18.html new file mode 100644 index 0000000..d6ab282 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch18.html @@ -0,0 +1,197 @@ +Chapter 18. Miscellaneous formatting and tools

Chapter 18. Miscellaneous formatting and tools

+ +

This chapter tries to collect all other formatting options (and tricks) available in + the library that doesn't really fit anywhere else

+

Linear regression analysis

+ +

The library offers support to do basic linear regression analysis with the help of + the utility : class LinearRegression defined in the utility module + "jpgraph_utils.inc.php". With this class it is possible to + make a linear estimation of data and calculate some of the basic statistics of the + data, i.e. correlation coefficient and standard error.

+

The LinearRegression class is instantiated with the data to be + analyzed and it is then possible to both get hold of the statistics that corresponds + to the data and also to automatically calculate a range of estimated y-values for a + given set of x-coordinates.

+

The following code snippet shows how to instantiate a regression analysis with + some data

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+require_once( 'jpgraph_utils.inc.php')
+ 
+// Some data to be analyzed (both x, and y-data must be specified)
+$datay = array( ... ) ;
+$datax = array( ... ) ;
+ 
+// Instantiate the linear regression class
+$linreg = new LinearRegression($datax, $datay);
+ 
+// Get the basic statistics
+list( $stderr, $corr ) = $linreg->GetStat();
+ 
+// Get a set of estimated y-value for x-values in range [0,20]
+list($x, $esty) = $linreg->GetY(0,20)
+ 
+...
+ 
+?>

+

+

The methods available in the LinearRegression class that can be used + are

+

+

  • +

    LinearRegression::GetStat()

    +

    Returns an array with (standard error, correlation coefficient, + determination coefficient)

    +

    The closer the correlation coefficient is to 1 the more of the data + variation can be explained by a linear estimate.

    +
  • +

    LinearRegression::GetAB()

    +

    Return an array of the linear coefficients (a,b) where the linear + estimation is y = a + b*x

    +
  • +

    LinearRegression::GetY($aMinX, $aMaxX, $aStep=1)

    +

    Return an array with (xdata, ydata) corresponding to an x-range + between x values in range [$aMinX, $aMaxX] + with steps of $aStep

    +

+

+

The following example shows how to use this utility class to plot both the + original data as well as the estimated linear line.

+

+

Example 18.1. Linear regression using utility class (example16.6.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// Create some "fake" regression data
+$datay = array();
+$datax = array();
+$a= 3.2;
+$b= 2.5;
+for($x=0; $x < 20; ++$x) {
+    $datax[$x] = $x;
+    $datay[$x] = $a + $b*$x + rand(-20,20);
+}
+ 
+$lr = new LinearRegression($datax, $datay);
+list( $stderr, $corr ) = $lr->GetStat();
+list( $xd, $yd ) = $lr->GetY(0,19);
+ 
+// Create the graph
+$graph = new Graph(300,250);
+$graph->SetScale('linlin');
+ 
+// Setup title
+$graph->title->Set("Linear regression");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$graph->subtitle->Set('(stderr='.sprintf('%.2f',$stderr).', corr='.sprintf('%.2f',$corr).')');
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,12);
+ 
+// 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($datay,$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($yd);
+$lplot->SetWeight(2);
+$lplot->SetColor('navy');
+ 
+// Add the pltos to the line
+$graph->Add($sp1);
+$graph->Add($lplot);
+ 
+// ... and stroke
+$graph->Stroke();
+ 
+?>


Figure 18.1. Linear regression using utility class (example16.6.php)

Linear regression using utility class (example16.6.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch19.html b/includes/jpgraph/docs/chunkhtml/ch19.html new file mode 100644 index 0000000..92d2b30 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch19.html @@ -0,0 +1,41 @@ +Chapter 19. Graphical tables

Chapter 19. Graphical tables

+ +

Introduction

+ +

Note

This module is only available in the pro-version of the library.

+

When visualizing data it is often useful to have both a quick graphical view which can + show high level trends and a detailed table view with the exact figures. The table + module supports the creation of an almost endless varieties of tables.

+

The table library module will allow any kind of rectangular table with an arbitrary + number of rows and columns. user selectable size, cells may be merged with other cells, + have individual background colors, different fonts and various types of borders.

+

Since graphic tables can be created as objects this also means that they can be added + to ordinary graph types in much the same way as for example icons and text + objects.

+

A good way to get an idea of the capabilities of the library is to review Figure 19.1. Standalone table examples where a number of different tables that all have + ben created with the library are shown. In the remainder of this chapter the APIs + available will be explained by means of a number of worked through examples.

+

Since table has full support for Client Side Image Maps (CSIM) they can also be used a + launch pad to take the user to further detailed information.

+

In addition to adding data tables to graphs it is also possible to create graphic + tables on the fly all by its own. This has the advantage compared with HTML tables to + allow users to make copies of the table while maintaining the exact formatting of the + table.

+

Figure 19.1. Standalone table examples

+ +
Standalone table examples
+

+

In addition to the standalone tables shown above another common usage is to combine a + graph and a table. An example of how this can be done is shown in Figure 19.2. Combining a graphic table and a bar graph below. The exact steps how to create this graph + is described in Case study: Adding a table to a bar graph.

+

Figure 19.2. Combining a graphic table and a bar graph

+ +
Combining a graphic table and a bar graph
+

+
+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch19s02.html b/includes/jpgraph/docs/chunkhtml/ch19s02.html new file mode 100644 index 0000000..cd25b08 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch19s02.html @@ -0,0 +1,699 @@ +Constructing tables

Constructing tables

+ +

In this section we will introduce the basic concepts of tables and explain the basic + formatting possibilities that are available.

+

Basic tables

+ +

A table is created as an instance of the class GTextTable and can be + managed in much the same way as for example Icons, Texts or other plot objects. It + can be added to the graph (at specified X and Y coordinates) using the standard + Graph::Add() method.

+

The creation of a table starts with including the necessary file + "jpgraph_table.php" which contains the class definition for + the GTextTable class. In order to create a table we also need a graph + context to which the table can be added. This can be either one of the ordinary + graphs which used an instance of class Graph or to create a stand alone + table by using an instance of class CanvasGraph

+

Creating a new table is then just matter of creating a new instance of the + class GTextTable and calling the initialization method with the + desired size (in rows and columns) of the table. To display the table stand alone we + also need to create a canvas graph and then add the table to the graph.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php
+require_once "jprgraph/jpgraph.php";
+require_once 'jpgraph/jpgraph_canvas.php';
+require_once "jprgaph/jpgraph_table.php";
+ 
+// Setup a basic canvas graph context
+$graph = new CanvasGraph(630,600);
+ 
+// Create a basic graph
+$table = new GTextTable();
+$table->Init(5,7); // Create a 5 rows x 7 columns table
+ 
+...
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// and send back to the client
+$graph->Stroke();
+?>

+

+

As can be seen above it is not necessary (but still possible) to specify an + explicit physical size for the table. The physical size of the table will be + automatically determined depending on the content of the table.

+

The cells in the table are numbered sequentially where (0,0) is the top left and + (n-1, m-1) is the bottom right cell in a table with n rows and m columns.

+

The next step is to populate the table with some data. The content in one cell is + specified with the using one of the following methods

+

+

  • +

    GTextTable::Set($aRow, $aCol, $aText)

    +

    Set the specified text in cell ($aRow, + $aCol)

    +

    GTextTable::Set($aData)

    +

    Copy the data in the two dimensional array $aData to the + table

    +
  • +

    GTextTable::SetImage($aRow, $aCol, $aText, + $aImage)

    +

    Set the specified image in cell ($aRow, + $aCol)

    +
  • +

    GTextTable::SetCellCountryFlag($aRow,$aCol,$aFlag,$aScale=1.0,$aMix=100,$aStdSize=3)

    +

    Set the specified country flag in cell ($aRow, + $aCol)

    +

+

+

The Set() method is polymorphic and can be called in two different + ways.

+

It can either be used to specify the value of each individual cell by identifying + the cell by its row and column index (starting at 0) ways. For example to continue + the example above we set the first two cells on the first row to 1 and 2 vi the two + calls

+

+

1
+2
+3
+4
+
...
+$table->Set(0,0,1);
+$table->Set(0,1,1);
+...

+

+

The second, and probably less tedious way is to setup a 2-dimensional array + (matrix) with suitable values and then pass that 2-dimensional array as the first + and only argument to the Set() method as the following example + shows

+

+

1
+2
+3
+
$data = array( array( 12, 7),
+               array( 10, 5));
+$table->Set($data)

+

+

If the table is specified by a matrix directly it is not necessary to make the + initial Init() call since it will be automatically determined by the + size of the matrix.

+

The following basic full example creates a 2 rows by 4 columns table with + consecutive values. Note here that we make use of CanvasGraph to + provide the graph on which to add the table. The result of this script is shown in + Figure 19.3. The most basic 2x4 table (table_howto1.php)

+

+

Example 19.1. The most basic 2x4 table (table_howto1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(70,50);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// ... and send back the table to the client
+$graph->Stroke();
+ 
+?>


Figure 19.3. The most basic 2x4 table (table_howto1.php)

The most basic 2x4 table (table_howto1.php)


+

+

In the example above we also made use of a minor shortcut. If the data to the + table is specified with a 2-dimensional array there is no need to call the + Init() method since the size will be determined by the supplied + array.

+

We will not yet begin discussion how to change fonts, colors and grids. Instead we + will focus on the structure of the table and introduce the merge operation.

+
+

Merging cells

+ +

The only way to change the structure (as opposed to the look & feel) of the + table is by merging two or more cells. The merge operation is done via one of three + method calls:

+

+

  • +

    MergeRow()

    +

    Merge all cells in a specified row

    +
  • +

    MergeCol()

    +

    Merge all cells in a specified column

    +
  • +

    MergeCells()

    +

    Merge a rectangular range of cells

    +

+

+

The first two methods are really just simplifications for the third most generic + method. The first two methods merge all the cells in a specified row or column and + the third method merges any arbitrary rectangular range of cells specified by the + upper left nd lower right corner.

+

In addition, by default, these calls will also center align the text in the merged + cells (both horizontally and vertically). This can however be adjusted by giving the + wanted alignment as additional argument to the methods or by calling the specific + APIs that controls the alignment of the data within each cell.

+

The third (and most generic) method merge a range of cells specified by the top + left and bottom right corner. So, for example, the following line will merge the + rightmost four cells in the previous example

+

+

1
+
$table->MergeCells(0,2,1,3);

+

+

+

Figure 19.4. Merging the rightmost 4 cells in the table (table_howto2.php)

Merging the rightmost 4 cells in the table (table_howto2.php)


+

+

The merged cell can later on be referenced by the top left of the original merged + cell range. This means that the merged cell in the above example is referred to as + the (0,2) cell.

+

If we instead wanted to merge the top row of the table we could have simplified + the call by using one of the alternative merge methods. In this case the + MergeRow() method would be applicable as in

+

+

1
+
$table->MergeRow(0);

+

+

which would then give the table as shown in Figure 19.5. Merging the top row (table_howto3.php)

+

+

Figure 19.5. Merging the top row (table_howto3.php)

Merging the top row (table_howto3.php)


+

+

In summary, the following three rules apply to merging and/or merged cells

+

+

  • +

    It is an error to try o merge already merged cells.

    +
  • +

    A merged cell is referenced by the top left cell in the merged range. +

    +
  • +

    All formatting that can be applied to a single cell can also be + applied to a merged cell.

    +

+

+
+

Font adjustment

+ +

The most basic way to change the look and feel of the table is to adjust the font + that is used in the different cells in the table. To adjust the font within the + table the following methods are available

  • +

    SetFont(), Specify the default font for the entire table + or for a specified range of cells

    +
  • +

    SetRowFont(), Specify the font for an entire row of cells +

    +
  • +

    SetColFont(), Specify the font for an entire column of + cells

    +
  • +

    SetCellFont(), Specify the font for a single cell

    +
+

By default the font in the table is set to FF_FONT1, i.e. the + built-in bit mapped font of medium size. The default color of the font is 'black'.

+

+

Note

+

If several font settings are applied to the same cell it will be the last + method call before the table Stroke() method that will take + precedence.

+

+

+

As a simple example the following script shows how to adjust the font used in the + first merged row in the previous example.

+

+

Figure 19.6. Adjusting the font in the top row (table_howto5.php)

Adjusting the font in the top row (table_howto5.php)


+

+

The font in Figure 19.6. Adjusting the font in the top row (table_howto5.php) was adjusted with a call to

+

+

1
+
$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14);

+

+

Polymorphic SetFont()

+

Before finishing this section it is worth noting that the SetFont() + method is polymorphic and can be called in two different ways.

+

+

  1. +

    In the first way it can be called with a single font (triple) + argument. That font specification will then become the default for all + cells in the table, for example

    +

    +

    1
    +
    $table->SetFont(FF_TIMES,FS_NORMAL,12);

    +

    +

    will set the entire table to use Times TTF font.

    +
  2. +

    In the second way the first four arguments specifies a cell range (top + left, bottom right) to apply the font setting to, for example

    +

    +

    1
    +
    $table->SetFont(0,1,1,2,FF_TIMES,FS_NORMAL,12);

    +

    +

+

+
+

Color adjustment

+ +

In order to adjust the look and feel of the table it is possible to set the + following colors of the table:

+

+

  • +

    The color of the text/number in each cell

    +
  • +

    The background color of each cell

    +
  • +

    The color of the grid (inside the table) and border (around the table) +

    +

+

+

The font color for a cell (or range of cells) is specified with one of

+

+

  • +

    SetColor(), Set the color for a range of cells or the + entire table

    +
  • +

    SetRowColor(), Set the color for a specified row of cells +

    +
  • +

    SetColColor(), Set the color for a specified column of + cells

    +
  • +

    SetCellColor(), Set the color for a specified cells +

    +

+

+

In a similar way the background color (or the fill color) of a cell can be + specified with

+

+

  • +

    SetFillColor(), Set the fill color for a range of cells + or the entire table

    +
  • +

    SetRowFillColor(), Set the fill color for a specified row + of cells

    +
  • +

    SetColFillColor(), Set the fill color for a specified + column of cells

    +
  • +

    SetCellFillColor(), Set the fill color for a specified + cells

    +

+

+

The way to adjust the color of the grid and border will be discussed in the + section regarding borders and grids below.

+

Polymorphic SetColor() and + SetFillColor()

+

In the same manner as SetFont() can act on both all cells and a + specified range of cells the two color setting methods work in the same way. Both + SetColor() and SetFillColor() can both be called + either with a single argument (in which all cells will be addressed) or by giving a + range (top left and bottom right cell) to be acted upon.

+

The following method calls will set the background color of the first three cells + in row 2 and 3 and the entire table

+

+

1
+2
+3
+4
+5
+6
+7
+
...
+// First set the default fill color to lightgray
+$table->SetFillColor('lightgray');
+ 
+// The Set a range to yellow
+$table->SetFillColor(2,0,3,2,'yellow');
+...

+

+

Finally we give some concluding examples to make the usage of these methods more + clear.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
...
+// Set the default font color for all table cells
+$table->SetColor('darkgray');
+ 
+// Set the font color for all cells in row one 
+$table->SetRowColor(1,'darkgray');
+ 
+// Set the font color for the first two cells in the second row 
+// (row with index=1)
+$table->SetColor(1,0,1,1,'darkgray');
+...

+

+

Note

+

If there are multiple color settings for the same cell then the last method + called before the final Stroke() call will be the color that shows.

+

For example the following script sets the color of cell (0,0) to both 'black' + and 'yellow' but since the yellow is the last method to be called this is the + color that will be used for cell (0,0)

+

+

1
+2
+3
+4
+5
+
...
+$table->SetRowColor(0,'black');
+$table->SetColColor(0,'yellow');
+...
+$graph->Stroke();

+

+
+

Finally, we illustrate the usage of these method by continuing with the previous + example and coloring row 0 as shown in Figure 19.7. Merging and setting the colors the top row (table_howto4.php)

+

+

Figure 19.7. Merging and setting the colors the top row (table_howto4.php)

Merging and setting the colors the top row (table_howto4.php)


+

+

The coloring in Figure 19.7. Merging and setting the colors the top row (table_howto4.php) was accomplished by adding + the following two lines to the previous script.

+

+

1
+2
+
$table->SetCellFillColor(0,0,'orange@0.7');
+$table->SetCellColor(0,0,'darkred');

+

+

The same effect could also have been accomplished by using the row version of the + color methods as in

+

+

1
+2
+
$table->SetRowFillColor(0,'orange@0.7');
+$table->SetRowColor(0,'darkred');

+

+

Which sets of methods to use in this case is a matter of personal preference since + both achieve the same effect.

+
+

Adjusting table and cell sizes

+ +

The exact size of the table can only be indirectly controlled by specifying the + width of the columns and the height of the rows. The width/height can either be + controlled individually on a row by row (or column by column) basis or by giving all + rows/columns the same width/height. This is accomplished by the methods

+

+

  • +

    SetMinRowHeight(), Sets the minimum height of rows +

    +
  • +

    SetMinColWidth(), Sets the minimum width of columns +

    +

+

+

As can be noted from the name of the methods the width and height specified is not + necessarily the exact size of the row/column. It's just the minimum size. The actual + size is depending on the text in the cells. The row height (and column width) will + always grow in order to fit the text within the largest cell.

+

Polymorphic functions

+

The number of arguments to the two methods can in fact be either one or two. If + only one argument is supplied then it is interpretated as the minimum width/height + for all columns/rows in the table. If two arguments are used then the first argument + will specify what row/columns the height/width is specified for.

+

Continuing with the table in Figure 19.7. Merging and setting the colors the top row (table_howto4.php) . If we want + to make sure that all the cells in row 1 is at least 35 pixels wide we could add to + add the following in the previous script

+

+

1
+2
+3
+
...
+$table->SetMinColWidth(35);
+...

+

+

Which would then give the table shown in Figure 19.8. Setting the minimum column width to 35 pixels. (table_howto6.php)

+

+

Figure 19.8. Setting the minimum column width to 35 pixels. (table_howto6.php)

Setting the minimum column width to 35 pixels. (table_howto6.php)


+

+
+

Fine tuning cell alignment and cell padding

+ +

The final bit of important formatting is the ability to specify the alignment of + the data in each of the cells within the table. It is possible to specify both the + horizontal and vertical alignment. The alignment can be specified as one of

+

+

  • +

    Horizontal alignment: "left", "right", "center"

    +
  • +

    Vertical alignment: "top", "bottom", "center"

    +

+

+

As usual there are four variants of the alignment methods

+

+

  • +

    SetAlign(), Set the align for a range of cells or the + entire table

    +
  • +

    SetRowAlign(), Set the alignment for an entire row +

    +
  • +

    SetColAlign(), Set the alignment for an entire column +

    +
  • +

    SetCellAlign(), Set the alignment for a specific cell +

    +

+

+

Each of the methods accepts two alignment arguments, the horizontal and the + vertical alignment. We don't give any examples here since the usage of these methods + should be obvious.

+

+

Note

+

It should be mentioned that in addition to using these methods the + alignment can also be set when using the merge methods (as discussed above). + This is purely as a convenience since it is such a common use case to adjust + the alignment when merging cells.

+

+

+
+

Adjusting border and grid lines

+ +

The final formatting option available is the shape, size and color of the border + and grid lines in the table. As of this writing the library supports the following + styles of grid lines.

+

+

  • +

    TGRID_SINGLE, a basic solid line of specified width and + color (default)

    +
  • +

    TGRID_DOUBLE, two lines of equal width separated by the + same width as the line width.

    +
  • +

    TGRID_DOUBLE2, two lines where the left/top line is twice + as thick as the bottom/right line.

    +

+

+

+

+
+

Figure 19.9. Double lines 1 (table_howto7.1.php)

Double lines 1 (table_howto7.1.php)

+
+

Figure 19.10. Double lines 2 (table_howto7.2.php)

Double lines 2 (table_howto7.2.php)

+
+

+

+

The methods available to adjust the grid lines are

+

+

  • +

    SetGrid(), Set the grid line style for all grid lines +

    +
  • +

    SetColGrid(), Set the specified vertical grid line +

    +
  • +

    SetRowGrid(), Set the specified horizontal grid line +

    +

+

+

The borders in Figure 19.9. Double lines 1 (table_howto7.1.php) was modified by adding the + following call to the basic table script.

+

+

1
+
$table->SetRowGrid(2,1,'black',TGRID_DOUBLE);

+

+

and in Figure 19.10. Double lines 2 (table_howto7.2.php) +

+

+

1
+
$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2);

+

+

The order of the arguments are 1) Row, 2) Width (weight) and 3) Line style.

+

Finally, in order to adjust the outer border of the table there is one last method + available

+

+

  • +

    SetBorder(), Set the width and color of the outer border +

    +

+

+

+

Tip

+

In order to remove a specific grid line or the border the width is + specified as 0

+

+

+

As a final example the following script snippet removes many of the grid lines and + borders by adding the following lines to the previous basic table script.

+

+

1
+2
+3
+4
+5
+
...
+$table->SetBorder(0);
+$table->SetGrid(0);
+$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2);
+...

+

+

The result of this modification is shown in Figure 19.11. Removing some grid lines and border. In addition we have right aligned all the cells as is common practice for numeric data. (table_howto8.php) + below.

+

+

Figure 19.11. Removing some grid lines and border. In addition we have right aligned all the cells as is common practice for numeric data. (table_howto8.php)

Removing some grid lines and border. In addition we have right aligned all the cells as is common practice for numeric data. (table_howto8.php)


+

+
+

Specific number formatting

+ +

The final method of formatting we will briefly touch upon is the number + formatting. By setting a specific number formatting it is possible to have numeric + values formatted in a uniform way regardless of the original format. The number + format is the same format string that would be used with the printf() + family.

+

The available methods for this formatting follows the usual structure

+

+

  • +

    SetNumberFormat(), Set the number format for a range or + the whole table

    +
  • +

    SetRowNumberFormat(), Set the number format for a + specific row

    +
  • +

    SetColNumberFormat(), Set the number format for a + specific column

    +
  • +

    SetCellNumberFormat(), Set the number format for a + specific cell

    +

+

+

To illustrate the use of this formatting we start with the table in Figure 19.11. Removing some grid lines and border. In addition we have right aligned all the cells as is common practice for numeric data. (table_howto8.php) . and apply the format string + "%0.1f" which will format the values as floating point values with + one decimal. We do this by adding the method following method call

+

+

1
+
$table->SetNumberFormat('%0.1f');

+

+

+

Figure 19.12. Applying a number format to the data in the cells (table_howto9.php)

Applying a number format to the data in the cells (table_howto9.php)


+

+

+

Note

+

The number format will only set the number format it will not do any + rounding of the actual values. This is the responsibility of the client. +

+

+

+
+

Using images and country flags in the table

+ +

In addition to ordinary text it is also possible to have arbitrary images (read + from a file) or use one of the built-in country flags available in the library as + background images in the table cells.

+

+

Note

+

Remember to include "jpgraph_iconplot.php" if images + should be included and "jpgraph_flags.php" if country + flags are included.

+

+

+

The methods available for this purpose are

+

+

  • +

    SetImage(), Set the same image for all cells or a range + of cells

    +
  • +

    SetCellImage(), Set the image for a specific cell

    +
  • +

    SetRowImage(), Set the image for a row of cells

    +
  • +

    SetColImage(), Set the image for a column of cells +

    +
  • +

    SetCellImageConstrain(), Set the height or width of an + image in a specified cell

    +
  • +

    SetCellCountryFlag(), Use a specified country flag as + image in a specified cell

    +

+

+

For example, to add the United Kingdoms flag in cell (2,1) in the table one would + have to add the call

+

+

1
+
$table->SetCellCountryFlag(2,1,'united kingdom');

+

+

as usual with the background images it is possible to scale it and also adjust the + mix-in factor by using additional arguments to the above methods.

+

However there is on extra feature available with images and tables. If we wanted + to make sure that the flag is of a specific height or width it is possible to + specify this and have the library auto-scale the image to fit the specified + parameter.

+

For example to restrict the height of the UK flag set in cell (2,1) to 20 pixels + the call would be

+

+

1
+
$table->SetCellImageConstrain(2,1,TIMG_HEIGHT,20);

+

+

We conclude this section with a small example on the use of country flags in a + table in Figure 19.13. Using country flags in the table cells (table_flagex1.php)

+

+

Figure 19.13. Using country flags in the table cells (table_flagex1.php)

Using country flags in the table cells (table_flagex1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch19s03.html b/includes/jpgraph/docs/chunkhtml/ch19s03.html new file mode 100644 index 0000000..d3483ea --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch19s03.html @@ -0,0 +1,11 @@ +CSIM Table support

CSIM Table support

+ +

Each cell in a table can be a hotspot target. The following line will make cell (1,1) + a hotspot

+

+

1
+
$table->SetCellCSIMTarget(1,1,'tableex02.php','View details');

+

+

As usual it is necessary to call Graph::StrokeCSIM() instead of the + ordinary Graph::Stroke() method to generate the CSIM result.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch19s04.html b/includes/jpgraph/docs/chunkhtml/ch19s04.html new file mode 100644 index 0000000..c98d487 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch19s04.html @@ -0,0 +1,262 @@ +Table API Overview

Table API Overview

+ +

In this overview we do not give details about the arguments required by each method. + Instead this is meant as an overview to get a feel for what is available in the library. + All details are provided in the class reference.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 19.1. Table API Overview
Method nameDescription
Constructing
GTextTable()Create a new table
Init()Specify table size
Set()Specify data in table
SetPos()Specify position of table in graph
SetScalePos()Specify scale position of table in graph
SetAnchorPos()Specify anchor position for table. By default the top left corner of the + table will be aligned with the specified position.
Merging cells
MergeCol()Merge all cells in the same column
MergeRow()Merge all cells in the same row
MergeCells()Merge all cells in a range
Font specification
SetFont()Set default font for range or entire table
SetRowFont()Set font for a specific row
SetColFont()Set font for a specific column
SetCellFont()Set font for a specific cell
Font color
SetColor()Set default font color for range or entire table
SetRowColor()Set font color for a specific row
SetColColor()Set font color for a specific column
SetCellColor()Set font color for a specific cell
Fill color
SetFillColor()Set fill color for range or entire table
SetRowFillColor()Set fill color for an entire row
SetColFillColor()Set fill color for an entire column
SetCellFillColor()Set fill color fro a specific cell
Alignment in cells
SetAlign()Set default align for range or entire table
SetRowAlign()Set align in a specific row
SetColAlign()Set align in a specific column
SetCellAlign()Set align in a specific cell
Borders and grid
SetBorder()Set weight of border around the table
SetGrid()Set style and weight for interior grid
SetColGrid()Specify grid for a specific column
SetRowGrid()Specify grid for a specific row
Background images & country + flags
SetImage()Use the specified image as background
SetCellImage()Use the specified image as background
SetRowImage()Use the specified image as background
SetColImage()Use the specified image as background
SetCountryFlag()Use a country flag as background
SetImageConstrain()Specify width or height for cell image (or flag)
Width and height of + cells
SetMinColWidth()Set minumum column width
SetMinRowHeight()Set minimum row height
Number formatting
SetNumberFormat()Set number format for range or entire table
SetRowNumberFormat()Number format fro a specific row
SetColNumberFormat()Number format fro a specific column
SetCellNumberFormat()Number format fro a specific cell
Cell padding and + margins
SetPadding()Set default padding for range or all cells
SetRowPadding()Set padding in a specific row
SetColPadding()Set padding in a specific column
SetCellPadding()Set padding in a specific cell
Text orientation
SetTextOrientation()Set text orientation for entire table
SetCellTextOrientation()Set text orientation for a specific cell
CSIM Handling
SetCellCSIMTarget()Set URL target for specified cell
SetCSIMTarget()Set URL target for all cells. By using this method it is also possible + to have an automatic row and column index appended to the target URL as + GET parameters
+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch19s05.html b/includes/jpgraph/docs/chunkhtml/ch19s05.html new file mode 100644 index 0000000..e176b99 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch19s05.html @@ -0,0 +1,48 @@ +Examples

Examples

+ +

Example 1

+ +

Table formatting, variant 1, right adjusted Times font

+

+

Figure 19.14. xx (table_mex00.php)

xx (table_mex00.php)


+

+
+

Example 2

+ +

Table formatting, variant 1, using Times font for data and a sans serit font for + headings together with removed grid lines and filled headers.

+

+

Figure 19.15. xx (table_mex0.php)

xx (table_mex0.php)


+

+
+

Example 3

+ +

Table formatting, variant 2, using the same sans serit font for all information + but with some grid lines.

+

+

Figure 19.16. xx (table_mex1.php)

xx (table_mex1.php)


+

+
+

Example 4

+ +

Table formatting, variant 3, where some data is highlighted and we use a thicker + border.

+

+

Figure 19.17. xx (table_mex3.php)

xx (table_mex3.php)


+

+
+

Example 5

+ +

Show how the table can be turned 90 degrees

+

+

Figure 19.18. Vertical text (table_vtext.php)

Vertical text (table_vtext.php)


+

+
+

Example 6

+ +

The following example shows how to add images (icons) to a number of cells.

+

+

Figure 19.19. Adding an icon (image) in a table cell (table_iconex1.php)

Adding an icon (image) in a table cell (table_iconex1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch19s06.html b/includes/jpgraph/docs/chunkhtml/ch19s06.html new file mode 100644 index 0000000..a830f12 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch19s06.html @@ -0,0 +1,158 @@ +Case study: Adding a table to a bar graph

Case study: Adding a table to a bar graph

+ +

The goal of this example is to explain in detail how to achieve the graphs shown in + Figure 19.20. Combining a bar graph and a table (tablebarex1.php)

+

+

Figure 19.20. Combining a bar graph and a table (tablebarex1.php)

Combining a bar graph and a table (tablebarex1.php)


+

+

The graph in Figure 19.20. Combining a bar graph and a table (tablebarex1.php) consists of a standard accumulated + bar graph combined with a table just below the X-axis. The way to create such a graph is + very basic. First create a standard bar graph with some extra bottom margin (to make + room for the table) and then create and position the table below the graph. The only + challenge here is to make sure that the width of the table and graph matches to line up + each column under each bar.

+

Lets walk through the steps to do this.

+

The data to be plotted in the bar and in the table is created in a table as follows

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+$datay = array(
+    array('Jan','Feb','Mar','Apr','May','Jun'),
+    array(12,18,19,7,17,6),
+    array(3,5,2,7,5,25),
+    array(6,1.5,2.4,2.1,6.9,12.3));
+?>

+

+

each line in this matrix corresponds to one row in the table and one set of bars that + will make up the accumulated bar plot.

+

First let's define some constants that will control the size and position of the graph + and table.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+$nbrbar = 6; // number of bars and hence number of columns in table
+$cellwidth = 50;  // width of each column in the table
+$tableypos = 200; // top left Y-coordinate for table
+$tablexpos = 60;  // top left X-coordinate for table
+$tablewidth = $nbrbar*$cellwidth; // overall table width
+$rightmargin = 30;  // right margin in the graph
+$topmargin = 30  // top margin of graph
+?>

+

+

The next step is to calculate a suitable size for the entire graph, i.e. the entire + image.

+

+

1
+2
+3
+4
+
<?php
+$height = 320;  // a suitable height for the image
+$width = $tablexpos+$tablewidth+$rightmargin; // the width of the image
+?>

+

+

Finally its time ot make use of these constants to rceate the basic graph. Note that + we calculate the bottom margin to just fit the tables selected Y-coordinate position.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$graph = new Graph($width,$height);    
+$graph->img->SetMargin($tablexpos,$rightmargin,$topmargin,$height-$tableypos);
+$graph->SetScale('textlin');
+$graph->SetMarginColor('white');
+?>

+

+

The rest of the code to create the accumulated bar plot is pretty mundane and we just + show the code here without further comment.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php
+// Create the bars and the accbar plot
+$bplot = new BarPlot($datay[3]);
+$bplot->SetFillColor('orange');
+$bplot2 = new BarPlot($datay[2]);
+$bplot2->SetFillColor('red');
+$bplot3 = new BarPlot($datay[1]);
+$bplot3->SetFillColor('darkgreen');
+$accbplot = new AccBarPlot(array($bplot,$bplot2,$bplot3));
+$accbplot->value->Show();
+$graph->Add($accbplot);
+?>

+

+

It's now time to setup the table. The position of the table is determined by the + previous set constants and the original data as specified above.

+

+

1
+2
+3
+4
+5
+
<?php
+$table = new GTextTable();
+$table->Set($datay);
+$table->SetPos($tablexpos,$tableypos+1);
+?>

+

+

The rest of the table formatting is fairly basic and again we just show the necessary + script without further comment.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php
+$table->SetFont(FF_ARIAL,FS_NORMAL,10);
+$table->SetAlign('right');
+$table->SetMinColWidth($cellwidth);
+$table->SetNumberFormat('%0.1f');
+ 
+// Format table header row
+$table->SetRowFillColor(0,'teal@0.7');
+$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11);
+$table->SetRowAlign(0,'center');
+ 
+// .. and add it to the graph
+$graph->Add($table);
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch20.html b/includes/jpgraph/docs/chunkhtml/ch20.html new file mode 100644 index 0000000..32fac26 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch20.html @@ -0,0 +1,50 @@ +Chapter 20. Odometer

Chapter 20. Odometer

+ +

Introduction

+ +

Note

This module is only available in the pro-version of the library.

+

Odometer graphs uses the metaphor of an old fashioned speedometer for cars. It is + normally used to give a quick overview of one specific parameter. Experience have shown + that this type of metaphor is easily and quickly understood by most people. By adding + color indications to the odometer it is very quick to see whether or not a specific + value is within a allowed range or outside.

+

Figure 20.1. Odometers shows an overview of some typical + odometers created with the library.

+

Figure 20.1. Odometers

+ +
Odometers
+

+

Features

+ +

Odometers produced with this package have a wide range of functionality and as you + would expect almost every bit of visual layout is in one way or the other + customisable. For simple use there are suitable default values for most parameters + which will make creation of simple Odometer just a matter of a few lines of code.

+

Among other things Odometers support the following features:

+

+

  • +

    Both half (semi-circle) and full (circle) odometers are supported +

    +
  • +

    Fully customizable scales and odometer sizes

    +
  • +

    Different size and shapes of the indicator needles

    +
  • +

    Scale color indicators

    +
  • +

    Multiple dials in the same graph

    +
  • +

    Full support for library standard fonts and colors

    +
  • +

    Automatic layout engine for multiple plots in the same graph which + aids in positioning of the graphs without having to specify pixel + coordinates

    +

+

+
+
+ + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch20s02.html b/includes/jpgraph/docs/chunkhtml/ch20s02.html new file mode 100644 index 0000000..85e056b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch20s02.html @@ -0,0 +1,633 @@ +Creating and formatting basic odometer graphs

Creating and formatting basic odometer graphs

+ +

In order to use odometer graphs the extension module + "jpgraph_odo.php" must be included in the script (in addition + to the ordinary "jpgraph.php" code module).

+

The creation of Odometer graphs otherwise follows the traditional steps in the library + of creating a graph and then adding one or several plots to the canvas.

  1. +

    Create a basic canvas graph as an instance of class + OdoGraph

    +
  2. +

    Create an instance of one or several odometer plots (the dials) as + instances of class OdoPlot, set up the scale and appearance and + then add them to the graph canvas.

    +
  3. +

    Send back the graph to the client with a call to + OdoGraph::Stroke()

    +
+

The following script shows the principles

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php
+// Create a new canvas 300x200 pixels
+$graph = new OdoGraph(300,200);
+ 
+// Adjust parameters as needed
+$graph->title->Set(.......)
+$graph->caption->Set(...)
+ 
+// Create one of more Odometer
+$odo1 = new Odometer();
+$odo2 = new Odometer();
+ 
+...
+ 
+// Adjust odometer parameters, colors etc
+$odo1->needle->Set(21);
+$odo2->needle->Set(47);
+ 
+...
+ 
+// Position the odometer plots vertically
+$l = new LayoutVert( array($odo1, $odo2, ...) );
+ 
+// Add the odometers with the proper layout to the canvas
+$graph->Add( $l );
+ 
+// If you only have a single odometer you may also write
+// $graph->Add( $odo1 );
+ 
+// Send back the image to the client
+$graph->Stroke();  
+?>

+

+

+

A basic odometer

+ +

The following script shows the simplest possible odometer using just default + values

+

+

Example 20.1. A basic odometer (odotutex00.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,140);
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>


Figure 20.2. A basic odometer (odotutex00.php)

A basic odometer (odotutex00.php)


+

+

The size of the Odometer is determined automatically to fit the given image size + as good as possible. Since the size of the odometer automatically adjust itself to + allow for any odometer caption, graph titles or graph captions there is rarely need + to manually override this automation.

+

However it is still possible to manually specify the absolute size (of the radius) + in pixels or as a fraction of the image size.

+

To set a specific value top the Odometer radius the following method is + used

+

+

  • +

    OdoPlot::SetSize($aRadius) +

    +

+

+

Since clas OdoGraph inherits all the basic graph features we can easily augment + the graph in Figure 20.2. A basic odometer (odotutex00.php) to, for example, have titles by + adding the line

+

+

1
+
$graph->title->Set('A suitable graph title');

+

+

In the following chapters we will go through all the options that exists to modify + the size, shape and appearance of the graph.

+

+

Tip

+

Remember that since Odometer inherits all the basic graph feature it will + support functionality like image cache (see Efficient graph generation using the built-in cache subsystem.)

+

+

+
+

Half and Full Odometers

+ +

Odometers comes in two fundamental shapes, full and half circle. The default if + nothing else is specified is to create a half circle. The type of odometer is + specified in the creation of the odometer.

+

The type is controlled by the two constants

+

+

  • +

    ODO_FULL Create a full circle odometer

    +
  • +

    ODO_HALF Create a half circle odometer. This is also the + default value.

    +

+

+

As an example the following odometer plot instantiation will create a full + odometer plot

+

+

1
+
$odo = new Odometer(ODO_FULL);

+

+

and the following a half odometer plot

+

+

1
+
$odo = new Odometer(ODO_HALF);

+

+

In ?? an example of a very basic full circle odometer is shown

+

+

Figure 20.3. A full circle odometer (odotutex01.php)

A full circle odometer (odotutex01.php)


+

+
+

Adding titles and captions

+ +

Remember that each graph can have a title, a subtitle and subsubtitle. In addition + the Odmeter graphs offers the possibility to have a caption string. This is a text + (much like the title) but is drawn at the bottom of the graph instead of at the top.

+

The following script shows how to add a tite, subtitle and caption to our previous + example

+

+

Example 20.2. Adding titles and captions (odotutex02.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,180);
+ 
+// Setup titles
+$graph->title->Set("Result for 2002");
+$graph->title->SetColor("white");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set("New York Office");
+$graph->subtitle->SetColor("white");
+$graph->caption->Set("Figure 1. Branch results.");
+$graph->caption->SetColor("white");
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>


Figure 20.4. Adding titles and captions (odotutex02.php)

Adding titles and captions (odotutex02.php)


+

+

As can be see from the figure the margins will automatically adjust to hold the + specified titles and captions.

+

Remember that text strings can have multiple lines by separating lines with a '\n' + character. The following example shows how to add a more descriptive caption to the + graph

+

+

Example 20.3. Adding a multi line caption (odotutex03.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,200);
+ 
+// Setup titles
+$graph->title->Set("Result for 2002");
+$graph->title->SetColor("white");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set("New York Office");
+$graph->subtitle->SetColor("white");
+$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption.");
+$graph->caption->SetColor("white");
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>


Figure 20.5. Adding a multi line caption (odotutex03.php)

Adding a multi line caption (odotutex03.php)


+

+
+

Adjusting colors

+ +

Almost all areas in the graph have a customizable color. This means that for the + Odometer graph itself it is possible to adjust

+

+

  • +

    Margin colors

    +
  • +

    The plot area (the rectangular area where the plot(s) are added

    +
  • +

    The border line colors

    +
  • +

    Shadow color

    +

+

+

For example the following line changes the margin color of the graph

+

+

1
+2
+3
+4
+5
+
<?php
+// Make the border 40% darker than normal "khaki"
+$graph->SetMarginColor("khaki:0.6"); 
+$graph->SetColor("khaki");
+?>

+

+

For the odometer plot itself it is possible to adjust

+

+

  • +

    Fascia color

    +
  • +

    Scale label color (and font)

    +
  • +

    Frame color (and width)

    +
  • +

    Indicator color (the color of the odometer "needle"

    +
  • +

    Adding colored segment for scale areas

    +

+

+

For example the following lines would change the fascia, indicator and scale label + color

+

+

1
+2
+3
+4
+5
+
<?php
+$odo->SetColor("white");
+$odo->scale->label->SetColor("blue");
+$odo->needle->SetFillColor("yellow");
+?>

+

+

Figure 20.6. Changing colors (odotutex04.php) shows the effect of adding the two code + snippets above to our previous example.

+

+

Figure 20.6. Changing colors (odotutex04.php)

Changing colors (odotutex04.php)


+

+

+
+

Changing indicator needle style

+ +

The indicator is accessed through the "$needle" property of the plot. + The indicator needle for the odometer can have six basic shapes. which are set by + the method

+

+

  • +

    Needle::SetStyle($aStyle,$aStyleOption=null)

    +

+

+

The style is defined by one of the following symbolic constants.

+

+

  1. +

    NEEDLE_STYLE_SIMPLE

    +
  2. +

    NEEDLE_STYLE_STRAIGHT

    +
  3. +

    NEEDLE_STYLE_ENDARROW, (default)

    +
  4. +

    NEEDLE_STYLE_SMALL_TRIANGLE

    +
  5. +

    NEEDLE_STYLE_MEDIUM_TRIANGLE

    +
  6. +

    NEEDLE_STYLE_LARGE_TRIANGLE

    +
  7. +

    NEEDLE_STYLE_HUGE_TRIANGLE

    +

+

+

The following line would therefore create a plot with a "simple" indicator.

+

+

1
+
$odo->needle->SetStyle(NEEDLE_STYLE_SIMPLE);

+

+

The different styles are illustrated in Figure 20.7. Possible shapes of the odometer indicator (odotutex06.php)

+

+

Figure 20.7. Possible shapes of the odometer indicator (odotutex06.php)

Possible shapes of the odometer indicator (odotutex06.php)


+

+

For the needle style "NEEDLE_STYLE_ENDARROW" it is also possible to + adjust the ending arrow. This is done by specifying the particular end arrow size as + the second parameter to SetStyle(). , the $aStyleOption + parameter.

+

To simplify the arrow style setting a number of predefined sizes are available. + When choosing an arrowhead the width and length are specified in three different + steps, small , medium and large.

+

The available end arrow styles are listed in ?? below

+

+

Table 20.1. Available arrow size

+ +
Symbolic nameDescription
NEEDLE_ARROW_SSSmall width, small length
NEEDLE_ARROW_SMSmall width, small length
NEEDLE_ARROW_SLSmall width, large length
NEEDLE_ARROW_MSMedium width, small length
NEEDLE_ARROW_MMMedium width, small length
NEEDLE_ARROW_MLMedium width, large length
NEEDLE_ARROW_LSLarge width, small length
NEEDLE_ARROW_LMLarge width, medium length
NEEDLE_ARROW_LLLarge width, large length
+


+

+

The following code specifies a the largest available arrowhead

+

+

1
+
$odo->needle->SetStyle(NEEDLE_STYLE_ARROWHEAD, NEEDLE_ARROW_LL);

+

+

An illustration of the various arrow heads are given in Figure 20.8. Illustration of various sizes of arrow heads (odotutex07.php)

+

+

Figure 20.8. Illustration of various sizes of arrow heads (odotutex07.php)

Illustration of various sizes of arrow heads (odotutex07.php)


+

+

The basic length and weight of the needle is specified with the methods

+

+

  • +

    Needle::SetLength($aLength)

    +
  • +

    Needle::SetWeight($aWeight)

    +

+

+

The needle size is specified as fractions of the radius. So for example the + following line wold create a needle halfway into the plot area

+

+

1
+
$odo->needle->SetLength(0.5);

+

+

The default size for a needles is 60% of the radius.

+

+
+

Adding drop shadows

+ +

It is possible to add drop shadows to both the overall graph s well as the + indicator needle. To add a drop shadow to the overall graph the method is as + usual

+

+

  • +

    OdoGraph::SetShadow($aShadow=true,$aColor="gray@0.5",$aDx=4,$aDy=4)

    +

+

+

and to add a drop shadow to the indicator needle the method

+

+

  • +

    OdoNeedle::SetShadow($aShadow=true,$aColor="gray@0.5",$aDx=4,$aDy=4)

    +

+

+

must be used.

+

The following two lines add both types of drop shadows to an odometer graph with + the result shown in ??

+

+

1
+2
+3
+4
+5
+
<?php
+$graph->SetShadow();
+...
+$odo->needle->SetShadow();
+?>

+

+

+

Figure 20.9. Adding drop shadows (odotutex08.php)

Adding drop shadows (odotutex08.php)


+

+
+

Changing sizes and margins

+ +

The size of the odometer is automatically adjusted to fit the available space in + the image after margins for titles and captions have been taken into account. This + means that normally it is not necessary to adjust the margins manually.

+

The odometer plot can be adjusted with the method

+

+

  • +

    OdoPlot::SetSiz<e($aSize)

    +

+

+

Each odometer also have a margin surrounding it. This is the amount of "space" + around each individual odometer. The amount of space is adjusted by the method

+

OdoPlot::SetMargin($aMargin)

+

If we take the example in Figure 20.8. Illustration of various sizes of arrow heads (odotutex07.php) and increase the + individual margin around all odometers they will become smaller (if we keep the + original image size) and the result is shown in Figure 20.10. Increasing the individual margins around the plots (odotutex09.php)

+

+

Figure 20.10. Increasing the individual margins around the plots (odotutex09.php)

Increasing the individual margins around the plots (odotutex09.php)


+

+
+

Adding color indications in the scale

+ +

An odometer usually have some colored markings to indicate safe and dangerous + values. The library allows the addition of any number of colored scale areas with + one or several calls to the method

+

+

  • +

    OdoPlot::AddIndication($aMin,$aMax,$aColor)

    +

+

+

This method allows the specification of a min and max value of the scale which + will be given the background color specified as the third parameter.

+

The example in Figure 20.11. Adding colored scale indicators (odotutex10.php) adds three different scale + area with 6 different scale areas

+

+

Figure 20.11. Adding colored scale indicators (odotutex10.php)

Adding colored scale indicators (odotutex10.php)


+

+
+

Changing size of the non-colored center area

+ +

In Figure 20.11. Adding colored scale indicators (odotutex10.php) it can be seen that by default the scale + color indication goes all the way down to the base of the needle. It is however + possible to adjust this to the colored area stops a bit above the base of the + needle. The non colored area is adjusted with a call to the method

+

+

  • +

    OdoPlot::SetCenterAreaWidth($aWidth)

    +

    The width is specified as a fraction of the radius of the plot.

    +

+

+

The following example in Figure 20.12. Adjusting the non-colored center area (odotutex11.php) set the size of this + base area to be 45% of the plot radius.

+

+

Figure 20.12. Adjusting the non-colored center area (odotutex11.php)

Adjusting the non-colored center area (odotutex11.php)


+

+
+

Using multiple indicator needles in one odometer

+ +

In all the previous example the odometer plots have all had a single indicator. It + is however possible to add up to four indicators to each plot. This could for + example be sued to show the current value and a sliding 3-day average.

+

The extra needles are accessed through the properties

+

+

  • +

    OdoPlot::needle2

    +
  • +

    OdoPlot::needle3

    +
  • +

    OdoPlot::needle4

    +

+

+

In order to enable one of these extra needles the method OdoNeedle::Show() has to + be called. The value of the indicator can then be set as the following example + shows.

+

+

1
+2
+
$odo->needle2->Show();
+$odo->needle2->Set(44);

+

+

By default all the needles will have the same color so the color should be + manually changed to be able to differentiate among multiple needles. The example in + Figure 20.13. Adding a second scale indicator (odotutex12.php) shows an example of this where we also have + made the second indicator a bit shorter to further make it easier to read.

+

+

Figure 20.13. Adding a second scale indicator (odotutex12.php)

Adding a second scale indicator (odotutex12.php)


+

+
+

Adding an odometer legend (label)

+ +

Most types of odometers have a legend in the middle of the meter usually + indicating what the scale shows. The odometer have a specific text property to add + text in that position.

+

+

  • +

    OdoPlot::label

    +

+

+

The following code adds the label "mBar" as the scale indicator and also adjusts + the default font

+

+

1
+2
+
$odo->label->Set("mBar");
+$odo->label->SetFont(FF_FONT2,FS_BOLD);

+

+

The result of this cane be seen in Figure 20.14. Adding a scale legend by using the label property (odotutex13.php)

+

+

Figure 20.14. Adding a scale legend by using the label property (odotutex13.php)

Adding a scale legend by using the label property (odotutex13.php)


+

+
+

Adjusting the width and color of the odometer frame (border)

+ +

The border of the odometer plot can be adjusted with a call to

+

+

  • +

    OdoPlot::SetBorder($aColor,$aWidth=1)

    +

+

+

The following example shows the effect of making the odometer plot border + thicker

+

+

1
+
"=odotutex08.1|Adding a thicker border around the odometer plot"

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch20s03.html b/includes/jpgraph/docs/chunkhtml/ch20s03.html new file mode 100644 index 0000000..aec97bc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch20s03.html @@ -0,0 +1,269 @@ +Working with the odometer scale

Working with the odometer scale

+ +

In the previous section we ignored the actual scale in order to focus on the + formatting options. Now we will do the (almost) opposite, only focus on how to + manipulate the scale and the scale labels.

+

There are a number of properties that can be adjusted in the scale.

+

+

  • +

    The min and max values

    +
  • +

    The fonts and for the scale

    +
  • +

    The formatting of the scale values

    +
  • +

    The start and end angles for the min and max values

    +
  • +

    The tick interval

    +
  • +

    The intervall of the scale labels

    +

+

+

The scale is an instance of class OdoScale and is instantiated as an + object that is accessed through the "$scale" property of the plot

+

+

  • +

    OdoPlot::scale

    +

+

+

Adjusting the scale, ticks and labels

+ +

By default the scale runs between 0 (inclusively) and 100 (inclusively). trying to + set the indicator needle to a value outside this range will result in an + error.

+

The min an max values o the scale are specified with the method

+

+

  • +

    OdoScale::Set($aMin,$aMax)

    +

+

+

The min/max values can be specified to any numeric value with the restriction that + $aMin <= $aMax

+

To adjust which scale position should have tick marks and which tick marks should + have a labels the following method is used.

+

+

  • +

    OdoScle::SetTicks($aTickInterval, $aLabelInterval)

    +

    The first argument specifies the tick interval, i.e. the interval tick + marks will be drawn in the odometer. The second argument specifies that + every n:th tick should have a label.

    +

+

+

The following line specifies that every 20 unit of the scale should have a tick + mark and that every second tick mark should have a label

+

+

1
+
$odo->scale->SetTicks(20,2)

+

+

+

Tip

+

To make sure that both the min and max value of the scale gets a tick mark + the tick multiplier should be an even divider to the scale range and the + label multiplier should be a factor in the tick multiplier.

+

+

+

Figure 20.15.  (odotutex14.php) shows and example of how to change the scale, + tick and label positions.

+

+

Figure 20.15.  (odotutex14.php)

(odotutex14.php)


+

+

To adjust the appearance of the tick marks in respect to line weight, length and + color the following three methods can be used:

+

+

  • +

    OdoScale::SetTickLength($aLength)

    +
  • +

    OdoScale::SetTickWeight($aWeight)

    +
  • +

    OdoScale::SetTickColor('red')

    +

+

+

+

Note

+

The tick length of a major tick mark (which have labels) are 1.5 times + that of a minor tick mark. This factor can not be adjusted.

+

+

+
+

Adjusting scale label format

+ +

The following section will show hot to customize the appearance of scale and + labels.

+

The scale labels can, as all other texts in the library have there font and color + adjusted. The text property for the labels i accessed through the property

+

+

  • +

    OdoScale::label

    +

+

+

Since this is a standard Text object we can adjust the font and color as the + following example shows

+

+

1
+2
+
$odo->scale->label->SetFont(FF_FONT1,FS_BOLD);
+$odo->scale->label->SetColor('navy');

+

+

The way the labels are formatted are controlled by a format string with the + standard "printf()" syntax, e.g "%d" (as default) displays + an integer and "%02f.1" displays a label zero padded to two positions + and with one decimal place.

+

The format string is applied by using the OdoScale::SetLabelFormat() + method of the scale class as in

+

+

1
+
$odo->scale->SetLabelFormat('%d%%');

+

+

The other aspect of the label formatting is exactly how the labels are positioned + within the scale. By using the method

+

+

  • +

    OdoScale::SetLabelPos($aPos)

    +

+

+

it is possible to specify the distance from the center to the label edge. By + default this is 80% (i.e. specified as 0.8)

+

The following example shows the effect of applying some of these formatting + options.

+

+

Example 20.4. Adjusting the scale format (odotutex15.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,170);
+ 
+// Setup graph titles
+$graph->title->Set('Custom formatting');
+$graph->title->SetColor('white');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD);
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+$odo = new Odometer();
+$odo->SetColor("lightgray:1.9");
+ 
+// Setup the scale
+$odo->scale->Set(100,600);
+$odo->scale->SetTicks(50,2);
+$odo->scale->SetTickColor('brown');
+$odo->scale->SetTickLength(0.05);
+$odo->scale->SetTickWeight(2);
+ 
+$odo->scale->SetLabelPos(0.75);
+$odo->scale->label->SetFont(FF_FONT1, FS_BOLD);
+$odo->scale->label->SetColor('brown');
+$odo->scale->label->SetFont(FF_ARIAL,FS_NORMAL,10);
+ 
+// Setup a label with a degree mark
+$odo->scale->SetLabelFormat('%dC'.SymChar::Get('degree'));
+ 
+// Set display value for the odometer
+$odo->needle->Set(280);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>


Figure 20.16. Adjusting the scale format (odotutex15.php)

Adjusting the scale format (odotutex15.php)


+

+

+

Note

+

As can be seen in Figure 20.16. Adjusting the scale format (odotutex15.php) we have used the + utility class SymChar in order to get hold of the extended + character that represents the degree mark. Remember that in order to get the + extended character it is necessary to use a TTF scale.

+

+

+
+

Adjusting the start and stop angle for the scale

+ +

By default the scale labels start at 180 degree (9'a clock) and ends at 0 degree + (3'a clock). To offer full flexibility this can be adjusted.

+

The method used for this is

+
  • +

    OdoScale::SetAngle($aStart, $aEnd)

    +

    the angle is counted clockwise from the 6'a clock position. This means + that the normal half odometer has a start angle of 90 degrees and an end + angle of 270 degrees.

    +

For full circle odometers the standard start angle is 40 degrees and + the end angle is 320. This leaves a sector of 80 degrees free at the bottom of the + odometer.

+

For example we could decide that the scale will start and stop 20 degrees above + the horizontal line. The following example shows two odometer plots. The left uses + the default start and end angle while the right odometer plot have adjusted start + and end angles.

+

+

Figure 20.17. Adjusting start and end angles of scale (odotutex16.php)

Adjusting start and end angles of scale (odotutex16.php)


+

+

To further emphasize that the scale below the start and stop angles are "invalid" + we could add a scale indicator in some gray:ish color that would signal that the + area below 0 and 100 is not a valid scale area. We can do this by setting the range + of the scale indicator to values outside the scale that would correspond to the + horizontal line.

+

In Figure 20.17. Adjusting start and end angles of scale (odotutex16.php) we can accomplish this by adding the + following two lines to the second odometer

+

+

1
+2
+
$odo2->AddIndication(-15,0,'lightgray');
+$odo2->AddIndication(100,115,'lightgray');

+

+

The result of this is shown in Figure 20.18. Adding gray areas below the min and max scale values (odotutex16.1.php)

+

+

Figure 20.18. Adding gray areas below the min and max scale values (odotutex16.1.php)

Adding gray areas below the min and max scale values (odotutex16.1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch20s04.html b/includes/jpgraph/docs/chunkhtml/ch20s04.html new file mode 100644 index 0000000..02420ee --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch20s04.html @@ -0,0 +1,196 @@ +Adding and positioning multiple odometers to a graph

Adding and positioning multiple odometers to a graph

+ +

The library supports unlimited number of odometers plots in a single graph. They can + either be positioned manually within the graph by specifying absolute coordinates for + the centers of the odometers or it can be done in a semi automatically way to avoid the + hassle of calculating exact pixels positions.

+

+

Tip

+

Remember that there is a caption property of the odometer plot as well as the + main graph class and it is suitable to add a separate caption text to every + odometer to separate them.

+

+

+

As have been shown in the previous example adding several odometer to the same graph + is simply a matter of creating multiple instances of class Odometer and + then adding them to the graph by calling the OdoGraph::Add() method.

+

Manual positioning

+ +

To manually position the odometer plot the following method is used

+

+

  • +

    OdoPlot::SetPos($aX, $aY)

    +

    Specifies the position of the odometer plot in either absolute + coordinates (>1) or as fraction of the width/height when specified as + fractions (in range (0.0 to 1.0)

    +

+

+

+

Note

+

There is a minor difference when using odometer captions and specifying + the y coordinate using fractions in that the y-coordinate and the radius + will automatically adjust to the height of the caption size. This guarantees + that the total image (odometer+caption) will always occupy the same total + height in the image regardless of the size of the caption.

+

+

+

The top left corner of the graph is (0,0)

+

The following example manually positions to odometer plots in the graph, one at + the top right corner and one in the bottom left corner.

+

+

Figure 20.19. Manually specifying the position of odometer plots (odotutex17.php)

Manually specifying the position of odometer plots (odotutex17.php)


+

+
+

Using layout classes

+ +

+

Note

+

Those familiar with Java AWT classes will recognize this concept

+

+

+

Normally we don't want to have to calculate the absolute x and y coordinates when + positioning odometers. A much better concept would be to just tell the library to + position three odometer horizontally or perhaps vertically without us having to + figure out the exact coordinates our self.

+

This is where layout classes come in handy.

+

There are two types of layout horizontal and vertical. To specify that two + odometers should be positioned side by side (horizontal) first a new layout object + is created and then the odometer plots are added as object within the layout class. + Later on when the object are put to the image the horizontal layout class will take + all its objects and spread them out evenly along a horizontal line. The + corresponding applies to the vertical layout class with the obvious change in + direction.

+

The layout object are added to the graph in exactly the same was as odometers, by + calling the OdoGraph::Add() method.

+

The following line would create a horizontal line of odometer plots

+

+

1
+2
+3
+4
+
<?php
+$row1 = new LayoutHor( array($odo1, $odo2, $odo3) );
+$graph->Add( $row1 );
+?>

+

+

If we instead wanted the odometer stacked on top of each other the lines above + would have to be changed to

+

+

1
+2
+3
+4
+
<?php
+$row1 = new LayoutVert( array($odo1, $odo2, $odo3) );
+$graph->Add( $row1 );
+?>

+

+

There is no limit to how many object can be added to a layout class.

+

If it was only possible to add odometers in the creation of layout classes it + would be of limited use. The real power of layout classes is that they can be + combined.

+

So for example if we wanted two odometers in the top row and three in the bottom + row we can think of this as first creating two horizontal layout object which are + then in there turn layout out vertically.

+

The following code shows how this could be done

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+$row1 = new LayoutHor( array($odo1, $odo2) );
+$row2 = new LayoutHor( array($odo3, $odo4, $odo5) );
+ 
+// Combine the two rows in a column
+$col1 = new LayoutVert( array($row1, $row2) );
+ 
+// The image will now have 5 odometers!
+$graph->Add( $col1 );
+?>

+

+

The following code shows a full example on how this is done

+

+

Example 20.5. Using layout classes for automatic positioning (odotutex18.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph
+$graph = new OdoGraph(500,180);
+ 
+$odo = array();
+ 
+// Now we need to create an odometer to add to the graph.
+for( $i=0; $i < 5; ++$i ) {
+    $odo[$i] = new Odometer();
+    $odo[$i]->SetColor('lightgray:1.9');
+    $odo[$i]->needle->Set(10+$i*17);
+    $odo[$i]->needle->SetShadow();
+    if( $i < 2 )
+        $fsize = 10;
+    else
+        $fsize = 8;
+    $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize);
+    $odo[$i]->AddIndication(92,100,'red');
+    $odo[$i]->AddIndication(80,92,'orange');
+    $odo[$i]->AddIndication(60,80,'yellow');
+}
+ 
+// Create the layout
+$row1 = new LayoutHor( array($odo[0],$odo[1]) );
+$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) );
+$col1 = new LayoutVert( array($row1,$row2) );
+ 
+// Add the odometer to the graph
+$graph->Add($col1);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+?>


Figure 20.20. Using layout classes for automatic positioning (odotutex18.php)

Using layout classes for automatic positioning (odotutex18.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch20s05.html b/includes/jpgraph/docs/chunkhtml/ch20s05.html new file mode 100644 index 0000000..711a122 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch20s05.html @@ -0,0 +1,146 @@ +Adding icon and text objects to the graph

Adding icon and text objects to the graph

+ +

Odometer plots supports the ordinary way of adding icon and text objects to the graph.

+

Adding a text object

+ +

Text objects are added by first creating an instance of class Text + for each text needed and then adding the text to the graph with the usual call to + MatrixGraph::Add().

+

A basic text will only require two additional lines of code

+

+

1
+2
+3
+4
+
<?php
+$txt = new Text('Simple string',20,20);
+$graph->Add($txt); 
+?>

+

+

The following code snippet is slightly more complicated and will create a boxed + text in the upper right corner of the graph.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+// Add a boxed text
+$txt = new Text();
+$txt->SetFont(FF_ARIAL,FS_NORMAL,10);
+$txt->Set("Arbitrary text\non a\nMatrix Plot");
+$txt->SetParagraphAlign('center');
+$txt->SetPos(0.95,0.15,'right');
+$txt->SetBox('lightyellow');
+$txt->SetShadow();
+$graph->Add($txt); 
+?>

+

+

The snippet above adds a text at coordinates X=20, Y=20 using the default lower + left corner as the text anchor point.

+

+

Note

+

To add a newline you must remember to use double-quotes to enclose the + text otherwise the "\n" will only be interpreted literally.

+

+

+

+

Note

+

Remember that the "text align", as adjusted with SetAlign(), + specifies the anchor point for the text, i.e. what part of the text is + aligned with the specified position.

+

+

+

To add many text strings it is often useful to specify them in an array and then + have a loop creating the text object and add the text array of all the created + objects to the graph as the following short snippet shows.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+//--------------------------------------------------------------
+// Add texts to the graph
+//--------------------------------------------------------------
+$txts = array( 
+    array('Textstring one ...',$tx1,$ty1),
+    array('Textstring two ...',$tx2,$ty2),
+    array('Textstring three ...',$tx3,$ty3),
+ 
+$n=count($txts);
+$t=array();
+for($i=0; $i < $n; ++$i){
+    $t[$i] = new Text($txts[$i][0],$txts[$i][1],$txts[$i][2]);
+    $t[$i]->SetFont(FF_ARIAL,FS_NORMAL,12);
+    $t[$i]->SetColor('brown');
+    $t[$i]->SetAlign('center','top');
+}
+$graph->Add($t);
+?>

+

+
+

Adding icons to the graph

+ +

Icons are added as instances of class IconPlot to the graph (as usual + with a call to OdometerGraph::Add()). This means that to use icons the + library module "jpgraph_iconplot.php" must first be included.

+

The following example shows how to add a small icon in the lower right corner of + the graph. For more information on formatting icons that are added to a graph see + Adding icons (and small images) to the graph

+

+

Caution

+

Since Odometer graphs doesn't have a ny concept of linear scale the + position of icons can only be specified as absolute pixels or as fractions + of the width/height.

+

+

+

+

Figure 20.21. Adding an icon and text to a Odometer graph (odotutex19.php)

Adding an icon and text to a Odometer graph (odotutex19.php)


+

+

We also recall that it is possible to use country flags as icons by making use of + the method

+

+

  • +

    IconPlot::SetCountryFlag($aFlag,$aX=0,$aY=0,$aScale=1.0,$aMix=100,$aStdSize=3)

    +

+

+
+

Adding background images

+ +

In just the same way as for all other plots it is possible to add a background + images, background gradients and a background flag to the graph. Since this has been + discussed several time previously in the manual we only show a simple example + here.

+

+

Note

+

Since odometer graphs does not have the concept of plot area the + background image positioning alternative BGIMG_FILLPLOT is the + same as BGIMG_FILLFRAME as we have used in this example + below.

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch21.html b/includes/jpgraph/docs/chunkhtml/ch21.html new file mode 100644 index 0000000..31ef0e6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21.html @@ -0,0 +1,318 @@ +Chapter 21. Windrose

Chapter 21. Windrose

+ +

Introduction

+ +

Note

This module is only available in the pro-version of the library.

+

Windrose plots are usually used to display values which are related to compass + directions. For example it could be used to illustrate measured wind strengths over a + time period in different directions. Figure 21.1. An basic Windrose plot + Illustrates a basic example of a windrose graph with one windrose plot.

+

Figure 21.1. An basic Windrose plot

+ +
An basic Windrose plot
+

+

Windrose plots puts data in a number of ranges (or buckets). The number of data points + in a certain bucket is visualized by the length of the particular bucket in that + direction. The input data specifies the percentage of the overall data that belongs to + one bucket in one specific direction. By default there are eight buckets with ranges + shown in Table 21.1. Default windrose buckets. The default ranges that + is shown in the legend is standard values used in displaying wind strengths. The values + in the legend (for the buckets) is purely informational since the actual display is + controlled by the input data that only specifies a bucket number and not any absolute + data values. See more on how to specify input data in ??

+

+

Table 21.1. Default windrose buckets

+ +
Bucket nr Range of values
0[0,1]
1[1,2]
2[2,3]
3[3,5]
4[5,6]
5[6,10]
6[10,13.5]
7[13.5,99]
+


+

+

+

Note

+

The default fonts for Windrose graphs are TTF fonts. This means that to run + the examples exactly as shown in this chapter TTF fonts must be installed. If + TTF fonts are not available then the font needs to be changed to one of the + built-in fonts.

+

+

+

Windrose plots also supports full image anti-aliasing to enhance the look and feel of + the graph. The image in Figure 21.1. An basic Windrose plot is using + anti-alias.

+

+

Caution

+

To use anti alias TTF fonts must be enabled and used.

+

+

+

Features

+ +

The Windrose extension module supports all the usual library graph capabilities + like frames, shadows, colors, titles, cache. Some of the additional Windrose graphs + capabilities are:

+

+

  • +

    Enhanced anti-alias capability for smooth looking graphs

    +
  • +

    Manual or automatic scale

    +
  • +

    Supports customizable compass types which allow you to choose between + 16,8 and 4 compass directions to be shown.

    +
  • +

    Supports two types of basic graphs; Free direction graphs and compass + bound graphs.

    +
  • +

    Allows data to be specified with both compass direction and angles (in + degrees)

    +
  • +

    Fully customizable fonts everywhere in the plot

    +
  • +

    Fully automatic adaptive positioning of the labels for the scale to + avoid collision with data. This can also be turned off to allow manual + positioning of the labels.

    +
  • +

    Labels have extensive formatting capabilities and supports background + colors, rounded boxes and arbitrary fonts.

    +
  • +

    Supports multiple Windrose graphs on the same image

    +
  • +

    Fully customizable size and positioning of each individual windrose + graph.

    +
  • +

    Size of windrose plots can be specified both as absolute pixels or as + fraction of the graph size.

    +
  • +

    Both manual and automatic color specifications

    +
  • +

    Both automatic and manual scaling

    +
  • +

    Intelligent positioning of angle labels with possibility for client + specification of alignment type.

    +
  • +

    Windrose graphs may have arbitrary texts blocks added to the + graph

    +

+

+
+

Different types of Windrose plots

+ +

There are two basic types of Windrose plots:

+

+

  • +

    Compass type.

    +

    This type of windrose plot has either 4,8 or 16 compass direction + axis. Directions in input data is limited to one of the compass + directions in the plot. The directions are specified as ordinal number + of the direction axis.

    +

    The labels on the axis is by default short forms of the compass + directions, for example, "E", "N", "W", "S". (See ?? for how to alter + the default names of the compass directions). The ordinal number are + counted anti-clockwise from East (3 o'clock).

    +
  • +

    Free type.

    +

    This type of windrose plot has no pre-defined direction axis. + Directions in input data can be arbitrary angles (or specified as + compass directions e.g. "NW"). The 0-angle corresponds to the East + direction (3 o'clock)

    +

+

+

To specify the type of plot to create the following method is used

+

+

  • +

    WindrosePlot::SetType($aDirection) +

    +

    $aDirection is one of the following 4 predefined + constants

    +

    +

    • +

      WINDROSE_TYPE4, Compass type with the four + core compass directions

      +
    • +

      WINDROSE_TYPE8, Compass type with eight + directions

      +
    • +

      WINDROSE_TYPE16, Compass type with sixteen + directions

      +
    • +

      WINDROSE_TYPEFREE, Free type. Data directions + can be arbitrary angles and there are no predefined labels + nor any predefined axis.

      +

    +

    +

+

+

The figures below illustrates the basic principle of the different types of + windrose plots

+

+ + + + + + + + + + + +
+

Figure 21.2. WINDROSE_TYPE4

+ +
WINDROSE_TYPE4
+

+
+

Figure 21.3. WINDROSE_TYPE8

+ +
WINDROSE_TYPE8
+

+
+

Figure 21.4. WINDROSE_TYPE16

+ +
WINDROSE_TYPE16
+

+
+

Figure 21.5. WINDROSE_TYPEFREE

+ +
WINDROSE_TYPEFREE
+

+
+

+

The following line would specify a Windrose plot with all 16 compass angles

+

+

1
+2
+3
+4
+
<?php
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE16); 
+?>

+

+

+

Note

+

If no type is specified the plot type will default to a compass type with + 16 directions

+

+

+

Specifying input data

+ +

Input data is in the form of a data array. Each entry in the array is itself + an array which gives the data for one direction. The data should be interpreted + as the percentage of the overall data that belongs to a certain direction and + bucket. This also means that the total sum of all data entries (for all + doirections) must be less or equal to 100. It can however be less than 100 + (indicating that some data is lost).

+

The first bucket, bucket 0, specifies the 0-value, i.e. what part of the data + in that direction that has no measurement (e.g. it was wind still). Since wind + still has no direction all specified bucket 0 are summarized and displayed in + the inner circle.

+

By default the ranges displayed on the legend are:

+

0-1, 1-2, 2-3, 3-5, 5-6, 6-10, 10-13.5, 13-99

+

This means that the first element specify the percentage of 0-1 reading the + sum of these reading will be placed in the center of the windrose plot. The + second element specifies the percentage of 1-2 readings, the third element the + percentage of 2-3 readings and so on.

+

The direction is specified as the key for that element. The direction can be + specified as either

+

+

  • +

    A string specifying any of the displayed compass directions, e.g. + "N", "SW".

    +

    +

    $data = array ( array('E' => <east_bucket0>,<east_bucket1> ... <east_bucketN> ),
    +                array('ESE' => <eastsoutheast_bucket0>, ... <eastsoutheast_bucketN> ), 
    +                ....
    +                array('NE' => <northeast_bucket0>, ... <northeast_bucketN> ), 
    +                array('ENE' => <eastnortheast_bucket0>, ... <eastnortheast_bucketN> ));

    +

    +
  • +

    An ordinal number (integer) in the range 0-15 for regular plots + which indicates the axis counting anti-clockwise from East. Please + note that only displayed axis count. Ordinal number zero specifies + the east direction

    +

    +

    $data = array ( array(0 => <east_bucket0>,<east_bucket1> ... <east_bucketN> ),
    +                array(1 => <eastsoutheast_bucket0>, ... <eastsoutheast_bucketN> ), 
    +                ....
    +                array(2 => <northeast_bucket0>, ... <northeast_bucketN> ), 
    +                array(3 => <eastnortheast_bucket0>, ... <eastnortheast_bucketN> ));

    +

    +
  • +

    A string indicating a number, e.g. '34.5' , please note that if + the angle is a fraction it must specified as a string. The library + will then automatically recognize that as a valid angle and treat it + as expected. (The reason for this is that floating point numbers + can't be used as keys in an associative array.)

    +

    +

    $data = array ( array('12.5' => <bucket0>,<bucket1> ... <bucketN> ),
    +                array('22.1' => <bucket0>, ... <bucketN> ), 
    +                ....
    +                                

    +

    +

+

+

Within the same data set it is also possible to mix the styles.

+

+

Caution

+

The library makes no data validation apart from checking that the + overall sum of the buckets can not be > 100%. It is up to the client to + make sure that the data specified makes sense.

+

+

+

If you specify a direction in the data for a compass directions that is not + displayed when using a regular Windrose plot you will get an error message to + that affect.

+

Below are some examples of how to specify the data which should clarify how + this works

+

+

Example 21.1. Examples of input data for compass (regular) Windrose plots

+ +

(Assuming we have all 16 axis + displayed)

+

+

1
+
$data = array( 'N' => array(2,5,6) );

+

+

This data array specifies reading in only one direction, "North", the + number of 0-readings are 2 percent, number of 0-1 readings are 5 percent + and the number of 1-2 readings are 6 percent.

+

+

1
+
$data = array( 1 => array(2,5,6), 3 =>  array(6,3), 'NW' => array(3,2,2,2) )

+

+

This data array specifies readings in three directions. As shown it is + possible to mix both ordinal number for the axis as well as the symbolic + direction name. However, it is probably best to stick with one method at + a time for clarity.

+


+

+

+

Example 21.2.  Examples of input data for free Windrose plots

+ +

What is special with the free type is that angles are no longer + restricted to only the 16 compass directions but arbitrary directions as + well.

+

+

1
+
$data = array( 10 => array(2,5,6), 24 =>  array(6,3), 137 => array(3,2,2,2) )

+

+

This data array specifies readings in three directions, 10 degrees, 24 + degrees and 137 degrees.

+

+

1
+
$data = array( '21.6' => array(2,5,6), 'N' => array(6,3), 137 => array(3,2,2,2) )

+

+

This data array specifies readings in three directions, 21.5 degrees, + 'North' (or 90 degrees) and finally 137 degrees. Please note that in + order to specify a fraction for an angle we must specify the direction + as a string value, i.e. '21.6'. This will then be handled automatically + be the library.

+


+

+
+
+
+ + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch21s02.html b/includes/jpgraph/docs/chunkhtml/ch21s02.html new file mode 100644 index 0000000..14696f5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21s02.html @@ -0,0 +1,450 @@ +Creating and formatting basic Windrose graphs

Creating and formatting basic Windrose graphs

+ +

Creation of windrose graphs first requires the inclusion of the library extension + module "jpgraph_windrose.php"

+

The creation of Windrose graphs otherwise follows the traditional steps in the library + of creating a graph and then adding one or several windrose plots to the canvas.

  1. +

    Create a basic canvas graph as an instance of class + WindroseGraph

    +
  2. +

    Create an instance of one or several windrose plots as instances of + class WindrosePlot, set up the scale and appearance and + then add them to the graph canvas.

    +
  3. +

    Send back the graph to the client with a call to + WindroseGraph::Stroke(). As usual this can be used to + either send back the graph to the client (e.g.browser) or write the graph to + a file by specifying a filename as the first argument to + WindroseGraph::Stroke().

    +
+

The example in Figure 21.6. A basic 16 direction windrose graph (windrose_ex0.php) show a windrose graphs using + just the default values for all parameters.

+

+

Example 21.3. A basic 16 direction windrose graph (windrose_ex0.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    0 => array(5,5,5,8),
+    1 => array(3,4,1,4),
+    'WSW' => array(1,5,5,3),
+    'N' => array(2,3,8,1,1),
+    15 => array(2,3,5));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+$graph->title->Set('A basic Windrose graph');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Add and send back to browser
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.6. A basic 16 direction windrose graph (windrose_ex0.php)

A basic 16 direction windrose graph (windrose_ex0.php)


+

+

In the same way as for other graph types one or several Windrose plots can be added + and positioned freely in the Windrose graph by specifying the position as either + absolute coordinates or as fractions of the width/height of the overall graph.

+

+

Tip

+

An easier way to position Windrose plots is to use layout classes as described + in Using layout classes to position Windrose plots

+

+

+

Each instance of the WindrosePlot is added to the overall graph with a + call to the standard method

+

+

  • +

    WindroseGraph::Add($aObject)

    +

+

+

To avoid that all the plots collide in the middle the positioning and sizing methods + as shown in the previous sections should be used.

+

The following script shows how two plots are displayed in the same graph.

+

+

Example 21.4. Adding two windrose plots to the same graph (windrose_2plots_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal idex of axis as well
+// as the direction label
+$data = array(
+    1 => array(10,10,13,7),
+    2 => array(2,8,10),
+    4 => array(1,12,22),
+    );
+ 
+$data2 = array(
+    4 => array(12,8,2,3),
+    2 => array(5,4,4,5,2),
+    );
+ 
+// Create a new small windrose graph
+$graph = new WindroseGraph(660,400);
+$graph->SetShadow();
+ 
+$graph->title->Set('Two windrose plots in one graph');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set('(Using Box() for each plot)');
+ 
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE8);
+$wp->SetSize(0.42);
+$wp->SetPos(0.25,0.55);
+$wp->SetBox();
+ 
+$wp2 = new WindrosePlot($data2);
+$wp2->SetType(WINDROSE_TYPE16);
+$wp2->SetSize(0.42);
+$wp2->SetPos(0.74,0.55);
+$wp2->SetBox();
+$wp2->SetRangeColors(array('green','yellow','red','brown'));
+ 
+$graph->Add($wp);
+$graph->Add($wp2);
+ 
+$graph->Stroke();
+?>


Figure 21.7. Adding two windrose plots to the same graph (windrose_2plots_ex1.php)

Adding two windrose plots to the same graph (windrose_2plots_ex1.php)


+

+

Specifying the windrose scale

+ +

The scale is a property of each plot and is access though the instance variable + WindrosePlot::scale. The scale consists of the epi-centric circles + that radiates from the center of the Windrose plot. The step between each circle can + be set manually or it can be done automatically by the library depending on the data + values.

+

(In order to keep the flow of the text this section leaves the full examples to + the example section.)

+

To manual set the scale of the circles the following method is used:

+

+

  • +

    WindrosePlotScale::SetStepSize($aMax,$aStepSize=null)

    +

    $aMax, The maximum scale value

    +

    $aStepSize, The step between each scale circle

    +

+

+

By default the library tries multiple of 5:s and 2:s for a visually esthetic grid + spacing.

+

Other example of methods available to adjust the scale are

+

+

  • +

    WindrosePlotScale::SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10)

    +

    Specify font for all scale labels apart from the 0-label (in the + center)

    +
  • +

    WindrosePlotScale::SetZFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10)

    +

    Specify the font for the 0-label (in the center)

    +
  • +

    WindrosePlotScale::SetFontColor($aColor)

    +

    Specify font color for all scale labels apart from the 0-label (in the + center)

    +
  • +

    WindrosePlotScale::SetZFontColor($aColor)

    +

    Specify the font for the 0-label (in the center)

    +
  • +

    WindrosePlotScale::SetLabelFillColor($aBkgColor,$aBorderColor=false)

    +

    Set the background color for the labels

    +
  • +

    WindrosePlotScale::SetLabelAlign($aAlign)

    +

    Set the label text alignment

    +
  • +

    WindrosePlotScale::SetLabelFormat($aFmt)

    +

    Set the label format. This is specified as a "printf()" + format string.

    +
  • +

    WindrosePlotScale::Hide($aFlg)

    +

    Hide the scale labels

    +

+

+

Examples of how to use these methods are shown in the following sections.

+

Specifying fonts and font colors

+ +

Fonts can be specified for both the labels on the scale as well as separately + for the label in the center of the plot. The following code snippet shows how to + do this (we assume we have already created a windrose plot called + "windplot")

+

+

1
+2
+3
+4
+5
+6
+7
+
// Font and color for scale labels
+$windplot->scale->SetFont(FF_VERDANA,FS_NORMAL,10);
+$windplot->scale->SetFontColor('navy');
+                        
+// Font and color for the center (Zero circle) label
+$windplot->scale->SetZFont(FF_VERDANA,FS_NORMAL,10);
+$windplot->scale->SetZFontColor('navy');

+

+
+

Manually specifying the scale

+ +

By default the library automatically determines a scale range and step size + taking into account the maximum value of data, size of the plot and the font + size specified for the scale labels.

+

However it is possible to force a manual scale and step size with a call to + Set($aMaxValue,$aStepSize). This call sets the maximum scale + value as well as the step size. The step size is optional. If the step size is + not specified it will be automatically determined.

+

+

1
+2
+3
+4
+5
+
// Specify both maximum value and a step size
+$windplot->scale->Set(40,8);
+  ...
+// Specify just the maximum value
+$windplot->scale->Set(40);

+

+

This feature is also illustrated in Figure 21.25.  (windrose_ex7.php) in + the example part of this chapter.

+

+

Note

+

The automatic scaling tries to first use step sizes as multiples of 5 + and then multiples of 2 to achieve a suitable spacing of the scale + lines.

+

+

+

+

Note

+

It might be surprising to see that the scale steps may change when the + label font is changed. However, this is by design. The reason for this + is that there is only a certain amount of space available for the labels + between each step. In order for large fonts to fit the space between the + grids the step between each circle must be large enough.

+

+

+
+

Specifying the label angle

+ +

The labels for the scale is placed along a line radiating from the center of + the windrose plots. The angle for the labels can be either manually or + automatically determined.

+

The labels for the scale is placed along one of the sixteen compass directions + if you choose automatic positioning of the labels. By default the library tries + to choose a direction with as little data around it as possible.

+

To manually specify the angle a call to SetAngle($aAngle) with + the angle (in degrees) as argument.

+

The code snippet below shows how to do this

+

+

1
+2
+
// Show the labels at 45 degrees angle
+$windplot->scale->SetAngle(45);

+

+

To specify that the library should do this automatically (which is the + default) the angle is specified as the string 'auto' as

+

+

1
+2
+
// Let the library determine a good angle 
+$windplot->scale->SetAngle('auto');

+

+
+

Specifying number formats for scale labels

+ +

In the same way as for other scales in the library it is possible to specify a + "printf()" format string to adjust the appearance of the labels. By default the + label format is the same as

+

+

1
+
$windplot->scale->SetLabelFormat('%d%%');

+

+
+
+

Specifying direction labels

+ +

With direction labels we mean the names of the compass directions surrounding the + windrose plot. By default they are given the English short form for the 16 discrete + compass named directions. This can also be localized (described in ??).

+

Specifying fonts and font colors for the axis titles (direction + labels)

+ +

Fonts for the axis titles are specified with (with the usual arguments)

+
  • +

    WindrosePlot::SetFont()

    +
  • +

    WindrosePlot::SetFontColor()

    +

as the following example shows

+

+

1
+2
+
$windplot->SetFont(FF_TIMES,FS_BOLD,12);
+$windplot->SetFontColor('darkgreen');

+

+

Which for example could give a Windrose plot as shown in Figure 21.22.  (windrose_ex4.php)

+
+

Setting arbitrary text for data directions

+ +

Wen using the free direction windrose plots the default label is the direction + for the data in degrees. This is fully customizable by using the following + method.

  • +

    WindrosePlot::SetLabels($aLabels)

    +

    The input data to this method is an associative array where the + keys are the direction and the content is the text to be + displayed.

    +
+

Please note that for regular Windrose plots, i.e. with only compass direction + the label can not be changed. This is only available if the type of the windrose + plot is WINDROSE_TYPEFREE.

+

The following example specifies a data point at 50 degrees and a text + "Point\n#7315" as the label.

+

+

Tip

+

Labels can contain "\n" which will be interpreted as a line break. +

+

+

+

+

1
+2
+3
+4
+5
+
$data = array( 50 => array(12,12,2) );
+$labels = array( 50 => 'Point #7315' );
+...
+$windplot = new WindrosePlot();
+$windplot->SetLabels($labels);

+

+

An example of this can be seen in Figure 21.24.  (windrose_ex6.php)

+
+

Adjusting the alignment and margin

+ +

There are two basic ways of adjusting the position of the compass labels + around the plot:

+

+

  • +

    Adjusting the margin between the label and the outer plot + circle

    +
  • +

    Adjusting the anchor point of the labels.

    +

+

+

The easiest way to explain this is to first imagine an invisible circle around + the plot. The margins specifies how far from the outer scale circle this + imaginative circle is placed.

+

In order to position the labels on that circle around the plot there are + several possible ways to select what point of the text should be positioned on + the circle. The easiest way is to select the center (both in X and Y directions) + of the text. This works well if all labels are roughly the same size. If there + are big difference between the smallest and largest label it might be necessary + to have a very large margin to avoid the text to "collide" with the plot.

+

A better way is to determine the closest point of the text to the plot and + then make that point lay on the circle. The closets point depends on what + compass direction the label is on, for example for the "East" label the closes + point is the middle of the left side of the text and for the "West" the closes + point is the middle of the right side.

+

The library supports both way of positioning through the method

+
  • +

    WindrosePlot::SetLabelPosition($aPosition)

    +

    Valid values for $aPosition are LBLPOSIITON_CENTER + and LBLPOSITION_EDGE .

    +

The following code snippet shows how to specify both margin and + position do this:

+

+

1
+2
+
$windplot->SetLabelMargin(30);
+$windplot->SetLabelPosition(LBLPOSITION_EDGE);

+

+

The red circle in ?? and ?? illustrates the "imaginative" circle on which the + labels are placed. The distance from the out most plot circle to the label + anchor point is the margin.

+ + + + + + + +
+

Figure 21.8. Positioning with LBLPOSITION_CENTER

+ +
Positioning with LBLPOSITION_CENTER
+

+
+

Figure 21.9. Positioning with LBLPOSITION_EDGE

+ +
Positioning with LBLPOSITION_EDGE
+

+
+

An example of this can be seen in Figure 21.24.  (windrose_ex6.php)

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch21s03.html b/includes/jpgraph/docs/chunkhtml/ch21s03.html new file mode 100644 index 0000000..3b809a6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21s03.html @@ -0,0 +1,365 @@ +Formatting the plot

Formatting the plot

+ +

Positioning the plot

+ +

The position of the graph can be controlled with the method

+

+

  • +

    WindrosePlot::SetPos($aXPos,$aYPos)

    +

+

+

The position can be specified as either absolute position (in pixels) or as a + fraction of width and height. The anchor for the position is the center of the + windrose plot. For example, the following line centers the plot in the graph

+

+

1
+
$windplot->SetPos(0.5,0.5);

+

+
+

Specifying the size of the plot

+ +

In the same way as for the position the size of the windrose plot can be specified + as either an absolute value or as a fraction of the minimum of width and height. The + size specified refers to the diameter of the plot.

+

The size is controlled with the the method

+

+

  • +

    WindrosePlot::SetSize($aDiameter) +

    +

+

+

as in

+

+

1
+
$windplot->SetSize(200);

+

+

The code above sets the diameter of the plot to 200 pixels, setting the value to + 0.7 would set the diameter to 0.7 * min(WIDTH,HEIGHT) where width and height are the + size of the graph.

+
+

Specifying the size of the Zero-circle (middle circle)

+ +

The size of the middle circle (the zero-range circle) can be adjusted with the + method

+

+

  • +

    WindrosePlot::SetZCircleSize($aDiameter) +

    +

    $aDiameter, The diameter can be specified as either an + absolute integer value or as a fraction of the windrose plot diameter. +

    +

+

+

For example the following line sets the size to 1/3 of the windrose plot.

+

+

1
+
$windplot->SetZCircleSize(1/3);

+

+
+

Formatting the plot legend

+ +

The legend is displayed in a fixed position just below the windrose plot as can be + seen in all the previous examples.

+

All legend methods is accessed through the legend property of the windrose plot as + in

+

+

1
+
$windroseplot->legend->SetFont(...);

+

+

There are four basic attributes that can be customizable for the legend as + described in the following paragraphs.

+

Specifying legend fonts

+ +

To allow for maximum flexibility font can be specified for both the numerical + ranges as well as for the text under the legend. In order to avoid making the + legend to wide it is often desirable to use a smaller font for the ranges and a + slightly larger font for the actual text under the legend (as well as inside the + "calm" circle - the indicator for bucket 0).

+

The fonts for the legend is adjusted by the following methods

+

+

  • +

    SetTFont(), The text below the legend

    +
  • +

    SetLFont(), The font for the labels

    +
  • +

    SetCFont(), The font for the label inside the "calm" + circle

    +
  • +

    SetFont(), Sets all the font areas above the same + font. Note that if this method is called after one of the individual + settings previous specified (e.g. SetCFont()) they will + be overwritten.

    +

+

+

The colors for the fonts are specified in an analogue way by using the methods

+

+

  • +

    SetTFontColor()

    +
  • +

    SetLFontColor()

    +
  • +

    SetCFontColor()

    +
  • +

    SetFontColor()

    +

+

+

Figure 21.10. Windrose legend methods explains visually how these + methods are applied

+

Figure 21.10. Windrose legend methods

+ +
Windrose legend methods
+

+

Figure 21.11. Using chinese fonts (windrose_ex6.1.php) illustrates how two fonts were used + for the legend. For the circle we have use a Chinese font (The Kanji characters + roughly means "Chinese language")

+

+

Caution

+

The source file (as every source file in the library) is encoded in + utf-8. For technical reasons some browsers might not render the Chinese + characters correctly when the source file is viewed.

+

+

+

+

Figure 21.11. Using chinese fonts (windrose_ex6.1.php)

Using chinese fonts (windrose_ex6.1.php)


+

+
+

Setting text and colors for the Zero-circle

+ +

The "Calm" circle can have it's size, line weight and color adjusted. In + addition (as was shown in Figure 21.11. Using chinese fonts (windrose_ex6.1.php) ) specify any + text within the circle. By default the text "Calm" is printed inside the circle. + The following methods are used to adjust these properties.

+

+

  • +

    SetCircleWeight($aWeight)

    +
  • +

    SetCircleRadius($aRadius)

    +
  • +

    SetCircleColor($aColor)

    +
  • +

    SetCircleText($aTxt)

    +

+

+
+

Specifying number formats for ranges

+ +

For the ranges it is possible to adjust how the numbers are formatted with a + general format string (in the style of a printf() format string). + This would allow, for example, to choose the number of decimal values to show in + the legend. The format string is specified with a call to

+

+

  • +

    Legend::SetFormat($aFmt).

    +

    The format will be applied to both the lower and upper range + value. This means that the actual legend range text in the legend + will be printed as [number format]-[number format].

    +

+

+

The following example shows how to make sure the ranges are displayed as + integers

+

+

1
+
$wp->legend->SetFormat('%d');

+

+
+

Specifying legend bottom text

+ +

Finally it is also possible to specify a text at the bottom of the legend with + a call to

+

+

+

+
+

Specifying the numeric values displayed for the ranges

+ +

The values displayed in the legend for the ranges can be adjusted with a call + to

+

+

  • +

    WindRosePlot::SetRanges($aRanges). By default the + ranges are set to 0,1,2,3,5,6,10,13.5,99.0, this means that the + ranges printed will be 1-2, 2-3, 3-5, ....

    +

+

+

The following example shows how to change this to the ranges 0.000-0.001, + 0.001-0.003, 0.003-0.005

+

+

1
+2
+
$windplot->SetRanges(array(0.001,0.003,0.005));
+                        $windplot->SetFormat('%.3f');

+

+

As can be seen the first range (bucket 0) is not really directly printed. It + is by default indicated by the circle to the left in the legend.

+

In the example lines above we also changed the format to display the decimals. + Without this the default is only to show one decimal and that would show all + ranges as 0.0. An example of how this might look can be seen in figure 10 below. +

+
+
+

Adjusting the grid colors

+ +

The colors of both the radial grid and the circular grid can be adjusted. This is + done with the method

+

+

  • +

    WindrosePlot::SetGridColor($aColor1,$aColor2) +

    +

+

+

The first argument specifies the grid circle color and the second argument + specifies the radial grid colors.

+
+

Adjusting the weight of the grid circles

+ +

To adjust the weight (thickness) of the grid lines (both circle and radial lines) + the following method is used

+

+

  • +

    WindrosePlot::SetGridWeight($aWeight1,$aWeight2)

    +

    The first argument specifies the weight of the circle and the second + the weight of the radial lines.

    +

+

+

Note

+

It is possible to have individual colors of the radial grid lines (and line + style &weight) by using any of the methods

+

+

  • +

    SetRadialColors()

    +
  • +

    SetRadialStyles() +

    +
  • +

    SetRadialWeight()

    +

+

+
+

+

Note

+

Due to technical and performance limitations circle weight can only be + specified in the range [1,3] (inclusively).

+

+

+
+

Adding a box around the plot

+ +

Finally we remember that it is possible to add a rectangular box around the plot + by using the method

+

+

  • +

    WindrosePlot::SetBox($aColor='black', $aWeight=1, + $aStyle='solid', $aShow=true)

    +

+

+

an example of this can be seen in Figure 21.7. Adding two windrose plots to the same graph (windrose_2plots_ex1.php) .

+
+

Adjusting the size of the center zero circle

+ +

The size of the center circle can be manually adjusted as either specified in + absolute number of pixels or as fractions of the windrose plot (not the entire + windrose graph). This is done with the method

+

+

  • +

    WindrosePlot::SetZCircleSize($aSize)

    +

+

+
+

Localizing the default names for the compass directions

+ +

By default the compass cardinal directions are presented in English locale using + standard denominations for the 16 compass directions.

+

Localizing these names are done with a call to the method

+

+

  • +

    WindrosePlot::SetCompassLabels($aLabels)

    +

+

+

The order of the names for the directions should start with the corresponding name + for "East" and then continue counter-clockwise all the way to "East North East". + Adjusting the names for the compass directions means two things:

+

+

  • +

    If there is named direction in the data (as key) that key must now + also be in localized form.

    +
  • +

    The displayed names for the compass direction will be shown in + localized form.

    +

+

+

For example, the code snippet below shows how to localize the compass directions + into Swedish.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
...
+$data = array(
+    'sso' => array(12,8,2,3),
+    6 => array(5,4,4,5,4),
+);
+$se_CompassLbl =
+array('O','ONO','NO','NNO','N','NNV','NV','VNV','V','VSV','SV','SSV','S','SSO','SO','OSO');
+....
+$windroseplot->SetCompassLabels($se_CompassLbl);
+...

+

+

and the following shows how to make a localization into Japanese

+

+

Caution

+

The source file (as every source file in the library) is encoded in utf-8. + For technical reasons some browsers might not render the Japanese characters + correctly when the source file is viewed.

+

+

+

+

Figure 21.12. Japanese locale (windrose_ex7.1.php)

Japanese locale (windrose_ex7.1.php)


+

+
+

Adjusting the formatting of the windrose plot legs

+ +

Specifying range colors

+ +

To adjust the colors used for each range in the plot the method

+

WindrosePlot::SetRangeColors($aRangeColors) +

+

The following example shows how to set a red-brown color scale

+

+

1
+2
+
$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black');
+$windplot->SetRangeColors($rangeColors);

+

+
+

Specifying the width of the plot "legs"

+ +

The weight (width) of the legs used for each range in the plot is by default + set to the range 2,4,6,8,10,12,14,16,18,20 pixels.

+

This can be adjusted with a call to the method

+

+

  • +

    WindrosePlot::SetRangeWeights($aWeights) +

    +

+

+

If fewer weights than ranges used are supplied the ranges will wrap-around. + The following example shows how to set a larger difference in size for the legs + between the ranges.

+

+

1
+
$windplot->SetRangeWeights(array(2,6,10,14,18));

+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch21s04.html b/includes/jpgraph/docs/chunkhtml/ch21s04.html new file mode 100644 index 0000000..9ceae08 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21s04.html @@ -0,0 +1,392 @@ +Some more advanced formatting

Some more advanced formatting

+ +

Turning off Anti-aliasing

+ +

By default anti-aliasing is enabled. This has a speed penalty together with + restrictions that no background images can be used in this version of the library.

+

If you want to use background images or improve performance anti-aliasing can be + turned off with a call to the method

+

+

  • +

    WindrosePlot::SetAntiAlias($aFlag)

    +

+

+
+

More on formatting scale-labels

+ +

Since scale labels are normal text element all normal text formatting can be used + to enhance the look &feel of the scale labels.

+

Adding background colors

+ +

A simple enhancement to make the labels more visible is to add a box and a + background color for the label. This is done with a call to the method

+

+

  • +

    WindrosePlotScale::SetLabelFillColor($aFillColor, + $aColor)

    +

+

+

The following code snippet shows how this could be done

+

+

1
+
$windplot->scale->SetLabelFillColor('lightblue','black');

+

+

+

Figure 21.13. Adding label background (windrose_ex8.1.php)

Adding label background (windrose_ex8.1.php)


+

+
+

Adjusting the alignment of the scale labels

+ +

By default the scale labels are centered on the intersection between the + radial line and the grid circle. It is possible to also have the label + positioned slightly outside the circular grid. This is all controlled by the + method

+

+

  • +

    WindrosePlotScale::SetLabelAlign($aAlign)

    +

    Possible values for $aAlign are

    +

    +

    • +

      LBLALIGN_CENTER, The default. Center the label

      +
    • +

      LBLALIGN_TOP, Optional. Position the label slightly + outside the circular grid line.

      +

    +

    +

+

+
+

Specifying number formats

+ +

The final formatting option is to specify the number format of the label. This + is specified as an ordinary "printf()" format string. The format is + specified with a call to

+

+

  • +

    WindrosePlotScale::SetLabelFormat($aFmt)

    +

+

+

For example the code snippet below makes the label display 1 decimal and + adding a '%' sign.

+

+

1
+
$windroseplot->scale->SetLabelFormat('%.1f%%');

+

+
+

Hiding the labels

+ +

Finally it is possible to completely hide the scale labels with a call to

+

+

  • +

    WindrosePlotScale::Hide($aFlg=true)

    +

+

+
+
+

Formatting the legend

+ +

All the property for the legend is access through the legend property of the + windrose plot as shown in the examples below.

+

Turning off the legend

+ +

By default the legend is shown for each plot. It can be turned off with a call + to

+

+

  • +

    LegendStyle::Hide()

    +

+

+

as the following code snippet shows.

+

+

1
+
$windroseplot->legend->Hide();

+

+
+

Adjusting the legend position

+ +

In version 1.0 of Windrose plot it is not possible to fully adjust the + position of the plot legend. However, it is possible to manually adjust the + margin between

+

+

  • +

    the Windrose plot and the legend

    +
  • +

    ... the bottom of the box around a single plot and the + legend

    +

+

+

Both these margins are adjusted with a call to

+

+

  • +

    Legend::SetMargin($aMarg,$aBottomMargin=5)

    +

+

+

For example by adding the following lines to your script

+

+

1
+
$windroseplot->legend->SetMargin(25);

+

+

By default this margin to the Windrose plot is 10 pixels and to the bottom of + the plot box it is 5 pixels. Note that the legend positioning will automatically + adjust for any increase in the font size for the compass directions to ensure + that the legend will never collide with the labels when large fonts are + used.

+
+

Adjusting the length of each legend window leg

+ +

By default the length of each legend leg is just long enough (with a little + bit to spare) to cover the range labels just on top of the legend legs. It can + never be set to smaller than that but it can be made larger with a call to

+

+

  • +

    LegendStyle::SetLength($aLength)

    +

+

+
+

Adjusting how the range is displayed

+ +

By default the range labels is displayed so that the end label of bucket + n is the same as the start label in + bucket (n+1). This behaviour can be + controlled with the method

+

+

  • +

    WindrosePlot::SetRangeStyle($aStyle)

    +

    $aStyle, is one of two symbolic constants

    +

    +

    1. +

      RANGE_OVERLAPPING, (The default)

      +
    2. +

      RANGE_DISCRETE, The range labels will be + distinct

      +

    +

    +

+

+

Figure 21.14. Different legend label styles shows the difference between + the two legend styles

+

Figure 21.14. Different legend label styles

+ +
Different legend label styles
+

+
+
+

Highlighting specific compass directions

+ +

In order to emphasize certain directions it is possible to individually adjust the + radial lines look & feel.

+

For example, assume that the direction 134º in a free plot is especially + important. In order to emphasize this we can make the radial line, solid and red + while maintaining a low profile on the other directions.

+

This is easily accomplished by the use of one or more of the three plot methods

+

+

  • +

    SetRadialColors($aColors) +

    +
  • +

    SetRadialWeights($aWeights)

    +
  • +

    SetRadialStyles($aStyles)

    +

+

+

These method all take arrays as argument. The arrays specifies what direction and + what style to use. So, for example to make the "Southwest" grid red one would add + the lines

+

+

1
+2
+3
+4
+
<?php
+colors = array('sw' => 'red');
+$windplot->SetRadialColors($colors);
+?>

+

+

As direction either the (localized) name can be used or the index/direction + depending on if it is a free or regular type of windrose type.

+

Any direction which hasn't been explicitly specified in the array will use the + default colors (As Specified by SetGridColor()) and the default weight + (as specified by SetGridWeight()).

+
+

Including a graph in a PDF

+ +

This information assumes that the PDFlib in installed and available in the PHP + setup being used. This very short paragraph is in no way a replacement for reading + the full PDFlib documentation. It is just intended to give some ideas on how this + can be done. This information is to large extent a repetition of what can be read in + Appendix C. FAQ

+

Instead of stroking the image to a file or back to the browser you can get hold of + the internal GD handle that represents the graph. This is done by specifying the + constant _IMG_HANDLER as the file name in the call to + Stroke(). This will tell the Stroke() method to return + the GD handle.

+

In order to use the GD handle together with the PDFlib the image must be loaded + into memory by a call to

+

pdf_open_memory_image($pdf, $im) +

+

The following snippet shows how you can produce and send back a PDF page to the + browser. Please note that this is just a code sketch and not final code

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
...
+$graph = new WindroseGraph(...);
+ 
+// Code to create the graph
+// .........................
+// .........................
+ 
+// Put the image in a PDF page by first getting the GD handle
+$im = $graph->Stroke(_IMG_HANDLER);
+ 
+$pdf = pdf_new();
+pdf_open_file($pdf, "");
+ 
+// Convert the GD image to something the
+// PDFlibrary knows how to handle
+$pimg = pdf_open_memory_image($pdf, $im);
+ 
+// Setup a basic PDF page
+pdf_begin_page($pdf, 595, 842);
+pdf_add_outline($pdf, "Page 1");
+pdf_place_image($pdf, $pimg, 0, 500, 1);
+pdf_close_image($pdf, $pimg);
+pdf_end_page($pdf);
+pdf_close($pdf);
+ 
+// Prepare to output the PDF page
+$buf = pdf_get_buffer($pdf);
+$len = strlen($buf);
+ 
+header("Content-type: application/pdf");
+header("Content-Length: $len");
+header("Content-Disposition: inline; filename=foo.pdf");
+ 
+echo $buf;
+ 
+pdf_delete($pdf);
+...

+

+
+

Adding a background image

+ +

In the same way as with the other types of plots in the library there is a + possibility to add a background image in the graph. However, due to limitations with + the way the extended anti-alias in windroses is implemented it is not possible to + use background images when this (default) behavior is enabled.

+

(It is technically possible to correct this limitations but the performance hit of + doing this is completely unacceptable since that would require pixel-level + manipulation directly in PHP with would be prohibitively CPU expensive).

+

To use background images the extended anti alias feature in windrose plots must be + disabled with a call to Windrosegraph::SetAntiAlias(false)

+

In order to add a background image the normal method + SetBackgroundImage() is used. The following code snippet shows how + this is done.

+

+

1
+
$graph->SetBackgroundImage('mybackground.jpg',BGIMG_FILLFRAME);

+

+

The above example puts the image covering the entire graph area.

+

Remember that you can also adjust the mixing level of the background image with a + call to SetBackgroundImageMix($aMixLevel) This determines how much of + the image is blended with the background color. An argument of 100 takes 100 percent + of the image and a value of 0 is the same as not displaying the background image at + all.

+

An example of using a background image is shown in Example 10

+

See Adding images and country flags to the background of the graph for more general information + on background images.

+

+

Tip

+

Remember that the method Graph::SetBackgroundImageMix($aMix) + can be used to adjust the alpha blending of the background image

+

+

+
+

Adjusting the interpretation for ordinal keys in data

+ +

As previously stated the position for data values in the plot, (when the ' key is + specified as an integer), is the index of the displayed axis counted + counter-clockwise from "East".

+

Another possibility which seems to be standard in some application of Windrose + plots is to start counting clockwise from the first axis after the "North" axis. + Depending on if the plots displays 16 , 8 or 3 axis this first axis (with ordinal + number 0) would then be either "NNE", "NE" or "E".

+

To adjust the interpretation the following method is used

+

+

  • +

    WindrosePlot::SetDataKeyEncoding($aEncoding) +

    +

    Possible values for the parameter are

    +

    +

    • +

      KEYENCODING_CLOCKWISE, This setting will + force the plot to interpret the key in the data as counted + clockwise. The axis with 0-index is taken to be the first + existing axis just to the right of "North" counted + clockwise.

      +
    • +

      KEYENCODING_ANTICLOCKWISE, This setting will + force the plot to interpret the key in the data as counted + counter-clockwise. The axis with the 0-index is the "East" + axis.

      +

    +

    +

+

+

By default the setting is KEYENCODING_ANTICLOCKWISE. ?? illustrates + how the same data can be interpretated in two different way depending on this + setting. The data in both figure a) and b) was given by the array

+

+

1
+2
+3
+4
+5
+6
+
$data = array(
+    0 => array(3,2,1,2,2),
+    4 => array(1,1,1.5,2),
+    6 => array(1,1,1.5,2),
+    12 => array(2,3,5,1),
+);

+

+

+

Figure 21.15. Interpretation of ordinal keys (windrose_ex9.1.php)

Interpretation of ordinal keys (windrose_ex9.1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch21s05.html b/includes/jpgraph/docs/chunkhtml/ch21s05.html new file mode 100644 index 0000000..6b40d9a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21s05.html @@ -0,0 +1,187 @@ +Adding icon and text objects to the graph

Adding icon and text objects to the graph

+ +

Windrose plots supports the ordinary way of adding icon and text objects to the graph.

+

Adding a text object

+ +

Text objects are added by first creating an instance of class Text + for each text needed and then adding the text to the graph with the usual call to + WindroseGraph::Add().

+

A basic text will only require two additional lines of code

+

+

1
+2
+3
+4
+
<?php
+$txt = new Text('Simple string',20,20);
+$graph->Add($txt); 
+?>

+

+

The following code snippet is slightly more complicated and will create a boxed + text in the upper right corner of the graph.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+// Add a boxed text
+$txt = new Text();
+$txt->SetFont(FF_ARIAL,FS_NORMAL,10);
+$txt->Set("Arbitrary text\non a\nWidrose Plot");
+$txt->SetParagraphAlign('center');
+$txt->SetPos(0.95,0.15,'right');
+$txt->SetBox('lightyellow');
+$txt->SetShadow();
+$graph->Add($txt); 
+?>

+

+

An example of adding text to a graph can for example be seen in Figure 21.23.  (windrose_ex5.php) . The snippet above adds a text at coordinates + X=20, Y=20 using the default lower left corner as the text anchor point.

+

+

Note

+

To add a newline you must remember to use double-quotes to enclose the + text otherwise the "\n" will only be interpreted literally.

+

+

+

+

Note

+

Remember that the "text align", as adjusted with SetAlign(), + specifies the anchor point for the text, i.e. what part of the text is + aligned with the specified position.

+

+

+

To add many text strings it is often useful to specify them in an array and then + have a loop creating the text object and add the text array of all the created + objects to the graph as the following short snippet shows.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+//--------------------------------------------------------------
+// Add texts to the graph
+//--------------------------------------------------------------
+$txts = array( 
+    array('Textstring one ...',$tx1,$ty1),
+    array('Textstring two ...',$tx2,$ty2),
+    array('Textstring three ...',$tx3,$ty3),
+ 
+$n=count($txts);
+$t=array();
+for($i=0; $i < $n; ++$i){
+    $t[$i] = new Text($txts[$i][0],$txts[$i][1],$txts[$i][2]);
+    $t[$i]->SetFont(FF_ARIAL,FS_NORMAL,12);
+    $t[$i]->SetColor('brown');
+    $t[$i]->SetAlign('center','top');
+}
+$graph->Add($t);
+?>

+

+
+

Adding icons to the graph

+ +

Icons are added as instances of class IconPlot to the graph (as usual + with a call to WindroseGraph::Add()). This means that to use icons the + library module "jpgraph_iconplot.php" must first be included.

+

The following example shows how to add a small "tornado" icon in the upper left + corner of the graph. For more information on formatting icons that are added to a + graph see Adding icons (and small images) to the graph

+

+

Caution

+

Since Windrose graphs doesn't have a ny concept of linear scale the + position of icons can only be specified as absolute pixels or fraction of + the width/height.

+

+

+

+

Example 21.5. Adding a "tornado" icon to the top left corner (windrose_icon_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    'wsw' => array(1,5,5,3),
+    'N' => array(2,7,5,4,2),
+    15 => array(2,7,12));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Creta an icon to be added to the graph
+$icon = new IconPlot('tornado.jpg',10,10,1.3,50);
+$icon->SetAnchor('left','top');
+$graph->Add($icon);
+ 
+// Setup title
+$graph->title->Set('Windrose icon example');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Add to graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.16. Adding a "tornado" icon to the top left corner (windrose_icon_ex1.php)

Adding a "tornado" icon to the top left corner (windrose_icon_ex1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch21s06.html b/includes/jpgraph/docs/chunkhtml/ch21s06.html new file mode 100644 index 0000000..ca5e09a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21s06.html @@ -0,0 +1,239 @@ +Using layout classes to position Windrose plots

Using layout classes to position Windrose plots

+ +

Normally we don't want to have to calculate the absolute x and y coordinates when + positioning multiple Windrose plots in graph as was done in Figure 21.7. Adding two windrose plots to the same graph (windrose_2plots_ex1.php) . A much better concept would be to just tell + the library to position three windrose plots horizontally or vertically without having + to figure out the exact coordinates our self.

+

This is where layout classes come in handy.

+

There are two types of layouts; horizontal and vertical. To specify that two windroses + should be positioned side by side (horizontal) a new horizontal layout object is created + and then the two windroses plots are added as object within the horizontal layout class. + Later on when the objects are about to be stroked on the graph the horizontal layout + class will take all its objects and spread them out evenly along a horizontal line + depending on the individual size of each windrose. The same principle applies to the + vertical layout class with the obvious change in direction.

+

The layout object are added to the graph in exactly the same was as odometers, by + calling the WindroseGraph::Add() method.

+

The following line would create a horizontal line of three windrose plots

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+$graph = WindroseGraph($width,$height);
+ 
+...
+// Create three plots
+$w1 = new WindrosePlot($data1);
+$w1->SetSize(0.25);
+$w2 = new WindrosePlot($data2);
+$w2->SetSize(0.25);
+$w3 = new WindrosePlot($data3);
+$w3->SetSize(0.25);
+ 
+// Position them even horizontally
+$hor = new LayoutHor( array($w1, $w2, $w3) );
+ 
+// add and send back to the client
+$graph->Add($hor);
+$graph->Stroke();
+?>

+

+

Since both horizontal en vertical layout can be combined it is possible to create + almost any rectangular layout. For example to create a 4x4 graph first two horizontal + layouts would be created and they would then be included in a vertical layout as the + following principle code snippet shows.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php
+$graph = WindroseGraph($width,$height);
+ 
+...
+// Create three plots
+$w1 = new WindrosePlot($data1);
+$w1->SetSize(0.24);
+$w2 = new WindrosePlot($data2);
+$w2->SetSize(0.24);
+$w3 = new WindrosePlot($data3);
+$w3->SetSize(0.24);
+$w4 = new WindrosePlot($data4);
+$w4->SetSize(0.24);
+ 
+// Create the two rows
+$hor1 = new LayoutHor( array($w1, $w2) );
+$hor2 = new LayoutHor( array($w3, $w4) );
+ 
+// positioned on top of each other
+$vert = new LayoutVert( array($hor1, $hor2) );
+ 
+// add and send back to the client
+$graph->Add($vert);
+$graph->Stroke();
+?>

+

+

An example of this is shown in Figure 21.17. Using layout classes to position 4 windrose plots (windrose_layout_ex0.php)

+

+

Figure 21.17. Using layout classes to position 4 windrose plots (windrose_layout_ex0.php)

Using layout classes to position 4 windrose plots (windrose_layout_ex0.php)


+

+

A slightly more complex example where some more formatting have been added is shown in + Figure 21.18. Using layout classes to position 5 windrose plots (windrose_layout_ex1.php) where two larger plots are in the top + row and three smaller plots are shown in the bottom row.

+

+

Example 21.6. Using layout classes to position 5 windrose plots (windrose_layout_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Some data for the five windrose plots
+$data = array(
+    array(
+        1 => array(10,10,13,7),
+        2 => array(2,8,10),
+        4 => array(1,12,22)),
+    array(
+        4 => array(12,8,2,3),
+        2 => array(5,4,4,5,2)),
+    array(
+        1 => array(12,8,2,3),
+        3 => array(5,4,4,5,2)),
+    array(
+        2 => array(12,8,2,3),
+        3 => array(5,4,4,5,2)),
+    array(
+        4 => array(12,8,2,3),
+        6 => array(5,4,4,5,2))
+);
+ 
+// Legend range colors
+$rangecolors = array('green','yellow','red','brown');
+ 
+// Create a windrose graph with titles
+$graph = new WindroseGraph(750,700);
+ 
+$graph->title->Set('Multiple plots with automatic layout');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Setup the individual windrose plots
+$wp = array();
+for( $i=0; $i < 5; ++$i ) {
+    $wp[$i] = new WindrosePlot($data[$i]);
+    $wp[$i]->SetType(WINDROSE_TYPE8);
+    if( $i < 2) {
+        $wp[$i]->SetSize(0.28);
+    }
+    else {
+        $wp[$i]->legend->Hide();
+        $wp[$i]->SetSize(0.16);
+        $wp[$i]->SetCenterSize(0.25);
+    }
+    $wp[$i]->SetRangeColors($rangecolors);
+}
+ 
+// Position with two rows. Two plots in top row and three plots in
+// bottom row.
+$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) );
+$hl2 = new LayoutHor( array( $wp[2], $wp[3], $wp[4] ) );
+$vl = new LayoutVert( array( $hl1, $hl2) );
+ 
+$graph->Add($vl);
+$graph->Stroke();
+?>


Figure 21.18. Using layout classes to position 5 windrose plots (windrose_layout_ex1.php)

Using layout classes to position 5 windrose plots (windrose_layout_ex1.php)


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch21s07.html b/includes/jpgraph/docs/chunkhtml/ch21s07.html new file mode 100644 index 0000000..38cefe9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch21s07.html @@ -0,0 +1,1293 @@ +Example section

Example section

+ +

The following section is a summary with a number of examples that illustrates the + usage of the methods described in the previous sections.

+

Example 1

+ +

Objectives:

+

+

  1. +

    Showing a complete but elementary windrose plot using mostly default + values.

    +
  2. +

    Adding and formatting a title

    +
  3. +

    Adding a legend text in order to show the units.

    +
  4. +

    Showing how to specify data using both ordinal and textual + representation of compass directions.

    +

+

+

+

Example 21.7.  (windrose_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    'wsw' => array(1,5,5,3),
+    'N' => array(2,7,5,4,2),
+    15 => array(2,7,12));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Setup title
+$graph->title->Set('Windrose basic example');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetRadialGridStyle('solid');
+$graph->Add($wp);
+ 
+// Send the graph to the browser
+$graph->Stroke();
+?>


Figure 21.19.  (windrose_ex1.php)

(windrose_ex1.php)


+

+
+

Example 2

+ +

Objectives:

+

+

  1. +

    Showing how to customize the width of the windrose legs

    +
  2. +

    Showing how to only display 8 compass axis

    +
  3. +

    Showing how to set a specific size in pixels for the plot

    +
  4. +

    Showing how to adjust the size of the center circle

    +
  5. +

    Showing how to adjust scale label font &colors

    +
  6. +

    Showing how to adjust the font for the compass directions

    +

+

+

+

Example 21.8.  (windrose_ex2.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Setup title
+$graph->title->Set('Windrose example 2');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Make it have 8 compass direction
+$wp->SetType(WINDROSE_TYPE8);
+ 
+// Setup the weight of the laegs for the different ranges
+$weights = array_fill(0,8,10);
+$wp->SetRangeWeights($weights);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11);
+$wp->scale->SetFontColor('navy');
+ 
+// Set the diametr for the plot to 160 pixels
+$wp->SetSize(200);
+ 
+// Set the size of the innermost center circle to 30% of the plot size
+$wp->SetZCircleSize(0.2);
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,12);
+$wp->SetFontColor('darkgreen');
+ 
+// Add and send back the graph to the client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.20.  (windrose_ex2.php)

(windrose_ex2.php)


+

+
+

Example 3

+ +

Objectives:

+

+

  1. +

    Showing how to add multiple plots to the same graph

    +
  2. +

    Showing how to add a subtitle and a drop shadow to the graph

    +
  3. +

    Showing how to change size and position for plots

    +
  4. +

    Showing how to add legend text

    +

+

+

+

Example 21.9.  (windrose_ex3.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data[0] = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+$data[1] = array(
+    "n" => array(1,1,2.5,4),
+    "ssw" => array(3,4,1,4),
+    "se" => array(2,7,4,4,3));
+ 
+// Store the position and size data for each plot in an
+// array to make it easier to create multiple plots.
+// The format choosen for the layout data is
+// (type,x-pos,y-pos,size, z-circle size)
+$layout = array(
+    array(WINDROSE_TYPE8,0.25,0.55,0.4,0.25),
+    array(WINDROSE_TYPE16,0.75,0.55,0.4,0.25));
+ 
+$legendtxt = array('(m/s) Station 7','(m/s) Station 12');
+ 
+// First create a new windrose graph with a dropshadow
+$graph = new WindroseGraph(600,350);
+$graph->SetShadow('darkgray');
+ 
+// Setup titles
+$graph->title->Set('Windrose example 3');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+$graph->subtitle->Set('(Multiple plots in the same graph)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_NORMAL,9);
+$graph->subtitle->SetColor('navy');
+ 
+// Create the two windrose plots.
+for( $i=0; $i < count($data); ++$i ) {
+    $wp[$i] = new WindrosePlot($data[$i]);
+ 
+    // Make it have 8 compass direction
+    $wp[$i]->SetType($layout[$i][0]);
+ 
+    // Adjust the font and font color for scale labels
+    $wp[$i]->scale->SetFont(FF_TIMES,FS_NORMAL,10);
+    $wp[$i]->scale->SetFontColor('navy');
+ 
+    // Set the position of the plot
+    $wp[$i]->SetPos($layout[$i][1],$layout[$i][2]);
+ 
+    // Set the diameter for the plot to 30% of the width of the graph pixels
+    $wp[$i]->SetSize($layout[$i][3]);
+ 
+    // Set the size of the innermost center circle to 30% of the plot size
+    $wp[$i]->SetZCircleSize($layout[$i][4]);
+ 
+    // Adjust the font and font color for compass directions
+    $wp[$i]->SetFont(FF_ARIAL,FS_NORMAL,10);
+    $wp[$i]->SetFontColor('darkgreen');
+ 
+    // Add legend text
+    $wp[$i]->legend->SetText($legendtxt[$i]);
+ 
+    $graph->Add($wp[$i]);
+}
+ 
+// Send the graph to the browser
+$graph->Stroke();
+?>


Figure 21.21.  (windrose_ex3.php)

(windrose_ex3.php)


+

+
+

Example 4

+ +

Objectives:

+

+

  1. +

    Showing how to add arbitrary paragraphs of text to a graph

    +
  2. +

    Showing how to manually set the grid distance

    +
  3. +

    Showing how to adjust the grid colors

    +
  4. +

    Showing how to customize the format for the displayed ranges

    +
  5. +

    Showing how to add arbitrary text to the center circle

    +
  6. +

    Showing how to adjust the margin for the legend

    +
  7. +

    Showing how to increase the margin to the compass directions

    +

+

+

+

Example 21.10.  (windrose_ex4.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Setup title
+$graph->title->Set('Windrose example 4');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11);
+$wp->scale->SetFontColor('navy');
+ 
+// Set the diameter and position for plot
+$wp->SetSize(190);
+ 
+// Set the size of the innermost center circle to 40% of the plot size
+// Note that we can have the automatic "Zero" sum appear in our custom text
+$wp->SetZCircleSize(0.38);
+$wp->scale->SetZeroLabel("Station 12\n(Calm %d%%)");
+ 
+// Adjust color and font for center circle text
+$wp->scale->SetZFont(FF_ARIAL,FS_NORMAL,9);
+$wp->scale->SetZFontColor('darkgreen');
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,10);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust the margin to the compass directions
+$wp->SetLabelMargin(50);
+ 
+// Adjust grid colors
+$wp->SetGridColor('silver','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+$wp->legend->SetMargin(20,5);
+ 
+// Add and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.22.  (windrose_ex4.php)

(windrose_ex4.php)


+

+
+

Example 5

+ +

Objectives:

+

+

  1. +

    Showing how to add arbitrary paragraphs of text to a graph

    +
  2. +

    Showing how to manually set the grid distance

    +
  3. +

    Showing how to add a box/frame around the individual plot

    +
  4. +

    Showing how to localize the compass directions

    +
  5. +

    Showing how to set customized colors for the ranges

    +

+

+

+

Example 21.11.  (windrose_ex5.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+// Text to be added.
+$txt=array();
+$txt[0] = "It is possible to add arbitrary,multi line, text to a graph. ";
+$txt[0] .= "Such a paragraph can have it's text be left, right or center ";
+$txt[0] .= "aligned.";
+$txt[1] = "This is an example of a right aligned paragraph.";
+$txt[2] = "Finally we can show a center aligned paragraph without box.";
+ 
+// We store the layout for each of the text boxes in an array
+// to keep the code clean
+$txtlayout = array(
+    array(0.97,0.15,25,'left','black','lightblue'),
+    array(0.97,0.4,20,'right','black','lightblue'),
+    array(0.97,0.7,20,'center','darkred',false,FF_COMIC,FS_NORMAL,12),
+);
+ 
+// Range colors to be used
+$rangeColors = array('silver','khaki','orange','brown','blue','navy','maroon','red');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(570,430);
+$graph->title->Set('Windrose example 5');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Setup graph background color
+$graph->SetColor('darkgreen@0.7');
+ 
+// Setup all the defined text boxes
+$n = count($txt);
+for( $i=0; $i < $n; ++$i ) {
+    $txtbox[$i] = new Text($txt[$i]);
+    $txtbox[$i]->SetPos($txtlayout[$i][0],$txtlayout[$i][1],'right');
+    $txtbox[$i]->SetWordwrap($txtlayout[$i][2]);
+    $txtbox[$i]->SetParagraphAlign($txtlayout[$i][3]);
+    $txtbox[$i]->SetColor($txtlayout[$i][4]);
+    $txtbox[$i]->SetBox($txtlayout[$i][5]);
+    if( count($txtlayout[$i]) > 6 )
+    $txtbox[$i]->SetFont($txtlayout[$i][6],$txtlayout[$i][7],$txtlayout[$i][8]);
+}
+$graph->Add($txtbox);
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Set background color for plot area
+$wp->SetColor('lightyellow');
+ 
+// Add a box around the plot
+$wp->SetBox();
+ 
+// Setup the colors for the ranges
+$wp->SetRangeColors($rangeColors);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+$wp->scale->SetFontColor('navy');
+ 
+// Set the diameter and position for plot
+$wp->SetSize(190);
+$wp->SetPos(0.35,0.53);
+ 
+$wp->SetZCircleSize(0.2);
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,10);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust the margin to the compass directions
+$wp->SetLabelMargin(50);
+ 
+// Adjust grid colors
+$wp->SetGridColor('silver','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+$wp->legend->SetMargin(20,5);
+ 
+// Add plot and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.23.  (windrose_ex5.php)

(windrose_ex5.php)


+

+
+

Example 6

+ +

Objectives:

+

+

  1. +

    Set range colors

    +
  2. +

    Set grid colors

    +
  3. +

    Showing how to adjust the label margin

    +
  4. +

    Showing how to change the format for displayed legend values

    +

+

+

+

Example 21.12.  (windrose_ex6.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    '10'  => array(1,1,2.5,4),
+    '32.0' => array(3,4,1,4),
+    '120.5' => array(2,3,4,4,3,2,1),
+    '223.2' => array(2,4,1,2,2),
+    '285.7' => array(2,2,1,2,4,2,1,1)
+);
+ 
+// Specify text for direction labels
+$labels = array( '120.5' => "Plant\n#1275",
+         '285.7' => "Reference\n#13 Ver:2");
+ 
+// Range colors to be used
+$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,450);
+ 
+// Setup titles
+$graph->title->Set('Windrose example 6');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+$graph->subtitle->Set('(Free type plot)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+$graph->subtitle->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Setup a free plot
+$wp->SetType(WINDROSE_TYPEFREE);
+ 
+// Setup labels
+$wp->SetLabels($labels);
+$wp->SetLabelPosition(LBLPOSITION_CENTER);
+$wp->SetLabelMargin(30);
+ 
+// Setup the colors for the ranges
+$wp->SetRangeColors($rangeColors);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+ 
+// Set the diameter and position for plot
+$wp->SetSize(230);
+$wp->SetZCircleSize(30);
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,10);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust grid colors
+$wp->SetGridColor('darkgreen@0.7','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+ 
+// Display legend values with no decimals
+$wp->legend->SetFormat('%d');
+ 
+// Add plot to graph and send back to the client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.24.  (windrose_ex6.php)

(windrose_ex6.php)


+

+
+

Example 7

+ +

Objectives:

+

+

  1. +

    Showing how to change the direction labels

    +
  2. +

    Adjust the displayed ranges

    +
  3. +

    Showing how to change the format for displayed legend values

    +
  4. +

    Showing how to manually setting the scale range and scale step size +

    +

+

+

+

Example 21.13.  (windrose_ex7.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+$data = array(
+    2 => array(1,15,7.5,2),
+    5 => array(1,1,1.5,2),
+    7 => array(1,2,10,3,2),
+    9 => array(2,3,1,3,1,2),
+    );
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,450);
+$graph->title->Set('Windrose example 7');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE16);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Localize the compass direction labels into Swedish
+// Note: The labels for data must now also match the exact
+// string for the compass directions.
+$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV',
+                          'V','VSV','SV','SSV','S','SSO','SO','OSO');
+$wp->SetCompassLabels($se_CompassLbl);
+ 
+// Localize the "Calm" text into Swedish and make the circle
+// slightly bigger than default
+$se_calmtext = 'Lugnt';
+$wp->legend->SetCircleText($se_calmtext);
+$wp->legend->SetCircleRadius(20);
+ 
+// Adjust the displayed ranges
+$ranges = array(1,3,5,8,12,19,29);
+$wp->SetRanges($ranges);
+//$wp->SetAntiAlias(true);
+ 
+// Set the scale to always have max value of 30 with a step
+// size of 12.
+$wp->scale->Set(30,12);
+ 
+// Finally add it to the graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.25.  (windrose_ex7.php)

(windrose_ex7.php)


+

+
+

Example 8

+ +

Objectives:

+

+

  1. +

    Different styles of radial grid lines for a type 8 plot

    +
  2. +

    Adding partial labels

    +

+

+

+

Example 21.14. Show how to set different styles for individual radial grid lines (windrose_ex8.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    '45.9' => array(3,2,1,2,2),
+    355 => array(1,1,1.5,2),
+    180 => array(1,1,1.5,2),
+    150 => array(1,2,1,3),
+    'S' => array(2,3,5,1),
+    );
+ 
+// Add some labels for  afew of the directions
+$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant");
+ 
+// Define the color,weight and style of some individual radial grid lines.
+$axiscolors = array(355=>"red");
+$axisweights = array(355=>8);
+$axisstyles = array(355=>'solid',150=>'solid');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,500);
+$graph->title->Set('Windrose example 8');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPEFREE);
+ 
+// Specify colors weights and style for the radial gridlines
+$wp->SetRadialColors($axiscolors);
+$wp->SetRadialWeights($axisweights);
+$wp->SetRadialStyles($axisstyles);
+ 
+// Add a few labels
+$wp->SetLabels($labels);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Finally add it to the graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.26. Show how to set different styles for individual radial grid lines (windrose_ex8.php)

Show how to set different styles for individual radial grid lines (windrose_ex8.php)


+

+
+

Example 9

+ +

Objectives:

+

+

  1. +

    Set radial grids for a type 16 plot

    +

+

+

+

Example 21.15.  (windrose_ex9.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    'E' => array(3,2,1,2,2),
+    'N' => array(1,1,1.5,2),
+    'nw' => array(1,1,1.5,2),
+    'S' => array(2,3,5,1),
+    );
+ 
+// Define the color,weight and style of some individual radial
+// grid lines. Axis can be specified either by their (localized)
+// label or by their index.
+// Note; Depending on how many axis you have in the plot the
+// index will vary between 0..n where n is the number of
+// compass directions.
+$axiscolors = array('nw'=>'brown');
+$axisweights = array('nw'=>8);  // Could also be specified as 6 => 8
+$axisstyles = array('nw'=>'solid');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,500);
+$graph->title->Set('Windrose example 9');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE16);
+ 
+// Specify colors weights and style for the radial gridlines
+$wp->SetRadialColors($axiscolors);
+$wp->SetRadialWeights($axisweights);
+$wp->SetRadialStyles($axisstyles);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Finally add it to the graph and send back to the client
+$graph->Add($wp);
+$graph->Stroke();
+?>


Figure 21.27.  (windrose_ex9.php)

(windrose_ex9.php)


+

+
+

Example 10

+ +

Objectives:

+

+

  1. +

    Showing how to add a background image which is one of the country + flags

    +

+

+

+

Example 21.16.  (windrose_bgimg_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+require_once ('jpgraph/jpgraph_flags.php');
+ 
+// Data can be specified using both ordinal idex of axis as well
+// as the direction label
+$data2 = array(
+    'vsv' => array(12,8,2,3),
+    6 => array(5,4,4,5,4),
+    );
+ 
+$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV','V','VSV','SV','SSV','S','SSO','SO','OSO');
+ 
+// Create a new small windrose graph
+$graph = new WindroseGraph(400,400);
+$graph->SetMargin(25,25,25,25);
+$graph->SetFrame();
+ 
+$graph->title->Set('Example with background flag');
+#$graph->title->SetFont(FF_VERA,FS_BOLD,14);
+ 
+ 
+//$graph->SetBackgroundImage('bkgimg.jpg',BGIMG_FILLFRAME);
+//$graph->SetBackgroundImageMix(90);
+$graph->SetBackgroundCFlag(28,BGIMG_FILLFRAME,15);
+ 
+ 
+$wp2 = new WindrosePlot($data2);
+$wp2->SetType(WINDROSE_TYPE16);
+$wp2->SetSize(0.55);
+$wp2->SetPos(0.5,0.5);
+$wp2->SetAntiAlias(false);
+ 
+$wp2->SetFont(FF_ARIAL,FS_BOLD,10);
+$wp2->SetFontColor('black');
+ 
+$wp2->SetCompassLabels($se_CompassLbl);
+$wp2->legend->SetMargin(20,5);
+ 
+$wp2->scale->SetZFont(FF_ARIAL,FS_NORMAL,8);
+$wp2->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+$wp2->scale->SetLabelFillColor('white','white');
+ 
+$wp2->SetRangeColors(array('green','yellow','red','brown'));
+ 
+$graph->Add($wp2);
+$graph->Stroke();
+?>


Figure 21.28.  (windrose_bgimg_ex1.php)

(windrose_bgimg_ex1.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22.html b/includes/jpgraph/docs/chunkhtml/ch22.html new file mode 100644 index 0000000..78112fe --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22.html @@ -0,0 +1,90 @@ +Chapter 22. Matrix graphs

Chapter 22. Matrix graphs

+ +

Introduction

+ +

Note

+

This module is only available in the pro-version of the library.

+
+

Matrix graphs are used to visualize the content of a rectangular matrix. Each entry in + the matrix is mapped to a specific color which are then displayed in a rectangular plot + corresponding to the size of the input matrix. The size of each module (corresponding to + a matrix entry) is user customizable. There are two types of possible modules; circular + and rectangular shape.

+

In order to achieve high quality rendering when circles are used the matrix module + makes use of an optional (user settable) super-sampling to achieve an anti-alias effect + to take the edge of the filled circles.

+

The color assignment to each value is controlled by the selected color map. The + library first establish the min and max value in the matrix and then equates the min + value with the "lower" end of the specified color map and the max value with the + "higher" end of the color map. All values in between is linearly interpolated to a have + a color between the "low" and "high" end in relation to the value (which are guaranteed + to be between the min and max value previously established). There are several + pre-defined color maps available as well as completely user configurable color maps.

+

The (optional) legend shows the range associated to each color in the corresponding + plot.

+

+

Tip

+

The library supports mesh interpolation. Mesh interpolation which by itself + doesn't produce any new data but can help produce smoother plots by creating + "false" interpolated values in between the original entries in the matrix. This + is similar to the Matlab (tm) command interp2 +

+

+

+

The overall structure and capabilities of matrix graphs follows that of other graphs + in the library, e.g. Windrose plots, in that a graph can have multiple plots, title, + footers, texts, icons, image backgrounds etc. Figure 22.1. A medium complex example to shows some capabilities of matrix plots (matrix_introex.php) shows a medium complex example of two matrix + plots in a matrix graphs which uses both a background image, icon (the logo in the top + left corner), timing of the graph and free positioned text. We have also used a small + degree of alpha blending in the plots just to let the background "shine" through a + little bit. The two plots shows the same data but uses different color maps.

+

+

Figure 22.1. A medium complex example to shows some capabilities of matrix plots (matrix_introex.php)

A medium complex example to shows some capabilities of matrix plots (matrix_introex.php)


+

+

The library offers an extensive range of formatting for the appearance of the plot + when it comes to adjusting exactly how the colors are used. There are several built in + color maps as well as the possibility to specify manual color maps and adjusting the + contrast (scale range) of the plot.

+

Features of the matrix plots

+ +

+

  • +

    Both manual and automatic scale range setting

    +
  • +

    Customizable legend position and layout

    +
  • +

    Row and column legends (edge labels)

    +
  • +

    Several built in color maps (22)

    +
  • +

    Option for manual specified color maps

    +
  • +

    Adjustable color contrast

    +
  • +

    Layout classes to position multiple plots in the sam graph

    +
  • +

    Both circular and rectangular module type

    +
  • +

    Mesh interpolation of input data

    +
  • +

    Flexible sizing of matrix plots both manual, automatic and a mix of + them

    +
  • +

    Alpha blending support for matrix plot

    +
  • +

    All the usual graph support for background images, text objects and + icons

    +

+

+
+
+ + + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s02.html b/includes/jpgraph/docs/chunkhtml/ch22s02.html new file mode 100644 index 0000000..c724a8c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s02.html @@ -0,0 +1,118 @@ +Creating and formatting a basic matrix graph

Creating and formatting a basic matrix graph

+ +

In order to create a matrix plot the extension module + "jpgraph_matrix.php" must be included in the script along with + the core module "jpgraph.php".

+

The creation of Matrix graphs otherwise follows the traditional steps in the library + of first creating a matrix graph which acts as a canvas for one or several matrix plots. + The principle steps are:

  1. +

    Create a basic matrix graph as an instance of class + MatrixGraph (in all our example we use the variable + $graph to hold this instance)

    +
  2. +

    Create an instance of one or several matrix plots as instances of + class MatrixPlot, make any necessary modifications to the + color map and appearance and then add the plots to the matrix graph + canvas.

    +
  3. +

    Send back the graph to the client with a call to + MatrixGraph::Stroke(). As usual this can be used to either + send back the graph to the client (e.g.browser) or write the graph to a file + by specifying a filename as the first argument to + MatrixGraph::Stroke().

    +
+

The example in Figure 22.2. A basic matrix graph with all default values (matrix_ex0.php) shows a matrix plot using just the default values for + all parameters.

+

+

Example 22.1. A basic matrix graph with all default values (matrix_ex0.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php
+require_once('jpgraph/jpgraph.php');
+require_once('jpgraph/jpgraph_matrix.php');
+ 
+// Some (random) matrix
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Setup a bsic matrix graph and title
+$graph = new MatrixGraph(400,300);
+$graph->title->Set('Basic matrix example');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Create a ,atrix plot using all default values
+$mp = new MatrixPlot($data);
+$graph->Add($mp);
+ 
+$graph->Stroke();
+ 
+?>


Figure 22.2. A basic matrix graph with all default values (matrix_ex0.php)

A basic matrix graph with all default values (matrix_ex0.php)


+

+

In the same way as for other graph types one or several Matrix plots can be added and + positioned freely in the Matrix graph by specifying the position as either absolute + coordinates or as fractions of the width/height of the overall graph.

+

+

Tip

+

An easier way to position Matrix plots is to use layout classes as described + in Using layout classes to position matrix plots

+

+

+

+

Tip

+

If the data for the matrix is available in a file a convenient way to get hold + of the dat in the file is to use the utility class ReadFileData to + get hold of the data using the method

+

+

  • +

    ReadFileData::FromMatrix($aFile,$aSeparator=' ') +

    +

+

+

which read the matrix from a file. Each row of the matrix must be a separate + line and each cell is separated with the character specified as the second + argument. By default a space is used as separator. All values read back are + converted to floating point numbers (double precision). The following short + example shows how easy this is to use

+

+

1
+
$data = ReadFileData::FromMatrix('matrixdata.txt');

+

+

+

+

We will not further discuss all the standard graph formatting options such as the + ability to add title(s), footers etc. since this is covered in numerous other places in + this manual.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s03.html b/includes/jpgraph/docs/chunkhtml/ch22s03.html new file mode 100644 index 0000000..3e34e49 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s03.html @@ -0,0 +1,59 @@ +Mesh interpolating of input data

Mesh interpolating of input data

+ +

By using mesh interpolation it is possible to obtain a "smoother" looking matrix plot + by creating a "in-between" values in the original matrix by linear interpolation.

+

+

Tip

+

This is also used in contour plots. See Understanding mesh interpolation for a more thorough discussion on + mesh interpolation and the implication of CPU usage.

+

+

+

The interpolation factor specifies how many times, recursively, the interpolation + should be done. Practical value ranges from 2-6. While it is possible to specify larger + values than 6 the time it takes to do the interpolation will grow exponentially in the + interpolation factor. It is also important to remember that this interpolation dos not + create any "more" information than what is already available in the matrix. In addition + it needs to be verified that such a linear interpolation of data is at all valid for the + underlying data in the matrix.

+

As an example the following figures show the effect of doing a 1-5 times interpolation + of the original data (same as interpolation = 1). With the chosen graph size it is no + point of interpolating further since doing 5 times interpolating will force the module + to be 1x1 pixel in order to fit within the constraints of the graph. (The original data + was 8x11 and interpolating it 5 times creates a 113x161 matrix)

+
+
 
+
+

The different sizes of the plot is due to the fact that each cell in the matrix must + have an integer number of pixels. In the graphs above we have used the largest module + size while still fitting in the image. Hence the different appearances.

+

There are two ways of doing this interpolation.

+

+

  1. +

    When the matrix plot is created by specifying the interpolation factor as + the second argument to the plot constructor, i.e.

    +

    +

    1
    +
    $matrixplot = new MatrixPlot($data,4); // 4 times interpolation

    +

    +
  2. +

    If many plots share the same data it is more efficient to do it once in + the beginning instead of doing the interpolation each time a new matrix plot + object is created. This can be done by using the utility function

    +

    +

    • +

      doMeshInterpolate(&$aData, $aFactor)

      +

    +

    +

    As can be seen from the declaration this is a call by reference method + where the data is replaced by the new data that has been interpolated the + specified number of times. This avoids unnecessary data copying for large + matrices.

    +

+

+

+

Note

+

Those familiar with Matlab (tm) will recognize a similar mesh interpolation in + the interp2() function.

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s04.html b/includes/jpgraph/docs/chunkhtml/ch22s04.html new file mode 100644 index 0000000..9686d91 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s04.html @@ -0,0 +1,449 @@ +Formatting the matrix plot

Formatting the matrix plot

+ +

Color maps

+ +

The color map is a property of the matrix plot and all aspects of the color map is + accessed through the "MatrixPlot::colormap" property which is an + instance of class MatrixColormap.

+

To adjust how the color map is used the following methods are available

+

+

  • +

    ColorMap::SetMap($aMap, $aInvert=false)

    +

    This is a polymorphic method that can take either a symbolic constant + as argument and in that case specifies one of the built in color maps or + it can be an array of colors which in that case specifies a manual color + map. There are several built in color maps of different types which are + referenced by an integer in range [0, 19]. A list of the built in color + maps can be found in Built in color maps

    +

    For example the specification

    +

    +

    1
    +
    $mp->colormap->SetMap(0);

    +

    +

    will make the library use the heat color map which is standard color + map that goes from black for the min value up through red, orange, + yellow and finally white for the highest value. This could be though of + as the color of a heated iron rod (the hottest iron is white + glowing).

    +

    The following manual specification uses three color plateau that the + map touches.

    +

    +

    1
    +2
    +
    $map = array( 'navy', 'gray', 'red' );
    +$mp->colormap->Set($map);

    +

    +

    would create a color map that would use 'navy' color for + the min value and 'red' for the max value and linearly + interpolate all other values for a color range continuously moving from + 'navy'-'gray'-'red'. The + color interpolation made between these values is a linear interpolation + of the corresponding RGB values which creates the illusion of a + continuous color change. The array must have at least two colors. There + is no limit on the maximum number of base colors specified. However + using more than ~7-10 colors to specify the color map is probably not to + be recommended.

    +

    If $aInvert is set to true then the color + map will be reversed so that the lowest color in the map will be the + highest and vice versa.

    +
  • +

    ColorMap::GetCurrMap()

    +

    Return the current set color map

    +
  • +

    ClorMap::SetRange($aMin,$aMax)

    +

    This is used to manually specify the min and max values to be used for + mapping matrix values to a color. Any values in the matrix that is lower + than $aMin will be set to the min color and any values + above $aMax will be set to the maximum color.

    +

    The matrix values in between will be mapped to the entire color scale. + Another way of looking at this is that this will compress the dynamic + range used or the colors. If the min and max values specified are much + higher and lower than the actual content of the matrix the result is + that most of the colors in the matrix will have "middle" colors (and + hence lower the contrast). By default the values are (0,0) which means + that the library will automatically determine the min/max value based on + the input data and use the entire range of colors specified in the color + map.

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +
    <?php
    +// This will lower the contrast by roughly 50 percent 
    +$mindataval = ... ; // The minimum data value
    +$maxdataval = ... ; // The maximum data value
    +$contrast = -0.5;  // Reduce the contrast by 50%
    +$adj = ($maxdataval-$mindataval+1)*$contrast/2;
    +$matrixplot->colormap->SetRange($mindataval+$adj, $maxdataval-$adj);
    +?>

    +

    +

    In a similar way the following code will instead increase the + "contrast" 50% by letting a large part of the data values become mapped + to the min and max color values.

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +
    <?php
    +// This will increase the contrast by roughly 50 percent 
    +$mindataval = ... ; // The minimum data value
    +$maxdataval = ... ; // The maximum data value
    +$contrast = 0.5;  // Increase the contrast by 50%
    +$adj = ($maxdataval-$mindataval+1)*$contrast/2;
    +$matrixplot->colormap->SetRange($mindataval+$adj, $maxdataval-$adj);
    +?>

    +

    +

    The three plots in Figure 22.3. The effects of changing the value range for the colormap shows the effect of + increasing and decreasing the contrast with this method.

    +

    Figure 22.3. The effects of changing the value range for the colormap

    + +
    The effects of changing the value range for the colormap
    +

    +

    Tip

    +

    When using the auto ranging (the default) the contrast can be + adjusted with a call to

    +

    +

    • +

      MatrixPlot::SetAutoContrast($aContrast) +

      +

    +

    +

    as in

    +

    +

    1
    +
    $matrixplot->SetAutoContrast(-0.3);

    +

    +
    +
  • +

    ColorMap::SetNumColors($aNum)

    +

    This is used to specify the number of discrete color steps used in the + map. By default the scale range is divided in approximately 64 color + buckets that all matrix entries are mapped into. Depending on the actual + color map the specified value might be adjusted up or down up to +/- + (p-1). Where p=number of base colors. Valid ranges are + 3-128 but is also dependent on the actual color map.

    +

    The reasons for these restriction and the adjustments are

    +

    +

    • +

      The minimum number of colors are the number of base colors + in the current color map

      +
    • +

      The number of colors must satisfy the equation

      +

      n = p + k*(p-1), k = 0, 1, 2, + ... (eq. 1)

      +

      where

      +

      +

      • +

        n = number of + colors

        +
      • +

        p = number of base colors + that specifies the map

        +

      +

      +

      The specified number of colors will be adjusted to the + closest number that satisfies (eq. 1).

      +

    +

    +
  • +

    ColorMap::SetNullColor($aColor)

    +

    If specified this determines what color will be used for any values in + the matrix that are null

    +

+

+
+

Changing the module type (rectangle vs. circle)

+ +

By default the module type (the shape that represents one cell in the matrix) is a + rectangle. As was mentioned in the introduction this can also be a circle. This is + controlled by the method

+

+

  • +

    MatrixPlot::SetModuleType($aType)

    +

    $aType, 0 = Use rectangle, 1 = Use a circle

    +

+

+

When using circular module type it might also be useful to specify a separate + background color for the plot since there will be some space between the circles + where the background can be seen. The plot background is specified with the + method

+

+

  • +

    MatrixPlot::SetBackgroundColor($aColor)

    +

+

+

An example of using circular modules can be seen in Figure 22.4. Using a circular module type (matrix_ex05.php)

+

+

Figure 22.4. Using a circular module type (matrix_ex05.php)

Using a circular module type (matrix_ex05.php)


+

+
+

Adjusting the alpha blending of the plots

+ +

By default the plots are filled with solid colors from the chosen color map. By + specifying an alpha value it is possible to let the background shine through the + matrix plot. The alpha blending is chosen by the method

+

+

  • +

    MatrixPlot::SetAlpha($aAlpha)

    +

    $aAlpha , 0=No transparency, 1=Full transparency (not so + useful since then only the background can be seen)

    +

+

+

+

+
+

Figure 22.5. Matrix alpha blending=0.2 (matrix_ex04.1.php)

Matrix alpha blending=0.2 (matrix_ex04.1.php)

+
+

Figure 22.6. Matrix alpha blending=0.7 (matrix_ex04.2.php)

Matrix alpha blending=0.7 (matrix_ex04.2.php)

+
+

+

+

+

Note

+

As can be seen in the figures only the plot area is adjusted. The legend + is always shown with no transparency.

+

+

+
+

Specifying the size

+ +

There are three and disjunct way to specify the size of the matrix plot. However + the size can not be set to any pixel value. Since the matrix plot is a visualization + of a matrix the width and height must always be an even multiple of the number of + rows and columns since each cell in the matrix have an integer number of pixels as + width and height (the module size). This will sometimes force the library to adjust + a specified size so that it is an even multiple of the number of rows and columns in + the input data matrix.

+

For example; if the matrix has 50 columns this means that the width will only grow + and shrink by multiples of 50 pixels since each cell has an equal number of pixels. + The minimum width for such a matrix is 50 pixels.

+

There are three ways to specify the size:

+

+

  1. +

    by setting the width and height explicitly (in number of pixels).

    +

    Note that the actual rendered size might be different depending on the + input matrix size since each cell must have an integer number of pixels + and not all sizes will be even dividable with the input data matrix + size.

    +
  2. +

    by setting the width and height as fractions of the overall width and + height of the graph

    +

    Note that the actual rendered size might be different depending on the + size of the input data matrix.

    +
  3. +

    by specifying the width and height of each rendered cell (a.k.a the + module size)

    +

    This specifies the size (in pixels) of each module. The minimum size + is 1x1 pixels.

    +

+

+

The size is adjusted by the following two methods

+

+

  • +

    MatrixPlot::SetSize($aW,$aH)

    +

    MatrixPlot::SetSize($aW)

    +

    If the two arguments are numbers in range [0.0, 1.0] it will be + interpreted as specifying the size as fractions of the overall graph + width and height. If the number are > 1 they will be interpreted as the + absolute size (in pixels). It is perfectly possible to mix teh two ways. + For example the following is a valid size specification

    +

    +

    1
    +
    $matrixplot->SetSize(250,0.6); // 250px wide and height will be ~60% of the graph height

    +

    +

    If only one argument is specified it will set both the width and + height to the specified size. If the single size is specified as a + fraction the smallest of the graph width/height will be used as the + base.

    +
  • +

    MatrixPlot::SetModuleSize($aW,$aH)

    +

    The two argument specifies the module size, i.e. the size of each cell + in the plot (in pixels).

    +

+

Note

+

The size does not effect the legend that belongs to a matrix plot.

+

+

+
+

Specifying the position of the plot on the graph

+ +

The position of the plot by is by default centered vertically and slightly move to + the left of the vertical center in order to compensate for the default legend that + is shown n the right of the plot. The position of the plot is specified by the + method

+

+

  • +

    MatrixPlot::SetCenterPos($aX,$aY)

    +

    Specifies the center of the plot to be the given x and y-coordinates. + The position can be specified in either absolute pixels or as fractions + of the width and height (or as a combination).

    +

+

Tip

+

In order to position multiple plots on the same graph it is easier to user + the layout classes (as described in Using layout classes to position matrix plots)

+

+

+
+

Adjusting the legend

+ +

The legend belongs to the matrix plot and not the graph. All legend are instances + of class MatrixLegend and is accessed through the property

+

+

  • +

    MatrixPlot::legend

    +

+

+

By default the legend is enabled and positioned to the right of the plot. Both the + size and position of the legend can be manually adjusted.

+

There are four possible positions of the legend as shown in Figure 22.7. Matrix legend positions, on each of the four sides of the plot. + The labels of the legend will be automatically adjusted to face aways from the + plot.

+

Figure 22.7. Matrix legend positions

+ +
Matrix legend positions
+

+

To position the legend the following MatrixPlot method is used

+

+

  • +

    MatrixPlot::SetLegendLayout($aPos)

    +

    The position of the legend is specified as an integer in range [0-3] + where 0 is the right side of the plot and the remaining posiotins follow + clockwise from the right, (i.e. 1 is the bottom, 2 is the left and 3 is + the top side).

    +

+

+

The following methods can be used to fine tune and adjust the legend

+

+

  • +

    MatrixLegend::Show($aFlg=true)

    +

    Used to enable/disable the legend. The following code line would hide + the legend

    +

    +

    1
    +
    $matrixplot->legend->Show(false);

    +

    +
  • +

    MatrixLegend::SetModuleSize($aBucketWidth,$aBucketHeight=5)

    +

    This specifies the size of each color bucket in the legend.

    +
  • +

    MatrixLegend::SetSize($aWidth,$aHeight=5)

    +

    This is an alternative way to specify the size of the legend compare + with the individual bucket specification. With this method the overall + width and height of the legend bar can be adjusted. The size can be + specified s either absolute pixels or as fraction of the width height of + the entire graph.

    +
  • +

    MatrixLegend::SetMargin($aMargin)

    +

    Specifies the margin (in pixels) between the matrix plot and the + legend.

    +
  • +

    MatrixLegend::SetLabelMargin($aMargin)

    +

    Specifies the margin between the min/max label and the legend + bar

    +
  • +

    MatrixLegend::SetFont($aFamily,$aStyle,$aSize)

    +

    Specifies the font for the label on the legend

    +
  • +

    MatrixLegend::SetFormatString($aStr)

    +

    Specifies the format string (in printf() format) to be + used when rendering the legend label

    +

+

+
+

Adding row and column legends

+ +

+

Note

+

This feature is only available in v3.0.4p and above.

+

+

+

When using matrix plots to display micro arrays it is often desirable to have + legends for each row and column. Figure 22.8. Adding row and column legends to a matrix plot (matrix_edgeex01.php) shows an example of this which helps + understand this concept.

+

+

Figure 22.8. Adding row and column legends to a matrix plot (matrix_edgeex01.php)

Adding row and column legends to a matrix plot (matrix_edgeex01.php)


+

+

In the library this is modelled by the class EdgeLabel which is + instantiated in the matrix plot as

+

+

  • +

    MatrixPlot::collabel

    +

    Instance for horizontal labels

    +
  • +

    MatrixPlot::rowlabel

    +

    Instance for vertical labels

    +

+

+

To adjust the appearance of the labels the following methods can be used:

+

+

  • +

    EdgeLabel::SetFont($aFF,$aFS,$aSize)

    +

    Specify the font to be used. Keep in mind that the font size should + not be larger than the module size chosen to be able to fit within the + row/column it specifies. For the default module size a font size of 8-9 + for a TTF font is usually fine. By default the labels are set in + FF_ARIAL, 8 pt size.

    +
  • +

    EdgeLabel::SetFontColor($aColor)

    +

    Specifies the font color.

    +
  • +

    EdgeLabel::SetMargin($aMargin)

    +

    Set the margin from the edge of the matrix in pixels.

    +
  • +

    EdgeLabel::SetSide($aSide)

    +

    Specifies on what side the labels should be drawn. For horizontal (x) + labels the possible sides are "left" or + "right" and for vertical (y) the possible sides are + "top" and "bottom".

    +
  • +

    EdgeLabel::Set($aLabels)

    +

    Specifies the 1-dimensional array that holds the labels to be + used.

    +
  • +

    EdgeLabel::SetAngle($aAngle)

    +

    Specify the angle to draw the label at. By default row labels are + drawn at 0 degree and column labels are drawn at 90 degrees + angle.

    +

+

+

The simplest use of labels is to use the default values for all parameters and + just set the labels, i.e.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+$data = array( ... ) ;
+$collabels = array( ... ) ;
+$rowlabels = array( ... ) ;
+ 
+$mp = new MatrixPlot($data);
+ 
+$mp->collabel->Set($collabels);
+$mp->rowlabel->Set($rowlabels);
+?>

+

+

Below is a final example of adding row and column labels to a matrix graph

+

+

1
+
#=matrix_edgeex02|Adding row and column legends to a matrix plot##

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s05.html b/includes/jpgraph/docs/chunkhtml/ch22s05.html new file mode 100644 index 0000000..f3508cf --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s05.html @@ -0,0 +1,294 @@ +Adding icon and text objects to the graph

Adding icon and text objects to the graph

+ +

Matrix plots supports the ordinary way of adding icon and text objects to the graph.

+

Adding a text object

+ +

Text objects are added by first creating an instance of class Text + for each text needed and then adding the text to the graph with the usual call to + MatrixGraph::Add().

+

A basic text will only require two additional lines of code

+

+

1
+2
+3
+4
+
<?php
+$txt = new Text('Simple string',20,20);
+$graph->Add($txt); 
+?>

+

+

The following code snippet is slightly more complicated and will create a boxed + text in the upper right corner of the graph.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+// Add a boxed text
+$txt = new Text();
+$txt->SetFont(FF_ARIAL,FS_NORMAL,10);
+$txt->Set("Arbitrary text\non a\nMatrix Plot");
+$txt->SetParagraphAlign('center');
+$txt->SetPos(0.95,0.15,'right');
+$txt->SetBox('lightyellow');
+$txt->SetShadow();
+$graph->Add($txt); 
+?>

+

+

The snippet above adds a text at coordinates X=20, Y=20 using the default lower + left corner as the text anchor point.

+

+

Note

+

To add a newline you must remember to use double-quotes to enclose the + text otherwise the "\n" will only be interpreted literally.

+

+

+

+

Note

+

Remember that the "text align", as adjusted with SetAlign(), + specifies the anchor point for the text, i.e. what part of the text is + aligned with the specified position.

+

+

+

To add many text strings it is often useful to specify them in an array and then + have a loop creating the text object and add the text array of all the created + objects to the graph as the following short snippet shows.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+//--------------------------------------------------------------
+// Add texts to the graph
+//--------------------------------------------------------------
+$txts = array( 
+    array('Textstring one ...',$tx1,$ty1),
+    array('Textstring two ...',$tx2,$ty2),
+    array('Textstring three ...',$tx3,$ty3),
+ 
+$n=count($txts);
+$t=array();
+for($i=0; $i < $n; ++$i){
+    $t[$i] = new Text($txts[$i][0],$txts[$i][1],$txts[$i][2]);
+    $t[$i]->SetFont(FF_ARIAL,FS_NORMAL,12);
+    $t[$i]->SetColor('brown');
+    $t[$i]->SetAlign('center','top');
+}
+$graph->Add($t);
+?>

+

+
+

Adding icons to the graph

+ +

Icons are added as instances of class IconPlot to the graph (as usual + with a call to MatrixGraph::Add()). This means that to use icons the + library module "jpgraph_iconplot.php" must first be included.

+

The following example shows how to add a small icon in the lower right corner of + the graph. For more information on formatting icons that are added to a graph see Adding icons (and small images) to the graph

+

+

Caution

+

Since Matrix graphs doesn't have a ny concept of linear scale the position + of icons can only be specified as absolute pixels or as fractions of the + width/height.

+

+

+

+

Example 22.2. Adding an icon to the lower right corner (matrix_ex03.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Do the meshinterpolation once for the data
+doMeshInterpolate($data,3);
+$r=count($data);$c=count($data[0]);
+ 
+$width=400; $height=400;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Adding an icon to the background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$mp = new MatrixPlot($data,1);
+$mp->SetSize(0.6);
+ 
+$icon = new IconPlot('icon.jpg',$width-1,$height-1,0.8,50);
+$icon->SetAnchor('right','bottom');
+$graph->Add($icon);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>


Figure 22.9. Adding an icon to the lower right corner (matrix_ex03.php)

Adding an icon to the lower right corner (matrix_ex03.php)


+

+

We also recall that it is possible to use country flags as icons by making use of + the method

+

+

  • +

    IconPlot::SetCountryFlag($aFlag,$aX=0,$aY=0,$aScale=1.0,$aMix=100,$aStdSize=3)

    +

+

+
+

Adding background images

+ +

In just the same way as for all other plots it is possible to add a background + images, background gradients and a background flag to the graph. Since this has been + discussed several time previously in the manual we only show a simple example + here.

+

+

Note

+

Since Matrix graphs does not have the concept of plot area the background + image positioning alternative BGIMG_FILLPLOT is the same as + BGIMG_FILLFRAME as we have used in this example + below.

+

+

+

+

Example 22.3. Adding a background image to the matrix graph (matrix_ex04.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Do the meshinterpolation once for the data
+doMeshInterpolate($data,4);
+$r=count($data);$c=count($data[0]);
+ 
+$width=400; $height=400;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Adding a background image');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Add a stretched background image
+$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME);
+$graph->SetBackgroundImageMix(50);
+ 
+$mp = new MatrixPlot($data,1);
+$mp->SetSize(0.6);
+$mp->SetCenterPos(0.5,0.5);
+$mp->SetLegendLayout(1);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>


Figure 22.10. Adding a background image to the matrix graph (matrix_ex04.php)

Adding a background image to the matrix graph (matrix_ex04.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s06.html b/includes/jpgraph/docs/chunkhtml/ch22s06.html new file mode 100644 index 0000000..7eb45bd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s06.html @@ -0,0 +1,48 @@ +Adding marker lines to the matrix plot

Adding marker lines to the matrix plot

+ +

+

Note

+

This feature was added in 3.1.1p

+

+

+

In order to mark important divisions in the plot it is possible to add an instance of + class PlotLine (either horizontal or vertical line) to each plot in the + graph. For example, to add one vertical and one horizontal plot line the following lines + can be added to the matrix script

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
<?php
+$mp = new MatrixPlot($data);
+ 
+// Create two lines to add as markers
+$l1 = new PlotLine(VERTICAL, 5, 'lightgray:1.5', 4);
+$l2 = new PlotLine(HORIZONTAL, 3, 'lightgray:1.5', 4);
+ 
+// Add lines to the plot
+$mp->AddLine($l1);
+$mp->AddLine($l2);
+// this could also be done as
+// $mp->AddLine(array($l1,$l2));
+ 
+...
+?>

+

+

The example in Figure 22.11. Adding plot lines to the matrix plot (matrix_ex06.php) shows an example of this

+

+

Figure 22.11. Adding plot lines to the matrix plot (matrix_ex06.php)

Adding plot lines to the matrix plot (matrix_ex06.php)


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s07.html b/includes/jpgraph/docs/chunkhtml/ch22s07.html new file mode 100644 index 0000000..4066634 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s07.html @@ -0,0 +1,153 @@ +Using layout classes to position matrix plots

Using layout classes to position matrix plots

+ +

Normally we don't want to have to calculate the absolute x and y coordinates when + positioning multiple Matrix plots in graph. A much better concept would be to just tell + the library to position three matrix plots horizontally or vertically without having to + figure out the exact coordinates our self but just evenly distribute them in the + specified direction.

+

This is where layout classes come in handy.

+

There are two types of layouts; horizontal and vertical. To specify that two matrix + plots should be positioned side by side (horizontal) a new horizontal layout object is + created and then the two matrix plots are added as object within the horizontal layout + class. Later on when the objects are about to be stroked on the graph the horizontal + layout class will take all its objects and spread them out evenly along a horizontal + line depending on the individual size of each matrix plot (including the specified + margin). The same principle applies to the vertical layout class with the obvious change + in direction.

+

The layout object are added to the graph in exactly the same way as ordinary matrix + plots, by calling the MatrixGraph::Add() method.

+

The following line would create a horizontal line of three matrix plots

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php
+$graph = new MatrixGraph($width,$height);
+ 
+// additional graph formatting
+ 
+$mp1 = new MatrixPlot($mat1);
+$mp2 = new MatrixPlot($mat1);
+$mp3 = new MatrixPlot($mat1);
+ 
+$hor = new LayoutHor( array( $mp1, $mp2, $mp3) );
+ 
+$graph->Add($hor);
+$graph->Stroke();
+?>

+

+

A complete example of this can be seen in Figure 22.12. Using layout classes with Matrix plots (matrix_layout_ex1.php)

+

+

Example 22.4. Using layout classes with Matrix plots (matrix_layout_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+ 
+$data = array(
+array(0,1,2,3,4,5,6,7,8,9,10),
+array(10,9,8,7,6,5,4,3,2,1,0),
+array(0,1,2,3,4,5,6,7,8,9,10),
+array(10,9,8,17,6,5,4,3,2,1,0),
+array(0,1,2,3,4,4,9,7,8,9,10),
+array(8,1,2,3,4,8,3,7,8,9,10),
+array(10,3,5,7,6,5,4,3,12,1,0),
+array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+doMeshInterpolate($data,4);
+ 
+$graph = new MatrixGraph(850,580);
+$graph->title->Set('Matrix layout example');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$mp = array();
+$n = 5;
+for($i=0; $i < $n; ++$i){
+    $mp[$i] = new MatrixPlot($data);
+    $mp[$i]->colormap->SetMap($i);
+    if( $i < 2 )
+        $mp[$i]->SetSize(0.35);
+    else
+        $mp[$i]->SetSize(0.21);    
+    // We need to make the legend a bit smaller since by 
+    // defalt has a  ~45% height 
+    $mp[$i]->legend->SetModuleSize(15,2);
+}
+ 
+$hor1 = new LayoutHor(array($mp[0],$mp[1]));
+$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4]));
+$vert = new LayoutVert(array($hor1,$hor2));
+$vert->SetCenterPos(0.45,0.5);
+ 
+$graph->Add($vert);
+$graph->Stroke();
+ 
+?>


Figure 22.12. Using layout classes with Matrix plots (matrix_layout_ex1.php)

Using layout classes with Matrix plots (matrix_layout_ex1.php)


+

+

When using layout classes there is one parameter of the matrix plot that can be + adjusted and that is the margin around each matrix plot. This margin is controlled by a + call to

+

+

  • +

    + MatrixPlot::SetMargin($aMargin) +

    +

+

+

By default the margin is 20 pixels on each side. This margin also takes the legend + into consideration so the margin is counted from the edge of the legend.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s08.html b/includes/jpgraph/docs/chunkhtml/ch22s08.html new file mode 100644 index 0000000..3e23a02 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s08.html @@ -0,0 +1,50 @@ +Built in color maps

Built in color maps

+ +

There are three types of built in color maps

+

+

  1. +

    Standard maps

    +

    Includes rainbow spectrum and heat maps and combination of plain + red-green-blue maps

    +
  2. +

    Normalized center

    +

    These maps have a white:ish center. This is mostly useful to visualize the + spread from a center value

    +
  3. +

    Continues

    +

    The maps have one base color where the hue changes

    +

+

+

In the color maps in the following section the black bars under some colors in the + color map shows the discrete colors (the plateaus) that the color map is made up of. All + colors in between two "barred" colors are linear interpolations.

+

The script that was used to generate these color maps can be found under the example + directory as "colormaps.php".

+

Standard maps

+ +

To show heat gradient map 0 is the standard color map. To highlight the min and + max values (to get a high contrast) map 3 is a good choice. Map two is a standard + "rainbow" spectrum from red all up to violet.

+

Figure 22.13. Standard color maps

+ +
Standard color maps
+

+
+

Normalized center

+ +

These maps have a neutral (white) center and feathers out to the min/max value at + each end.

+

Figure 22.14. Centered color map

+ +
Centered color map
+

+
+

Continues map

+ +

These maps changes continues from the min color to the max color.

+

Figure 22.15. Continues color map

+ +
Continues color map
+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s09.html b/includes/jpgraph/docs/chunkhtml/ch22s09.html new file mode 100644 index 0000000..6736eec --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s09.html @@ -0,0 +1,187 @@ +Using CSIM with matrix plots

Using CSIM with matrix plots

+ +

+

Note

+

This feature was added in v3.1.1p

+

+

+

In the same was as most other plot types matrix plots also supports the usage of + Client Side Image Maps. (See Chapter 10. Using CSIM (Client side image maps) for a full description on the usage of CSIM in + general the library.)

+

The possible hotspot areas in a matrix graph are:

+

+

  • +

    The title

    +

    This is set (as usual with a call to) + MatrixGraph::title::SetCSIM()

    +
  • +

    Each cell in the matrix itself.

    +

    This is set with a call to MatrixPlot::SetCSIM() The input is + specified with a matrix of the same size as the input data. An error message + will be given if the sizes differ.

    +
  • +

    Each row and column label text. The input must be an array of the same + length as the number of labels.

    +

    This is specified with either (or both)

    +

    MatrixGraph::rowlabel::SetCSIM()

    +

    MatrixGraph::collabel::SetCSIM()

    +

+

+

The following example shows how to add both label and data CSIM. As usual the graph + must be stroked with a call to MatrixGraph::StrokeCSIM() when using CSIM + functionality.

+

+

Example 22.5. Matrix example with CSIM (matrix_csimex01.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
<?php // content="text/plain; charset=utf-8"
+require_once('jpgraph/jpgraph.php');
+require_once('jpgraph/jpgraph_matrix.php');
+ 
+ 
+$data = array(
+    array(0,null,2,3,4,5,6,7,8,9,10,8,6,4,2),
+    array(10,9,8,7,6,5,4,3,2,1,0,8,5,9,2),
+    array(0,1,2,3,4,5,6,7,8,9,10,2,4,5,7),
+    array(10,9,8,17,6,5,4,3,2,1,0,8,6,4,2),
+    array(0,1,2,3,4,4,9,7,8,9,10,3,2,7,2),
+    array(8,1,2,3,4,8,3,7,8,9,10,5,3,9,1),
+    array(10,3,5,7,6,5,4,3,12,1,0,6,5,10,2),
+    array(10,9,8,7,6,5,4,3,2,1,NULL,8,6,4,2),
+);
+ 
+$nx = count($data[0]);
+$ny = count($data);
+ 
+for( $i=0; $i < $ny; ++$i ) {
+    for( $j=0; $j < $nx; ++$j ) {
+        $csimtargets[$i][$j] = '#'.sprintf('%02sd',$i)."-".sprintf('%02sd',$j);
+    }
+}
+ 
+ 
+for($i=0; $i < $nx; ++$i ) {
+    $collabels[$i] = sprintf('column label: %02d',$i);
+    $collabeltargets[$i] = '#'.sprintf('collabel: %02d',$i);
+ 
+}
+for($i=0; $i < $ny; ++$i ) {
+    $rowlabels[$i] = sprintf('row label: %02d',$i);
+    $rowlabeltargets[$i] = '#'.sprintf('rowlabel: %02d',$i);
+}
+ 
+// Setup a nasic matrix graph
+$graph = new MatrixGraph(400,350);
+ 
+$graph->SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3');
+$graph->title->Set('CSIM with matrix');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
+$graph->title->SetColor('white');
+ 
+// Create one matrix plot
+$mp = new MatrixPlot($data,1);
+$mp->SetModuleSize(13,15);
+$mp->SetCenterPos(0.35,0.6);
+$mp->colormap->SetNullColor('gray');
+ 
+// Setup column lablels
+$mp->collabel->Set($collabels);
+$mp->collabel->SetSide('top');
+$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->collabel->SetFontColor('lightgray');
+ 
+// Setup row lablels
+$mp->rowlabel->Set($rowlabels);
+$mp->rowlabel->SetSide('right');
+$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->rowlabel->SetFontColor('lightgray');
+ 
+$mp->rowlabel->SetCSIMTargets($rowlabeltargets);
+$mp->collabel->SetCSIMTargets($collabeltargets);
+ 
+// Move the legend more to the right
+$mp->legend->SetMargin(90);
+$mp->legend->SetColor('white');
+$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10);
+ 
+$mp->SetCSIMTargets($csimtargets);
+ 
+$graph->Add($mp);
+$graph->StrokeCSIM();
+ 
+?>


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch22s10.html b/includes/jpgraph/docs/chunkhtml/ch22s10.html new file mode 100644 index 0000000..994bf9a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch22s10.html @@ -0,0 +1,19 @@ +Matrix graph examples

Matrix graph examples

+ +

Example 1

+ +

+
+

Example 2

+ +

+
+

Example 3

+ +

+
+

Example 4

+ +

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch23.html b/includes/jpgraph/docs/chunkhtml/ch23.html new file mode 100644 index 0000000..0e64f78 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch23.html @@ -0,0 +1,313 @@ +Chapter 23. Filled contour graphs

Chapter 23. Filled contour graphs

+ +

Filled Contour graphs

+ +

+

Note

+

This section describes additional functionality available in the pro-version + v3.1p and above.

+

+

+

The use of filled ContourPlots requires the inclusion of the module + "jpgraph_contourf.php". The filled version of contour graphs + supports the following additional features compared to the regular contour graphs

+
  • +

    Filled contour plots

    +
  • +

    Labelling of isobar lines in the contour plots

    +
  • +

    Two user selectable adaptive algorithms to determine the contours, one + rectangular and one triangular based adaptive mesh algorithm.

    +

The enhanced contour plot is contained in the new plot class + FilledContourPlot.

+

As a quick introduction the two examples below shows two contour graphs which makes + use of these additional features

+

+ + + + + + + +
+

Figure 23.1. Filled contour with labels (contour2_ex1.php)

Filled contour with labels (contour2_ex1.php)

+
+

Figure 23.2. Filled contour with no isobar lines (contour2_ex2.php)

Filled contour with no isobar lines (contour2_ex2.php)

+
+

+

All basic formatting, such as specifying colors and number/location of the isobar + lines are handled in exactly the same way as described in the previous section for basic + contours.

+

Creating a filled contour graph

+ +

The filled contour graph follows the exact same principles as for the non filled + graph described above. The core difference is that a filled graph is created as an + instance of class FilledContourPlot, i.e.

+

+

1
+2
+3
+
<?php
+$filledContour = new FilledContourPlot($data);
+?>

+

+
+

Enabling and disabling contour lines

+ +

Contour lines are controlled with the method

+

+

  • +

    FilledContourPlot::ShowLines($aFlg,$aColorWithFilled='black')

    +

    The $aFlg is a boolean that determines if contour lines + should be shown or not. by default they are enabled. The second argument + $aColorWithFilled determines what color the contour + lines should have when the contour is filled. If the contour is not + filled then the contour lines will have the color of the isobar.

    +

+

+
+

Specifying a filled contour

+ +

In order to have the contour filled the method

+
  • +

    ContourPlot::SetFilled($aFlg) Determines if the contour + should be filled or not.

    +
+

should be called.

+

Since there are n isobar lines and there needs to be n+1 colors to fill the graph there is a choice of what + side should the color for isobar line n fill. The area above or the area below the isobar. In + this library we use the convention that the color for isobar line n is used to fill the area up to the next highest + isobar n+1.

+

If the colors are specified manually it is important that one more color than the + number of isobar lines are specified. The convention is such that the color + specified in the first position (position = 0 ) in the color array is used to fill + the area below the lowest specified isobar.

+

An example will make this clear.

+

The graph below only uses three isobar lines (to keep things simple) which means + that we need four colors. To create such a graph we use the lines

+
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php
+$data = array( ... );
+ 
+$isobar_colors = array('lightgray','teal:1.3','orange','red');
+ 
+// Create a new contour graph with three isobar lines
+$cp = new ContourPlot($data,3);
+ 
+// Specify the colors manually
+$cp->SetIsobarColors($isobar_colors);
+ 
+?>
+

+

Figure 23.3. Manual colors for contour (contour2_ex3.php)

Manual colors for contour (contour2_ex3.php)


+

+

as can be seen from the labels in the graph the algorithm has resulted in three + isobar lines (as specified) at values 6.2, 10.5 and 14.8. The first color "gray" is used to fill the area + below the smallest isobar (6.2).

+

It should be noted that by specifying SetFilled(false) a non filled + contour graph can be created. However, the visual appearance compared with the + class ContourPlot will be slightly different. The reason is that + the filled contour plot class uses an adaptive algorithm that gives better fidelity + than the simpler non adaptive algorithm used in the standard (non-filled) contour + plot class. The contour corresponds to creating a contour with the plain contour + plot algorithm (class ContourPlot) using an interpolation factor of ~3-4.

+
+

Adjusting the labels in the contour

+ +

In order to make it easier to follow the contour labels can be added inside the + contour. The labels are placed using a heuristic algorithm that tries to place + enough labels to make the plot easy to read but not as many labels as to make it + crowded.

+

There are two main characteristic of the labels that can be controlled.

+
  • +

    The font and color of the labels which are controlled by the two methods + FilledContourPlot::SetFont() and + FilledContourPlot::SetFontColor()

    +
  • +

    Whether or not the label should follow the gradient of the isobar line at + the point where the label is displayed or if it should always be drawn + horizontally.

    +
+

To enable or disable the display of the labels as well as determining if the label + should follow the gradient or not the method

+

+

  • +

    FilledContourPlot::ShowLabel($aFlg,$aFollowGradient)

    +

+

+

is used. The two examples below show two variants of the same contour where the + left graph have labels which follows the gradient and the right graph have labels + that are always oriented horizontally.

+

+ + + + + + + +
+

Figure 23.4. Labels that follows the gradients (contour2_ex4.php)

Labels that follows the gradients (contour2_ex4.php)

+
+

Figure 23.5. Labels that are always horizontal. In this example we have also shown how to change the colors. (contour2_ex5.php)

Labels that are always horizontal. In this example we have also shown how to change the colors. (contour2_ex5.php)

+
+

+
+

Selecting the adaptive method to use

+ +

+

Note

+

This section can be skipped without loss of continuity. The default method + "rectangular" recursive adaptation is good enough for most + circumstances.

+

+

+

In order to fully understand the effect of selecting which adaptive method to use + it is first necessary to understand some background on how contours are created + algorithmically.

+

Determining general contours for a function of two independent variables is + equivalent to the problem of finding the equivalence class of all coordinate pairs (x,y) for which for C=f(x,y) which in general is a non-linear problem. This + is an example of a problem that is computational very expensive to mathematically + solve correct but quite tractable if we view a sampled version of the function. This + means that we in general do not have access to f(x,y) instead we only know of its values at a number + of grid points. This is also the cause of visually different contour plots for the + same input data.

+

The difference lay in the core problem that in order to draw a continues contour + we need to interpolate the unknown values in between the known sample points. This + is therefore a degree of freedom where the actual choice of how we do the + interpolation will cause the contour to be visually different depending on our + choice.

+

While it would take to far in this manual to describe the full adaptive algorithm + in all details we will show the different principles that underlying the two methods + hat the user can select between.

+

In order to determine the isobars the given data points are considered to be + vertices in a grid where each vertice is connected with an edge. There are two basic + ways to connect the points with edges; rectangular and triangular. In the first way + four points are connected to form a square and in the second way three point are + connected to form a triangle. The so created square or triangles will be referred to + as a submesh consisting of four and three sides respectively.

+

To determine the isobars each submesh is recursively divided until each side is + small enough to only have one crossing isobar. The exact position of the crossing is + determined by linear interpolation between the two corresponding vertices.

+

The figures below shows the sequences for the triangle recursive division. The + recursion continues until each edge has exactly one crossing of an isobar.

+

+

+
+

Figure 23.6. Triangulation step 0

+ +
Triangulation step 0
+

+
+

Figure 23.7. Triangulation step 1

+ +
Triangulation step 1
+

+
+

Figure 23.8. Triangulation step 2

+ +
Triangulation step 2
+

+
+

+

+

In the same way the sequence of figures below shows the principle for the + quadratic recursive subdivsion of the mesh for first three steps.

+

+

+
+

Figure 23.9. "Rectangularization" step 0

+ +
"Rectangularization" step 0
+

+
+

Figure 23.10. "Rectangularization" step 1

+ +
"Rectangularization" step 1
+

+
+

Figure 23.11. "Rectangularization" step 2

+ +
"Rectangularization" step 2
+

+
+

+

+

Needless to say these two variants give slightly different visual appearance of + the resulting contour plot and neither of the two method can be considered "the + right method". Triangularization tends to work better (and faster) for high + frequency contour plots and gives a more "edgy" result. The quadratic subdivision + might require more recursive steps for high frequency contours but in general gives + a smoother look of the resulting contour.

+

By default the library uses a rectangular mesh division and that is the method + that has been used in all the previous examples. As an illustration the effect of + the method have the two figures below shows the same data as we have used in the + previous figures to display a contour plot with 7 isobars. The left figures uses a + rectangular division (the default) and the right figure uses a triangular + division.

+

+

+
+

Figure 23.12. 7 Isobars, "rect" method (contour2_ex6.php)

7 Isobars, "rect" method (contour2_ex6.php)

+
+

Figure 23.13. 7 Isobars, "tri" method (contour2_ex7.php)

7 Isobars, "tri" method (contour2_ex7.php)

+
+

+

+

As can be seen in this case the triangular method favour elongated contours from + southwest to northeast while the rectangular method favours circular contours.

+

The way to choose what method to use is by the method

+

+

  • +

    FilledContourPlot::SetMethod($aMethod) +

    +

    The possible options for $aMethod are

    1. +

      "rect" - Rectangualr algortihm (default)

      +
    2. +

      "tri" - Triangular algorithm

      +
    +

+

+

+

Tip

+

It is possible to show the triangulation used by calling the method + FilledContourPlot::ShowTriangulation($aFlg). In the two + figures below the triangulation for the "rect" and "tri" method in the + previous examples are shown.

+

+ + + + + + + +
+

Figure 23.14. Rectangular sub-division

+ +
Rectangular sub-division
+

+
+

Figure 23.15. Triangular sub-division

+ +
Triangular sub-division
+

+
+

+

+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24.html b/includes/jpgraph/docs/chunkhtml/ch24.html new file mode 100644 index 0000000..e34d517 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24.html @@ -0,0 +1,81 @@ +Chapter 24. Linear Barcodes (One Dimensional Barcodes)

Chapter 24. Linear Barcodes (One Dimensional Barcodes)

+ +

Introduction

+ +

Note

This module is only available in the pro-version of the library.

+

With the linear (One-dimensional) barcode extension it is possible to create bar + codes using all the commonly accepted symbologies. The resulting bar code can be + created as either an image (in PNG or JPEG format) or as a Postscript file ready for + printing on high resolution printers.

+

The bar code extension provides extensive data verification which makes sure that + the created barcode follows the official applicable standards.

+

+

Note

+

All generated bar codes (except CODE 11 which have little support in + Europe) have been extensively verified using Metrologic CCD-47 handhold + scanner.

+

+

+

In order to create a linear barcode the module + "jpgraph_barcode.php" must be included.

+

There are several types of linear barcode even though they all use the same + principle. The reason for several different types (or symbologies as it is known) is + partly to handle different requirements (for example encoding just numerical data or + both numerical and alphabetical data) and partly because they were initially created + by different companies to solve similar problems. The library supports most of the + common linear barcode. These types of barcode look like what can be usually seen on + consumer goods.

+

The different types of barcodes are often referred to as different + symbologies.

+

Most of the commonly used symbologies has been elevated to ISO/IEC standards. Some + barcode which have not yet been accepted as ISO standard are available from AIM + (http://www.aimglobal.org). In + USA the organization responsible for issuing retail codes used in barcodes are the + Uniform Code Council, (UCC) http://www.uc-council.org.

+

While these standards are very comprehensive they are of little interest to end + user of the barcode. For an end user the three most important question when + selecting a barcode symbology are

+
  1. +

    What characters can be encoded in this symbology?

    +
  2. +

    How efficient is the symbology, i.e. how large will the barcode be for + a given input data string?

    +

    Linear barcodes typically encode alphanumerical strings up to maximum + of ~20 characters.

    +

    +

    Note

    +

    While many of the barcode symbologies can handle, in theory + unlimited, string lengths there are practical limitation to how + wide barcode a given reader/scanner can interpret. Most handhold + scanners can usually not reliable read a barcode wider than + ~10cm.

    +

    +

    +
  3. +

    How strong is the tolerance against physical damage, i.e. how large + percentage of the barcode can be destroyed while still be readable by a + scanner?

    +

    The tolerance for linear barcode are in general low. If one ore more + of the bars (making up the barcode) is unreadable the whole barcode is + in practice unreadable. While some barcode symbologies include a check + digit this is not enough to re-create damaged data. It is only enough to + verify with some confidence that the data is intact, however there is + still no guarantee since two errors might, by coincidence, make the + check digit correct.

    +

    A common way to strengthen linear barcodes is to make them physically + larger/taller.

    +

While linear barcodes is still widely used in legacy applications + there are almost no new applications that uses linear barcode due in part to the + limitations listed above (poor fault tolerance and low capacity). Most new + applications uses either RFID tags or two dimensional barcodes (described in the + following chapters) which have much higher data capacity and fault tolerance.

+
+ + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s02.html b/includes/jpgraph/docs/chunkhtml/ch24s02.html new file mode 100644 index 0000000..1d722e7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s02.html @@ -0,0 +1,33 @@ +How does linear barcodes work?

How does linear barcodes work?

+ +

Linear barcodes are created by translating the supported characters that should be + displayed into combination of narrow and wide bars which are combined into a + barcode. To identify the start and end of a barcode special "guard" patterns are + used to indicate to the scanner that the barcode starts and also identify what type + of symbology is used.

+

To illustrate this Figure 24.1. Understanding linear barcodes. Example with Code 25 symbology shows an enlarged + and amended barcode thats uses the Code 25 symbology and encodes the numeric string + "123". In order to illustrate the different parts we have colored the start and stop + pattern and the three digits to make it clear how it is encoded.

+

+

Figure 24.1. Understanding linear barcodes. Example with Code 25 symbology

+ +
Understanding linear barcodes. Example with Code 25 symbology
+


+

+

We have chosen to illustrate the principle with the code 25 symbology since it is + easy to understand. Each character is encoded with 5 black elements with spaces in + between, 2 wide and three narrow elements, hence the name 2 of 5 (or 25). The width + of the thinnest element is also known as the module width. Other symbologies have + more complicated patterns to achieve higher density (more encoded characters in a + given width) but the principle still stands.

+

The typical scanner sends out light which is reflected and is them measured as the + scanner swipes from left to right. The relative size of the black and white areas + are measured and translated back to a the encoded data.

+

The human readable string, usually at the bottom of the barcode is strictly + speaking not a part of the barcode. It is only there to help a human reader + interpret the barcode.

+

Some barcode symbologies also add a check digit at the end of the data. This check + digit (or digits) is used to verify that the interpretated data has been read + correctly.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s03.html b/includes/jpgraph/docs/chunkhtml/ch24s03.html new file mode 100644 index 0000000..6b30b92 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s03.html @@ -0,0 +1,69 @@ +Barcode symbologies

Barcode symbologies

+ +

Numerical only barcode symbologies

+ +

The following supported symbologies only supports numerical data and in some + cases special characters like "-,+,:,$" . A more detailed description and + example of each barcode is given in Short description of supported symbologies

+

+

  • +

    Codabar. Older code not widely used today apart from some library + system primarily in USA.

    +
  • +

    Code 11. Used primarily for labeling telecommunications + equipment

    +
  • +

    EAN-13 (ISO/IEC 15420). European Article Numbering, 13-digits. + International retail product code

    +

    (Also known as UPC-13 in USA)

    +
  • +

    EAN-8. European Article Numbering, 8-digits. Compressed version of + EAN code for use on small products

    +
  • +

    Industrial 2 of 5. Older low density code not commonly used + today

    +
  • +

    Interleaved 2 of 5 (ISO/IEC 16390). Compact numeric code, widely + used in industry, driving licenses, transportation

    +
  • +

    UPC-A. Universal product code seen on almost all retail products + in the USA and Canada

    +
  • +

    UPC-E. Compressed version of UPC-A code for use on small + products

    +
  • +

    Bookland. Used to encode ISBN (International Standard Book Number) + numbers used in book and magazines

    +

+

+
+

Alphanumerical barcode symbologies

+ +

The following supported symbologies supports alpha numerical data and in some + cases special characters like "-,+,&,#,!". A more detailed description and + example of each barcode is given in Short description of supported symbologies

+

+

  • +

    Code 128 (ISO/IEC 15417). A flexible high capacity code in wide + use. There are variants of Code 128 (e.g EAN-128) that impose a + strict structure of the data.

    +
  • +

    EAN 128 (ISO/IEC 15420). Structured variant of Code 128. This is + not really a barcode symbology in itself but rather a structure for + how to format the input data to Code 128.

    +
  • +

    Code 39 (ISO/IEC 16388). General purpose code. Used + worldwide.

    +

+

+
+

Which symbology should be used?

+ +

Usually the application dictates what standard should be followed and there is + no choice other than following the applicable industry standard.

+

However, if the usage is strictly internal it is possible to chose any + symbology. However for generic usage we would recommends using either Code 39 or + Code 128 since they offer great flexibility, supports large character sets and + is fairly efficient in terms of space/datasize ratio.

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s04.html b/includes/jpgraph/docs/chunkhtml/ch24s04.html new file mode 100644 index 0000000..d96ca10 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s04.html @@ -0,0 +1,116 @@ +Features

Features

+ +

This is a summary of the features available in the JpGraph barcode extension.

+

+

  • +

    Supports the following symbologies (with data validation)

    +

    +

    1. +

      UPC A

      +
    2. +

      UPC E

      +
    3. +

      EAN 128

      +
    4. +

      EAN 13

      +
    5. +

      EAN 8

      +
    6. +

      CODE 11 (USD-8)

      +
    7. +

      CODE 39

      +
    8. +

      CODE 128

      +
    9. +

      Industrial 2 of 5

      +
    10. +

      Interleaved 2 of 5

      +
    11. +

      Codabar

      +
    12. +

      Bookland (ISBN)

      +

    +

    +
  • +

    Input data is verified against the official specification of each + symbologies and makes it impossible to create invalid bar codes.

    +
  • +

    Output format

    +

    +

    1. +

      Image format (either PNG or JPG encoding)

      +
    2. +

      Postscript

      +
    3. +

      Encapsulated postscript

      +

    +

    +
  • +

    Formatting options

    +

    +

    1. +

      User specified module width. This controls the width of + the smallest unity in the barcode.

      +
    2. +

      Automatic calculation of optional checksum for symbologies + where the checksum is optional

      +
    3. +

      User specified scaling of resulting bar code

      +
    4. +

      Horizontal or vertical bar code layout

      +
    5. +

      Suppression of human readable text on barcodes

      +
    6. +

      Selectable font for human readable text

      +

    +

    +

+

+

+

Note

+

The term "symbology" is the term used to describe the combination of + encodation method (how characters are translated to bars) and the layout of + the bars specified by a particular barcode standard. All of the listed + standard symbologies above are still widely used. Many of the symbologies + overlap in terms of functionality and multiple symbologies might be possible + to use for a particular application unless there is a strict standard that + stipulates that a particular symbology should be used.

+

The reason for the existence of so many symbologies with overlapping + functionality is in some cases the result of different companies early on + specifying there own patented barcodes in order to gain market shares or in + some cases lock customers to a specific brand of scanner. In other cases it + is simply the result of that earlier barcodes could not handle new + demands.

+

+

+

Sample application

+ +

Even though primarily the JpGraph bar code extension is meant, and designed, + to be used as a library within a larger system there is a small demo web + application to allow easy creation of linear barcodes bar codes. This + application is primarily included as a demo of the features available and not as + a finalized product.

+

The application is available under the directory + "barcode/demoapp" as "index.html" + in the main library directory

+

Figure 24.2. Linear Barcode Demo application (screen shot from running in + WEB-browser) shows a screen shot of the + demo application

+

+

Figure 24.2. Linear Barcode Demo application (screen shot from running in + WEB-browser)

+ +
Linear Barcode Demo application (screen shot from running in WEB-browser)
+


+

+

We strongly suggest running this demo application to get a feel for what + formatting options and how the different symbologies behave.

+

+

Tip

+

There is also a command line utility that allows the creation of + barcodes from the command line + "mkbarcode.php"

+

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s05.html b/includes/jpgraph/docs/chunkhtml/ch24s05.html new file mode 100644 index 0000000..55d730a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s05.html @@ -0,0 +1,101 @@ +Creating barcodes - quick start

Creating barcodes - quick start

+ +

The creation of all linear barcode follows the same chema:

+

+

  1. +

    Create an instance of the encoder for the chosen symbology

    +
  2. +

    Create an instance of the backend for the chosen output format (image + or postscript)

    +
  3. +

    Encode the data and generate the barcode

    +

+

+

Normally only three lines of code is needed to create a basic barcode.

+

For example, the following code will create a barcode encoded as an image + representing the data string "ABC123" using symbology "CODE 39".

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+require_once('jpgraph_barcode.php');
+ 
+$symbology = BarcodeFactory::Create (ENCODING_CODE39 );
+$barcode = BackendFactory ::Create(BACKEND_IMAGE, $symbology);
+$barcode ->Stroke('ABC123');
+?>

+

+

The generated barcode is shown in

+

+

Figure 24.3. Encoding "ABC123" with CODE 39.

+ +
Encoding "ABC123" with CODE 39.
+


+

+

As can be seen from the code above the basic interface to the library makes use of + two abstract factories which creates the appropriate encoder and output backend. + This design makes the addition of new output formats and new symbologies transparent + for the end user of the library.

+

If instead we wanted to encode the data string using symbology "CODE 128" instead, + it would only be necessary to modify the first line in the above code so instead it + would become.

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+require_once('jpgraph_barcode.php');
+ 
+$symbology = BarcodeFactory::Create (ENCODING_CODE128 );
+$barcode = BackendFactory ::Create(BACKEND_IMAGE, $symbology);
+$barcode ->Stroke('ABC123');
+?>

+

+

the result of this script is shown in Figure 24.4. Encoding "ABC123" with CODE 128.

+

+

Figure 24.4. Encoding "ABC123" with CODE 128.

+ +
Encoding "ABC123" with CODE 128.
+


+

+

As can be seen in the examples above both the backend and the symbology is + specified by means of a symbolic constant. The following list shows the symbolic + constants available to specify the different supported symbologies.

+

+

  1. +

    ENCODING_EAN128

    +
  2. +

    ENCODING_EAN13

    +
  3. +

    ENCODING_EAN8

    +
  4. +

    ENCODING_UPCA

    +
  5. +

    ENCODING_UPCE

    +
  6. +

    ENCODING_CODE39

    +
  7. +

    ENCODING_CODE128

    +
  8. +

    ENCODING_CODE25

    +
  9. +

    ENCODING_CODEI25

    +
  10. +

    ENCODING_CODABAR

    +
  11. +

    ENCODING_CODE11

    +
  12. +

    ENCODING_BOOKLAND

    +

+

+

The usage and typical application of each symbology is discussed in Short description of supported symbologies.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s06.html b/includes/jpgraph/docs/chunkhtml/ch24s06.html new file mode 100644 index 0000000..6d0a284 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s06.html @@ -0,0 +1,80 @@ +Error handling

Error handling

+ +

The barcode module uses the standard library error handling which mean that in + case of an error (most likely that the data validation fails) an exception will be + raised. Errors can be handled in two ways.

+

+

  1. +

    By enclosing the script in a try { ... } catch { ... } + statement

    +
  2. +

    By installing a custom default error handler with + set_exception_handler() when the library throws an + error the specified error handler will be called with an instance of the + JpGraphException class.

    +

+

+

The following code snippet shows an example of using a try-catch statment

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+try {
+    $encoder = BarcodeFactory::Create(ENCODING_CODE39);
+    $e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $e->Stroke('abc123');
+} catch( JpGraphException $e ) {
+        echo 'Error: ' . $e->getMessage()."\n";
+}
+?>

+

+

The code when run will give the error

+

+

Error: Data validation failed. Can't encode [abc123] using encoding "CODE 39" 

+

+

The problem with the input data string is that Code 39 does not support encoding + lower case letters. In the case some error handling is still needed but the image + error should be displayed it is possible to re-raise the original exception as the + following example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+try {
+    $encoder = BarcodeFactory::Create(ENCODING_CODE39);
+    $e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $e->Stroke('abc123');
+} catch( JpGraphException $e ) {
+    JpGraphError::Raise($e->getMessage());
+}
+?>

+

+

The line

+

+

1
+
JpGraphError::Raise($e->getMessage());

+

+

will display the image error as shown in Figure 24.5. Image error - Failed barcode data validation

+

+

Figure 24.5. Image error - Failed barcode data validation

+ +
Image error - Failed barcode data validation
+


+

+

In the command line barcode utility ( Generating barcodes on the command line) the alternative method of installing a different default error handler can be + seen.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s07.html b/includes/jpgraph/docs/chunkhtml/ch24s07.html new file mode 100644 index 0000000..d3ca5ba --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s07.html @@ -0,0 +1,53 @@ +Generating barcodes on the command line

Generating barcodes on the command line

+ +

The library includes a command line utility as an additional example on how to use + the library.

+

+

  • +

    mkbarcode.php

    +

+

+

This utility can be found in the "barcode/" directory. This + utility should be used from the command line as the following example shows

+

+

$>php mkbarcode.php -b code39 ABC123 > barcode.png

+

+

The line above will create a barcode from the data string "abc123" using the Code + 39 symbology and store the resulting image in the file + "barcode.png".

+

Using the command utility as above assumes that the client version of PHP is + available at the command line.

+

This utility has the following syntax

+

+

mkbarcode.php -b <symbology> [-r -h -c -o <output format> -m <width> -s <scale>\\ 
+-y <height> -f <filename> ] datastring
+
+Create the specified barcode
+-b           What symbology to use, one of the following strings (case insensitive)
+             UPCA
+             UPCE
+             EAN128
+             EAN13
+             EAN8
+             CODE11
+             CODE39
+             CODE128
+             CODE25
+             CODEI25
+             CODABAR
+             BOOKLAND
+-c           Add checkdigit for symbologies where this is optional
+-o           Output format. 0=Image, 1=PS, 2=EPS
+-m           Module width
+-s           Scale factor
+-h           Show this help
+-f           Filename to write to
+-r           Rotate barcode 90 degrees
+-y height    Set height in pixels
+-x           Hide the human readable text
+--silent     Silent. Don't give any error mesages
+

+

+

If no filename is given the image will be sent back to the console which means it + should be redirected to a file.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s08.html b/includes/jpgraph/docs/chunkhtml/ch24s08.html new file mode 100644 index 0000000..af4a330 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s08.html @@ -0,0 +1,268 @@ +Format options for barcodes

Format options for barcodes

+ +

Adjusting the encodation process

+ +

For the encoding there is basically only one modification available.

+

For those symbologies that include an optional checksum it is possible to + enable or disable this calculation.

+

The following symbologies may have optional checksum character(s)

+

+

  1. +

    Industrial 2 of 5

    +
  2. +

    Interleaved 2 of 5

    +
  3. +

    Code 39

    +
  4. +

    Code 39 Extended

    +
  5. +

    Code 11

    +

+

+

Turning on/off checksum calculation for other symbologies will have no affect. + Checksum calculation is enabled with a call to AddChecksum() on the + chosen backend.

+

For example to augment the previous "CODE 39" example to include the checksum + the code would be changed to

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$symbology = BarcodeFactory::Create (ENCODING_CODE39 );
+$symbology->AddChecksum();
+$barcode = BackendFactory ::Create('IMAGE', $symbology);
+$barcode->Stroke('ABC123');
+?>

+

+

Which would give the result shown in Figure 24.6. Encoding "ABC123" with CODE 39 adding checksum (checksum=4).

+

+

Figure 24.6. Encoding "ABC123" with CODE 39 adding checksum (checksum=4).

+ +
Encoding "ABC123" with CODE 39 adding checksum (checksum=4).
+


+

+
+

Selecting output format

+ +

The output format can be adjusted by specifying/creating the appropriate + backend. The library supports image and postscript (and encapsulated postscript) + backends.

+

The backend is created by calling the static factory method

+

+

  • +

    BackendFactory::Create($aBackend,$aEncoder,$aReport=false)

    +

+

+

So to create an image backend the following code is needed

+

+

1
+
$barcode = BackendFactory::Create (BACKEND_IMAGE ,$symbology);

+

+

Where "$symbology" is the chosen symbology as created by the + BarcodeFactory::Create() factory method. Please note that both + factory functions are called as static methods.

+

The output format is specified by using one of the following symbolic + defines

+

+

  1. +

    BACKEND_IMAGE, Creates a standard JPEG or PNG + (default) image

    +
  2. +

    BACKEND_PS, Creates a standard postscript file as + output. It is possible to modify this output to become EPS + (Encapsulated postscript) by calling the SetEPS() + method on the backend as the following code snippet shows

    +

    +

    1
    +2
    +
    $barcode = BackendFactory::Create (BACKEND_PS,$symbology);
    +$barcode->SetEPS()

    +

    +

    Please note that for the postscript backend the postscript code is + returned as a string from the Stroke() method.

    +

+

+

To send the created stream (either image or postscript) back to the browser or + to a file the Backend::Stroke() method shall be used. The parameter + to the Stroke() method shall be the string to be encoded.

+

Assume we want to create an image that is sent back to the browser. We would + then use the following code

+

+

1
+2
+3
+4
+5
+
<?php
+$symbology = BarcodeFactory::Create (ENCODING_CODE128 );
+$barcode = BackendFactory ::Create(BACKEND_IMAGE, $symbology);
+$barcode->Stroke('ABC123');
+?>

+

+

It is also possible to write the barcode directly to a file by specifying a + second argument to the Stroke() method above. So if we instead + wanted the barcode to be stored in the file + "/tmp/barcode.png" we could write

+

+

1
+2
+3
+
$symbology = BarcodeFactory::Create (ENCODING_CODE128 );
+$barcode = BackendFactory ::Create(BACKEND_IMAGE, $symbology);
+$barcode->Stroke('ABC123','/tmp/barcode.png');

+

+

+

Note

+

There is no automatic added extension to the file name.

+

+

+

Again, please note that for the Postscript background the + Backend::Stroke() method normally returns the postscript file + as a string if everything went well.

+
+

Writing barcodes to a file

+ +

This is done by adding a second argument, the file name, to the + Backend::Stroke() method. This works for all backends. The file + name should be an absolute path name. Since it is the PHP process that writes + the file the permissions must allow the PHP process to write to the directory if + PHP is called from a browser. If the command line version of PHP is used this + does of course not apply.

+
+

Hiding the human readable text

+ +

+

  • +

    Backend::HideText($aHide=true)

    +

+

+

The human readable text is the string that can optionally be displayed at the + bottom of the bar. By default this is enabled.

+
+

Adjusting the module width

+ +

+

  • +

    Backend::SetModuleWidth($aWidth)

    +

+

+

There are however some subtle facts regarding the module width and backend + that needs to be explained.

+

+

  1. +

    For image type backends the module width specifies the number of + pixels used for a module.

    +
  2. +

    For Postscript (and Encapsulated PS) backends the module width + specifies the width in points (i.e. 1/72 inch).

    +

+

+

This also means that for image type backends only integer values makes + sense.

+

+

Caution

+

Depending on the quality of the printer (and paper) very small module + width might not be readable with all bar code readers. For images it is + therefore recommended to use "2" pixels as the minimum module width and + for postscript output the minimum recommended width is "0.8" pt.

+

+

+

The following code shows how to both change the module width to 2 pixels and + hide the human readable text

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+$symbology = BarcodeFactory::Create (ENCODING_CODE39 );
+$barcode = BackendFactory ::Create('IMAGE', $symbology);
+$barcode ->SetModuleWidth (2);
+$barcode ->HideText();
+$barcode ->Stroke('ABC123');
+?>

+

+

which would give the result shown in Figure 24.7. Encoding "ABC123" with CODE 39, hiding the text. + below

+

+

Figure 24.7. Encoding "ABC123" with CODE 39, hiding the text.

+ +
Encoding "ABC123" with CODE 39, hiding the text.
+


+

+
+

Setting vertical or horizontal layout

+ +

+

  • +

    Backend::SetVertical($aVertical=true)

    +

+

+

Will rotate the barcode 90 degrees to create a vertical view of the + barcode.

+
+

Adjusting height of bar code

+ +

+

  • +

    + Backend::SetHeight($aHeight)

    +

+

+

The height of the bar codes is specified with the + Backend::SetHeight() method. For images the height is + interpreted as pixels and for postscript files it is interpreted as points (1 pt + = 1/72 inch)

+
+

Scaling of bar codes

+ +

+

  • +

    Backend::SetScale($aScaleFactor)

    +

+

+

The scale factor is real number and specifies a scale factor for the overall + barcode image.

+
+

Add frame around bar code

+ +

+

  • +

    Backend::ShowFrame($aFlag=true)

    +

+

+

This method will enable a frame around the edges of the barcode image

+
+

Examples of adjusting the output

+ +

The following example outputs a postscript file representing the bar code with + a module width of 1.2 pt, using a vertical layout and scaling the image 2 times. + For this example we are using CODE 39 with a checksum (which is automatically + generated)

+

+

1
+2
+3
+4
+5
+6
+7
+8
+
<?php
+$symbology = BarcodeFactory::Create (ENCODING_CODE128 );
+$barcode = BackendFactory ::Create(BACKEND_PS, $symbology);
+$barcode->SetVertical(true);
+$barcode->Scale(2);
+$barcode->SetModuleWidth(1.2);
+$barcode ->Stroke('ABC123') ) {
+?>

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch24s09.html b/includes/jpgraph/docs/chunkhtml/ch24s09.html new file mode 100644 index 0000000..2b68817 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch24s09.html @@ -0,0 +1,572 @@ +Short description of supported symbologies

Short description of supported symbologies

+ +

In the following section we will describe the requirements to encode in each of + the supported symbologies. Some symbologies have strict standard for the data to be + encoded. Trying to encode illegal (or not supported data) will result in a "Data + validation" error as shown in Figure 24.5. Image error - Failed barcode data validation.

+

+

Warning

+

Please note that the information given here is in no way a replacement for + the official AIM and ISO standards these encoding are based on. It is + assumed that the reader have access to the official standards describing + each of these encodings before applying a particular symbology.

+

+

+

UPC A

+ +

UPC A = Universal Product Code Version A.

+

UPC A encodes 12 numeric digits. The first digit identifies the number system + used. The next group of 5 digits identifies the manufacturer. This number is + assigned by the Uniform Code Council (UCC). The next 5 digits + identify the particular product and are assigned by the manufacturer. The final + digit is a check digit.

+

Usage

+ +

Used for consumer goods. Is being slowly replaced by EAN13. UPCA is a + special case of EAN 13 where the first digit is always 0.

+
+

Input data/character set

+ +

Eleven digit. First digit is always 0.

+
+

Checksum

+ +

Automatic, mandatory.

+
+

Example

+ +

Encoded string = "03456781233" +

+

+

Figure 24.8. UPC A Example

+ +
UPC A Example
+


+

+
+
+

UPC E

+ +

UPC E = Universal Product Code Version E.

+

Usage

+ +

Same general use as UPC A. Can be considered a subset and a more compact + version of UPC A. Used where UPC A bar codes are to wide.

+

The 6 resulting digits is take from the UPC A according to the following 4 + rules:

+

+

  1. +

    If a manufacturer's number ends in 000 or 100 or 200, he has + available to him 1,000 item numbers between 00000 and 00999. The + six characters are obtained from the first two characters of the + manufacturer's number followed by the last three characters of + the item number, followed by the third character of the + manufacturer's number.

    +
  2. +

    If a manufacturer's number ends in 300, 400, 500, 600, 700, + 800 or 900, he has available to him 100 item numbers between + 00000 and 00099. The six characters are obtained from the first + three characters of the manufacturer's number followed by the + last two characters of the item number, followed by "3".

    +
  3. +

    If a manufacturer's number ends in 10, 20, 30, 40, 50, 60, 70, + 80 or 90, he has available to him 10 item numbers between 00000 + and 00009. The six characters are obtained from the first four + characters of the manufacturer's number followed by the last + character of the item number, followed by "4".

    +
  4. +

    If a manufacturer's number does not end in zero, then five + item numbers between 00005 and 00009 are available. The six + characters are obtained from all five of the manufacturer's + identification number followed by the last character of the item + number.

    +

+

+
+

Input data/character set

+ +

Eleven digits. First digit is always 0. Data input must follow UPC rule + for construction of UPC E data.

+
+

Checksum

+ +

Automatic, mandatory

+
+

Example

+ +

Encoded string = "05510000120"

+

As an example of the smaller size of UPC E the same data string is also + encoded with UPC A below.

+

+

+
+

+

Figure 24.9. UPC E Encoding of "05510000120"

+ +
UPC E Encoding of "05510000120"
+


+

+
+

+

Figure 24.10. UPC A Encoding of "05510000120"

+ +
UPC A Encoding of "05510000120"
+


+

+
+

+

+
+
+

EAN 8

+ +

General purpose short barcodes

+

Usage

+ +

A shorter version of EAN13 using only 7 digits + checksum digit.

+
+

Input data/character set

+ +

Seven digits.

+
+

Checksum

+ +

Automatic, mandatory

+
+

Example

+ +

Encode string = "3776221". Note the automatically added check + digit.

+

+

Figure 24.11. EAN 8 Example

+ +
EAN 8 Example
+


+

+
+
+

EAN 13

+ +

The names comes from that this symbology encodes 13 characters. It is widely + used in the manufacturing industry.

+

The first two or three digits are a country code which identify the country in + which the manufacturer is registered. The country code is followed by 9 or 10 + data digits (depending on the length of the country code) and a finally a single + digit checksum.

+

Usage

+ +

Generic code for consumer goods. Is replacing UPC-A as worldwide standard. +

+
+

Input data/character set

+ +

Twelve digits.

+
+

Checksum

+ +

Automatic, mandatory

+
+

Example

+ +

Encoded string = "377622153812" +

+

+

Figure 24.12. EAN 13 Example

+ +
EAN 13 Example
+


+

+
+
+

EAN 128

+ +

+

Note

+

The GS1 (www.gs1.com) organization + has renamed several barcode standards built on Code 128 such as EAN-128 + to GS1-128.

+

+

+

Usage

+ +

EAN 128 is a CODE 128 where the data structure is strictly regulated. + Please refer to the official EAN-128 specifications for details.

+
+

Input data/character set

+ +

An alphanumeric data string following EAN 128 rules. This means for one + thing that the string must start with a FUNC1 character which is encoded + using ASCII 128 in JpGraph Barcode available as constant EA_FUNC1. The + validation routines checks these rules and will fail any data string not + following the EAN 128 rules.

+
+

Checksum

+ +

Automatic, mandatory.

+
+

Example

+ +

Encoded string = "3125134772"

+

+

Figure 24.13. EAN 128 Example

+ +
EAN 128 Example
+


+

+
+
+

Industrial 2 of 5

+ +

The names comes from that each character is encoded in 5 bars and 2 of those + are 3 modules wide and the rest 1 module wide

+

Usage

+ +

Old low density standard. For newer applications it should not be used. + Use interleaved 2 of 5 instead since this is a higher density code.

+
+

Input data/character set

+ +

Digits.

+
+

Checksum

+ +

Optional.

+
+

Example

+ +

Encoded string = "13729"

+

+

+
+

+

Figure 24.14. Industrial 2 of 5, without check + digit

+ +
Industrial 2 of 5, without check digit
+


+

+
+

+

Figure 24.15. Industrial 2 of 5, with check digit

+ +
Industrial 2 of 5, with check digit
+


+

+
+

+

+
+
+

Interleaved 2 of 5

+ +

The name comes from the that each data character is composed of 5 elements, + either 5 bars or 5 spaces. Two elements are 3 modules wide and three elements + have a width of 1 module. Adjacent characters are interleaved, mixing the spaces + from one character with the bars of the other.

+

+

Note

+

This symbology is sometimes referred to as "Code 25" but since this + could also refer to "Industry 2 of 5" symbology this name is ambiguous + without further discriminating information.

+

+

+

Usage

+ +

Various. Relative hight density numeric code. Used for example on some + driving licenses.

+
+

Input data/character set

+ +

Even length numeric string when not using checksum. Odd length string when + using checksum.

+
+

Checksum

+ +

Optional.

+
+

Example

+ +

Encoded string = "137291"

+

Since using a checksum requires an odd number of digits we add a '0' in + the beginning to get a data string with an even number of digits.

+

+

+
+

+

Figure 24.16. Industrial 2 of 5, without check + digit

+ +
Industrial 2 of 5, without check digit
+


+

+
+

+

Figure 24.17. Industrial 2 of 5, with check digit

+ +
Industrial 2 of 5, with check digit
+


+

+
+

+

+
+
+

CODE 11 (USD 8)

+ +

Warning

+

THIS IS AN EXPERIMENTAL ENCODER

+

Due to the lack of CCD scanners supporting this code in Europe we have not + been able to verify this Code against any scanning equipment.

+
+

Usage

+ +

Numeric only code. Used primarily on telecommunication equipment. Not + recommended for general usage. Note: This code is not widely supported by + handhold CCD scanners.

+
+

Input data/character set

+ +

Numeric including the dash "-" character.

+
+

Checksum

+ +

Optional.

+
+

Example

+ +

Encoded string = "0137291"

+

+

+
+

+

Figure 24.18. Code 11, without check digit

+ +
Code 11, without check digit
+


+

+
+

+

Figure 24.19. Code 11, with check digit

+ +
Code 11, with check digit
+


+

+
+

+

+
+
+

CODE 39

+ +

This is also known as "Code 3 of 9" or + "USD 3" . This names comes from that each + character consists of 9 elements. 5 bars and 4 spaces. Three of those elements + are 2 modules wide and the rest one module wide. Code 39 is defined in American National Standards Institute (ANSI) + standard MH10.8M-1983.

+

The full 128 ASCII character set can be encoded in Code 39.

+

Code 39 is a very widely used barcode and basically every scanner/reader on + the market is able to decode Code 39 barcodes which makes it for a very good + selection as a generic linear barcode.

+

Usage

+ +

General alphanumeric data (Capitals only)

+
+

Input data/character set

+ +

Alphanumeric (CAPITALS only) including the special characters "$", "/", + "+", "%" and "*"

+
+

Checksum

+ +

Optional.

+
+

Example

+ +

Encoded string = "GRAPH12"

+

+

+
+

+

Figure 24.20. Code 39, without check digit

+ +
Code 39, without check digit
+


+

+
+

+

Figure 24.21. Code 39, with check digit

+ +
Code 39, with check digit
+


+

+
+

+

+
+
+

CODE 39 Extended

+ +

Code 39 Extended was developed to provide a means of encoding additional + characters that are not normally part of the Code 39 character set (lower case + characters and symbols).

+

Usage

+ +

Same as Code 39 with the change that it supports lower case characters + ("a,b,c,d,...") but do not support the special characters "+/%$+*".

+
+

Input data/character set

+ +

Alphanumeric data.

+
+

Checksum

+ +

Optional.

+
+

Example

+ +

Encoded string = "Code39"

+

+

+
+

+

Figure 24.22. Code 39 Extended, without check + digit

+ +
Code 39 Extended, without check digit
+


+

+
+

+

Figure 24.23. Code 39 Extended, with check digit

+ +
Code 39 Extended, with check digit
+


+

+
+

+

+
+
+

CODE 128

+ +

Named so since it can encode the entire 128 ASCII character set (from ASCII 0 + to ASCII 128.)

+

Usage

+ +

Generic high density code which supports the full ASCII set.

+
+

Input data/character set

+ +

Alphanumeric characters.

+
+

Checksum

+ +

Automatic, mandatory.

+
+

Example

+ +

Encoded string = "Code128"

+

+

Figure 24.24. Code 128

+ +
Code 128
+


+

+
+
+

CODABAR

+ +

Codabar is primarily used in libraries in the USA. It is also sometimes used + in health care and transportation systems.

+

Usage

+ +

Old, numeric + some alpha capability, code. Primarily used in the USA. +

+
+

Input data/character set

+ +

Numbers 0-9, Special characters "-$:/.+"

+
+

Checksum

+ +

None.

+
+

Example

+ +

Encoded string = "12354"

+

+

Figure 24.25. Codabar

+ +
Codabar
+


+

+
+
+

Bookland (ISBN)

+ +

This is a specially formatted EAN13 Code. This is primarily used to encode the + International Standard Book Number (ISBN) + on magazines and books.

+

Usage

+ +

Encodes ISBN codes in books and magazines.

+
+

Input data/character set

+ +

A valid ISBN number without last digit (check digit) and "-" signs. An + ISBN is a 10-digit number which is made up of

+

+

  • +

    Group identifier (1 digit, typically 0 or 1 for + English-speaking countries)

    +
  • +

    Publisher identifier

    +
  • +

    Title identifier

    +
  • +

    Check digit

    +

+

+
+

Checksum

+ +

Automatic, mandatory.

+
+

Example

+ +

The input data must be a valid ISBN (International Standard Book Number)

+

Encoded string = "0-486-63926-6" +

+

+

Figure 24.26. Bookland (ISBN)

+ +
Bookland (ISBN)
+


+

+

+

Note

+

The ISBN check digit "6" is automatically removed and replaced by + the EAN 13 check digit.

+

+

+

+

Note

+

A bookland code will always have the digits "978" as the first + three digits (the standard also allows "979" but that is currently + not in use)

+

+

+

+

Note

+

ISBN numbers are organized in Europe by:

+

+

International Standard Book Number Agency, 
+Staatsbibliothek Preussischer Kulturbesitz
+Posdamer Strasse 33
+D-1000 Berlin 30 Germany

+

+

+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25.html b/includes/jpgraph/docs/chunkhtml/ch25.html new file mode 100644 index 0000000..dc7a3b3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25.html @@ -0,0 +1,177 @@ +Chapter 25. PDF417 (2D-Barcode)

Chapter 25. PDF417 (2D-Barcode)

+ +

Principle of PDF417 Barcodes

+ +

Note

+

This module is only available in the pro-version of the library.

+
+

+

Caution

+

In order to use the PDF417 barcode module it is necessary for the PHP + installation to support the function bcmod(). This is enabled + when compiling PHP by making sure that the option --enable-bcmath + is given when configuring PHP at compile time.

+

+

+

This first section gives a very brief explanation of the general structure of PDF417 + barcodes and some capacity figures.

+

PDF417 was one of the first publicly available high density (capable of storing up to + 2710 data characters) two dimensional barcodes. It was originally published by Symbol + Technologies, Inc. but has since become an ISO standard. PDF417 belongs to the early two + dimensional barcodes which internally consists of a number of linear barcodes stacked on + top of each other. This is in contrast to the more modern two dimensional barcodes like + Datamatrix and QR + code which are truly two dimensional in that they have moved away from + the row thinking in the internal construction of the barcode.

+

PDDF417 barcodes are extensively used for example within aviation, automobile industry + and health care.

+

Strictly speaking it is not necessary to know this level of detail to use the PDF417 + barcode module but we would recommend to read through this at least once since some + parameters (like number of columns - explained below - that are used adjustable)

+

PDF417 is an acronym for Portable Data Format 4 of 17 where 4 of 17 describes the structure of + how a single data character is encoded (4 bars and 4 spaces in a 17 module wide + structure).

+

PDF417 standard

+ +

The PDF417 is high capacity two dimensional barcode and is fully described in the + official standard ISO/IEC 15438:2001 available for purchase from ISO Standard Organization.

+
+

Data capacity

+ +

PDF417 is a row based 2 dimensional barcode that consists of a maximum of 90 rows + and 30 columns. The maximum number of data is dependent on

+

+

  • +

    The compaction mode used

    +
  • +

    The number of columns (and rows)

    +
  • +

    The error correction level

    +

+

+

The maximum data size is dependent on both the compaction mode as well as the + input data. The figures listed below will give some idea on the capacity

+

+

  • +

    2710 digits in numeric compaction mode

    +
  • +

    1850 characters in text compaction mode

    +
  • +

    1108 bytes in byte compaction mode

    +

+

+

One barcode can hold up to a maximum of 929 codewords (data count + data + error + correction)

+
+

Structure of PDF417 barcodes

+ +

A high level overview of the structure of a PDF417 barcode is shown in Figure 25.1. PDF417 Structure - Overview . A PDF417 barcode can be thought + of as a number of linear barcode stapled on top of each other. Each row in the + barcode is constructed in a similar way.

+

Each data word (symbol character) consists of 4 bars and four spaces in a 17 + module structure, hence the name PDF417. A more detailed explanation of a real + PDF417 barcode is shown in Figure 25.2. PDF417 Structure - Details of a real barcode

+

There are three distinct areas in a barcode:

+

+

  1. +

    Start and stop pattern (light red background + color). Used to help the scanner find the start and + beginning of the barcode. These patterns are static and are the same for + all barcodes.

    +
  2. +

    Left and right row indicators. Used + to help the scanner orient itself in the barcode. These patterns are + dependent on the actual data in the barcode to achieve maximum + contrast.

    +
  3. +

    Data and data count. This is unique + for each barcode and represents the encoded data. PDF417 specifies + several ways to encode the characters in the input data to achieve + maximum compression level based on the knowledge (and restriction) on + the input alphabet. For example, if the data is known to be only numeric + the encodation can take advantage of this and make the compaction schema + more efficient than if also alphabetical letters have to be encoded.

    +

    The way the data is encoded is user specifiable. By default the + library analyses the input data and determines an optimal mix of + encoding suitable for this particular data.

    +
  4. +

    Error correction codewords. Each + PDf417 have a user selectable error correction level. Since the barcode + have a specified size this means that the more error correction words + that are used the less data can fit. The error correction words are + added to the end of the payload data, each barcode has a minimum of 2 + error detection codewords. Up to 510 additional error correction + codewords can be added for maximum data correction.

    +

+

+

+

Figure 25.1. PDF417 Structure - Overview

+ +
PDF417 Structure - Overview
+


+

+

In Figure 25.2. PDF417 Structure - Details of a real barcode the distinct data column + (which on each row holds one data word) are indicated at the bottom + (w1,w2,w3,w4,w5). This particular barcode have 8 rows and 5 columns which means that + the total number of data words + error correction words encoded are 8x5 = 40.

+

+

Figure 25.2. PDF417 Structure - Details of a real barcode

+ +
PDF417 Structure - Details of a real barcode
+


+

+

The data to be converted into a barcode has to go through a number of steps which + are handled by the library:

+

+

  1. +

    The first step is a high level compression schema known as compaction. + This schema translates the input string into a number of codewords. Each + codeword has a numeric value between 0 and 928. To achieve the highest + possible compaction and flexibility the PDF417 standard defined three + different compaction schema:

    +

    +

    • +

      numeric (encodes only digits 0-9, ASCII 30-39). This + schema can compact up to 2.9 digits per codeword (and has + the highest density)

      +
    • +

      byte (encodes ASCII 0-255). This schema can only compact + up to 1.2 bytes per codeword (and has the lowest + density)

      +
    • +

      text (which encodes ASCII 32-126). This schema can compact + up to 1.8 characters per codeword.

      +

    +

    +
  2. +

    The second step is the transformation of codeword into (4,17) symbols. + The exact symbol used is dependent on which row the codeword to be + encoded is on. Three different sets of codewords, known as clusters, are + used. This ensures that two adjacent rows uses different clusters. This + allows the barcode to be scanned without using specific divider + symbols.

    +
  3. +

    In the third step the error codewords specified are calculated and + added to the end of the payload data. The error correction uses + polynomial Reed-Solomon error correcting coding (same schema as used on + CD:s) to achieve a good balance between error correcting efficiency and + computational effort and space requirements.

    +
  4. +

    Finally these codeword are positioned sequentially in each row + starting at the top left corner down to the bottom right in between the + left and right row indicators, and the start and stop patterns.

    +

+

+

By necessity this s a fairly shallow description where we have omitted many + technical details in the encodation process. We therefore refer to the official + standard which gives much more technical details on the encodation process.

+
+
+ + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s02.html b/includes/jpgraph/docs/chunkhtml/ch25s02.html new file mode 100644 index 0000000..551e50a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s02.html @@ -0,0 +1,126 @@ +Creating barcodes

Creating barcodes

+ +

Introduction

+ +

The library allows the creation of PDF417 barcodes as either images (in either PNG + or JPEG format) or as a Postscript files. In addition the barcode extension provides + extensive data verification which makes it impossible to create an invalid + barcode

+

Verification

+ +

The JpGraph PDF417 barcode module have been extensively verified using an + ARGOX 8213 2D CCD handhold scanner.

+
+

Features

+ +

This is a summary of the features available in the JpGraph PDF417 barcode + extension.

+

+

  • +

    Supports both standard and truncated PDF 417 codes

    +
  • +

    Output format

    +

    +

    1. +

      Image format, (any of the formats supported by the + library)

      +
    2. +

      Postscript

      +
    3. +

      Encapsulated postscript

      +

    +

    +
  • +

    Supports both auto and user selectable number of columns and + rows

    +
  • +

    Supports all 8 possible error correction levels

    +
  • +

    Supports all defined compaction schemes, Alpha, Numeric and Byte. + In addition the library has an optimization algorithm that will + determine the best possible encoding given a specific input + data.

    +
  • +

    User specified module height

    +
  • +

    User specified module width factor

    +
  • +

    User specified overall image scaling of resulting barcode

    +
  • +

    Horizontal or vertical barcode layout

    +
  • +

    Optional human readable text at the bottom of the barcodes with + selectable font and size

    +
  • +

    Foreground and background color specification

    +

+

+
+

Sample application

+ +

Even though the library module is meant, and designed, to be used as a library + within a larger system there is a small demo barcode creation application + included in the distribution. This application can be used to easily create + barcode through it's WEB interface as can be seen in Figure 25.3. PDF417 WEB-based demo application

+

This application is primarily included as a demo on the features available in + the library and not as a finalized product.

+

The application is available at + "pdf417/demoapp/index.html" in the distribution.

+

+

Figure 25.3. PDF417 WEB-based demo application

+ +
PDF417 WEB-based demo application
+


+

+

The fields in the demo application has the following meaning

+

+

  • +

    Data: Data to be encoded. This + should be entered as a standard string.

    +
  • +

    Encoding: Determine the + compaction schema to be used

    +
  • +

    Columns: Number of data columns + to be used

    +
  • +

    Error level: What error level to + be used

    +
  • +

    Module width: Module width

    +
  • +

    Height factor: Specify the height + of the individual rows in the barcode as a multiplier of the + width.

    +
  • +

    Scale: Scale factor.

    +
  • +

    Text: Should the human readable + text be shown?

    +
  • +

    Vertical: Should the barcode use + vertical layout?

    +
  • +

    Frame: Should a frame be added to + the barcode?

    +
  • +

    Truncated: Should the barcode be + truncated?

    +
  • +

    File: If specified the output + will be written to this file

    +
  • +

    PS Module: If specified will be + used as the module width for PS

    +
  • +

    Format: If specified will set + what image encoding will be used output

    +
  • +

    Debug info: Will open a new frame + and display some internal debugging information from the + library.

    +

+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s03.html b/includes/jpgraph/docs/chunkhtml/ch25s03.html new file mode 100644 index 0000000..4572d6d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s03.html @@ -0,0 +1,207 @@ +Creating barcodes

Creating barcodes

+ +

In order to access the PDF417 functionality the module + "pdf417/jpgraph_pdf417.php" must first be included.

+

Usage of PDF417 barcodes follows a similar schema as for the linear barcodes with the + concepts of an encoder and backend. The principle of the overall encodation process is + shown in Figure 25.4. Overview of the interaction between encoder and backends

+

+

Figure 25.4. Overview of the interaction between encoder and backends

+ +
Overview of the interaction between encoder and backends
+


+

+

In order to create a PDf417 barcode the following principle steps are needed

+

+

  1. +

    Create an instance of the PDF417 encoder (as an instance of class + PDF417Barcode )

    +
  2. +

    Create an instance of a backend to produce the wanted output (image, + postscript or encapsulated postscript) by using the static factory method + PDF417BackendFactory::Create()

    +
  3. +

    Encode data and send it back to the browser or a file with a call to the + backend Stroke() method.

    +

+

+

The following script shows how to create the simplest possible barcode (in PNG format) + representing the data string "PDF-417" encoded using default number of columns and the + default error correction level

+

+

Example 25.1. The most basic PDF417 script (pdf417_ex0.php)

1
+2
+3
+4
+5
+6
+7
+8
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+// Create a new encoder and backend to generate PNG images
+$backend = PDF417BackendFactory::Create(BACKEND_IMAGE,new PDF417Barcode());
+$backend->Stroke($data);
+?>


Figure 25.5. The most basic PDF417 script (pdf417_ex0.php)

The most basic PDF417 script (pdf417_ex0.php)


+

+

As can bee seen from the code above the basic interface to the library makes use of + one abstract factory to create the appropriate output backend. This design makes the + addition of new output formats transparent for the end user of the library.

+

The example above does not have any error handling. If there is some error in the + process an exception will be thrown in the same way as in other places in the library. + The default exception will display the standard library image error box. If we instead + always wanted to do some additional processing and perhaps just display a text based + re-formatted error message we could change the above code to catch this exception as the + following example shows

+

+

Example 25.2. Adding error handling (pdf417_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+try {
+    // Create a new encoder and backend to generate PNG images
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,new PDF417Barcode());
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


Figure 25.6. Adding error handling (pdf417_ex1.php)

Adding error handling (pdf417_ex1.php)


+

+

when an exception is thrown it will be caught and the error string echoed. If instead + we wanted to specifically encode the data using 8-columns and using error detection + level 5 the code would have to be modified to

+

+

Example 25.3. Adjusting the number of columns and error correction level (pdf417_ex1b.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 2;  // Use error level 2 (minimum recommended)
+ 
+// Create a new encoder and backend to generate PNG images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


Figure 25.7. Adjusting the number of columns and error correction level (pdf417_ex1b.php)

Adjusting the number of columns and error correction level (pdf417_ex1b.php)


+

+

Later on we will go through all the different options available both on the encoder + and on the backends. But for now let's just show how easy it is to change the size of + the barcode and add a human readable text at the bottom of the bar from the example + above.

+

In the same way as for linear barcode the concept of "module width" is used. This is + basically the width of a unit bar in the barcode. Remember that each codeword is made up + of 17 modules where there are 4 black and 4 white areas of various width. The width of + the module is specified with the backend method

+

+

  • +

    Backend::SetModuleWidth($aWidth)

    +

+

+

For images this is specified in pixels and for a postscript backend this is + interpretated as specifying the number of points (1 pt = 1/72 inch).

+

To add a human readable version of the data at the bottom of the barcode we use the + method

+

+

  • +

    Backend::ShowText($aShow=true)

    +

+

+

Adding these tow method calls to our previous example will give us the following code + and resulting barcode.

+

+

Example 25.4. Adjusting the module width and showing human readable text (pdf417_ex2.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 2;  // Use error level 2 (minimum recommended)
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 3;    // Height factor
+ 
+// Create a new encoder and backend to generate PNG images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


Figure 25.8. Adjusting the module width and showing human readable text (pdf417_ex2.php)

Adjusting the module width and showing human readable text (pdf417_ex2.php)


+

+

In the remainder of this chapter we will explain in more detail what other formatting + options are available.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s04.html b/includes/jpgraph/docs/chunkhtml/ch25s04.html new file mode 100644 index 0000000..058d4a8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s04.html @@ -0,0 +1,461 @@ +Specifying the PDF417 parameters

Specifying the PDF417 parameters

+ +

+

Note

+

The following section is not meant as a general introduction to the way PDF417 + barcode is specified. It assumes that the reader has a basic understanding of + the nature of PDF417 encoding. This section will focus on how to make use of the + methods in the library to specify the various settings for the PDF417 barcodes. +

+

+

+

Specifying encoding and input data

+ +

The absolute simplest way of encoding data is simply to create a simple string + representing the data to be encoded and then pass that string as the first argument + to the Stroke() method in the backend. The encoder will then analyze + the input data and choose the most efficient space saving encoding schema for this + data.

+

The PDF417 standard allows 3 different compaction schema that can be used to + minimize the number of codewords used for a particular data string. This also means + that a particular data string may have several different valid barcodes that + visually looks different.

+

The available compaction modes are:

+

+

  • +

    Alpha compaction mode (also known as + Text compaction mode). Efficient encoding of ASCII 32-126, (inclusively) + i.e. the normal alphabet including numbers. Encodes 1.8 characters per + codeword.

    +
  • +

    Numeric compaction mode. Efficient + encoding of numeric data. For long consecutive strings of digits this + gives a better compaction than the alpha mode. Numeric compaction + encodes about 2.9 digits per codeword.

    +
  • +

    Byte compaction mode. The least + efficient encoding. Used only when there is a need to encode byte values + as is, i.e. values in the range 0-255. Please note that many barcode + readers, especially those with a keyboard wedge, don't send back the + proper encoding for ASCII values lower than 32 or higher than 126. Byte + compaction mode encodes roughly 1.2 byte per codeword.

    +

+

+

When the automatic encoding is chosen this will create an optimum encoding (from a + size perspective) of the supplied data. This includes shifting encoding method in + the middle of the data one or several time depending on the structure of the data.

+

It is also possible to manually control the exact encodation of the input data. + This is done by supplying one or more data tuples where the first entry in the tuple + is the compaction schema and the second the data. To encode the data manually the + following structure must then be followed:

+

+

Figure 25.9. Structure for manually specified encodation schema

+ +
$data = array( array( <encoding_mode1> , <data1> ),
+               array( <encoding_mode2> , <data2> ),
+                         ...
+               array( <encoding_modeN> , <dataN> ));
+


+

+

The encoding mode is specified as one of three symbolic constants

+

+

  • +

    USE_TC, (short for USE-TextCompaction) Use Text compaction schema

    +
  • +

    USE_NC, (short for USE-Numerical-Compaction) Use Numeric compaction + schema

    +
  • +

    USE_BC, (short for USE-ByteCompaction) Use Byte compaction schema

    +

+

+

and the data is specified as a regular text string. Each section of data must + therefore have the compaction mode specified.

+

Example 1:

+

In the following example we will assume that we want to encode the data string

+

+

1
+
$data="1234567890"

+

+

To use automatic encoding then there is nothing more than specifying this data to + the Backend::Stroke() method as

+

+

1
+
$backend->Stroke($data);

+

+

If instead we wanted to make sure that only alpha mode (text) compaction schema is + used the input data would have to be changed to

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$data="1234567890" 
+$newdata = array(array( USE_TC, $data ));
+...
+$backend->Stroke($newdata);
+?>

+

+

this will then force the input string to be encoded using only the text compaction + schema.

+

If instead we wanted to enforce only numeric compaction the code would have to be + changed to

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$data="1234567890" 
+$newdata = array(array( USE_NC, $data ));
+...
+$backend->Stroke($newdata);
+?>

+

+

this will then force the input data string to be encoded using numeric compaction + schema. ∎

+

In the above example we just used a single compaction schema to use multiple + encodation schema we just need to split our data for each of the compaction mode we + want to use and create an input array. An example will make this clear.

+

Example 2:

+

We will assume that we want to encode the string "1234abc567" by + using numeric compaction for the first 4 digits, then use text compaction for the + three letters and finally go back to numeric compaction schema for the last three + digits. For this to work we would have to create an input array as shown below.

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+$newdata = array(array( USE_NC, '1234'), 
+                 array( USE_TC, 'abc'), 
+                 array( USE_NC, '567'));
+...
+$backend->Stroke($newdata);
+?>

+

+

+

+

Note

+

Normally there are very few reasons to specify the encodation schema + manually and it is therefore better to let the library determine the optimum + encoding by itself.

+

+

+

Using byte compaction mode

+ +

Using byte compaction mode is however slightly more complex. The reason is + that we need, for technical reasons, specify if the size (length) of the data to + be encoded is an even multiple of 6 or not.

+

Hence, there are actually two Byte code compaction schema

+

+

  1. +

    USE_BC_E6 (for even multiples of 6)

    +
  2. +

    USE_BC_O6 (for odd data).

    +

+

+

So to encode data using byte compaction mode the following template should be + used to determine the proper byte compaction variant.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+$even6 = ( strlen($data) % 6 === 0 );
+$newdata = array(array( $even6 ? USE_BC_E6 : USE_BC_O6, $data));
+...
+$backend->Stroke($newdata);
+?>

+

+

+

Caution

+

Remember that strlen() is not multi byte character + encodation safe. If multi-byte characters should be encoded then the + mb_strlen() should be used.

+

+

+

+

Caution

+

Note that several keyboard wedge barcode scanners do not handle byte + values < 32 or > 127 properly.

+

+

+
+
+

Encoder option: Adjusting the number of data columns

+ +

PDF417 barcode is made up of a number of rows and columns. The library allows the + specification of the number of columns and it will then determine the necessary + number of rows to hold all the given data + the error correction information.

+

Since each row has some overhead (start/stop and sync codewords) the overall area + taken by the barcode will be minimized by trying to use as many columns as possible. + The standards allow for up to 30 columns (and 90 rows). The most practical limit is + how wide data the scanner is able to handle. Most hand hold scanner will usually not + work very reliable with barcodes which are more than ~10cm wide.

+
+

Encoder option: Adjusting the error level

+ +

All PDF417 barcodes have a minimum of two error detection codewords. Above that + the user is free to specify a higher level which will allow not only error detection + but also (some) error correction.

+

The error level determines how much redundancy is added in the barcode label. A + high level of redundancy ensures that a partially damaged barcode can still be + correctly read by the barcode scanner. The downside is that the higher the error + level the larger the barcode gets and since the total number of codewords in a + PDF417 barcode has a maximum limit of 928 also less real data. Table 25.1. Available error levels shows the available error levels and + how that will impact the maximum data payload. Table 25.1. Available error levels also shows the error correcting + capacity. For example using error level 4 means that 15 of the codewords can have + errors and still be corrected.

+

+

Table 25.1. Available error levels

+ +
Error level +

Error correction

+

codewords

+
+

Error correction

+

capacity

+
+

Maximum

+

payload

+
+

0

+
+

2

+
0 +

923

+
+

1

+
+

4

+
1 +

921

+
+

2

+
+

8

+
3 +

917

+
+

3

+
+

16

+
7 +

909

+
+

4

+
+

32

+
15 +

893

+
+

5

+
+

64

+
31 +

861

+
+

6

+
+

128

+
63 +

797

+
+

7

+
+

256

+
127 +

669

+
+

8

+
+

512

+
255 +

413

+
+


+

+

The recommended minimum error level is a dependent on the payload size and is + given below.

+

+

Table 25.2. Recommended error levels

+ +
+

Data codewords

+
+

Recommended

+

error level

+
+

1 to 40

+
+

2

+
+

41 to 160

+
+

3

+
+

161 to 320

+
+

4

+
+

321 to 863

+
+

5

+
+


+

+

Note that the number of codewords is not the same thing as, for example, the + number of digits or letters in a string to be encoded. Depending on the chosen + encoding the number of symbols per codeword is always > 1. For example in numeric + compaction mode (encoding) each codewords encode, on average, 2.93 digits.

+

The error level is specified as an integer in the range [0-8] inclusively and can + be specified when creating a particular encoder. For example the code below uses the + default error correction (2).

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+// Use 10-columns for data
+$columns =10;
+ 
+// Create a new encode using the default error correction
+$encoder = new PDF417Barcode ($columns);
+?>

+

+

While the following specifies an error correction level of 6

+

+

1
+2
+3
+4
+5
+6
+7
+
<?php
+$columns = 10; // Use 10-columns for data
+$errlevel = 6; // Error correction level 6
+ 
+// Create a new encode using the default error correction
+$encoder = new PDF417Barcode ($columns, $errlevel);
+?>

+

+

In addition to specifying the number of data columns and error level in the + creation of the encoder it is also possible to adjust them afterwards.

+

For example, it might be necessary to create the encoder in the beginning of a + script and then use the same encoder with different settings controlled by, for + example, entries in a DB.

+

The two encoder methods

+

+

  • +

    Encoder::SetErrLevel($aErrLevel)

    +
  • +

    Encoder::SetColumns($aColumns)

    +

+

+

are used for this purpose. The code snippet below does the exact same things as + the code snippet above but using these two methods after the encoder has been + instantiated instead.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+$columns = 10; // Use 10-columns for data
+$errlevel = 6; // Error correction level 6
+ 
+// Create a new encode using the default error correction
+$encoder = new PDF417Barcode();
+$encoder->SetColumns($columns);
+$encoder->SetErrLevel($errlevel);
+?>

+

+
+

Truncated PDF417

+ +

+

Warning

+

Not all PDF417 barcode readers can handle truncated PDF417

+

+

+

In situations where the physical size of the label is restricted one might use the + truncated version of the PDF417 code.

+

This works by simply stripping of some redundant information on the right side of + the barcode. This will also make the barcode more sensible for damage.

+

The two images below shows a normal version together with the truncated version + (both barcodes encode the same information).

+

+

+
+

+

Figure 25.10. Normal PDF417

+ +
Normal PDF417
+


+

+
+

+

Figure 25.11. Truncated PDF417

+ +
Truncated PDF417
+


+

+
+

+

+

To use the truncated version the method the following encoder method is + used

+

+

  • +

    Encoder::SetTruncated($aFlg=true)

    +

+

+

The following code snippet shows how this can be used

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+$columns = 10; // Use 10-columns for data
+$errlevel = 4; // Error correction level 4
+$truncated = true;
+ 
+// Create a new encode using the default error correction
+$encoder = new PDF417Barcode();
+$encoder->SetTruncated($truncated);
+$encoder->SetColumns($columns);
+$encoder->SetErrLevel($errlevel);
+?>

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s05.html b/includes/jpgraph/docs/chunkhtml/ch25s05.html new file mode 100644 index 0000000..d132f9e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s05.html @@ -0,0 +1,100 @@ +Adjusting the output

Adjusting the output

+ +

This section deals with the way you can adjust the visual quality and appearance of + the output by adjusting a number of properties on the backend.

+

Output format

+ +

By choosing the appropriate backend you can choose to generate the barcode label + as either an image (in either PNG or JPEG format) or as Postscript (both standalone + and Encapsulated postscript) . For images the PNG is strongly recommended and used + by default. The reason is that PNG is a non-destructive format and will ensure the + maximum quality of the barcodes while JPEG is not well suited for this type of + applications since it is a destructive format.

+

This choice is being made by creating the appropriate backend. The backend is + created by calling the factory method PDF417BackendFactory::Create() + specifying what type of backend and what encoder to use. The backend factory will + then return a suitable encoder.

+

The following code snippet shows how to create a backend that will generate an + image.

+

+

1
+2
+3
+4
+5
+6
+
<?php
+// Create a new encode using the default error correction
+// and columns
+$encoder = new PDF417Barcode ();
+$backend = PDF417BackendFactory::Create( BACKEND_IMAGE, $encoder);
+?>

+

+

It is also possible to have one encoder and two different backends to allow the + creation of both image and postscript output at the same time as the following + example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php
+$date='ABC123';
+$file=' ...'; // Some filename to write the PS file to
+ 
+// Create a new encode using the default error correction
+// and columns
+$encoder = new PDF417Barcode ();
+ 
+$eImg = PDF417BackendFactory::Create( BACKEND_IMAGE, $encoder);
+$eEPS = PDF417BackendFactory::Create( BACKEND_EPS, $encoder);
+$eEPS->Stroke($data,$file);
+$eImg->Stroke($data);
+?>

+

+
+

Summary of user settings for the backend

+ +

In the list below is a short description of the available possibilities to change + the output. For a more detailed explanation of the parameters for each method please + consult the method reference at the end of this chapter

+

+

  • +

    Specifying the module width. The + module width for the barcode is user selectable, For images this + specifies the number of pixels for the module and for Postscript output + this specifies the number of points (1/72 inch).

    +
  • +

    Specifying the width/height factor + Specify the height of each individual row in the barcode as a multiple + of the width. By default the height is 3x the width.

    +
  • +

    Specifying background and foreground + color The foreground color and the background color for + the barcodes are user selectable. The colors can be specified as any of + JpGraphs builtin colors.

    +
  • +

    Adding human readable text This is an + extension to the PDF417 standard. This adds a plaintext string of the + data that has been encoded under the barcode. This is useful when + debugging applications to make sure that the right values have been + read, for example, from a DB.

    +
  • +

    Rotating 90 degrees (Vertical output) This enables the barcode to be + printed vertically.

    +
  • +

    Scaling the image The resulting barcode images can be scaled by an + arbitrary factor.

    +

+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s06.html b/includes/jpgraph/docs/chunkhtml/ch25s06.html new file mode 100644 index 0000000..85e0355 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s06.html @@ -0,0 +1,64 @@ +A template to create barcodes

A template to create barcodes

+ +

In the example directory in the distribution ('pdf417/examples') + you can find many more examples on how to create barcodes. As a good start the following + (simple) template may be used as a base for further customizations.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php
+require_once('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Specification for barcode
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 2;    // Height factor (=2)
+$truncated = false; // Don't truncate 
+$showtext = false;  // Show human readable string
+ 
+// Create a new encoder and backend to generate images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $encoder->SetTruncated ($truncated); 
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s07.html b/includes/jpgraph/docs/chunkhtml/ch25s07.html new file mode 100644 index 0000000..a8d81af --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s07.html @@ -0,0 +1,340 @@ +Method reference

Method reference

+ +

Encoder methods

+ +

All encoder methods are accessed on an instance of class + PDF417Barcode +

+

+

1
+2
+3
+
...
+$encoder = new PDF417Barcode($columns,$errlevel);
+...

+

+

PDF417Barcode

+ +

PDF417Barcode($aNumCols=10, $aErrLevel=2)

+

Purpose:

+

To create a new PDF417 encoder with a chosen number of columns and error + level. Please note that these parameters can also be adjusted using the methods + described below. The method will throw exceptions if the parmeters are outside + there valid range.

+

$aNumCols , an integer in the range [2,30]

+

$aErrLevel, an integer in the range [0,8]

+

Returns:

+

A new encoder which is used by the backend to generate the barcode + label.

+

Example:

+

+

1
+2
+
// Create a new encoder with 20 columns
+$encoder = new PDF417Barcode(20);

+

+
+

SetColumns

+ +

SetColumns($aCols)

+

Purpose:

+

Specify number of data columns. This should be a value in the range [2-30] + (inclusively) . Note that it is also possible to specify the number of columns + in the instantiation of the encoder.

+

Example:

+

+

1
+2
+3
+
// Create a new encoder with 20 columns
+$encoder = new PDF417Barcode();
+$encoder->SetColumns(20);

+

+

Note:

+

The number of rows will be automatically adjusted to fit the data and the + error correction codewords as specified by the error level setting. The number + of rows is not directly user configurable.

+
+

SetErrLevel

+ +

SetErrLevel($aErrLevel)

+

Purpose:

+

Specify the chosen level of error correction.

+

Example:

+

+

1
+2
+
$encoder = new PDF417Barcode();
+$encoder->SetErrLevel(5);

+

+

Note:

+

A high error level will limit the number of payload data since the total + number of data in the label is fixed.

+
+

SetTruncated

+ +

SetTruncated($aTrunc=true)

+

Purpose:

+

Specify that barcode should use the truncated PDF format. This will make the + barcode slightly narrower and might be used where the physical space is at + premium.

+

Example:

+

+

1
+2
+
$encoder = new  PDF417Barcode();
+$encoder->SetTruncated ();

+

+

Note:

+

Not all barcode scanners can handle truncated PDF417.

+
+
+

Common backend methods

+ +

The backend is responsible for the actual output of the barcode (see Figure 25.4. Overview of the interaction between encoder and backends).

+

It is possible to either create an image or a postscript backend. In the creation + of the backend an instance of the encoder is given as the second argument. The + actual output from the script (to create the barcode label) is done with a call to + the Backend::Stroke() method. As usual this call should be the last + line in the script if it is used to send the image back to the browser.

+

The method call to Stroke() should always be guarded with a try{} catch + {} statement.

+

Example:

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
try {
+    $encoder = new  PDF417Barcode( $columns, $errlevel);
+    $backend = PDF417BackendFactory::Create( BACKEND_IMAGE, $encoder);
+ 
+    // .. Output formatting
+    $backend->Stroke();
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}

+

+

In the example above we have chosen to create an image encoder (specified by + constant BACKEND_IMAGE) by default the image format used will be PNG + which is also the recommended format.

+

Stroke

+ +

Stroke($aData, $aFile='')

+

Purpose:

+

Encode a specific data string entered as the first argument and send the + barcode output, depending on backend, either directly back to the browser as an + image or return the Postscript representation as a string.

+

Example:

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php
+// Data to be encoded
+$data = ... ;
+ 
+try {
+    ...
+    $backend->Stroke($data);
+} catch( JpGraphException $e) {
+    ...
+}
+?>

+

+
+

SetVertical

+ +

SetVertical($aFlg=true)

+

Purpose:

+

Draw the barcode vertically instead of the default horizontal direction

+

Example:

+

+

1
+
$backend->SetVertical();

+

+
+

SetScale

+ +

SetScale($aScale)

+

Purpose:

+

Will arbitrary scale the generated barcode image. Scale factor is specified as + a floating point number .

+

Example:

+

+

1
+
$backend->SetScale(2.5);

+

+
+

SetModuleWidth

+ +

SetModuleWidth($aWidth)

+

Purpose:

+

Specifies the module width to be used in the barcode. The module width is + interpretated differently depending on whether it is applied on an image or a + postscript backend. The module width will determine the physical width of the + overall barcode. Please make sure that the printer has good enough resolution to + handle the chosen module width.

+

For image backends is specifies the number of pixels to be used for the width + of one module in the barcode. The module can be thought of as the thinnest line + printed in the barcode. Each codeword is encoded 17 modules wide where there are + 4 black and 4 white separated areas.

+

Even though most modern inkjet printers (2003 and later) can resolve modules + down to 1 pixels it is recommended that for inkjet printers a module width of >= + 2 is used.

+

For Postcript backend the module width specified the width in Postscript + points (1 point = 1/72 inch).

+

Example:

+

+

1
+
$backend->SetModuleWidth(2);

+

+

+

Tip

+

The size of the barcode image can be fine tuned by applying an overall + scaling constant as specified with the method + SetScale().

+

+

+
+

SetHeight

+ +

SetHeight($aHeight)

+

Purpose:

+

Specified the height to width ratio for the individual rows in the barcode. By + default the ratio is 3, which means that the height of the rows in the barcode + is 3 times the module width. Most scanners can handle a factor between 2-5. You + should very rarely have to change this parameter.

+

The ratio is specified as an integer.

+

One reason to change this to a smaller value is to make a barcode label take + up less vertical space.

+

Example:

+

+

1
+
$backend->SetHeight(2);

+

+

+

Caution

+

Not all barcode scanners are good at handling very small ratios. This + will also make the barcode more susceptible to damages.

+

+

+
+

SetColor

+ +

SetColor($aFrgColor,$aBkgColor)

+

Purpose:

+

Specify the foreground and background color for the barcode.

+

Example:

+

+

1
+
$backend->SetColor( 'black', 'lightyellow');

+

+
+

ShowFrame

+ +

ShowFrame($aFlg=true)

+

Purpose:

+

Draw a 1 pixel frame around the barcode. This is not recommended in production + since it might disturb some scanners reading. This is only useful if you need a + visual feedback on the boundaries for the image.

+

Example:

+

+

1
+
backend->SetFrame();

+

+
+

ShowText

+ +

ShowText($aFlg=true)

+

+

Caution

+

This is an extension specific to JpGraph. Human readable text is not + part of the official PDF417 standard and hence this is disabled by + default.. There are usually no problems of including this text but it is + not recommended to do so in a production environment. This is mostly + useful when debugging an application and to make it easer to see that + the correct data is encoded as a barcode label.

+

+

+

Purpose:

+

Show human readable text of the encoded data underneath the barcode label.

+

Example:

+

+

%%

+

+
+

SetFont

+ +

SetFont($aFontFam,$aFontStyle,$aFontSize)

+

Purpose:

+

Specify the font for the human readable text underneath the barcode label.

+

Example:

+

+

1
+
$backend->SetFont( FF_ARIAL, FS_NORMAL, 8);

+

+
+
+

Image backend methods

+ +

SetImgFormat

+ +

SetImgFormat($aFormat)

+

Purpose:

+

Specify image format. Possible values are

+

+

  • +

    'auto'

    +
  • +

    'png'

    +
  • +

    'jpeg'

    +
  • +

    'gif'

    +

+

+

Example:

+

+

1
+
$backend->SetImgFormat('jpeg');

+

+
+
+

Postscript backend methods

+ +

+

SetEPS($aFlg=true)

+ +

SetEPS($aFlg=true)

+

Purpose:

+

Format the output as Encapsulated Postcript. This adds a bounding box + information to the output and makes this format suitable to be included in other + postscript files.

+

Example:

+

+

1
+2
+3
+
$encoder = new PDF417Barcode( $columns, $errlevel);
+$backend = PDF417BackendFactory::Create( BACKEND_PS, $encoder); 
+$backend->SetEPS();

+

+
+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch25s08.html b/includes/jpgraph/docs/chunkhtml/ch25s08.html new file mode 100644 index 0000000..05de6b9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch25s08.html @@ -0,0 +1,265 @@ +Example scripts

Example scripts

+ +

The following section shows some example scripts that can serve as starting points for + further development.

+

Showing human readable text

+ +

+

Example 25.5. Showing human readable text (pdf417_ex3.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 2;    // Height factor (=2)
+$showtext = false;  // Show human readable string
+ 
+// Create a new encoder and backend to generate PNG images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


Figure 25.12. Showing human readable text (pdf417_ex3.php)

Showing human readable text (pdf417_ex3.php)


+

+
+

Altering colors

+ +

+

Example 25.6. Changing colors (pdf417_ex4.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 2;    // Height factor (=2)
+$showtext = true;  // Show human readable string
+ 
+try {
+    // Create a new encoder and backend to generate PNG images
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+ 
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->SetColor('black','yellow');
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


Figure 25.13. Changing colors (pdf417_ex4.php)

Changing colors (pdf417_ex4.php)


+

+
+

Creating postscript output

+ +

+

Example 25.7.  (pdf417_ex5.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 0.8;// Setup module width (in PS points)
+$height = 3;    // Height factor (=2)
+$showtext = true;  // Show human readable string
+ 
+try {
+    // Create a new encoder and backend to generate PNG images
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_PS,$encoder);
+ 
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->SetColor('black','yellow');
+    $output = $backend->Stroke($data);
+    echo nl2br(htmlspecialchars($output));
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


+

+
+

Manually selecting compaction schema

+ +

Purpose:

+

To show how to manually specify the compaction schema to be used for the input + data. The example below shows how to manually specify when to use numeric and when + to use text mode.

+

+

Example 25.8.  (pdf417_ex6.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data1 = '12345';
+$data2 = 'Abcdef';
+$data3 = '6789';
+ 
+// Manually specify several encodation schema
+$data = array(
+    array(USE_NC,$data1),
+    array(USE_TC,$data2),
+    array(USE_NC,$data3));
+ 
+//$data = "12345Abcdef6789";
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$modwidth = 2;  // Use 2 pixel module width
+$errlevel = 2;  // Use error level 2
+$showtext = true;  // Show human readable string
+ 
+try {
+    // Create a new encoder and backend to generate PNG images
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+ 
+    $backend->SetModuleWidth($modwidth);
+    $backend->NoText(!$showtext);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>


Figure 25.14.  (pdf417_ex6.php)

(pdf417_ex6.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch26.html b/includes/jpgraph/docs/chunkhtml/ch26.html new file mode 100644 index 0000000..e4d68b9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch26.html @@ -0,0 +1,476 @@ +Chapter 26. Datamatrix (2D-Barcode)

Chapter 26. Datamatrix (2D-Barcode)

+ +

Principle of Datamatrix Barcodes

+ +

Datamatrix (or Data Matrix) is a high density 2 dimensional barcode that can encode up + to 3116 characters from the entire 256 byte ASCII character set. Compared with DF417 + barcode symbology the datamatrix barcode belongs to newer family of 2 dimensional + barcodes that makes better use of both dimensions and thus can achieve higher data + capacity than the PDF417 symbology (~3kB vs ~2kB). The symbol is built on a square grid + which have a finder pattern around the edges of the symbol to allow a scanner to + identify the barcode. The finder pattern makes it possible to read the barcode + regardless of the physical orientation of the code.

+

In the same way as with other 2 dimensional barcodes the datamatrix code includes + error correction capability in order to be resilient towards physical damages of a code. + Originally data matrix used an older convolutional error correction schema (ECC) but + that has later been changed to use a Reed-Solomon type of error correction which is much + more efficient. The older ECC version is known as ECC 000 to ECC 140 and should be + considered obsolete and should not be used in new applications.

+

The newer error correction schema (with Reed-Solomon codes) is known as ECC 200 schema + and is the current and recommended schema. By default the library will use the newer + schema but support also exists for legacy applications to use the older ECC schema. (See + ??)

+

Figure 26.1. Datamatrix structure. shows the principle of a Datamatrix + barcode.

+

+

Figure 26.1. Datamatrix structure.

+ +

The image shows an annotated Datamatrix where the finder and synchronization + patterns have been highlighted.

+
Datamatrix structure.
+


+

+

Even though it is primarily designed to handle the the Western alphabet (ISO-8859/x + code tables) it will support user prepared Unicode characters through the use of the + "Extended Channel Interpretation" (ECI) mechanism. However description of the ECI + standard is out of scope for this manual and the interested reader are referred to the + official ECI standard document.

+

Datamatrix standard has been adopted by (among others) "The American National + Standards Institute" (ANSI) as a standard symbology and a number of industry standard + associations (e.g. EIA, SEMI, AIAG, ATA) where it has been recommended for use.

+

Summary of features offered in the library

+ +

The following list summarizes the features that the library offers for Datamatrix + barcodes. Some of the terms used here assumes familiarity with Datamatrix barcodes. + All terms are also described in the remainder of this chapter.

+

+

  • +

    Supports both the new ECC 200 variant and the older ECC 140

    +
  • +

    Output formats

    +

    +

    1. +

      Image

      +
    2. +

      Postscript

      +
    3. +

      ASCII

      +

    +

    +
  • +

    Supports all recommended encodation formats

    +

    +

    1. +

      ASCII

      +
    2. +

      C40

      +
    3. +

      BASE256

      +
    4. +

      Text

      +
    5. +

      X12

      +

    +

    +
  • +

    Supports all specified symbol sizes

    +
  • +

    Supports both auto and user selectable encodation

    +
  • +

    Supports both auto and user selectable symbol size

    +
  • +

    Supports user specified module size

    +
  • +

    Supports custom color specification (foreground, background)

    +
  • +

    Supports user specified quiet zone

    +
  • +

    Supports easy handling of non-printable characters through the use of + special escape sequences ("Tilde" - processing)

    +
  • +

    Supports concatenated symbols

    +
  • +

    Symbols can be written directly to a file or sent back as an image to + the browser

    +

+

+
+

Limitation of the JpGraph Datamatrix implementation

+ +

This version of the library does not support the EDIFACT compaction standard due + to the very specialized and limited use of this encodation schema.

+
+

Datamatrix standard

+ +

Datamatrix as a standard is fully described in the ISO/IEC 16022E International + Standard and is available for purchase from the ISO Standard Organization.

+

Additional information about Data Matrix code is available in the following United + States patents: 4,939,354; 5,053,609; 5,124,536. See US patent + Office for full disclosures of these patents.

+
+

Structure of Data Matrix codes

+ +

Datamatrix is a two-dimensional symbology in the shape of a rectangle. The size + and shape of the symbol is usually chosen either automatically or by the user. + Usually it is chosen to be the smallest size that will have enough data capacity to + encode the given data. The symbol rectangle is build up by square dots whose size + "the module" is also user specified.

+

The Data Matrix symbol rectangle comes in two basic shapes.

+

+

  1. +

    It is either a square between the sizes of 10x10 up to 144x144 modules + in even steps

    +
  2. +

    It is a rectangle between the size of 8x16 up to 16x48

    +

+

+

Examples of the two basic shapes are shown in Figure 26.2. Datamatrix - Square symbol shape and Figure 26.3. Datamatrix - Rectangle symbol shape

+

+

+
+

Figure 26.2. Datamatrix - Square symbol shape

+ +
Datamatrix - Square symbol shape
+

+
+

Figure 26.3. Datamatrix - Rectangle symbol shape

+ +
Datamatrix - Rectangle symbol shape
+

+
+

+

+

The maximum capacity for Data Matrix codes is up to 3116 numeric characters or up + to 2335 alphanumeric characters or up to 1555 bytes of binary information.

+

The exact number of characters that can fit in a Data Matrix symbol depends on the + actual encoding (or compaction) schema used. In short this is used to more + efficiently encode ASCII characters to fit more data into a fixed number of bytes. + For example if only numeric data is to be encoded then instead of using one byte to + hold each digit two digits is stored in a single byte hence doubling the amount of + data that can be stored in a given number of bytes.

+

To encode data into a Datamatrix symbol the following (principal) steps are + taken.

+

+

  1. +

    The input string (which can be any ASCII values between 0-255) is + encoded using the selected encoding or encodings (it is possible to + switch encoding mid-way through the string). The primary purpose of the + encoding is to compress the data into a much shorter form.

    +
  2. +

    If needed the data is padded to fill up to the capacity of the + selected symbol size.

    +
  3. +

    Once the string has been encoded (and possible padded) a number of + error correcting code words are added so that the data can be recovered + even if part of the printed symbol have been destroyed (perhaps a corner + has been teared off).

    +
  4. +

    Finally the encoded data and the error correcting words are placed in + the symbol according to an algorithm specified in the standard. This is + done by placing each bit of every data byte in a specific position in + the data matrix symbol.

    +

+

+

The above explanation is by necessity simplified and for those interested into the + specific details we refer to the official standard. It is also possible to review + the code itself to understand the details.

+
+

Encodation efficiency

+ +

As explained in the previous section several compaction schema are used to encode + the data to enable more data to fit in a given symbol. Depending on the actual data + there are several compaction schema that can be used in order to achieve the + greatest possible compression. The standard specifies six different schema. The + compaction efficiency are given in Table 26.1. Datamatrix encodation efficiency.

+

Depending on the application the user of the library may chose to either select a + fixed encodation mode but it is usually best to let the library automatically select + a combination of encodation schema that will give the smallest possible symbol + size.

+

+

Table 26.1. Datamatrix encodation efficiency

+ +
+

Encodation schema

+
+

Characters

+
+

Bits per character

+
ASCII

Double digit numerics

+

ASCII 0-127

+

Extended ASCII 128-255

+

4

+

8

+

16

+
C40Primarily upper-case alphanumeric5.33
TextPrimarily lower-case alphanumeric5.33
X12ANSI X12 EDI data set5.33
EDIFACTASCII values 32-946
Base 256All byte values 0-2558
+


+

+
+

More on ECC Datamatrix subsets

+ +

As was mentioned in the introduction there are two main subsets of Datamatrix + symbols. Those using convolutional codes for error correction which were used for + most of the initial installations of Datamatrix systems, these earlier versions are + referenced as ECC-000 to ECC-140 (the number specifies the level of convolutional + error correcting code).

+

This first subset will be commonly referred to as ECC-140 in the remainder of + this manual.

+

The second subset is referenced ECC-200 and uses Reed-Solomon error correction + techniques. The two subsets have the following characteristic:

+

+

  1. +

    ECC-000 to ECC-140 symbols all have an odd number of modules along + each square side.

    +
  2. +

    ECC-200 symbols have an even number of modules on each side. ECC-200 + can have non-square symbol sizes.

    +

+

+

Hence the type of encoding used is auto-discriminative. The maximum data capacity + of an ECC-200 symbol is 3116 numeric digits, or 2335 alpha numeric characters, in + the largest 144 modules square symbol.

+

Even though the library supports the creation of both type of Datamatrix symbols + it is recommended that all new applications uses the more modern ECC-200 subset. + This is also the recommendation in the standard. ECC-140 should only be used in + legacy system where old equipment is used which have not be upgraded to handle the + modern ECC-200 subset.

+
+

Symbology Data capacity

+ +

As was mentioned in the previous section the actual data capacity depends on the + symbol size. By default the library will select the smallest possible symbol size + that will encode a given character string with the chosen encoding (possibly + automatic). Table 2 below gives the maximum capacity for the three most common + encoding schema for each symbol size as well as robustness in each symbol specified + as the number of errors (destroyed data) that can be recovered.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 26.2. Maximum data capacity for the different symbol sizes in ECC-200 Data + Matrix subset.
SizeNumeric capacityAlphanumeric capacityBinary capacityMax Correctable Error/Erasure
10 x 106312
12 x 1210633
14 x 14161065/7
16 x 162416106/9
18 x 183625167/11
20 x 204431209/15
22 x 2260432810/17
24 x 2472523412/21
26 x 2688644214/25
32 x 32124916018/33
36 x 361721278421/39
40 x 4022816911224/45
44 x 4428821414228/53
48 x 4834825917234/65
52 x 5240830420242/78
64 x 6456041827856/106
72 x 7273655036672/132
80 x 8091268245496/180
88 x 881152862574112/212
96 x 9613921042694136/260
104 x 10416321222814168/318
120 x 120210015731048204/390
132 x 132260819541302248/472
144 x 144311623351556310/590
8 x 1810633
8 x 32201385
12 x 263222147/11
12 x 364431209/15
16 x 3664463012/21
16 x 4898724714/25
+

+
+
+ + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch26s02.html b/includes/jpgraph/docs/chunkhtml/ch26s02.html new file mode 100644 index 0000000..02efb80 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch26s02.html @@ -0,0 +1,641 @@ +Creating barcodes

Creating barcodes

+ +

In order to use datamatrix barcodes the module + "datamatrix/datamatrix.inc.php" must first be included.

+

Usage of Datamatrix barcodes follows a similar schema as for the linear and PDF417 + barcodes with concepts of an encoder and backend. The principle of the overall + encodation process is shown in Figure 26.4. Datamatrix encodation principle

+

Figure 26.4. Datamatrix encodation principle

+ +
Datamatrix encodation principle
+

+

Getting started

+ +

Assuming that the library is installed where it can be found by PHP it is now very + simple to create a basic Data Matrix symbol using just default values. We first show + the complete first example and then discuss it. In the following scripts we will + assume that the include path has the core JpGraph directory in its path.

+

All barcode creation follows the following basic three steps :

+

+

  1. +

    Create an instance of the encoder with the chosen datamatrix layout as + an instance of class Datamatrix

    +
  2. +

    Create an instance of a suitable backend for the chosen output format + (image or postscript) by calling the + DatamatrixBackenFactory::Create()

    +
  3. +

    Encode data and send it back to the browser or to a file with a call + to the backend Backend::Stroke() method.

    +

+

+

The following script shows how to create the simplest possible barcode (in PNG + format) representing the data string "The first datamatrix" encoded + using all default values. The resulting barcode is shown in Figure 26.5. The simplest possible datamatrix script (datamatrix_ex00.php)

+

+

Example 26.1. The simplest possible datamatrix script (datamatrix_ex00.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'The first datamatrix';
+ 
+$encoder = DatamatrixFactory::Create();
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->Stroke($data);
+?>


Figure 26.5. The simplest possible datamatrix script (datamatrix_ex00.php)

The simplest possible datamatrix script (datamatrix_ex00.php)


+

+

(As can be seen this follows the same principles as the creation of PDF417 + symbols)

+

The principle is the same for all type of data matrix symbol creations. We first + create an instance of the chosen encoder. In this case a standard ECC-200 encoder by + creating an instance of class Datamatrix. We then create a suitable + backend that handles the output of the barcode. By default the output will be an + image encoded in the PNG image format.

+

The final step is to send back the generated image to the browser with a call to + the method Backend::Stroke() with the data to be encoded as its first + argument.

+

The example above does not have any error handling. If there is some error in the + process an exception will be thrown in the same way as in other places in the + library. The default exception will display a standard library image error box. An + example of this is shown in Figure 26.6. Datamatrix error image.

+

Figure 26.6. Datamatrix error image

+ +
Datamatrix error image
+

+

If some additional processing is necessary and just display a text based + re-formatted error message we could change the above code to catch this exception as + the following example shows.

+

+

Example 26.2. Datamatrix with basic error handling (datamatrix_ex0.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'The first datamatrix';
+$encoder = DatamatrixFactory::Create();
+$encoder->SetEncoding(ENCODING_ASCII);
+$backend = DatamatrixBackendFactory::Create($encoder);
+ 
+// We increase the module width to 3 pixels
+$backend->SetModuleWidth(3);
+ 
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    echo 'Datamatrix error: '.$e->GetMessage()."\n";
+    exit(1);
+}
+?>


Figure 26.7. Datamatrix with basic error handling (datamatrix_ex0.php)

Datamatrix with basic error handling (datamatrix_ex0.php)


+

+

In contrast to the PDF417 encodation process there is no option to select an level + of error correction. The error correction level is automatically specified in the + standard depending on the size of the barcode. As a final initial example the next + script uses the backend method Backend::SetModuleWidth($aWidth) to + increase the width of one module.

+

+

Example 26.3. Datamatrix with modified module width (datamatrix_ex1.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = '123456';
+ 
+$encoder = DatamatrixFactory::Create();
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->SetModuleWidth(3);
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>


Figure 26.8. Datamatrix with modified module width (datamatrix_ex1.php)

Datamatrix with modified module width (datamatrix_ex1.php)


+

+
+

Error handling

+ +

As in other parts of the library the Datamatrix module throws an exception when an + error occurs. As shown in the previous section an error image is the default if no + explicit try {} catch {} statement is added to the script.

+

The script below shows how to catch the error, do some possible clean up and then + explicitly create and send back the error image.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+...
+try {
+    $backend->Stroke($data);
+} catch( Exception $e ) {
+    doCleanup();
+    $errobj = new DMErrObjectImg();
+    $errobj->Raise($e->getMessage());    
+}
+?>

+

+

another variant of this would be to re-throw the exception after the cleanup has + been performed as the following example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+...
+try {
+    $backend->Stroke($data);
+} catch( Exception $e ) {
+    doCleanup();
+    throw $e;
+}
+?>

+

+

It is also possible to get hold of the internal error code that corresponds to + each error message by calling the PHP standard exception method + Exception::getCode() as the following example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+...
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    $errcode = $e->GetCode();
+    echo "Datamatrix error ($errcode). Message: $errstr\n";
+}
+?>

+

+

Table 26.3. Datamatrix error messages lists the errors that can be + thrown by the datamatrix module (the table deliberately excludes internal error + messages).

+

+

Table 26.3. Datamatrix error messages

+ +
Error numberError messages
-1Data is too long to fit specified symbol + size
-2The BASE256 data is too long to fit + available symbol size
-3Data must have at least three characters + for C40 encodation
-4Data must have at least three characters + for TEXT encodation
-8The given data can not be encoded using X12 + encodation.
-9The "tilde" encoded data is not + valid.
-10Data must have at least three characters + for X12 encodation
-11Specified data can not be encoded with + datamatrix 000 140
-12Can not create image
-13Invalid color specification
-15This PHP installation does not support the + chosen image encoding format
-20The specification for shape of matrix is + out of bounds (0,29)
-21Cannot open the data file specifying bit + placement for Datamatrix 200
-22Datafile for bit placement is corrupt, crc + checks fails.
-26Cannot open the data file specifying bit + placement for Datamatrix 140
-30The symbol size specified for ECC140 type + Datamatrix is not valid
-31Data is too long to fit into any available + matrix size for datamatrix 140
-34Cannot open file %s for writing.
-35Cannot write to file %s .
-99EDIFACT encodation not implemented
-100 +

Datamatrix Error: HTTP headers have already been + sent.

+

Caused by output from file %s at line %d

+

Explanation: HTTP headers have already been sent back to + the browser indicating the data as text before the library + got a chance to send it's image HTTP header to this browser. + This makes it impossible for the Datamatrix library to send + back image data to the browser (since that would be + interpretated as text by the browser and show up as junk + text).

+

Most likely you have some text in your script before the + call to DatamatrixBackend::Stroke().

+

If this texts gets sent back to the browser the browser + will assume that all data is plain text. Look for any text + (even spaces and newlines) that might have been sent back to + the browser.

+

For example it is a common mistake to leave a blank line + before the opening "<?php"

+
+


+

+
+

Encodation options

+ +

The primary encodation option is to manually specify the shape of the Datamatrix + barcode. By default the symbol size will be chosen as the smallest possible. However + some application require that usage of a fixed size symbol shape.

+

The available shapes are listed in Table 26.2. Maximum data capacity for the different symbol sizes in ECC-200 Data + Matrix subset.. The wanted shape is specified when + the instance of the encoder is created or by a call to + Datamatrix::SetSize(). The shape is specified by a symbolic + constant that corresponds to each available shape in Table 26.2. Maximum data capacity for the different symbol sizes in ECC-200 Data + Matrix subset.. The symbol name is + "DMAT_<H>x<W>" where <H> is the height (in + modules) and <W> is the width (in modules). For example the + following line specifies a 24 module square symbol

+

+

1
+
$encoder->SetSize(DMAT_24x24);

+

+

In addition to the sizes specified in Table 26.2. Maximum data capacity for the different symbol sizes in ECC-200 Data + Matrix subset. there is also an option to specify + automatic sizing (which is the default). The following script sets the sizing to be + automatic.

+

+

1
+
$encoder->SetSize(DMAT_AUTO);

+

+

As was discussed in Encodation efficiency there are + several ways by which data can be encoded. By default the encoder will use an + optimal algorithm to create a combination of the available encodation schema to + create the smallest possible symbol. In some application it might however be stated + that a specific encodation method should be chosen.

+

The encoding method is a property of the encodation class and is set with a call + to

+

+

  • +

    Datamatrix::SetEncoding($aEncoding=ENCODING_ASCII) +

    +

+

+

The encoding is specified as one of the symbolic constants shown in Table 26.4. Datamatrix encodation schemas

+

Table 26.4. Datamatrix encodation schemas

+ +
Symbolic constantEncoding schemaCharacter set
ENCODING_AUTO--An optimal combination of all encodation schema
ENCODING_ASCIIASCIIMost efficient for numeric data
ENCODING_C40C40Primarily upper-case alphanumeric
ENCODING_TEXTTextPrimarily lower-case alphanumeric
ENCODING_X12X12ANSI X12 EDI data set
ENCODING_EDIFACTEDIFACTASCII values 32-94
ENCODING_BASE256Base 256All byte values 0-255
+

+

The following example sets the ASCII encodation schema

+

+

1
+
$encoder->SetEncoding(ENCODING_ASCII);

+

+

The default automatic encoding is the same as

+

+

1
+
$encoder->SetSize(ENCODING_AUTO);

+

+
+

Processing special input characters

+ +

In order to allow the specification of special input data in normal ASCII + encodation for easy entering from a keyboard the library supports what is commonly + known as "tilde" processing. When this is enabled (it is disabled by default) + certain character sequences that begins with a tilde sign (i.e. "~") will be + translated to a special ASCII value that cannot normally be entered from a + keyboard.

+

When tilde mode is enabled with a call to the method

+

+

  • +

    Datamatrix::SetTilde($aFlg=true)

    +

+

+

Table 26.5. Tilde processing translating lists the translations + that will then be enabled on the input data. Some of the translations are technical + and requires full understanding of Datamatrix standard to be used.

+

Table 26.5. Tilde processing translating

+ +
Input sequenceTranslation
~X : where 'X' is a character in the range [@-Z]Translates to ASCII value 0-25, i.e. ~@==0, ~A==1, ~B==2 , + ...
~1Represents the character FNC1. Alternate Data Type Identifier. + See Table 6: ISO 16022
~2nnmmfffggg +

Structured Append. This code is only allowed in the first + position of the data. Up to 16 ECC 200 symbols may be appended + in a structured format. The structured append is specified with + symbol index, total number of symbols and a file identification.

+

The first two values "nn" is the position of this particular + symbol specified as two digits in the range of 01-16.

+

The second two values "mm" is the total number of symbols in + this structured append in the range 02-16 specified as two + digits.

+

The last two 3 digit codewords are the file identification + specified with digits and necessary leading 0:s to make it a + full three digits. For example. Assume that we want to encode + the 4:th symbol from a total of 9 symbols and with the file + identification "0,1". This would then be encoded as + "~20409000001". Note: Internally this is translated to three + codewords with the reserved starting codeword of ASCII + 233.

+
~5 and ~6 +

The special 05 and 06 Macros. Can only be in the first + position and is used to encode industry standard headers in + certain structured formats.

+

Macro 05 is translated by the barcode reader to : Symbol + prefix: chr(30) chr(05) chr(29) Symbol postfix: chr(30) chr(04) + Macro 06 is translated by the barcode reader to : Symbol prefix: + chr(30) chr(06) chr(29 Symbol postfix: chr(30) chr(04)

+
~7nnnnnn +

Extended Channel Interpretation (ECI) nnnnnn.

+

The ECI protocol allows the output data stream to have + interpretations different from that of the default character + set. See "Extended Channel + Interpretation Assignments" document (available + from ISO) for a list of channels and there meaning.

+

The ECI is identified by a 6-digit number which is encoded + according to Table 10: in the ISO 16022:2000 specification. This + is the encodation that is used for the "~7" tilde specification + of the ECI protocol.

+
~9 +

Send the special control code (ASCII=234) so that the reader + will interpret the rest of the symbol as a bar code reader + programming instruction.

+
~dnnn +

Character value as 3 digits, i.e. ~d142 means ASCII value + 142

+
+

+
+

Creating different backends

+ +

In order to create the actual output one or more backends must be created. The + Datamatrix supports the following backends:

+

+

  • +

    BACKEND_IMAGE, Create an image backend. This is the + default backend if no explicit backend is specified.

    +
  • +

    BACKEND_PS, Create a postscript backend. The text string + that represents the postscript for the barcode is returned directly from + the Backend::Stroke()

    +
  • +

    BACKEND_EPS, Create an encapsulated postscript + backend

    +
  • +

    BACKEND_ASCII, This is a special backend which will + generate an ASCII rendering of the datamatrix barcode. This is mostly + practical for technical investigations regarding the technical structure + of a Datamatrix barcode.

    +

+

+

The following code snippet shows two ways of creating a barcode image + backend.

+

+

1
+2
+
// Create an image backend
+$backend = DatamatrixBackendFactory::Create($encoder);

+

+

+

1
+2
+
// Create an image backend
+$backend = DatamatrixBackendFactory::Create($encoder, BACKEND_IMAGE);

+

+

The following code shows a complete script to generate a postscript output

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+$data = '0123456789';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create();
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder, BACKEND_PS);
+try {
+    $ps_txt = $backend->Stroke($data);
+    echo '<pre>'.$ps_txt.'</pre>';
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+?>

+

+
+

Generic backend methods

+ +

The following methods are available to adjust the final look and feel of the + barcode

+

+

  1. +

    Backend::SetColor($aOne, $aZero, + $aBackground='white')

    +

    the color of the 'black' and 'white' modules in the barcode and the + quiet area around the barcode

    +
  2. +

    Backend::SetQuietZone($aSize)

    +

    the size of the "quiet zone" in pixels for the image backend and in + points (1 pt = 1/72 inch) for the postscript backend

    +
  3. +

    Backend::SetModuleWidth($aWidth)

    +

    the module width specified in pixels for the image backend and in + points (1 pt = 1/72 inch) for the postscript backend

    +
  4. +

    Backend::Stroke($aData, $aFileName='')

    +

    create the barcode and send it back the client or store it to a file + if the second parameter is set. For postscript backends the postscript + string is returned directly from the method. (See example above)

    +

+

+
+

Image backend methods

+ +

For the image backend it is possible to adjust the image encoding format with the + following method

+

+

  1. +

    Backend::SetImgFormat($aFormat,$aQuality=75)

    +

    Specify image format. Possible values are

    +

    +

    • +

      'auto'

      +
    • +

      'png'

      +
    • +

      'jpeg'

      +
    • +

      'gif'

      +

    +

    +

    For 'jpeg' format the quality parameter is a number in range [1-100] + and specified how much compression / (Data loss) should be used. 100=no + compression. Normal values are in the range [60-95]

    +

    The following example sets the image format to 'JPEG' with quality + 80.

    +

    +

    1
    +
    $backend->SetImgFormat('jpeg', 80);

    +

    +

+

+
+

Postscript backend format options

+ +

For postscript backend it is possible to select whether the postscript should be + generated as encapsulated postscript. This is controlled by the method

+

+

  • +

    Backend::SetEPS($aFlg=true)

    +

+

+
+

A template to create barcodes

+ +

In the example directory in the distribution + ('datamatrix/examples') you can find many more examples on + how to create barcodes. As a good start the following (simple) template may be used + as a base for further customizations.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = '0123456789';
+ 
+$shape       = DMAT_AUTO;
+$encoding    = ENCODING_AUTO;
+$modulewidth = 3;
+$quietzone   = 10;
+$color1      = 'black';
+$color0      = 'white';
+$colorq      = 'white';
+$outputfile  = '';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create($shape);
+$encoder->SetEncoding($encoding);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+ 
+// By default the module width is 2 pixel so we increase it a bit
+$backend->SetModuleWidth($modulewidth);
+ 
+// Set Quiet zone
+$backend->SetQuietZone($quietzone);
+ 
+// Set other than default colors (one, zero, quiet zone/background)
+$backend->SetColor($color1, $color0, $colorq);
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data,$outputfile);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+?>

+

+
+

Sample application

+ +

As an example the library includes a WEB-based demo barcode creation application. + This application can be used to easily create barcode through it's WEB interface. It + is available at 'datamatrix/demoapp/index.html'

+

This application is primarily included as a demo on the features available in the + library and not as a finalized product.

+

Figure 26.9. Datamatrix WEB-based demo application shows a screen shot of the + application interface.

+

Figure 26.9. Datamatrix WEB-based demo application

+ +
Datamatrix WEB-based demo application
+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch26s03.html b/includes/jpgraph/docs/chunkhtml/ch26s03.html new file mode 100644 index 0000000..ebac77b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch26s03.html @@ -0,0 +1,263 @@ +Example script

Example script

+ +

Example 1 - Setting the shape

+ +

The following example shows how to

+

+

  • +

    Set the shape to 64x64

    +
  • +

    Use ASCII encoding

    +
  • +

    Adjust the quiet zone

    +

+

+

+

Example 26.4. Datamatrix example, setting quiet zone and ASCII encoding (datamatrix_ex4.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'This is a 64x64 datamatrix symbol';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create(DMAT_64x64);
+$encoder->SetEncoding(ENCODING_TEXT);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->SetModuleWidth(3);
+ 
+// Adjust the Quiet zone
+$backend->SetQuietZone(10);
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>


Figure 26.10. Datamatrix example, setting quiet zone and ASCII encoding (datamatrix_ex4.php)

Datamatrix example, setting quiet zone and ASCII encoding (datamatrix_ex4.php)


+

+
+

Example 2 - Writing to a file

+ +

The following example shows how to generate a barcode and write it to a + file.

+

+

Example 26.5. Datamatrix example, writing to a file (datamatrix_ex6.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'This is a datamatrix symbol';
+ 
+$outputfile = 'dm_ex6.png';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create();
+$encoder->SetEncoding(ENCODING_TEXT);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->SetModuleWidth(5);
+$backend->SetQuietZone(10);
+ 
+// Set other than default colors (one, zero, background)
+$backend->SetColor('navy','white');
+ 
+// Create the barcode from the given data string and write to output file
+$dir = dirname(__FILE__);
+$file = '<span style="font-weight:bold;">"'.$dir.'/'.$outputfile.'"</span>';
+try {
+    $backend->Stroke($data,$outputfile);
+    echo 'Barcode sucessfully written to file: '.$file;
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    $errcode = $e->GetCode();
+    echo "Failed writing file: ".$file.'<br>';
+    echo "Datamatrix error ($errcode). Message: $errstr\n";
+}
+ 
+?>


+

+
+

Example 3 - Creating postscript output

+ +

The following example shows hot to generate a postscript output.

+

When

+

+

Example 26.6. Datamatrix example, creating postscript output (datamatrix_ex7.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'A Datamatrix barcode';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create();
+$encoder->SetEncoding(ENCODING_BASE256);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder, BACKEND_ASCII);
+$backend->SetModuleWidth(3);
+ 
+try {
+    $ps_txt = $backend->Stroke($data);
+    echo '<pre>'.$ps_txt.'</pre>';
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>


+

+

The resulting output is shown in Figure 26.11. Datamatrix postscript output below

+

Figure 26.11. Datamatrix postscript output

+ +
Datamatrix postscript output
+

+
+

Example 4 - Changing background color

+ +

The following example shows how to modify the colors in the barcode.

+

+

Example 26.7. Datamatrix example, changing colors (datamatrix_ex5.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'This is a 20x20 symbol';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create(DMAT_20x20);
+$encoder->SetEncoding(ENCODING_TEXT);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+ 
+// By default the module width is 2 pixel so we increase it a bit
+$backend->SetModuleWidth(4);
+ 
+// Set Quiet zone
+$backend->SetQuietZone(10);
+ 
+// Set other than default colors (one, zero, quiet zone/background)
+$backend->SetColor('navy','white','lightgray');
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>


Figure 26.12. Datamatrix example, changing colors (datamatrix_ex5.php)

Datamatrix example, changing colors (datamatrix_ex5.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch27.html b/includes/jpgraph/docs/chunkhtml/ch27.html new file mode 100644 index 0000000..d99ce80 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch27.html @@ -0,0 +1,1621 @@ +Chapter 27. QR (2D-Barcode)

Chapter 27. QR (2D-Barcode)

+ +

Principle of QR Barcodes

+ +

Note

This module is only available in the pro-version of the library.

+

QR is currently the highest capacity general two-dimensional matrix symbology + available (up to ~7Kb numeric data can be encoded) and it is designed to encode the full + 256 byte ASCII character set as well as the Kanji (Shift-JIS character set). QR code + belongs to the modern 2 dimensional codes that is designed for both high capacity as + well as to be efficient for scanner equipment to process and this is also the reason for + its name - Quick Response code.

+

An advantage with QR code is also there relatively small size for a given amount of + information

+

The QR code is available in 40 different square sizes each with a user selectable + error correction level in four steps (referred to as error correction level L,M,Q and + H). With the highest level of error correction used up to ~30% of the codewords can be + damaged and still be restored.

+

QR code is extensively used in some Asian countries and is finding more an more usage + to transfer medium sized information onto mobile phones where the QR codes are + interpretated by first taking a photo of the barcode with the mobile and then running a + QR decoding program on the cell phone. This has currently become the most expansive + usage of QR codes and some mobile manufactures are providing software to aid in + interpreting QR codes for free.

+

+

Note

+

QR codes are also finding there way into public information sharing. For + example in Texas in US some cities are using QR codes to display public + information.

+

+

+

+

Note

+

QR Codes can be freely used without royalties. QR Codes are copyrighted + by:

+

+ DENSO WAVE NCORPORATED.

+

+

+

In Figure 27.1. QR Code high level structure we have amended a large version of + a basic QR code. In this figure the special finding patterns and timing patterns have + been highlighted in red and blue.

+

Figure 27.1. QR Code high level structure

+ +
QR Code high level structure
+

+

The images below shows some real-life creative use of QR barcodes.

+

+

Figure 27.2. Creative usage of QR Barcodes

+ +
+
Creative usage of QR BarcodesCreative usage of QR BarcodesCreative usage of QR Barcodes
+
+


+

+

Summary of library features

+ +

+

  • +

    Output format

    +

    +

    1. +

      Image format

      +
    2. +

      Postscript and encapsulated postscript

      +
    3. +

      ASCII

      +

    +

    +
  • +

    Encodation formats

    +

    +

    1. +

      Numeric

      +
    2. +

      Alphanumeric

      +
    3. +

      Binary

      +

    +

    +
  • +

    Supports all specified symbol sizes

    +
  • +

    Supports both auto and user selectable encodation

    +
  • +

    Supports both auto and user selectable symbol size

    +
  • +

    Supports user specified module size

    +
  • +

    Supports custom color specification (foreground, background)

    +
  • +

    Symbols can be written directly to a file or sent back as an image to + the browser

    +

+

+
+

Limitation in the JpGraph QR implementation

+ +

This implementation is a faithful implementation of the ISO/IEC 18004E + International Standard with one important exception. Version 1.0 does not support + the encoding of 2 byte Shift-JIS character set. This means that two byte Kanji can + only be encoded using binary data format which is less efficient than the native + Kanji encoding.

+

+

Caution

+

The computational complexity of the encodation process makes QR code + generation slightly slower than both PDF417 and Datamatrix. The technical + reason for most of the time is the final necessary evaluation of a bitmap + mask which is chosen to give as close to 50% mix of black and white areas in + the code as possible. Unfortunately this evaluation take time proportional + to the square of the size of the matrix. This time can be noticeable when + using "large" symbol sizes. There are existing QR code libraries that cheat + on this final step and just randomly selects a bit mask to avoid this + computational intensive evaluation. This is also the cause for the visual + difference between this libraries final result and some other.

+

In this case we claim that this library implements the proper standard + much more faithfully than some other libraries that exists.

+

+

+
+

QR Standard

+ +

The QR code standard is fully described in the ISO/IEC 18004E International + Standard and is available for purchase from the ISO Standard Organization. for a nominal fee.

+
+

Structure and capacity of QR barcodes

+ +

All QR barcode have square layout made up of equal spaced square modules. + Depending on the size of the QR code a certain number of finder patterns are + included in the code to aid in scanner decoding. The standard specifies 40 versions + (sizes) of the QR code from the smallest 21x21 up to 177x177 modules in size.

+

Examples of two basic QR codes are shown in Figure 27.3. A small sized QR Code (version=2) and Figure 27.4. A medium sized QR code (version=13)

+

+

+
+

Figure 27.3. A small sized QR Code (version=2)

+ +
A small sized QR Code (version=2)
+

+
+

Figure 27.4. A medium sized QR code (version=13)

+ +
A medium sized QR code (version=13)
+

+
+

+

+

Depending on the actual data there are several compaction schema that can be used + in order to achieve the greatest possible compression. The standard specifies four + different principal schema, Numeric, Alphanumeric, Binary and Kanji.

+

Depending on the application the user of the library may chose to either select a + fixed encodation mode or let the library automatically chose the most efficient + encodation method. It is usually best to let the library automatically select a + combination of encodation schema that will give the smallest possible symbol size.

+

The maximum capacity for QR codes dependent on the encodation schema (using the + lowest possible error correction overhead) are given in Table 27.1. QR Data capacity

+

+

Table 27.1. QR Data capacity

+ +
Encoding modeMaximum capacity
Numeric7089 digits (Datamatrix=3116)
Alphanumeric4296 characters (Datamatrix=2335)
Binary2953 (Datamatrix=1555)
Kanji1817 (Datamatrix NA)
+


+

+

The exact number of characters that can fit in a QR symbol depends on the actual + encoding (or compaction) schema used. In short this is used to more efficiently + encode ASCII characters to fit more data into a fixed number of bytes. For example + if only numeric data is to be encoded then instead of using one byte to hold each + digit three digits is stored in 10 bits. Which gives the equivalent capacity that 12 + digits takes only 5 bytes to encode.

+

To encode data into a QR symbol the following principal steps are taken.

+

+

  1. +

    The input string (which can be any ASCII values between 0-255) is + encoded using the selected encoding or encodings (it is possible to + switch encoding mid-way through the string). The primary purpose of the + encoding is to compress the data into a much shorter form.

    +
  2. +

    If needed the data is padded to fill up to the capacity of the + selected symbol size.

    +
  3. +

    Once the string has been encoded (and possible padded) a number of + error correcting code words are added so that the data can be recovered + even if part of the printed symbol have been destroyed (perhaps a corner + has been teared off).

    +
  4. +

    Finally the encoded data and the error correcting words are placed in + the symbol according to an algorithm specified in the standard. This is + done by placing each bit of every data byte in a specific position in + the qr matrix symbol.

    +

+

+

The above explanation is by necessity simplified and for those interested into the + specific details we refer to the official standard. It is also possible to review + the code itself to understand the details.

+
+

QR versions and symbol size

+ +

As mentioned in the previous section the QR standard specifies 40 different sizes + of the QR code and the maximum data capacity will also vary depending on the size. + Table 27.2. Maximum data capacity for the + different symbol sizes in the QR-code. shows the defined sizes and for each + size specifies the possible Error correction levels and the maximum data capacity + depending on the compaction schema used.

+

By default the symbol size will be chosen as the smallest possible. However some + application require that usage of a fixed size symbol. The symbol size is a + parameter of the encodation schema and is adjusted in the creation of the + QREncoder. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 27.2. Maximum data capacity for the + different symbol sizes in the QR-code.
VersionModulesECC LevelData bitsNumericAlphanumericBinaryKanji
121x21L15241251710
M1283420148
Q1042716117
H72171074
2 25x25 L 272 77 47 32 20
M 224 63 38 26 16
Q 176 48 29 20 12
H 128 34 20 14 8
329x29L440127775332
M352101614226
Q27277473220
H20858352415
4 33x33 L 640 187 114 78 48
M 512 149 90 62 38
Q 384 111 67 46 28
H 288 82 50 34 21
537x37L86425515410665
M6882021228452
Q496144876037
H368106644427
6 41x41 L 1,088 322 195 134 82
M 864 255 154 106 65
Q 608 178 108 74 45
H 480 139 84 58 36
745x45L1,24837022415495
M99229317812275
Q7042071258653
H528154936439
8 49x49 L 1,552 461 279 192 118
M 1,232 365 221 152 93
Q 880 259 157 108 66
H 688 202 122 84 52
953x53L1,856552335230141
M1,456432262180111
Q1,05631218913080
H8002351439860
10 57x57 L 2,192 652 395 271 167
M 1,728 513 311 213 131
Q 1,232 364 221 151 93
H 976 288 174 119 74
1161x61L2,592772468321198
M2,032604366251155
Q1,440427259177109
H1,12033120013785
12 65x65 L 2,960 883 535 367 226
M 2,320 691 419 287 177
Q 1,648 489 296 203 125
H 1,264 374 227 155 96
1369x69L3,4241,022619425262
M2,672796483331204
Q1,952580352241149
H1,440427259177109
14 73x73 L 3,688 1,101 667 458 282
M 2,920 871 528 362 223
Q 2,088 621 376 258 159
H 1,576 468 283 194 120
1577x77L4,1841,250758520320
M3,320991600412254
Q2,360703426292180
H1,784530321220136
16 81x81 L 4,712 1,408 854 586 361
M 3,624 1,082 656 450 277
Q 2,600 775 470 322 198
H 2,024 602 365 250 154
1785x85L5,1761,548938644397
M4,0561,212734504310
Q2,936876531364224
H2,264674408280173
18 89x89 L 5,768 1,725 1,046 718 442
M 4,504 1,346 816 560 345
Q 3,176 948 574 394 243
H 2,504 746 452 310 191
1993x93L6,3601,9031,153792488
M5,0161,500909624384
Q3,5601,063644442272
H2,728813493338208
20 97x97 L 6,888 2,061 1,249 858 528
M 5,352 1,600 970 666 410
Q 3,880 1,159 702 482 297
H 3,080 919 557 382 235
21101x101L7,4562,2321,352929572
M5,7121,7081,035711438
Q4,0961,224742509314
H3,248969587403248
22 105x105 L 8,048 2,409 1,460 1,003 618
M 6,256 1,872 1,134 779 480
Q 4,544 1,358 823 565 348
H 3,536 1,056 640 439 270
23109x109L8,7522,6201,5881,091672
M6,8802,0591,248857528
Q4,9121,468890611376
H3,7121,108672461284
24 113x113 L 9,392 2,812 1,704 1,171 721
M 7,312 2,188 1,326 911 561
Q 5,312 1,588 963 661 407
H 4,112 1,228 744 511 315
25117x117L10,2083,0571,8531,273784
M8,0002,3951,451997614
Q5,7441,7181,041715440
H4,3041,286779535330
26 121x121 L 10,960 3,283 1,990 1,367 842
M 8,496 2,544 1,542 1,059 652
Q 6,032 1,804 1,094 751 462
H 4,768 1,425 864 593 365
27125x125L11,7443,5142,1321,465902
M9,0242,7011,6371,125692
Q6,4641,9331,172805496
H5,0241,501910625385
28 129x129 L 12,248 3,669 2,223 1,528 940
M 9,544 2,857 1,732 1,190 732
Q 6,968 2,085 1,263 868 534
H 5,288 1,581 958 658 405
29133x133L13,0483,9092,3691,6281,002
M10,1363,0351,8391,264778
Q7,2882,1811,322908559
H5,6081,6771,016698430
30 137x137 L 13,880 4,158 2,520 1,732 1,066
M 10,984 3,289 1,994 1,370 843
Q 7,880 2,358 1,429 982 604
H 5,960 1,782 1,080 742 457
31141x141L14,7444,4172,6771,8401132
M11,6403,4862,1131,452894
Q8,2642,4731,4991,030634
H6,3441,8971,150790486
32 145x145 L 15,640 4,686 2,840 1,952 1,201
M 12,328 3,693 2,238 1,538 947
Q 8,920 2,670 1,618 1,112 684
H 6,760 2,022 1,226 842 518
33149x149L16,5684,9653,0092,0681,273
M13,0483,9092,3691,6281,002
Q9,3682,8051,7001,168719
H7,2082,1571,307898553
34 153x153 L 17,528 5,253 3,183 2,188 1,347
M 13,800 4,134 2,506 1,722 1,060
Q 9,848 2,949 1,787 1,228 756
H 7,688 2,301 1,394 958 590
35157x157L18,4485,5293,3512,3031,417
M14,4964,3432,6321,8091,113
Q10,2883,0811,8671,283790
H7,8882,3611,431983605
36 161x161 L 19,472 5,836 3,537 2,431 1,496
M 15,312 4,588 2,780 1,911 1,176
Q 10,832 3,244 1,966 1,351 832
H 8,432 2,524 1,530 1,051 647
37165x165L20,5286,1533,7292,5631,577
M15,9364,7752,8941,9891,224
Q11,4083,4172,0711,423876
H8,7682,6251,5911,093673
38 169x169 L 21,616 6,479 3,927 2,699 1,661
M 16,816 5,039 3,054 2,099 1,292
Q 12,016 3,599 2,181 1,499 923
H 9,136 2,735 1,658 1,139 701
39173x173L22,4966,7434,0872,8091,729
M17,7285,3133,2202,2131,362
Q12,6563,7912,2981,579972
H9,7762,9271,7741,219750
40 177x177 L 23,648 7,089 4,296 2,953 1,817
M 18,672 5,596 3,391 2,331 1,435
Q 13,328 3,993 2,420 1,663 1,024
H 10,208 3,057 1,852 1,273 784
+
+

Error correction level

+ +

As shown in Table 27.2. Maximum data capacity for the + different symbol sizes in the QR-code. the QR standard specifies + four different error correction levels. In the library the error correction can + either be set to be chosen automatically or specified manually. The properties of + the available error correction levels are given in Table 27.3. QR Error correction levels. The "Error correction capacity" column specifies how large percentage of + the codewords that can be destroyed and the code still being decoded.

+

+

Table 27.3. QR Error correction levels

+ +
Error levelSymbolic constantError correction capacity
LQRCapacity::ErrL5 %
MQRCapacity::ErrM15 %
QQRCapacity::ErrQ25 %
HQRCapacity::ErrH30 %
+


+

+
+

Comparing the visual output with other QR-generating software

+ +

It is possible that the JpGraph library gives a visually different result than + some other available QR encoders. As a matter of fact many QR encoders gives a + different visual result from the same input. This does not mean that one QR encoder + is more correct than any other. This is a consequence of interpretation of the + standard in a way that (without going into technical details) does not in any way + affect the decoding of the barcode. It only affects the visual appearance.

+
+
+ + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch27s02.html b/includes/jpgraph/docs/chunkhtml/ch27s02.html new file mode 100644 index 0000000..e6933f7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch27s02.html @@ -0,0 +1,796 @@ +Creating barcodes

Creating barcodes

+ +

In order to use QR codes the module "QR/qrencoder.inc.php" must + first be included.

+

Usage of QR codes follows a similar schema as for the linear, PDF417 and Datamatrix + barcodes with the concepts of an encoder and backend. The principle of the overall + encodation process is shown in Figure 26.4. Datamatrix encodation principle

+

Figure 27.5. QR Encodation Process

+ +
QR Encodation Process
+

+

Getting started

+ +

In order to use the QR barcodes the library module + "QR/qrencoder.inc.php" must first be included in the + script.

+

+

  1. +

    Create an instance of the encoder and optionally specify size and + error correction level. The encoder is created as an instance of + class QREncoder

    +
  2. +

    Create an instance of a suitable backend for the chosen output format + (image or postscript) by calling the + DatamatrixBackenFactory::Create()

    +
  3. +

    Encode data and send it back to the browser or to a file with a call + to the backend Backend::Stroke() method.

    +

+

+

The following script shows how to create the simplest possible QR code (in PNG + format) representing the data string "The first QR code" encoded using + all default values. The resulting QR Code is shown in Figure 27.6. The first very basic QR code (qrexample00.php)

+

+

Example 27.1. The first very basic QR code (qrexample00.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data = '01234567';
+ 
+// Create a new instance of the encoder and let the library
+// decide a suitable QR version and error level
+$e=new QREncoder();
+ 
+// Use the image backend (this is also the default)
+$b=QRCodeBackendFactory::Create($e);
+ 
+// .. send the barcode back to the browser for the data
+$b->Stroke($data);
+?>


Figure 27.6. The first very basic QR code (qrexample00.php)

The first very basic QR code (qrexample00.php)


+

+

(As can be seen this follows the same principles as the creation of Datamatrix + symbols)

+

The principle is the same for all type of data QR code creations. First an + instance of the chosen encoder is instantiated. In this case using all default + parameters by creating an instance of class QREncoder. We then create a + suitable backend that handles the output of the barcode. By default the output will + be an image encoded in the PNG image format.

+

The final step is to send back the generated image to the browser with a call to + the method Backend::Stroke() with the data to be encoded as its first + argument.

+

The example above does not have any error handling. If there is some error in the + process an exception will be thrown in the same way as in other places in the + library. The default exception will display a standard library image error box. An + example of this is shown in Figure 27.7. QR Error message

+

Figure 27.7. QR Error message

+ +
QR Error message
+

+

If some additional processing is necessary and to just display a text based + re-formatted error message we could change the above code to catch this exception as + the following example shows.

+

+

Example 27.2. Adding basic exception handling (qrexample0.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data = '01234567';
+ 
+// Create a new instance of the encoder and let the library
+// decide a suitable QR version and error level
+$encoder = new QREncoder(1);
+ 
+// Use the image backend (this is also the default)
+$backend = QRCodeBackendFactory::Create($encoder);
+ 
+try {
+    //     . send the QR Code back to the browser
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo 'QR Code error: '.$e->GetMessage()."\n";
+    exit(1);
+}
+ 
+?>


Figure 27.8. Adding basic exception handling (qrexample0.php)

Adding basic exception handling (qrexample0.php)


+

+

As a final initial example the next script uses the backend method + Backend::SetModuleWidth($aWidth) to increase the size of one + module. Since a module in QR code refers to the smallest square used adjusting the + module width will also adjust the height of the overall QR code

+

+

Example 27.3. Adjusting the module width for the QR code (qrexample01.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data = '01234567';
+ 
+// Create a new instance of the encoder and let the library
+// decide a suitable QR version and error level
+$encoder = new QREncoder();
+ 
+// Use the image backend
+$backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+// Set the module size (quite big)
+$backend->SetModuleWidth(5);
+ 
+// .. send the barcode back to the browser for the data
+$backend->Stroke($data);
+?>


Figure 27.9. Adjusting the module width for the QR code (qrexample01.php)

Adjusting the module width for the QR code (qrexample01.php)


+

+
+

Error handling

+ +

As in other parts of the library the QR module throws an exception when an error + occurs. As shown in the previous section an error image is the default if no + explicit try {} catch {} statement is added to the script.

+

+

Note

+

The fact that an image is shown as the default exception is caused by the + library module "qrexception.inc.php" installing its own default error + handler which will be called when an exception happens. However, this + handler is intelligent enough to know if the exception is caused by the + library or not. If the exception is not caused by the library the exception + is re-thrown and the original error handler restored. This means that + JpGraph will not interfere with previously installed error handlers for + other parts of an application.

+

+

+

The script below shows how to catch the error, do some possible clean up and then + explicitly create and send back the error image.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+...
+try {
+    $backend->Stroke($data);
+} catch( Exception $e ) {
+    doCleanup();
+    $errobj = new QRErrObjectImg();
+    $errobj->Raise($e->getMessage());    
+}
+?>

+

+

another variant of this would be to re-throw the exception after the cleanup has + been performed as the following example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+...
+try {
+    $backend->Stroke($data);
+} catch( Exception $e ) {
+    doCleanup();
+    throw $e;
+}
+?>

+

+

It is also possible to get hold of the internal error code that corresponds to + each error message by calling the PHP standard exception method + Exception::getCode() as the following example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+...
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    $errcode = $e->GetCode();
+    echo "QR error ($errcode). Message: $errstr\n";
+}
+?>

+

+

Table 27.4. QR Error messages lists the public errors that can be + thrown by the QR code module (the table deliberately excludes internal error + messages)

+

Table 27.4. QR Error messages

+ +
Error numberError string
1000 +

Tilde processing is not yet supported for QR Barcodes.

+
1001 +

Inverting the bit pattern is not supported for QR + Barcodes.

+
1002 +

Cannot read data from file %s

+
1003 +

Cannot open file %s

+
1004 +

Cannot write QR barcode to file %s

+
1005 +

Unsupported image format selected. Check your GD + installation

+
1006 +

Cannot set the selected barcode colors. Check your GD + installation and spelling of color name

+
1007 +

QR Error: HTTP headers have already been sent.

+

Caused by output from file %s at line %d

+

Explanation: HTTP headers have already been sent back to the + browser indicating the data as text before the library got a + chance to send it's image HTTP header to this browser. This + makes it impossible for the QR library to send back image data + to the browser (since that would be interpretated as text by the + browser and show up as junk text).

+

Most likely you have some text in your script before the call + to QRBackend::Stroke().

+

If this texts gets sent back to the browser the browser will + assume that all data is plain text. Look for any text (even + spaces and newlines) that might have been sent back to the + browser.

+

For example it is a common mistake to leave a blank line + before the opening "<?php"

+
1008 +

Could not create the barcode image with image format=%s. Check + your GD/PHP installation.

+
1009 +

Cannot open log file %s for writing.

+
1010 +

Cannot write log info to log file %s.

+
1011 +

Could not write the QR Code to file. Check the file system + permissions.

+
1400 +

QR Version must be specified as a value in the range [1,40] + got %d

+
1401 +

Input data to barcode can not be empty.

+
1402 +

Automatic encodation mode was specified but input data looks + like specification for manual encodation.

+
1403 +

Was expecting an array of arrays as input data for manual + encoding.

+
1404 +

Each input data array element must consist of two entries. + Element $i has of $nn entries

+
1405 +

Each input data array element must consist of two entries with + first entry being the encodation constant and the second element + the data string. Element %d is incorrect in this respect.

+
1406 +

Was expecting either a string or an array as input data

+
1407 +

Manual encodation mode was specified but input data looks like + specification for automatic encodation.

+
1408 +

Input data too large to fit into one QR Symbol

+
1409 +

The selected symbol version %d is too small to fit the + specified data and selected error correction level.

+
1410 +

Trying to read past the last available codeword in block + split.

+
1415 +

Manually specified encodation schema MODE_NUMERIC has no data + that can be encoded using this schema.

+
1416 +

Manually specified encodation schema MODE_ALPHANUM has no data + that can be encoded using this schema.

+
1417 +

Manually specified encodation schema MODE_BYTE has no data + that can be encoded using this schema.

+
1418 +

Unsupported encodation schema specified (%d)

+
1419 +

Found character in data stream that cannot be encoded with the + selected manual encodation mode.

+
1420 +

Encodation using KANJI mode not yet supported.

+
1422 +

Found unknown characters in the data stream that can't be + encoded with any available encodation mode.

+
1423 +

Kanji character set not yet supported.

+
1427 +

Expected either DIGIT, ALNUM or BYTE but found ASCII + code=%d

+
+

+
+

Creating an encoder

+ +

A QR encoder is created as an instance of class QREncoder. The + constructor have the following signature

+

+

+

+

The following examples creates a basic encoder which will automatically select the + smallest possible size to fit the data given

+

+

1
+
$encoder = new QREncoder();

+

+

The following example will create an instance of an encoder with size 22 and error + correction level 'Q'

+

+

1
+
$encoder = new QREncoder(22, QRCapacity::ErrQ);

+

+
+

Encodation of input data options

+ +

The absolute simplest way of encoding data is simply to create a simple string + representing the data to be encoded and then pass that string as the first argument + to the Stroke() method in the backend. The encoder will then analyze + the input data and choose the most efficient space saving encoding schema for this + data.

+

+

Note

+

Unless there are some really good reasons to use manual encodation it + should be left to the library to determine this in an optimal way!

+

+

+

The QR standard allows 3 different compaction schema that can be used to minimize + the number of codewords used for a particular data string. This also means that a + particular data string may have several different valid barcodes that visually looks + different.

+

The supported compaction modes in the library are:

+

+

  • +

    Alpha compaction mode Efficient + encoding of digits 0 - 9; upper case letters A -Z and nine other + characters: space, $ % * + - . / : .

    +
  • +

    Numeric compaction mode. Efficient + encoding of numeric data. For long consecutive strings of digits this + gives a better compaction than the alpha mode.

    +
  • +

    Byte compaction mode. Used only when + there is a need to encode byte values as is, i.e. values in the range + 0-255. Please note that some barcode readers, especially those with a + keyboard wedge, don't send back the proper encoding for ASCII values + lower than 32 or higher than 126.

    +

+

+

When the automatic encoding is chosen this will create an optimum encoding (from a + size perspective) of the supplied data. This includes shifting encoding method in + the middle of the data one or several time depending on the structure of the data.

+

It is also possible to manually control the exact encodation of the input data. + This is done by supplying one or more data tuples where the first entry in the tuple + is the compaction schema and the second the data. To encode the data manually the + following structure must then be followed:

+

+

Figure 27.10. Structure for manually specify QR encodation schema

+ +
$data = array( array( <encoding_mode1> , <data1> ),
+               array( <encoding_mode2> , <data2> ),
+                         ...
+               array( <encoding_modeN> , <dataN> ));
+


+

+

The encoding mode is specified as one of three symbolic constants

+

+

  • +

    QREncoder::MODE_NUMERIC

    +
  • +

    QREncoder::MODE_ALPHANUM

    +
  • +

    QREncoder::MODE_BYTE

    +

+

+

and the data is specified as a regular text string. Each section of data must + therefore have the compaction mode specified.

+

In order to use a specific encodation schema one has to create an array as input + instead of the normal string input. For example, to specify an input where the + encodation should be alphanumeric encoding of the digits '0123456789' one would have + to create the array

+

+

1
+2
+3
+4
+5
+
<?php
+$data = array( array( QREncoder::MODE_ALPHANUM,'0123456789') );
+...
+$backend->Stroke($data)
+?>

+

+

It is also possible to use different encodings for different parts of the data in + a similar way as the following example shows

+

+

1
+2
+3
+4
+5
+6
+7
+8
+
<?php
+$data = array( array(QREncoder::MODE_ALPHANUM,'0123456789'),
+               array(QREncoder::MODE_BYTE,'ABCDEFGH') 
+             );
+...
+...
+$backend->Stroke($data)
+?>

+

+
+

Reading input data from a file

+ +

Normally the method Backend::Stroke($aData) is sued to create a QR code from the + datastring given. This string can of course come from a database, user input or from + a file. The library provides a utility method

+

+

  • +

    Backend::StrokeFromFile($aFromFile,$aToFile='')

    +

    $aFromFile, The file to read the data from

    +

    $aToFile, Optional filename to write the generated QR + code to

    +

+

+

which makes it easy to get data directly from a file. Otherwise it behaves exactly + the same as the normal Backend::Stroke().

+
+

Creating different backends

+ +

In order to create the actual output one or more backends must be created. The QR + Code supports the following backends:

+

+

  • +

    BACKEND_IMAGE, Create an image backend. This is the + default backend if no explicit backend is specified.

    +
  • +

    BACKEND_PS, Create a postscript backend. The text string + that represents the postscript for the barcode is returned directly from + the Backend::Stroke()

    +
  • +

    BACKEND_EPS, Create an encapsulated postscript + backend

    +
  • +

    BACKEND_ASCII, This is a special backend which will + generate an ASCII rendering of the datamatrix barcode. This is mostly + practical for technical investigations regarding the technical structure + of a Datamatrix barcode.

    +

+

+

The following code snippet shows two ways of creating a barcode image + backend.

+

+

1
+2
+3
+4
+5
+
<?php
+$encoder = new QREncoder();
+$backend = QRCodeBackendFactory::Create($encoder);
+...
+?>

+

+

+

1
+2
+3
+4
+5
+
<?php
+$encoder = new QREncoder();
+$backend = QRCodeBackendFactory::Create($encoder,BACKEND_IMAGE);
+...
+?>

+

+

The following code shows a complete script to generate a postscript output

+

+

Example 27.4. Generating Postscript output (qrexample11.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+// Include the library
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Example 11 : Generate postscript output
+ 
+$data         = 'ABCDEFGH01234567'; // Data to be encoded
+$version      = -1;  // -1 = Let the library decide version (same as default)
+$corrlevel    = QRCapacity::ErrH; // Error correction level H (Highest possible)
+$modulewidth  = 3;
+ 
+// Create a new instance of the encoder using the specified
+// QR version and error correction
+$encoder = new QREncoder($version,$corrlevel);
+ 
+// Use the image backend
+$backend = QRCodeBackendFactory::Create($encoder, BACKEND_PS);
+ 
+// Set the module size
+$backend->SetModuleWidth($modulewidth);
+ 
+// Store the barcode in the specifed file
+$ps_str = $backend->Stroke($data);
+ 
+echo '<pre>'.$ps_str.'</pre>';
+?>


+

+

Figure 27.11. QR Code - Example Postscript Output

+ +
QR Code - Example Postscript Output
+

+
+

Generic backend methods

+ +

The following methods are available to adjust the final look and feel of the + barcode

+

+

  1. +

    Backend::SetColor($aOne, $aZero, + $aBackground='white')

    +

    the color of the 'black' and 'white' modules in the barcode and the + quiet area around the barcode

    +
  2. +

    Backend::SetQuietZone($aSize)

    +

    the size of the "quiet zone" in pixels for the image backend and in + points (1 pt = 1/72 inch) for the postscript backend

    +
  3. +

    Backend::SetModuleWidth($aWidth)

    +

    the module width specified in pixels for the image backend and in + points (1 pt = 1/72 inch) for the postscript backend

    +
  4. +

    Backend::Stroke($aData, $aFileName='')

    +

    create the barcode and send it back the client or store it to a file + if the second parameter is set. For postscript backends the postscript + string is returned directly from the method. (See example above)

    +
  5. +

    Backend::StrokeFromFile($aFromFileName,$aFileName='')

    +

    This allows the creation of barcode directly from data in a + file.

    +

+

+
+

Image backend methods

+ +

For the image backend it is possible to adjust the image encoding format with the + following method

+

+

  1. +

    + Backend::SetImgFormat($aFormat,$aQuality=75) +

    +

    Specify image format. Possible values are

    +

    +

    • +

      + 'auto' +

      +
    • +

      + 'png' +

      +
    • +

      + 'jpeg' +

      +
    • +

      + 'gif' +

      +

    +

    +

    For 'jpeg' format the quality parameter is a number in range [1-100] + and specified how much compression / (Data loss) should be used. 100=no + compression. Normal values are in the range [60-95]

    +

    The following example sets the image format to 'JPEG' with quality + 80.

    +

    +

    1
    +
    $backend->SetImgFormat('jpeg', 80);

    +

    +

+

+
+

Postscript backend methods

+ +

For postscript backend it is possible to select whether the postscript should be + generated as encapsulated postscript. This is controlled by the method

+

+

  • +

    Backend::SetEPS($aFlg=true)

    +

+

+
+

A template to create barcodes

+ +

The following (complete) script can be used as a starting point for creation of + more advanced barcode scripts

+

+

Example 27.5. A QR code template (qr_template.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data         = 'ABCDEFGH01234567';
+ 
+// QR Code specification
+$version      = -1;                  // -1 = Let the library decide version (same as default)
+$corrlevel    = QRCapacity::ErrM;   // Medium erro correction
+$modulewidth  = 2;                    // Module width
+$back         = BACKEND_IMAGE;        // Default backend
+$quiet          = 4;                     // Same as default value
+ 
+// Create encoder and backend
+$encoder = new QREncoder($version, $corrlevel);
+$backend = QRCodeBackendFactory::Create($encoder, $back);
+ 
+// Set the module size
+$backend->SetModuleWidth($modulewidth);
+ 
+// Set Quiet zone (this should rarely need changing from the default)
+$backend->SetQuietZone($quiet);
+ 
+if( $back == BACKEND_IMAGE ) {
+ 
+    $backend->Stroke($data);
+}
+else {
+    $str = $backend->Stroke($data);
+    echo '<pre>'.$str.'</pre>';
+}
+?>


Figure 27.12. A QR code template (qr_template.php)

A QR code template (qr_template.php)


+

+
+

Sample application

+ +

As an example the library includes a WEB-based demo barcode creation application. + This application can be used to easily create barcode through it's WEB interface. It + is available at 'qr/demoapp/index.html'

+

This application is primarily included as a demo on the features available in the + library and not as a finalized product.

+

Figure 27.13. QR Code WEB-based demo application shows a screen shot of the application + interface.

+

Figure 27.13. QR Code WEB-based demo application

+ +
QR Code WEB-based demo application
+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch27s03.html b/includes/jpgraph/docs/chunkhtml/ch27s03.html new file mode 100644 index 0000000..7ba773d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch27s03.html @@ -0,0 +1,531 @@ +Example scripts

Example scripts

+ +

The following sections shows a number of example script that can be used as a base for + further refinement.

+

Example 1 - Store QR code to file

+ +

QR Barcode with specified version and stored to a file

+

+

Example 27.6. Storing image to a file (qrexample03.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php
+    // Example 3 : QR Barcode with specified version and stored to a file
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    $data = '01234567';
+    $version = 3;  // Use QR version 3
+    $fileName = 'qrexample03.png';
+ 
+    // Create a new instance of the encoder and let the library
+    // decide a suitable error level
+    $encoder = new QREncoder($version);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size (quite big)
+    $backend->SetModuleWidth(5);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data,$fileName);
+    list($version,$errorcorrection) = $backend->GetQRInfo();
+ 
+    echo "QR Barcode, (<b>Version: $version-$errorcorrection</b>), image stored in file $fileName";
+?>


+

+
+

Example 2 - Specified error correction level

+ +

QR Barcode with specified version and error correction level

+

+

Example 27.7. Specified error correction level (qrexample04.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php
+    // Example 4 : QR Barcode with specified version and error correction level
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    $data = '01234567';
+    $version = 12;  // Use QR version 4
+    $corrlevel = QRCapacity::ErrH ; // Level H error correction (the highest possible)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(3);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>


Figure 27.14. Specified error correction level (qrexample04.php)

Specified error correction level (qrexample04.php)


+

+
+

Example 3 - Manual specified encoding

+ +

QR Barcode with manually specified encodation

+

+

Example 27.8. QR Barcode with manually specified encodation (qrexample05.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php
+    // Example 5 : QR Barcode with manually specified encodation
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    // We want the data to be encoded using alphanumeric encoding even though
+    // it is only numbers
+    $data = array(
+        array(QREncoder::MODE_ALPHANUM,'01234567')
+    );
+ 
+    $version = 3;  // Use QR version 3
+    $corrlevel = QRCapacity::ErrH ; // Level H error correction (the highest possible)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(4);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>


Figure 27.15. QR Barcode with manually specified encodation (qrexample05.php)

QR Barcode with manually specified encodation (qrexample05.php)


+

+
+

Example 4 - JPEG image format

+ +

QR Barcode with image in JPG format

+

+

Example 27.9. QR Barcode with image in JPG format (qrexample06.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+    // Example 6 : QR Barcode with image in JPG format
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $data      = 'ABCDEFGH01234567'; // Data to be encoded
+    $version   = -1;  // -1 = Let the library decide version (same as default)
+    $corrlevel = -1; // -1 = Let the library decide error correction level (same as default)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend=QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Use JPEG format with 80% quality level
+    $backend->SetImgFormat('jpeg',80);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(4);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>


Figure 27.16. QR Barcode with image in JPG format (qrexample06.php)

QR Barcode with image in JPG format (qrexample06.php)


+

+
+

Example 5 - Multiple manual encoding

+ +

QR Barcode with multiple manually specified encodation schema.

+

+

Note

+

Normally there would be no need to ever use manually specified + encodation)

+

+

+

+

Example 27.10. multiple manually specified encodation schema. (qrexample07.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+    // Example 7 : QR Barcode with multiple manually specified encodation schemas
+    // (Note: Normally there would be no need to ever use manually specified encodation)
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    $data = array(
+        array(QREncoder::MODE_ALPHANUM,'01234567'),
+        array(QREncoder::MODE_NUMERIC,'89012345')
+    );
+ 
+    // Create a new instance of the encoder (automatically determined QR version and
+    // error correction level)
+    $encoder = new QREncoder();
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(4);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>


Figure 27.17. multiple manually specified encodation schema. (qrexample07.php)

multiple manually specified encodation schema. (qrexample07.php)


+

+
+

Example 6 - Reading data from file

+ +

QR Barcode with data read from file

+

+

Example 27.11. data read from file (qrexample08.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+    // Example 8 : QR Barcode with data read from file
+ 
+    // Include the library
+    require_once ('jpgraph/jpgraph.php');
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $readFromFilename = 'qr-input.txt';
+ 
+    // Create a new instance of the encoder and let the library
+    // decide a suitable QR version and error level
+    $encoder=new QREncoder();
+ 
+    // Use the image backend
+    $backend=QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size (quite big)
+    $backend->SetModuleWidth(5);
+ 
+    // .. send the barcode back to the browser for the data in the file
+    $backend->StrokeFromFile($readFromFilename);
+?>


Figure 27.18. data read from file (qrexample08.php)

data read from file (qrexample08.php)


+

+
+

Example 7 - Adjusting colors

+ +

QR Barcode with data read from file and different colors

+

+

Example 27.12.  (qrexample09.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php
+    // Example 9 : QR Barcode with data read from file and different colors
+ 
+    // Include the library
+    require_once ('jpgraph/jpgraph.php');
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $readFromFilename = 'qr-input.txt';
+ 
+    // Create a new instance of the encoder and let the library
+    // decide a suitable QR version and error level
+    $encoder = new QREncoder();
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size (quite big)
+    $backend->SetModuleWidth(5);
+ 
+    // Use blue and white colors instead
+    $backend->SetColor('navy','white');
+ 
+    // .. send the barcode back to the browser for the data in the file
+    $backend->StrokeFromFile($readFromFilename);
+?>


Figure 27.19.  (qrexample09.php)

(qrexample09.php)


+

+
+

Example 8 - Setting error correction level

+ +

Specified error correction level

+

+

Example 27.13. Specified error correction level (qrexample10.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+    // Example 10 : Specified error correction level
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $data      = 'ABCDEFGH01234567'; // Data to be encoded
+    $version   = -1;  // -1 = Let the library decide version (same as default)
+    $corrlevel = QRCapacity::ErrH; // Error correction level H (Highest possible)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(3);
+ 
+    // Set color
+    $backend->SetColor('brown','white');
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>


Figure 27.20. Specified error correction level (qrexample10.php)

Specified error correction level (qrexample10.php)


+

+
+

Example 9 - Generating ASCII output

+ +

Using the ASCII backend

+

+

Example 27.14. Using the ASCII backend (qrexample12.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+// Include the library
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Example 11 : Generate postscript output
+ 
+$data         = 'ABCDEFGH01234567'; // Data to be encoded
+$version      = -1;  // -1 = Let the library decide version (same as default)
+$corrlevel    = QRCapacity::ErrH; // Error correction level H (Highest possible)
+$modulewidth  = 1;
+ 
+// Create a new instance of the encoder using the specified
+// QR version and error correction
+$encoder = new QREncoder($version,$corrlevel);
+ 
+// Use the image backend
+$backend = QRCodeBackendFactory::Create($encoder, BACKEND_ASCII);
+ 
+// Set the module size
+$backend->SetModuleWidth($modulewidth);
+ 
+// Store the barcode in the specifed file
+$ps_str = $backend->Stroke($data);
+ 
+echo '<pre>'.$ps_str.'</pre>';
+?>


+

+

Figure 27.21. QR With ASCII rendering

+ +
QR With ASCII rendering
+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch28.html b/includes/jpgraph/docs/chunkhtml/ch28.html new file mode 100644 index 0000000..062b018 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch28.html @@ -0,0 +1,36 @@ +Chapter 28. Applying the prepared theme

Chapter 28. Applying the prepared theme

+ +

To understand how themes are used, it is easiest to look at the sample code. For example, the Aqua Theme can be applied using the following. +

+

+

1
+2
+3
+4
+
<?php
+$theme_class = new AquaTheme();
+$graph->SetTheme($theme_class);
+?>

+

+

In line 1, an instance of AquaTheme class is created, and the graph theme is changed by passing the instance to SetTheme(). To use 'GreenTheme' instead of 'AquaTheme', use the following. +

+

+

1
+
$theme_class = new GreenTheme;

+

+

All theme classes inherit the abstract 'Theme' class. +

+

+ +

+

Figure 28.1. Aqua Theme (aqua_example.php)

Aqua Theme (aqua_example.php)


+

Figure 28.2. Green Theme (green_example.php)

Green Theme (green_example.php)


+

Figure 28.3. Ocean Theme (ocean_example.php)

Ocean Theme (ocean_example.php)


+

Figure 28.4. Pastel Theme (pastel_example.php)

Pastel Theme (pastel_example.php)


+

Figure 28.5. Softy Theme (softy_example.php)

Softy Theme (softy_example.php)


+

Figure 28.6. Vivid Theme (vivid_example.php)

Vivid Theme (vivid_example.php)


+

Figure 28.7. Orange Theme (orange_example.php)

Orange Theme (orange_example.php)


+

Figure 28.8. Rose Theme (rose_example.php)

Rose Theme (rose_example.php)


+

Figure 28.9. Universal Theme (universal_example.php)

Universal Theme (universal_example.php)


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch29.html b/includes/jpgraph/docs/chunkhtml/ch29.html new file mode 100644 index 0000000..99de448 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch29.html @@ -0,0 +1,30 @@ +Chapter 29. Attention

Chapter 29. Attention

+ +

When using themes, there are some things that require particular attention.

+

The order of SetTheme() and changing settings

+ +

At first, $graph->SetTheme() should be used after creating the graph, just after $graph->SetScale(). The following code is an example. +

+

+

1
+2
+3
+4
+
$graph = new Graph(750, 320, 'auto');
+$graph->SetScale('textlin');
+$theme_class = new AquaTheme;
+$graph->SetTheme($theme_class);

+

+

In this way, all the settings of AquaTheme(grid, background and font color etc) can be applied. Any plots after this will also use the AquaTheme settings. +Of course there are times where we only want to change individual settings and not the overall theme. For example, there is no outline around the graph in 'AquaTheme'. To add an outline we can do the following. After SetTheme(), you can use functions to change individual settings. +If you want to display an outline around the graph, add the following line to the code shown previously. +

+

+

1
+
$graph->SetFrame(true);

+

+

In this way, all the settings of AquaTheme(grid, background and font color etc) can be applied. Any plots after this will also use the AquaTheme settings. +

+
+ +
diff --git a/includes/jpgraph/docs/chunkhtml/ch29s02.html b/includes/jpgraph/docs/chunkhtml/ch29s02.html new file mode 100644 index 0000000..78ea2a3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch29s02.html @@ -0,0 +1,47 @@ +Changing the display settings of line/bar graphs

Changing the display settings of line/bar graphs

+ +

You should be careful when adding additional lines or bars to graphs and when changing color settings etc. +

+

For example, in the previous version of JpGraph, after generating the 'BarPlot' instance and changing some settings, we used the Add() instance applied to $graph. But when using the theme class, this won't work. Because when Add() is called, all previous settings are ignored and the theme's defaults are used. +

+

To avoid this, you should change each setting individually after using Add() when you want to customize. +The following is sample code showing how to change colors in BarPlot. +

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+$data1y=array(47,80,40,116);
+$bplot = new BarPlot($data1y);
+$graph->Add($bplot);
+ 
+// you can change properties of the plot only after calling Add()
+$bplot->SetWeight(0);
+$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);    
+ 
+?>

+

+

If you use the code shown below, the changes made using the SetWeight() and SetFillGradient() method will be overwritten by Add() and won't be applied . +

+

+

1
+2
+3
+4
+
// this is an invalid example
+$bplot->SetWeight(0);
+$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);    
+$graph->Add($bplot);

+

+

PiePlot settings can be changed in the same way. +For examples relating to BarPlot, please see 'new_bar1.php' on the gallery page. +

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch30.html b/includes/jpgraph/docs/chunkhtml/ch30.html new file mode 100644 index 0000000..b97fc7b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch30.html @@ -0,0 +1,56 @@ +Chapter 30. Examples of applying a theme

Chapter 30. Examples of applying a theme

+ +

The following code is an example of using the theme class to customize some settings. +

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php
+$data1y=array(47,80,40,116);
+$graph = new Graph(400, 300, 'auto');
+$graph->SetScale('textlin');
+ 
+$theme_class = new AquaTheme;
+$graph->SetTheme($theme_class);
+// after setting the theme, you can change individual details yourself
+$graph->SetFrame(true,'lightgray');                        // make frame visible and set color
+$graph->xaxis->SetTickLabels(array('A','B','C','D')); // change xaxis lagels
+$graph->title->Set("Theme Example");                    // add title
+ 
+// add barplot
+$bplot = new BarPlot($data1y);
+ 
+// you can change properties of the plot only after calling Add()
+$bplot->SetWeight(0);
+$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);    
+ 
+$graph->Stroke();
+?>

+

+

The following graph was generated using this sample program. +

+

+

Figure 30.1. Theme Sample (theme_example.php)

Theme Sample (theme_example.php)


+

+ + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch31.html b/includes/jpgraph/docs/chunkhtml/ch31.html new file mode 100644 index 0000000..2b2093a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch31.html @@ -0,0 +1,108 @@ +Chapter 31. Creating original themes

Chapter 31. Creating original themes

+ +

You can create an original theme class yourself. +You can easily create new theme classes by extending the 'Theme' class and adding your own settings. +

+

Let's say that you like 'AquaTheme' but want to make some changes. +In 'AquaTheme', the y axis and y scale are not displayed. To change these settings and to display both, you can use the following. However, it can be time-consuming to add these lines to each graph individually. +

+

+

1
+2
+3
+4
+
<?php
+$graph->yaxis->HideLine(false);
+$graph->yaxis->HideTicks(false,false);
+?>

+

+

It may be easier to create a new theme based on the original but which has some different settings. Lets create 'MyAquaTheme'. +You should put the new theme class file in the 'Theme' folder, This is where all theme classes are kept. +

+

At first, create a file at Themes/MyAquaTheme.class.php. +The code for 'MyAquaTheme' class is the following. +

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
<?php
+class MyAquaTheme extends AquaTheme
+{
+  function SetupGraph($graph) {
+    parent::SetupGraph($graph);
+    $graph->yaxis->HideLine(false);
+    $graph->yaxis->HideTicks(false,false);
+  }
+}
+?>

+

+

When redefining a method of parent class, please call the parent method. +In this way, all settings of the parent class method are applied and you can add the original settings. +Font, x axis, y axis colors etc are all defined as class properties. The following code shows how to change these settings. +

+

+

1
+2
+3
+4
+5
+6
+7
+8
+
<?php
+function __construct() {
+    $this->font_color       = '#009900';
+    $this->background_color = '#EEFFDD';
+    $this->axis_color       = '#00CC00';
+    $this->grid_color       = '#33CC33';
+}
+?>

+

+

You can set four properties, $font_color, $background_color, $axs_color and $grid_color. +You can also change values individually. +

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
<?php
+class MyAquaTheme extends AquaTheme
+{
+    function __construct() {
+        $this->font_color       = '#009900';
+        $this->background_color = '#EEFFDD';
+        $this->axis_color       = '#00CC00';
+        $this->grid_color       = '#33CC33';
+    }
+  
+    function SetupGraph($graph) {
+        parent::SetupGraph($graph);
+        $graph->yaxis->HideLine(false);
+        $graph->yaxis->HideTicks(false,false);
+    }
+}
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch32.html b/includes/jpgraph/docs/chunkhtml/ch32.html new file mode 100644 index 0000000..9967517 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch32.html @@ -0,0 +1,165 @@ +Chapter 32. Synchronized Y-axis

Chapter 32. Synchronized Y-axis

Table of Contents

32.1. Creating two scales
+ +

The purpose of this chapter is to show how one can have one set of data displayed with + two different scales that are still synchronized meaning that the tick marks are at + identical positions.

+

One classic example of when this can be useful is to show temperature in both Celsius + and Fahrenheit. Figure 32.1. Synchronized y and y2 scales (y2synch.php) below illustrates what we would like + to accomplish.

+

+

Figure 32.1. Synchronized y and y2 scales (y2synch.php)

Synchronized y and y2 scales (y2synch.php)


+

+

Creating two scales

+ +

Normally the auto scaling puts tick marks at "nice" positions that for example are + multiples of 5,2,10 and so on. This would mean that it seems like the graph in Figure 32.1. Synchronized y and y2 scales (y2synch.php) with tick positions at 59 F and 68 F can not be auto + scaled.

+

The simplest method of creating two scales as in the example above is to add a + secondary Y-axis, add the same plot to that axis. This would then mean that the two + axes would be identical. The magic now happens in the last step when we add a format + callback method to the second Y-axis. This format callback will be applied to each + label. All we have to do now is create a callback function that does the proper + scale conversion.

+

This way also means that we have too chose one of the scales as the "master" which + will be auto scaled with tick positions at "nice" intervals.

+

+

Caution

+

For the second scale one can add the same plot or one could create a new + plot from the same data set. If the data set to be plotted is very large it + can be advantageous to create a new plot and set the line weight to 0 + (zero). This way the line will not actually be plotted and that plot time is + eliminated.

+

+

+

The script to create the graph in Figure 32.1. Synchronized y and y2 scales (y2synch.php) is given + below.

+

+

Example 32.1.  (y2synch.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+ 
+function toFahrenheit($aVal) {
+    return round(($aVal*9/5)+32,2);
+}
+ 
+function toCelcius($aVal) {
+    return round(($aVal-32)*5/9,2);
+}
+ 
+ 
+$datay =array(2,3,8,19,7,17,6,22);
+ 
+// Create the graph. 
+$graph = new Graph(400,280);
+ 
+// Slightly bigger margins than default to make room for titles
+$graph->SetMargin(50,60,40,45);
+$graph->SetMarginColor('white');
+ 
+ 
+// Setup the scales for X,Y and Y2 axis
+$graph->SetScale("intlin"); // X and Y axis
+$graph->SetY2Scale("lin"); // Y2 axis
+ 
+// Overall graph title
+$graph->title->Set('Synchronized Y & Y2 scales');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// Title for X-axis
+$graph->xaxis->title->Set('Measurement');
+$graph->xaxis->title->SetMargin(5);
+$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Create Y data set 
+$lplot = new LinePlot($datay);
+$graph->yaxis->title->Set('Celcius (C)');
+$graph->yaxis->title->SetMargin(5);
+$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+// ... and add the plot to the Y-axis
+$graph->Add($lplot);
+ 
+// Create Y2 scale data set 
+$l2plot = new LinePlot($datay);
+$l2plot->SetWeight(0);
+$graph->y2axis->title->Set('Fahrenheit (F)');
+$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels
+$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+$graph->y2axis->SetLabelFormatCallback('toFahrenheit');
+$graph->y2axis->SetColor('navy');
+ 
+// ... and add the plot to the Y2-axis
+$graph->AddY2($l2plot);
+ 
+$graph->Stroke();
+?>


+

+

The same principle will also work with othrr plot variants, for example bar plots. + By making the first plot an instance of class BarPlot the graph in + Figure 32.2. Using a barplot with two different scales (y2synch2.php) can be created.

+

+

Figure 32.2. Using a barplot with two different scales (y2synch2.php)

Using a barplot with two different scales (y2synch2.php)


+

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch33.html b/includes/jpgraph/docs/chunkhtml/ch33.html new file mode 100644 index 0000000..d8cea42 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch33.html @@ -0,0 +1,282 @@ +Chapter 33. USPS Confirmation Barcodes

Chapter 33. USPS Confirmation Barcodes

+ +

US Postal Service (USPS) uses EAN-128 barcodes to tag confirmation codes for the + sender of parcels and letters in the case the sender is a registered business entity. + The confirmation barcode gives feedback to the sender on the date, ZIP Code and the time + the article was delivered.

+

Figure 33.1. usps_exhibit44.png

+ +
usps_exhibit44.png
+

+

The full standard describing this is available in "Confirmation + Services Technical Guide"

+

In order to create labels adhering to this strict standard it is possible to use + JpGraph as a basic building block in order to create the barcode part (which uses + UCC/EAN128 as mandatory coding from 2004 and onwards). The standard describes two basic + forms of labels :

+

+

  1. +

    Inclusion of postal service routing information (destination ZIP code) +

    +
  2. +

    Exclusion of the destination ZIP code. This will then only include the Dun + & Bradstreet Number (DUNS). The DUNS uniquely identifies businesses at + specific geographical locations. For more information regarding this and how + to obtain such a number please refer to USPS technical documentation. +

    +

+

+

Creating the confirmation codes

+ +

In order to create the final Package Identification Code (PIC) the following three + steps must be taken

+

+

  1. +

    Determine the basic element of the code. This consists of identifying + the Zip code (of the addressee), USPS service type, the DUNS and + Sequence number of parcel (as determined by the business). These number + are input and the process of how to get those number is not described + further in this short note. It is assumed that a potential client will + now how these numbers are obtained.

    +
  2. +

    Determine what type of confirmation code should be used (with or + without Zip code)

    +
  3. +

    Calculate the additional checkdigit for the code and append that code + to the digit sequence.

    +

+

+

The final code that one arrives at in the final stage is then the barcode that + should be created. However creating this code requires knowledge of the EAN-128 + barcode format and the rules for creating barcodes that follow the highly + standardized format for a EAN-128 barcode.

+

EAN-128 barcodes are the same as CODE-128 barcodes from a technical barcode point + of view but the data to be encoded must follow a rigorous standard. The JpGraph + library has built in validation to ensure that any data that is encoded using the + EAN-128 symbology follows this standard.

+

This standard requires that special control character is inserted at specific + points in the data stream. In the discussion below we will simply state what those + control characters are and not discuss the general format of the EAN-128 barcodes in + too much details.

+

In order to do this we will create a utility class with methods that does the + following three things

+

+

  1. +

    Create the additional USPS Modulo-10 check digit.

    +
  2. +

    Create a confirmation code without the ZIP number

    +
  3. +

    Create a confirmation code with ZIP number

    +

+

+

The USPS_Confirmation Utility class

+

For both types of confirmation code USPS uses its own checkdigit (a variant of a + Modulo-10 checkdigit) at the end of the complete Package Identification Code (PIC), + (the exact process for calculating this number is also described in the technical + documentation released by USPS). The utility class will therefore consist of three + methods, one to calculate the checkdigit and one method each to create PIC with and + without ZIP code. The three methods are listed below

+

+

  1. +

    function + _USPS_chkd($aData)

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +
    <?php
    +// Calculate the single digit check digit from sequence of numbers
    +// in a string
    +function _USPS_chkd($aData) {
    +    $n = strlen($aData);
    +    
    +    // Add all numbers at position 0,2,4,.. from the end
    +    $et = 0 ;
    +    for( $i=1; $i <= $n; $i+=2 ) {
    +    $d = intval(substr($aData,-$i,1));
    +    $et += $d;
    +    }
    + 
    +    // Add all numbers at position 1,3,5,... from the end
    +    $ot = 0 ;
    +    for( $i=2; $i <= $n; $i+=2 ) {
    +    $d = intval(substr($aData,-$i,1));
    +    $ot += $d;
    +    }
    + 
    +    // Calculate the checkdigit
    +    $tot = 3*$et + $ot;
    +    return (10 - ($tot % 10))%10;
    +}
    +?>

    +

    +
  2. +

    function + GetPIC($aServiceType,$aDUNS,$aSeqNbr)

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +
    <?php
    +// Get type 2 of confirmation code (without ZIP)
    +function GetPIC($aServiceType,$aDUNS,$aSeqNbr) {
    +  // Convert to USPS format with AI=91
    +  $data = '91' . $aServiceType . $aDUNS . $aSeqNbr;
    +  $cd = $this->_USPS_chkd($data);
    +  return $data . $cd;
    +}
    +?>

    +

    +
  3. +

    function + GetPICwithZIP($aZIP,$aServiceType,$aDUNS,$aSeqNbr)

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +
    <?php
    +// Get type 1 of confirmation code (with ZIP)
    +function GetPICwithZIP($aZIP,$aServiceType,$aDUNS,$aSeqNbr) {
    +   // Convert to USPS format with AI=420 and extension starting 
    +   // with AI=91
    +   $data = '420'. $aZIP . '91' . $aServiceType . 
    +             $aDUNS . $aSeqNbr;
    +   // Only calculate the checkdigit from the AI=91 and forward
    +   // and do not include the ~1 (FUNC1) in the calculation
    +   $cd = $this->_USPS_chkd(substr($data,8));
    +   $data = '420'. $aZIP . '~191' . $aServiceType . 
    +              $aDUNS . $aSeqNbr;
    +   return $data . $cd;
    +}
    +?>

    +

    +

    All that now remains is to tie this together with the EAN-128 standard + barcode generation in order to crate the confirmation code. The + following script shows how this can be done

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +
    <?php
    +$zip     = '92663';     // Zip code
    +$service = '21';        // Service 21 = Priority Mail
    +$DUNS    = '805213907'; // DUNS
    +$seqnr   = '04508735';  // Seqnr
    + 
    +$usps = new USPS_Confirmation();
    +$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr);
    + 
    +$encoder = BarcodeFactory::Create(ENCODING_EAN128);
    +$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
    +$e->SetModuleWidth(2);
    +$e->SetFont(FF_ARIAL,FS_NORMAL,14);
    +$e->Stroke($data);
    +?>

    +

    +

    The script above will then generate the following barcode

    +

    Figure 33.2. USPS example 1

    + +
    USPS example 1
    +

    +

+

+

+

Caution

+

Even though only numbers are input to the PIC, integers should not be used + since initial "0":s will be lost. Use strings as the example above shows. +

+

+

+

Additional example

+

The following script shows how to generate PIC that does not use Zip codes.

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php
+$service = '01';         // Priority mail
+$DUNS    = '123456789';  // DUNS
+$seqnr   = '00000001';   // Seqnr
+ 
+$usps = new USPS_Confirmation();
+$data = $usps->GetPIC($service,$DUNS,$seqnr);
+ 
+$encoder = BarcodeFactory::Create(ENCODING_EAN128);
+$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
+$e->SetModuleWidth(2);
+$e->SetFont(FF_ARIAL,FS_NORMAL,14);
+$e->Stroke($data);
+?>

+

+

The script above will generate the following confirmation barcode.

+

Figure 33.3. USPS example 2

+ +
USPS example 2
+

+

A complete script to implement this is available in the distribution as + "barcode/examples/barcode_usps_example.php"

+
+
diff --git a/includes/jpgraph/docs/chunkhtml/ch34.html b/includes/jpgraph/docs/chunkhtml/ch34.html new file mode 100644 index 0000000..5717b4f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch34.html @@ -0,0 +1,158 @@ +Chapter 34. Showing SPAM statistics

Chapter 34. Showing SPAM statistics

+ +

Introduction and purpose

+ +

This worked example will show hot to setup a graph that is periodically generated + offline to show Spam statistics for a mail server. The graph will show daily + summaries for the three things; a) The total number + of identified spam mails b) The number of + immediately deleted spams and c) The number of + suspected spams that was stored in the "spam" folder instead of being immediately + deleted.

+

An example of the graph we will generate is shown in Figure 34.1. Spam statistics

+

Figure 34.1. Spam statistics

+ +
Spam statistics
+

+

The graph above makes two assumption;

+

+

  1. +

    The spam setup has two levels of identifications and how spams are + handled. Suspected email are either deleted immediately (by sending them + to dev/null) or storing the email in the users spam + folder.

    +
  2. +

    The log files from the mail server are available for analysis.

    +

+

+

In the following we will construct a complete PHP command line script that will be + run periodically and analyse the email logs and produce a graph similar to what is + shown above. The script assume that the log file uses procmail + log format so that the folder where each mail is stored are logged.

+

+

Warning

+

For very high load email servers doing log file analysis in PHP is + probably not a very good idea due to performance reasons in regards to both + time and memory constraints. We do not make any claim that the scripts below + is enough optimized to be used on high volume mail servers.

+

+

+

The script will consist of three parts

+
  1. +

    A parser to scan the log file and create the data

    +
  2. +

    A suitable graph script to create an accumulated bar graph

    +
  3. +

    Uploading of the created image file with the graph to a server where + it will be displayed

    +

We will therefore use three classes that corresponds to each step + above.

+

To define the different files and ftp credentials we will use the following + symbolic constants which will need to be defined depending on the system setup. + Constants that must be adjusted is marked as "...".

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+/ FTP Server credentials
+DEFINE('FTP_SERVER','...');
+DEFINE('FTP_UID','...');
+DEFINE('FTP_PWD','...');
+ 
+// Directory on FTP server where the image should be stored
+DEFINE('FTP_DIR','...');
+ 
+// Which procmail logfile to read
+DEFINE('PROCMAIL_LOGFILE','...');
+ 
+// 2 Weeks windows to display
+DEFINE('WINDOWSIZE',14); 
+ 
+// Where to store the temporary image file
+DEFINE('IMGFILE','/tmp/spamstat.png');
+?>

+

+

The whole process is then driven by the following relative small main + script:

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php
+// Use the text based error handling and log potential errors to the 
+// system default system logger
+JpGraphError::SetImageFlag(false); 
+JpGraphError::SetLogFile('syslog');
+JpGraphError::SetTitle('Spamstat Message: ');
+ 
+//---------------------------------------------------------------------------    
+// Step 1) Get the statistics. We return a window of WINDOWSIZE days
+//---------------------------------------------------------------------------
+$parser = new ParseProcmailLogFile(PROCMAIL_LOGFILE);
+list($xdata, $ydata, $y2data) = $parser->GetStat(WINDOWSIZE);
+ 
+//---------------------------------------------------------------------------
+// Step 2) Create the graph and store it in the file IMGFILE
+//---------------------------------------------------------------------------
+$width = 650; $height = 420;
+$sgraph = new SpamGraph($width,$height);
+$sgraph->Create(IMGFILE,$xdata,$ydata,$y2data);
+ 
+//---------------------------------------------------------------------------
+// Step 3) Upload the file to the FTP_SERVER server and store the
+// local file IMGFILE with the same base name in directory FTP_DIR  
+//---------------------------------------------------------------------------
+$ftp = new FTPUploader(FTP_SERVER,FTP_UID,FTP_PWD);
+$ftp->Upload(IMGFILE,FTP_DIR);
+?>

+

+

For brevity we have excluded the lines that defines the symbolic constants above + and also the inclusion of the necessary library files.

+

In the following sections we will shortly discuss each of the three support + classes.

+
+ + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch34s02.html b/includes/jpgraph/docs/chunkhtml/ch34s02.html new file mode 100644 index 0000000..969219d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch34s02.html @@ -0,0 +1,366 @@ +Step 1: Parsing the log file

Step 1: Parsing the log file

+ +

The log file we will be parsing is the standard procmail log. + An authentic example of the log file from our main mail server (that receives around + ~10,000 spam mails per month) is shown below (slightly anonymized to remove the real + name of the mailbox)

+

+

...
+From sterne@gvt.net.br  Thu Jul 16 00:03:32 2009
+ Subject: *** SPAM (5.3) *** =?koi8-r?B?79DUyc3J2sHDydEg08HK1ME=?=
+  Folder: /dev/null                                                       14278
+From yhrtjgommsg@boomboomroom.com  Thu Jul 16 00:13:33 2009
+ Subject: *** SPAM (6.7) *** Women will be begging you to sleep with you.
+  Folder: /srv/mail/john/.Spam/new/1247696013.18366_0.lambda                2070
+From ErikaFrazier12@aol.com  Thu Jul 16 00:13:33 2009
+ Subject: *** SPAM (41.5) *** Obama Allows Meds Sold Online
+  Folder: /dev/null 
+...

+

+

Each entry for a received mail in the log are three lines, sender, subject and the + folder the mail will be stored in. For mails that are identified with (according to + this setup) 100% confidence as spams the destination is set to + /dev/null , i.e they are immediately deleted. For mails + that are determined to be spams but where there might be a chance that they are + legitimate they are store in the users Spam folder. From the above log we can see + that two mails are deleted immediately and one mail is stored in the users Spam + folder.

+

To analyze this we will create the class ParseProcmailLogFile the + constructor will take a file name of the log file as the only argument and to get + hold of the statistics we use the method

+

+

  • +

    ParseProcmailLogFile::GetStat($aWindowSize)

    +

    $aWindowSize is the number of days back the stats should + be based on. The returned statistics will be an array with three array + elements with the following layout:

    +

    ($dateArray, nbrDevNull, nbrSpamFolder)

    +

    These returned values are both arrays indexed by date and value the + number of spams for that date (key)

    +

+

+

+

Caution

+

Remember that the PHP process or user running the script must have read + privileges for the log file.

+

+

+

We will not walk through the parsing class in any more details than what is given + in the phpdoc comments in the source below

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+
<?php
+/**
+* Class ParseProcmailLogFile
+*/
+class ParseProcmailLogFile {
+    private $iFileName='';
+    /**
+    * Constructor for the parse class
+    *
+    * @param mixed $aFileName  Log file to read
+    * @return ParseProcmailLogFile
+    */
+    function __construct($aFileName) {
+        $this->iFileName = $aFileName ;
+    }
+    /**
+    * Get line without trailing "\n"
+    *
+    * @param mixed $fp Filepointer
+    * @return string Read line without trailing "\n"
+    */
+    function GetLine($fp) {
+        $s = fgets($fp);
+        return substr($s,0,strlen($s)-1);
+    }
+    /**
+    * Get statistics from the parsed log file
+    *
+    * @param $aWindow Window size. How many days to include in the returned stats
+    * @return array with (date, number of killed spam, number of non killed spams)
+    */
+   function GetStat($aWindow) {
+ 
+        $fp = fopen($this->iFileName,'r');
+        if( $fp === false ) {
+            JpGraphError::Raise('Cannot read log file');
+        }
+ 
+        // Now loop through the file. We always keep the last 3 lines in
+        // the buffer to be able to get the context of a line since the
+        // folder is stored on one line and the date of the main on the
+        // previous line
+        $buf[1] = $this->GetLine($fp);
+        $buf[2] = $this->GetLine($fp);
+ 
+        $idx = 0;
+        $idx2 = 0;
+        $found = array(); // All /dev/null spam headers
+        $found2 = array(); // All Spam folder headers
+ 
+        // Loop through all lines in the file and store the found emails
+        // in the two $found arrays
+        while( ! feof($fp) ) {
+ 
+            //Shift buffer one step
+            $buf[0] = $buf[1];
+            $buf[1] = $buf[2];
+            $buf[2] = $this->GetLine($fp);
+ 
+            // Find /dev/null entries
+            if( strpos($buf[2],'Folder: /dev/null') !== false ) {
+                if( strpos($buf[0],'From ') !== false ) {
+                    $datepos = 0 ;
+                }
+                elseif( strpos($buf[1],'From ') !== false ) {
+                    $datepos = 1 ;
+                }
+                else {
+                    continue;
+                }
+                // Aggregate all the data per day
+                $date = strtotime(date('D j M Y',strtotime(substr($buf[$datepos],-24))));
+                $found[$idx++] = array(str_replace(' Subject: ','',$buf[1]),$date);
+            }
+ 
+            // Find spam folder entries
+            if( strpos($buf[2],'.Spam') !== false ) {
+                if( strpos($buf[0],'From ') !== false ) {
+                    $datepos = 0 ;
+                }
+                elseif( strpos($buf[1],'From ') !== false ) {
+                    $datepos = 1 ;
+                }
+                else {
+                    continue;
+                }
+                // Aggregate all the data per day
+                $date = strtotime(date('D j M Y',strtotime(substr($buf[$datepos],-24))));
+                $found2[$idx2++] = array(str_replace(' Subject: ','',$buf[1]),$date);
+            }
+ 
+        }
+ 
+        fclose($fp);
+ 
+        // Find out how many at each day of dev null
+        $date = $found[0][1];
+        $daystat[$date] = 0;
+ 
+        for($i=0; $i < $idx; ++$i ) {
+            if( $date == $found[$i][1] ) {
+                ++$daystat[$date];
+            }
+            else {
+                $date = $found[$i][1];
+                $daystat[$date] = 1;
+            }
+        }
+ 
+        // Find out how many at each day of spam
+        $daystat2 = array();
+        if( count($found2) > 0 ) {
+            $date = $found2[0][1];
+            $daystat2[$date] = 0;
+ 
+            for($i=0; $i < $idx2; ++$i ) {
+                if( $date == $found2[$i][1] ) {
+                    ++$daystat2[$date];
+                }
+                else {
+                    $date = $found2[$i][1];
+                    $daystat2[$date] = 1;
+                }
+            }
+        }
+ 
+        // Now make sure that both arrays have the same
+        // number of entries.
+        foreach( $daystat as $key => $val ) {
+            if( !isset($daystat2[$key]) ) {
+                $daystat2[$key] = 0;
+            }
+        }
+ 
+        foreach( $daystat2 as $key => $val ) {
+            if( !isset($daystat[$key]) ) {
+                $daystat[$key] = 0;
+            }
+        }
+ 
+        // Window and return the data
+        $n = count($daystat);
+        $start = $n > $aWindow ? $n - $aWindow : 0;
+        $date_keys = array_keys($daystat);
+        $idx=0;
+ 
+        $datax = array(); $datay1 = array(); $datay2 = array();
+        for( $i=$start; $i < $n; ++$i ) {
+            $datax[$idx] = date('D j M',$date_keys[$i]);
+            $datay1[$idx] = $daystat[$date_keys[$i]];
+            $datay2[$idx++] = $daystat2[$date_keys[$i]];
+        }
+ 
+        return array($datax,$datay1,$datay2);
+    }
+}
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch34s03.html b/includes/jpgraph/docs/chunkhtml/ch34s03.html new file mode 100644 index 0000000..2d8d00d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch34s03.html @@ -0,0 +1,150 @@ +Step 2: Creating the graph

Step 2: Creating the graph

+ +

We will use a basic accumulated bar graphs with a text scale and integer y-scale. + The remainder of the script should be fairly self explanatory since this is a + straightforward graph with no "tricks".

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
<?php
+/**
+* Class SpamGraph
+*/
+class SpamGraph {
+    private $iWidth, $iHeight;
+    /**
+    * Constructor
+    * 
+    * @param $aWidth Width of generated graph
+    * @param $aHeight Height of generated graph
+    * @return SpamGraph 
+    */
+    public function __construct($aWidth,$aHeight) {
+        $this->iWidth = $aWidth;
+        $this->iHeight = $aHeight;
+    } 
+    /**
+    * Create an accumulated bar graph
+    * 
+    * @param string $aFile File to write graph to
+    * @param array $aXData Date x-labels
+    * @param array $aYData Spam data 1 (/dev/null)
+    * @param array $aY2Data Spam data 2 (Spam folder)
+    */
+    public function Create($aFile,$aXData,$aYData,$aY2Data) {
+ 
+        $graph = new Graph($this->iWidth,$this->iHeight);    
+        $graph->SetMargin(40,20,50,110); 
+        $graph->SetScale('textint');
+        $graph->SetMarginColor('khaki2@0.6');
+ 
+        $graph->legend->SetPos(0.5,0.97,'center','bottom');
+        $graph->legend->SetLayout(10);
+        $graph->legend->SetFillColor('white');
+        $graph->legend->SetFont(FF_ARIAL,FS_NORMAL,10);
+ 
+        $graph->title->Set('Identified spams');
+        $graph->title->SetMargin(10);
+        $graph->title->SetFont(FF_ARIAL,FS_NORMAL,14);
+ 
+        $graph->subtitle->Set('(Updated: '.date('j M Y, H:i'.' T)'));
+        $graph->subtitle->SetMargin(5);
+        $graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,11);
+ 
+        $graph->xaxis->SetTickLabels($aXData);
+        $graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
+        $graph->xaxis->SetLabelAngle(45);
+ 
+        $graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,10);
+        $graph->yscale->SetGrace(10);
+ 
+        $bar1 = new BarPlot($aYData);
+        $bar1->SetFillGradient('darkred:1.2','darkred:0.7',GRAD_VER);
+        $bar1->SetLegend('To "/dev/null"');
+ 
+        $bar2 = new BarPlot($aY2Data);
+        $bar2->SetFillGradient('orange','orange:0.7',GRAD_VER);
+        $bar2->SetLegend('To Spam folder');
+ 
+        $abar = new AccBarPlot(array($bar1,$bar2));
+        $abar->value->Show();
+        $abar->value->SetFormat('%d');
+        $graph->Add($abar);
+        $graph->Stroke($aFile);
+        
+        syslog(LOG_INFO,"Created spam image in $aFile."); 
+    }
+}
+  
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch34s04.html b/includes/jpgraph/docs/chunkhtml/ch34s04.html new file mode 100644 index 0000000..12d1db1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch34s04.html @@ -0,0 +1,119 @@ +Step 3: Uploading the image file to a server

Step 3: Uploading the image file to a server

+ +

This class assumes that PHP has been built with support for FTP. Since the script + is straightforward we do not discuss it any more in details other than noting that + we use the default system logger to store information that we have uploaded the file + successfully. This is done via the PHP method syslog().

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
<?php
+/**
+* Class FTPUploader
+*/
+class FTPUploader {
+    private $iserver='', $iuid='',$ipwd='';
+    /**
+     * Creat new instance of the FTP uploader class
+     * 
+     * @param $aServer The URI for the server
+     * @param $aUID The ftp user id
+     * @param $aPWD The ftp user password
+     * @return FTPUploader
+     */
+    function __construct($aServer,$aUID,$aPWD) {
+        $this->iserver = $aServer;
+        $this->iuid = $aUID;
+        $this->ipwd = $aPWD;   
+    }
+    /**
+     * Upload the specified file to the given directory on the server
+     * 
+     * @param $aFile Name and path of file to uploads
+     * @param $aUploadDir The directory on the server where the file should be stored
+     */
+    function Upload($aFile,$aUploadDir) {
+        $conn_id = @ftp_connect($this->iserver);
+        
+        if ( !$conn_id ) {
+            JpGraphError::Raise("FTP connection failed.\nAttempted to connect to {$this->iserver} for user {$this->iuid}.");
+        }
+ 
+        $login_result = ftp_login($conn_id, $this->iuid, $this->ipwd);
+        if ((!$conn_id) || (!$login_result)) {
+            JpGraphError::Raise("FTP login has failed.\nAttempted to connect to {$this->iserver} for user {$this->iuid}.",3);
+        }
+                 
+        syslog(LOG_INFO,JpGraphError::GetTitle()."Connected to {$this->iserver}");
+        
+        // Delete potential old file
+        $ftp_file = $aUploadDir.basename($aFile);
+        $res = @ftp_delete($conn_id,$ftp_file);
+        
+        // Upload new image
+        $upload = ftp_put($conn_id, $ftp_file, $aFile, FTP_BINARY);
+        if (!$upload) {
+            JpGraphError::Raise("FTP upload of image failed.");
+        }
+                 
+        syslog(LOG_INFO,JpGraphError::GetTitle()."Succesfully uploaded $aFile to {$this->iserver}.");
+        
+        @ftp_close($conn_id);        
+    } 
+}  
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch34s05.html b/includes/jpgraph/docs/chunkhtml/ch34s05.html new file mode 100644 index 0000000..a15993a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch34s05.html @@ -0,0 +1,576 @@ +Step 0: The full driver script

Step 0: The full driver script

+ +

For completeness we also include the exact main script we use

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+
#!/usr/bin/php
+<?php
+require_once 'jpgraph/jpgraph.php';
+require_once 'jpgraph/jpgraph_bar.php';
+require_once 'jpgraph/jpgraph_line.php';
+ 
+DEFINE('FTP_SERVER','aditus.nu');
+DEFINE('FTP_UID','aditus');
+DEFINE('FTP_PWD','Psion3a');
+ 
+DEFINE('PROCMAIL_LOGFILE','/tmp/procmail-ljp-200907.log');
+DEFINE('WINDOWSIZE',14); // nbr days window
+DEFINE('IMGFILE','/tmp/spamstat.png');
+ 
+DEFINE('FTP_DIR','www/jpgraph/img/');
+ 
+// Don't use image error handler, use syslog
+JpGraphError::SetImageFlag(false);
+JpGraphError::SetLogFile('syslog');
+ 
+/**
+* Class ParseProcmailLogFile
+*/
+class ParseProcmailLogFile {
+    private $iFileName='';
+    /**
+    * Constructor for the parse class
+    *
+    * @param mixed $aFileName  Log file to read
+    * @return ParseProcmailLogFile
+    */
+    function __construct($aFileName) {
+        $this->iFileName = $aFileName ;
+    }
+    /**
+    * Get line without trailing "\n"
+    *
+    * @param mixed $fp Filepointer
+    * @return string Read line without trailing "\n"
+    */
+    function GetLine($fp) {
+        $s = fgets($fp);
+        return substr($s,0,strlen($s)-1);
+    }
+    /**
+    * Get statistics from the parsed log file
+    *
+    * @param $aWindow Window size. How many days to include in the returned stats
+    * @return array with (date, number of killed spam, number of non killed spams)
+    */
+    function GetStat($aWindow) {
+ 
+        $fp = fopen($this->iFileName,'r');
+        if( $fp === false ) {
+            JpGraphError::Raise('Cannot read log file');
+        }
+ 
+        // Now loop through the file. We always keep the last 3 lines in
+        // the buffer to be able to get the context of a line since the
+        // folder is stored on one line and the date of the main on the
+        // previous line
+        $buf[1] = $this->GetLine($fp);
+        $buf[2] = $this->GetLine($fp);
+ 
+        $idx = 0;
+        $idx2 = 0;
+        $found = array(); // All /dev/null spam headers
+        $found2 = array(); // All Spam folder headers
+ 
+        // Loop through all lines in the file and store the found emails
+        // in the two $found arrays
+        while( ! feof($fp) ) {
+ 
+            //Shift buffer one step
+            $buf[0] = $buf[1];
+            $buf[1] = $buf[2];
+            $buf[2] = $this->GetLine($fp);
+ 
+            // Find /dev/null entries
+            if( strpos($buf[2],'Folder: /dev/null') !== false ) {
+                if( strpos($buf[0],'From ') !== false ) {
+                    $datepos = 0 ;
+                }
+                elseif( strpos($buf[1],'From ') !== false ) {
+                    $datepos = 1 ;
+                }
+                else {
+                    continue;
+                }
+                $date = strtotime(date('D j M Y',strtotime(substr($buf[$datepos],-24))));
+                $found[$idx++] = array(str_replace(' Subject: ','',$buf[1]),$date);
+            }
+ 
+            // Find spam folder entries
+            if( strpos($buf[2],'.Spam') !== false ) {
+                if( strpos($buf[0],'From ') !== false ) {
+                    $datepos = 0 ;
+                }
+                elseif( strpos($buf[1],'From ') !== false ) {
+                    $datepos = 1 ;
+                }
+                else {
+                    continue;
+                }
+                $date = strtotime(date('D j M Y',strtotime(substr($buf[$datepos],-24))));
+                $found2[$idx2++] = array(str_replace(' Subject: ','',$buf[1]),$date);
+            }
+ 
+        }
+ 
+        fclose($fp);
+ 
+        // Find out how many at each day of dev null
+        $date = $found[0][1];
+        $daystat[$date] = 0;
+ 
+        for($i=0; $i < $idx; ++$i ) {
+            if( $date == $found[$i][1] ) {
+                ++$daystat[$date];
+            }
+            else {
+                $date = $found[$i][1];
+                $daystat[$date] = 1;
+            }
+        }
+ 
+        // Find out how many at each day of spam
+        $daystat2 = array();
+        if( count($found2) > 0 ) {
+            $date = $found2[0][1];
+            $daystat2[$date] = 0;
+ 
+            for($i=0; $i < $idx2; ++$i ) {
+                if( $date == $found2[$i][1] ) {
+                    ++$daystat2[$date];
+                }
+                else {
+                    $date = $found2[$i][1];
+                    $daystat2[$date] = 1;
+                }
+            }
+        }
+ 
+        // Now make sure that both arrays have the same
+        // number of entries.
+        foreach( $daystat as $key => $val ) {
+            if( !isset($daystat2[$key]) ) {
+                $daystat2[$key] = 0;
+            }
+        }
+ 
+        foreach( $daystat2 as $key => $val ) {
+            if( !isset($daystat[$key]) ) {
+                $daystat[$key] = 0;
+            }
+        }
+ 
+        // Window and return the data
+        $n = count($daystat);
+        $start = $n > $aWindow ? $n - $aWindow : 0;
+        $date_keys = array_keys($daystat);
+        $idx=0;
+ 
+        $datax = array(); $datay1 = array(); $datay2 = array();
+        for( $i=$start; $i < $n; ++$i ) {
+            $datax[$idx] = date('D j M',$date_keys[$i]);
+            $datay1[$idx] = $daystat[$date_keys[$i]];
+            $datay2[$idx++] = $daystat2[$date_keys[$i]];
+        }
+ 
+        return array($datax,$datay1,$datay2);
+    }
+}
+/**
+* Class SpamGraph
+*/
+class SpamGraph {
+    /**
+    * Create an accumulated bar graph
+    *
+    * @param mixed $aFile File to write graph to
+    * @param mixed $aXData Date x-labels
+    * @param mixed $aYData Spam data 1 (/dev/null)
+    * @param mixed $aY2Data Spam data 2 (Spam folder)
+    */
+    static function Create($aFile,$aXData,$aYData,$aY2Data) {
+ 
+        $graph = new Graph(650,420);
+        $graph->SetMargin(40,20,50,110);
+        $graph->SetScale('textint');
+        $graph->SetMarginColor('khaki2@0.6');
+ 
+        $graph->legend->SetPos(0.5,0.97,'center','bottom');
+        $graph->legend->SetLayout(10);
+        $graph->legend->SetFillColor('white');
+        $graph->legend->SetFont(FF_ARIAL,FS_NORMAL,10);
+ 
+        $graph->title->Set('Identified spams');
+        $graph->title->SetMargin(10);
+        $graph->title->SetFont(FF_ARIAL,FS_NORMAL,14);
+ 
+        $graph->subtitle->Set('(Updated: '.date('j M Y, H:i'.' T)'));
+        $graph->subtitle->SetMargin(5);
+        $graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,11);
+ 
+        $graph->xaxis->SetTickLabels($aXData);
+        $graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
+        $graph->xaxis->SetLabelAngle(45);
+ 
+        $graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,10);
+        $graph->yscale->SetGrace(10);
+ 
+        $bar1 = new BarPlot($aYData);
+        $bar1->SetFillGradient('darkred:1.2','darkred:0.7',GRAD_VER);
+        $bar1->SetLegend('To "/dev/null"');
+ 
+        $bar2 = new BarPlot($aY2Data);
+        $bar2->SetFillGradient('orange','orange:0.7',GRAD_VER);
+        $bar2->SetLegend('To Spam folder');
+ 
+        $abar = new AccBarPlot(array($bar1,$bar2));
+        $abar->value->Show();
+        $abar->value->SetFormat('%d');
+        $graph->Add($abar);
+        $graph->Stroke($aFile);
+        syslog(LOG_INFO,"Created spam image in $aFile.");
+    }
+}
+/**
+* Class FTP
+*/
+class FTP {
+    private $iserver='', $iuid='',$ipwd='';
+    function __construct($aServer,$aUID,$aPWD) {
+        $this->iserver = $aServer;
+        $this->iuid = $aUID;
+        $this->ipwd = $aPWD;
+    }
+    function Upload($aFile,$aUploadDir) {
+        $conn_id = @ftp_connect($this->iserver);
+ 
+        if ( !$conn_id ) {
+            JpGraphError::Raise("FTP connection failed.\nAttempted to connect to {$this->iserver} for user {$this->iuid}.");
+        } else {
+            syslog(LOG_INFO,"Connected to {$this->iserver}");
+        }
+        $login_result = ftp_login($conn_id, $this->iuid, $this->ipwd);
+        if ((!$conn_id) || (!$login_result)) {
+            JpGraphError::Raise("FTP login has failed.\nAttempted to connect to {$this->iserver} for user {$this->iuid}.",3);
+        } else {
+            syslog(LOG_INFO,"Logged in to {$this->iserver}");
+        }
+ 
+        // Delete potential old file
+        $ftp_file = $aUploadDir.basename($aFile);
+        $res = @ftp_delete($conn_id,$ftp_file);
+        syslog(LOG_INFO,"Uploading image as $aFile");
+ 
+        // Upload new image
+        $upload = ftp_put($conn_id, $ftp_file, $aFile, FTP_BINARY);
+        if (!$upload) {
+            JpGraphError::Raise("FTP upload of image failed.");
+        } else {
+            syslog(LOG_INFO,"Succesfully uploaded $aFile to {$this->iserver}.");
+        }
+ 
+        @ftp_close($conn_id);
+    }
+}
+ 
+// Step 1) Get the statistics
+$parser = new ParseProcmailLogFile(PROCMAIL_LOGFILE);
+list($xdata, $ydata, $y2data) = $parser->GetStat(WINDOWSIZE);
+ 
+ 
+// Step 2) Create the graph
+SpamGraph::Create(IMGFILE,$xdata,$ydata,$y2data);
+ 
+// Step 3) Upload the file if defined
+if( IMGFILE !== '' ) {
+    $ftp = new FTP(FTP_SERVER,FTP_UID,FTP_PWD);
+    $ftp->Upload(IMGFILE,FTP_DIR);
+}
+ 
+?>

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35.html b/includes/jpgraph/docs/chunkhtml/ch35.html new file mode 100644 index 0000000..81ac8b2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35.html @@ -0,0 +1,177 @@ +Chapter 35. Creating Critical chain buffer penetration charts

Chapter 35. Creating Critical chain buffer penetration charts

+ +

Introduction and purpose

+ +

Critical chain is one (of many) suggested principles for project management that + actually makes some sense in the meaning that it tries to take into account both the + human aspect of making time estimates (it is difficult) as well as the different + constraints put upon (for example) a SW project. Such constraints are typically that + there are only two persons with the knowledge to do task X or that task Y has never + been done before and therefore is almost impossible to estimate correctly.

+

Since this manual has no intention to serve as an introduction to full critical + chain project management (CCPM) we will not dwell on the finer details instead we + will take out one particular part, or rather a tool, that is one of the fundamental + ways of keeping track of a projects using CCPM. The buffer penetration chart.

+

Even though CCPM in general might not be of interest to the reader the particular + graph we will create is s good way to show how to think "out-of-the-box" in creating + some graphs with the this library. So it is fully possible to read this case without + understanding the underlying methodology.

+

The graph we will create makes use of ( among other things)

+

+

  • +

    Filled area graphs combined with scatter plots

    +
  • +

    Showing how to modify the default fill behavior (from the + x-axis)

    +
  • +

    Showing how to disable the 0-labels

    +
  • +

    Adjusting the display depth for grid lines (and changing the styler of + grid lines)

    +
  • +

    Using different colors on individual scale labels

    +
  • +

    How to create a custom graph class that can be reused

    +

+

+

Figure 35.1. Critical chain buffer penetration. Each white scatter dot represents the + state of one task. shows a typical example of what we will + accomplish by the end of this case study

+

Figure 35.1. Critical chain buffer penetration. Each white scatter dot represents the + state of one task.

+ +
Critical chain buffer penetration. Each white scatter dot represents the state of one task.
+

+

The principle behind buffer penetration charts

+ +

While not strictly necessary in order to create the graph the following crash + course on buffer penetration might help see the usefulness of these types of + charts in large projects.

+

+

Note

+

Those wanting to know more about Critical Chain planning are referred + to the book and online references at the end of this chapter, see [1] Critical chain Project Management, 2ed, Lawrence P. Leach and [2] A Guide to Implementing the Theory of Constraints, K. J. Youngman, .

+

+

+

To understand the principles of this graph we need to shortly discuss how task + (time) estimation is done using the CC methodology. Time estimation for a task + is divided in two parts; 1) the optimum time and 2) the contingency buffer. + Together they will make up the allocated time for a task. On average each task + is expected to make use of some of the contingency buffer (typically as much as + 50-75%).

+

This might seem very strange for people with experience with other + methodologies where use of contingency time is an indication of some kind of + failure. However, that is not the case in CCPM. The usage of (some) of the + allocated buffers are expected. This comes from the way the buffer and the + "optimum" time are estimated. The optimum time is a 50% estimate, meaning that + the task is only expected to be able to go that fast in 50% of all the times the + task is performed. Hence a very optimistic estimate. With the contingency buffer + added the estimate should correspond to a 90% estimate, i.e. in 90% of the times + the task is performed it will finish within this time.

+

The graph in Figure 35.1. Critical chain buffer penetration. Each white scatter dot represents the + state of one task. is a way to visualise the + status of an entire project in terms of buffer penetration. The x-axis shows how + much of a particular task is completed and the y-axis shows how much buffer up + to now have been used. Another way of viewing this is to show how far off the + optimum 50% time estimate for the task we are in practice.

+

The different colored background is a "health" monitor for the tasks. As long + as a task is in the green area that task is not in the focus for corrective + actions. However as the task moves from green through yellow and into the red + this is a signal that immediate actions are needed to secure the end delivery + time. If a task has gone into the dark red (or brown) area this is an indication + that corrective actions are probably not going to help and a re-planning of the + task (and potentially the project is needed). Hence we do not want any tasks in + the brown area!

+

The exact limits for what is considered "green", "yellow" and "red" varies + depending on the context and to some degree the flexibility and size of the team + but the default values shown above represents a fairly average limits that have + been shown to be useful indicators across several industries.

+

The final key to why this works fairly well in practice is that each team + member only have to report one figure in order to track the progress he or she + is making and that is how much time more he or she will need to complete the + task. Since we now at what day the team member made the estimate we have all the + information we need in order to update the plans to see how well we are tracking + the original plan.

+

With the CC methodology we do not bother looking in the mirror and asking the + team member to estimate how much of the task he or she has done because that is + really irrelevant. The only key figure we need to complete the project on time + is to how much more effort/time is needed from the team member. How much of the + task has been completed can easily be calculated by knowing how much time is + left and compare that with the original estimate. For example, if the original + estimate was12 days and the team member at a particular day estimates that + he/she has 10 days left we can say that we have completed (12-10)/12 ~ 17% of + the task.

+

This also explains how it can come that we could get negative completion. This + is just an indication that the original estimate was too low. For example if the + task was originally estimated to 12 days and at a particular day the team member + estimates that he/she will need at least 16 more days to complete the task the + completion % would be (12-16)/12 ~ -33%

+

An example will illustrate how this works.

+

+

Example 35.1. Buffer penetration example

+ +

Assume we have one task that has a 50% estimate of 6 days and a buffer + of 5 days (indicating the volatility in the 50% estimate). The following + table shows how much time left the team member estimates he has at the + end of each working day. This single number allows us to compute (in + relation to the original estimate) how much of the task is completed and + how much buffer the member has used.

+

+

+
Day +

Est. time left

+

(days)

+
+

Completion

+

%

+
+

Buffer penetration

+

(days)

+
+

Buffer penetration

+

(%)

+
15000
25(6-5)/6 ~ 17%11/5 = 20%
35(6-5)/6 ~17%22/5 = 40%
45(6-5)/6 ~ 17%33/5 = 60%
54(6-4)/6 ~ 33%33/5 = 60%
63(6-3)/6 ~ 50%33/5 = 60%
72(6-2)/6 ~ 67%33/5 = 60%
81(6-1)/6 ~ 83 %33/5 = 60%
90(6-0)/6 = 100%33/5 = 60%
+

+

+

The following three (small) buffer penetration diagram shows how the + task at end of days 2,5 and 8

+

Figure 35.2. Buffer penetration chart for example

+ +
Buffer penetration chart for example
+

+

Figure 35.2. Buffer penetration chart for example hows a fairly typical + (albeit not ideal) progress for a task. It gets a rocky start, has some + problems halfway through and then manages to recover towards the end of + the execution.

+

A common extension to the graph above is to also add a "historic" tail + to the scatter point to show how it historically has moved. Adding a + historic "tail" at day 8 would give the following penetration + chart

+

Figure 35.3. Buffer penetration chart with "historic" tail

+ +
Buffer penetration chart with "historic" tail
+

+


+

+

For an entire project these kind of "falling star" traces can be quite + effective ways to see how tasks are progressing. We end this chapter with a + final complete example (which uses the code we will develop in the following + sections) to create a buffer chart for two tasks.

+

+

Figure 35.4. Complete buffer penetration example with history trace (ccbp_ex1.php)

Complete buffer penetration example with history trace (ccbp_ex1.php)


+

+

We can also use the alternative color map for this and get the result shown in + Figure 35.5. Using the alternative color map (ccbp_ex2.php)

+

+

Figure 35.5. Using the alternative color map (ccbp_ex2.php)

Using the alternative color map (ccbp_ex2.php)


+

+

The next section will explain in some details how to create a class that can + mae these types of charts with an easy to use interface.

+
+
+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s02.html b/includes/jpgraph/docs/chunkhtml/ch35s02.html new file mode 100644 index 0000000..7005437 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s02.html @@ -0,0 +1,229 @@ +Creating a utility class to construct CC BP charts

Creating a utility class to construct CC BP charts

+ +

We will start from a high level and think about how we would like to be able to + use such a utility class. Ideally it would be similar to other types of graphs + classes. To keep things simple we want the following parameter to be + adjustable

+

+

  • +

    The min and max x- and y-axis scale values to be displayed in the + graph

    +
  • +

    The limits for the color indications, i.e. exactly what is the green, + yellow, red and brown areas should be customizable. In oder to keep the + interface simple we assume that the areas are bounded by straight lines + and that we want to be able to specify the areas by stating the value at + x=0 and the value at x=maximum x-scale

    +

    So for example the standard green area is limited by the specification + (5,75) meaning that the green line crosses y=5 at x=0 and y=75 at + x=100

    +
  • +

    We would also like to be ale to adjust the colors used as + indicators

    +
  • +

    We want to be able to add both scatter marks and lines (to show + history)

    +
  • +

    We also need to be able to specify the title and the sub title

    +
  • +

    The rest of the graph options and setting we would like the utility + class to handle for us. As a bonus it would be nice if the class + adjusted the size of the fonts to the overall size we have specified for + the graph automatically to make it look visually proportional.

    +

+

+

When doing designs like this it is always good to first write a small test driver + without having to think about how to actually implement it. This keeps an end user + perspective on things. Later on we can do changes if it turns out that a particular + simplification for the user is simply too complex to implement.

+

So, lets think about how we (ideally) would like to be able to create the chart + shown in Figure 35.3. Buffer penetration chart with "historic" tail

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+$graph = new CCBPGraph(300,250);
+$graph->SetTitle('Buffer penetration','(history)');
+ 
+$datax=array(83); $datay=array(60);
+$datax_history = array(0,17,17,17,33,50,67,83); 
+$datay_history = array(0,20,40,60,60,60,60,60);
+ 
+$sp = new ScatterPlot($datay,$datax);
+$sp->mark->SetType(MARK_DIAMOND);
+$sp->mark->SetFillColor('white');
+$sp->mark->SetSize(10);
+ 
+$sp_hist = new LinePlot($datay2,$datax2);
+$sp_hist->SetWeight(2);
+$sp_hist->SetColor('black');
+ 
+$graph->Add($sp_hist);
+$graph->Add($sp);
+ 
+$graph->Stroke();
+?>

+

+

We cannot hope to have the class make it any simpler than this. This is as close + to a "normal" line graph we can get (apart from the color indications in the + background). So now its just a matter on designing this class.

+

Since the utility class will be a rather restricted graph class it with a very + specific usage it doesn't make sense to implement it as an extension to the normal + graph. Instead we will create contain class that contains a graph that we can modify + and setup. (In UML language a has-a + relation.)

+

We will name our utility class CCBPGraph (Short for Critical chain Buffer Penetration Graph). The class + should have the following signature

+

+

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+class CCBPGraph{ 
+    private $graph = null ; // The real graph instance
+ 
+    // The "normal" constructor
+    public function __construct($aWidth,$aHeight) {}
+ 
+    // Methods that will control the appearance
+    public function SetTitle($aTitle,$aSubTitle) {}
+    public function SetXMinMax($aMin,$aMax) {}
+    public function SetYMinMax($aMin,$aMax) {}
+    public function SetColorIndication($aSpec,$aColors=null) {}
+    public function SetColorMap($aMap) {}
+    
+    // Internal function to create and setup the graph
+    private function Init() {}
+    
+    // Mimix the standard graph functions Add() and Stroke()
+    public function Add($aPlots) {}
+    public function Stroke($aFile='') {}
+}
+?>

+

+

In addition the class must have a number of instance variables that are used to + store the settings until we need them when we create the graph. However to keep + things simple here we do not list them above. Lets now walk through the four groups + of methods.

+

+

  1. +

    The constructor

    +

    +

    public function __construct($aWidth,$aHeight) {}

    +

    +

    The constructor doesn't need to do very much. It just needs to store + the user specified width and height so we get them back when we create + the actual graph. We could also make use of the constructor to create an + instance of the real graph class but we prefer to do as late as possible + instantiation.

    +
  2. +

    Controlling the appearance of the graph.

    +

    Again these methods will be very basic "setter" methods that will just + store the user specified options until we need them when we construct + the graph

    +

    +

    public function SetTitle($aTitle,$aSubTitle) {} 
    +public function SetXMinMax($aMin,$aMax) {} 
    +public function SetYMinMax($aMin,$aMax) {} 
    +public function SetColorIndication($aSpec,$aColors=null) {}
    +public function SetColorMap($aMap) {}

    +

    +

    For the color setter we should also add some basic error checking so + that the parameter makes sense.

    +
  3. +

    The real worker method

    +

    +

    private function Init() {}

    +

    +

    Since this is the method is where we will do the actual work and will + be fairly large we will spend the entire next section on this + method.

    +
  4. +

    The "fake" standard methods. Add() and Stroke(). Since these are + fairly short we will show them here in there entirety

    +

    +

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +
    <?php
    +function Add($aPlots) {
    +    if( is_array($aPlots) ) {
    +        $this->iPlots = array_merge($this->iPlots,$aPlots);                
    +    }
    +    else {
    +        $this->iPlots[] = $aPlots;
    +    }
    +}
    +    
    +function Stroke($aFile='') {
    +    $this->Init();
    +    $this->graph->Add($this->iPlots);
    +    $this->graph->Stroke($aFile);
    +}
    +?>

    +

    +

    When adding plots (with the Add() method) we have to take + into account that the parameter can be either a single object or an + array of plot objects (line and scatter plots) and we must handle that + accordingly as is done above.

    +

    For the Stroke() method we use this to call the + initialization method (to actually create the graph) and then add the + user specified plots and finally call the real + Graph::Stroke() of the graph.

    +

    These methods are very simple but from the outside it will look like a + "real" graph class with a clean and simple interface.

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s03.html b/includes/jpgraph/docs/chunkhtml/ch35s03.html new file mode 100644 index 0000000..3ace0d5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s03.html @@ -0,0 +1,33 @@ +The Init() method

The Init() method

+ +

This is the real method that actually constructs the graph. While we will not go + through every single line in details we will highlight the complications and some + formatting options we have used.

+

Creating the colored backgrounds

+ +

In order to create the colored background we create filled area plots and add + them to the graph. Starting with the "brown" and successively adding the rest to + create the colored band effect we want. Figure 35.6. Steps to create the background shows in "slow-motion" how this is + done by adding four area plots, one at a time.

+

Figure 35.6. Steps to create the background

+ +
Steps to create the background
+

+

The exact position for the lines are calculated with the positions given for + each color band. The position for each color band is specified by giving the + y-coordinate at x=0 and the y-coordinate at the maximum x-scale value.

+

When adding the area plots there is one thing we have to modify. By default + the fill is done between the line and the y=0 line. In our case we need the fill + to go all the way down to the min y-value. To change this behavior we need to + call the method

+

+

  • +

    LinePlot::SetFillFromYMin()

    +

+

+

for each of the areas.

+
+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s03s02.html b/includes/jpgraph/docs/chunkhtml/ch35s03s02.html new file mode 100644 index 0000000..d1e8b0a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s03s02.html @@ -0,0 +1,21 @@ +Getting the grid lines right

Getting the grid lines right

+ +

Since we want some discrete horizontal grid lines we might think that it is + enough to do the normal

+

+

1
+
$graph->ygrid->Show();

+

+

However, doing that will not show any grid lines. The reason is hat by default + the grid lines are drawn at the bottom of the plot. Since we have filled area + plots covering 100% of the pot area no grid lines would show. In order to change + this we need to move the grid line to the front with a call to the method

+

+

  • +

    Graph::SetGridDepth($aDepth)

    +

+

+

using the argument DEPTH_FRONT. The rest of the grid line + formatting is just basic style and color modification to make the grid visible + but just barely.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s03s03.html b/includes/jpgraph/docs/chunkhtml/ch35s03s03.html new file mode 100644 index 0000000..d484485 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s03s03.html @@ -0,0 +1,24 @@ +Getting the scale and labels right

Getting the scale and labels right

+ +

For this type of graph we have manually set the distance between each tick + label to 25 units. This would put labels as 0,25,50, and so on. The maximum + value (the user specifies) will be adjusted so that it is always an even + multiple of 25 to allow the last tick mark to be at the end of the axis.

+

As can be seen from the previous images we are using one feature that hasn't + been previously exemplified and that is the possibility to have unique colors on + each label on the scale. We use this for the x-scale by having the negative + labels in black and the positive labels in white. The reason is purely + functional to allow the scale labels to be more easy to read against the colored + background.

+

The color of the labels are specified as the second argument to

+

+

  • +

    Axis::SetColor($aAxisColor,$aLabelColor)

    +

+

+

In addition we have also hidden the zero labels since they would just be + disturbing in the middle and doesn't really add any information we don't already + have.

+

Finally the labels are formatted to show a percentage sign after each label. + This is done by a format string

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s03s04.html b/includes/jpgraph/docs/chunkhtml/ch35s03s04.html new file mode 100644 index 0000000..522169f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s03s04.html @@ -0,0 +1,8 @@ +Adjusting the margin and text sizes

Adjusting the margin and text sizes

+ +

In the beginning of the Init() method the margins for the graph + is adjusted depending on the actual size the user specified. The same goes with + establishing the basic font size used for the scale labels as well as the titles + (both graph and axis). The size is just based on heuristics on what (in our + view) gives a well balanced graph.

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s04.html b/includes/jpgraph/docs/chunkhtml/ch35s04.html new file mode 100644 index 0000000..abc0414 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s04.html @@ -0,0 +1,34 @@ +Suggested improvements

Suggested improvements

+ +

As means for further individual exploration the CCBPGraph class could + be extended by adding (for example) the following features. (There is always a + balance to be had between adding a lot of feature and still keeping the interface + simple enough to be manageable)

+

+

  1. +

    Add customization for the titles of the two axis

    +
  2. +

    Make it possible to adjust the margin color

    +
  3. +

    Make the number of background color bands user adjustable

    +
  4. +

    Add data manipulation so that the input data is specified as a number + of historic values for each task. The latest value should be displayed + as a mark and the last n values (user + selectable window size) shown as a trailing path behind the mark to see + how it has moved as shown in for example Figure 35.4. Complete buffer penetration example with history trace (ccbp_ex1.php)

    +
  5. +

    Make use of the MGraph class to make it possible to + create multiple CCBP charts in the same image. In order to identify + which graph is affected by commands ti would be possible to just add a + new argument giving the index to all the existing methods. However, a + cleaner implementation would probably use the concept of a "current" + graph which receives all the method calls. Implementing it that way + would allow us to keep the existing signatures for all existing methods. + In order to position the graphs it is probably a good idea to make use + of some easy way for the user just to select how many rows should be + used and many charts should be displayed on each row (to avoid the end + user from having to position the graphs pixel by pixel)

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s05.html b/includes/jpgraph/docs/chunkhtml/ch35s05.html new file mode 100644 index 0000000..1e6643c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s05.html @@ -0,0 +1,524 @@ +The implementation of class CCBPGraph

The implementation of class CCBPGraph

+ +

The entire implementation is included below and is also available en the + "Example/" directory of the distribution as + "ccbpgraph.class.php". There are also two example scripts + using this utility class "ccbp_ex1.php" and + "ccbp_ex2.php"

+

+

Example 35.2.  (ccbpgraph.class.php)

1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+
<?php // content="text/plain; charset=utf-8" 
+/**
+* Class CCBPGraph
+* Utility class to create Critical Chain Buffer penetration charts
+*/
+class CCBPGraph {
+    const TickStep = 25;
+    const YTitle = '% Buffer used';
+    const XTitle = '% CC Completed';
+    const NColorMaps = 2;
+    private $graph=null;
+    private $iWidth,$iHeight;
+    private $iPlots=array();
+    private $iXMin=-50, $iXMax = 100;
+    private $iYMin=-50, $iYMax = 150;
+    private $iColorInd = array( 
+        array(5,75),   /* Green */
+        array(25,85),  /* Yellow */
+        array(50,100));/* Red */ 
+    private $iColorMap = 0;
+    private $iColorSpec = array(
+                array('darkgreen:1.0','yellow:1.4','red:0.8','darkred:0.85'),
+                array('#c6e9af','#ffeeaa','#ffaaaa','#de8787'));
+    private $iMarginColor = array('darkgreen@0.7','darkgreen@0.9');                
+    private $iSubTitle='',$iTitle = 'CC Buffer penetration';
+    /**
+    * Construct a new instance of CCBPGraph 
+    * 
+    * @param int $aWidth
+    * @param int $aHeight
+    * @return CCBPGraph
+    */
+    public function __construct($aWidth, $aHeight) {
+        $this->iWidth = $aWidth;
+        $this->iHeight = $aHeight;
+    }
+    /**
+    * Set the title and subtitle for the graph
+    * 
+    * @param string $aTitle
+    * @param string $aSubTitle
+    */
+    public function SetTitle($aTitle, $aSubTitle) {
+        $this->iTitle = $aTitle;
+        $this->iSubTitle = $aSubTitle;
+    }
+    /**
+    * Set the x-axis min and max values
+    * 
+    * @param int $aMin
+    * @param int $aMax
+    */
+    public function SetXMinMax($aMin, $aMax) {
+        $this->iXMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+        $this->iXMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+    }
+    /**
+    * Specify what color map to use
+    * 
+    * @param int $aMap
+    */
+    public function SetColorMap($aMap) {
+        $this->iColorMap = $aMap % CCBPGraph::NColorMaps;
+    }
+    /**
+    * Set the y-axis min and max values
+    * 
+    * @param int $aMin
+    * @param int $aMax
+    */
+    public function SetYMinMax($aMin,$aMax) {
+        $this->iYMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+        $this->iYMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+    }
+    /**
+    * Set the specification of the color backgrounds and also the
+    * optional exact colors to be used
+    * 
+    * @param mixed $aSpec  An array of 3 1x2 arrays. Each array specify the 
+    * color indication value at x=0 and x=max x in order to determine the slope
+    * @param mixed $aColors  An array with four elements specifying the colors
+    * of each color indicator
+    */
+    public function SetColorIndication(array $aSpec,array $aColors=null) {
+        if( count($aSpec) !== 3 ) {
+            JpgraphError::Raise('Specification of scale values for background indicators must be an array with three elements.');
+        }
+        $this->iColorInd = $aSpec;    
+        if( $aColors !== null ) {
+            if( is_array($aColors) && count($aColors) == 4 ) {
+                $this->iColorSpec = $aColors;
+            }
+            else {
+                JpGraphError::Raise('Color specification for background indication must have four colors.');
+            }
+        }        
+    }
+    /**
+    * Construct the graph
+    * 
+    */
+    private function Init() {
+ 
+        // Setup limits for color indications
+        $lowx = $this->iXMin; $highx= $this->iXMax;
+        $lowy = $this->iYMin; $highy = $this->iYMax;
+         $width=$this->iWidth; $height=$this->iHeight;
+ 
+        // Margins
+        $lm=50; $rm=40;
+        $tm=60; $bm=40;
+        
+        if( $width <= 300 || $height <= 250 ) {
+            $labelsize = 8;
+            $lm=25; $rm=25;
+            $tm=45; $bm=25;
+        }                
+        elseif( $width <= 450 || $height <= 300 ) {
+            $labelsize = 8;
+            $lm=30; $rm=30;
+            $tm=50; $bm=30;
+        }
+        elseif( $width <= 600 || $height <= 400 ) {
+            $labelsize = 9;        
+        }
+        else {
+            $labelsize = 11;
+        }    
+        
+        if( $this->iSubTitle == '' ) {
+            $tm -= $labelsize+4;
+        }     
+ 
+        $graph = new Graph($width,$height);
+        $graph->SetScale('intint',$lowy,$highy,$lowx,$highx);
+        $graph->SetMargin($lm,$rm,$tm,$bm);
+        $graph->SetMarginColor($this->iMarginColor[$this->iColorMap]);
+        $graph->SetClipping();
+        
+        $graph->title->Set($this->iTitle);
+        $graph->subtitle->Set($this->iSubTitle);
+        
+        $graph->title->SetFont(FF_ARIAL,FS_BOLD,$labelsize+4);
+        $graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,$labelsize+1);
+        
+        $graph->SetBox(true,'black@0.3');
+ 
+        $graph->xaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize);
+        $graph->yaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize);
+        
+        $graph->xaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep);
+        $graph->yaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep);
+        
+        $graph->xaxis->HideZeroLabel();
+        $graph->yaxis->HideZeroLabel();
+                
+        $graph->xaxis->SetLabelFormatString('%d%%');
+        $graph->yaxis->SetLabelFormatString('%d%%');
+        
+        // For the x-axis we adjust the color so labels on the left of the Y-axis are in black
+        $n1 = floor(abs($this->iXMin/25))+1;
+        $n2 = floor($this->iXMax/25);
+        if( $this->iColorMap == 0 ) {
+            $xlcolors=array();
+            for( $i = 0; $i < $n1; ++$i ) {
+                $xlcolors[$i] = 'black';
+            }
+            for( $i = 0; $i < $n2; ++$i ) {
+                $xlcolors[$n1+$i] = 'lightgray:1.5';
+            }
+            $graph->xaxis->SetColor('gray',$xlcolors);
+            $graph->yaxis->SetColor('gray','lightgray:1.5');
+        }
+        else {
+            $graph->xaxis->SetColor('darkgray','darkgray:0.8');
+            $graph->yaxis->SetColor('darkgray','darkgray:0.8');            
+        }
+        $graph->SetGridDepth(DEPTH_FRONT);
+        $graph->ygrid->SetColor('gray@0.6');
+        $graph->ygrid->SetLineStyle('dotted');
+        
+        $graph->ygrid->Show();
+        
+        $graph->xaxis->SetWeight(1);
+        $graph->yaxis->SetWeight(1);
+        
+        $ytitle = new Text(CCBPGraph::YTitle,floor($lm*.75),($height-$tm-$bm)/2+$tm);
+        #$ytitle->SetFont(FF_VERA,FS_BOLD,$labelsize+1);
+        $ytitle->SetAlign('right','center');
+        $ytitle->SetAngle(90);
+        $graph->Add($ytitle);
+        
+        $xtitle = new Text(CCBPGraph::XTitle,($width-$lm-$rm)/2+$lm,$height - 10);
+        #$xtitle->SetFont(FF_VERA,FS_BOLD,$labelsize);
+        $xtitle->SetAlign('center','bottom');
+        $graph->Add($xtitle);
+        
+        $df = 'D j:S M, Y'; 
+        if( $width < 400 ) {
+            $df = 'D j:S M';
+        }
+        
+        $time = new Text(date($df),$width-10,$height-10);
+        $time->SetAlign('right','bottom');
+        #$time->SetFont(FF_VERA,FS_NORMAL,$labelsize-1);
+        $time->SetColor('darkgray');
+        $graph->Add($time);
+ 
+        // Use an accumulated fille line graph to create the colored bands
+       
+        $n = 3;
+        for( $i=0; $i < $n; ++$i ) {
+            $b = $this->iColorInd[$i][0];
+            $k = ($this->iColorInd[$i][1] - $this->iColorInd[$i][0])/$this->iXMax;
+            $colarea[$i] = array( array($lowx,$lowx*$k+$b), array($highx,$highx*$k+$b) );
+        }
+        $colarea[3] = array( array($lowx,$highy), array($highx,$highy) );
+        
+        
+        $cb = array();
+        for( $i=0; $i < 4; ++$i ) {
+            $cb[$i] = new LinePlot(array($colarea[$i][0][1],$colarea[$i][1][1]),
+                                   array($colarea[$i][0][0],$colarea[$i][1][0]));
+            $cb[$i]->SetFillColor($this->iColorSpec[$this->iColorMap][$i]);
+            $cb[$i]->SetFillFromYMin();                                   
+        }
+ 
+        $graph->Add(array_slice(array_reverse($cb),0,4));    
+        $this->graph = $graph;
+    }
+    /**
+    * Add a line or scatter plot to the graph
+    * 
+    * @param mixed $aPlots
+    */
+    public function Add($aPlots) {
+        if( is_array($aPlots) ) {
+            $this->iPlots = array_merge($this->iPlots,$aPlots);                
+        }
+        else {
+            $this->iPlots[] = $aPlots;
+        }
+    }
+    /**
+    * Stroke the graph back to the client or to a file
+    * 
+    * @param mixed $aFile
+    */
+    public function Stroke($aFile='') {
+        $this->Init();
+        if( count($this->iPlots) > 0 )  {
+            $this->graph->Add($this->iPlots);
+        }
+        $this->graph->Stroke($aFile);
+    }
+}
+?>


+

+
diff --git a/includes/jpgraph/docs/chunkhtml/ch35s06.html b/includes/jpgraph/docs/chunkhtml/ch35s06.html new file mode 100644 index 0000000..2777733 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/ch35s06.html @@ -0,0 +1,10 @@ +References

References

+ +

+

[1] Critical chain Project Management, 2ed, Lawrence P. Leach
+

Artech House, ISBN 1-58053-903-3

+
[2] A Guide to Implementing the Theory of Constraints, K. J. Youngman,
+

http://www.dbrmfg.co.nz/Projects Project Buffers.htm

+

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/checkmark-plain.gif b/includes/jpgraph/docs/chunkhtml/checkmark-plain.gif new file mode 100644 index 0000000..789a078 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/checkmark-plain.gif differ diff --git a/includes/jpgraph/docs/chunkhtml/checkmark.png b/includes/jpgraph/docs/chunkhtml/checkmark.png new file mode 100644 index 0000000..7988369 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/checkmark.png differ diff --git a/includes/jpgraph/docs/chunkhtml/example_src/.html b/includes/jpgraph/docs/chunkhtml/example_src/.html new file mode 100644 index 0000000..7800497 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/.html @@ -0,0 +1 @@ +001: Cannot read souce file: /root/jpgraph/trunk/src/Examples/.php diff --git a/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex01.html b/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex01.html new file mode 100644 index 0000000..7843d75 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex01.html @@ -0,0 +1,62 @@ +
accbarframeex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay1=array(13,8,19,7,17,6);
+$datay2=array(4,5,2,7,5,25);
+ 
+// Create the graph.
+$graph = new Graph(350,250);
+$graph->SetScale('textlin');
+$graph->SetMarginColor('white');
+ 
+// Setup title
+$graph->title->Set('Acc bar with gradient');
+ 
+// Create the first bar
+$bplot = new BarPlot($datay1);
+$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
+$bplot->SetColor('darkred');
+ 
+// Create the second bar
+$bplot2 = new BarPlot($datay2);
+$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
+$bplot2->SetColor('darkgreen');
+ 
+// And join them in an accumulated bar
+$accbplot = new AccBarPlot(array($bplot,$bplot2));
+$graph->Add($accbplot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex02.html b/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex02.html new file mode 100644 index 0000000..8018720 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex02.html @@ -0,0 +1,66 @@ +
accbarframeex02.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay1=array(13,8,19,7,17,6);
+$datay2=array(4,5,2,7,5,25);
+ 
+// Create the graph.
+$graph = new Graph(350,250);
+$graph->SetScale('textlin');
+$graph->SetMarginColor('white');
+ 
+// Setup title
+$graph->title->Set('Acc bar with gradient');
+ 
+// Create the first bar
+$bplot = new BarPlot($datay1);
+$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
+$bplot->SetColor('darkred');
+ 
+// Create the second bar
+$bplot2 = new BarPlot($datay2);
+$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
+$bplot2->SetColor('darkgreen');
+ 
+// And join them in an accumulated bar
+$accbplot = new AccBarPlot(array($bplot,$bplot2));
+$accbplot->SetColor('red');
+$accbplot->SetWeight(1);
+$graph->Add($accbplot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex03.html b/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex03.html new file mode 100644 index 0000000..c3ce20d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/accbarframeex03.html @@ -0,0 +1,70 @@ +
accbarframeex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay1=array(13,8,19,7,17,6);
+$datay2=array(4,5,2,7,5,25);
+ 
+// Create the graph.
+$graph = new Graph(350,250);
+$graph->SetScale('textlin');
+$graph->SetMarginColor('white');
+ 
+// Setup title
+$graph->title->Set('Acc bar with gradient');
+ 
+// Create the first bar
+$bplot = new BarPlot($datay1);
+$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
+$bplot->SetColor('darkred');
+$bplot->SetWeight(0);
+ 
+// Create the second bar
+$bplot2 = new BarPlot($datay2);
+$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
+$bplot2->SetColor('darkgreen');
+$bplot2->SetWeight(0);
+ 
+// And join them in an accumulated bar
+$accbplot = new AccBarPlot(array($bplot,$bplot2));
+$accbplot->SetColor('darkgray');
+$accbplot->SetWeight(1);
+$graph->Add($accbplot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/antispamex01.html b/includes/jpgraph/docs/chunkhtml/example_src/antispamex01.html new file mode 100644 index 0000000..05b8db3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/antispamex01.html @@ -0,0 +1,34 @@ +
antispamex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
<?php // content="text/plain; charset=utf-8"
+// Antispam example using a random string
+require_once "jpgraph/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');
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/aqua_example.html b/includes/jpgraph/docs/chunkhtml/example_src/aqua_example.html new file mode 100644 index 0000000..a5a4776 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/aqua_example.html @@ -0,0 +1,116 @@ +
aqua_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new AquaTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "AquaTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex01.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex01.html new file mode 100644 index 0000000..3943040 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex01.html @@ -0,0 +1,70 @@ +
axislabelbkgex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_NONE"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_NONE,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex02.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex02.html new file mode 100644 index 0000000..f6de7bf --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex02.html @@ -0,0 +1,70 @@ +
axislabelbkgex02.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_XAXIS"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_XAXIS,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex03.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex03.html new file mode 100644 index 0000000..420cef4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex03.html @@ -0,0 +1,70 @@ +
axislabelbkgex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_YAXIS"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_YAXIS,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex04.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex04.html new file mode 100644 index 0000000..6e74911 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex04.html @@ -0,0 +1,70 @@ +
axislabelbkgex04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_YAXISFULL"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_YAXISFULL,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex05.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex05.html new file mode 100644 index 0000000..5bd792a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex05.html @@ -0,0 +1,70 @@ +
axislabelbkgex05.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_XAXISFULL"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_XAXISFULL,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex06.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex06.html new file mode 100644 index 0000000..d6fd9ad --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex06.html @@ -0,0 +1,70 @@ +
axislabelbkgex06.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_XYFULL"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_XYFULL,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex07.html b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex07.html new file mode 100644 index 0000000..d340d52 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/axislabelbkgex07.html @@ -0,0 +1,70 @@ +
axislabelbkgex07.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,19,3,9,15,10);
+ 
+// The code to setup a very basic graph
+$graph = new Graph(200,150);
+$graph->SetScale('intlin');
+$graph->SetMargin(30,15,40,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(true,'blue',3);
+ 
+$graph->title->Set('Label background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
+$graph->subtitle->SetColor('darkred');
+$graph->subtitle->Set('"LABELBKG_XY"');
+ 
+$graph->SetAxisLabelBackground(LABELBKG_XY,'orange','red','lightblue','red');
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($ydata);
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex0.html new file mode 100644 index 0000000..8aaa045 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex0.html @@ -0,0 +1,76 @@ +
background_type_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale("textlin");
+$graph->SetMargin(40,40,50,50);
+ 
+// Setup the grid and plotarea box
+$graph->ygrid->SetLineStyle('dashed');
+$graph->ygrid->setColor('darkgray');
+$graph->SetBox(true);
+ 
+// Steup graph titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Using background image');
+$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
+$graph->subtitle->Set('"BGIMG_COPY"');
+$graph->subtitle->SetColor('darkred');
+ 
+// Add background with 25% mix
+$graph->SetBackgroundImage('heat1.jpg',BGIMG_COPY);
+$graph->SetBackgroundImageMix(25);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex1.html new file mode 100644 index 0000000..b5efba4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex1.html @@ -0,0 +1,76 @@ +
background_type_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale("textlin");
+$graph->SetMargin(40,40,50,50);
+ 
+// Setup the grid and plotarea box
+$graph->ygrid->SetLineStyle('dashed');
+$graph->ygrid->setColor('darkgray');
+$graph->SetBox(true);
+ 
+// Steup graph titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Using background image');
+$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
+$graph->subtitle->Set('"BGIMG_CENTER"');
+$graph->subtitle->SetColor('darkred');
+ 
+// Add background with 25% mix
+$graph->SetBackgroundImage('heat1.jpg',BGIMG_CENTER);
+$graph->SetBackgroundImageMix(25);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex2.html new file mode 100644 index 0000000..62874d8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex2.html @@ -0,0 +1,76 @@ +
background_type_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale("textlin");
+$graph->SetMargin(40,40,50,50);
+ 
+// Setup the grid and plotarea box
+$graph->ygrid->SetLineStyle('dashed');
+$graph->ygrid->setColor('darkgray');
+$graph->SetBox(true);
+ 
+// Steup graph titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Using background image');
+$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
+$graph->subtitle->Set('"BGIMG_FREE"');
+$graph->subtitle->SetColor('darkred');
+ 
+// Add background with 25% mix
+$graph->SetBackgroundImage('heat1.jpg',BGIMG_FREE);
+$graph->SetBackgroundImageMix(25);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex3.html b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex3.html new file mode 100644 index 0000000..2e5edfd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex3.html @@ -0,0 +1,76 @@ +
background_type_ex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale("textlin");
+$graph->SetMargin(40,40,50,50);
+ 
+// Setup the grid and plotarea box
+$graph->ygrid->SetLineStyle('dashed');
+$graph->ygrid->setColor('darkgray');
+$graph->SetBox(true);
+ 
+// Steup graph titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Using background image');
+$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
+$graph->subtitle->Set('"BGIMG_FILLPLOT"');
+$graph->subtitle->SetColor('darkred');
+ 
+// Add background with 25% mix
+$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLPLOT);
+$graph->SetBackgroundImageMix(25);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex4.html b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex4.html new file mode 100644 index 0000000..3158c5e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/background_type_ex4.html @@ -0,0 +1,76 @@ +
background_type_ex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale("textlin");
+$graph->SetMargin(40,40,50,50);
+ 
+// Setup the grid and plotarea box
+$graph->ygrid->SetLineStyle('dashed');
+$graph->ygrid->setColor('darkgray');
+$graph->SetBox(true);
+ 
+// Steup graph titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Using background image');
+$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
+$graph->subtitle->Set('"BGIMG_FILLFRAME"');
+$graph->subtitle->SetColor('darkred');
+ 
+// Add background with 25% mix
+$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLFRAME);
+$graph->SetBackgroundImageMix(25);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/balloonex2.html b/includes/jpgraph/docs/chunkhtml/example_src/balloonex2.html new file mode 100644 index 0000000..dc5fefd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/balloonex2.html @@ -0,0 +1,158 @@ +
balloonex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+// Each ballon is specificed by four values. 
+// (X,Y,Size,Color)
+$data = array(
+    array(1,12,10,'orange'),
+    array(3,41,15,'red'),
+    array(4,5,19,'lightblue'),
+    array(5,70,22,'yellow')
+);
+ 
+ 
+ 
+// We need to create X,Y data vectors suitable for the
+// library from the above raw data.
+$n = count($data);
+for( $i=0; $i < $n; ++$i ) {
+    
+    $datax[$i] = $data[$i][0];
+    $datay[$i] = $data[$i][1];
+ 
+    // Create a faster lookup array so we don't have to search
+    // for the correct values in the callback function
+    $format[strval($datax[$i])][strval($datay[$i])] = array($data[$i][2],$data[$i][3]);
+    
+}
+ 
+ 
+// Callback for markers
+// Must return array(width,border_color,fill_color,filename,imgscale)
+// If any of the returned values are '' then the
+// default value for that parameter will be used (possible empty)
+function FCallback($aYVal,$aXVal) {
+    global $format;
+    return array($format[strval($aXVal)][strval($aYVal)][0],'',
+         $format[strval($aXVal)][strval($aYVal)][1],'','');
+}
+ 
+// Setup a basic graph
+$graph = new Graph(450,300,'auto');
+$graph->SetScale("intlin");
+$graph->SetMargin(40,40,40,40);        
+$graph->SetMarginColor('wheat');
+ 
+$graph->title->Set("Example of ballon scatter plot with X,Y callback");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->SetMargin(10);
+ 
+// Use a lot of grace to get large scales since the ballon have
+// size and we don't want them to collide with the X-axis
+$graph->yaxis->scale->SetGrace(50,10);
+$graph->xaxis->scale->SetGrace(50,10);
+ 
+// Make sure X-axis as at the bottom of the graph and not at the default Y=0
+$graph->xaxis->SetPos('min');
+ 
+// Set X-scale to start at 0
+$graph->xscale->SetAutoMin(0);
+ 
+// 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->SetCallbackYX("FCallback");
+ 
+// Add the scatter plot to the graph
+$graph->Add($sp1);
+ 
+// ... and send to browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradex1.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradex1.html new file mode 100644 index 0000000..cce994d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradex1.html @@ -0,0 +1,94 @@ +
bargradex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+// Example for use of JpGraph,
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(0.13,0.25,0.21,0.35,0.31,0.06);
+$datax=array("January","February","March","April","May","June");
+ 
+// Setup the graph.
+$graph = new Graph(400,240);
+$graph->img->SetMargin(60,20,35,75);
+$graph->SetScale("textlin");
+$graph->SetMarginColor("lightblue:1.1");
+$graph->SetShadow();
+ 
+// Set up the title for the graph
+$graph->title->Set("Bar gradient with left reflection");
+$graph->title->SetMargin(8);
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor("darkred");
+ 
+// Setup font for axis
+$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
+$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
+ 
+// Show 0 label on Y-axis (default is not to show)
+$graph->yscale->ticks->SupressZeroLabel(false);
+ 
+// Setup X-axis labels
+$graph->xaxis->SetTickLabels($datax);
+$graph->xaxis->SetLabelAngle(50);
+ 
+// Create the bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetWidth(0.6);
+ 
+// Setup color for gradient fill style
+$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION);
+ 
+// Set color for the frame of each bar
+$bplot->SetColor("white");
+$graph->Add($bplot);
+ 
+// Finally send the graph to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex1.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex1.html new file mode 100644 index 0000000..5adc839 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex1.html @@ -0,0 +1,68 @@ +
bargradsmallex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex2.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex2.html new file mode 100644 index 0000000..035b7ed --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex2.html @@ -0,0 +1,68 @@ +
bargradsmallex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex3.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex3.html new file mode 100644 index 0000000..2418437 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex3.html @@ -0,0 +1,68 @@ +
bargradsmallex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex4.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex4.html new file mode 100644 index 0000000..92a56b9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex4.html @@ -0,0 +1,68 @@ +
bargradsmallex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex5.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex5.html new file mode 100644 index 0000000..2f43e43 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex5.html @@ -0,0 +1,68 @@ +
bargradsmallex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex6.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex6.html new file mode 100644 index 0000000..c0a47da --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex6.html @@ -0,0 +1,68 @@ +
bargradsmallex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex7.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex7.html new file mode 100644 index 0000000..aa2ad44 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex7.html @@ -0,0 +1,68 @@ +
bargradsmallex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex8.html b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex8.html new file mode 100644 index 0000000..55915d4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/bargradsmallex8.html @@ -0,0 +1,68 @@ +
bargradsmallex8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// We need some data
+$datay=array(4,8,6);
+ 
+// Setup the graph. 
+$graph = new Graph(200,150);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/barlinealphaex1.html b/includes/jpgraph/docs/chunkhtml/example_src/barlinealphaex1.html new file mode 100644 index 0000000..2081be3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/barlinealphaex1.html @@ -0,0 +1,148 @@ +
barlinealphaex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some "random" data
+$ydata  = array(10,120,80,190,260,170,60,40,20,230);
+$ydata2 = array(10,70,40,120,200,60,80,40,20,5);
+ 
+// Get a list of month using the current locale
+$months = $gDateLocale->GetShortMonth();
+ 
+// Create the graph. 
+$graph = new Graph(300,200);    
+$graph->SetScale("textlin");
+$graph->SetMarginColor('white');
+ 
+// Adjust the margin slightly so that we use the 
+// entire area (since we don't use a frame)
+$graph->SetMargin(30,1,20,5);
+ 
+// Box around plotarea
+$graph->SetBox(); 
+ 
+// No frame around the image
+$graph->SetFrame(false);
+ 
+// Setup the tab title
+$graph->tabtitle->Set('Year 2003');
+$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10);
+ 
+// Setup the X and Y grid
+$graph->ygrid->SetFill(true,'#DDDDDD@0.5','#BBBBBB@0.5');
+$graph->ygrid->SetLineStyle('dashed');
+$graph->ygrid->SetColor('gray');
+$graph->xgrid->Show();
+$graph->xgrid->SetLineStyle('dashed');
+$graph->xgrid->SetColor('gray');
+ 
+// Setup month as labels on the X-axis
+$graph->xaxis->SetTickLabels($months);
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
+$graph->xaxis->SetLabelAngle(45);
+ 
+// Create a bar pot
+$bplot = new BarPlot($ydata);
+$bplot->SetWidth(0.6);
+$fcol='#440000';
+$tcol='#FF9090';
+ 
+$bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION);
+ 
+// Set line weigth to 0 so that there are no border
+// around each bar
+$bplot->SetWeight(0);
+ 
+$graph->Add($bplot);
+ 
+// Create filled line plot
+$lplot = new LinePlot($ydata2);
+$lplot->SetFillColor('skyblue@0.5');
+$lplot->SetColor('navy@0.7');
+$lplot->SetBarCenter();
+ 
+$lplot->mark->SetType(MARK_SQUARE);
+$lplot->mark->SetColor('blue@0.5');
+$lplot->mark->SetFillColor('lightblue');
+$lplot->mark->SetSize(6);
+ 
+$graph->Add($lplot);
+ 
+// .. and finally send it back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/barscalecallbackex1.html b/includes/jpgraph/docs/chunkhtml/example_src/barscalecallbackex1.html new file mode 100644 index 0000000..127a18f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/barscalecallbackex1.html @@ -0,0 +1,126 @@ +
barscalecallbackex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Callback function for Y-scale to get 1000 separator on labels
+function separator1000($aVal) {
+    return number_format($aVal);
+}
+ 
+function separator1000_usd($aVal) {
+    return '$'.number_format($aVal);
+}
+ 
+// Some data
+$datay=array(120567,134013,192000,87000);
+ 
+// Create the graph and setup the basic parameters
+$graph = new Graph(500,300,'auto');
+$graph->img->SetMargin(80,30,30,40);
+$graph->SetScale('textint');
+$graph->SetShadow();
+$graph->SetFrame(false); // No border around the graph
+ 
+// Add some grace to the top so that the scale doesn't
+// end exactly at the max value.
+// The grace value is the percetage of additional scale
+// value we add. Specifying 50 means that we add 50% of the
+// max value
+$graph->yaxis->scale->SetGrace(50);
+$graph->yaxis->SetLabelFormatCallback('separator1000');
+ 
+// Setup X-axis labels
+$a = $gDateLocale->GetShortMonth();
+$graph->xaxis->SetTickLabels($a);
+$graph->xaxis->SetFont(FF_FONT2);
+ 
+// Setup graph title ands fonts
+$graph->title->Set('Example of Y-scale callback formatting');
+$graph->title->SetFont(FF_FONT2,FS_BOLD);
+$graph->xaxis->title->Set('Year 2002');
+$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
+ 
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor('orange');
+$bplot->SetWidth(0.5);
+$bplot->SetShadow();
+ 
+// Setup the values that are displayed on top of each bar
+$bplot->value->Show();
+ 
+// Must use TTF fonts if we want text at an arbitrary angle
+$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
+$bplot->value->SetAngle(45);
+$bplot->value->SetFormatCallback('separator1000_usd');
+ 
+// Black color for positive values and darkred for negative values
+$bplot->value->SetColor('black','darkred');
+$graph->Add($bplot);
+ 
+// Finally stroke the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex01.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex01.html new file mode 100644 index 0000000..a285951 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex01.html @@ -0,0 +1,80 @@ +
basic_contourex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
+            array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
+            array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
+            array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
+            array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex02.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex02.html new file mode 100644 index 0000000..9b6523c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex02.html @@ -0,0 +1,86 @@ +
basic_contourex02.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
+            array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
+            array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
+            array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
+            array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Show axis on all sides
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot with multiple axis');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-1.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-1.html new file mode 100644 index 0000000..77a5a00 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-1.html @@ -0,0 +1,80 @@ +
basic_contourex03-1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array ( 12,7,3,15 ),
+            array ( 18,5,1, 9 ),
+            array ( 13,9,5,12),
+            array (  5,3,8, 9 ),
+            array (  1,8,5, 7 ));
+ 
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Show axis on all sides
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot with multiple axis');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data,10,1);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-2.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-2.html new file mode 100644 index 0000000..b53a645 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-2.html @@ -0,0 +1,80 @@ +
basic_contourex03-2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array ( 12,7,3,15 ),
+            array ( 18,5,1, 9 ),
+            array ( 13,9,5,12),
+            array (  5,3,8, 9 ),
+            array (  1,8,5, 7 ));
+ 
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Show axis on all sides
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot with multiple axis');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data,10,2);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-3.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-3.html new file mode 100644 index 0000000..e6f7f52 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex03-3.html @@ -0,0 +1,80 @@ +
basic_contourex03-3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array ( 12,7,3,15 ),
+            array ( 18,5,1, 9 ),
+            array ( 13,9,5,12),
+            array (  5,3,8, 9 ),
+            array (  1,8,5, 7 ));
+ 
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Show axis on all sides
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot with multiple axis');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data,10,3);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex04.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex04.html new file mode 100644 index 0000000..33b8e10 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex04.html @@ -0,0 +1,86 @@ +
basic_contourex04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
+            array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
+            array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
+            array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
+            array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Show axis on all sides
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot with multiple axis');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data,5);
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex05.html b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex05.html new file mode 100644 index 0000000..174dad7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/basic_contourex05.html @@ -0,0 +1,92 @@ +
basic_contourex05.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php // content="text/plain; charset=utf-8"
+// Basic contour plot example
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contour.php');
+ 
+$data = array(
+            array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
+            array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
+            array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
+            array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
+            array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
+            array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
+            array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
+ 
+// Basic contour graph
+$graph = new Graph(350,250);
+$graph->SetScale('intint');
+ 
+// Show axis on all sides
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+// Adjust the margins to fit the margin
+$graph->SetMargin(30,100,40,30);
+ 
+// Setup
+$graph->title->Set('Basic contour plot with multiple axis');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// A simple contour plot with default arguments (e.g. 10 isobar lines)
+$cp = new ContourPlot($data);
+ 
+// Flip the data around its center line
+$cp->SetInvert();
+ 
+// Display the legend
+$cp->ShowLegend();
+ 
+$graph->Add($cp);
+ 
+// ... and send the graph back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/boxstockex1.html b/includes/jpgraph/docs/chunkhtml/example_src/boxstockex1.html new file mode 100644 index 0000000..9d05743 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/boxstockex1.html @@ -0,0 +1,66 @@ +
boxstockex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+// Example of a stock chart
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/builtinplotmarksex1.html b/includes/jpgraph/docs/chunkhtml/example_src/builtinplotmarksex1.html new file mode 100644 index 0000000..cf4af39 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/builtinplotmarksex1.html @@ -0,0 +1,128 @@ +
builtinplotmarksex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_plotline.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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/canvasex01.html b/includes/jpgraph/docs/chunkhtml/example_src/canvasex01.html new file mode 100644 index 0000000..58e1d3f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/canvasex01.html @@ -0,0 +1,72 @@ +
canvasex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex01.php,v 1.3 2002/10/23 08:17:23 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/canvasex02.html b/includes/jpgraph/docs/chunkhtml/example_src/canvasex02.html new file mode 100644 index 0000000..8e0f466 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/canvasex02.html @@ -0,0 +1,82 @@ +
canvasex02.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex02.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/canvasex03.html b/includes/jpgraph/docs/chunkhtml/example_src/canvasex03.html new file mode 100644 index 0000000..ffaeba3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/canvasex03.html @@ -0,0 +1,114 @@ +
canvasex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex03.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/canvasex04.html b/includes/jpgraph/docs/chunkhtml/example_src/canvasex04.html new file mode 100644 index 0000000..887dbfd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/canvasex04.html @@ -0,0 +1,114 @@ +
canvasex04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex04.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/canvasex05.html b/includes/jpgraph/docs/chunkhtml/example_src/canvasex05.html new file mode 100644 index 0000000..6dd5e72 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/canvasex05.html @@ -0,0 +1,114 @@ +
canvasex05.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex05.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/canvasex06.html b/includes/jpgraph/docs/chunkhtml/example_src/canvasex06.html new file mode 100644 index 0000000..a32e79c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/canvasex06.html @@ -0,0 +1,82 @@ +
canvasex06.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// $Id: canvasex06.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ccbp_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/ccbp_ex1.html new file mode 100644 index 0000000..f05a27c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ccbp_ex1.html @@ -0,0 +1,72 @@ +
ccbp_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8" 
+require_once 'jpgraph/jpgraph.php';
+require_once 'jpgraph/jpgraph_line.php';
+require_once 'jpgraph/jpgraph_plotmark.inc.php';
+require_once 'jpgraph/jpgraph_scatter.php';
+require_once 'ccbpgraph.class.php';
+ 
+$graph = new CCBPGraph(600,400);
+$graph->SetTitle('Buffer penetration','(history added)');
+$graph->SetColorMap(0); 
+ 
+ // Two "fake tasks with hostory
+$datax=array(75,83); $datay=array(110,64);
+$datax1 = array(33,50,67,83); $datay1 = array(86,76,80,64);
+$datax2 = array(18,47,58,75); $datay2 = array(80,97,105,110);
+ 
+$sp = new ScatterPlot($datay,$datax);
+$sp->mark->SetType(MARK_DIAMOND);
+$sp->mark->SetFillColor('white');
+$sp->mark->SetSize(12);
+ 
+$sp_hist = array();
+$sp_hist[0] = new LinePlot($datay1,$datax1);
+$sp_hist[0]->SetWeight(1);
+$sp_hist[0]->SetColor('white');
+ 
+$sp_hist[1] = new LinePlot($datay2,$datax2);
+$sp_hist[1]->SetWeight(1);
+$sp_hist[1]->SetColor('white');
+ 
+$graph->Add($sp_hist);
+$graph->Add($sp);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ccbp_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/ccbp_ex2.html new file mode 100644 index 0000000..6b52713 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ccbp_ex2.html @@ -0,0 +1,72 @@ +
ccbp_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8" 
+require_once 'jpgraph/jpgraph.php';
+require_once 'jpgraph/jpgraph_line.php';
+require_once 'jpgraph/jpgraph_plotmark.inc.php';
+require_once 'jpgraph/jpgraph_scatter.php';
+require_once 'ccbpgraph.class.php';
+ 
+$graph = new CCBPGraph(600,400);
+$graph->SetTitle('Buffer penetration','(history added)');
+$graph->SetColorMap(1); 
+ 
+ // Two "fake tasks with hostory
+$datax=array(75,83); $datay=array(110,64);
+$datax1 = array(33,50,67,83); $datay1 = array(86,76,80,64);
+$datax2 = array(18,47,58,75); $datay2 = array(80,97,105,110);
+ 
+$sp = new ScatterPlot($datay,$datax);
+$sp->mark->SetType(MARK_DIAMOND);
+$sp->mark->SetFillColor('white');
+$sp->mark->SetSize(12);
+ 
+$sp_hist = array();
+$sp_hist[0] = new LinePlot($datay1,$datax1);
+$sp_hist[0]->SetWeight(1);
+$sp_hist[0]->SetColor('white');
+ 
+$sp_hist[1] = new LinePlot($datay2,$datax2);
+$sp_hist[1]->SetWeight(1);
+$sp_hist[1]->SetColor('white');
+ 
+$graph->Add($sp_hist);
+$graph->Add($sp);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ccbpgraph.class.html b/includes/jpgraph/docs/chunkhtml/example_src/ccbpgraph.class.html new file mode 100644 index 0000000..5336bad --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ccbpgraph.class.html @@ -0,0 +1,514 @@ +
ccbpgraph.class.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+
<?php // content="text/plain; charset=utf-8" 
+/**
+* Class CCBPGraph
+* Utility class to create Critical Chain Buffer penetration charts
+*/
+class CCBPGraph {
+    const TickStep = 25;
+    const YTitle = '% Buffer used';
+    const XTitle = '% CC Completed';
+    const NColorMaps = 2;
+    private $graph=null;
+    private $iWidth,$iHeight;
+    private $iPlots=array();
+    private $iXMin=-50, $iXMax = 100;
+    private $iYMin=-50, $iYMax = 150;
+    private $iColorInd = array( 
+        array(5,75),   /* Green */
+        array(25,85),  /* Yellow */
+        array(50,100));/* Red */ 
+    private $iColorMap = 0;
+    private $iColorSpec = array(
+                array('darkgreen:1.0','yellow:1.4','red:0.8','darkred:0.85'),
+                array('#c6e9af','#ffeeaa','#ffaaaa','#de8787'));
+    private $iMarginColor = array('darkgreen@0.7','darkgreen@0.9');                
+    private $iSubTitle='',$iTitle = 'CC Buffer penetration';
+    /**
+    * Construct a new instance of CCBPGraph 
+    * 
+    * @param int $aWidth
+    * @param int $aHeight
+    * @return CCBPGraph
+    */
+    public function __construct($aWidth, $aHeight) {
+        $this->iWidth = $aWidth;
+        $this->iHeight = $aHeight;
+    }
+    /**
+    * Set the title and subtitle for the graph
+    * 
+    * @param string $aTitle
+    * @param string $aSubTitle
+    */
+    public function SetTitle($aTitle, $aSubTitle) {
+        $this->iTitle = $aTitle;
+        $this->iSubTitle = $aSubTitle;
+    }
+    /**
+    * Set the x-axis min and max values
+    * 
+    * @param int $aMin
+    * @param int $aMax
+    */
+    public function SetXMinMax($aMin, $aMax) {
+        $this->iXMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+        $this->iXMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+    }
+    /**
+    * Specify what color map to use
+    * 
+    * @param int $aMap
+    */
+    public function SetColorMap($aMap) {
+        $this->iColorMap = $aMap % CCBPGraph::NColorMaps;
+    }
+    /**
+    * Set the y-axis min and max values
+    * 
+    * @param int $aMin
+    * @param int $aMax
+    */
+    public function SetYMinMax($aMin,$aMax) {
+        $this->iYMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+        $this->iYMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep;
+    }
+    /**
+    * Set the specification of the color backgrounds and also the
+    * optional exact colors to be used
+    * 
+    * @param mixed $aSpec  An array of 3 1x2 arrays. Each array specify the 
+    * color indication value at x=0 and x=max x in order to determine the slope
+    * @param mixed $aColors  An array with four elements specifying the colors
+    * of each color indicator
+    */
+    public function SetColorIndication(array $aSpec,array $aColors=null) {
+        if( count($aSpec) !== 3 ) {
+            JpgraphError::Raise('Specification of scale values for background indicators must be an array with three elements.');
+        }
+        $this->iColorInd = $aSpec;    
+        if( $aColors !== null ) {
+            if( is_array($aColors) && count($aColors) == 4 ) {
+                $this->iColorSpec = $aColors;
+            }
+            else {
+                JpGraphError::Raise('Color specification for background indication must have four colors.');
+            }
+        }        
+    }
+    /**
+    * Construct the graph
+    * 
+    */
+    private function Init() {
+ 
+        // Setup limits for color indications
+        $lowx = $this->iXMin; $highx= $this->iXMax;
+        $lowy = $this->iYMin; $highy = $this->iYMax;
+         $width=$this->iWidth; $height=$this->iHeight;
+ 
+        // Margins
+        $lm=50; $rm=40;
+        $tm=60; $bm=40;
+        
+        if( $width <= 300 || $height <= 250 ) {
+            $labelsize = 8;
+            $lm=25; $rm=25;
+            $tm=45; $bm=25;
+        }                
+        elseif( $width <= 450 || $height <= 300 ) {
+            $labelsize = 8;
+            $lm=30; $rm=30;
+            $tm=50; $bm=30;
+        }
+        elseif( $width <= 600 || $height <= 400 ) {
+            $labelsize = 9;        
+        }
+        else {
+            $labelsize = 11;
+        }    
+        
+        if( $this->iSubTitle == '' ) {
+            $tm -= $labelsize+4;
+        }     
+ 
+        $graph = new Graph($width,$height);
+        $graph->SetScale('intint',$lowy,$highy,$lowx,$highx);
+        $graph->SetMargin($lm,$rm,$tm,$bm);
+        $graph->SetMarginColor($this->iMarginColor[$this->iColorMap]);
+        $graph->SetClipping();
+        
+        $graph->title->Set($this->iTitle);
+        $graph->subtitle->Set($this->iSubTitle);
+        
+        $graph->title->SetFont(FF_ARIAL,FS_BOLD,$labelsize+4);
+        $graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,$labelsize+1);
+        
+        $graph->SetBox(true,'black@0.3');
+ 
+        $graph->xaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize);
+        $graph->yaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize);
+        
+        $graph->xaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep);
+        $graph->yaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep);
+        
+        $graph->xaxis->HideZeroLabel();
+        $graph->yaxis->HideZeroLabel();
+                
+        $graph->xaxis->SetLabelFormatString('%d%%');
+        $graph->yaxis->SetLabelFormatString('%d%%');
+        
+        // For the x-axis we adjust the color so labels on the left of the Y-axis are in black
+        $n1 = floor(abs($this->iXMin/25))+1;
+        $n2 = floor($this->iXMax/25);
+        if( $this->iColorMap == 0 ) {
+            $xlcolors=array();
+            for( $i = 0; $i < $n1; ++$i ) {
+                $xlcolors[$i] = 'black';
+            }
+            for( $i = 0; $i < $n2; ++$i ) {
+                $xlcolors[$n1+$i] = 'lightgray:1.5';
+            }
+            $graph->xaxis->SetColor('gray',$xlcolors);
+            $graph->yaxis->SetColor('gray','lightgray:1.5');
+        }
+        else {
+            $graph->xaxis->SetColor('darkgray','darkgray:0.8');
+            $graph->yaxis->SetColor('darkgray','darkgray:0.8');            
+        }
+        $graph->SetGridDepth(DEPTH_FRONT);
+        $graph->ygrid->SetColor('gray@0.6');
+        $graph->ygrid->SetLineStyle('dotted');
+        
+        $graph->ygrid->Show();
+        
+        $graph->xaxis->SetWeight(1);
+        $graph->yaxis->SetWeight(1);
+        
+        $ytitle = new Text(CCBPGraph::YTitle,floor($lm*.75),($height-$tm-$bm)/2+$tm);
+        #$ytitle->SetFont(FF_VERA,FS_BOLD,$labelsize+1);
+        $ytitle->SetAlign('right','center');
+        $ytitle->SetAngle(90);
+        $graph->Add($ytitle);
+        
+        $xtitle = new Text(CCBPGraph::XTitle,($width-$lm-$rm)/2+$lm,$height - 10);
+        #$xtitle->SetFont(FF_VERA,FS_BOLD,$labelsize);
+        $xtitle->SetAlign('center','bottom');
+        $graph->Add($xtitle);
+        
+        $df = 'D j:S M, Y'; 
+        if( $width < 400 ) {
+            $df = 'D j:S M';
+        }
+        
+        $time = new Text(date($df),$width-10,$height-10);
+        $time->SetAlign('right','bottom');
+        #$time->SetFont(FF_VERA,FS_NORMAL,$labelsize-1);
+        $time->SetColor('darkgray');
+        $graph->Add($time);
+ 
+        // Use an accumulated fille line graph to create the colored bands
+       
+        $n = 3;
+        for( $i=0; $i < $n; ++$i ) {
+            $b = $this->iColorInd[$i][0];
+            $k = ($this->iColorInd[$i][1] - $this->iColorInd[$i][0])/$this->iXMax;
+            $colarea[$i] = array( array($lowx,$lowx*$k+$b), array($highx,$highx*$k+$b) );
+        }
+        $colarea[3] = array( array($lowx,$highy), array($highx,$highy) );
+        
+        
+        $cb = array();
+        for( $i=0; $i < 4; ++$i ) {
+            $cb[$i] = new LinePlot(array($colarea[$i][0][1],$colarea[$i][1][1]),
+                                   array($colarea[$i][0][0],$colarea[$i][1][0]));
+            $cb[$i]->SetFillColor($this->iColorSpec[$this->iColorMap][$i]);
+            $cb[$i]->SetFillFromYMin();                                   
+        }
+ 
+        $graph->Add(array_slice(array_reverse($cb),0,4));    
+        $this->graph = $graph;
+    }
+    /**
+    * Add a line or scatter plot to the graph
+    * 
+    * @param mixed $aPlots
+    */
+    public function Add($aPlots) {
+        if( is_array($aPlots) ) {
+            $this->iPlots = array_merge($this->iPlots,$aPlots);                
+        }
+        else {
+            $this->iPlots[] = $aPlots;
+        }
+    }
+    /**
+    * Stroke the graph back to the client or to a file
+    * 
+    * @param mixed $aFile
+    */
+    public function Stroke($aFile='') {
+        $this->Init();
+        if( count($this->iPlots) > 0 )  {
+            $this->graph->Add($this->iPlots);
+        }
+        $this->graph->Stroke($aFile);
+    }
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/checkgd.html b/includes/jpgraph/docs/chunkhtml/example_src/checkgd.html new file mode 100644 index 0000000..f589288 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/checkgd.html @@ -0,0 +1,22 @@ +
checkgd.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
<?php // content="text/plain; charset=utf-8"
+$im = @imagecreate (200, 100) or die ( "cannot create a new gd image.");
+$background_color = imagecolorallocate ($im, 240, 240, 240);
+$border_color = imagecolorallocate ($im, 50, 50, 50);
+$text_color = imagecolorallocate ($im, 233, 14, 91);
+ 
+imagerectangle($im,0,0,199,99,$border_color);
+imagestring ($im, 5, 10, 40, "a simple text string", $text_color );
+header ("content-type: image/png");
+imagepng ($im);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/checkgd2.html b/includes/jpgraph/docs/chunkhtml/example_src/checkgd2.html new file mode 100644 index 0000000..b485980 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/checkgd2.html @@ -0,0 +1,28 @@ +
checkgd2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php // content="text/plain; charset=utf-8"
+$im =  imagecreatetruecolor ( 300, 200);
+$black = imagecolorallocate ($im,  0, 0, 0);
+$lightgray = imagecolorallocate ($im,  230, 230, 230);
+$darkgreen = imagecolorallocate ($im,  80, 140, 80);
+$white = imagecolorallocate ($im,  255, 255, 255);
+ 
+imagefilledrectangle ($im,0,0,299,199 ,$lightgray);
+imagerectangle ($im,0,0,299,199,$black);
+imagefilledellipse ($im,150,100,210,110,$white);
+imagefilledellipse ($im,150,100,200,100,$darkgreen);
+header ("Content-type: image/png");
+imagepng ($im);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/checkttf.html b/includes/jpgraph/docs/chunkhtml/example_src/checkttf.html new file mode 100644 index 0000000..1c7abfd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/checkttf.html @@ -0,0 +1,44 @@ +
checkttf.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+// Change this defines to where Your fonts are stored
+DEFINE("TTF_DIR","/usr/share/fonts/truetype/");
+ 
+// Change this define to a font file that You know that You have
+DEFINE("TTF_FONTFILE","arial.ttf");
+ 
+// Text to display
+DEFINE("TTF_TEXT","Hello World!");
+ 
+$im = imagecreatetruecolor (400, 100);
+$white = imagecolorallocate ($im, 255, 255, 255);
+$black = imagecolorallocate ($im, 0, 0, 0);
+$border_color = imagecolorallocate ($im, 50, 50, 50);
+ 
+imagefilledrectangle($im,0,0,399,99,$white);
+imagerectangle($im,0,0,399,99,$border_color);
+imagettftext ($im, 30, 0, 90, 60, $black, TTF_DIR.TTF_FONTFILE,TTF_TEXT);
+ 
+header ("Content-type: image/png");
+imagepng ($im);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/clipping_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/clipping_ex1.html new file mode 100644 index 0000000..69b3861 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/clipping_ex1.html @@ -0,0 +1,72 @@ +
clipping_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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,250);    
+$graph->SetScale('intlin',0,10);
+$graph->SetMargin(30,20,70,40);
+$graph->SetMarginColor(array(177,191,174));
+ 
+$graph->SetClipping(false);
+ 
+$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->ygrid->SetLineStyle('dashed');
+ 
+$graph->title->Set("Manual scale");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->title->SetColor('white');
+$graph->subtitle->Set("(No clipping)");
+$graph->subtitle->SetColor('white');
+$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10);
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor("red");
+$lineplot->SetWeight(2);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/clipping_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/clipping_ex2.html new file mode 100644 index 0000000..708e497 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/clipping_ex2.html @@ -0,0 +1,72 @@ +
clipping_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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,250);    
+$graph->SetScale('intlin',0,10);
+$graph->SetMargin(30,20,70,40);
+$graph->SetMarginColor(array(177,191,174));
+ 
+$graph->SetClipping(true);
+ 
+$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->ygrid->SetLineStyle('dashed');
+ 
+$graph->title->Set("Manual scale");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->title->SetColor('white');
+$graph->subtitle->Set("(With clipping)");
+$graph->subtitle->SetColor('white');
+$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10);
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor("red");
+$lineplot->SetWeight(2);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/comb90dategraphex03.html b/includes/jpgraph/docs/chunkhtml/example_src/comb90dategraphex03.html new file mode 100644 index 0000000..7eae848 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/comb90dategraphex03.html @@ -0,0 +1,294 @@ +
comb90dategraphex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_date.php');
+require_once ('jpgraph/jpgraph_mgraph.php');
+ 
+// Setup some fake data to simulate some wind speed and direction
+ 
+DEFINE('NDATAPOINTS',280);
+DEFINE('SAMPLERATE',300);
+ 
+$start = time();
+$end = $start+NDATAPOINTS*SAMPLERATE;
+$xdata = array();
+ 
+$data_winddirection[0] = rand(100,200);
+$data_windspeed[0] = rand(7,10);
+$data_windtemp[0] = rand(5,20);
+ 
+for( $i=0; $i < NDATAPOINTS-1; ++$i ) {
+    $data_winddirection[$i+1] = $data_winddirection[$i] + rand(-4,4);
+    if($data_winddirection[$i+1] < 0 || $data_winddirection[$i+1] > 359)
+        $data_winddirection[$i+1] = 0;
+ 
+    $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2);
+    if($data_windspeed[$i+1] < 0 )
+        $data_windspeed[$i+1] = 0;
+ 
+    $data_windtemp[$i+1] = $data_windtemp[$i] + rand(-1.5,1.5);
+ 
+    $xdata[$i] = $start + $i * SAMPLERATE;
+}
+$xdata[$i] = $start + $i * SAMPLERATE;
+ 
+ 
+//DEFINE('BKG_COLOR','lightgray:1.7');
+DEFINE('BKG_COLOR','green:1.98');
+DEFINE('WIND_HEIGHT',800);
+DEFINE('WIND_WIDTH',250);
+ 
+//------------------------------------------------------------------
+// Setup the Wind direction graph
+//------------------------------------------------------------------
+$graph = new Graph(WIND_WIDTH,WIND_HEIGHT);
+$graph->SetMarginColor(BKG_COLOR);
+$graph->SetScale('datlin',0,360);
+$graph->Set90AndMargin(50,10,70,30);
+$graph->SetFrame(true,'white',0);
+$graph->SetBox();
+ 
+$graph->title->Set('Wind direction');
+$graph->title->SetColor('blue');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->title->SetMargin(5);
+ 
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->xaxis->scale->SetDateFormat('H:i');
+$graph->xgrid->Show();
+ 
+$graph->yaxis->SetLabelAngle(90);
+$graph->yaxis->SetColor('blue');
+$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph->yaxis->SetLabelMargin(0);
+$graph->yaxis->scale->SetAutoMin(0);
+ 
+$line = new LinePlot($data_winddirection,$xdata);
+$line->SetStepStyle();
+$line->SetColor('blue');
+ 
+$graph->Add($line);
+ 
+//------------------------------------------------------------------
+// Setup the wind speed graph
+//------------------------------------------------------------------
+$graph2 = new Graph(WIND_WIDTH-30,WIND_HEIGHT);
+$graph2->SetScale('datlin');
+$graph2->Set90AndMargin(5,20,70,30);
+$graph2->SetMarginColor(BKG_COLOR);
+$graph2->SetFrame(true,'white',0);
+$graph2->SetBox();
+ 
+$graph2->title->Set('Windspeed');
+$graph2->title->SetColor('red');
+$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph2->title->SetMargin(5);
+ 
+$graph2->xaxis->HideLabels();
+$graph2->xgrid->Show();
+ 
+$graph2->yaxis->SetLabelAngle(90);
+$graph2->yaxis->SetColor('red');
+$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph2->yaxis->SetLabelMargin(0);
+$graph2->yaxis->scale->SetAutoMin(0);
+ 
+$line2 = new LinePlot($data_windspeed,$xdata);
+$line2->SetStepStyle();
+$line2->SetColor('red');
+ 
+$graph2->Add($line2);
+ 
+//------------------------------------------------------------------
+// Setup the wind temp graph
+//------------------------------------------------------------------
+$graph3 = new Graph(WIND_WIDTH-30,WIND_HEIGHT);
+$graph3->SetScale('datlin');
+$graph3->Set90AndMargin(5,20,70,30);
+$graph3->SetMarginColor(BKG_COLOR);
+$graph3->SetFrame(true,'white',0);
+$graph3->SetBox();
+ 
+$graph3->title->Set('Temperature');
+$graph3->title->SetColor('black');
+$graph3->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph3->title->SetMargin(5);
+ 
+$graph3->xaxis->HideLabels();
+$graph3->xgrid->Show();
+ 
+$graph3->yaxis->SetLabelAngle(90);
+$graph3->yaxis->SetColor('black');
+$graph3->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+$graph3->yaxis->SetLabelMargin(0);
+$graph3->yaxis->scale->SetAutoMin(-10);
+ 
+$line3 = new LinePlot($data_windtemp,$xdata);
+$line3->SetStepStyle();
+$line3->SetColor('black');
+ 
+$graph3->Add($line3);
+ 
+//-----------------------
+// Create a multigraph
+//----------------------
+$mgraph = new MGraph();
+$mgraph->SetMargin(2,2,2,2);
+$mgraph->SetFrame(true,'darkgray',2);
+$mgraph->SetFillColor(BKG_COLOR);
+$mgraph->Add($graph,0,50);
+$mgraph->Add($graph2,250,50);
+$mgraph->Add($graph3,460,50);
+$mgraph->title->Set('Climate diagram 12 March 2009');
+$mgraph->title->SetFont(FF_ARIAL,FS_BOLD,20);
+$mgraph->title->SetMargin(8);
+$mgraph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/combgraphex1.html b/includes/jpgraph/docs/chunkhtml/example_src/combgraphex1.html new file mode 100644 index 0000000..8f60943 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/combgraphex1.html @@ -0,0 +1,174 @@ +
combgraphex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+require_once ('jpgraph/jpgraph_mgraph.php');
+ 
+//------------------------------------------------------------------
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//------------------------------------------------------------------
+$datay = array();
+$datax = array();
+$ts = time();
+$n=70; // Number of data points
+for($i=0; $i < $n; ++$i ) {
+    $datax[$i] = $ts+$i*150000; 
+    $datay[$i] = rand(5,60);
+    $datay2[$i] = rand(1,8);
+}
+ 
+// Now get labels at the start of each month
+$dateUtils = new DateScaleUtils();
+list($tickPositions,$minTickPositions) = $dateUtils->getTicks($datax,DSUTILS_MONTH1);
+ 
+// Now create the real graph
+// Combine a line and a bar graph
+ 
+// We add some grace to the end of the X-axis scale so that the first and last
+// data point isn't exactly at the very end or beginning of the scale
+$grace = 400000;
+$xmin = $datax[0]-$grace;
+$xmax = $datax[$n-1]+$grace;;
+ 
+// Overall width of graphs
+$w = 450;
+// Left and right margin for each graph
+$lm=25; $rm=15; 
+ 
+//----------------------
+// Setup the line graph
+//----------------------
+$graph = new Graph($w,250);
+$graph->SetScale('linlin',0,0,$xmin,$xmax);
+$graph->SetMargin($lm,$rm,10,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(false);
+$graph->SetBox(true);
+$graph->title->Set('Example of combined graph');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14);
+$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+$graph->xaxis->SetLabelFormatString('My',true);
+$graph->xgrid->Show();
+$p1 = new LinePlot($datay,$datax);
+$graph->Add($p1);
+ 
+//----------------------
+// Setup the bar graph
+//----------------------
+$graph2 = new Graph($w,110);
+$graph2->SetScale('linlin',0,0,$xmin,$xmax);
+$graph2->SetMargin($lm,$rm,5,10);
+$graph2->SetMarginColor('white');
+$graph2->SetFrame(false);
+$graph2->SetBox(true);
+$graph2->xgrid->Show();
+$graph2->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+$graph2->xaxis->SetLabelFormatString('My',true);
+$graph2->xaxis->SetPos('max');
+$graph2->xaxis->HideLabels();
+$graph2->xaxis->SetTickSide(SIDE_DOWN);
+$b1 = new BarPlot($datay2,$datax);
+$b1->SetFillColor('teal');
+$b1->SetColor('teal:1.2');
+$graph2->Add($b1);
+ 
+//-----------------------
+// Create a multigraph
+//----------------------
+$mgraph = new MGraph();
+$mgraph->SetMargin(2,2,2,2);
+$mgraph->SetFrame(true,'darkgray',2);
+$mgraph->Add($graph);
+$mgraph->Add($graph2,0,240);
+$mgraph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/combgraphex2.html b/includes/jpgraph/docs/chunkhtml/example_src/combgraphex2.html new file mode 100644 index 0000000..08dcf51 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/combgraphex2.html @@ -0,0 +1,176 @@ +
combgraphex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
<?php // content="text/plain; charset=utf-8"
+require_once ('../jpgraph.php');
+require_once ('../jpgraph_mgraph.php');
+require_once ('../jpgraph_line.php');
+require_once ('../jpgraph_bar.php');
+require_once ('../jpgraph_utils.inc.php');
+ 
+//------------------------------------------------------------------
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//------------------------------------------------------------------
+$datay = array();
+$datax = array();
+$ts = time();
+$n=70; // Number of data points
+for($i=0; $i < $n; ++$i ) {
+    $datax[$i] = $ts+$i*150000; 
+    $datay[$i] = rand(5,60);
+    $datay2[$i] = rand(1,8);
+}
+ 
+// Now get labels at the start of each month
+list($tickPositions,$minTickPositions) = DateScaleUtils::getTicks($datax,DSUTILS_MONTH1);
+ 
+// Now create the real graph
+// Combine a line and a bar graph
+ 
+// We add some grace to the end of the X-axis scale so that the first and last
+// data point isn't exactly at the very end or beginning of the scale
+$grace = 400000;
+$xmin = $datax[0]-$grace;
+$xmax = $datax[$n-1]+$grace;;
+ 
+// Overall width of graphs
+$w = 450;
+// Left and right margin for each graph
+$lm=25; $rm=15; 
+ 
+//----------------------
+// Setup the line graph
+//----------------------
+$graph = new Graph($w,250);
+$graph->SetScale('linlin',0,0,$xmin,$xmax);
+$graph->SetMargin($lm,$rm,10,30);
+$graph->SetMarginColor('white');
+$graph->SetFrame(false);
+$graph->SetBox(true);
+$graph->title->Set('Example of combined graph with background');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14);
+$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+$graph->xaxis->SetLabelFormatString('My',true);
+$graph->xgrid->Show();
+$p1 = new LinePlot($datay,$datax);
+$graph->Add($p1);
+ 
+//----------------------
+// Setup the bar graph
+//----------------------
+$graph2 = new Graph($w,110);
+$graph2->SetScale('linlin',0,0,$xmin,$xmax);
+$graph2->SetMargin($lm,$rm,5,10);
+$graph2->SetMarginColor('white');
+$graph2->SetFrame(false);
+$graph2->SetBox(true);
+$graph2->xgrid->Show();
+$graph2->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+$graph2->xaxis->SetLabelFormatString('My',true);
+$graph2->xaxis->SetPos('max');
+$graph2->xaxis->HideLabels();
+$graph2->xaxis->SetTickSide(SIDE_DOWN);
+$b1 = new BarPlot($datay2,$datax);
+$b1->SetFillColor('teal');
+$b1->SetColor('teal:1.2');
+$graph2->Add($b1);
+ 
+//-----------------------
+// Create a multigraph
+//----------------------
+$mgraph = new MGraph();
+$mgraph->SetImgFormat('jpeg',60);
+$mgraph->SetMargin(2,2,2,2);
+$mgraph->SetFrame(true,'darkgray',2);
+$mgraph->SetBackgroundImage('tiger1.jpg');
+$mgraph->AddMix($graph,0,0,85);
+$mgraph->AddMix($graph2,0,250,85);
+$mgraph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/common-obj-graph.html b/includes/jpgraph/docs/chunkhtml/example_src/common-obj-graph.html new file mode 100644 index 0000000..8d9b4ee --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/common-obj-graph.html @@ -0,0 +1,118 @@ +
common-obj-graph.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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
+$width=550;$height=400;
+$graph = new Graph(550,400);
+$graph->SetScale('textlin');
+$graph->SetY2Scale('lin');
+$graph->SetShadow();
+ 
+// Adjust the margin
+$graph->SetMargin(50,150,60,80);
+ 
+// 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('darkred');
+$graph->yaxis->SetColor('blue');
+ 
+$graph->title->SetFont(FF_ARIAL, FS_BOLD, 14);
+$graph->title->Set('Using JpGraph Library');
+$graph->title->SetMargin(10);
+ 
+$graph->subtitle->SetFont(FF_ARIAL, FS_BOLD, 10);
+$graph->subtitle->Set('(common objects)');
+ 
+$graph->xaxis->title->SetFont(FF_ARIAL, FS_BOLD, 10);
+$graph->xaxis->title->Set('X-title');
+$graph->yaxis->title->SetFont(FF_ARIAL, FS_BOLD, 10);
+$graph->yaxis->title->Set('Y-title');
+ 
+// Set the colors for the plots
+$lineplot->SetColor('blue');
+$lineplot->SetWeight(2);
+$lineplot2->SetColor('darkred');
+$lineplot2->SetWeight(2);
+ 
+// Set the legends for the plots
+$lineplot->SetLegend('Plot 1');
+$lineplot2->SetLegend('Plot 2');
+ 
+// Adjust the legend position
+$graph->legend->SetPos(0.05,0.5,'right','center');
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/common-obj-piegraph.html b/includes/jpgraph/docs/chunkhtml/example_src/common-obj-piegraph.html new file mode 100644 index 0000000..2b6d91f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/common-obj-piegraph.html @@ -0,0 +1,76 @@ +
common-obj-piegraph.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php
+include ("../jpgraph.php");
+include ("../jpgraph_pie.php");
+ 
+// Some data
+$data = array(50,15,25,10,31,20);
+ 
+// A new graph
+$graph = new PieGraph(400,420);
+$graph->SetAntiAliasing();
+ 
+$graph->title->SetFont(FF_ARIAL, FS_BOLD, 14);
+$graph->title->Set('Using JpGraph Library');
+$graph->title->SetMargin(10);
+ 
+$graph->subtitle->SetFont(FF_ARIAL, FS_BOLD, 10);
+$graph->subtitle->Set('(common objects)');
+ 
+// The pie plot
+$p1 = new PiePlot($data);
+$p1->SetSliceColors(array('darkred','navy','lightblue','orange','gray','teal'));
+ 
+// Move center of pie to the left to make better room
+// for the legend
+$p1->SetSize(0.3);
+$p1->SetCenter(0.5,0.47);
+$p1->value->Show();
+$p1->value->SetFont(FF_ARIAL,FS_NORMAL,10);
+ 
+// Legends
+$p1->SetLegends(array("May (%1.1f%%)","June (%1.1f%%)","July (%1.1f%%)","Aug (%1.1f%%)",
+"Sep (%1.1f%%)", "Oct (%1.1f%%)"));
+$graph->legend->SetPos(0.5,0.97,'center','bottom');
+$graph->legend->SetColumns(3);
+ 
+$graph->Add($p1);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex1.html new file mode 100644 index 0000000..3ce0ff0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex1.html @@ -0,0 +1,100 @@ +
contour2_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(With lines and labels)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot
+$cp = new FilledContourPlot($data);
+ 
+// Use only blue/red color schema
+$cp->UseHighContrastColor(true);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+ 
+// Display the labels
+$cp->ShowLabels(true,true);
+$cp->SetFont(FF_ARIAL,FS_BOLD,9);
+$cp->SetFontColor('white');
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex2.html new file mode 100644 index 0000000..7eea493 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex2.html @@ -0,0 +1,102 @@ +
contour2_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(No lines, no labels)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot
+$cp = new FilledContourPlot($data);
+ 
+// Use only blue/red color schema
+$cp->UseHighContrastColor(true);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+ 
+// No labels
+$cp->ShowLabels(false);
+ 
+// No lines
+$cp->ShowLines(false);
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex3.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex3.html new file mode 100644 index 0000000..97a6955 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex3.html @@ -0,0 +1,110 @@ +
contour2_ex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(Manual colors)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot with only 3 isobars
+$cp = new FilledContourPlot($data,3);
+ 
+// Specify the colors manually
+$isobar_colors = array('lightgray','teal:1.3','orange','red');
+$cp->SetIsobarColors($isobar_colors);
+ 
+// Use only blue/red color schema
+$cp->UseHighContrastColor(true);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+ 
+// Display labels
+$cp->ShowLabels(true);
+ 
+// No lines
+$cp->ShowLines(false);
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex4.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex4.html new file mode 100644 index 0000000..4455048 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex4.html @@ -0,0 +1,94 @@ +
contour2_ex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(labels follows gradients)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot
+$cp = new FilledContourPlot($data,8);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+ 
+// Display the labels
+$cp->ShowLabels(true,true);
+$cp->SetFont(FF_ARIAL,FS_BOLD,9);
+$cp->SetFontColor('black');
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex5.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex5.html new file mode 100644 index 0000000..dbb7702 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex5.html @@ -0,0 +1,104 @@ +
contour2_ex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(horizontal labels)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot
+$cp = new FilledContourPlot($data,8);
+ 
+// Use only black/and white schema
+$cp->UseHighContrastColor(true,true);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+// Show lines in red
+$cp->ShowLines(true,'red');
+ 
+// Display the labels
+$cp->ShowLabels(true,false);
+$cp->SetFont(FF_ARIAL,FS_BOLD,9);
+$cp->SetFontColor('white');
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex6.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex6.html new file mode 100644 index 0000000..3d75550 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex6.html @@ -0,0 +1,106 @@ +
contour2_ex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(With lines and labels)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot
+$cp = new FilledContourPlot($data,7);
+ 
+// Use only blue/red color schema
+$cp->UseHighContrastColor(true);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+ 
+// Specify method to use
+$cp->SetMethod('rect');
+ 
+// Display the labels
+$cp->ShowLabels(true,true);
+$cp->SetFont(FF_ARIAL,FS_BOLD,9);
+$cp->SetFontColor('white');
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex7.html b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex7.html new file mode 100644 index 0000000..a8f1e9c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/contour2_ex7.html @@ -0,0 +1,106 @@ +
contour2_ex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_contourf.php');
+ 
+// Setup some data to use for the contour
+$data = array(
+    array (12,12,10,10),
+    array (10,10,8,14),
+    array (7,7,13,17),
+    array (4,5,8,12),
+    array (10,8,7,8));
+ 
+// create a basic graph as a container
+$graph = new Graph(300,300);
+$graph->SetMargin(30, 30, 40, 30);
+$graph->SetScale('intint');
+$graph->SetMarginColor('white');
+ 
+// Setup title of graph
+$graph->title->Set('Filled contour plot');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+ 
+$graph->subtitle->Set('(With lines and labels)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+ 
+// Create a new contour plot
+$cp = new FilledContourPlot($data,7);
+ 
+// Use only blue/red color schema
+$cp->UseHighContrastColor(true);
+ 
+// Flip visually 
+$cp->SetInvert();
+ 
+// Fill the contours
+$cp->SetFilled(true);
+ 
+// Specify method to use
+$cp->SetMethod('tri');
+ 
+// Display the labels
+$cp->ShowLabels(true,true);
+$cp->SetFont(FF_ARIAL,FS_BOLD,9);
+$cp->SetFontColor('white');
+ 
+// And add the plot to the graph
+$graph->Add($cp);
+ 
+// Send it back to the client
+$graph->stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex0.html new file mode 100644 index 0000000..47bcbb2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex0.html @@ -0,0 +1,36 @@ +
datamatrix_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'The first datamatrix';
+$encoder = DatamatrixFactory::Create();
+$encoder->SetEncoding(ENCODING_ASCII);
+$backend = DatamatrixBackendFactory::Create($encoder);
+ 
+// We increase the module width to 3 pixels
+$backend->SetModuleWidth(3);
+ 
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    echo 'Datamatrix error: '.$e->GetMessage()."\n";
+    exit(1);
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex00.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex00.html new file mode 100644 index 0000000..7f571c5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex00.html @@ -0,0 +1,18 @@ +
datamatrix_ex00.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'The first datamatrix';
+ 
+$encoder = DatamatrixFactory::Create();
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex1.html new file mode 100644 index 0000000..06bc49a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex1.html @@ -0,0 +1,36 @@ +
datamatrix_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = '123456';
+ 
+$encoder = DatamatrixFactory::Create();
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->SetModuleWidth(3);
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex4.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex4.html new file mode 100644 index 0000000..700a29c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex4.html @@ -0,0 +1,50 @@ +
datamatrix_ex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'This is a 64x64 datamatrix symbol';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create(DMAT_64x64);
+$encoder->SetEncoding(ENCODING_TEXT);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->SetModuleWidth(3);
+ 
+// Adjust the Quiet zone
+$backend->SetQuietZone(10);
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex5.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex5.html new file mode 100644 index 0000000..e232854 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex5.html @@ -0,0 +1,60 @@ +
datamatrix_ex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'This is a 20x20 symbol';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create(DMAT_20x20);
+$encoder->SetEncoding(ENCODING_TEXT);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+ 
+// By default the module width is 2 pixel so we increase it a bit
+$backend->SetModuleWidth(4);
+ 
+// Set Quiet zone
+$backend->SetQuietZone(10);
+ 
+// Set other than default colors (one, zero, quiet zone/background)
+$backend->SetColor('navy','white','lightgray');
+ 
+// Create the barcode from the given data string and write to output file
+try {
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex6.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex6.html new file mode 100644 index 0000000..2ade239 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex6.html @@ -0,0 +1,66 @@ +
datamatrix_ex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'This is a datamatrix symbol';
+ 
+$outputfile = 'dm_ex6.png';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create();
+$encoder->SetEncoding(ENCODING_TEXT);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder);
+$backend->SetModuleWidth(5);
+$backend->SetQuietZone(10);
+ 
+// Set other than default colors (one, zero, background)
+$backend->SetColor('navy','white');
+ 
+// Create the barcode from the given data string and write to output file
+$dir = dirname(__FILE__);
+$file = '<span style="font-weight:bold;">"'.$dir.'/'.$outputfile.'"</span>';
+try {
+    $backend->Stroke($data,$outputfile);
+    echo 'Barcode sucessfully written to file: '.$file;
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    $errcode = $e->GetCode();
+    echo "Failed writing file: ".$file.'<br>';
+    echo "Datamatrix error ($errcode). Message: $errstr\n";
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex7.html b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex7.html new file mode 100644 index 0000000..c834b4e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datamatrix_ex7.html @@ -0,0 +1,44 @@ +
datamatrix_ex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+require_once('jpgraph/datamatrix/datamatrix.inc.php');
+ 
+$data = 'A Datamatrix barcode';
+ 
+// Create and set parameters for the encoder
+$encoder = DatamatrixFactory::Create();
+$encoder->SetEncoding(ENCODING_BASE256);
+ 
+// Create the image backend (default)
+$backend = DatamatrixBackendFactory::Create($encoder, BACKEND_ASCII);
+$backend->SetModuleWidth(3);
+ 
+try {
+    $ps_txt = $backend->Stroke($data);
+    echo '<pre>'.$ps_txt.'</pre>';
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo "Datamatrix error message: $errstr\n";
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex1.html b/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex1.html new file mode 100644 index 0000000..aed7af2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex1.html @@ -0,0 +1,106 @@ +
dateaxisex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex2.html b/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex2.html new file mode 100644 index 0000000..3875bd9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex2.html @@ -0,0 +1,76 @@ +
dateaxisex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex4.html b/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex4.html new file mode 100644 index 0000000..951970c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/dateaxisex4.html @@ -0,0 +1,88 @@ +
dateaxisex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/datescaleticksex01.html b/includes/jpgraph/docs/chunkhtml/example_src/datescaleticksex01.html new file mode 100644 index 0000000..8677d27 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/datescaleticksex01.html @@ -0,0 +1,126 @@ +
datescaleticksex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
<?php // content="text/plain; charset=utf-8"
+require_once ('../jpgraph.php');
+require_once ('../jpgraph_line.php');
+require_once ('../jpgraph_date.php');
+ 
+DEFINE('INTERVAL', 5*60);
+ 
+// First create some "dummy" data
+$m = 5; // Number of data sets
+$n = 4; // Number of bids to show
+$startbid = 8000;
+ 
+for( $i=0; $i < $m; ++$i ) {
+    $bids[$i] = array($startbid + rand(100,500)*10 );
+    for( $j=1; $j < $n; ++$j ) {
+        $bids[$i][$j] = $bids[$i][$j-1] + rand(20,500)*10;
+    }
+}
+ 
+$start = floor(time()/INTERVAL)*INTERVAL;
+$times = array($start);
+for( $i=1; $i < $n; ++$i ) {
+    // Create a timestamp for every 5 minutes
+    $times[$i] = $times[$i-1]+INTERVAL;
+}
+ 
+// Setup the bid graph
+$graph = new Graph(600,250);
+$graph->SetMargin(80,30,50,40);
+$graph->SetMarginColor('white');
+$graph->SetScale('dateint');
+$graph->title->Set('Current Bids');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->subtitle->Set('(Updated every 5 minutes)');
+$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10);
+ 
+// Enable antialias
+$graph->img->SetAntiAliasing();
+ 
+// Setup the y-axis to show currency values
+$graph->yaxis->SetLabelFormatCallback('number_format');
+$graph->yaxis->SetLabelFormat('$%s');
+ 
+//Use hour:minute format for the labels
+$graph->xaxis->scale->SetDateFormat('H:i');
+ 
+// Force labels to only be displayed every 5 minutes
+$graph->xaxis->scale->ticks->Set(INTERVAL);
+ 
+// Adjust the start time for an "even" 5 minute, i.e. 5,10,15,20,25, ...
+$graph->xaxis->scale->SetTimeAlign(MINADJ_5);
+ 
+// Create the plots using the dummy data created at the beginning
+$line = array();
+for( $i=0; $i < $m; ++$i ) {
+    $line[$i] = new LinePlot($bids[$i],$times);
+    $line[$i]->mark->SetType(MARK_SQUARE);
+}
+$graph->Add($line);
+ 
+// Send the graph back to the client
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/dateutilex01.html b/includes/jpgraph/docs/chunkhtml/example_src/dateutilex01.html new file mode 100644 index 0000000..0b8b018 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/dateutilex01.html @@ -0,0 +1,106 @@ +
dateutilex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// Get a dataset stored in $xdata and $ydata
+require_once ('dataset01.inc.php');
+ 
+$dateUtils = new DateScaleUtils();
+ 
+// Setup a basic graph
+$width=500; $height=300;
+$graph = new Graph($width, $height);
+ 
+// We set the x-scale min/max values to avoid empty space
+// on the side of the plot
+$graph->SetScale('intlin',0,0,min($xdata),max($xdata));
+$graph->SetMargin(60,20,40,60);
+ 
+// Setup the titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Development since 1984');
+$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10);
+$graph->subtitle->Set('(Example using DateScaleUtils class)');
+ 
+// Setup the labels to be correctly format on the X-axis
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
+$graph->xaxis->SetLabelAngle(30);
+ 
+// The second paramter set to 'true' will make the library interpret the
+// format string as a date format. We use a Month + Year format
+$graph->xaxis->SetLabelFormatString('M, Y',true);
+ 
+// Get manual tick every second year
+list($tickPos,$minTickPos) = $dateUtils->getTicks($xdata,DSUTILS_YEAR2);
+$graph->xaxis->SetTickPositions($tickPos,$minTickPos);
+ 
+// First add an area plot
+$lp1 = new LinePlot($ydata,$xdata);
+$lp1->SetWeight(0);
+$lp1->SetFillColor('orange@0.85');
+$graph->Add($lp1);
+ 
+// And then add line. We use two plots in order to get a
+// more distinct border on the graph
+$lp2 = new LinePlot($ydata,$xdata);
+$lp2->SetColor('orange');
+$graph->Add($lp2);
+ 
+// And send back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/dateutilex02.html b/includes/jpgraph/docs/chunkhtml/example_src/dateutilex02.html new file mode 100644 index 0000000..368ba94 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/dateutilex02.html @@ -0,0 +1,94 @@ +
dateutilex02.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_date.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// Get a dataset stored in $xdata and $ydata
+require_once ('dataset01.inc.php');
+ 
+$dateUtils = new DateScaleUtils();
+ 
+// Setup a basic graph
+$width=500; $height=300;
+$graph = new Graph($width, $height);
+$graph->SetScale('datlin');
+$graph->SetMargin(60,20,40,60);
+ 
+// Setup the titles
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('Development since 1984');
+$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10);
+$graph->subtitle->Set('(Example using the builtin date scale)');
+ 
+// Setup the labels to be correctly format on the X-axis
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
+$graph->xaxis->SetLabelAngle(30);
+ 
+// The second paramter set to 'true' will make the library interpret the
+// format string as a date format. We use a Month + Year format
+// $graph->xaxis->SetLabelFormatString('M, Y',true);
+ 
+// First add an area plot
+$lp1 = new LinePlot($ydata,$xdata);
+$lp1->SetWeight(0);
+$lp1->SetFillColor('orange@0.85');
+$graph->Add($lp1);
+ 
+// And then add line. We use two plots in order to get a
+// more distinct border on the graph
+$lp2 = new LinePlot($ydata,$xdata);
+$lp2->SetColor('orange');
+$graph->Add($lp2);
+ 
+// And send back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example0-0.html b/includes/jpgraph/docs/chunkhtml/example_src/example0-0.html new file mode 100644 index 0000000..7c5158b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example0-0.html @@ -0,0 +1,50 @@ +
example0-0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example0.html b/includes/jpgraph/docs/chunkhtml/example_src/example0.html new file mode 100644 index 0000000..f682772 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example0.html @@ -0,0 +1,42 @@ +
example0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example11.html b/includes/jpgraph/docs/chunkhtml/example_src/example11.html new file mode 100644 index 0000000..a04fd49 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example11.html @@ -0,0 +1,100 @@ +
example11.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+ 
+$timer = new JpgTimer();
+$timer->Push();
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(300,200);
+$graph->SetScale("textlin");
+ 
+$graph->SetMargin(40,20,20,60);
+ 
+$graph->title->Set("Timing a graph");
+$graph->footer->right->Set('Timer (ms): ');
+$graph->footer->right->SetFont(FF_COURIER,FS_ITALIC);
+$graph->footer->SetTimer($timer);
+ 
+// 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->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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example13.html b/includes/jpgraph/docs/chunkhtml/example_src/example13.html new file mode 100644 index 0000000..a106ea2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example13.html @@ -0,0 +1,72 @@ +
example13.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example14.html b/includes/jpgraph/docs/chunkhtml/example_src/example14.html new file mode 100644 index 0000000..d45b1a1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example14.html @@ -0,0 +1,74 @@ +
example14.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example15.html b/includes/jpgraph/docs/chunkhtml/example_src/example15.html new file mode 100644 index 0000000..031280a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example15.html @@ -0,0 +1,80 @@ +
example15.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example16.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example16.1.html new file mode 100644 index 0000000..519dac4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example16.1.html @@ -0,0 +1,88 @@ +
example16.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example16.3.html b/includes/jpgraph/docs/chunkhtml/example_src/example16.3.html new file mode 100644 index 0000000..d348ef4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example16.3.html @@ -0,0 +1,90 @@ +
example16.3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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','Jun','Jul','Aug');
+ 
+// Create the graph. 
+$graph = new Graph(400,200);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example16.4.html b/includes/jpgraph/docs/chunkhtml/example_src/example16.4.html new file mode 100644 index 0000000..53cae78 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example16.4.html @@ -0,0 +1,92 @@ +
example16.4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$l1datay = array(11,9,2,4,3,13,17);
+$l2datay = array(23,12,5,19,17,10,15);
+JpgraphError::SetImageFlag(false);
+JpGraphError::SetLogFile('syslog');
+ 
+// Create the graph. 
+$graph = new Graph(400,200);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example16.6.html b/includes/jpgraph/docs/chunkhtml/example_src/example16.6.html new file mode 100644 index 0000000..82fbe81 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example16.6.html @@ -0,0 +1,114 @@ +
example16.6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// Create some "fake" regression data
+$datay = array();
+$datax = array();
+$a= 3.2;
+$b= 2.5;
+for($x=0; $x < 20; ++$x) {
+    $datax[$x] = $x;
+    $datay[$x] = $a + $b*$x + rand(-20,20);
+}
+ 
+$lr = new LinearRegression($datax, $datay);
+list( $stderr, $corr ) = $lr->GetStat();
+list( $xd, $yd ) = $lr->GetY(0,19);
+ 
+// Create the graph
+$graph = new Graph(300,250);
+$graph->SetScale('linlin');
+ 
+// Setup title
+$graph->title->Set("Linear regression");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$graph->subtitle->Set('(stderr='.sprintf('%.2f',$stderr).', corr='.sprintf('%.2f',$corr).')');
+$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,12);
+ 
+// 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($datay,$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($yd);
+$lplot->SetWeight(2);
+$lplot->SetColor('navy');
+ 
+// Add the pltos to the line
+$graph->Add($sp1);
+$graph->Add($lplot);
+ 
+// ... and stroke
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example16.html b/includes/jpgraph/docs/chunkhtml/example_src/example16.html new file mode 100644 index 0000000..8611f38 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example16.html @@ -0,0 +1,88 @@ +
example16.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example17.html b/includes/jpgraph/docs/chunkhtml/example_src/example17.html new file mode 100644 index 0000000..34207e0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example17.html @@ -0,0 +1,82 @@ +
example17.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example19.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example19.1.html new file mode 100644 index 0000000..a4b97ae --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example19.1.html @@ -0,0 +1,70 @@ +
example19.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale('intlin');
+ 
+// Add a drop shadow
+$graph->SetShadow();
+ 
+// Adjust the margin a bit to make more room for titles
+$graph->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 basic 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example19.html b/includes/jpgraph/docs/chunkhtml/example_src/example19.html new file mode 100644 index 0000000..5b061c0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example19.html @@ -0,0 +1,70 @@ +
example19.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$graph->SetScale('textlin');
+ 
+// Add a drop shadow
+$graph->SetShadow();
+ 
+// Adjust the margin a bit to make more room for titles
+$graph->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 basic 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example2.html b/includes/jpgraph/docs/chunkhtml/example_src/example2.html new file mode 100644 index 0000000..be07744 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example2.html @@ -0,0 +1,66 @@ +
example2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example20.3.html b/includes/jpgraph/docs/chunkhtml/example_src/example20.3.html new file mode 100644 index 0000000..2d58aa8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example20.3.html @@ -0,0 +1,80 @@ +
example20.3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example21.html b/includes/jpgraph/docs/chunkhtml/example_src/example21.html new file mode 100644 index 0000000..95132bd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example21.html @@ -0,0 +1,74 @@ +
example21.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example22.html b/includes/jpgraph/docs/chunkhtml/example_src/example22.html new file mode 100644 index 0000000..703da66 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example22.html @@ -0,0 +1,76 @@ +
example22.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example23.html b/includes/jpgraph/docs/chunkhtml/example_src/example23.html new file mode 100644 index 0000000..aca025b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example23.html @@ -0,0 +1,78 @@ +
example23.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example24.html b/includes/jpgraph/docs/chunkhtml/example_src/example24.html new file mode 100644 index 0000000..5ded885 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example24.html @@ -0,0 +1,92 @@ +
example24.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example25.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example25.1.html new file mode 100644 index 0000000..a31f43c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example25.1.html @@ -0,0 +1,80 @@ +
example25.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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,40,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->SetPos(10,20);
+$txt->SetColor('darkred');
+$txt->SetFont(FF_FONT2,FS_BOLD);
+$txt->SetBox('yellow','navy','gray@0.5');
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example25.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example25.2.html new file mode 100644 index 0000000..586b58d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example25.2.html @@ -0,0 +1,82 @@ +
example25.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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->SetPos(0.5,0.5,'center','center');
+$txt->SetFont(FF_FONT2,FS_BOLD);
+$txt->ParagraphAlign('center');
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example25.html b/includes/jpgraph/docs/chunkhtml/example_src/example25.html new file mode 100644 index 0000000..22ca324 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example25.html @@ -0,0 +1,78 @@ +
example25.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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,40,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->SetPos(0,20);
+$txt->SetColor('darkred');
+$txt->SetFont(FF_FONT2,FS_BOLD);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example26.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example26.1.html new file mode 100644 index 0000000..6036c58 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example26.1.html @@ -0,0 +1,40 @@ +
example26.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,21,33);
+ 
+$graph = new PieGraph(300,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example26.html b/includes/jpgraph/docs/chunkhtml/example_src/example26.html new file mode 100644 index 0000000..47dce53 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example26.html @@ -0,0 +1,32 @@ +
example26.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example27.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example27.1.html new file mode 100644 index 0000000..d84df08 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example27.1.html @@ -0,0 +1,46 @@ +
example27.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+require_once ('jpgraph/jpgraph_pie3d.php');
+ 
+$data = array(40,60,21,33);
+ 
+$graph = new PieGraph(300,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example27.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example27.2.html new file mode 100644 index 0000000..dfd122b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example27.2.html @@ -0,0 +1,44 @@ +
example27.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+require_once ('jpgraph/jpgraph_pie3d.php');
+ 
+$data = array(40,60,21,33);
+ 
+$graph = new PieGraph(300,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example27.3.html b/includes/jpgraph/docs/chunkhtml/example_src/example27.3.html new file mode 100644 index 0000000..6ed3318 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example27.3.html @@ -0,0 +1,44 @@ +
example27.3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+require_once ('jpgraph/jpgraph_pie3d.php');
+ 
+$data = array(40,60,21,33);
+ 
+$graph = new PieGraph(330,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example27.html b/includes/jpgraph/docs/chunkhtml/example_src/example27.html new file mode 100644 index 0000000..07da26f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example27.html @@ -0,0 +1,44 @@ +
example27.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+require_once ('jpgraph/jpgraph_pie3d.php');
+ 
+$data = array(40,60,21,33);
+ 
+$graph = new PieGraph(300,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example28.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example28.1.html new file mode 100644 index 0000000..c07fc2c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example28.1.html @@ -0,0 +1,40 @@ +
example28.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,21,33,12,33);
+ 
+$graph = new PieGraph(150,150);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example28.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example28.2.html new file mode 100644 index 0000000..c60b0c3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example28.2.html @@ -0,0 +1,40 @@ +
example28.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,21,33,12,33);
+ 
+$graph = new PieGraph(150,150);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example28.3.html b/includes/jpgraph/docs/chunkhtml/example_src/example28.3.html new file mode 100644 index 0000000..6203e7f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example28.3.html @@ -0,0 +1,40 @@ +
example28.3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,21,33,12,33);
+ 
+$graph = new PieGraph(150,150);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example28.html b/includes/jpgraph/docs/chunkhtml/example_src/example28.html new file mode 100644 index 0000000..d421410 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example28.html @@ -0,0 +1,40 @@ +
example28.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,21,33,12,33);
+ 
+$graph = new PieGraph(150,150);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.0.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.0.1.html new file mode 100644 index 0000000..07b6da4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.0.1.html @@ -0,0 +1,82 @@ +
example3.0.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+ 
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.0.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.0.2.html new file mode 100644 index 0000000..134967f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.0.2.html @@ -0,0 +1,80 @@ +
example3.0.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(17,3,'-',10,7,'-',3,19,9,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Interpolated values');
+$graph->xaxis->title->Set('x-title');
+$graph->yaxis->title->Set('y-title');
+ 
+$graph->yaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 );
+$graph->xaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+ 
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.0.3.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.0.3.html new file mode 100644 index 0000000..c3f3f3a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.0.3.html @@ -0,0 +1,80 @@ +
example3.0.3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(17,3,'',10,7,'',3,19,9,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('NULL values');
+$graph->xaxis->title->Set('x-title');
+$graph->yaxis->title->Set('y-title');
+ 
+$graph->yaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 );
+$graph->xaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+ 
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.1.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.1.1.html new file mode 100644 index 0000000..cccb482 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.1.1.html @@ -0,0 +1,86 @@ +
example3.1.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+ 
+// Add an image mark scaled to 50%
+$lineplot->mark->SetType(MARK_IMG_DIAMOND,'red',0.5);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.1.html new file mode 100644 index 0000000..76dcd4c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.1.html @@ -0,0 +1,86 @@ +
example3.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+$lineplot->mark->SetType(MARK_UTRIANGLE);
+$lineplot->mark->SetColor('blue');
+$lineplot->mark->SetFillColor('red');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.2.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.2.1.html new file mode 100644 index 0000000..b8d8bc8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.2.1.html @@ -0,0 +1,70 @@ +
example3.2.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.2.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.2.2.html new file mode 100644 index 0000000..46213cc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.2.2.html @@ -0,0 +1,74 @@ +
example3.2.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.2.html new file mode 100644 index 0000000..68fe3fc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.2.html @@ -0,0 +1,68 @@ +
example3.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.3.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.3.html new file mode 100644 index 0000000..20b4cc2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.3.html @@ -0,0 +1,90 @@ +
example3.3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+$lineplot->mark->SetType(MARK_UTRIANGLE);
+$lineplot->mark->SetColor('blue');
+$lineplot->mark->SetFillColor('red');
+ 
+$lineplot->value->Show();
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.4.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.4.1.html new file mode 100644 index 0000000..29d9fa2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.4.1.html @@ -0,0 +1,162 @@ +
example3.4.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// A function to return the Roman Numeral, given an integer
+ function numberToRoman($aNum)
+ {
+     // Make sure that we only use the integer portion of the value
+     $n = intval($aNum);
+     $result = '';
+ 
+     // Declare a lookup array that we will use to traverse the number:
+     $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
+     'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,
+     'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
+ 
+     foreach ($lookup as $roman => $value)
+     {
+         // Determine the number of matches
+         $matches = intval($n / $value);
+ 
+         // Store that many characters
+         $result .= str_repeat($roman, $matches);
+ 
+         // Substract that from the number
+         $n = $n % $value;
+     }
+ 
+     // The Roman numeral should be built, return it
+     return $result;
+}
+ 
+function formatCallback($aVal) {
+    return '('.numberToRoman($aVal).')';
+}
+ 
+ 
+ // Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+$lineplot->mark->SetType(MARK_UTRIANGLE);
+$lineplot->mark->SetColor('blue');
+$lineplot->mark->SetFillColor('red');
+ 
+$lineplot->value->Show();
+$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
+$lineplot->value->SetColor('darkred');
+$lineplot->value->SetFormatCallback('formatCallback');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.4.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.4.html new file mode 100644 index 0000000..62bff03 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.4.html @@ -0,0 +1,96 @@ +
example3.4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+$graph->yaxis->SetColor('blue');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+$lineplot->mark->SetType(MARK_UTRIANGLE);
+$lineplot->mark->SetColor('blue');
+$lineplot->mark->SetFillColor('red');
+ 
+$lineplot->value->Show();
+$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
+$lineplot->value->SetColor('darkred');
+$lineplot->value->SetFormat('(%d)');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example3.html b/includes/jpgraph/docs/chunkhtml/example_src/example3.html new file mode 100644 index 0000000..24a5cb6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example3.html @@ -0,0 +1,76 @@ +
example3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+// Some (random) data
+$ydata = array(11,3,8,12,5,1,9,13,5,7);
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetColor( 'blue' );
+$lineplot->SetWeight( 2 );   // Two pixel wide
+ 
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example4.html b/includes/jpgraph/docs/chunkhtml/example_src/example4.html new file mode 100644 index 0000000..239009f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example4.html @@ -0,0 +1,90 @@ +
example4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+ // Some (random) data
+$ydata   = array(11, 3, 8, 12, 5, 1, 9, 13, 5, 7);
+$ydata2  = array(1, 19, 15, 7, 22, 14, 5, 9, 21, 13 );
+ 
+// Size of the overall graph
+$width=350;
+$height=250;
+ 
+// Create the graph and set a scale.
+// These two calls are always required
+$graph = new Graph($width,$height);
+$graph->SetScale('intlin');
+$graph->SetShadow();
+ 
+// Setup margin and titles
+$graph->SetMargin(40,20,20,40);
+$graph->title->Set('Calls per operator (June,July)');
+$graph->subtitle->Set('(March 12, 2008)');
+$graph->xaxis->title->Set('Operator');
+$graph->yaxis->title->Set('# of calls');
+ 
+$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD );
+ 
+// Create the first data series
+$lineplot=new LinePlot($ydata);
+$lineplot->SetWeight( 2 );   // Two pixel wide
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Create the second data series
+$lineplot2=new LinePlot($ydata2);
+$lineplot2->SetWeight( 2 );   // Two pixel wide
+ 
+// Add the second plot to the graph
+$graph->Add($lineplot2);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example5.html b/includes/jpgraph/docs/chunkhtml/example_src/example5.html new file mode 100644 index 0000000..198d68d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example5.html @@ -0,0 +1,88 @@ +
example5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example6.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example6.1.html new file mode 100644 index 0000000..dfb73c4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example6.1.html @@ -0,0 +1,110 @@ +
example6.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example6.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example6.2.html new file mode 100644 index 0000000..167cbe2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example6.2.html @@ -0,0 +1,94 @@ +
example6.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example6.html b/includes/jpgraph/docs/chunkhtml/example_src/example6.html new file mode 100644 index 0000000..a3af24d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example6.html @@ -0,0 +1,108 @@ +
example6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example7.html b/includes/jpgraph/docs/chunkhtml/example_src/example7.html new file mode 100644 index 0000000..b7797cb --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example7.html @@ -0,0 +1,88 @@ +
example7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example8.html b/includes/jpgraph/docs/chunkhtml/example_src/example8.html new file mode 100644 index 0000000..d74a9f2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example8.html @@ -0,0 +1,96 @@ +
example8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example9.1.html b/includes/jpgraph/docs/chunkhtml/example_src/example9.1.html new file mode 100644 index 0000000..42724d7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example9.1.html @@ -0,0 +1,100 @@ +
example9.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example9.2.html b/includes/jpgraph/docs/chunkhtml/example_src/example9.2.html new file mode 100644 index 0000000..bdff657 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example9.2.html @@ -0,0 +1,104 @@ +
example9.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/example9.html b/includes/jpgraph/docs/chunkhtml/example_src/example9.html new file mode 100644 index 0000000..023e489 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/example9.html @@ -0,0 +1,98 @@ +
example9.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/fieldscatterex1.html b/includes/jpgraph/docs/chunkhtml/example_src/fieldscatterex1.html new file mode 100644 index 0000000..b706c94 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/fieldscatterex1.html @@ -0,0 +1,180 @@ +
fieldscatterex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/filledgridex1.html b/includes/jpgraph/docs/chunkhtml/example_src/filledgridex1.html new file mode 100644 index 0000000..44f3c83 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/filledgridex1.html @@ -0,0 +1,96 @@ +
filledgridex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/filledlineex01.1.html b/includes/jpgraph/docs/chunkhtml/example_src/filledlineex01.1.html new file mode 100644 index 0000000..e889a70 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/filledlineex01.1.html @@ -0,0 +1,48 @@ +
filledlineex01.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/filledlineex01.html b/includes/jpgraph/docs/chunkhtml/example_src/filledlineex01.html new file mode 100644 index 0000000..6b9b0f1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/filledlineex01.html @@ -0,0 +1,46 @@ +
filledlineex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/filledlineex03.html b/includes/jpgraph/docs/chunkhtml/example_src/filledlineex03.html new file mode 100644 index 0000000..f0fc803 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/filledlineex03.html @@ -0,0 +1,42 @@ +
filledlineex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$datay = array(11,30,20,13,10,'x',16,12,'x',15,4,9);
+ 
+// Setup the graph
+$graph = new Graph(400,250);
+$graph->SetScale('intlin');
+$graph->title->Set('Filled line with NULL values');
+//Make sure data starts from Zero whatever data we have
+$graph->yscale->SetAutoMin(0);
+ 
+$p1 = new LinePlot($datay);
+$p1->SetFillColor('lightblue');
+$graph->Add($p1);
+ 
+// Output line
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/fixscale_radarex1.html b/includes/jpgraph/docs/chunkhtml/example_src/fixscale_radarex1.html new file mode 100644 index 0000000..823ea15 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/fixscale_radarex1.html @@ -0,0 +1,72 @@ +
fixscale_radarex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+$graph = new RadarGraph(300,300);
+$graph->SetScale('lin',0,50);
+$graph->yscale->ticks->Set(25,5);
+$graph->SetColor('white');
+$graph->SetShadow();
+ 
+$graph->SetCenter(0.5,0.55);
+ 
+$graph->axis->SetFont(FF_FONT1,FS_BOLD);
+$graph->axis->SetWeight(2);
+ 
+// Uncomment the following lines to also show grid lines.
+$graph->grid->SetLineStyle('dashed');
+$graph->grid->SetColor('navy@0.5');
+$graph->grid->Show();
+ 
+$graph->ShowMinorTickMarks();
+ 
+$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'));
+ 
+$plot = new RadarPlot(array(12,35,20,30,33,15,37));
+$plot->SetLegend('Goal');
+$plot->SetColor('red','lightred');
+$plot->SetFillColor('lightblue');
+$plot->SetLineWeight(2);
+ 
+$graph->Add($plot);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/footerex1.html b/includes/jpgraph/docs/chunkhtml/example_src/footerex1.html new file mode 100644 index 0000000..19bcc0b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/footerex1.html @@ -0,0 +1,120 @@ +
footerex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+$datay1 = array(4,26,15,44);
+ 
+// Setup the graph
+$graph = new Graph(300,250);
+$graph->SetMarginColor('white');
+$graph->SetScale("textlin");
+$graph->SetFrame(false);
+$graph->SetMargin(30,5,25,50);
+ 
+// 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());
+ 
+$graph->footer->left->Set('L. footer');
+$graph->footer->left->SetFont(FF_ARIAL,FS_NORMAL,12); 
+$graph->footer->left->SetColor('darkred');
+$graph->footer->center->Set('C. footer');
+$graph->footer->center->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->footer->center->SetColor('darkred');
+$graph->footer->right->Set('R. footer');
+$graph->footer->right->SetFont(FF_ARIAL,FS_NORMAL,12); 
+$graph->footer->right->SetColor('darkred');
+ 
+// 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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/funcex2.html b/includes/jpgraph/docs/chunkhtml/example_src/funcex2.html new file mode 100644 index 0000000..59e6142 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/funcex2.html @@ -0,0 +1,64 @@ +
funcex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+$f = new FuncGenerator('cos($i)','$i*$i*$i');
+list($xdata,$ydata) = $f->E(-M_PI,M_PI,25);
+ 
+$graph = new Graph(380,450);
+$graph->SetScale("linlin");
+$graph->SetShadow();
+$graph->img->SetMargin(50,50,60,40);    
+$graph->SetBox(true,'black',2);    
+$graph->SetMarginColor('white');
+$graph->SetColor('lightyellow');
+$graph->SetAxisStyle(AXSTYLE_SIMPLE);
+ 
+//$graph->xaxis->SetLabelFormat('%.1f');
+ 
+$graph->title->Set("Function plot with marker");
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->subtitle->Set("(BOXOUT Axis style)");
+$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL);
+ 
+$lp1 = new LinePlot($ydata,$xdata);
+$lp1->mark->SetType(MARK_FILLEDCIRCLE);
+$lp1->mark->SetFillColor("red");
+$lp1->SetColor("blue");
+ 
+$graph->Add($lp1);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gantt_samerowex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gantt_samerowex1.html new file mode 100644 index 0000000..2a63edf --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gantt_samerowex1.html @@ -0,0 +1,126 @@ +
gantt_samerowex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$graph->SetShadow();
+ 
+// Add title and subtitle
+$graph->title->Set("Activities on same row");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// 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); // 1=default value
+ 
+// Format the bar for the first activity
+// ($row,$title,$startdate,$enddate)
+$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2001-12-26","");
+ 
+// Yellow diagonal line pattern on a red background
+$activity1->SetPattern(BAND_RDIAG,"yellow");
+$activity1->SetFillColor("red");
+ 
+// Set absolute height of activity
+$activity1->SetHeight(16);
+ 
+// Format the bar for the second activity
+// ($row,$title,$startdate,$enddate)
+$activity2 = new GanttBar(0,"","2001-12-31","2002-01-2","[BO]");
+ 
+// 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 of activity
+$activity2->SetHeight(16);
+ 
+// Finally add the bar to the graph
+$graph->Add($activity1);
+$graph->Add($activity2);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gantt_samerowex2.html b/includes/jpgraph/docs/chunkhtml/example_src/gantt_samerowex2.html new file mode 100644 index 0000000..1a31b8b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gantt_samerowex2.html @@ -0,0 +1,130 @@ +
gantt_samerowex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$graph->SetShadow();
+ 
+// Add title and subtitle
+$graph->title->Set("Activities on same row");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->subtitle->Set('Using break style');
+ 
+// 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); // 1=default value
+ 
+// Format the bar for the first activity
+// ($row,$title,$startdate,$enddate)
+$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2001-12-26","");
+ 
+// Yellow diagonal line pattern on a red background
+$activity1->SetPattern(BAND_RDIAG,"yellow");
+$activity1->SetFillColor("red");
+ 
+// Format the bar for the first activity
+// ($row,$title,$startdate,$enddate)
+$break1 = new GanttBar(0,'',"2001-12-27","2001-12-30","");
+$break1->SetBreakStyle(true,'dotted',2);
+$break1->SetColor('red');
+$graph->Add($break1);
+ 
+// Format the bar for the second activity
+// ($row,$title,$startdate,$enddate)
+$activity2 = new GanttBar(0,"","2001-12-31","2002-01-2","[BO]");
+ 
+// 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");
+ 
+// Finally add the bar to the graph
+$graph->Add($activity1);
+$graph->Add($activity2);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gantt_textex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gantt_textex1.html new file mode 100644 index 0000000..b89762a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gantt_textex1.html @@ -0,0 +1,192 @@ +
gantt_textex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+require_once ('jpgraph/jpgraph_flags.php');
+ 
+$graph = new GanttGraph(0,0);
+$graph->SetBox();
+$graph->SetShadow();
+ 
+// Add title and subtitle
+$graph->title->Set("Example with added texts");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// 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","2001-12-27","[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 text to top left corner of graph
+$txt1 = new Text();
+$txt1->SetPos(5,2);
+$txt1->Set("Note:\nEstimate done w148");
+$txt1->SetFont(FF_ARIAL,FS_BOLD,12);
+$txt1->SetColor('darkred');
+$graph->Add($txt1);
+ 
+// Add text to the top bar
+$txt2 = new Text();
+$txt2->SetScalePos("2002-01-01",1);
+$txt2->SetFont(FF_ARIAL,FS_BOLD,12);
+$txt2->SetAlign('left','center');
+$txt2->Set("Remember this!");
+$txt2->SetBox('yellow');
+$graph->Add($txt2);
+ 
+ 
+// Add a vertical line
+$vline = new GanttVLine("2001-12-24","Phase 1");
+$vline->SetDayOffset(0.5);
+//$graph->Add($vline);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttcolumnfontsex01.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttcolumnfontsex01.html new file mode 100644 index 0000000..485829b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttcolumnfontsex01.html @@ -0,0 +1,132 @@ +
ganttcolumnfontsex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
<?php // content="text/plain; charset=utf-8"
+ 
+// Gantt column font array example
+ 
+require_once ('../jpgraph.php');
+require_once ('../jpgraph_gantt.php');
+ 
+// Setup a basic Gantt graph
+$graph = new GanttGraph();
+$graph->SetMarginColor('gray:1.7');
+$graph->SetColor('white');
+ 
+// Setup the graph title and title font
+$graph->title->Set("Example of column fonts");
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+ 
+// Show three headers
+$graph->ShowHeaders(GANTT_HDAY | GANTT_HMONTH| GANTT_HYEAR);
+ 
+// Set the column headers and font
+$graph->scale->actinfo->SetColTitles( array('Name','Start','End'),array(100));
+$graph->scale->actinfo->SetFont(FF_ARIAL,FS_BOLD,11);
+ 
+// Some "dummy" data to be dsiplayed
+$data = array(
+    array(0,'Group 1', '2001-11-27','2001-12-05'),
+    array(1,'  Activity 1', '2001-11-27','2001-11-29'),
+    array(2,'  Activity 2', '2001-11-28','2001-12-05'),
+    array(3,'Group 2', '2001-11-29','2001-12-10'),
+    array(4,'  Activity 1', '2001-11-29','2001-12-03'),
+    array(5,'  Activity 2', '2001-12-01','2001-12-10'),
+ 
+);
+ 
+// Format and add the Gantt bars to the chart
+$n = count($data);
+for($i=0; $i < $n; ++$i) {
+    if( $i === 0 || $i === 3 ) {
+        // Format the group bars
+        $bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.35);
+ 
+        // For each group make the name bold but keep the dates as the default font
+        $bar->title->SetColumnFonts(array(array(FF_ARIAL,FS_BOLD,11)));
+ 
+        // Add group markers
+        $bar->leftMark->SetType( MARK_LEFTTRIANGLE );
+        $bar->leftMark->Show();
+        $bar->rightMark->SetType( MARK_RIGHTTRIANGLE );
+        $bar->rightMark->Show();
+        $bar->SetFillColor('black');
+        $bar->SetPattern(BAND_SOLID,'black');
+    }
+    else {
+        // Format the activity bars
+        $bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.45);
+        $bar->SetPattern(BAND_RDIAG,'black');
+        $bar->SetFillColor('orange');
+    }
+    // Default font
+    $bar->title->SetFont(FF_ARIAL,FS_NORMAL,10);
+    $graph->Add($bar);
+}
+ 
+// Send back the graph to the client
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttconstrainex2.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttconstrainex2.html new file mode 100644 index 0000000..a9fb702 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttconstrainex2.html @@ -0,0 +1,74 @@ +
ganttconstrainex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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-11-01","2001-11-20",''),
+    array(2,ACTYPE_NORMAL,   "  Label 3",      "2001-10-26","2001-11-03",''),
+    array(3,ACTYPE_MILESTONE,"  Phase 1 Done", "2001-11-23",'M2') );
+ 
+// The constrains between the activities
+$constrains = array(array(2,1,CONSTRAIN_ENDSTART),
+            array(1,3,CONSTRAIN_STARTSTART));
+ 
+$progress = array(array(1,0.4));
+ 
+// Create the basic graph
+$graph = new GanttGraph();
+$graph->title->Set("Example with grouping and constrains");
+//$graph->SetFrame(false);
+ 
+// 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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex00.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex00.html new file mode 100644 index 0000000..e7d6047 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex00.html @@ -0,0 +1,28 @@ +
ganttex00.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+// A new graph with automatic size
+$graph = new GanttGraph();
+ 
+//  A new activity on row '0'
+$activity = new GanttBar(0,"Activity 1","2001-12-21","2002-01-19");
+$graph->Add($activity);
+ 
+// Display the Gantt chart
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex01.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex01.html new file mode 100644 index 0000000..f9aea7a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex01.html @@ -0,0 +1,80 @@ +
ganttex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$graph->SetShadow();
+ 
+// Add title and subtitle
+$graph->title->Set('A 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,'Activity 1','2001-12-21','2002-01-18');
+ 
+// Yellow diagonal line pattern on a red background
+$activity->SetPattern(BAND_LDIAG,'yellow');
+$activity->SetFillColor('red');
+ 
+// Finally add the bar to the graph
+$graph->Add($activity);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex03.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex03.html new file mode 100644 index 0000000..dce0835 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex03.html @@ -0,0 +1,84 @@ +
ganttex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph(0,0);
+$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-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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex04.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex04.html new file mode 100644 index 0000000..42a8745 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex04.html @@ -0,0 +1,94 @@ +
ganttex04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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-09','MS5');
+$milestone->caption->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->Add($milestone);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex06.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex06.html new file mode 100644 index 0000000..7354b1e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex06.html @@ -0,0 +1,104 @@ +
ganttex06.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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-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);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex07.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex07.html new file mode 100644 index 0000000..9df4115 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex07.html @@ -0,0 +1,106 @@ +
ganttex07.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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-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);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex08.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex08.html new file mode 100644 index 0000000..6f280f8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex08.html @@ -0,0 +1,126 @@ +
ganttex08.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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-15");
+ 
+// 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-10","2002-01-10");
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex13-zoom1.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex13-zoom1.html new file mode 100644 index 0000000..6c29cd8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex13-zoom1.html @@ -0,0 +1,134 @@ +
ganttex13-zoom1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$graph->SetShadow();
+ 
+// Add title and subtitle
+$graph->title->Set("Zooming a graph");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->subtitle->Set("(zoom=0.7)");
+ 
+// 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.0); // 1=default value
+ 
+// Set zoom factor
+$graph->SetZoomFactor(0.7);
+ 
+// Format the bar for the first activity
+// ($row,$title,$startdate,$enddate)
+$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]");
+ 
+// Yellow diagonal line pattern on a red background
+$activity1->SetPattern(BAND_RDIAG,"yellow");
+$activity1->SetFillColor("red");
+ 
+// Set absolute height of activity
+$activity1->SetHeight(16);
+ 
+// Format the bar for the second activity
+// ($row,$title,$startdate,$enddate)
+$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[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 of activity
+$activity2->SetHeight(16);
+ 
+// Finally add the bar to the graph
+$graph->Add($activity1);
+$graph->Add($activity2);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex13-zoom2.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex13-zoom2.html new file mode 100644 index 0000000..9e78793 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex13-zoom2.html @@ -0,0 +1,134 @@ +
ganttex13-zoom2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$graph->SetShadow();
+ 
+// Add title and subtitle
+$graph->title->Set("Zooming a graph");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->subtitle->Set("(zoom=1.5)");
+ 
+// 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.0); // 1=default value
+ 
+// Set zoom factor
+$graph->SetZoomFactor(1.5);
+ 
+// Format the bar for the first activity
+// ($row,$title,$startdate,$enddate)
+$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]");
+ 
+// Yellow diagonal line pattern on a red background
+$activity1->SetPattern(BAND_RDIAG,"yellow");
+$activity1->SetFillColor("red");
+ 
+// Set absolute height of activity
+$activity1->SetHeight(16);
+ 
+// Format the bar for the second activity
+// ($row,$title,$startdate,$enddate)
+$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[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 of activity
+$activity2->SetHeight(16);
+ 
+// Finally add the bar to the graph
+$graph->Add($activity1);
+$graph->Add($activity2);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex14.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex14.html new file mode 100644 index 0000000..baf6a09 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex14.html @@ -0,0 +1,134 @@ +
ganttex14.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex15.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex15.html new file mode 100644 index 0000000..2ceb8ae --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex15.html @@ -0,0 +1,136 @@ +
ganttex15.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex16.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex16.html new file mode 100644 index 0000000..0ccfa41 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex16.html @@ -0,0 +1,146 @@ +
ganttex16.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex17-flag.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex17-flag.html new file mode 100644 index 0000000..c4f4daa --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex17-flag.html @@ -0,0 +1,176 @@ +
ganttex17-flag.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+require_once ('jpgraph/jpgraph_flags.php');
+ 
+$graph = new GanttGraph();
+$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 coutnry flag
+$icon = new IconPlot();
+$icon->SetAnchor('left','top');
+$icon->SetCountryFlag('norway');
+$icon->SetMix(50);
+$icon->SetPos(5,5);
+$graph->Add($icon);
+ 
+ 
+// Add a vertical line
+$vline = new GanttVLine("2001-12-24","Phase 1");
+$vline->SetDayOffset(0.5);
+//$graph->Add($vline);
+ 
+// ... and display it
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex18.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex18.html new file mode 100644 index 0000000..8584e4b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex18.html @@ -0,0 +1,164 @@ +
ganttex18.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex19.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex19.html new file mode 100644 index 0000000..b7f5882 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex19.html @@ -0,0 +1,168 @@ +
ganttex19.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+$graph->SetBox();
+$graph->SetShadow();
+ 
+// Use default 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttex30.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttex30.html new file mode 100644 index 0000000..014ee75 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttex30.html @@ -0,0 +1,174 @@ +
ganttex30.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example 30
+// $Id: ganttex30.php,v 1.4 2003/05/30 20:12:43 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+// Standard calls to create a new graph
+$graph = new GanttGraph();
+$graph->SetShadow();
+$graph->SetBox();
+ 
+// Titles for chart
+$graph->title->Set("General conversion plan");
+$graph->subtitle->Set("(Revision: 2001-11-18)");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// For illustration we enable all headers.
+$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
+ 
+// For the week we choose to show the start date of the week
+// the default is to show week number (according to ISO 8601)
+$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
+ 
+// Change the scale font
+$graph->scale->week->SetFont(FF_FONT0);
+$graph->scale->year->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+ 
+// Setup some data for the gantt bars
+$data = array(
+        array(0,"Group 1", "2001-10-29","2001-11-27",FF_FONT1,FS_BOLD,8),
+        array(1,"  Label 2", "2001-11-8","2001-12-14"),
+        array(2,"  Label 3", "2001-11-01","2001-11-8"),
+        array(4,"Group 2", "2001-11-07","2001-12-19",FF_FONT1,FS_BOLD,8),
+        array(5,"  Label 4", "2001-11-8","2001-12-19"),
+        array(6,"  Label 5", "2001-11-01","2001-11-8")
+        );
+ 
+for($i=0; $i<count($data); ++$i) {
+        $bar = new GanttBar($data[$i][0],$data[$i][1],$data[$i][2],$data[$i][3],"[50%]",0.5);
+        if( count($data[$i])>4 )
+                $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]);
+ 
+        // If you like each bar can have a shadow
+        // $bar->SetShadow(true,"darkgray");
+ 
+        // For illustration lets make each bar be red with yellow diagonal stripes
+        $bar->SetPattern(BAND_RDIAG,"yellow");
+        $bar->SetFillColor("red");
+ 
+        // To indicate progress each bar can have a smaller bar within
+        // For illustrative purpose just set the progress to 50% for each bar
+        $bar->progress->Set(0.5);
+ 
+        // Each bar may also have optional left and right plot marks
+        // As illustration lets put a filled circle with a number at the end
+        // of each bar
+        $bar->rightMark->SetType(MARK_FILLEDCIRCLE);
+        $bar->rightMark->SetFillColor("red");
+        $bar->rightMark->SetColor("red");
+        $bar->rightMark->SetWidth(10);
+ 
+        // Title for the mark
+        $bar->rightMark->title->Set("".$i+1);
+        $bar->rightMark->title->SetColor("white");
+        $bar->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,10);
+        $bar->rightMark->Show();
+ 
+        // ... and add the bar to the gantt chart
+        $graph->Add($bar);
+}
+ 
+// Create a milestone mark
+$ms = new MileStone(7,"M5","2001-12-10","10/12");
+$ms->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->Add($ms);
+ 
+// Create a vertical line to emphasize the milestone
+$vl = new GanttVLine("2001-12-10 13:00","Phase 1","darkred");
+$vl->SetDayOffset(0.5); // Center the line in the day
+$graph->Add($vl);
+ 
+// Output the graph
+$graph->Stroke();
+ 
+// EOF
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gantthourex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gantthourex1.html new file mode 100644 index 0000000..8eb435e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gantthourex1.html @@ -0,0 +1,98 @@ +
gantthourex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php // content="text/plain; charset=utf-8"
+// Gantt hour example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gantthourminex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gantthourminex1.html new file mode 100644 index 0000000..148563f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gantthourminex1.html @@ -0,0 +1,182 @@ +
gantthourminex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+
<?php // content="text/plain; charset=utf-8"
+// Gantt hour + minute example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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");//d=1006858800,
+$vline = new GanttVLine("2001-11-27 9:00");//d=1006858800,
+$vline->SetWeight(5);
+$vline->SetDayOffset(0);
+$vline->title->Set("27/11 9:00");
+$vline->title->SetFont(FF_FONT1,FS_BOLD,10);
+$graph->Add($vline);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gantticonex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gantticonex1.html new file mode 100644 index 0000000..a770765 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gantticonex1.html @@ -0,0 +1,150 @@ +
gantticonex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+// Basic Gantt graph
+$graph = new GanttGraph();
+$graph->title->Set("Gantt chart with title columns and icons");
+$graph->title->SetFont(FF_ARIAL, FS_BOLD,12);
+$graph->title->SetMargin(10);
+ 
+// 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('darkgreen@0.95');
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex2.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex2.html new file mode 100644 index 0000000..707e4bc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex2.html @@ -0,0 +1,128 @@ +
ganttmonthyearex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+ 
+$graph->title->Set("Only month & year scale");
+ 
+// Setup some "very" 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');
+ 
+// Explicitely set the date range 
+// (Autoscaling will of course also work)
+$graph->SetDateRange('2001-10-06','2002-4-10');
+ 
+// 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);
+ 
+ 
+// Setup activity info
+ 
+// For the titles we also add a minimum width of 100 pixels for the Task name column
+$graph->scale->actinfo->SetColTitles(
+    array('Name','Duration','Start','Finish'),array(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');
+ 
+// Data for our example activities
+$data = array(
+    array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02")
+          , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8),
+    array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"),
+          "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8),
+    array(2,array("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");
+    $graph->Add($bar);
+}
+ 
+// Output the chart
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex3.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex3.html new file mode 100644 index 0000000..a16d412 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex3.html @@ -0,0 +1,128 @@ +
ganttmonthyearex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+ 
+$graph->title->Set("Only month & year scale");
+ 
+// Setup some "very" 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');
+ 
+// Explicitely set the date range 
+// (Autoscaling will of course also work)
+$graph->SetDateRange('2001-10-06','2002-4-10');
+ 
+// 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);
+ 
+ 
+// Setup activity info
+ 
+// For the titles we also add a minimum width of 100 pixels for the Task name column
+$graph->scale->actinfo->SetColTitles(
+    array('Type','Name','Duration','Start','Finish'),array(40,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');
+ 
+// Data for our example activities
+$data = array(
+    array(0,array("","Pre-study","102 days","23 Nov '01","1 Mar '02")
+          , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8),
+    array(1,array("","Prototype","21 days","26 Oct '01","16 Nov '01"),
+          "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8),
+    array(2,array("","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");
+    $graph->Add($bar);
+}
+ 
+// Output the chart
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex4.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex4.html new file mode 100644 index 0000000..e371ba3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttmonthyearex4.html @@ -0,0 +1,138 @@ +
ganttmonthyearex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_gantt.php');
+ 
+$graph = new GanttGraph();
+ 
+$graph->title->Set("Adding a spaning title");
+ 
+// Setup some "very" 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');
+ 
+// Explicitely set the date range
+// (Autoscaling will of course also work)
+$graph->SetDateRange('2001-11-06','2002-1-10');
+ 
+// Display month and year scale with the gridlines
+$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR | GANTT_HWEEK );
+$graph->scale->month->grid->SetColor('gray');
+$graph->scale->month->grid->Show(true);
+$graph->scale->year->grid->SetColor('gray');
+$graph->scale->year->grid->Show(true);
+ 
+ 
+//Setup spanning title
+$graph->scale->tableTitle->Set( 'Phase 1' );
+$graph->scale->tableTitle->SetFont( FF_ARIAL , FS_NORMAL , 16 );
+$graph->scale->SetTableTitleBackground( 'darkgreen@0.6' );
+$graph->scale->tableTitle->Show( true );
+ 
+// Setup activity info
+ 
+// For the titles we also add a minimum width of 100 pixels for the Task name column
+$graph->scale->actinfo->SetColTitles(array('Name','Duration','Start','Finish'),array(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');
+ 
+// Data for our example activities
+$data = array(
+    array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02")
+          , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8),
+    array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"),
+          "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8),
+    array(2,array("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");
+    $graph->Add($bar);
+}
+ 
+// Output the chart
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ganttsimpleex1.html b/includes/jpgraph/docs/chunkhtml/example_src/ganttsimpleex1.html new file mode 100644 index 0000000..ec7bdff --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ganttsimpleex1.html @@ -0,0 +1,58 @@ +
ganttsimpleex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php // content="text/plain; charset=utf-8"
+// Gantt example
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/grace_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex0.html new file mode 100644 index 0000000..a370b57 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex0.html @@ -0,0 +1,116 @@ +
grace_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Some data
+$datay=array(7,19,11,4,20);
+ 
+// Create the graph and setup the basic parameters 
+$graph = new Graph(300,200,'auto');    
+$graph->img->SetMargin(40,30,40,50);
+$graph->SetScale("textint");
+$graph->SetFrame(true,'blue',1); 
+$graph->SetColor('lightblue');
+$graph->SetMarginColor('lightblue');
+ 
+// Setup X-axis labels
+$a = $gDateLocale->GetShortMonth();
+$graph->xaxis->SetTickLabels($a);
+$graph->xaxis->SetFont(FF_FONT1);
+$graph->xaxis->SetColor('darkblue','black');
+ 
+// Setup "hidden" y-axis by given it the same color
+// as the background (this could also be done by setting the weight
+// to zero)
+$graph->yaxis->SetColor('lightblue','darkblue');
+$graph->ygrid->SetColor('white');
+ 
+// Setup graph title ands fonts
+$graph->title->Set('Using grace = 0');
+$graph->title->SetFont(FF_FONT2,FS_BOLD);
+$graph->xaxis->SetTitle('Year 2002','center');
+$graph->xaxis->SetTitleMargin(10);
+$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
+ 
+// Add some grace to the top so that the scale doesn't
+// end exactly at the max value. 
+$graph->yaxis->scale->SetGrace(0);
+ 
+                              
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor('darkblue');
+$bplot->SetColor('darkblue');
+$bplot->SetWidth(0.5);
+$bplot->SetShadow('darkgray');
+ 
+// Setup the values that are displayed on top of each bar
+// Must use TTF fonts if we want text at an arbitrary angle
+$bplot->value->Show();
+$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8);
+$bplot->value->SetFormat('$%d');
+$bplot->value->SetColor('darkred');
+$bplot->value->SetAngle(45);
+$graph->Add($bplot);
+ 
+// Finally stroke the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/grace_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex1.html new file mode 100644 index 0000000..69a0067 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex1.html @@ -0,0 +1,116 @@ +
grace_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Some data
+$datay=array(7,19,11,4,20);
+ 
+// Create the graph and setup the basic parameters 
+$graph = new Graph(300,200,'auto');    
+$graph->img->SetMargin(40,30,40,50);
+$graph->SetScale("textint");
+$graph->SetFrame(true,'blue',1); 
+$graph->SetColor('lightblue');
+$graph->SetMarginColor('lightblue');
+ 
+// Setup X-axis labels
+$a = $gDateLocale->GetShortMonth();
+$graph->xaxis->SetTickLabels($a);
+$graph->xaxis->SetFont(FF_FONT1);
+$graph->xaxis->SetColor('darkblue','black');
+ 
+// Setup "hidden" y-axis by given it the same color
+// as the background (this could also be done by setting the weight
+// to zero)
+$graph->yaxis->SetColor('lightblue','darkblue');
+$graph->ygrid->SetColor('white');
+ 
+// Setup graph title ands fonts
+$graph->title->Set('Using grace = 10%');
+$graph->title->SetFont(FF_FONT2,FS_BOLD);
+$graph->xaxis->SetTitle('Year 2002','center');
+$graph->xaxis->SetTitleMargin(10);
+$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
+ 
+// Add some grace to the top so that the scale doesn't
+// end exactly at the max value. 
+$graph->yaxis->scale->SetGrace(10);
+ 
+                              
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor('darkblue');
+$bplot->SetColor('darkblue');
+$bplot->SetWidth(0.5);
+$bplot->SetShadow('darkgray');
+ 
+// Setup the values that are displayed on top of each bar
+// Must use TTF fonts if we want text at an arbitrary angle
+$bplot->value->Show();
+$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8);
+$bplot->value->SetFormat('$%d');
+$bplot->value->SetColor('darkred');
+$bplot->value->SetAngle(45);
+$graph->Add($bplot);
+ 
+// Finally stroke the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/grace_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex2.html new file mode 100644 index 0000000..e606c5c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex2.html @@ -0,0 +1,116 @@ +
grace_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Some data
+$datay=array(7,19,11,4,20);
+ 
+// Create the graph and setup the basic parameters 
+$graph = new Graph(300,200,'auto');    
+$graph->img->SetMargin(40,30,40,50);
+$graph->SetScale("textint");
+$graph->SetFrame(true,'blue',1); 
+$graph->SetColor('lightblue');
+$graph->SetMarginColor('lightblue');
+ 
+// Setup X-axis labels
+$a = $gDateLocale->GetShortMonth();
+$graph->xaxis->SetTickLabels($a);
+$graph->xaxis->SetFont(FF_FONT1);
+$graph->xaxis->SetColor('darkblue','black');
+ 
+// Setup "hidden" y-axis by given it the same color
+// as the background (this could also be done by setting the weight
+// to zero)
+$graph->yaxis->SetColor('lightblue','darkblue');
+$graph->ygrid->SetColor('white');
+ 
+// Setup graph title ands fonts
+$graph->title->Set('Using grace = 50%');
+$graph->title->SetFont(FF_FONT2,FS_BOLD);
+$graph->xaxis->SetTitle('Year 2002','center');
+$graph->xaxis->SetTitleMargin(10);
+$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
+ 
+// Add some grace to the top so that the scale doesn't
+// end exactly at the max value. 
+$graph->yaxis->scale->SetGrace(50);
+ 
+                              
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor('darkblue');
+$bplot->SetColor('darkblue');
+$bplot->SetWidth(0.5);
+$bplot->SetShadow('darkgray');
+ 
+// Setup the values that are displayed on top of each bar
+// Must use TTF fonts if we want text at an arbitrary angle
+$bplot->value->Show();
+$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8);
+$bplot->value->SetFormat('$%d');
+$bplot->value->SetColor('darkred');
+$bplot->value->SetAngle(45);
+$graph->Add($bplot);
+ 
+// Finally stroke the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/grace_ex3.html b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex3.html new file mode 100644 index 0000000..0e90877 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/grace_ex3.html @@ -0,0 +1,116 @@ +
grace_ex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Some data
+$datay=array(7,19,11,4,20);
+ 
+// Create the graph and setup the basic parameters 
+$graph = new Graph(300,200,'auto');    
+$graph->img->SetMargin(40,30,40,50);
+$graph->SetScale("textint");
+$graph->SetFrame(true,'blue',1); 
+$graph->SetColor('lightblue');
+$graph->SetMarginColor('lightblue');
+ 
+// Setup X-axis labels
+$a = $gDateLocale->GetShortMonth();
+$graph->xaxis->SetTickLabels($a);
+$graph->xaxis->SetFont(FF_FONT1);
+$graph->xaxis->SetColor('darkblue','black');
+ 
+// Setup "hidden" y-axis by given it the same color
+// as the background (this could also be done by setting the weight
+// to zero)
+$graph->yaxis->SetColor('lightblue','darkblue');
+$graph->ygrid->SetColor('white');
+ 
+// Setup graph title ands fonts
+$graph->title->Set('Using grace = 100%');
+$graph->title->SetFont(FF_FONT2,FS_BOLD);
+$graph->xaxis->SetTitle('Year 2002','center');
+$graph->xaxis->SetTitleMargin(10);
+$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
+ 
+// Add some grace to the top so that the scale doesn't
+// end exactly at the max value. 
+$graph->yaxis->scale->SetGrace(100);
+ 
+                              
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor('darkblue');
+$bplot->SetColor('darkblue');
+$bplot->SetWidth(0.5);
+$bplot->SetShadow('darkgray');
+ 
+// Setup the values that are displayed on top of each bar
+// Must use TTF fonts if we want text at an arbitrary angle
+$bplot->value->Show();
+$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8);
+$bplot->value->SetFormat('$%d');
+$bplot->value->SetColor('darkred');
+$bplot->value->SetAngle(45);
+$graph->Add($bplot);
+ 
+// Finally stroke the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gradbkgex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gradbkgex1.html new file mode 100644 index 0000000..3fbfad5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gradbkgex1.html @@ -0,0 +1,128 @@ +
gradbkgex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex1.html new file mode 100644 index 0000000..7ff3aae --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex1.html @@ -0,0 +1,54 @@ +
gradlinefillex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$datay = array(20,15,33,5,17,35,22);
+ 
+// Setup the graph
+$graph = new Graph(400,200);
+$graph->SetMargin(40,40,20,30);    
+$graph->SetScale("intlin");
+$graph->SetMarginColor('darkgreen@0.8');
+ 
+$graph->title->Set('Gradient filled line plot');
+$graph->yscale->SetAutoMin(0);
+ 
+// Create the line
+$p1 = new LinePlot($datay);
+$p1->SetColor("blue");
+$p1->SetWeight(0);
+$p1->SetFillGradient('red','yellow');
+ 
+$graph->Add($p1);
+ 
+// Output line
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex2.html b/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex2.html new file mode 100644 index 0000000..71eac08 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex2.html @@ -0,0 +1,56 @@ +
gradlinefillex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$datay = array(20,10,35,5,17,35,22);
+ 
+// Setup the graph
+$graph = new Graph(400,200);
+$graph->SetMargin(40,40,20,30);    
+$graph->SetScale("intlin");
+$graph->SetBox();
+$graph->SetMarginColor('darkgreen@0.8');
+ 
+// Setup a background gradient image
+$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT);
+ 
+$graph->title->Set('Gradient filled line plot ex2');
+$graph->yscale->SetAutoMin(0);
+ 
+// Create the line
+$p1 = new LinePlot($datay);
+$p1->SetFillGradient('white','darkgreen');
+$graph->Add($p1);
+ 
+// Output line
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex3.html b/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex3.html new file mode 100644 index 0000000..cb65d27 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gradlinefillex3.html @@ -0,0 +1,56 @@ +
gradlinefillex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$datay = array(20,10,35,5,17,35,22);
+ 
+// Setup the graph
+$graph = new Graph(400,200);
+$graph->SetMargin(40,40,20,30);    
+$graph->SetScale("intlin");
+$graph->SetBox();
+$graph->SetMarginColor('darkgreen@0.8');
+ 
+// Setup a background gradient image
+$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT);
+ 
+$graph->title->Set('Gradient filled line plot ex3');
+$graph->yscale->SetAutoMin(0);
+ 
+// Create the line
+$p1 = new LinePlot($datay);
+$p1->SetFillGradient('white','darkgreen',4);
+$graph->Add($p1);
+ 
+// Output line
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/green_example.html b/includes/jpgraph/docs/chunkhtml/example_src/green_example.html new file mode 100644 index 0000000..afac001 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/green_example.html @@ -0,0 +1,116 @@ +
green_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new GreenTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "GreenTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/gridstylesex1.html b/includes/jpgraph/docs/chunkhtml/example_src/gridstylesex1.html new file mode 100644 index 0000000..b6da354 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/gridstylesex1.html @@ -0,0 +1 @@ +001: Cannot read souce file: /root/jpgraph/trunk/src/Examples/gridstylesex1.php diff --git a/includes/jpgraph/docs/chunkhtml/example_src/groupbarex1.html b/includes/jpgraph/docs/chunkhtml/example_src/groupbarex1.html new file mode 100644 index 0000000..db5d08b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/groupbarex1.html @@ -0,0 +1,86 @@ +
groupbarex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+// $Id: groupbarex1.php,v 1.2 2002/07/11 23:27:28 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay1=array(35,160,0,0,0,0);
+$datay2=array(35,190,190,190,190,190);
+$datay3=array(20,70,70,140,230,260);
+ 
+$graph = new Graph(450,200,'auto');    
+$graph->SetScale("textlin");
+$graph->SetShadow();
+$graph->img->SetMargin(40,30,40,40);
+$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
+ 
+$graph->xaxis->title->Set('Year 2002');
+$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->title->Set('Group bar plot');
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+$bplot1 = new BarPlot($datay1);
+$bplot2 = new BarPlot($datay2);
+$bplot3 = new BarPlot($datay3);
+ 
+$bplot1->SetFillColor("orange");
+$bplot2->SetFillColor("brown");
+$bplot3->SetFillColor("darkgreen");
+ 
+$bplot1->SetShadow();
+$bplot2->SetShadow();
+$bplot3->SetShadow();
+ 
+$bplot1->SetShadow();
+$bplot2->SetShadow();
+$bplot3->SetShadow();
+ 
+$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3));
+$gbarplot->SetWidth(0.6);
+$graph->Add($gbarplot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/horizbarex1.html b/includes/jpgraph/docs/chunkhtml/example_src/horizbarex1.html new file mode 100644 index 0000000..5149f8a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/horizbarex1.html @@ -0,0 +1,126 @@ +
horizbarex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/horizbarex4.html b/includes/jpgraph/docs/chunkhtml/example_src/horizbarex4.html new file mode 100644 index 0000000..07abb86 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/horizbarex4.html @@ -0,0 +1,96 @@ +
horizbarex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php // content="text/plain; charset=utf-8"
+// $Id: horizbarex4.php,v 1.4 2002/11/17 23:59:27 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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('Number of incidents');
+ 
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor('orange');
+$bplot->SetWidth(0.5);
+$bplot->SetYMin(1990);
+ 
+$graph->Add($bplot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/horizbarex6.html b/includes/jpgraph/docs/chunkhtml/example_src/horizbarex6.html new file mode 100644 index 0000000..beb50ce --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/horizbarex6.html @@ -0,0 +1,166 @@ +
horizbarex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(2,3,5,8,12,6,3);
+$datax=array("320x240","640x480","600x800","1024x768","1280x1024(16)","1280x1024(32)",
+         "1600x1200(32)");
+ 
+// Size of graph
+$width=300; 
+$height=400;
+ 
+// Set the basic parameters of the graph 
+$graph = new Graph($width,$height,'auto');
+$graph->SetScale("textlin");
+ 
+// No frame around the image
+$graph->SetFrame(false);
+ 
+// Rotate graph 90 degrees and set margin
+$graph->Set90AndMargin(100,20,50,30);
+ 
+// Set white margin color
+$graph->SetMarginColor('white');
+ 
+// Use a box around the plot area
+$graph->SetBox();
+ 
+// Use a gradient to fill the plot area
+$graph->SetBackgroundGradient('white','lightblue',GRAD_HOR,BGRAD_PLOT);
+ 
+// Setup title
+$graph->title->Set("Graphic card performance");
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,11);
+$graph->subtitle->Set("(Non optimized)");
+ 
+// Setup X-axis
+$graph->xaxis->SetTickLabels($datax);
+$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,8);
+ 
+// 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->SetShadow();
+ 
+//You can change the width of the bars if you like
+//$bplot->SetWidth(0.5);
+ 
+// Set gradient fill for bars
+$bplot->SetFillGradient('darkred','yellow',GRAD_HOR);
+ 
+// We want to display the value of each bar at the top
+$bplot->value->Show();
+$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
+//$bplot->value->SetAlign('left','center');
+$bplot->value->SetColor("white");
+$bplot->value->SetFormat('%.1f');
+$bplot->SetValuePos('max');
+ 
+// Add the bar to the graph
+$graph->Add($bplot);
+ 
+// Add some explanation text
+$txt = new Text('Note: Higher value is better.');
+$txt->SetPos(190,399,'center','bottom');
+$txt->SetFont(FF_ARIAL,FS_NORMAL,8);
+$graph->Add($txt);
+ 
+// .. and stroke the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/imgmarkerex1.html b/includes/jpgraph/docs/chunkhtml/example_src/imgmarkerex1.html new file mode 100644 index 0000000..de5fd52 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/imgmarkerex1.html @@ -0,0 +1,100 @@ +
imgmarkerex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/impulsex1.html b/includes/jpgraph/docs/chunkhtml/example_src/impulsex1.html new file mode 100644 index 0000000..3a4b49b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/impulsex1.html @@ -0,0 +1,46 @@ +
impulsex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);
+ 
+$graph = new Graph(300,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/impulsex3.html b/includes/jpgraph/docs/chunkhtml/example_src/impulsex3.html new file mode 100644 index 0000000..ba0fe66 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/impulsex3.html @@ -0,0 +1,106 @@ +
impulsex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/impulsex4.html b/includes/jpgraph/docs/chunkhtml/example_src/impulsex4.html new file mode 100644 index 0000000..9de5a0b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/impulsex4.html @@ -0,0 +1,152 @@ +
impulsex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_plotline.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);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/interpolation-growth-log.html b/includes/jpgraph/docs/chunkhtml/example_src/interpolation-growth-log.html new file mode 100644 index 0000000..b0c0806 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/interpolation-growth-log.html @@ -0,0 +1,80 @@ +
interpolation-growth-log.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_log.php');
+ 
+// Matrix size rxr
+$r = 10;
+ 
+// Max Interpolation factor
+$f = 5;
+ 
+for( $i=1; $i <= $f; ++$i ) {
+    $xdata[] = $i;
+    $ydata[] =  pow( $r*pow(2,($i-1)) - ( pow(2,$i) - 1 ),2);
+}
+ 
+$graph = new Graph(400,240);
+$graph->SetScale('intlog');
+$graph->SetMargin(50,50,20,30);
+$graph->SetFrame(false);
+$graph->SetBox(true,'black',2);
+$graph->SetMarginColor('white');
+$graph->SetColor('lightyellow@0.7');
+ 
+$graph->title->Set('Interpolation growth for size 10x10');
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->xaxis->SetTitle('Interpolation factor','center');
+$graph->xaxis->SetTitleMargin(10);
+ 
+$graph->SetAxisStyle(AXSTYLE_YBOXIN);
+$graph->xgrid->Show();
+ 
+$lp1 = new LinePlot($ydata,$xdata);
+$lp1->SetColor('darkred');
+$lp1->SetWeight(3);
+$graph->Add($lp1);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/interpolation-growth.html b/includes/jpgraph/docs/chunkhtml/example_src/interpolation-growth.html new file mode 100644 index 0000000..f73c787 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/interpolation-growth.html @@ -0,0 +1,80 @@ +
interpolation-growth.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_log.php');
+ 
+// Matrix size rxr
+$r = 10;
+ 
+// Max Interpolation factor
+$f = 5;
+ 
+for( $i=1; $i <= $f; ++$i ) {
+    $xdata[] = $i;
+    $ydata[] =  pow( $r*pow(2,($i-1)) - ( pow(2,$i) - 1 ),2);
+}
+ 
+$graph = new Graph(400,240);
+$graph->SetScale('intint');
+$graph->SetMargin(50,50,20,30);
+$graph->SetFrame(false);
+$graph->SetBox(true,'black',2);
+$graph->SetMarginColor('white');
+$graph->SetColor('lightyellow@0.7');
+ 
+$graph->title->Set('Interpolation growth for size 10x10');
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->xaxis->SetTitle('Interpolation factor','center');
+$graph->xaxis->SetTitleMargin(10);
+ 
+$graph->SetAxisStyle(AXSTYLE_YBOXIN);
+$graph->xgrid->Show();
+ 
+$lp1 = new LinePlot($ydata,$xdata);
+$lp1->SetColor('darkred');
+$lp1->SetWeight(3);
+$graph->Add($lp1);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/inyaxisex2.html b/includes/jpgraph/docs/chunkhtml/example_src/inyaxisex2.html new file mode 100644 index 0000000..ebadcce --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/inyaxisex2.html @@ -0,0 +1,102 @@ +
inyaxisex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex1.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex1.html new file mode 100644 index 0000000..cd377ab --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex1.html @@ -0,0 +1,24 @@ +
ledex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GREEN); 
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex10.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex10.html new file mode 100644 index 0000000..cffc6de --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex10.html @@ -0,0 +1,24 @@ +
ledex10.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_KHAKI);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex11.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex11.html new file mode 100644 index 0000000..4a979db --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex11.html @@ -0,0 +1,24 @@ +
ledex11.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_OLIVE);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex12.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex12.html new file mode 100644 index 0000000..f9e3f5f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex12.html @@ -0,0 +1,24 @@ +
ledex12.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_LIMEGREEN);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex13.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex13.html new file mode 100644 index 0000000..de353b3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex13.html @@ -0,0 +1,24 @@ +
ledex13.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_FORESTGREEN);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex14.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex14.html new file mode 100644 index 0000000..b77587a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex14.html @@ -0,0 +1,24 @@ +
ledex14.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_TEAL);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex15.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex15.html new file mode 100644 index 0000000..dfa327d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex15.html @@ -0,0 +1,24 @@ +
ledex15.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_STEELBLUE);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex16.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex16.html new file mode 100644 index 0000000..42094f7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex16.html @@ -0,0 +1,24 @@ +
ledex16.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_NAVY);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex17.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex17.html new file mode 100644 index 0000000..9d3bd94 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex17.html @@ -0,0 +1,24 @@ +
ledex17.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_INVERTGRAY);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex2.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex2.html new file mode 100644 index 0000000..8a2f33a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex2.html @@ -0,0 +1,24 @@ +
ledex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_RED); 
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex3.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex3.html new file mode 100644 index 0000000..b65940d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex3.html @@ -0,0 +1,24 @@ +
ledex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_YELLOW); 
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex4.1.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex4.1.html new file mode 100644 index 0000000..29ceb3b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex4.1.html @@ -0,0 +1,26 @@ +
ledex4.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
+$led = new DigitalLED74(6);
+$led->SetSupersampling(2);
+$led->StrokeNumber('123.',LEDC_RED);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex4.2.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex4.2.html new file mode 100644 index 0000000..a4a64cb --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex4.2.html @@ -0,0 +1,26 @@ +
ledex4.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
+$led = new DigitalLED74(6);
+$led->SetSupersampling(4);
+$led->StrokeNumber('123.',LEDC_RED);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex4.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex4.html new file mode 100644 index 0000000..242335b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex4.html @@ -0,0 +1,26 @@ +
ledex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
+$led = new DigitalLED74(6);
+$led->SetSupersampling(1);
+$led->StrokeNumber('123.',LEDC_RED);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex5.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex5.html new file mode 100644 index 0000000..0d94404 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex5.html @@ -0,0 +1,24 @@ +
ledex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_BLUE);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex6.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex6.html new file mode 100644 index 0000000..2e88c41 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex6.html @@ -0,0 +1,24 @@ +
ledex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GRAY);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex7.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex7.html new file mode 100644 index 0000000..5a9ccee --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex7.html @@ -0,0 +1,24 @@ +
ledex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_CHOCOLATE);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex8.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex8.html new file mode 100644 index 0000000..f17abd8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex8.html @@ -0,0 +1,24 @@ +
ledex8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_PERU);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ledex9.html b/includes/jpgraph/docs/chunkhtml/example_src/ledex9.html new file mode 100644 index 0000000..4d0980f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ledex9.html @@ -0,0 +1,24 @@ +
ledex9.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_led.php');
+ 
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74();
+$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GOLDENROD);
+ 
+ 
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/linebarcentex1.html b/includes/jpgraph/docs/chunkhtml/example_src/linebarcentex1.html new file mode 100644 index 0000000..27ca778 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/linebarcentex1.html @@ -0,0 +1,98 @@ +
linebarcentex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/lineiconex1.html b/includes/jpgraph/docs/chunkhtml/example_src/lineiconex1.html new file mode 100644 index 0000000..bb7a8ef --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/lineiconex1.html @@ -0,0 +1,94 @@ +
lineiconex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/lineiconex2.html b/includes/jpgraph/docs/chunkhtml/example_src/lineiconex2.html new file mode 100644 index 0000000..72b9026 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/lineiconex2.html @@ -0,0 +1,60 @@ +
lineiconex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_flags.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/lineimagefillex1.html b/includes/jpgraph/docs/chunkhtml/example_src/lineimagefillex1.html new file mode 100644 index 0000000..1cb85b2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/lineimagefillex1.html @@ -0,0 +1,78 @@ +
lineimagefillex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
<?php
+require_once ('../jpgraph.php');
+require_once ('../jpgraph_line.php');
+ 
+$datay = array(0,3,5,12,15,18,22,36,37,41);
+ 
+// Setup the graph
+$graph = new Graph(320,200);
+$graph->title->Set('Education growth');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->SetScale('intlin');
+$graph->SetMarginColor('white');
+$graph->SetBox();
+//$graph->img->SetAntialiasing();
+ 
+$graph->SetGridDepth(DEPTH_FRONT);
+$graph->ygrid->SetColor('gray@0.7');
+$graph->SetBackgroundImage('classroom.jpg',BGIMG_FILLPLOT);
+ 
+// Masking graph
+$p1 = new LinePlot($datay);
+$p1->SetFillColor('white');
+$p1->SetFillFromYMax();
+$p1->SetWeight(0);
+$graph->Add($p1);
+ 
+// Line plot
+$p2 = new LinePlot($datay);
+$p2->SetColor('black@0.4');
+$p2->SetWeight(3);
+$p2->mark->SetType(MARK_SQUARE);
+$p2->mark->SetColor('orange@0.5');
+$p2->mark->SetFillColor('orange@0.3');
+$graph->Add($p2);
+ 
+// Output line
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/listfontsex1.html b/includes/jpgraph/docs/chunkhtml/example_src/listfontsex1.html new file mode 100644 index 0000000..eccd6d5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/listfontsex1.html @@ -0,0 +1,306 @@ +
listfontsex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_canvtools.php');
+ 
+$width = 700;
+$height = 800;
+$g = new CanvasGraph($width,$height);
+$scale = new CanvasScale($g);
+$scale->Set(0,27,0,85);
+$g->SetMargin(5,6,5,6);
+$g->SetColor('white');
+$g->SetMarginColor("teal");
+$g->InitFrame();
+ 
+ 
+$t = new CanvasRectangleText();
+$t->SetFont(FF_ARIAL,FS_NORMAL,16);
+$t->SetFillColor('lemonchiffon2');
+$t->SetFontColor('black');
+$t->Set("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTTF Fonts (11pt)",0.5,19.5,26,64.5);
+$t->Stroke($g->img,$scale);
+ 
+$t->SetFillColor('lemonchiffon3');
+$t->Set("\n\n\n\nBitmap Fonts",0.5,5,26,13.5);
+$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('Normal',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",FF_TIMES,FS_BOLD),
+ 
+    array("Vera normal",FF_VERA,FS_NORMAL),
+    array("Vera italic",FF_VERA,FS_ITALIC),
+    array("Vera bold",FF_VERA,FS_BOLD),    
+    
+    array("Vera mono normal",FF_VERAMONO,FS_NORMAL),
+    array("Vera mono italic",FF_VERAMONO,FS_ITALIC),
+    array("Vera mono bold",FF_VERAMONO,FS_BOLD),    
+ 
+    array("Vera serif normal",FF_VERASERIF,FS_NORMAL),
+    array("",FF_VERASERIF,FS_ITALIC),
+    array("Vera serif bold",FF_VERASERIF,FS_BOLD),    
+            
+    array("DejaVu sans serif",FF_DV_SANSSERIF,FS_NORMAL),
+    array("DejaVu sans serif",FF_DV_SANSSERIF,FS_ITALIC),
+    array("DejaVu sans serif",FF_DV_SANSSERIF,FS_BOLD),
+ 
+    array("DejaVu serif",FF_DV_SERIF,FS_NORMAL),
+    array("DejaVu serif",FF_DV_SERIF,FS_ITALIC),
+    array("DejaVu serif",FF_DV_SERIF,FS_BOLD),
+ 
+    array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_NORMAL),
+    array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_ITALIC),
+    array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_BOLD),
+ 
+    array("DejaVuCond serif",FF_DV_SERIFCOND,FS_NORMAL),
+    array("DejaVuCond serif",FF_DV_SERIFCOND,FS_ITALIC),
+    array("DejaVuCond serif",FF_DV_SERIFCOND,FS_BOLD),
+ 
+    array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_NORMAL),
+    array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_ITALIC),
+    array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_BOLD),
+    
+    );
+ 
+ 
+$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],11);
+    $t->Stroke($g->img,$scale);
+    }
+ 
+    $c += $w+1;
+    if( $c > 30-$w-2 ) {
+    $c = 1;
+    $r += 4;
+    }
+ 
+}
+ 
+$g->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/loglogex1.html b/includes/jpgraph/docs/chunkhtml/example_src/loglogex1.html new file mode 100644 index 0000000..6d17502 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/loglogex1.html @@ -0,0 +1,118 @@ +
loglogex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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);     
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manscaleex1.html b/includes/jpgraph/docs/chunkhtml/example_src/manscaleex1.html new file mode 100644 index 0000000..0db9aae --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manscaleex1.html @@ -0,0 +1,40 @@ +
manscaleex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,17,22,19,5,15);
+ 
+$graph = new Graph(220,170);
+$graph->SetScale("textlin",3,35);
+$graph->yscale->ticks->Set(8,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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manscaleex2.html b/includes/jpgraph/docs/chunkhtml/example_src/manscaleex2.html new file mode 100644 index 0000000..783e47d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manscaleex2.html @@ -0,0 +1,38 @@ +
manscaleex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,17,22,19,5,15);
+ 
+$graph = new Graph(220,170);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manscaleex3.html b/includes/jpgraph/docs/chunkhtml/example_src/manscaleex3.html new file mode 100644 index 0000000..4a9bd38 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manscaleex3.html @@ -0,0 +1,42 @@ +
manscaleex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$ydata = array(12,17,22,19,5,15);
+ 
+$graph = new Graph(250,170);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex1.html new file mode 100644 index 0000000..a15c926 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex1.html @@ -0,0 +1,76 @@ +
manual_textscale_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex2.html new file mode 100644 index 0000000..5e7d65c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex2.html @@ -0,0 +1,76 @@ +
manual_textscale_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Some data
+for($i=0; $i < 12; ++$i) {
+    $databary[$i] = rand(1,20);
+}
+$months=$gDateLocale->GetShortMonth();
+ 
+// New graph with a drop shadow
+$graph = new Graph(300,200);
+$graph->SetShadow();
+ 
+// Use a "text" X-scale
+$graph->SetScale('textlin');
+ 
+// Specify X-labels
+$graph->xaxis->SetTickLabels($months);
+$graph->xaxis->SetTextTickInterval(2,0);
+ 
+// Set title and subtitle
+$graph->title->Set('Textscale with tickinterval=2');
+ 
+// Use built in font
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+// Create the bar plot
+$b1 = new BarPlot($databary);
+$b1->SetLegend('Temperature');
+ 
+// The order the plots are added determines who's ontop
+$graph->Add($b1);
+ 
+// Finally output the  image
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex3.html b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex3.html new file mode 100644 index 0000000..58e6cad --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex3.html @@ -0,0 +1,76 @@ +
manual_textscale_ex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+// Some data
+for($i=0; $i < 12; ++$i) {
+    $databary[$i] = rand(1,20);
+}
+$months=$gDateLocale->GetShortMonth();
+ 
+// New graph with a drop shadow
+$graph = new Graph(300,200);
+$graph->SetShadow();
+ 
+// Use a "text" X-scale
+$graph->SetScale('textlin');
+ 
+// Specify X-labels
+$graph->xaxis->SetTickLabels($months);
+$graph->xaxis->SetTextLabelInterval(2);
+ 
+// Set title and subtitle
+$graph->title->Set('Textscale with tickinterval=2');
+ 
+// Use built in font
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+// Create the bar plot
+$b1 = new BarPlot($databary);
+$b1->SetLegend('Temperature');
+ 
+// The order the plots are added determines who's ontop
+$graph->Add($b1);
+ 
+// Finally output the  image
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex4.html b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex4.html new file mode 100644 index 0000000..8f1e7be --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manual_textscale_ex4.html @@ -0,0 +1,98 @@ +
manual_textscale_ex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+define('DATAPERMONTH',40);
+ 
+// Some data
+$m=$gDateLocale->GetShortMonth();
+$k=0;
+for($i=0; $i < 480; ++$i) {
+    $datay[$i] = rand(1,40);
+    if( $i % DATAPERMONTH === 0 )
+        $months[$i] = $m[(int)($i/DATAPERMONTH)];
+    else
+        $months[$i] = 'xx';
+}
+ 
+ 
+// New graph with a drop shadow
+$graph = new Graph(400,200);
+//$graph->SetShadow();
+ 
+// Use a "text" X-scale
+$graph->SetScale('textlin');
+ 
+// Specify X-labels
+$graph->xaxis->SetTickLabels($months);
+$graph->xaxis->SetTextTickInterval(DATAPERMONTH,0);
+$graph->xaxis->SetTextLabelInterval(2);
+ 
+// Set title and subtitle
+$graph->title->Set('Textscale with tickinterval=2');
+ 
+// Use built in font
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->SetBox(true,'red');
+ 
+// Create the bar plot
+$lp1 = new LinePlot($datay);
+$lp1->SetLegend('Temperature');
+ 
+// The order the plots are added determines who's ontop
+$graph->Add($lp1);
+ 
+// Finally output the  image
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manualtickex1.html b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex1.html new file mode 100644 index 0000000..706859a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex1.html @@ -0,0 +1,142 @@ +
manualtickex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
<?php // content="text/plain; charset=utf-8"
+//
+// Basic example on how to use custom tickmark feature to have a label
+// at the start of each month.
+//
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// 
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//
+$datay = array();
+$datax = array();
+$ts = time();
+$n=15; // Number of data points
+for($i=0; $i < $n; ++$i ) {
+    $datax[$i] = $ts+$i*700000; 
+    $datay[$i] = rand(5,60);
+}
+ 
+// Now get labels at the start of each month
+$dateUtils = new DateScaleUtils();
+list($tickPositions,$minTickPositions) = $dateUtils->GetTicks($datax);
+ 
+// We add some grace to the end of the X-axis scale so that the first and last
+// data point isn't exactly at the very end or beginning of the scale
+$grace = 400000;
+$xmin = $datax[0]-$grace;
+$xmax = $datax[$n-1]+$grace;
+ 
+//
+// The code to setup a very basic graph
+//
+$graph = new Graph(400,200);
+ 
+//
+// We use an integer scale on the X-axis since the positions on the X axis
+// are assumed to be UNI timestamps
+$graph->SetScale('intlin',0,0,$xmin,$xmax);
+$graph->title->Set('Basic example with manual ticks');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12);
+ 
+//
+// Make sure that the X-axis is always at the bottom of the scale
+// (By default the X-axis is alwys positioned at Y=0 so if the scale
+// doesn't happen to include 0 the axis will not be shown)
+$graph->xaxis->SetPos('min');
+ 
+// Now set the tic positions
+$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+ 
+// The labels should be formatted at dates with "Year-month"
+$graph->xaxis->SetLabelFormatString('My',true);
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+ 
+// Add a X-grid
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($datay,$datax);
+$p1->SetColor('teal');
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manualtickex1a.html b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex1a.html new file mode 100644 index 0000000..3489ce4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex1a.html @@ -0,0 +1,142 @@ +
manualtickex1a.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
<?php // content="text/plain; charset=utf-8"
+//
+// Basic example on how to use custom tickmark feature to have a label
+// at the start of each month.
+//
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// 
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//
+$datay = array();
+$datax = array();
+$ts = time();
+$n=15; // Number of data points
+for($i=0; $i < $n; ++$i ) {
+    $datax[$i] = $ts+$i*700000; 
+    $datay[$i] = rand(5,60);
+}
+ 
+// Now get labels at the start of each month
+$dateUtils = new DateScaleUtils();
+list($tickPositions,$minTickPositions) = $dateUtils->GetTicks($datax);
+ 
+// We add some grace to the end of the X-axis scale so that the first and last
+// data point isn't exactly at the very end or beginning of the scale
+$grace = 400000;
+$xmin = $datax[0]-$grace;
+$xmax = $datax[$n-1]+$grace;
+ 
+//
+// The code to setup a very basic graph
+//
+$graph = new Graph(400,200);
+ 
+//
+// We use an integer scale on the X-axis since the positions on the X axis
+// are assumed to be UNI timestamps
+$graph->SetScale('intlin',0,0,$xmin,$xmax);
+$graph->title->Set('Basic example with manual ticks');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12);
+ 
+//
+// Make sure that the X-axis is always at the bottom of the scale
+// (By default the X-axis is alwys positioned at Y=0 so if the scale
+// doesn't happen to include 0 the axis will not be shown)
+$graph->xaxis->SetPos('min');
+ 
+// Now set the tic positions
+$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions);
+ 
+// The labels should be formatted at dates with "Year-month"
+$graph->xaxis->SetLabelFormatString('My',true);
+ 
+// Use Ariel font
+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
+ 
+// Add a X-grid
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($datay,$datax);
+$p1->SetColor('teal');
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manualtickex2.html b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex2.html new file mode 100644 index 0000000..6e3a146 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex2.html @@ -0,0 +1,140 @@ +
manualtickex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
<?php // content="text/plain; charset=utf-8"
+//
+// Basic example on how to use custom tickmark feature to have a label
+// at the start of each month.
+//
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// 
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//
+$f = new FuncGenerator('cos($x)+1.5*cos(2*$x)');
+list($datax,$datay) = $f->E(0,10);
+ 
+// Now get labels at 1/2 PI intervall
+$tickPositions = array();
+$tickLabels = array();
+$tickPositions[0] = 0;
+$tickLabels[0] = '0';
+for($i=1; $i/2*M_PI < 11 ; ++$i ) {
+    $tickPositions[$i] = $i/2*M_PI;
+    if( $i % 2 )
+    $tickLabels[$i] = $i.'/2'.SymChar::Get('pi');
+    else
+    $tickLabels[$i] = ($i/2).SymChar::Get('pi');
+}
+ 
+$n = count($datax);
+$xmin = $datax[0];
+$xmax = $datax[$n-1];
+ 
+//
+// The code to setup a very basic graph
+//
+$graph = new Graph(400,200);
+ 
+//
+// We use an integer scale on the X-axis since the positions on the X axis
+// are assumed to be UNI timestamps
+$graph->SetScale('linlin',0,0,$xmin,$xmax);
+$graph->title->Set('Example with manual tick labels');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12);
+ 
+//
+// Make sure that the X-axis is always at the bottom of the scale
+// (By default the X-axis is alwys positioned at Y=0 so if the scale
+// doesn't happen to include 0 the axis will not be shown)
+$graph->xaxis->SetPos('min');
+ 
+// Now set the tic positions
+$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels);
+ 
+// Use Times font
+$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,10);
+$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,10);
+ 
+// Add a X-grid
+$graph->xgrid->Show();
+ 
+// Create the plot line
+$p1 = new LinePlot($datay,$datax);
+$p1->SetColor('teal');
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manualtickex3.html b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex3.html new file mode 100644 index 0000000..704585c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex3.html @@ -0,0 +1,178 @@ +
manualtickex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
<?php // content="text/plain; charset=utf-8"
+//
+// Basic example on how to use custom tickmark feature to have a label
+// at the start of each month.
+//
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// 
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//
+$f = new FuncGenerator('cos($x)+1.5*cos(2*$x)');
+list($datax,$datay) = $f->E(0,10);
+ 
+// Now get labels at 1/2 PI intervall
+$tickPositions = array();
+$tickLabels = array();
+$tickPositions[0] = 0;
+$tickLabels[0] = '0';
+for($i=1; $i/2*M_PI < 11 ; ++$i ) {
+    $tickPositions[$i] = $i/2*M_PI;
+    if( $i % 2 )
+    $tickLabels[$i] = $i.'/2'.SymChar::Get('pi');
+    else
+    $tickLabels[$i] = ($i/2).SymChar::Get('pi');
+}
+ 
+$n = count($datax);
+$xmin = $datax[0];
+$xmax = $datax[$n-1];
+ 
+//
+// The code to setup a very basic graph
+//
+$graph = new Graph(400,200);
+ 
+// We use an integer scale on the X-axis since the positions on the X axis
+// are assumed to be UNI timestamps
+$graph->SetScale('linlin',0,0,$xmin,$xmax);
+$graph->title->Set('Example with manual tick labels');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->SetColor('white');
+ 
+// Setup a abackground gradient
+$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN);
+$graph->SetPlotGradient('black','darkred:0.8', 2);
+ 
+// Make sure that the X-axis is always at the bottom of the scale
+// (By default the X-axis is alwys positioned at Y=0 so if the scale
+// doesn't happen to include 0 the axis will not be shown)
+$graph->xaxis->SetPos('min');
+ 
+// Now set the tic positions
+$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels);
+ 
+// Use Times font
+$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,11);
+$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,9);
+ 
+// Set colors for axis
+$graph->xaxis->SetColor('lightgray');
+$graph->yaxis->SetColor('lightgray');
+ 
+// Add a X-grid
+$graph->xgrid->Show();
+ 
+// Show ticks outwards
+$graph->xaxis->SetTickSide(SIDE_DOWN);
+$graph->xaxis->SetLabelMargin(8);
+$graph->yaxis->SetTickSide(SIDE_LEFT);
+ 
+// Setup a filled y-grid
+//$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7');
+$graph->ygrid->SetStyle('dotted');
+$graph->xgrid->SetStyle('dashed');
+ 
+// Create the plot line
+$p1 = new LinePlot($datay,$datax);
+$p1->SetWeight(2);
+$p1->SetColor('orange:0.9');
+$p1->SetFillColor('white@0.7');
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/manualtickex4.html b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex4.html new file mode 100644 index 0000000..c275ce8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/manualtickex4.html @@ -0,0 +1,180 @@ +
manualtickex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
<?php // content="text/plain; charset=utf-8"
+//
+// Basic example on how to use custom tickmark feature to have a label
+// at the start of each month.
+//
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_utils.inc.php');
+ 
+// 
+// Create some random data for the plot. We use the current time for the
+// first X-position
+//
+$f = new FuncGenerator('cos($x)+1.5*cos(2*$x)');
+list($datax,$datay) = $f->E(0,10);
+ 
+// Now get labels at 1/2 PI intervall
+$tickPositions = array();
+$tickLabels = array();
+$tickPositions[0] = 0;
+$tickLabels[0] = '0';
+for($i=1; $i/2*M_PI < 11 ; ++$i ) {
+    $tickPositions[$i] = $i/2*M_PI;
+    if( $i % 2 )
+    $tickLabels[$i] = $i.'/2'.SymChar::Get('pi');
+    else
+    $tickLabels[$i] = ($i/2).SymChar::Get('pi');
+}
+ 
+$n = count($datax);
+$xmin = $datax[0];
+$xmax = $datax[$n-1];
+ 
+//
+// The code to setup a very basic graph
+//
+$graph = new Graph(400,200);
+ 
+// We use an integer scale on the X-axis since the positions on the X axis
+// are assumed to be UNI timestamps
+$graph->SetScale('linlin',0,0,$xmin,$xmax);
+$graph->title->Set('Example with manual tick labels');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->SetColor('white');
+ 
+// Setup a abackground gradient
+$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN);
+$graph->SetPlotGradient('black','darkred:0.8', 2);
+ 
+// Make sure that the X-axis is always at the bottom of the scale
+// (By default the X-axis is alwys positioned at Y=0 so if the scale
+// doesn't happen to include 0 the axis will not be shown)
+$graph->xaxis->SetPos('min');
+ 
+// Now set the tic positions
+$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels);
+ 
+// Use Times font
+$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,11);
+$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,9);
+ 
+// Set colors for axis
+$graph->xaxis->SetColor('lightgray');
+$graph->yaxis->SetColor('lightgray');
+ 
+// Add a X-grid
+$graph->xgrid->Show();
+ 
+// Show ticks outwards
+$graph->xaxis->SetTickSide(SIDE_DOWN);
+$graph->xaxis->SetLabelMargin(8);
+$graph->yaxis->SetTickSide(SIDE_LEFT);
+ 
+// Setup a filled y-grid
+//$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7');
+$graph->ygrid->SetStyle('dotted');
+$graph->xgrid->SetStyle('dashed');
+ 
+// Create the plot line
+$p1 = new LinePlot($datay,$datax);
+$p1->SetWeight(2);
+$p1->SetColor('orange:0.9');
+$p1->SetFillColor('white@0.7');
+$p1->SetFillFromYMin();
+$graph->Add($p1);
+ 
+// Output graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/markflagex1.html b/includes/jpgraph/docs/chunkhtml/example_src/markflagex1.html new file mode 100644 index 0000000..3b59519 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/markflagex1.html @@ -0,0 +1,144 @@ +
markflagex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/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,197);
+ 
+// 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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_csimex01.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_csimex01.html new file mode 100644 index 0000000..ee18140 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_csimex01.html @@ -0,0 +1,152 @@ +
matrix_csimex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
<?php // content="text/plain; charset=utf-8"
+require_once('jpgraph/jpgraph.php');
+require_once('jpgraph/jpgraph_matrix.php');
+ 
+ 
+$data = array(
+    array(0,null,2,3,4,5,6,7,8,9,10,8,6,4,2),
+    array(10,9,8,7,6,5,4,3,2,1,0,8,5,9,2),
+    array(0,1,2,3,4,5,6,7,8,9,10,2,4,5,7),
+    array(10,9,8,17,6,5,4,3,2,1,0,8,6,4,2),
+    array(0,1,2,3,4,4,9,7,8,9,10,3,2,7,2),
+    array(8,1,2,3,4,8,3,7,8,9,10,5,3,9,1),
+    array(10,3,5,7,6,5,4,3,12,1,0,6,5,10,2),
+    array(10,9,8,7,6,5,4,3,2,1,NULL,8,6,4,2),
+);
+ 
+$nx = count($data[0]);
+$ny = count($data);
+ 
+for( $i=0; $i < $ny; ++$i ) {
+    for( $j=0; $j < $nx; ++$j ) {
+        $csimtargets[$i][$j] = '#'.sprintf('%02sd',$i)."-".sprintf('%02sd',$j);
+    }
+}
+ 
+ 
+for($i=0; $i < $nx; ++$i ) {
+    $collabels[$i] = sprintf('column label: %02d',$i);
+    $collabeltargets[$i] = '#'.sprintf('collabel: %02d',$i);
+ 
+}
+for($i=0; $i < $ny; ++$i ) {
+    $rowlabels[$i] = sprintf('row label: %02d',$i);
+    $rowlabeltargets[$i] = '#'.sprintf('rowlabel: %02d',$i);
+}
+ 
+// Setup a nasic matrix graph
+$graph = new MatrixGraph(400,350);
+ 
+$graph->SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3');
+$graph->title->Set('CSIM with matrix');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
+$graph->title->SetColor('white');
+ 
+// Create one matrix plot
+$mp = new MatrixPlot($data,1);
+$mp->SetModuleSize(13,15);
+$mp->SetCenterPos(0.35,0.6);
+$mp->colormap->SetNullColor('gray');
+ 
+// Setup column lablels
+$mp->collabel->Set($collabels);
+$mp->collabel->SetSide('top');
+$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->collabel->SetFontColor('lightgray');
+ 
+// Setup row lablels
+$mp->rowlabel->Set($rowlabels);
+$mp->rowlabel->SetSide('right');
+$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->rowlabel->SetFontColor('lightgray');
+ 
+$mp->rowlabel->SetCSIMTargets($rowlabeltargets);
+$mp->collabel->SetCSIMTargets($collabeltargets);
+ 
+// Move the legend more to the right
+$mp->legend->SetMargin(90);
+$mp->legend->SetColor('white');
+$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10);
+ 
+$mp->SetCSIMTargets($csimtargets);
+ 
+$graph->Add($mp);
+$graph->StrokeCSIM();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_edgeex01.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_edgeex01.html new file mode 100644 index 0000000..53ebc21 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_edgeex01.html @@ -0,0 +1,106 @@ +
matrix_edgeex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once('jpgraph/jpgraph.php');
+require_once('jpgraph/jpgraph_matrix.php');
+ 
+$data = array(
+    array(0,null,2,3,4,5,6,7,8,9,10,8,6,4,2),
+    array(10,9,8,7,6,5,4,3,2,1,0,8,5,9,2),
+    array(0,1,2,3,4,5,6,7,8,9,10,2,4,5,7),
+    array(10,9,8,17,6,5,4,3,2,1,0,8,6,4,2),
+    array(0,1,2,3,4,4,9,7,8,9,10,3,2,7,2),
+    array(8,1,2,3,4,8,3,7,8,9,10,5,3,9,1),
+    array(10,3,5,7,6,5,4,3,12,1,0,6,5,10,2),
+    array(10,9,8,7,6,5,4,3,2,1,NULL,8,6,4,2),
+);
+ 
+for($i=0; $i < count($data[0]); ++$i ) {
+    $xlabels[$i] = sprintf('xlabel: %02d',$i);
+}
+for($i=0; $i < count($data); ++$i ) {
+    $ylabels[$i] = sprintf('ylabel: %02d',$i);
+}
+ 
+// Setup a nasic matrix graph
+$graph = new MatrixGraph(400,250);
+$graph->SetMarginColor('white');
+$graph->title->Set('Adding labels on the edges');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Create one matrix plot
+$mp = new MatrixPlot($data,1);
+$mp->SetModuleSize(13,15);
+$mp->SetCenterPos(0.35,0.45);
+$mp->colormap->SetNullColor('gray');
+ 
+// Setup column lablels
+$mp->collabel->Set($xlabels);
+$mp->collabel->SetSide('bottom');
+$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->collabel->SetFontColor('darkgray');
+ 
+// Setup row lablels
+$mp->rowlabel->Set($ylabels);
+$mp->rowlabel->SetSide('right');
+$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->rowlabel->SetFontColor('darkgray');
+ 
+// Move the legend more to the right
+$mp->legend->SetMargin(90);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex0.html new file mode 100644 index 0000000..edd6c3f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex0.html @@ -0,0 +1,56 @@ +
matrix_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php
+require_once('jpgraph/jpgraph.php');
+require_once('jpgraph/jpgraph_matrix.php');
+ 
+// Some (random) matrix
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Setup a bsic matrix graph and title
+$graph = new MatrixGraph(400,300);
+$graph->title->Set('Basic matrix example');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Create a ,atrix plot using all default values
+$mp = new MatrixPlot($data);
+$graph->Add($mp);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex03.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex03.html new file mode 100644 index 0000000..133af4e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex03.html @@ -0,0 +1,72 @@ +
matrix_ex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Do the meshinterpolation once for the data
+doMeshInterpolate($data,3);
+$r=count($data);$c=count($data[0]);
+ 
+$width=400; $height=400;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Adding an icon to the background');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$mp = new MatrixPlot($data,1);
+$mp->SetSize(0.6);
+ 
+$icon = new IconPlot('icon.jpg',$width-1,$height-1,0.8,50);
+$icon->SetAnchor('right','bottom');
+$graph->Add($icon);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.1.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.1.html new file mode 100644 index 0000000..eb4dc19 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.1.html @@ -0,0 +1,80 @@ +
matrix_ex04.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Do the meshinterpolation once for the data
+doMeshInterpolate($data,4);
+$r=count($data);$c=count($data[0]);
+ 
+$width=300; $height=300;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Adding a background image');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set('Alphablending = 0.2');
+ 
+// Add a stretched background image
+$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME);
+$graph->SetBackgroundImageMix(50);
+ 
+$mp = new MatrixPlot($data,1);
+$mp->SetSize(0.65);
+$mp->SetCenterPos(0.5,0.5);
+$mp->SetLegendLayout(1);
+$mp->SetAlpha(0.2);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.2.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.2.html new file mode 100644 index 0000000..5f2cae1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.2.html @@ -0,0 +1,80 @@ +
matrix_ex04.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Do the meshinterpolation once for the data
+doMeshInterpolate($data,4);
+$r=count($data);$c=count($data[0]);
+ 
+$width=300; $height=300;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Adding a background image');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set('Alphablending = 0.7');
+ 
+// Add a stretched background image
+$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME);
+$graph->SetBackgroundImageMix(50);
+ 
+$mp = new MatrixPlot($data,1);
+$mp->SetSize(0.65);
+$mp->SetCenterPos(0.5,0.5);
+$mp->SetLegendLayout(1);
+$mp->SetAlpha(0.7);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.html new file mode 100644 index 0000000..f02fe35 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex04.html @@ -0,0 +1,76 @@ +
matrix_ex04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+// Do the meshinterpolation once for the data
+doMeshInterpolate($data,4);
+$r=count($data);$c=count($data[0]);
+ 
+$width=400; $height=400;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Adding a background image');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Add a stretched background image
+$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME);
+$graph->SetBackgroundImageMix(50);
+ 
+$mp = new MatrixPlot($data,1);
+$mp->SetSize(0.6);
+$mp->SetCenterPos(0.5,0.5);
+$mp->SetLegendLayout(1);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex05.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex05.html new file mode 100644 index 0000000..f24ebed --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex05.html @@ -0,0 +1,62 @@ +
matrix_ex05.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+$width=400; $height=350;
+$graph = new MatrixGraph($width,$height);
+$graph->title->Set('Using a circular module type');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$mp = new MatrixPlot($data,2);
+$mp->SetSize(0.85);
+$mp->SetModuleType(1);
+$mp->SetBackgroundColor('teal:1.8');
+$mp->SetCenterPos(0.5,0.45);
+$mp->SetLegendLayout(1);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex06.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex06.html new file mode 100644 index 0000000..7467f40 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_ex06.html @@ -0,0 +1,150 @@ +
matrix_ex06.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
<?php // content="text/plain; charset=utf-8"
+require_once('jpgraph/jpgraph.php');
+require_once('jpgraph/jpgraph_matrix.php');
+require_once('jpgraph/jpgraph_plotline.php');
+ 
+ 
+$data = array(
+        array(0,null,2,3,4,5,6,7,8,9,10,8,6,4,2),
+        array(10,9,8,7,6,5,4,3,2,1,0,8,5,9,2),
+        array(0,1,2,3,4,5,6,7,8,9,10,2,4,5,7),
+        array(10,9,8,17,6,5,4,3,2,1,0,8,6,4,2),
+        array(0,1,2,3,4,4,9,7,8,9,10,3,2,7,2),
+        array(8,1,2,3,4,8,3,7,8,9,10,5,3,9,1),
+        array(10,3,5,7,6,5,4,3,12,1,0,6,5,10,2),
+        array(10,9,8,7,6,5,4,3,2,1,NULL,8,6,4,2),
+);
+ 
+$nx = count($data[0]);
+$ny = count($data);
+ 
+ 
+ 
+for($i=0; $i < $nx; ++$i ) {
+    $collabels[$i] = sprintf('column label: %02d',$i);
+ 
+}
+for($i=0; $i < $ny; ++$i ) {
+    $rowlabels[$i] = sprintf('row label: %02d',$i);
+ }
+ 
+// Setup a nasic matrix graph
+$graph = new MatrixGraph(400,350);
+ 
+$graph->SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3');
+$graph->title->Set('Matrix with lines');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,18);
+$graph->title->SetColor('white');
+ 
+// Create two lines to add as markers
+$l1 = new PlotLine(VERTICAL, 5, 'lightgray:1.5', 4);
+$l2 = new PlotLine(HORIZONTAL, 3, 'lightgray:1.5', 4);
+ 
+// Create one matrix plot
+$mp = new MatrixPlot($data,1);
+$mp->SetModuleSize(13,15);
+$mp->SetCenterPos(0.35,0.6);
+$mp->colormap->SetNullColor('gray');
+ 
+// Add lines
+$mp->AddLine($l1);
+$mp->AddLine($l2);
+// this could also be done as
+// $mp->AddLine(array($l1,$l2));
+ 
+// Setup column lablels
+$mp->collabel->Set($collabels);
+$mp->collabel->SetSide('top');
+$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->collabel->SetFontColor('lightgray');
+ 
+// Setup row lablels
+$mp->rowlabel->Set($rowlabels);
+$mp->rowlabel->SetSide('right');
+$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8);
+$mp->rowlabel->SetFontColor('lightgray');
+ 
+// Move the legend more to the right
+$mp->legend->SetMargin(90);
+$mp->legend->SetColor('white');
+$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10);
+ 
+$graph->Add($mp);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_introex.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_introex.html new file mode 100644 index 0000000..cc3e7f7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_introex.html @@ -0,0 +1,178 @@ +
matrix_introex.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,5,6,7,8,9,10),
+    array(10,9,8,17,6,5,4,3,2,1,0),
+    array(0,1,2,3,4,4,9,7,8,9,10),
+    array(8,1,2,3,4,8,3,7,8,9,10),
+    array(10,3,5,7,6,5,4,3,12,1,0),
+    array(10,9,8,7,6,5,4,3,2,1,0),
+);
+// Interpolate the data a factor of 4 to get some mroe 
+// data points
+doMeshInterpolate($data,4);
+ 
+// Setup a timer
+$timer = new JpgTimer();
+$timer->Push();
+ 
+//--------------------------------------------------------------
+// Setup a basic matrix graph
+//--------------------------------------------------------------
+$width = 740; $height = 500;
+$graph = new MatrixGraph($width,$height);
+$graph->SetMargin(1,2,70,1);
+$graph->SetColor('white');
+$graph->SetMarginColor('#fafafa');
+$graph->title->Set('Intro matrix graph');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Setup the background image
+$graph->SetBackgroundImage('fireplace.jpg',BGIMG_FILLPLOT);
+$graph->SetBackgroundImageMix(50);
+ 
+// Setup the timer in the right footer
+$graph->footer->SetTimer($timer);
+$graph->footer->right->SetColor('white');
+ 
+//--------------------------------------------------------------
+// Create the 2 matrix plots
+//--------------------------------------------------------------
+$mp = array(); $n = 2;
+for($i=0; $i < $n; ++$i){
+    $mp[$i] = new MatrixPlot($data);
+    $mp[$i]->colormap->SetMap($i);
+    $mp[$i]->SetSize(300,250);    
+    $mp[$i]->SetLegendLayout(1);
+    $mp[$i]->SetAlpha(0.2);
+    
+    // Make the legend slightly longer than default
+    $mp[$i]->legend->SetSize(20,280);
+}
+$mp[1]->colormap->SetMap(3);
+ 
+$hor1 = new LayoutHor(array($mp[0],$mp[1]));
+$hor1->SetCenterPos(0.5,0.5);
+ 
+$graph->Add($hor1);
+ 
+//--------------------------------------------------------------
+// Add texts to the graph
+//--------------------------------------------------------------
+$txts = array( 
+    array('Temperature gradient',$width/2,80),
+    array('Heat color map',200,110),
+    array('High contrast map',560,110));
+ 
+$n=count($txts);
+$t=array();
+for($i=0; $i < $n; ++$i){
+    $t[$i] = new Text($txts[$i][0],$txts[$i][1],$txts[$i][2]);
+    $t[$i]->SetFont(FF_ARIAL,FS_BOLD,14);
+    $t[$i]->SetColor('white');
+    $t[$i]->SetAlign('center','top');
+}
+$graph->Add($t);
+ 
+//--------------------------------------------------------------
+// Add Jpgraph logo to top left corner
+//--------------------------------------------------------------
+$icon = new IconPlot('jpglogo.jpg',2,2,0.9,50);
+$graph->Add($icon);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/matrix_layout_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/matrix_layout_ex1.html new file mode 100644 index 0000000..eba846c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/matrix_layout_ex1.html @@ -0,0 +1,88 @@ +
matrix_layout_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_matrix.php');
+ 
+$data = array(
+array(0,1,2,3,4,5,6,7,8,9,10),
+array(10,9,8,7,6,5,4,3,2,1,0),
+array(0,1,2,3,4,5,6,7,8,9,10),
+array(10,9,8,17,6,5,4,3,2,1,0),
+array(0,1,2,3,4,4,9,7,8,9,10),
+array(8,1,2,3,4,8,3,7,8,9,10),
+array(10,3,5,7,6,5,4,3,12,1,0),
+array(10,9,8,7,6,5,4,3,2,1,0),
+);
+ 
+doMeshInterpolate($data,4);
+ 
+$graph = new MatrixGraph(850,580);
+$graph->title->Set('Matrix layout example');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+$mp = array();
+$n = 5;
+for($i=0; $i < $n; ++$i){
+    $mp[$i] = new MatrixPlot($data);
+    $mp[$i]->colormap->SetMap($i);
+    if( $i < 2 )
+        $mp[$i]->SetSize(0.35);
+    else
+        $mp[$i]->SetSize(0.21);    
+    // We need to make the legend a bit smaller since by 
+    // defalt has a  ~45% height 
+    $mp[$i]->legend->SetModuleSize(15,2);
+}
+ 
+$hor1 = new LayoutHor(array($mp[0],$mp[1]));
+$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4]));
+$vert = new LayoutVert(array($hor1,$hor2));
+$vert->SetCenterPos(0.45,0.5);
+ 
+$graph->Add($vert);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/mulyaxisex1.html b/includes/jpgraph/docs/chunkhtml/example_src/mulyaxisex1.html new file mode 100644 index 0000000..cff9ac4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/mulyaxisex1.html @@ -0,0 +1,92 @@ +
mulyaxisex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$n = 8;
+for($i=0; $i < $n; ++$i ) {
+    $datay[$i] = rand(1,10);
+    $datay2[$i] = rand(10,55);
+    $datay3[$i] = rand(200,600);
+    $datay4[$i] = rand(500,800);
+}
+ 
+// Setup the graph
+$graph = new Graph(450,250);
+$graph->SetMargin(40,150,40,30);
+$graph->SetMarginColor('white');
+ 
+$graph->SetScale('intlin');
+$graph->title->Set('Using multiple Y-axis');
+$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14);
+ 
+$graph->SetYScale(0,'lin');
+$graph->SetYScale(1,'lin');
+$graph->SetYScale(2,'lin');
+ 
+$p1 = new LinePlot($datay);
+$graph->Add($p1);
+ 
+$p2 = new LinePlot($datay2);
+$p2->SetColor('teal');
+$graph->AddY(0,$p2);
+$graph->ynaxis[0]->SetColor('teal');
+ 
+$p3 = new LinePlot($datay3);
+$p3->SetColor('red');
+$graph->AddY(1,$p3);
+$graph->ynaxis[1]->SetColor('red');
+ 
+$p4 = new LinePlot($datay4);
+$p4->SetColor('blue');
+$graph->AddY(2,$p4);
+$graph->ynaxis[2]->SetColor('blue');
+ 
+// Output line
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/mulycsim_example_static.html b/includes/jpgraph/docs/chunkhtml/example_src/mulycsim_example_static.html new file mode 100644 index 0000000..e960dff --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/mulycsim_example_static.html @@ -0,0 +1,150 @@ +
mulyaxiscsimex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+ 
+// Setup some dummy targets for the CSIM
+$n = 5;
+for($i=0; $i < $n; ++$i ) {
+    $targ1[$i] = "#$i";
+    $targ2[$i] = "#$i";
+    $targ3[$i] = "#$i";
+    $alts1[$i] = "val=%d";
+    $alts2[$i] = "val=%d";
+    $alts3[$i] = "val=%d";
+}
+ 
+// Some data for the points
+$datay1 = array(3,10,4,1,6);
+$datay2 = array(25,22,18,24,20);
+$datay3 = array(89,70,92,77,96);
+ 
+// Create a basic graph with some suitable margins
+$graph = new Graph(500,250);
+$graph->SetMargin(60,180,50,40);
+$graph->SetMarginColor('white');
+$graph->title->Set("Multi Y-axes with Image Map");
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+// Setup the scales for all axes
+$graph->SetScale("intlin");
+$graph->SetYScale(0,'int');
+$graph->SetYScale(1,'int');
+ 
+// Standard Y-axis plot
+$lp1 = new LinePlot($datay1);
+$lp1->SetLegend('2001');
+$lp1->mark->SetType(MARK_DIAMOND);
+$lp1->mark->SetWidth(15);
+$lp1->mark->SetFillColor('orange');
+$lp1->SetCSIMTargets($targ1,$alts1);
+$graph->yaxis->title->Set('Basic Rate');
+$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->yaxis->title->SetColor('black');
+$graph->Add($lp1);
+ 
+// First multi Y-axis plot
+$lp2 = new LinePlot($datay2);
+$lp2->SetLegend('2002');
+$lp2->mark->SetType(MARK_DIAMOND);
+$lp2->mark->SetWidth(15);
+$lp2->mark->SetFillColor('darkred');
+$lp2->SetCSIMTargets($targ2,$alts2);
+$graph->ynaxis[0]->SetColor('darkred');
+$graph->ynaxis[0]->title->Set('Rate A');
+$graph->ynaxis[0]->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->ynaxis[0]->title->SetColor('darkred');
+$graph->AddY(0,$lp2);
+ 
+// Second multi Y-axis plot
+$lp3 = new LinePlot($datay3);
+$lp3->SetLegend('2003');
+$lp3->mark->SetType(MARK_DIAMOND);
+$lp3->mark->SetWidth(15);
+$lp3->mark->SetFillColor('darkgreen');
+$lp3->SetCSIMTargets($targ3,$alts3);
+$graph->ynaxis[1]->SetColor('darkgreen');
+$graph->ynaxis[1]->title->Set('Rate B');
+$graph->ynaxis[1]->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->ynaxis[1]->title->SetColor('darkgreen');
+$graph->AddY(1,$lp3);
+ 
+// Send back the HTML page which will call this script again
+// to retrieve the image.
+$graph->StrokeCSIM();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/ocean_example.html b/includes/jpgraph/docs/chunkhtml/example_src/ocean_example.html new file mode 100644 index 0000000..7d7e3f8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/ocean_example.html @@ -0,0 +1,116 @@ +
ocean_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new OceanTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "OceanTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex00.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex00.html new file mode 100644 index 0000000..1c016ab --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex00.html @@ -0,0 +1,42 @@ +
odotutex00.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,140);
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex01.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex01.html new file mode 100644 index 0000000..9030dbe --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex01.html @@ -0,0 +1,42 @@ +
odotutex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,140);
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer(ODO_FULL);
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex02.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex02.html new file mode 100644 index 0000000..dde003f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex02.html @@ -0,0 +1,60 @@ +
odotutex02.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,180);
+ 
+// Setup titles
+$graph->title->Set("Result for 2002");
+$graph->title->SetColor("white");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set("New York Office");
+$graph->subtitle->SetColor("white");
+$graph->caption->Set("Figure 1. Branch results.");
+$graph->caption->SetColor("white");
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex03.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex03.html new file mode 100644 index 0000000..0689652 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex03.html @@ -0,0 +1,60 @@ +
odotutex03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,200);
+ 
+// Setup titles
+$graph->title->Set("Result for 2002");
+$graph->title->SetColor("white");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set("New York Office");
+$graph->subtitle->SetColor("white");
+$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption.");
+$graph->caption->SetColor("white");
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex04.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex04.html new file mode 100644 index 0000000..ce41e53 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex04.html @@ -0,0 +1,80 @@ +
odotutex04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,200);
+ 
+// Setup titles
+$graph->title->Set("Result for 2002");
+$graph->title->SetColor("white");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set("New York Office");
+$graph->subtitle->SetColor("white");
+$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption.");
+$graph->caption->SetColor("white");
+ 
+// Setup colors
+// Make the border 40% darker than normal "khaki"
+$graph->SetMarginColor("khaki:0.6");
+$graph->SetColor("khaki");
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+ 
+// Setup colors for odometyer plot
+$odo->SetColor('white');
+$odo->scale->label->SetColor("darkred");
+$odo->needle->SetFillColor("yellow");
+ 
+// Set display value for the odometer
+$odo->needle->Set(30);
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex06.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex06.html new file mode 100644 index 0000000..0d55825 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex06.html @@ -0,0 +1,86 @@ +
odotutex06.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(570,220);
+ 
+$nstyle = array(
+    NEEDLE_STYLE_SIMPLE, NEEDLE_STYLE_STRAIGHT, NEEDLE_STYLE_ENDARROW,
+    NEEDLE_STYLE_SMALL_TRIANGLE,NEEDLE_STYLE_MEDIUM_TRIANGLE,
+    NEEDLE_STYLE_LARGE_TRIANGLE
+);
+ 
+$captions = array(
+    "NEEDLE_STYLE_SIMPLE","NEEDLE_STYLE_STRAIGHT","NEEDLE_STYLE_ENDARROW",
+    "NEEDLE_STYLE_SMALL_TRIANGLE","NEEDLE_STYLE_MEDIUM_TRIANGLE",
+    "NEEDLE_STYLE_LARGE_TRIANGLE"
+);
+ 
+$odo = array();
+ 
+for( $i=0; $i < 6; ++$i ) {
+    $odo[$i] = new Odometer();
+    $odo[$i]->SetColor("lightyellow");
+    $odo[$i]->needle->Set(80);
+    $odo[$i]->needle->SetStyle($nstyle[$i]);
+    $odo[$i]->caption->Set($captions[$i]);
+    $odo[$i]->caption->SetFont(FF_FONT1);
+    $odo[$i]->caption->SetMargin(3);
+}
+ 
+// Use the automatic layout engine to positon the plots on the graph
+$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) );
+$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) );
+$col1 = new LayoutVert( array($row1,$row2) );
+ 
+// Add the odometer to the graph
+$graph->Add($col1);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex07.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex07.html new file mode 100644 index 0000000..9a526d6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex07.html @@ -0,0 +1,74 @@ +
odotutex07.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(570,250);
+ 
+$odo = array();
+$astyles = array(
+    NEEDLE_ARROW_SS,NEEDLE_ARROW_SM,NEEDLE_ARROW_SL,
+    NEEDLE_ARROW_MS,NEEDLE_ARROW_MM, NEEDLE_ARROW_ML,
+    NEEDLE_ARROW_LS, NEEDLE_ARROW_LM, NEEDLE_ARROW_LL
+    );
+$acaptions = array(
+    'SS','SM','SL','MS','MM','ML','LS','LM','LL'
+);
+ 
+for($i = 0; $i < 9; ++$i ) {
+    $odo[$i] =     new Odometer();
+    $odo[$i]->SetColor("lightyellow");
+    $odo[$i]->needle->Set(75);
+    $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]);
+    $odo[$i]->caption->SetFont(FF_FONT1,FS_BOLD);
+    $odo[$i]->caption->Set('Arrow: '.$acaptions[$i]);
+}
+ 
+$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) );
+$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) );
+$row3 = new LayoutHor( array($odo[6],$odo[7],$odo[8]) );
+$col1 = new LayoutVert( array($row1,$row2,$row3) );
+ 
+// Add the odometer to the graph
+$graph->Add($col1);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex08.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex08.html new file mode 100644 index 0000000..0907d8c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex08.html @@ -0,0 +1,72 @@ +
odotutex08.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,140);
+ 
+// Setup a title
+$graph->title->Set('An example with drop shadows');
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Set some nonstandard colors
+$color = array(205,220,205);
+$graph->SetMarginColor($color);
+$graph->SetColor($color);
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+$odo->SetColor('white');
+ 
+// Set display value for the odometer
+$odo->needle->Set(70);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex09.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex09.html new file mode 100644 index 0000000..fe9646b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex09.html @@ -0,0 +1,76 @@ +
odotutex09.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(600,300);
+ 
+$odo = array();
+$astyles = array(
+    NEEDLE_ARROW_SS,NEEDLE_ARROW_SM,NEEDLE_ARROW_SL,
+    NEEDLE_ARROW_MS,NEEDLE_ARROW_MM, NEEDLE_ARROW_ML,
+    NEEDLE_ARROW_LS, NEEDLE_ARROW_LM, NEEDLE_ARROW_LL
+    );
+$acaptions = array(
+    'SS','SM','SL','MS','MM','ML','LS','LM','LL'
+);
+ 
+for($i = 0; $i < 9; ++$i ) {
+    $odo[$i] =     new Odometer();
+    $odo[$i]->SetColor("lightyellow");
+    $odo[$i]->needle->Set(75);
+    $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]);
+    $odo[$i]->caption->SetFont(FF_FONT1);
+    $odo[$i]->caption->Set($acaptions[$i]);
+    $odo[$i]->SetMargin(15);
+}
+ 
+$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) );
+$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) );
+$row3 = new LayoutHor( array($odo[6],$odo[7],$odo[8]) );
+$col1 = new LayoutVert( array($row1,$row2,$row3) );
+ 
+// Add the odometer to the graph
+$graph->Add($col1);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex10.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex10.html new file mode 100644 index 0000000..6b43322 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex10.html @@ -0,0 +1,86 @@ +
odotutex10.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,150);
+ 
+$graph->title->Set('Example with scale indicators');
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer(ODO_HALF);
+ 
+// Add color indications
+$odo->AddIndication(0,20,"green:0.7");
+$odo->AddIndication(20,30,"green:0.9");
+$odo->AddIndication(30,60,"yellow");
+$odo->AddIndication(60,80,"orange");
+$odo->AddIndication(80,100,"red");
+ 
+// Set display value for the odometer
+$odo->needle->Set(90);
+ 
+//---------------------------------------------------------------------
+// Add drop shadow for needle
+//---------------------------------------------------------------------
+$odo->needle->SetShadow();
+ 
+//---------------------------------------------------------------------
+// Add the odometer to the graph
+//---------------------------------------------------------------------
+$graph->Add($odo);
+ 
+//---------------------------------------------------------------------
+// ... and finally stroke and stream the image back to the browser
+//---------------------------------------------------------------------
+$graph->Stroke();
+ 
+// EOF
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex11.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex11.html new file mode 100644 index 0000000..667a4c7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex11.html @@ -0,0 +1,80 @@ +
odotutex11.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,150);
+ 
+$graph->title->Set('Example with scale indicators');
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer(ODO_HALF);
+ 
+// Add color indications
+$odo->AddIndication(0,20,"green:0.7");
+$odo->AddIndication(20,30,"green:0.9");
+$odo->AddIndication(30,60,"yellow");
+$odo->AddIndication(60,80,"orange");
+$odo->AddIndication(80,100,"red");
+ 
+// Set display value for the odometer
+$odo->needle->Set(90);
+ 
+// Set the size of the non-colored base area to 40% of the radius
+$odo->SetCenterAreaWidth(0.45);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+// EOF
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex12.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex12.html new file mode 100644 index 0000000..202cbdf --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex12.html @@ -0,0 +1,94 @@ +
odotutex12.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,150);
+ 
+$graph->title->Set('Example with scale indicators');
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer(ODO_HALF);
+ 
+// Add color indications
+$odo->AddIndication(0,20,"green:0.7");
+$odo->AddIndication(20,30,"green:0.9");
+$odo->AddIndication(30,60,"yellow");
+$odo->AddIndication(60,80,"orange");
+$odo->AddIndication(80,100,"red");
+ 
+// Set display value for the odometer
+$odo->needle->Set(90);
+ 
+// Set the size of the non-colored base area to 40% of the radius
+$odo->SetCenterAreaWidth(0.45);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Setup the second needle
+$odo->needle2->Set(44);
+$odo->needle2->Show();
+$odo->needle2->SetLength(0.4);
+$odo->needle2->SetFillColor("navy");
+$odo->needle2->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+// EOF
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex13.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex13.html new file mode 100644 index 0000000..80baf27 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex13.html @@ -0,0 +1,82 @@ +
odotutex13.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,150);
+ 
+$graph->title->Set('Example with scale indicators');
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer(ODO_HALF);
+ 
+// Add color indications
+$odo->AddIndication(0,20,"green:0.7");
+$odo->AddIndication(20,30,"green:0.9");
+$odo->AddIndication(30,60,"yellow");
+$odo->AddIndication(60,80,"orange");
+$odo->AddIndication(80,100,"red");
+ 
+$odo->SetCenterAreaWidth(0.45);
+ 
+// Set display value for the odometer
+$odo->needle->Set(90);
+ 
+// Add scale labels
+$odo->label->Set("mBar");
+$odo->label->SetFont(FF_FONT2,FS_BOLD);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex14.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex14.html new file mode 100644 index 0000000..f2f7022 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex14.html @@ -0,0 +1,70 @@ +
odotutex14.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,160);
+$graph->title->Set('Custom scale');
+$graph->title->SetColor('white');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD);
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo = new Odometer();
+$odo->SetColor('lightyellow');
+ 
+// Setup the scale
+$odo->scale->Set(100,600);
+$odo->scale->SetTicks(50,2);
+ 
+// Set display value for the odometer
+$odo->needle->Set(280);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex15.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex15.html new file mode 100644 index 0000000..28cdf59 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex15.html @@ -0,0 +1,92 @@ +
odotutex15.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(250,170);
+ 
+// Setup graph titles
+$graph->title->Set('Custom formatting');
+$graph->title->SetColor('white');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD);
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+$odo = new Odometer();
+$odo->SetColor("lightgray:1.9");
+ 
+// Setup the scale
+$odo->scale->Set(100,600);
+$odo->scale->SetTicks(50,2);
+$odo->scale->SetTickColor('brown');
+$odo->scale->SetTickLength(0.05);
+$odo->scale->SetTickWeight(2);
+ 
+$odo->scale->SetLabelPos(0.75);
+$odo->scale->label->SetFont(FF_FONT1, FS_BOLD);
+$odo->scale->label->SetColor('brown');
+$odo->scale->label->SetFont(FF_ARIAL,FS_NORMAL,10);
+ 
+// Setup a label with a degree mark
+$odo->scale->SetLabelFormat('%dC'.SymChar::Get('degree'));
+ 
+// Set display value for the odometer
+$odo->needle->Set(280);
+ 
+// Add drop shadow for needle
+$odo->needle->SetShadow();
+ 
+// Add the odometer to the graph
+$graph->Add($odo);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex16.1.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex16.1.html new file mode 100644 index 0000000..f8c1208 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex16.1.html @@ -0,0 +1,84 @@ +
odotutex16.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(350,100);
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo1 = new Odometer();
+$odo2 = new Odometer();
+$odo1->SetColor("lightgray:1.9");
+$odo2->SetColor("lightgray:1.9");
+ 
+// Adjust start and end angle for the scale
+$odo2->scale->SetAngle(110,250);
+ 
+$odo1->scale->label->SetFont(FF_ARIAL,FS_BOLD,10);
+$odo2->scale->label->SetFont(FF_ARIAL,FS_BOLD,10);
+$odo2->AddIndication(-15,0,'lightgray');
+$odo2->AddIndication(100,115,'lightgray');
+ 
+// Set display value for the odometer
+$odo1->needle->Set(70);
+$odo2->needle->Set(70);
+ 
+// Add drop shadow for needle
+$odo1->needle->SetShadow();
+$odo2->needle->SetShadow();
+ 
+// Specify the layout for the two odometers
+$row = new LayoutHor( array($odo1,$odo2) );
+ 
+// Add the odometer to the graph
+$graph->Add($row);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex16.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex16.html new file mode 100644 index 0000000..8ff9c10 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex16.html @@ -0,0 +1,80 @@ +
odotutex16.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph (width=250, height=200 pixels)
+$graph = new OdoGraph(350,100);
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+// By default the scale will be 0 to 100
+$odo1 = new Odometer();
+$odo2 = new Odometer();
+$odo1->SetColor("lightgray:1.9");
+$odo2->SetColor("lightgray:1.9");
+ 
+// Adjust start and end angle for the scale
+$odo2->scale->SetAngle(110,250);
+ 
+$odo1->scale->label->SetFont(FF_ARIAL,FS_BOLD,10);
+$odo2->scale->label->SetFont(FF_ARIAL,FS_BOLD,10);
+ 
+// Set display value for the odometer
+$odo1->needle->Set(70);
+$odo2->needle->Set(70);
+ 
+// Add drop shadow for needle
+$odo1->needle->SetShadow();
+$odo2->needle->SetShadow();
+ 
+// Specify the layout for the two odometers
+$row = new LayoutHor( array($odo1,$odo2) );
+ 
+// Add the odometer to the graph
+$graph->Add($row);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex17.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex17.html new file mode 100644 index 0000000..226c0a8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex17.html @@ -0,0 +1,92 @@ +
odotutex17.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph
+$graph = new OdoGraph(300,320);
+ 
+// Setup graph titles
+$graph->title->Set('Manual positioning');
+$graph->title->SetColor('white');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Add drop shadow for graph
+$graph->SetShadow();
+ 
+// Now we need to create an odometer to add to the graph.
+$odo1 = new Odometer();
+$odo2 = new Odometer();
+$odo1->SetColor('lightgray:1.9');
+$odo2->SetColor('lightgray:1.9');
+ 
+// Set display value for the odometer
+$odo1->needle->Set(37);
+$odo2->needle->Set(73);
+ 
+// Add drop shadow for needle
+$odo1->needle->SetShadow();
+$odo2->needle->SetShadow();
+ 
+// Specify the position for the two odometers
+$odo1->SetPos(180,110);
+$odo1->SetSize(100);
+$odo2->SetPos(110,250);
+$odo2->SetSize(100);
+ 
+// Set captions for the odometers
+$odo1->caption->Set("(x,y) = (180,120)\nradius=100");
+$odo2->caption->Set("(x,y) = (110,270)\nradius=100");
+ 
+// Add the odometer to the graph
+$graph->Add($odo1);
+$graph->Add($odo2);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex18.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex18.html new file mode 100644 index 0000000..bdd03b4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex18.html @@ -0,0 +1,74 @@ +
odotutex18.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+ 
+// Create a new odometer graph
+$graph = new OdoGraph(500,180);
+ 
+$odo = array();
+ 
+// Now we need to create an odometer to add to the graph.
+for( $i=0; $i < 5; ++$i ) {
+    $odo[$i] = new Odometer();
+    $odo[$i]->SetColor('lightgray:1.9');
+    $odo[$i]->needle->Set(10+$i*17);
+    $odo[$i]->needle->SetShadow();
+    if( $i < 2 )
+        $fsize = 10;
+    else
+        $fsize = 8;
+    $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize);
+    $odo[$i]->AddIndication(92,100,'red');
+    $odo[$i]->AddIndication(80,92,'orange');
+    $odo[$i]->AddIndication(60,80,'yellow');
+}
+ 
+// Create the layout
+$row1 = new LayoutHor( array($odo[0],$odo[1]) );
+$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) );
+$col1 = new LayoutVert( array($row1,$row2) );
+ 
+// Add the odometer to the graph
+$graph->Add($col1);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/odotutex19.html b/includes/jpgraph/docs/chunkhtml/example_src/odotutex19.html new file mode 100644 index 0000000..b341a9c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/odotutex19.html @@ -0,0 +1,98 @@ +
odotutex19.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_odo.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+// Create a new odometer graph
+$graph = new OdoGraph(500,180);
+ 
+$odo = array();
+ 
+// Now we need to create an odometer to add to the graph.
+for( $i=0; $i < 5; ++$i ) {
+    $odo[$i] = new Odometer();
+    $odo[$i]->SetColor('lightgray:1.9');
+    $odo[$i]->needle->Set(10+$i*17);
+    $odo[$i]->needle->SetShadow();
+    if( $i < 2 )
+        $fsize = 10;
+    else
+        $fsize = 8;
+    $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize);
+    $odo[$i]->AddIndication(92,100,'red');
+    $odo[$i]->AddIndication(80,92,'orange');
+    $odo[$i]->AddIndication(60,80,'yellow');
+}
+ 
+// Create the layout
+$row1 = new LayoutHor( array($odo[0],$odo[1]) );
+$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) );
+$col1 = new LayoutVert( array($row1,$row2) );
+ 
+// Add the odometer to the graph
+$graph->Add($col1);
+ 
+// Add an icon and text
+$icon = new IconPlot('jpglogo.jpg',250,10,0.85,30);
+$icon->SetAnchor('center','top');
+$graph->Add($icon);
+ 
+$t = new Text('JpGraph',250,70);
+$t->SetAlign('center','top');
+#$t->SetFont(FF_VERA,FS_BOLD,11);
+$t->SetColor('darkgray');
+$graph->Add($t);
+ 
+// ... and finally stroke and stream the image back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/orange_example.html b/includes/jpgraph/docs/chunkhtml/example_src/orange_example.html new file mode 100644 index 0000000..f83798f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/orange_example.html @@ -0,0 +1,116 @@ +
orange_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new OrangeTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "OrangeTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/partiallyfilledlineex1.html b/includes/jpgraph/docs/chunkhtml/example_src/partiallyfilledlineex1.html new file mode 100644 index 0000000..1c80c92 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/partiallyfilledlineex1.html @@ -0,0 +1,88 @@ +
partiallyfilledlineex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pastel_example.html b/includes/jpgraph/docs/chunkhtml/example_src/pastel_example.html new file mode 100644 index 0000000..8058145 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pastel_example.html @@ -0,0 +1,114 @@ +
pastel_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new PastelTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "PastelTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex0.html new file mode 100644 index 0000000..18efe1e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex0.html @@ -0,0 +1,16 @@ +
pdf417_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+// Create a new encoder and backend to generate PNG images
+$backend = PDF417BackendFactory::Create(BACKEND_IMAGE,new PDF417Barcode());
+$backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex1.html new file mode 100644 index 0000000..f550d86 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex1.html @@ -0,0 +1,26 @@ +
pdf417_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+try {
+    // Create a new encoder and backend to generate PNG images
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,new PDF417Barcode());
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex1b.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex1b.html new file mode 100644 index 0000000..c35ba06 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex1b.html @@ -0,0 +1,40 @@ +
pdf417_ex1b.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 2;  // Use error level 2 (minimum recommended)
+ 
+// Create a new encoder and backend to generate PNG images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex2.html new file mode 100644 index 0000000..0454be0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex2.html @@ -0,0 +1,48 @@ +
pdf417_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 2;  // Use error level 2 (minimum recommended)
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 3;    // Height factor
+ 
+// Create a new encoder and backend to generate PNG images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex3.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex3.html new file mode 100644 index 0000000..1db4ac6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex3.html @@ -0,0 +1,52 @@ +
pdf417_ex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 2;    // Height factor (=2)
+$showtext = false;  // Show human readable string
+ 
+// Create a new encoder and backend to generate PNG images
+try {
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex4.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex4.html new file mode 100644 index 0000000..68d4b77 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex4.html @@ -0,0 +1,56 @@ +
pdf417_ex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 2;  // Setup module width (in pixels)
+$height = 2;    // Height factor (=2)
+$showtext = true;  // Show human readable string
+ 
+try {
+    // Create a new encoder and backend to generate PNG images
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+ 
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->SetColor('black','yellow');
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex5.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex5.html new file mode 100644 index 0000000..1f23589 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex5.html @@ -0,0 +1,58 @@ +
pdf417_ex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data = 'PDF-417';
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$errlevel = 4;  // Use error level 4
+$modwidth = 0.8;// Setup module width (in PS points)
+$height = 3;    // Height factor (=2)
+$showtext = true;  // Show human readable string
+ 
+try {
+    // Create a new encoder and backend to generate PNG images
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_PS,$encoder);
+ 
+    $backend->SetModuleWidth($modwidth);
+    $backend->SetHeight($height);
+    $backend->NoText(!$showtext);
+    $backend->SetColor('black','yellow');
+    $output = $backend->Stroke($data);
+    echo nl2br(htmlspecialchars($output));
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex6.html b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex6.html new file mode 100644 index 0000000..1cfba60 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pdf417_ex6.html @@ -0,0 +1,70 @@ +
pdf417_ex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
+ 
+$data1 = '12345';
+$data2 = 'Abcdef';
+$data3 = '6789';
+ 
+// Manually specify several encodation schema
+$data = array(
+    array(USE_NC,$data1),
+    array(USE_TC,$data2),
+    array(USE_NC,$data3));
+ 
+//$data = "12345Abcdef6789";
+ 
+// Setup some symbolic names for barcode specification
+ 
+$columns = 8;   // Use 8 data (payload) columns
+$modwidth = 2;  // Use 2 pixel module width
+$errlevel = 2;  // Use error level 2
+$showtext = true;  // Show human readable string
+ 
+try {
+    // Create a new encoder and backend to generate PNG images
+    $encoder = new PDF417Barcode($columns,$errlevel);
+    $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
+ 
+    $backend->SetModuleWidth($modwidth);
+    $backend->NoText(!$showtext);
+    $backend->Stroke($data);
+}
+catch(JpGraphException $e) {
+    echo 'PDF417 Error: '.$e->GetMessage();
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/piebkgex1.html b/includes/jpgraph/docs/chunkhtml/example_src/piebkgex1.html new file mode 100644 index 0000000..654c4ae --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/piebkgex1.html @@ -0,0 +1,184 @@ +
piebkgex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+require_once ('jpgraph/jpgraph_pie3d.php');
+ 
+// Some data
+$data = array(
+    array(80,18,15,17),
+    array(35,28,6,34),
+    array(10,28,10,5),
+    array(22,22,10,17));
+ 
+$piepos = array(0.2,0.4,0.65,0.28,0.25,0.75,0.8,0.75);
+$titles = array('USA','Sweden','South America','Australia');
+ 
+$n = count($piepos)/2;
+ 
+// A new graph
+$graph = new PieGraph(550,400,'auto');
+ 
+// Specify margins since we put the image in the plot area
+$graph->SetMargin(1,1,40,1);
+$graph->SetMarginColor('navy');
+$graph->SetShadow(false);
+ 
+// Setup background
+$graph->SetBackgroundImage('worldmap1.jpg',BGIMG_FILLPLOT);
+ 
+// Setup title
+$graph->title->Set("Pie plots with background image");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,20);
+$graph->title->SetColor('white');
+ 
+$p = array();
+// Create the plots
+for( $i=0; $i < $n; ++$i ) {
+    $d = "data$i";
+    $p[] = new PiePlot3D($data[$i]);
+}
+ 
+// Position the four pies
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->SetCenter($piepos[2*$i],$piepos[2*$i+1]);
+}
+ 
+// Set the titles
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->title->Set($titles[$i]);
+    $p[$i]->title->SetColor('white');
+    $p[$i]->title->SetFont(FF_ARIAL,FS_BOLD,12);
+}
+ 
+// Label font and color setup
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->value->SetFont(FF_ARIAL,FS_BOLD);
+    $p[$i]->value->SetColor('white');
+}
+ 
+// Show the percetages for each slice
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->value->Show();
+}
+ 
+// Label format
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->value->SetFormat("%01.1f%%");
+}
+ 
+// Size of pie in fraction of the width of the graph
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->SetSize(0.15);
+}
+ 
+// Format the border around each slice
+ 
+ 
+for( $i=0; $i < $n; ++$i ) {
+    $p[$i]->SetEdge(false);
+    $p[$i]->ExplodeSlice(1);
+}
+ 
+// Use one legend for the whole graph
+$p[0]->SetLegends(array("May","June","July","Aug"));
+$graph->legend->Pos(0.05,0.35);
+$graph->legend->SetShadow(false);
+ 
+for( $i=0; $i < $n; ++$i ) {
+    $graph->Add($p[$i]);
+}
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/piecex1.html b/includes/jpgraph/docs/chunkhtml/example_src/piecex1.html new file mode 100644 index 0000000..9ac4b35 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/piecex1.html @@ -0,0 +1,88 @@ +
piecex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
<?php // content="text/plain; charset=utf-8"
+// $Id
+// Example of pie with center circle
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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_ARIAL,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_ARIAL,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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/piecex2.html b/includes/jpgraph/docs/chunkhtml/example_src/piecex2.html new file mode 100644 index 0000000..37a8e72 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/piecex2.html @@ -0,0 +1,136 @@ +
piecex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
<?php // content="text/plain; charset=utf-8"
+// $Id: piecex2.php,v 1.3.2.1 2003/08/19 20:40:12 aditus Exp $
+// Example of pie with center circle
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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_ARIAL,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_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);
+ 
+// Add plot to pie graph
+$graph->Add($p1);
+ 
+// .. and send the image on it's marry way to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pieex3.html b/includes/jpgraph/docs/chunkhtml/example_src/pieex3.html new file mode 100644 index 0000000..d6be57b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pieex3.html @@ -0,0 +1,100 @@ +
pieex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+// Some data
+$data = array(40,21,17,14,23);
+ 
+// Create the Pie Graph.
+$graph = new PieGraph(350,300);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pieex8.html b/includes/jpgraph/docs/chunkhtml/example_src/pieex8.html new file mode 100644 index 0000000..8025285 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pieex8.html @@ -0,0 +1,66 @@ +
pieex8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,31,35);
+ 
+// A new pie graph
+$graph = new PieGraph(250,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pieex9.html b/includes/jpgraph/docs/chunkhtml/example_src/pieex9.html new file mode 100644 index 0000000..cce360f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pieex9.html @@ -0,0 +1,78 @@ +
pieex9.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_pie.php');
+ 
+$data = array(40,60,31,35);
+ 
+// A new pie graph
+$graph = new PieGraph(250,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex1.html b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex1.html new file mode 100644 index 0000000..09bc4b4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex1.html @@ -0,0 +1,72 @@ +
pielabelsex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex2.html b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex2.html new file mode 100644 index 0000000..c0ded4c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex2.html @@ -0,0 +1,72 @@ +
pielabelsex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex4.html b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex4.html new file mode 100644 index 0000000..6a0d0b8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex4.html @@ -0,0 +1,72 @@ +
pielabelsex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex5.html b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex5.html new file mode 100644 index 0000000..b9b53cb --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pielabelsex5.html @@ -0,0 +1,92 @@ +
pielabelsex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
<?php // content="text/plain; charset=utf-8"
+include ("../jpgraph.php");
+include ("../jpgraph_pie.php");
+ 
+// Some data and the labels
+$data   = array(19,12,4,7,3,12,3);
+$labels = array("First\n(%.1f%%)",
+                "Second\n(%.1f%%)","Third\n(%.1f%%)",
+                "Fourth\n(%.1f%%)","Fifth\n(%.1f%%)",
+                "Sixth\n(%.1f%%)","Seventh\n(%.1f%%)");
+ 
+// Create the Pie Graph.
+$graph = new PieGraph(300,300);
+$graph->SetShadow();
+ 
+// Set A title for the plot
+$graph->title->Set('String labels with values');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('black');
+ 
+// Create pie plot
+$p1 = new PiePlot($data);
+$p1->SetCenter(0.5,0.5);
+$p1->SetSize(0.3);
+ 
+// Setup the labels to be displayed
+$p1->SetLabels($labels);
+ 
+// This method adjust the position of the labels. This is given as fractions
+// of the radius of the Pie. A value < 1 will put the center of the label
+// inside the Pie and a value >= 1 will pout the center of the label outside the
+// Pie. By default the label is positioned at 0.5, in the middle of each slice.
+$p1->SetLabelPos(1);
+ 
+// Setup the label formats and what value we want to be shown (The absolute)
+// or the percentage.
+$p1->SetLabelType(PIE_VALUE_PER);
+$p1->value->Show();
+$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9);
+$p1->value->SetColor('darkgray');
+ 
+// Add and stroke
+$graph->Add($p1);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex0.html new file mode 100644 index 0000000..188b246 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex0.html @@ -0,0 +1,76 @@ +
plotbanddensity_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,200);    
+$graph->SetScale('textlin');
+$graph->SetMargin(25,10,20,25);
+$graph->SetBox(true);
+ 
+// 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");
+ 
+$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(10);
+$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=10');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex1.html new file mode 100644 index 0000000..8645c84 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex1.html @@ -0,0 +1,76 @@ +
plotbanddensity_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,200);    
+$graph->SetScale('textlin');
+$graph->SetMargin(25,10,20,25);
+$graph->SetBox(true);
+ 
+// 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");
+ 
+$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(40);
+$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=40');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex2.html new file mode 100644 index 0000000..6b4d53c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/plotbanddensity_ex2.html @@ -0,0 +1,76 @@ +
plotbanddensity_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,200);    
+$graph->SetScale('textlin');
+$graph->SetMargin(25,10,20,25);
+$graph->SetBox(true);
+ 
+// Add 10% grace ("space") at top and botton of Y-scale. 
+$graph->yscale->SetGrace(10);
+$graph->ygrid->Show(false);
+ 
+// Create a bar pot
+$bplot = new BarPlot($datay);
+$bplot->SetFillColor("lightblue");
+ 
+ 
+// .. and add the plot to the graph
+$graph->Add($bplot);
+ 
+// Add band
+$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4');
+$band->SetDensity(80);
+$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=80');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarclockex1.html b/includes/jpgraph/docs/chunkhtml/example_src/polarclockex1.html new file mode 100644 index 0000000..7a3d882 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarclockex1.html @@ -0,0 +1,110 @@ +
polarclockex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_polar.php');
+ 
+//$data = array(22,12,27,40,80,48,120,40,142,27,170,12);
+ 
+$data = array(
+0,0,10,2,30,25,40,60,
+50,110,60,140,70,170,80,190,
+85,195,90,200,95,195,100,190,
+110,170,120,140,130,110,140,60,
+150,25,170,2,180,0);
+ 
+//$data2 = array(0,0,50,2,60,30,65,90,60,120,50,150,20,170,0,180);
+ 
+$data2 = array(0,0,34,56,90,90,170,65,220,90,270,120,300,60,355,10);
+ 
+$graph = new PolarGraph(350,350);
+$graph->SetScale('lin',150);
+ 
+$graph->SetMarginColor('#FFE6C0');
+$graph->SetType(POLAR_360);
+$graph->SetMargin(40,40,50,40);
+$graph->SetClockwise(true);
+ 
+//$graph->Set90AndMargin(60,50,70,120);
+ 
+$graph->SetBox(true);
+$graph->SetFrame(false);
+$graph->axis->ShowGrid(true,false,true);
+$graph->axis->SetGridColor('gray','gray','gray');
+ 
+$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8);
+$graph->axis->SetTitle('X-Axis','center');
+ 
+$graph->axis->SetColor('black','black','darkred');
+$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8);
+ 
+$graph->title->Set('Clockwise polar plot');
+$graph->title->SetFont(FF_COMIC,FS_NORMAL,16);
+$graph->title->SetColor('navy');
+ 
+ 
+ 
+$p = new PolarPlot($data);
+$p->SetFillColor('lightblue@0.5');
+$graph->Add($p);
+ 
+//$p2 = new PolarPlot($data2);
+//$p2->SetFillColor('red@0.5');
+//$graph->Add($p2);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarclockex2.html b/includes/jpgraph/docs/chunkhtml/example_src/polarclockex2.html new file mode 100644 index 0000000..25dc1d6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarclockex2.html @@ -0,0 +1,106 @@ +
polarclockex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_polar.php');
+ 
+//$data = array(22,12,27,40,80,48,120,40,142,27,170,12);
+ 
+$data = array(
+0,0,10,2,30,25,40,60,
+50,110,60,140,70,170,80,190,
+85,195,90,200,95,195,100,190,
+110,170,120,140,130,110,140,60,
+150,25,170,2,180,0);
+ 
+//$data2 = array(0,0,50,2,60,30,65,90,60,120,50,150,20,170,0,180);
+ 
+$data2 = array(0,0,34,56,90,90,170,65,220,90,270,120,300,60,355,10);
+ 
+$graph = new PolarGraph(350,350);
+$graph->SetScale('lin',150);
+ 
+$graph->SetMarginColor('#FFE6C0');
+$graph->SetType(POLAR_360);
+$graph->SetClockwise(true);
+$graph->Set90AndMargin(40,40,50,40);
+ 
+$graph->SetBox(true);
+$graph->SetFrame(false);
+$graph->axis->ShowGrid(true,false,true);
+$graph->axis->SetGridColor('gray','gray','gray');
+ 
+$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8);
+$graph->axis->SetTitle('X-Axis','center');
+ 
+$graph->axis->SetColor('black','black','darkred');
+$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8);
+ 
+$graph->title->Set('Clockwise polar plot (rotated)');
+$graph->title->SetFont(FF_COMIC,FS_NORMAL,16);
+$graph->title->SetColor('navy');
+ 
+ 
+ 
+$p = new PolarPlot($data);
+$p->SetFillColor('lightblue@0.5');
+$graph->Add($p);
+ 
+//$p2 = new PolarPlot($data2);
+//$p2->SetFillColor('red@0.5');
+//$graph->Add($p2);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex0-180.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex0-180.html new file mode 100644 index 0000000..dc7fbea --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex0-180.html @@ -0,0 +1,54 @@ +
polarex0-180.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph, example 0
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex0.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex0.html new file mode 100644 index 0000000..39a87b6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex0.html @@ -0,0 +1,52 @@ +
polarex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph, example 0
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex3-lin.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex3-lin.html new file mode 100644 index 0000000..e9a37c2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex3-lin.html @@ -0,0 +1,66 @@ +
polarex3-lin.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph, example 2
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex3.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex3.html new file mode 100644 index 0000000..cba8d25 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex3.html @@ -0,0 +1,66 @@ +
polarex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph, example 2
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex4.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex4.html new file mode 100644 index 0000000..5536751 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex4.html @@ -0,0 +1,68 @@ +
polarex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph, example 2
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex5.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex5.html new file mode 100644 index 0000000..a8f82e3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex5.html @@ -0,0 +1,74 @@ +
polarex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph, example 2
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex7-1.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex7-1.html new file mode 100644 index 0000000..e3587d5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex7-1.html @@ -0,0 +1,100 @@ +
polarex7-1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph,
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+ 
+$graph = new PolarGraph(300,350);
+$graph->SetScale('log',100);
+$graph->SetType(POLAR_180);
+$graph->SetPlotSize(220,250);
+ 
+// Hide frame around graph (by setting width=0)
+$graph->SetFrame(true,'white',1);
+ 
+$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_HOR,BGRAD_PLOT);
+ 
+// Set color for gradient lines
+$graph->axis->SetGridColor('gray','gray','gray');
+ 
+// Setup axis title
+$graph->axis->SetTitle('Coverage (in meter)','middle');
+$graph->axis->title->SetFont(FF_FONT1,FS_BOLD);
+ 
+$graph->title->Set('Polar plot #7');
+$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('lightblue@0.5');
+$p->mark->SetType(MARK_SQUARE);
+$p->SetLegend("Mirophone #1\n(No amps)");
+ 
+$graph->Add($p);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex7-2.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex7-2.html new file mode 100644 index 0000000..11943af --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex7-2.html @@ -0,0 +1,106 @@ +
polarex7-2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph,
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/polarex9.html b/includes/jpgraph/docs/chunkhtml/example_src/polarex9.html new file mode 100644 index 0000000..1c8564a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/polarex9.html @@ -0,0 +1,126 @@ +
polarex9.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
<?php // content="text/plain; charset=utf-8"
+// A simple Polar graph,
+ 
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/prepaccdata_example.html b/includes/jpgraph/docs/chunkhtml/example_src/prepaccdata_example.html new file mode 100644 index 0000000..5361e6e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/prepaccdata_example.html @@ -0,0 +1,122 @@ +
prepaccdata_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
<?php // content="text/plain; charset=utf-8"
+require_once ('../jpgraph.php');
+require_once ('../jpgraph_line.php');
+require_once ('../jpgraph_date.php');
+ 
+//Create some test data
+$xdata = array();
+$ydata = array();
+ 
+// Timestamps - 2h (=7200s) apart starting 
+$sampling = 7200;
+$n = 50; // data points
+for($i=0; $i < $n; ++$i ) {
+    $xdata[$i] = time() + $i * $sampling;
+    $ydata[0][$i] = rand(12,15);
+    $ydata[1][$i] = rand(100,155);
+    $ydata[2][$i] = rand(20,30);
+}
+ 
+function formatDate(&$aVal) {
+    $aVal = date('Y-m-d H:i',$aVal);
+}
+ 
+// Apply this format to all time values in the data to prepare it to be display
+array_walk($xdata,'formatDate');
+ 
+// Create the graph. 
+$graph  = new Graph(600, 350);
+$graph->title->Set('Accumulated values with specified X-axis scale');
+$graph->SetScale('textlin');
+ 
+// Setup margin color
+$graph->SetMarginColor('green@0.95');
+ 
+// Adjust the margin to make room for the X-labels
+$graph->SetMargin(40,30,40,120);
+ 
+// Turn the tick marks out from the plot area
+$graph->xaxis->SetTickSide(SIDE_BOTTOM);
+$graph->yaxis->SetTickSide(SIDE_LEFT);
+ 
+$p0 =new LinePlot($ydata[0]);
+$p0->SetFillColor('sandybrown');
+$p1 =new LinePlot($ydata[1]);
+$p1->SetFillColor('lightblue');
+$p2 =new LinePlot($ydata[2]);
+$p2->SetFillColor('red');
+$ap = new AccLinePlot(array($p0,$p1,$p2));
+ 
+$graph->xaxis->SetTickLabels($xdata);
+$graph->xaxis->SetTextLabelInterval(4);
+ 
+// Add the plot to the graph
+$graph->Add($ap);
+ 
+// Set the angle for the labels to 90 degrees
+$graph->xaxis->SetLabelAngle(90);
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/pushpinex1.html b/includes/jpgraph/docs/chunkhtml/example_src/pushpinex1.html new file mode 100644 index 0000000..61f2f18 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/pushpinex1.html @@ -0,0 +1,120 @@ +
pushpinex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+DEFINE('WORLDMAP','worldmap1.jpg');
+ 
+function markCallback($y,$x) {
+    // Return array width
+    // width,color,fill color, marker filename, imgscale
+    // any value can be false, in that case the default value will
+    // be used.
+    // We only make one pushpin another color
+    if( $x == 54 ) 
+    return array(false,false,false,'red',0.8);
+    else
+    return array(false,false,false,'green',0.8);
+}
+ 
+// Data arrays
+$datax = array(10,20,30,40,54,60,70,80);
+$datay = array(12,23,65,18,84,28,86,44);
+ 
+// Setup the graph
+$graph = new Graph(400,270);
+ 
+// We add a small 1pixel left,right,bottom margin so the plot area
+// doesn't cover the frame around the graph.
+$graph->img->SetMargin(1,1,1,1);
+$graph->SetScale('linlin',0,100,0,100);
+ 
+// We don't want any axis to be shown
+$graph->xaxis->Hide();
+$graph->yaxis->Hide();
+ 
+// Use a worldmap as the background and let it fill the plot area
+$graph->SetBackgroundImage(WORLDMAP,BGIMG_FILLPLOT);
+ 
+// Setup a nice title with a striped bevel background
+$graph->title->Set("Pushpin graph");
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
+$graph->title->SetColor('white');
+$graph->SetTitleBackground('darkgreen',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL);
+$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'blue','darkgreen');
+ 
+// Finally create the scatterplot
+$sp = new ScatterPlot($datay,$datax);
+ 
+// We want the markers to be an image
+$sp->mark->SetType(MARK_IMG_PUSHPIN,'blue',0.6);
+ 
+// Install the Y-X callback for the markers
+$sp->mark->SetCallbackYX('markCallback');
+ 
+// ...  and add it to the graph
+$graph->Add($sp);    
+ 
+// .. and output to browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qr_template.html b/includes/jpgraph/docs/chunkhtml/example_src/qr_template.html new file mode 100644 index 0000000..280c923 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qr_template.html @@ -0,0 +1,64 @@ +
qr_template.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data         = 'ABCDEFGH01234567';
+ 
+// QR Code specification
+$version      = -1;                  // -1 = Let the library decide version (same as default)
+$corrlevel    = QRCapacity::ErrM;   // Medium erro correction
+$modulewidth  = 2;                    // Module width
+$back         = BACKEND_IMAGE;        // Default backend
+$quiet          = 4;                     // Same as default value
+ 
+// Create encoder and backend
+$encoder = new QREncoder($version, $corrlevel);
+$backend = QRCodeBackendFactory::Create($encoder, $back);
+ 
+// Set the module size
+$backend->SetModuleWidth($modulewidth);
+ 
+// Set Quiet zone (this should rarely need changing from the default)
+$backend->SetQuietZone($quiet);
+ 
+if( $back == BACKEND_IMAGE ) {
+ 
+    $backend->Stroke($data);
+}
+else {
+    $str = $backend->Stroke($data);
+    echo '<pre>'.$str.'</pre>';
+}
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample0.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample0.html new file mode 100644 index 0000000..dbc3a16 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample0.html @@ -0,0 +1,46 @@ +
qrexample0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data = '01234567';
+ 
+// Create a new instance of the encoder and let the library
+// decide a suitable QR version and error level
+$encoder = new QREncoder(1);
+ 
+// Use the image backend (this is also the default)
+$backend = QRCodeBackendFactory::Create($encoder);
+ 
+try {
+    //     . send the QR Code back to the browser
+    $backend->Stroke($data);
+} catch (Exception $e) {
+    $errstr = $e->GetMessage();
+    echo 'QR Code error: '.$e->GetMessage()."\n";
+    exit(1);
+}
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample00.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample00.html new file mode 100644 index 0000000..fe62f46 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample00.html @@ -0,0 +1,32 @@ +
qrexample00.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data = '01234567';
+ 
+// Create a new instance of the encoder and let the library
+// decide a suitable QR version and error level
+$e=new QREncoder();
+ 
+// Use the image backend (this is also the default)
+$b=QRCodeBackendFactory::Create($e);
+ 
+// .. send the barcode back to the browser for the data
+$b->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample01.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample01.html new file mode 100644 index 0000000..e31be6d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample01.html @@ -0,0 +1,38 @@ +
qrexample01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?php
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Data to be encoded
+$data = '01234567';
+ 
+// Create a new instance of the encoder and let the library
+// decide a suitable QR version and error level
+$encoder = new QREncoder();
+ 
+// Use the image backend
+$backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+// Set the module size (quite big)
+$backend->SetModuleWidth(5);
+ 
+// .. send the barcode back to the browser for the data
+$backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample03.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample03.html new file mode 100644 index 0000000..150a8d0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample03.html @@ -0,0 +1,54 @@ +
qrexample03.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php
+    // Example 3 : QR Barcode with specified version and stored to a file
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    $data = '01234567';
+    $version = 3;  // Use QR version 3
+    $fileName = 'qrexample03.png';
+ 
+    // Create a new instance of the encoder and let the library
+    // decide a suitable error level
+    $encoder = new QREncoder($version);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size (quite big)
+    $backend->SetModuleWidth(5);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data,$fileName);
+    list($version,$errorcorrection) = $backend->GetQRInfo();
+ 
+    echo "QR Barcode, (<b>Version: $version-$errorcorrection</b>), image stored in file $fileName";
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample04.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample04.html new file mode 100644 index 0000000..1dee5ab --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample04.html @@ -0,0 +1,48 @@ +
qrexample04.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php
+    // Example 4 : QR Barcode with specified version and error correction level
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    $data = '01234567';
+    $version = 12;  // Use QR version 4
+    $corrlevel = QRCapacity::ErrH ; // Level H error correction (the highest possible)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(3);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample05.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample05.html new file mode 100644 index 0000000..1f176b2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample05.html @@ -0,0 +1,58 @@ +
qrexample05.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php
+    // Example 5 : QR Barcode with manually specified encodation
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    // We want the data to be encoded using alphanumeric encoding even though
+    // it is only numbers
+    $data = array(
+        array(QREncoder::MODE_ALPHANUM,'01234567')
+    );
+ 
+    $version = 3;  // Use QR version 3
+    $corrlevel = QRCapacity::ErrH ; // Level H error correction (the highest possible)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(4);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample06.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample06.html new file mode 100644 index 0000000..99cc83d --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample06.html @@ -0,0 +1,52 @@ +
qrexample06.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+    // Example 6 : QR Barcode with image in JPG format
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $data      = 'ABCDEFGH01234567'; // Data to be encoded
+    $version   = -1;  // -1 = Let the library decide version (same as default)
+    $corrlevel = -1; // -1 = Let the library decide error correction level (same as default)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend=QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Use JPEG format with 80% quality level
+    $backend->SetImgFormat('jpeg',80);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(4);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample07.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample07.html new file mode 100644 index 0000000..f0a7c9a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample07.html @@ -0,0 +1,52 @@ +
qrexample07.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+    // Example 7 : QR Barcode with multiple manually specified encodation schemas
+    // (Note: Normally there would be no need to ever use manually specified encodation)
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    // Data to be encoded
+    $data = array(
+        array(QREncoder::MODE_ALPHANUM,'01234567'),
+        array(QREncoder::MODE_NUMERIC,'89012345')
+    );
+ 
+    // Create a new instance of the encoder (automatically determined QR version and
+    // error correction level)
+    $encoder = new QREncoder();
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(4);
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample08.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample08.html new file mode 100644 index 0000000..5cdb654 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample08.html @@ -0,0 +1,44 @@ +
qrexample08.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php
+    // Example 8 : QR Barcode with data read from file
+ 
+    // Include the library
+    require_once ('jpgraph/jpgraph.php');
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $readFromFilename = 'qr-input.txt';
+ 
+    // Create a new instance of the encoder and let the library
+    // decide a suitable QR version and error level
+    $encoder=new QREncoder();
+ 
+    // Use the image backend
+    $backend=QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size (quite big)
+    $backend->SetModuleWidth(5);
+ 
+    // .. send the barcode back to the browser for the data in the file
+    $backend->StrokeFromFile($readFromFilename);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample09.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample09.html new file mode 100644 index 0000000..3368d1a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample09.html @@ -0,0 +1,50 @@ +
qrexample09.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php
+    // Example 9 : QR Barcode with data read from file and different colors
+ 
+    // Include the library
+    require_once ('jpgraph/jpgraph.php');
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $readFromFilename = 'qr-input.txt';
+ 
+    // Create a new instance of the encoder and let the library
+    // decide a suitable QR version and error level
+    $encoder = new QREncoder();
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size (quite big)
+    $backend->SetModuleWidth(5);
+ 
+    // Use blue and white colors instead
+    $backend->SetColor('navy','white');
+ 
+    // .. send the barcode back to the browser for the data in the file
+    $backend->StrokeFromFile($readFromFilename);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample10.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample10.html new file mode 100644 index 0000000..8e2195f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample10.html @@ -0,0 +1,52 @@ +
qrexample10.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+    // Example 10 : Specified error correction level
+ 
+    // Include the library
+    require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+    $data      = 'ABCDEFGH01234567'; // Data to be encoded
+    $version   = -1;  // -1 = Let the library decide version (same as default)
+    $corrlevel = QRCapacity::ErrH; // Error correction level H (Highest possible)
+ 
+    // Create a new instance of the encoder using the specified
+    // QR version and error correction
+    $encoder = new QREncoder($version,$corrlevel);
+ 
+    // Use the image backend
+    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
+ 
+    // Set the module size
+    $backend->SetModuleWidth(3);
+ 
+    // Set color
+    $backend->SetColor('brown','white');
+ 
+    // Store the barcode in the specifed file
+    $backend->Stroke($data);
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample11.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample11.html new file mode 100644 index 0000000..49b3fde --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample11.html @@ -0,0 +1,52 @@ +
qrexample11.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+// Include the library
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Example 11 : Generate postscript output
+ 
+$data         = 'ABCDEFGH01234567'; // Data to be encoded
+$version      = -1;  // -1 = Let the library decide version (same as default)
+$corrlevel    = QRCapacity::ErrH; // Error correction level H (Highest possible)
+$modulewidth  = 3;
+ 
+// Create a new instance of the encoder using the specified
+// QR version and error correction
+$encoder = new QREncoder($version,$corrlevel);
+ 
+// Use the image backend
+$backend = QRCodeBackendFactory::Create($encoder, BACKEND_PS);
+ 
+// Set the module size
+$backend->SetModuleWidth($modulewidth);
+ 
+// Store the barcode in the specifed file
+$ps_str = $backend->Stroke($data);
+ 
+echo '<pre>'.$ps_str.'</pre>';
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/qrexample12.html b/includes/jpgraph/docs/chunkhtml/example_src/qrexample12.html new file mode 100644 index 0000000..2c81cc9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/qrexample12.html @@ -0,0 +1,52 @@ +
qrexample12.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+// Include the library
+require_once ('jpgraph/QR/qrencoder.inc.php');
+ 
+// Example 11 : Generate postscript output
+ 
+$data         = 'ABCDEFGH01234567'; // Data to be encoded
+$version      = -1;  // -1 = Let the library decide version (same as default)
+$corrlevel    = QRCapacity::ErrH; // Error correction level H (Highest possible)
+$modulewidth  = 1;
+ 
+// Create a new instance of the encoder using the specified
+// QR version and error correction
+$encoder = new QREncoder($version,$corrlevel);
+ 
+// Use the image backend
+$backend = QRCodeBackendFactory::Create($encoder, BACKEND_ASCII);
+ 
+// Set the module size
+$backend->SetModuleWidth($modulewidth);
+ 
+// Store the barcode in the specifed file
+$ps_str = $backend->Stroke($data);
+ 
+echo '<pre>'.$ps_str.'</pre>';
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex1.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex1.html new file mode 100644 index 0000000..3011233 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex1.html @@ -0,0 +1,32 @@ +
radarex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+// Some data to plot
+$data = array(55,80,46,71,95);
+ 
+// Create the graph and the plot
+$graph = new RadarGraph(250,200);
+$plot = new RadarPlot($data);
+ 
+// Add the plot and display the graph
+$graph->Add($plot);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex2.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex2.html new file mode 100644 index 0000000..62529f1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex2.html @@ -0,0 +1,42 @@ +
radarex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+ 
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex4.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex4.html new file mode 100644 index 0000000..caf41b3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex4.html @@ -0,0 +1,56 @@ +
radarex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+ 
+// Add a drop shadow to the graph
+$graph->SetShadow();
+ 
+// Create the titles for the axis
+$titles = $gDateLocale->GetShortMonth();
+$graph->SetTitles($titles);
+ 
+// Add grid lines
+$graph->grid->Show();
+$graph->grid->SetLineStyle('dashed');
+ 
+$plot = new RadarPlot($data);
+$plot->SetFillColor('lightblue');
+ 
+// Add the plot and display the graph
+$graph->Add($plot);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex6.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex6.html new file mode 100644 index 0000000..7a37867 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex6.html @@ -0,0 +1,70 @@ +
radarex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+ 
+// 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.45,0.5);
+ 
+// Add grid lines
+$graph->grid->Show();
+$graph->grid->SetColor('darkred');
+$graph->grid->SetLineStyle('dashed');
+ 
+$plot = new RadarPlot($data);
+$plot->SetFillColor('lightblue');
+$plot->SetLegend("QA results");
+ 
+// Add the plot and display the graph
+$graph->Add($plot);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex7.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex7.html new file mode 100644 index 0000000..96aef27 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex7.html @@ -0,0 +1,96 @@ +
radarex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+// Create the basic rtadar graph
+$graph = new RadarGraph(300,200);
+ 
+// 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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex8.1.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex8.1.html new file mode 100644 index 0000000..53af9ce --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex8.1.html @@ -0,0 +1,104 @@ +
radarex8.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+// Create the basic radar graph
+$graph = new RadarGraph(300,200);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarex8.html b/includes/jpgraph/docs/chunkhtml/example_src/radarex8.html new file mode 100644 index 0000000..8900dee --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarex8.html @@ -0,0 +1,102 @@ +
radarex8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+// Create the basic radar graph
+$graph = new RadarGraph(300,200);
+//$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarlogex1-aa.html b/includes/jpgraph/docs/chunkhtml/example_src/radarlogex1-aa.html new file mode 100644 index 0000000..e0ea16c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarlogex1-aa.html @@ -0,0 +1,118 @@ +
radarlogex1-aa.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+// Some data to plot
+$data = array(242,58,1500,12,1397,810,373);
+$data2 = array(447,176,1472,191,1616,42,46);
+ 
+// Create the graph
+$graph = new RadarGraph(300,350);
+ 
+// Use logarithmic scale (If you don't use any SetScale()
+// the radar graph will default to linear scale
+$graph->SetScale('log');
+ 
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
+$graph->title->Set('Logarithmic scale');
+$graph->title->SetMargin(10);
+ 
+// Make the radar graph fill out it's bounding box
+$graph->SetPlotSize(0.8);
+$graph->SetCenter(0.5,0.55);
+ 
+// Note: Enabling this results in a very noticable slow
+// down of the image generation! And more load on your
+// server.
+$graph->img->SetAntiAliasing();
+ 
+// Uncomment the following line if you want to supress
+// minor tick marks
+//$graph->yscale->ticks->SupressMinorTickMarks();
+ 
+// We want the major tick marks to be black and minor
+// slightly less noticable
+$graph->yscale->ticks->SetMarkColor('black','darkgray');
+ 
+// Set the axis title font
+$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->axis->title->SetColor('darkred:0.8');
+ 
+// Use blue axis
+$graph->axis->SetColor('blue');
+ 
+$plot = new RadarPlot($data);
+$plot->SetLineWeight(1);
+$plot->SetColor('forestgreen');
+$plot->SetFillColor('forestgreen@0.9');
+ 
+$plot2 = new RadarPlot($data2);
+$plot2->SetLineWeight(2);
+$plot2->SetColor('red');
+$plot2->SetFillColor('red@0.9');
+ 
+// Add the plot and display the graph
+$graph->Add($plot);
+$graph->Add($plot2);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarlogex1.html b/includes/jpgraph/docs/chunkhtml/example_src/radarlogex1.html new file mode 100644 index 0000000..203fa03 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarlogex1.html @@ -0,0 +1,108 @@ +
radarlogex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_log.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+// Some data to plot
+$data = array(242,58,1500,12,1397,810,373);
+$data2 = array(447,176,1472,191,1616,42,46);
+ 
+// Create the graph
+$graph = new RadarGraph(300,350);
+ 
+// Use logarithmic scale (If you don't use any SetScale()
+// the radar graph will default to linear scale
+$graph->SetScale('log');
+ 
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
+$graph->title->Set('Logarithmic scale');
+$graph->title->SetMargin(10);
+ 
+// Make the radar graph fill out it's bounding box
+$graph->SetPlotSize(0.8);
+$graph->SetCenter(0.5,0.55);
+ 
+// Uncomment the following line if you want to supress
+// minor tick marks
+//$graph->yscale->ticks->SupressMinorTickMarks();
+ 
+// We want the major tick marks to be black and minor
+// slightly less noticable
+$graph->yscale->ticks->SetMarkColor('black','darkgray');
+ 
+// Set the axis title font
+$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->axis->title->SetColor('darkred:0.8');
+ 
+// Use blue axis
+$graph->axis->SetColor('blue');
+ 
+$plot = new RadarPlot($data);
+$plot->SetLineWeight(1);
+$plot->SetColor('forestgreen');
+$plot->SetFillColor('forestgreen@0.9');
+ 
+$plot2 = new RadarPlot($data2);
+$plot2->SetLineWeight(2);
+$plot2->SetColor('red');
+$plot2->SetFillColor('red@0.9');
+ 
+// Add the plot and display the graph
+$graph->Add($plot);
+$graph->Add($plot2);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/radarmarkex1.html b/includes/jpgraph/docs/chunkhtml/example_src/radarmarkex1.html new file mode 100644 index 0000000..91a27fa --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/radarmarkex1.html @@ -0,0 +1,70 @@ +
radarmarkex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_radar.php');
+ 
+$titles=array('Planning','Quality','Time','RR','CR','DR');
+$data=array(18, 40, 70, 90, 42,66);
+ 
+$graph = new RadarGraph (300,280);
+ 
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rose_example.html b/includes/jpgraph/docs/chunkhtml/example_src/rose_example.html new file mode 100644 index 0000000..ce2ef56 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rose_example.html @@ -0,0 +1,114 @@ +
rose_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new RoseTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "RoseTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rotex0.html b/includes/jpgraph/docs/chunkhtml/example_src/rotex0.html new file mode 100644 index 0000000..73f4845 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rotex0.html @@ -0,0 +1,40 @@ +
rotex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rotex1.html b/includes/jpgraph/docs/chunkhtml/example_src/rotex1.html new file mode 100644 index 0000000..4d2c3d5 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rotex1.html @@ -0,0 +1,44 @@ +
rotex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rotex2.html b/includes/jpgraph/docs/chunkhtml/example_src/rotex2.html new file mode 100644 index 0000000..da5cc82 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rotex2.html @@ -0,0 +1,44 @@ +
rotex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rotex3.html b/includes/jpgraph/docs/chunkhtml/example_src/rotex3.html new file mode 100644 index 0000000..fe37f00 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rotex3.html @@ -0,0 +1,46 @@ +
rotex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rotex4.html b/includes/jpgraph/docs/chunkhtml/example_src/rotex4.html new file mode 100644 index 0000000..795348a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rotex4.html @@ -0,0 +1,46 @@ +
rotex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/rotex5.html b/includes/jpgraph/docs/chunkhtml/example_src/rotex5.html new file mode 100644 index 0000000..c711442 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/rotex5.html @@ -0,0 +1,46 @@ +
rotex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/scatterex1.html b/includes/jpgraph/docs/chunkhtml/example_src/scatterex1.html new file mode 100644 index 0000000..d99a75e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/scatterex1.html @@ -0,0 +1,44 @@ +
scatterex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/scatterex2.html b/includes/jpgraph/docs/chunkhtml/example_src/scatterex2.html new file mode 100644 index 0000000..a57f83c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/scatterex2.html @@ -0,0 +1,50 @@ +
scatterex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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);
+$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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/scatterlinkex3.html b/includes/jpgraph/docs/chunkhtml/example_src/scatterlinkex3.html new file mode 100644 index 0000000..c2a7205 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/scatterlinkex3.html @@ -0,0 +1,86 @@ +
scatterlinkex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+ 
+// Make a circle with a scatterplot
+$steps=16;
+for($i=0; $i<$steps; ++$i) {
+    $a=2*M_PI/$steps*$i;
+    $datax[$i]=cos($a);
+    $datay[$i]=sin($a);
+}
+ 
+$graph = new Graph(350,230);
+$graph->SetScale('linlin');
+$graph->SetShadow();
+$graph->SetAxisStyle(AXSTYLE_BOXOUT);
+ 
+$graph->img->SetMargin(50,50,60,40);
+ 
+$graph->title->Set('Linked scatter plot');
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->subtitle->Set('(BOXOUT Axis style)');
+$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL);
+ 
+ 
+// 10% top and bottom grace
+$graph->yscale->SetGrace(5,5);
+$graph->xscale->SetGrace(1,1);
+ 
+$sp1 = new ScatterPlot($datay,$datax);
+$sp1->mark->SetType(MARK_FILLEDCIRCLE);
+$sp1->mark->SetFillColor('red');
+$sp1->SetColor('blue');
+ 
+$sp1->mark->SetWidth(4);
+$sp1->link->Show();
+$sp1->link->SetStyle('dotted');
+ 
+$graph->Add($sp1);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/scatterlinkex4.html b/includes/jpgraph/docs/chunkhtml/example_src/scatterlinkex4.html new file mode 100644 index 0000000..8f0bc06 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/scatterlinkex4.html @@ -0,0 +1,86 @@ +
scatterlinkex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+ 
+// Make a circle with a scatterplot
+$steps=16;
+for($i=0; $i<$steps; ++$i) {
+    $a=2*M_PI/$steps*$i;
+    $datax[$i]=cos($a);
+    $datay[$i]=sin($a);
+}
+ 
+$graph = new Graph(350,230);
+$graph->SetScale('linlin');
+$graph->SetShadow();
+$graph->SetAxisStyle(AXSTYLE_BOXIN);
+ 
+$graph->img->SetMargin(50,50,60,40);
+ 
+$graph->title->Set('Linked scatter plot');
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->subtitle->Set('(BOXIN Axis style)');
+$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL);
+ 
+// 10% top and bottom grace
+$graph->yscale->SetGrace(5,5);
+$graph->xscale->SetGrace(1,1);
+ 
+$sp1 = new ScatterPlot($datay,$datax);
+$sp1->mark->SetType(MARK_FILLEDCIRCLE);
+$sp1->mark->SetFillColor('red');
+$sp1->SetColor('blue');
+ 
+$sp1->mark->SetWidth(4);
+$sp1->link->Show();
+$sp1->link->SetWeight(2);
+$sp1->link->SetColor('red@0.7');
+ 
+ 
+$graph->Add($sp1);
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex1.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex1.html new file mode 100644 index 0000000..d70ef0c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex1.html @@ -0,0 +1,82 @@ +
smallstaticbandsex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex1.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_RDIAG');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex10.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex10.html new file mode 100644 index 0000000..a7d1c37 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex10.html @@ -0,0 +1,82 @@ +
smallstaticbandsex10.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex10.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_DIAGCROSS');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex2.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex2.html new file mode 100644 index 0000000..bf2cef1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex2.html @@ -0,0 +1,82 @@ +
smallstaticbandsex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex2.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_LDIAG');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex3.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex3.html new file mode 100644 index 0000000..f1d9ab1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex3.html @@ -0,0 +1,82 @@ +
smallstaticbandsex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex3.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_SOLID');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex4.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex4.html new file mode 100644 index 0000000..ded48d7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex4.html @@ -0,0 +1,84 @@ +
smallstaticbandsex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex4.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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(80);
+$band->ShowFrame(true);
+$graph->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_3DPLANE, Density=60');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex5.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex5.html new file mode 100644 index 0000000..8ac5186 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex5.html @@ -0,0 +1,84 @@ +
smallstaticbandsex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex5.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_HVCROSS, In front');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex6.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex6.html new file mode 100644 index 0000000..835aa30 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex6.html @@ -0,0 +1,82 @@ +
smallstaticbandsex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex6.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_VLINE');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex7.html b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex7.html new file mode 100644 index 0000000..b38635a --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/smallstaticbandsex7.html @@ -0,0 +1,82 @@ +
smallstaticbandsex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php // content="text/plain; charset=utf-8"
+// Illustration of the different patterns for bands
+// $Id: smallstaticbandsex7.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$datay=array(10,29,3,6);
+ 
+// Create the graph. 
+$graph = new Graph(200,150);    
+$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->Add($band);
+ 
+// Set title
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->title->SetColor('darkred');
+$graph->title->Set('BAND_HLINE');
+ 
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/softy_example.html b/includes/jpgraph/docs/chunkhtml/example_src/softy_example.html new file mode 100644 index 0000000..8e82c24 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/softy_example.html @@ -0,0 +1,116 @@ +
softy_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new SoftyTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "SoftyTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/splineex1.html b/includes/jpgraph/docs/chunkhtml/example_src/splineex1.html new file mode 100644 index 0000000..fcbdced --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/splineex1.html @@ -0,0 +1,110 @@ +
splineex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_scatter.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/staticbandbarex7.html b/includes/jpgraph/docs/chunkhtml/example_src/staticbandbarex7.html new file mode 100644 index 0000000..66c2dc3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/staticbandbarex7.html @@ -0,0 +1,124 @@ +
staticbandbarex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_plotline.php');
+ 
+$datay=array(12,5,19,22,17,6);
+ 
+// Create the graph. 
+$graph = new Graph(400,300);    
+$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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/stockex1.html b/includes/jpgraph/docs/chunkhtml/example_src/stockex1.html new file mode 100644 index 0000000..d829be3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/stockex1.html @@ -0,0 +1,66 @@ +
stockex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php // content="text/plain; charset=utf-8"
+// Example of a stock chart
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex1.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex1.html new file mode 100644 index 0000000..da79054 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex1.html @@ -0,0 +1,102 @@ +
sunspotsex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex2.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex2.html new file mode 100644 index 0000000..bca4f75 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex2.html @@ -0,0 +1,104 @@ +
sunspotsex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetFillColor('orange@0.5');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex3.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex3.html new file mode 100644 index 0000000..1478656 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex3.html @@ -0,0 +1,106 @@ +
sunspotsex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+$graph->xaxis->SetTickLabels($year);
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetFillColor('orange@0.5');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex4.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex4.html new file mode 100644 index 0000000..837dea2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex4.html @@ -0,0 +1,106 @@ +
sunspotsex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint',0,0,0,max($year)-min($year)+1);
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+$graph->xaxis->SetTickLabels($year);
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetFillColor('orange@0.5');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex5.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex5.html new file mode 100644 index 0000000..efec7b8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex5.html @@ -0,0 +1,114 @@ +
sunspotsex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+function year_callback($aLabel) {
+    return 1700+(int)$aLabel;
+}
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+$graph->xaxis->SetLabelFormatCallback('year_callback');
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the linear plot
+$lineplot=new LinePlot($ydata);
+$lineplot->SetFillColor('orange@0.5');
+ 
+// Add the plot to the graph
+$graph->Add($lineplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex6.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex6.html new file mode 100644 index 0000000..808ab49 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex6.html @@ -0,0 +1,104 @@ +
sunspotsex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+ 
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// int = integer scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('intint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year from 1701)');
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the bar plot
+$barplot=new BarPlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($barplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex7.html b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex7.html new file mode 100644 index 0000000..2a0a942 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/sunspotsex7.html @@ -0,0 +1,112 @@ +
sunspotsex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+function readsunspotdata($aFile, &$aYears, &$aSunspots) {
+    $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
+    if( $lines === false ) {
+        throw new JpGraphException('Can not read sunspot data file.');
+    }
+    foreach( $lines as $line => $datarow ) {
+        $split = preg_split('/[\s]+/',$datarow);
+        $aYears[] = substr(trim($split[0]),0,4);
+        $aSunspots[] = trim($split[1]);
+    }
+}
+ 
+$year = array();
+$ydata = array();
+readsunspotdata('yearssn.txt',$year,$ydata);
+ 
+// Just keep the last 20 values in the arrays
+$year = array_slice($year, -20);
+$ydata = array_slice($ydata, -20);
+ 
+ // Width and height of the graph
+$width = 600; $height = 200;
+ 
+// Create a graph instance
+$graph = new Graph($width,$height);
+ 
+// Specify what scale we want to use,
+// text = txt scale for the X-axis
+// int = integer scale for the Y-axis
+$graph->SetScale('textint');
+ 
+// Setup a title for the graph
+$graph->title->Set('Sunspot example');
+ 
+// Setup titles and X-axis labels
+$graph->xaxis->title->Set('(year)');
+$graph->xaxis->SetTickLabels($year);
+ 
+// Setup Y-axis title
+$graph->yaxis->title->Set('(# sunspots)');
+ 
+// Create the bar plot
+$barplot=new BarPlot($ydata);
+ 
+// Add the plot to the graph
+$graph->Add($barplot);
+ 
+// Display the graph
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_flagex1.html b/includes/jpgraph/docs/chunkhtml/example_src/table_flagex1.html new file mode 100644 index 0000000..b1e7628 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_flagex1.html @@ -0,0 +1,138 @@ +
table_flagex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+
<?php
+include '../jpgraph.php';
+include '../jpgraph_canvas.php';
+include '../jpgraph_table.php';
+include '../jpgraph_iconplot.php';
+include '../jpgraph_flags.php';
+ 
+// Setup a basic canvas to use as graph to add the table
+$graph = new CanvasGraph(500,200);
+ 
+// Setup the basic table
+$data = array(
+    array('Areas'),
+    array(''),
+    array('','USA','UK','France','Denmark','Iceland','Canada'),
+    array('Feb',13,17,15,8,3,9),
+    array('Mar',34,35,26,20,22,16),
+    array('Apr',41,43,49,45,51,47),
+    array('Sum:',88,95,90,73,76,72));
+ 
+$countries = array('united states','united kingdom','french republic','denmark','iceland','canada');
+ 
+// Create a basic table and default fonr
+$table = new GTextTable();
+$table->Set($data);
+$table->SetFont(FF_TIMES,FS_NORMAL,11);
+ 
+// Adjust the font for row 0 and 6
+$table->SetColFont(0,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFont(6,FF_TIMES,FS_BOLD,12);
+ 
+// Set the minimum heigth/width
+$table->SetMinRowHeight(2,10);
+$table->SetMinColWidth(70);
+ 
+// Add some padding (in pixels)
+$table->SetRowPadding(2,0);
+$table->SetRowGrid(6,1,'darkgray',TGRID_DOUBLE2);
+ 
+// Setup the grid
+$table->SetGrid(0);
+$table->SetRowGrid(6,1,'black',TGRID_DOUBLE2);
+ 
+// Merge all cells in row 0
+$table->MergeRow(0);
+ 
+// Set aligns
+$table->SetAlign(3,0,6,6,'right');
+$table->SetRowAlign(1,'center');
+$table->SetRowAlign(2,'center');
+ 
+// Set background colors
+$table->SetRowFillColor(0,'lightgray@0.5');
+$table->SetColFillColor(0,'lightgray@0.5');
+ 
+// Add the country flags in row 1
+$n = count($countries);
+for($i=0; $i < $n; ++$i ) {
+    $table->SetCellCountryFlag(1,$i+1,$countries[$i],0.5);
+    $table->SetCellImageConstrain(1,$i+1,TIMG_HEIGHT,20);
+}
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// Send back the table graph to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto1.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto1.html new file mode 100644 index 0000000..d0fa5fe --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto1.html @@ -0,0 +1,40 @@ +
table_howto1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(70,50);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// ... and send back the table to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto2.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto2.html new file mode 100644 index 0000000..8473ad7 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto2.html @@ -0,0 +1,48 @@ +
table_howto2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(70,50);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Merge all cellsn in the rectangle with
+// top left corner = (0,2) and bottom right = (1,3)
+$table->MergeCells(0,2,1,3);
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// ... and send back the table to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto3.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto3.html new file mode 100644 index 0000000..8404611 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto3.html @@ -0,0 +1,46 @@ +
table_howto3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(70,50);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Merge all cells in row 0
+$table->MergeRow(0);
+ 
+// Add table to graph
+$graph->Add($table);
+ 
+// ... and send back the table to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto4.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto4.html new file mode 100644 index 0000000..50c92a6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto4.html @@ -0,0 +1,54 @@ +
table_howto4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(70,50);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Merge all cells in row 0
+$table->MergeRow(0);
+ 
+// Set foreground and background color
+$table->SetCellFillColor(0,0,'orange@0.7');
+$table->SetCellColor(0,0,'darkred');
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// and send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto5.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto5.html new file mode 100644 index 0000000..4f30322 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto5.html @@ -0,0 +1,58 @@ +
table_howto5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(70,60);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Merge all cells in row 0
+$table->MergeRow(0);
+ 
+// Adjust font in cell (0,0)
+$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14);
+ 
+// Set left align for all cells in rectangle (0,0) - (0,3)
+$table->SetAlign(0,0,0,3,'Left');
+ 
+// Add table to graph
+$graph->Add($table);
+ 
+// ... send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto6.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto6.html new file mode 100644 index 0000000..f0aa3dd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto6.html @@ -0,0 +1,62 @@ +
table_howto6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(150,60);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Merge all cells in row 0
+$table->MergeRow(0);
+ 
+// Setup font and color
+$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14);
+$table->SetRowFillColor(0,'orange@0.5');
+$table->SetRowColor(0,'darkred');
+ 
+// Setup the minimum width of all columns
+$table->SetMinColWidth(35);
+ 
+// Add table to the graph
+$graph->Add($table);
+ 
+// ... send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto7.1.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto7.1.html new file mode 100644 index 0000000..d98a48e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto7.1.html @@ -0,0 +1,66 @@ +
table_howto7.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(150,90);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8), array(6,8,10,12));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Set default font in entire table
+$table->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Setup font and color for row = 2
+$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFillColor(2,'orange@0.5');
+ 
+// Setup minimum color width
+$table->SetMinColWidth(35);
+ 
+// Setup grid on row 2
+$table->SetRowGrid(2,1,'black',TGRID_DOUBLE);
+ 
+// Add table to the graph
+$graph->Add($table);
+ 
+// and send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto7.2.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto7.2.html new file mode 100644 index 0000000..c99e40b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto7.2.html @@ -0,0 +1,66 @@ +
table_howto7.2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(150,90);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8), array(6,8,10,12));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Set default font in entire table
+$table->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Setup font and color for row = 2
+$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFillColor(2,'orange@0.5');
+ 
+// Setup minimum color width
+$table->SetMinColWidth(35);
+ 
+// Setup grid on row 2
+$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2);
+ 
+// Add table to the graph
+$graph->Add($table);
+ 
+// and send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto8.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto8.html new file mode 100644 index 0000000..24c4b1f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto8.html @@ -0,0 +1,84 @@ +
table_howto8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Create a canvas graph where the table can be added
+$graph = new CanvasGraph(150,90);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8), array(6,8,10,12));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Setup overall table font
+$table->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Setup font and color for row = 2
+$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFillColor(2,'orange@0.5');
+ 
+// Setup minimum color width
+$table->SetMinColWidth(35);
+ 
+// Setup overall cell alignment for the table
+$table->SetAlign('right');
+ 
+// Setup overall table border
+$table->SetBorder(0,'black');
+ 
+// Setup overall table grid
+$table->setGrid(0,'black');
+ 
+// Set specific frid for row = 2
+$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2);
+ 
+// Add the table to the graph
+$graph->Add($table);
+ 
+// and send it back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_howto9.html b/includes/jpgraph/docs/chunkhtml/example_src/table_howto9.html new file mode 100644 index 0000000..ddaa8dc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_howto9.html @@ -0,0 +1,90 @@ +
table_howto9.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Setup graph context
+$graph = new CanvasGraph(165,90);
+ 
+// Setup the basic table
+$data = array( array(1,2,3,4),array(5,6,7,8), array(6,8,10,12));
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Setup overall table font
+$table->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Setup font and color for row = 2
+$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFillColor(2,'orange@0.5');
+ 
+// Setup minimum color width
+$table->SetMinColWidth(40);
+ 
+// Setup overall cell alignment for the table
+$table->SetAlign('right');
+ 
+// Setup overall table border
+$table->SetBorder(0,'black');
+ 
+// Setup overall table grid
+$table->setGrid(0,'black');
+ 
+// Set specific frid for row = 2
+$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2);
+ 
+// Setup overall number format in all cells
+$table->SetNumberFormat("%0.1f");
+ 
+// Add table to the graph
+$graph->Add($table);
+ 
+// and send it back to the browser
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_iconex1.html b/includes/jpgraph/docs/chunkhtml/example_src/table_iconex1.html new file mode 100644 index 0000000..bd257f1 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_iconex1.html @@ -0,0 +1 @@ +001: Cannot read souce file: /root/jpgraph/trunk/src/Examples/table_iconex1.php diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_mex0.html b/includes/jpgraph/docs/chunkhtml/example_src/table_mex0.html new file mode 100644 index 0000000..8fd9921 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_mex0.html @@ -0,0 +1,98 @@ +
table_mex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Setup graph context
+$graph = new CanvasGraph(430,150);
+ 
+// Setup the basic table
+$data = array(
+    array('',        'w631','w632','w633','w634','w635','w636'),
+    array('Critical (sum)',13,17,15,8,3,9),
+    array('High (sum)',34,35,26,20,22,16),
+    array('Low (sum)',41,43,49,45,51,47),
+    array('Sum:',88,95,90,73,76,72)
+    );
+ 
+// Setup a basic table
+$table = new GTextTable();
+$table->Set($data);
+ 
+// Setup fonts
+$table->SetFont(FF_TIMES,FS_NORMAL,11);
+$table->SetColFont(0,FF_ARIAL,FS_NORMAL,11);
+$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,11);
+$table->SetRowFont(4,FF_TIMES,FS_BOLD,14);
+ 
+// Turn off the grid
+$table->SetGrid(0);
+ 
+// Setup color
+$table->SetRowFillColor(0,'lightgray@0.5');
+$table->SetRowFillColor(4,'lightgray@0.5');
+$table->SetColFillColor(0,'lightgray@0.5');
+$table->SetFillColor(0,0,4,0,'lightgray@0.5');
+ 
+// Set default minimum column width
+$table->SetMinColWidth(45);
+ 
+// Set default table alignment
+$table->SetAlign('right');
+ 
+// Add table to the graph
+$graph->Add($table);
+ 
+// and send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_mex00.html b/includes/jpgraph/docs/chunkhtml/example_src/table_mex00.html new file mode 100644 index 0000000..c2b5e47 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_mex00.html @@ -0,0 +1,64 @@ +
table_mex00.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Setup graph context
+$graph = new CanvasGraph(430,150);
+ 
+// Setup the basic table
+$data = array(
+    array('',        'w631','w632','w633','w634','w635','w636'),
+    array('Critical (sum)',13,17,15,8,3,9),
+    array('High (sum)',34,35,26,20,22,16),
+    array('Low (sum)',41,43,49,45,51,47),
+    array('Sum:',88,95,90,73,76,72)
+    );
+ 
+// Setup the basic table and font
+$table = new GTextTable();
+$table->Set($data);
+$table->SetFont(FF_TIMES,FS_NORMAL,11);
+ 
+// Set default table alignment
+$table->SetAlign('right');
+ 
+// Add table to graph
+$graph->Add($table);
+ 
+// and send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_mex1.html b/includes/jpgraph/docs/chunkhtml/example_src/table_mex1.html new file mode 100644 index 0000000..d4fba90 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_mex1.html @@ -0,0 +1,110 @@ +
table_mex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Setup graph context
+$graph = new CanvasGraph(430,150);
+ 
+// Setup the basic table
+$data = array(
+    array('', 'w631', 'w632', 'w633', 'w634', 'w635', 'w636'),
+    array('Critical (sum)',13,17,15,8,3,9),
+    array('High (sum)',34,35,26,20,22,16),
+    array('Low (sum)',41,43,49,45,51,47),
+    array('Sum',88,95,90,73,76,72)
+    );
+ 
+// Setup the basic table and font
+$table = new GTextTable();
+$table->Set($data);
+$table->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Setup default column width
+$table->SetMinColWidth(40);
+ 
+// Setup defalt table alignment
+$table->SetAlign('right');
+ 
+// Turn off border
+$table->SetBorder(0);
+ 
+// Turn off grid
+$table->setGrid(0);
+ 
+// Setup font for row 4 and 0
+$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11);
+ 
+// Setup color
+$table->SetRowFillColor(4,'orange@0.5');
+$table->SetFillColor(0,1,0,6,'teal@0.8');
+ 
+ 
+// Setup grids
+$table->SetRowGrid(4,1,'black',TGRID_DOUBLE2);
+$table->SetColGrid(1,1,'black',TGRID_SINGLE);
+$table->SetRowGrid(1,1,'black',TGRID_SINGLE);
+ 
+// Add table to the graph
+$graph->Add($table);
+ 
+// Send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_mex3.html b/includes/jpgraph/docs/chunkhtml/example_src/table_mex3.html new file mode 100644 index 0000000..cde0e94 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_mex3.html @@ -0,0 +1,116 @@ +
table_mex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Setup graph context
+$graph = new CanvasGraph(430,150);
+ 
+// Setup the basic table
+$data = array(
+    array('',        'w631','w632','w633','w634','w635','w636'),
+    array('Critical (sum)',13,17,15,8,3,9),
+    array('High (sum)',34,35,26,20,22,16),
+    array('Low (sum)',41,43,49,45,51,47),
+    array('Sum:',88,95,90,73,76,72),
+    );
+ 
+// Setup the basic table and font
+$table = new GTextTable();
+$table->Set($data);
+$table->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Set default minimum color width
+$table->SetMinColWidth(40);
+ 
+// Set default table alignment
+$table->SetAlign('right');
+ 
+// Turn off grid
+$table->setGrid(0);
+ 
+// Set table border
+$table->SetBorder(2);
+ 
+// Setup font
+$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11);
+$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11);
+$table->SetFont(1,2,1,3,FF_ARIAL,FS_BOLD,11);
+ 
+// Setup grids
+$table->SetRowGrid(4,2,'black',TGRID_SINGLE);
+$table->SetColGrid(1,1,'black',TGRID_SINGLE);
+$table->SetRowGrid(1,1,'black',TGRID_SINGLE);
+ 
+// Setup colors
+$table->SetFillColor(0,1,0,6,'black');
+$table->SetRowColor(0,'white');
+$table->SetRowFillColor(4,'lightgray@0.3');
+$table->SetFillColor(2,0,2,6,'lightgray@0.6');
+$table->SetFillColor(1,2,1,3,'lightred');
+ 
+// Add table to graph
+$graph->Add($table);
+ 
+// Send back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/table_vtext.html b/includes/jpgraph/docs/chunkhtml/example_src/table_vtext.html new file mode 100644 index 0000000..570fc34 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/table_vtext.html @@ -0,0 +1,82 @@ +
table_vtext.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_canvas.php');
+require_once ('jpgraph/jpgraph_table.php');
+ 
+// Setup a basic canvas graph context
+$graph = new CanvasGraph(630,600);
+ 
+// Setup the basic table
+$data = array(
+    array('GROUP 1O',        'w631','w632','w633','w634','w635','w636'),
+    array('Critical (sum)',13,17,15,8,3,9),
+    array('High (sum)',34,35,26,20,22,16),
+    array('Low (sum)',41,43,49,45,51,47),
+    array('Sum:',88,95,90,73,76,72)
+    );
+ 
+// Setup a basic table
+$table = new GTextTable();
+$table->Set($data);
+$table->SetAlign('right');
+$table->SetFont(FF_TIMES,FS_NORMAL,12);
+$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,16);
+ 
+// Rotate the entire table 90 degrees
+$table->SetTextOrientation(90);
+//$table->SetCellTextOrientation(0,0,0);
+ 
+// Setup background color for header column
+$table->SetColFillColor(0,'lightgray');
+ 
+// Set the imnimum row height
+$table->SetMinRowHeight(0,150);
+ 
+// Add table to graph
+$graph->Add($table);
+ 
+// and send it back to the client
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/tablebarex1.html b/includes/jpgraph/docs/chunkhtml/example_src/tablebarex1.html new file mode 100644 index 0000000..1b5eb31 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/tablebarex1.html @@ -0,0 +1,140 @@ +
tablebarex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
<?php
+include ("../jpgraph.php");
+include ("../jpgraph_bar.php");
+include ("../jpgraph_table.php");
+ 
+$datay = array(
+    array('Jan','Feb','Mar','Apr','May','Jun'),
+    array(12,18,19,7,17,6),
+    array(3,5,2,7,5,25),
+    array(6,1.5,2.4,2.1,6.9,12.3))
+;
+ 
+// Some basic defines to specify the shape of the bar+table
+$nbrbar = 6;
+$cellwidth = 50;
+$tableypos = 200;
+$tablexpos = 60;
+$tablewidth = $nbrbar*$cellwidth;
+$rightmargin = 30;
+ 
+// Overall graph size
+$height = 320;
+$width = $tablexpos+$tablewidth+$rightmargin;
+ 
+// Create the basic graph. 
+$graph = new Graph($width,$height);    
+$graph->img->SetMargin($tablexpos,$rightmargin,30,$height-$tableypos);
+$graph->SetScale("textlin");
+$graph->SetMarginColor('white');
+ 
+// Setup titles and fonts
+$graph->title->Set('Bar and table');
+$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14);
+$graph->yaxis->title->Set("Flow");
+$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,12);
+$graph->yaxis->title->SetMargin(10);
+ 
+// Create the bars and the accbar plot
+$bplot = new BarPlot($datay[3]);
+$bplot->SetFillColor("orange");
+$bplot2 = new BarPlot($datay[2]);
+$bplot2->SetFillColor("red");
+$bplot3 = new BarPlot($datay[1]);
+$bplot3->SetFillColor("darkgreen");
+$accbplot = new AccBarPlot(array($bplot,$bplot2,$bplot3));
+$accbplot->value->Show();
+$graph->Add($accbplot);
+ 
+//Setup the table
+$table = new GTextTable();
+$table->Set($datay);
+$table->SetPos($tablexpos,$tableypos+1);
+ 
+// Basic table formatting
+$table->SetFont(FF_ARIAL,FS_NORMAL,10);
+$table->SetAlign('right');
+$table->SetMinColWidth($cellwidth);
+$table->SetNumberFormat('%0.1f');
+ 
+// Format table header row
+$table->SetRowFillColor(0,'teal@0.7');
+$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11);
+$table->SetRowAlign(0,'center');
+ 
+// .. and add it to the graph
+$graph->Add($table);
+ 
+$graph->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/textalignex1.html b/includes/jpgraph/docs/chunkhtml/example_src/textalignex1.html new file mode 100644 index 0000000..a227af8 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/textalignex1.html @@ -0,0 +1,180 @@ +
textalignex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
<?php // content="text/plain; charset=utf-8"
+require_once "jpgraph/jpgraph.php";
+require_once "jpgraph/jpgraph_canvas.php";
+ 
+// We accept a URI argument to adjust the angle at what we display the text
+if( empty($_GET['a']) ) {
+    $angle=40;
+}
+else {
+    $angle=$_GET['a'];
+}
+ 
+// Caption below the image
+$caption = "Demonstration of different anchor points for texts as specified with\n".
+    "TextAlign(). The red cross marks the coordinate that was given to\n".
+    "stroke 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);
+ 
+// Make the image easier to access
+$img = $g->img;
+ 
+// Get the bounding box for text
+$img->SetFont(FF_ARIAL,FS_NORMAL,16);
+$tw=$img->GetBBoxWidth($txt,$angle);
+$th=$img->GetBBoxHeight($txt,$angle);
+ 
+$img->SetFont(FF_ARIAL,FS_NORMAL,11);
+$ch=$img->GetBBoxHeight($caption);
+ 
+// Calculate needed height for the image
+$h = 3*$th+2*$ym + $ch;
+$g = new CanvasGraph($w,$h);
+$img = $g->img;
+ 
+// Alignment for anchor points to use
+$anchors = array('left','top',
+              'center','top',
+              'right','top',
+              'left','center',
+              'center','center',
+              'right','center',
+              'left','bottom',
+              'center','bottom',
+              'right','bottom');
+ 
+$n = count($anchors)/2;
+ 
+for( $i=0,$r=0,$c=0; $i < $n; ++$i ) {
+ 
+    $x = $c*($tw+$xm)+$xm/2;
+    $y = $r*($th+$ym)+$ym/2-10;
+ 
+    $img->SetColor('blue');
+    $img->SetTextAlign($anchors[$i*2],$anchors[$i*2+1]);
+    $img->SetFont(FF_ARIAL,FS_NORMAL,16);
+    $img->StrokeText($x,$y,$txt,$angle,"left",true);
+ 
+    $img->SetColor('black');
+    $img->SetFont(FF_FONT1,FS_BOLD);
+    $img->SetTextAlign('center','top');
+    $align = sprintf('("%s","%s")',$anchors[$i*2],$anchors[$i*2+1]);
+    $img->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++;
+    }
+}
+ 
+// Draw the caption text
+$img->SetTextAlign('center','bottom');
+$img->SetFont(FF_ARIAL,FS_ITALIC,11);
+$img->StrokeText($w/2,$h-10,$caption,0,'left');
+ 
+$img->SetColor('navy');
+$img->Rectangle(0,0,$w-1,$h-1);
+ 
+// .. and send back to browser
+$g->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/textpalignex1.html b/includes/jpgraph/docs/chunkhtml/example_src/textpalignex1.html new file mode 100644 index 0000000..b60dc33 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/textpalignex1.html @@ -0,0 +1,86 @@ +
textpalignex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php // content="text/plain; charset=utf-8"
+require_once "jpgraph/jpgraph.php";
+require_once "jpgraph/jpgraph_canvas.php";
+ 
+// Caption below the image
+$txt="The day was rapidly becoming more and\nmore strange.\n\nNot only had he managed to\nget by the first pass without so much as\na hint of questions but now when he\ncould feel that the second pass wouldn't\nlong be noone had yet seen him.";
+ 
+$w=950;$h=250;
+$xm=20;$ym=20;
+$tw=300;
+ 
+$g = new CanvasGraph($w,$h);
+$img = $g->img;
+ 
+// Alignment for anchor points to use
+$palign = array('left','center','right');
+ 
+$n = count($palign);
+$t = new Text($txt);
+ 
+$y = $ym;
+for( $i=0; $i < $n; ++$i ) {
+ 
+    $x = $xm + $i*$tw;
+ 
+    $t->SetColor('black');
+    $t->SetAlign('left','top');
+    $t->SetFont(FF_ARIAL,FS_NORMAL,11);
+    $t->SetBox();
+    $t->SetParagraphAlign($palign[$i]);
+    $t->Stroke($img, $x,$y);
+ 
+    $img->SetColor('black');
+    $img->SetFont(FF_FONT1,FS_BOLD);
+    $img->SetTextAlign('center','top');
+    $img->StrokeText($x+140,$y+160,'"'.$palign[$i].'"'.' pargraph align');
+ 
+}
+ 
+// .. and send back to browser
+$g->Stroke();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/theme_example.html b/includes/jpgraph/docs/chunkhtml/example_src/theme_example.html new file mode 100644 index 0000000..e9027ec --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/theme_example.html @@ -0,0 +1,52 @@ +
theme_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+$data1y=array(47,80,40,116);
+$graph = new Graph(400, 300, 'auto');
+$graph->SetScale('textlin');
+ 
+$theme_class = new AquaTheme;
+$graph->SetTheme($theme_class);
+ 
+// after setting theme, you can change details as you want
+$graph->SetFrame(true, 'lightgray');                        // set frame visible
+ 
+$graph->xaxis->SetTickLabels(array('A','B','C','D')); // change xaxis lagels
+$graph->title->Set("Theme Example");                    // add title
+ 
+// add barplot
+$bplot = new BarPlot($data1y);
+$graph->Add($bplot);
+ 
+// you can change properties of the plot only after calling Add()
+$bplot->SetWeight(0);
+$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);    
+ 
+$graph->Stroke();
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/theme_samplele.html b/includes/jpgraph/docs/chunkhtml/example_src/theme_samplele.html new file mode 100644 index 0000000..81e4abe --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/theme_samplele.html @@ -0,0 +1 @@ +001: Cannot read souce file: /root/jpgraph/trunk/src/Examples/theme_samplele.php diff --git a/includes/jpgraph/docs/chunkhtml/example_src/timestampex01.html b/includes/jpgraph/docs/chunkhtml/example_src/timestampex01.html new file mode 100644 index 0000000..ad94315 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/timestampex01.html @@ -0,0 +1,118 @@ +
timestampex01.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
<?php // content="text/plain; charset=utf-8"
+// Example on how to treat and format timestamp as human readable labels
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/titleex1.html b/includes/jpgraph/docs/chunkhtml/example_src/titleex1.html new file mode 100644 index 0000000..03223c9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/titleex1.html @@ -0,0 +1,58 @@ +
titleex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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(200,150);
+$graph->SetScale("textlin");
+$graph->SetMargin(25,10,30,30);
+ 
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+$graph->title->Set('The Title');
+$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10);
+$graph->subtitle->Set('The Subtitle');
+$graph->subsubtitle->SetFont(FF_ARIAL,FS_ITALIC,9);
+$graph->subsubtitle->Set('The Subsubitle');
+ 
+// 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();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/topxaxisex1.html b/includes/jpgraph/docs/chunkhtml/example_src/topxaxisex1.html new file mode 100644 index 0000000..11d4b81 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/topxaxisex1.html @@ -0,0 +1,94 @@ +
topxaxisex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/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();
+ 
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/universal_example.html b/includes/jpgraph/docs/chunkhtml/example_src/universal_example.html new file mode 100644 index 0000000..01b47da --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/universal_example.html @@ -0,0 +1,116 @@ +
universal_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new UniversalTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "UniversalTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/vivid_example.html b/includes/jpgraph/docs/chunkhtml/example_src/vivid_example.html new file mode 100644 index 0000000..c1a30aa --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/vivid_example.html @@ -0,0 +1,114 @@ +
vivid_example.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_bar.php');
+require_once ('jpgraph/jpgraph_line.php');
+ 
+$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
+ 
+$data = array (
+  0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
+  1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
+  2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
+  3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
+  4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
+  5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
+  6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
+  7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
+  8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
+);
+ 
+// Create the graph. These two calls are always required
+$graph = new Graph(400,300);    
+ 
+$graph->SetScale("textlin");
+if ($theme) {
+  $graph->SetTheme(new $theme());
+}
+$theme_class = new VividTheme;
+$graph->SetTheme($theme_class);
+ 
+$plot = array();
+// Create the bar plots
+for ($i = 0; $i < 4; $i++) {
+  $plot[$i] = new BarPlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.($i+1));
+}
+//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
+//$acc1->value->Show();
+$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
+ 
+for ($i = 4; $i < 8; $i++) {
+  $plot[$i] = new LinePlot($data[$i]);
+  $plot[$i]->SetLegend('plot'.$i);
+  $plot[$i]->value->Show();
+}
+ 
+$graph->Add($gbplot);
+$graph->Add($plot[4]);
+ 
+$title = "VividTheme Example";
+$title = mb_convert_encoding($title,'UTF-8');
+$graph->title->Set($title);
+$graph->xaxis->title->Set("X-title");
+$graph->yaxis->title->Set("Y-title");
+ 
+// Display the graph
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_2plots_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_2plots_ex1.html new file mode 100644 index 0000000..2794c58 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_2plots_ex1.html @@ -0,0 +1,86 @@ +
windrose_2plots_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal idex of axis as well
+// as the direction label
+$data = array(
+    1 => array(10,10,13,7),
+    2 => array(2,8,10),
+    4 => array(1,12,22),
+    );
+ 
+$data2 = array(
+    4 => array(12,8,2,3),
+    2 => array(5,4,4,5,2),
+    );
+ 
+// Create a new small windrose graph
+$graph = new WindroseGraph(660,400);
+$graph->SetShadow();
+ 
+$graph->title->Set('Two windrose plots in one graph');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+$graph->subtitle->Set('(Using Box() for each plot)');
+ 
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE8);
+$wp->SetSize(0.42);
+$wp->SetPos(0.25,0.55);
+$wp->SetBox();
+ 
+$wp2 = new WindrosePlot($data2);
+$wp2->SetType(WINDROSE_TYPE16);
+$wp2->SetSize(0.42);
+$wp2->SetPos(0.74,0.55);
+$wp2->SetBox();
+$wp2->SetRangeColors(array('green','yellow','red','brown'));
+ 
+$graph->Add($wp);
+$graph->Add($wp2);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_bgimg_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_bgimg_ex1.html new file mode 100644 index 0000000..b38ed69 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_bgimg_ex1.html @@ -0,0 +1,98 @@ +
windrose_bgimg_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+require_once ('jpgraph/jpgraph_flags.php');
+ 
+// Data can be specified using both ordinal idex of axis as well
+// as the direction label
+$data2 = array(
+    'vsv' => array(12,8,2,3),
+    6 => array(5,4,4,5,4),
+    );
+ 
+$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV','V','VSV','SV','SSV','S','SSO','SO','OSO');
+ 
+// Create a new small windrose graph
+$graph = new WindroseGraph(400,400);
+$graph->SetMargin(25,25,25,25);
+$graph->SetFrame();
+ 
+$graph->title->Set('Example with background flag');
+#$graph->title->SetFont(FF_VERA,FS_BOLD,14);
+ 
+ 
+//$graph->SetBackgroundImage('bkgimg.jpg',BGIMG_FILLFRAME);
+//$graph->SetBackgroundImageMix(90);
+$graph->SetBackgroundCFlag(28,BGIMG_FILLFRAME,15);
+ 
+ 
+$wp2 = new WindrosePlot($data2);
+$wp2->SetType(WINDROSE_TYPE16);
+$wp2->SetSize(0.55);
+$wp2->SetPos(0.5,0.5);
+$wp2->SetAntiAlias(false);
+ 
+$wp2->SetFont(FF_ARIAL,FS_BOLD,10);
+$wp2->SetFontColor('black');
+ 
+$wp2->SetCompassLabels($se_CompassLbl);
+$wp2->legend->SetMargin(20,5);
+ 
+$wp2->scale->SetZFont(FF_ARIAL,FS_NORMAL,8);
+$wp2->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+$wp2->scale->SetLabelFillColor('white','white');
+ 
+$wp2->SetRangeColors(array('green','yellow','red','brown'));
+ 
+$graph->Add($wp2);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex0.html new file mode 100644 index 0000000..9c02952 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex0.html @@ -0,0 +1,48 @@ +
windrose_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    0 => array(5,5,5,8),
+    1 => array(3,4,1,4),
+    'WSW' => array(1,5,5,3),
+    'N' => array(2,3,8,1,1),
+    15 => array(2,3,5));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+$graph->title->Set('A basic Windrose graph');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Add and send back to browser
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex1.html new file mode 100644 index 0000000..d98d446 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex1.html @@ -0,0 +1,54 @@ +
windrose_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    'wsw' => array(1,5,5,3),
+    'N' => array(2,7,5,4,2),
+    15 => array(2,7,12));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Setup title
+$graph->title->Set('Windrose basic example');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetRadialGridStyle('solid');
+$graph->Add($wp);
+ 
+// Send the graph to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex2.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex2.html new file mode 100644 index 0000000..e6242dd --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex2.html @@ -0,0 +1,96 @@ +
windrose_ex2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Setup title
+$graph->title->Set('Windrose example 2');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Make it have 8 compass direction
+$wp->SetType(WINDROSE_TYPE8);
+ 
+// Setup the weight of the laegs for the different ranges
+$weights = array_fill(0,8,10);
+$wp->SetRangeWeights($weights);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11);
+$wp->scale->SetFontColor('navy');
+ 
+// Set the diametr for the plot to 160 pixels
+$wp->SetSize(200);
+ 
+// Set the size of the innermost center circle to 30% of the plot size
+$wp->SetZCircleSize(0.2);
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,12);
+$wp->SetFontColor('darkgreen');
+ 
+// Add and send back the graph to the client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex3.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex3.html new file mode 100644 index 0000000..45a9a2f --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex3.html @@ -0,0 +1,144 @@ +
windrose_ex3.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data[0] = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+$data[1] = array(
+    "n" => array(1,1,2.5,4),
+    "ssw" => array(3,4,1,4),
+    "se" => array(2,7,4,4,3));
+ 
+// Store the position and size data for each plot in an
+// array to make it easier to create multiple plots.
+// The format choosen for the layout data is
+// (type,x-pos,y-pos,size, z-circle size)
+$layout = array(
+    array(WINDROSE_TYPE8,0.25,0.55,0.4,0.25),
+    array(WINDROSE_TYPE16,0.75,0.55,0.4,0.25));
+ 
+$legendtxt = array('(m/s) Station 7','(m/s) Station 12');
+ 
+// First create a new windrose graph with a dropshadow
+$graph = new WindroseGraph(600,350);
+$graph->SetShadow('darkgray');
+ 
+// Setup titles
+$graph->title->Set('Windrose example 3');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+$graph->subtitle->Set('(Multiple plots in the same graph)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_NORMAL,9);
+$graph->subtitle->SetColor('navy');
+ 
+// Create the two windrose plots.
+for( $i=0; $i < count($data); ++$i ) {
+    $wp[$i] = new WindrosePlot($data[$i]);
+ 
+    // Make it have 8 compass direction
+    $wp[$i]->SetType($layout[$i][0]);
+ 
+    // Adjust the font and font color for scale labels
+    $wp[$i]->scale->SetFont(FF_TIMES,FS_NORMAL,10);
+    $wp[$i]->scale->SetFontColor('navy');
+ 
+    // Set the position of the plot
+    $wp[$i]->SetPos($layout[$i][1],$layout[$i][2]);
+ 
+    // Set the diameter for the plot to 30% of the width of the graph pixels
+    $wp[$i]->SetSize($layout[$i][3]);
+ 
+    // Set the size of the innermost center circle to 30% of the plot size
+    $wp[$i]->SetZCircleSize($layout[$i][4]);
+ 
+    // Adjust the font and font color for compass directions
+    $wp[$i]->SetFont(FF_ARIAL,FS_NORMAL,10);
+    $wp[$i]->SetFontColor('darkgreen');
+ 
+    // Add legend text
+    $wp[$i]->legend->SetText($legendtxt[$i]);
+ 
+    $graph->Add($wp[$i]);
+}
+ 
+// Send the graph to the browser
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex4.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex4.html new file mode 100644 index 0000000..9b7e4f4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex4.html @@ -0,0 +1,114 @@ +
windrose_ex4.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Setup title
+$graph->title->Set('Windrose example 4');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11);
+$wp->scale->SetFontColor('navy');
+ 
+// Set the diameter and position for plot
+$wp->SetSize(190);
+ 
+// Set the size of the innermost center circle to 40% of the plot size
+// Note that we can have the automatic "Zero" sum appear in our custom text
+$wp->SetZCircleSize(0.38);
+$wp->scale->SetZeroLabel("Station 12\n(Calm %d%%)");
+ 
+// Adjust color and font for center circle text
+$wp->scale->SetZFont(FF_ARIAL,FS_NORMAL,9);
+$wp->scale->SetZFontColor('darkgreen');
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,10);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust the margin to the compass directions
+$wp->SetLabelMargin(50);
+ 
+// Adjust grid colors
+$wp->SetGridColor('silver','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+$wp->legend->SetMargin(20,5);
+ 
+// Add and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex5.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex5.html new file mode 100644 index 0000000..3b25451 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex5.html @@ -0,0 +1,186 @@ +
windrose_ex5.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    3 => array(2,7,4,4,3),
+    5 => array(2,7,1,2));
+ 
+// Text to be added.
+$txt=array();
+$txt[0] = "It is possible to add arbitrary,multi line, text to a graph. ";
+$txt[0] .= "Such a paragraph can have it's text be left, right or center ";
+$txt[0] .= "aligned.";
+$txt[1] = "This is an example of a right aligned paragraph.";
+$txt[2] = "Finally we can show a center aligned paragraph without box.";
+ 
+// We store the layout for each of the text boxes in an array
+// to keep the code clean
+$txtlayout = array(
+    array(0.97,0.15,25,'left','black','lightblue'),
+    array(0.97,0.4,20,'right','black','lightblue'),
+    array(0.97,0.7,20,'center','darkred',false,FF_COMIC,FS_NORMAL,12),
+);
+ 
+// Range colors to be used
+$rangeColors = array('silver','khaki','orange','brown','blue','navy','maroon','red');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(570,430);
+$graph->title->Set('Windrose example 5');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Setup graph background color
+$graph->SetColor('darkgreen@0.7');
+ 
+// Setup all the defined text boxes
+$n = count($txt);
+for( $i=0; $i < $n; ++$i ) {
+    $txtbox[$i] = new Text($txt[$i]);
+    $txtbox[$i]->SetPos($txtlayout[$i][0],$txtlayout[$i][1],'right');
+    $txtbox[$i]->SetWordwrap($txtlayout[$i][2]);
+    $txtbox[$i]->SetParagraphAlign($txtlayout[$i][3]);
+    $txtbox[$i]->SetColor($txtlayout[$i][4]);
+    $txtbox[$i]->SetBox($txtlayout[$i][5]);
+    if( count($txtlayout[$i]) > 6 )
+    $txtbox[$i]->SetFont($txtlayout[$i][6],$txtlayout[$i][7],$txtlayout[$i][8]);
+}
+$graph->Add($txtbox);
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Set background color for plot area
+$wp->SetColor('lightyellow');
+ 
+// Add a box around the plot
+$wp->SetBox();
+ 
+// Setup the colors for the ranges
+$wp->SetRangeColors($rangeColors);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+$wp->scale->SetFontColor('navy');
+ 
+// Set the diameter and position for plot
+$wp->SetSize(190);
+$wp->SetPos(0.35,0.53);
+ 
+$wp->SetZCircleSize(0.2);
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,10);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust the margin to the compass directions
+$wp->SetLabelMargin(50);
+ 
+// Adjust grid colors
+$wp->SetGridColor('silver','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+$wp->legend->SetMargin(20,5);
+ 
+// Add plot and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex6.1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex6.1.html new file mode 100644 index 0000000..31f7243 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex6.1.html @@ -0,0 +1,176 @@ +
windrose_ex6.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+$data = array(
+    '10'  => array(1,1,2.5,4),
+    '32.0' => array(3,4,1,4),
+    '120.5' => array(2,3,4,4,3,2,1),
+    '223.2' => array(2,4,1,2,2),
+    '285.7' => array(2,2,1,2,4,2,1,1)
+);
+ 
+// This file is encode din utf-8. The two Kanji characters roughly means
+// 中 = Chinese
+// 文 = Sentences
+$ctxt = '中文';
+ 
+// Specify text for direction labels
+$labels = array(
+    '120.5' => $ctxt,
+    '232.2' => "Reference\n#13 Ver:2");
+ 
+// Range colors to be used
+$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,450);
+ 
+// Setup title
+$graph->title->Set('Using chinese charecters');
+#$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+$graph->subtitle->Set('(Free type plot)');
+#$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+$graph->subtitle->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Setup a free plot
+$wp->SetType(WINDROSE_TYPEFREE);
+ 
+// Setup labels
+$wp->SetLabels($labels);
+$wp->SetLabelPosition(LBLPOSITION_CENTER);
+$wp->SetLabelMargin(30);
+ 
+// Setup the colors for the ranges
+$wp->SetRangeColors($rangeColors);
+ 
+// Adjust the font and font color for scale labels
+#$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+ 
+// Set the diameter and position for plot
+#$wp->SetSize(240);
+$wp->SetSize(200);
+$wp->SetZCircleSize(30);
+$wp->SetPos(0.5,0.5);
+ 
+// Adjust the font and font color for compass directions
+#$wp->SetFont(FF_CHINESE,FS_NORMAL,12);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust grid colors
+$wp->SetGridColor('darkgreen@0.7','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+$wp->legend->SetTFontColor('blue');
+ 
+// Set legend label font color
+$wp->legend->SetLFontColor('orange:0.7');
+#$wp->legend->SetLFont(FF_ARIAL,FS_ITALIC,8);
+ 
+// Display legend values with no decimals
+$wp->legend->SetFormat('%d');
+ 
+// Set the circle font to use chinse character set
+// Note: When FF_CHINESE is used the input charectr data are
+// assumed to already be in utf-8 encoding
+#$wp->legend->SetCFont(FF_CHINESE,FS_NORMAL,14);
+$wp->legend->SetCircleText($ctxt);
+$wp->legend->SetCFontColor('red');
+ 
+// Add plot to graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex6.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex6.html new file mode 100644 index 0000000..d91e752 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex6.html @@ -0,0 +1,142 @@ +
windrose_ex6.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label
+$data = array(
+    '10'  => array(1,1,2.5,4),
+    '32.0' => array(3,4,1,4),
+    '120.5' => array(2,3,4,4,3,2,1),
+    '223.2' => array(2,4,1,2,2),
+    '285.7' => array(2,2,1,2,4,2,1,1)
+);
+ 
+// Specify text for direction labels
+$labels = array( '120.5' => "Plant\n#1275",
+         '285.7' => "Reference\n#13 Ver:2");
+ 
+// Range colors to be used
+$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,450);
+ 
+// Setup titles
+$graph->title->Set('Windrose example 6');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+$graph->subtitle->Set('(Free type plot)');
+$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
+$graph->subtitle->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Setup a free plot
+$wp->SetType(WINDROSE_TYPEFREE);
+ 
+// Setup labels
+$wp->SetLabels($labels);
+$wp->SetLabelPosition(LBLPOSITION_CENTER);
+$wp->SetLabelMargin(30);
+ 
+// Setup the colors for the ranges
+$wp->SetRangeColors($rangeColors);
+ 
+// Adjust the font and font color for scale labels
+$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
+ 
+// Set the diameter and position for plot
+$wp->SetSize(230);
+$wp->SetZCircleSize(30);
+ 
+// Adjust the font and font color for compass directions
+$wp->SetFont(FF_ARIAL,FS_NORMAL,10);
+$wp->SetFontColor('darkgreen');
+ 
+// Adjust grid colors
+$wp->SetGridColor('darkgreen@0.7','blue');
+ 
+// Add (m/s) text to legend
+$wp->legend->SetText('(m/s)');
+ 
+// Display legend values with no decimals
+$wp->legend->SetFormat('%d');
+ 
+// Add plot to graph and send back to the client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex7.1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex7.1.html new file mode 100644 index 0000000..54dd596 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex7.1.html @@ -0,0 +1,132 @@ +
windrose_ex7.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+ 
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    2 => array(1,15,7.5,2),
+    5 => array(1,1,1.5,2),
+    7 => array(1,2,10,3,2),
+    8 => array(2,3,1,3,1,2),
+    );
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(590,580);
+$graph->title->Set('Japanese locale');
+#$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE8);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Localize the compass direction labels into Japanese
+// Note: The labels for data must now also match the exact
+// string for the compass directions.
+//
+// E   東
+// NE  北東
+// N   北
+// NW  北西
+// W   西
+// SW  南西
+// S   南
+// SE  南東
+$jp_CompassLbl = array('','','北東','','','','北西','',
+                        '西','','南西','','','','南東','');
+$wp->SetCompassLabels($jp_CompassLbl);
+#$wp->SetFont(FF_MINCHO,FS_NORMAL,15);
+ 
+// Localize the "Calm" text into Swedish and make the circle
+// slightly bigger than default
+$jp_calmtext = '平穏';
+$wp->legend->SetCircleText($jp_calmtext);
+$wp->legend->SetCircleRadius(20);
+#$wp->legend->SetCFont(FF_MINCHO,FS_NORMAL,10);
+$wp->legend->SetMargin(5,0);
+$wp->SetPos(0.5, 0.5);
+ 
+// Adjust the displayed ranges
+$ranges = array(1,3,5,8,12,19,29);
+$wp->SetRanges($ranges);
+ 
+// Set the scale to always have max value of 30
+$wp->scale->Set(30,10);
+#$wp->scale->SetFont(FF_VERA,FS_NORMAL,12);
+ 
+// Finally add it to the graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex7.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex7.html new file mode 100644 index 0000000..d9070bc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex7.html @@ -0,0 +1,100 @@ +
windrose_ex7.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+$data = array(
+    2 => array(1,15,7.5,2),
+    5 => array(1,1,1.5,2),
+    7 => array(1,2,10,3,2),
+    9 => array(2,3,1,3,1,2),
+    );
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,450);
+$graph->title->Set('Windrose example 7');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE16);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Localize the compass direction labels into Swedish
+// Note: The labels for data must now also match the exact
+// string for the compass directions.
+$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV',
+                          'V','VSV','SV','SSV','S','SSO','SO','OSO');
+$wp->SetCompassLabels($se_CompassLbl);
+ 
+// Localize the "Calm" text into Swedish and make the circle
+// slightly bigger than default
+$se_calmtext = 'Lugnt';
+$wp->legend->SetCircleText($se_calmtext);
+$wp->legend->SetCircleRadius(20);
+ 
+// Adjust the displayed ranges
+$ranges = array(1,3,5,8,12,19,29);
+$wp->SetRanges($ranges);
+//$wp->SetAntiAlias(true);
+ 
+// Set the scale to always have max value of 30 with a step
+// size of 12.
+$wp->scale->Set(30,12);
+ 
+// Finally add it to the graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex8.1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex8.1.html new file mode 100644 index 0000000..eab55a9 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex8.1.html @@ -0,0 +1,96 @@ +
windrose_ex8.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    '45.9' => array(3,2,1,2,2),
+    355 => array(1,1,1.5,2),
+    180 => array(1,1,1.5,2),
+    150 => array(1,2,1,3),
+    'S' => array(2,3,5,1),
+    );
+ 
+// Add some labels for  afew of the directions
+$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant");
+ 
+// Define the color,weight and style of some individual radial grid lines.
+$axiscolors = array(355=>"red");
+$axisweights = array(355=>8);
+$axisstyles = array(355=>'solid',150=>'solid');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,460);
+$graph->title->Set('Adding label backgrounds');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPEFREE);
+$wp->scale->SetLabelFillColor('lightblue','black');
+ 
+// Specify colors weights and style for the radial gridlines
+$wp->SetRadialColors($axiscolors);
+$wp->SetRadialWeights($axisweights);
+$wp->SetRadialStyles($axisstyles);
+ 
+// Add a few labels
+$wp->SetLabels($labels);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Finally add it to the graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex8.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex8.html new file mode 100644 index 0000000..a9d11d4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex8.html @@ -0,0 +1,94 @@ +
windrose_ex8.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    '45.9' => array(3,2,1,2,2),
+    355 => array(1,1,1.5,2),
+    180 => array(1,1,1.5,2),
+    150 => array(1,2,1,3),
+    'S' => array(2,3,5,1),
+    );
+ 
+// Add some labels for  afew of the directions
+$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant");
+ 
+// Define the color,weight and style of some individual radial grid lines.
+$axiscolors = array(355=>"red");
+$axisweights = array(355=>8);
+$axisstyles = array(355=>'solid',150=>'solid');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,500);
+$graph->title->Set('Windrose example 8');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPEFREE);
+ 
+// Specify colors weights and style for the radial gridlines
+$wp->SetRadialColors($axiscolors);
+$wp->SetRadialWeights($axisweights);
+$wp->SetRadialStyles($axisstyles);
+ 
+// Add a few labels
+$wp->SetLabels($labels);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Finally add it to the graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex9.1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex9.1.html new file mode 100644 index 0000000..9d8430c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex9.1.html @@ -0,0 +1,122 @@ +
windrose_ex9.1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    0 => array(3,2,1,2,2),
+    4 => array(1,1,1.5,2),
+    6 => array(1,1,1.5,2),
+    12 => array(2,3,5,1),
+);
+ 
+$xpos1 = 0.26;
+$xpos2 = 0.74;
+$ypos1 = 0.5;
+$ypos2 = 0.9;
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(650,350);
+$graph->title->Set('Interpretation of ordinal keys');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the first plot
+$wp1 = new WindrosePlot($data);
+$wp1->SetType(WINDROSE_TYPE16);
+ 
+// This is the default encoding
+$wp1->SetDataKeyEncoding(KEYENCODING_ANTICLOCKWISE);
+$wp1->legend->Hide();
+$wp1->SetPos($xpos1,$ypos1);
+$wp1->SetSize(0.5);
+ 
+// Create the second plot
+$wp2 = new WindrosePlot($data);
+$wp2->SetType(WINDROSE_TYPE16);
+$wp2->SetDataKeyEncoding(KEYENCODING_CLOCKWISE);
+$wp2->legend->Hide();
+$wp2->SetPos($xpos2,$ypos1);
+$wp2->SetSize(0.5);
+ 
+$txt1 = new Text('KEYENCODING_ANTICLOCKWISE');
+$txt1->SetFont(FF_COURIER,FS_BOLD,12);
+$txt1->SetPos($xpos1,$ypos2);
+$txt1->SetAlign('center','top');
+ 
+$txt2 = new Text('KEYENCODING_CLOCKWISE');
+$txt2->SetFont(FF_COURIER,FS_BOLD,12);
+$txt2->SetPos($xpos2,$ypos2);
+$txt2->SetAlign('center','top');
+ 
+// Finally add it to the graph and send back to the client
+$graph->Add($wp1);
+$graph->Add($txt1);
+ 
+$graph->Add($wp2);
+$graph->Add($txt2);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex9.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex9.html new file mode 100644 index 0000000..84505a0 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_ex9.html @@ -0,0 +1,90 @@ +
windrose_ex9.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Data can be specified using both ordinal index of the axis
+// as well as the direction label.
+$data = array(
+    'E' => array(3,2,1,2,2),
+    'N' => array(1,1,1.5,2),
+    'nw' => array(1,1,1.5,2),
+    'S' => array(2,3,5,1),
+    );
+ 
+// Define the color,weight and style of some individual radial
+// grid lines. Axis can be specified either by their (localized)
+// label or by their index.
+// Note; Depending on how many axis you have in the plot the
+// index will vary between 0..n where n is the number of
+// compass directions.
+$axiscolors = array('nw'=>'brown');
+$axisweights = array('nw'=>8);  // Could also be specified as 6 => 8
+$axisstyles = array('nw'=>'solid');
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,500);
+$graph->title->Set('Windrose example 9');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
+$graph->title->SetColor('navy');
+ 
+// Create the free windrose plot.
+$wp = new WindrosePlot($data);
+$wp->SetType(WINDROSE_TYPE16);
+ 
+// Specify colors weights and style for the radial gridlines
+$wp->SetRadialColors($axiscolors);
+$wp->SetRadialWeights($axisweights);
+$wp->SetRadialStyles($axisstyles);
+ 
+// Add some "arbitrary" text to the center
+$wp->scale->SetZeroLabel("SOx\n8%%");
+ 
+// Finally add it to the graph and send back to the client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_icon_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_icon_ex1.html new file mode 100644 index 0000000..6c6a228 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_icon_ex1.html @@ -0,0 +1,64 @@ +
windrose_icon_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+require_once ('jpgraph/jpgraph_iconplot.php');
+ 
+$data = array(
+    0 => array(1,1,2.5,4),
+    1 => array(3,4,1,4),
+    'wsw' => array(1,5,5,3),
+    'N' => array(2,7,5,4,2),
+    15 => array(2,7,12));
+ 
+// First create a new windrose graph with a title
+$graph = new WindroseGraph(400,400);
+ 
+// Creta an icon to be added to the graph
+$icon = new IconPlot('tornado.jpg',10,10,1.3,50);
+$icon->SetAnchor('left','top');
+$graph->Add($icon);
+ 
+// Setup title
+$graph->title->Set('Windrose icon example');
+$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
+$graph->title->SetColor('navy');
+ 
+// Create the windrose plot.
+$wp = new WindrosePlot($data);
+ 
+// Add to graph and send back to client
+$graph->Add($wp);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_layout_ex0.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_layout_ex0.html new file mode 100644 index 0000000..e6e9733 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_layout_ex0.html @@ -0,0 +1,90 @@ +
windrose_layout_ex0.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Some data for the five windrose plots
+$data = array(
+    array(
+        1 => array(10,10,13,7),
+        2 => array(2,8,10),
+        4 => array(1,12,22)),
+    array(
+        4 => array(12,8,2,3),
+        2 => array(5,4,4,5,2)),
+    array(
+        1 => array(12,8,2,3),
+        3 => array(5,4,4,5,2)),
+    array(
+        2 => array(12,8,2,3),
+        3 => array(5,4,4,5,2)),
+);
+ 
+// Create a windrose graph with titles
+$graph = new WindroseGraph(600,650);
+$graph->SetShadow();
+ 
+$graph->title->Set('Multiple plots with automatic layout');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Setup the individual windrose plots
+$wp = array();
+for( $i=0; $i < 4; ++$i ) {
+    $wp[$i] = new WindrosePlot($data[$i]);
+    $wp[$i]->SetSize(0.22);
+    $wp[$i]->SetCenterSize(0.25);
+}
+ 
+// Position with two rows. Two plots in top row and three plots in
+// bottom row.
+$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) );
+$hl2 = new LayoutHor( array( $wp[2], $wp[3] ) );
+$vl = new LayoutVert( array( $hl1, $hl2) );
+ 
+$graph->Add($vl);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/windrose_layout_ex1.html b/includes/jpgraph/docs/chunkhtml/example_src/windrose_layout_ex1.html new file mode 100644 index 0000000..7d0dded --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/windrose_layout_ex1.html @@ -0,0 +1,116 @@ +
windrose_layout_ex1.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
<?php
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_windrose.php');
+ 
+// Some data for the five windrose plots
+$data = array(
+    array(
+        1 => array(10,10,13,7),
+        2 => array(2,8,10),
+        4 => array(1,12,22)),
+    array(
+        4 => array(12,8,2,3),
+        2 => array(5,4,4,5,2)),
+    array(
+        1 => array(12,8,2,3),
+        3 => array(5,4,4,5,2)),
+    array(
+        2 => array(12,8,2,3),
+        3 => array(5,4,4,5,2)),
+    array(
+        4 => array(12,8,2,3),
+        6 => array(5,4,4,5,2))
+);
+ 
+// Legend range colors
+$rangecolors = array('green','yellow','red','brown');
+ 
+// Create a windrose graph with titles
+$graph = new WindroseGraph(750,700);
+ 
+$graph->title->Set('Multiple plots with automatic layout');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
+ 
+// Setup the individual windrose plots
+$wp = array();
+for( $i=0; $i < 5; ++$i ) {
+    $wp[$i] = new WindrosePlot($data[$i]);
+    $wp[$i]->SetType(WINDROSE_TYPE8);
+    if( $i < 2) {
+        $wp[$i]->SetSize(0.28);
+    }
+    else {
+        $wp[$i]->legend->Hide();
+        $wp[$i]->SetSize(0.16);
+        $wp[$i]->SetCenterSize(0.25);
+    }
+    $wp[$i]->SetRangeColors($rangecolors);
+}
+ 
+// Position with two rows. Two plots in top row and three plots in
+// bottom row.
+$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) );
+$hl2 = new LayoutHor( array( $wp[2], $wp[3], $wp[4] ) );
+$vl = new LayoutVert( array( $hl1, $hl2) );
+ 
+$graph->Add($vl);
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/y2synch.html b/includes/jpgraph/docs/chunkhtml/example_src/y2synch.html new file mode 100644 index 0000000..25655ed --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/y2synch.html @@ -0,0 +1,120 @@ +
y2synch.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+ 
+function toFahrenheit($aVal) {
+    return round(($aVal*9/5)+32,2);
+}
+ 
+function toCelcius($aVal) {
+    return round(($aVal-32)*5/9,2);
+}
+ 
+ 
+$datay =array(2,3,8,19,7,17,6,22);
+ 
+// Create the graph. 
+$graph = new Graph(400,280);
+ 
+// Slightly bigger margins than default to make room for titles
+$graph->SetMargin(50,60,40,45);
+$graph->SetMarginColor('white');
+ 
+ 
+// Setup the scales for X,Y and Y2 axis
+$graph->SetScale("intlin"); // X and Y axis
+$graph->SetY2Scale("lin"); // Y2 axis
+ 
+// Overall graph title
+$graph->title->Set('Synchronized Y & Y2 scales');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// Title for X-axis
+$graph->xaxis->title->Set('Measurement');
+$graph->xaxis->title->SetMargin(5);
+$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Create Y data set 
+$lplot = new LinePlot($datay);
+$graph->yaxis->title->Set('Celcius (C)');
+$graph->yaxis->title->SetMargin(5);
+$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+// ... and add the plot to the Y-axis
+$graph->Add($lplot);
+ 
+// Create Y2 scale data set 
+$l2plot = new LinePlot($datay);
+$l2plot->SetWeight(0);
+$graph->y2axis->title->Set('Fahrenheit (F)');
+$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels
+$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+$graph->y2axis->SetLabelFormatCallback('toFahrenheit');
+$graph->y2axis->SetColor('navy');
+ 
+// ... and add the plot to the Y2-axis
+$graph->AddY2($l2plot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/example_src/y2synch2.html b/includes/jpgraph/docs/chunkhtml/example_src/y2synch2.html new file mode 100644 index 0000000..90c63f4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/example_src/y2synch2.html @@ -0,0 +1,120 @@ +
y2synch2.php
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
<?php // content="text/plain; charset=utf-8"
+require_once ('jpgraph/jpgraph.php');
+require_once ('jpgraph/jpgraph_line.php');
+require_once ('jpgraph/jpgraph_bar.php');
+ 
+ 
+function toFahrenheit($aVal) {
+    return round(($aVal*9/5)+32,2);
+}
+ 
+function toCelcius($aVal) {
+    return round(($aVal-32)*5/9,2);
+}
+ 
+ 
+$datay =array(2,3,8,19,7,17,6,22);
+ 
+// Create the graph. 
+$graph = new Graph(400,280);
+ 
+// Slightly bigger margins than default to make room for titles
+$graph->SetMargin(50,60,40,45);
+$graph->SetMarginColor('white');
+ 
+ 
+// Setup the scales for X,Y and Y2 axis
+$graph->SetScale("textlin"); // X and Y axis
+$graph->SetY2Scale("lin"); // Y2 axis
+ 
+// Overall graph title
+$graph->title->Set('Synchronized Y & Y2 scales');
+$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+ 
+// Title for X-axis
+$graph->xaxis->title->Set('Measurement');
+$graph->xaxis->title->SetMargin(5);
+$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+ 
+// Create Y data set 
+$lplot = new BarPlot($datay);
+$graph->yaxis->title->Set('Celcius (C)');
+$graph->yaxis->title->SetMargin(5);
+$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+// ... and add the plot to the Y-axis
+$graph->Add($lplot);
+ 
+// Create Y2 scale data set 
+$l2plot = new LinePlot($datay);
+$l2plot->SetWeight(0);
+$graph->y2axis->title->Set('Fahrenheit (F)');
+$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels
+$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11);
+$graph->y2axis->SetLabelFormatCallback('toFahrenheit');
+$graph->y2axis->SetColor('navy');
+ 
+// ... and add the plot to the Y2-axis
+$graph->AddY2($l2plot);
+ 
+$graph->Stroke();
+?>
diff --git a/includes/jpgraph/docs/chunkhtml/images/.png b/includes/jpgraph/docs/chunkhtml/images/.png new file mode 100644 index 0000000..e69de29 diff --git a/includes/jpgraph/docs/chunkhtml/images/aalias_line.jpg b/includes/jpgraph/docs/chunkhtml/images/aalias_line.jpg new file mode 100644 index 0000000..3dfc1b9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/aalias_line.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/accbarframeex01.png b/includes/jpgraph/docs/chunkhtml/images/accbarframeex01.png new file mode 100644 index 0000000..bb19001 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/accbarframeex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/accbarframeex02.png b/includes/jpgraph/docs/chunkhtml/images/accbarframeex02.png new file mode 100644 index 0000000..1000698 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/accbarframeex02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/accbarframeex03.png b/includes/jpgraph/docs/chunkhtml/images/accbarframeex03.png new file mode 100644 index 0000000..869822a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/accbarframeex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/alpha-channel.png b/includes/jpgraph/docs/chunkhtml/images/alpha-channel.png new file mode 100644 index 0000000..4ed9b2d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/alpha-channel.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/antispamex01.png b/includes/jpgraph/docs/chunkhtml/images/antispamex01.png new file mode 100644 index 0000000..6616fb4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/antispamex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/aqua_example.png b/includes/jpgraph/docs/chunkhtml/images/aqua_example.png new file mode 100644 index 0000000..1ad3331 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/aqua_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex01.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex01.png new file mode 100644 index 0000000..b1f28bc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex02.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex02.png new file mode 100644 index 0000000..474cd9c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex03.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex03.png new file mode 100644 index 0000000..3b8a14a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex04.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex04.png new file mode 100644 index 0000000..55d2700 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex05.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex05.png new file mode 100644 index 0000000..b6b111b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex05.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex06.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex06.png new file mode 100644 index 0000000..a74f2c1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex06.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex07.png b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex07.png new file mode 100644 index 0000000..9eb0ce4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/axislabelbkgex07.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/background_type_ex0.png b/includes/jpgraph/docs/chunkhtml/images/background_type_ex0.png new file mode 100644 index 0000000..fdbecc6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/background_type_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/background_type_ex1.png b/includes/jpgraph/docs/chunkhtml/images/background_type_ex1.png new file mode 100644 index 0000000..5bc0e25 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/background_type_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/background_type_ex2.png b/includes/jpgraph/docs/chunkhtml/images/background_type_ex2.png new file mode 100644 index 0000000..33467e8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/background_type_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/background_type_ex3.png b/includes/jpgraph/docs/chunkhtml/images/background_type_ex3.png new file mode 100644 index 0000000..20028ff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/background_type_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/background_type_ex4.png b/includes/jpgraph/docs/chunkhtml/images/background_type_ex4.png new file mode 100644 index 0000000..eab7263 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/background_type_ex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/balloonex2.png b/includes/jpgraph/docs/chunkhtml/images/balloonex2.png new file mode 100644 index 0000000..b430c79 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/balloonex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern1.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern1.png new file mode 100644 index 0000000..322ad4f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern2.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern2.png new file mode 100644 index 0000000..4553321 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern3.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern3.png new file mode 100644 index 0000000..e35db9c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern4.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern4.png new file mode 100644 index 0000000..f6732e5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern5.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern5.png new file mode 100644 index 0000000..119815d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern6.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern6.png new file mode 100644 index 0000000..c00dc12 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern7.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern7.png new file mode 100644 index 0000000..9a56bc5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern8.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern8.png new file mode 100644 index 0000000..cd0d37f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bar_pattern9.png b/includes/jpgraph/docs/chunkhtml/images/bar_pattern9.png new file mode 100644 index 0000000..50d014f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bar_pattern9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode-demoapp.png b/includes/jpgraph/docs/chunkhtml/images/barcode-demoapp.png new file mode 100644 index 0000000..08caffd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode-demoapp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode-explained-1.png b/includes/jpgraph/docs/chunkhtml/images/barcode-explained-1.png new file mode 100644 index 0000000..15b702d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode-explained-1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_bookland_048663926_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_bookland_048663926_ex1.png new file mode 100644 index 0000000..3ba5e0d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_bookland_048663926_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c11_0137291_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c11_0137291_ex1.png new file mode 100644 index 0000000..e15f7b4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c11_0137291_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c11_0137291_ex2.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c11_0137291_ex2.png new file mode 100644 index 0000000..5601fd3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c11_0137291_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c128_Code128_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c128_Code128_ex1.png new file mode 100644 index 0000000..5a820a9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c128_Code128_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c128_abc123_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c128_abc123_ex1.png new file mode 100644 index 0000000..a4e6e1d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c128_abc123_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c25_13729_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c25_13729_ex1.png new file mode 100644 index 0000000..fb386c9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c25_13729_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c25_13729_ex2.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c25_13729_ex2.png new file mode 100644 index 0000000..1d66e7b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c25_13729_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39_0137291_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_0137291_ex1.png new file mode 100644 index 0000000..42ae6de Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_0137291_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39_0137291_ex2.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_0137291_ex2.png new file mode 100644 index 0000000..707c706 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_0137291_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex1.png new file mode 100644 index 0000000..9a4edcd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex2.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex2.png new file mode 100644 index 0000000..594a00f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex3.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex3.png new file mode 100644 index 0000000..948ff38 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39_abc123_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39e_Code39_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39e_Code39_ex1.png new file mode 100644 index 0000000..76a582d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39e_Code39_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_c39e_Code39_ex2.png b/includes/jpgraph/docs/chunkhtml/images/barcode_c39e_Code39_ex2.png new file mode 100644 index 0000000..3063e05 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_c39e_Code39_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_codabar_12345_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_codabar_12345_ex1.png new file mode 100644 index 0000000..9e6b7f3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_codabar_12345_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_code25_123_m5.png b/includes/jpgraph/docs/chunkhtml/images/barcode_code25_123_m5.png new file mode 100644 index 0000000..e9d54cf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_code25_123_m5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_data_validation_failed.png b/includes/jpgraph/docs/chunkhtml/images/barcode_data_validation_failed.png new file mode 100644 index 0000000..d95f045 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_data_validation_failed.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_ean128_3125134772_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_ean128_3125134772_ex1.png new file mode 100644 index 0000000..3c973c5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_ean128_3125134772_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_ean13_377622153812_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_ean13_377622153812_ex1.png new file mode 100644 index 0000000..7b6989f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_ean13_377622153812_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_ean8_3776221_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_ean8_3776221_ex1.png new file mode 100644 index 0000000..2fe4187 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_ean8_3776221_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_i25_137291_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_i25_137291_ex1.png new file mode 100644 index 0000000..4ee00e8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_i25_137291_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_i25_137291_ex2.png b/includes/jpgraph/docs/chunkhtml/images/barcode_i25_137291_ex2.png new file mode 100644 index 0000000..fbc3eff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_i25_137291_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_upca_03456781233_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_upca_03456781233_ex1.png new file mode 100644 index 0000000..078f549 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_upca_03456781233_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_upca_055_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_upca_055_ex1.png new file mode 100644 index 0000000..78279b3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_upca_055_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barcode_upce_055_ex1.png b/includes/jpgraph/docs/chunkhtml/images/barcode_upce_055_ex1.png new file mode 100644 index 0000000..1c946a9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barcode_upce_055_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradex1.png b/includes/jpgraph/docs/chunkhtml/images/bargradex1.png new file mode 100644 index 0000000..b35d178 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex1.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex1.png new file mode 100644 index 0000000..bcc26f0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex2.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex2.png new file mode 100644 index 0000000..efd691f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex3.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex3.png new file mode 100644 index 0000000..02e21c9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex4.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex4.png new file mode 100644 index 0000000..b4b3ba4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex5.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex5.png new file mode 100644 index 0000000..4604353 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex6.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex6.png new file mode 100644 index 0000000..5f8d04d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex7.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex7.png new file mode 100644 index 0000000..25e5aff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bargradsmallex8.png b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex8.png new file mode 100644 index 0000000..8792ba8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bargradsmallex8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barlinealphaex1.png b/includes/jpgraph/docs/chunkhtml/images/barlinealphaex1.png new file mode 100644 index 0000000..4c7ae52 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barlinealphaex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/barscalecallbackex1.png b/includes/jpgraph/docs/chunkhtml/images/barscalecallbackex1.png new file mode 100644 index 0000000..9df38b6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/barscalecallbackex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/bartable_intro.png b/includes/jpgraph/docs/chunkhtml/images/bartable_intro.png new file mode 100644 index 0000000..ab9d257 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/bartable_intro.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex01.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex01.png new file mode 100644 index 0000000..ca52e58 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex02.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex02.png new file mode 100644 index 0000000..b0f3dfb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-1.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-1.png new file mode 100644 index 0000000..c0ce836 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-2.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-2.png new file mode 100644 index 0000000..ba585be Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-3.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-3.png new file mode 100644 index 0000000..f477990 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex03-3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex04.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex04.png new file mode 100644 index 0000000..1a1f5ff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/basic_contourex05.png b/includes/jpgraph/docs/chunkhtml/images/basic_contourex05.png new file mode 100644 index 0000000..69e0c16 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/basic_contourex05.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/blueish-scale.png b/includes/jpgraph/docs/chunkhtml/images/blueish-scale.png new file mode 100644 index 0000000..33f4c2a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/blueish-scale.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/boxstockex1.png b/includes/jpgraph/docs/chunkhtml/images/boxstockex1.png new file mode 100644 index 0000000..c9c514b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/boxstockex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/builtinplotmarksex1.png b/includes/jpgraph/docs/chunkhtml/images/builtinplotmarksex1.png new file mode 100644 index 0000000..2f2d452 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/builtinplotmarksex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/cache_principles.png b/includes/jpgraph/docs/chunkhtml/images/cache_principles.png new file mode 100644 index 0000000..677b4b7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/cache_principles.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/canvasex01.png b/includes/jpgraph/docs/chunkhtml/images/canvasex01.png new file mode 100644 index 0000000..a8f875d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/canvasex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/canvasex02.png b/includes/jpgraph/docs/chunkhtml/images/canvasex02.png new file mode 100644 index 0000000..2c5222d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/canvasex02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/canvasex03.png b/includes/jpgraph/docs/chunkhtml/images/canvasex03.png new file mode 100644 index 0000000..50f094d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/canvasex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/canvasex04.png b/includes/jpgraph/docs/chunkhtml/images/canvasex04.png new file mode 100644 index 0000000..efb2aa4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/canvasex04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/canvasex05.png b/includes/jpgraph/docs/chunkhtml/images/canvasex05.png new file mode 100644 index 0000000..dde65b1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/canvasex05.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/canvasex06.png b/includes/jpgraph/docs/chunkhtml/images/canvasex06.png new file mode 100644 index 0000000..24d10a3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/canvasex06.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ccbp-creating-background-indicators.png b/includes/jpgraph/docs/chunkhtml/images/ccbp-creating-background-indicators.png new file mode 100644 index 0000000..b4c810b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ccbp-creating-background-indicators.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ccbp_ex1.png b/includes/jpgraph/docs/chunkhtml/images/ccbp_ex1.png new file mode 100644 index 0000000..6806c31 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ccbp_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ccbp_ex2.png b/includes/jpgraph/docs/chunkhtml/images/ccbp_ex2.png new file mode 100644 index 0000000..76a1d05 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ccbp_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ccbp_example_charts.png b/includes/jpgraph/docs/chunkhtml/images/ccbp_example_charts.png new file mode 100644 index 0000000..f5f42f5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ccbp_example_charts.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ccbp_hist_example.png b/includes/jpgraph/docs/chunkhtml/images/ccbp_hist_example.png new file mode 100644 index 0000000..6dd8967 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ccbp_hist_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ccbpgraph.class.png b/includes/jpgraph/docs/chunkhtml/images/ccbpgraph.class.png new file mode 100644 index 0000000..e69de29 diff --git a/includes/jpgraph/docs/chunkhtml/images/ccpm_principle.png b/includes/jpgraph/docs/chunkhtml/images/ccpm_principle.png new file mode 100644 index 0000000..e31800e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ccpm_principle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/checkgd.png b/includes/jpgraph/docs/chunkhtml/images/checkgd.png new file mode 100644 index 0000000..3b90f88 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/checkgd.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/checkgd2.png b/includes/jpgraph/docs/chunkhtml/images/checkgd2.png new file mode 100644 index 0000000..f553a38 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/checkgd2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/checkttf.png b/includes/jpgraph/docs/chunkhtml/images/checkttf.png new file mode 100644 index 0000000..85e16a7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/checkttf.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/clipping_ex1.png b/includes/jpgraph/docs/chunkhtml/images/clipping_ex1.png new file mode 100644 index 0000000..a84e172 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/clipping_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/clipping_ex2.png b/includes/jpgraph/docs/chunkhtml/images/clipping_ex2.png new file mode 100644 index 0000000..7ae7d83 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/clipping_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/colormap_center.png b/includes/jpgraph/docs/chunkhtml/images/colormap_center.png new file mode 100644 index 0000000..aaca3a0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/colormap_center.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/colormap_continues.png b/includes/jpgraph/docs/chunkhtml/images/colormap_continues.png new file mode 100644 index 0000000..e656068 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/colormap_continues.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/colormap_standard.png b/includes/jpgraph/docs/chunkhtml/images/colormap_standard.png new file mode 100644 index 0000000..1a6dc48 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/colormap_standard.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/comb90dategraphex03.png b/includes/jpgraph/docs/chunkhtml/images/comb90dategraphex03.png new file mode 100644 index 0000000..5fdfcef Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/comb90dategraphex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/combgraphex1.png b/includes/jpgraph/docs/chunkhtml/images/combgraphex1.png new file mode 100644 index 0000000..e59d6d8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/combgraphex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/combgraphex2.png b/includes/jpgraph/docs/chunkhtml/images/combgraphex2.png new file mode 100644 index 0000000..f8d0ee0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/combgraphex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex1.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex1.png new file mode 100644 index 0000000..7df6912 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex2.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex2.png new file mode 100644 index 0000000..0394add Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex3.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex3.png new file mode 100644 index 0000000..5eab173 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex4.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex4.png new file mode 100644 index 0000000..0761abb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex5.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex5.png new file mode 100644 index 0000000..aa03d71 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex6.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex6.png new file mode 100644 index 0000000..a36473a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour2_ex7.png b/includes/jpgraph/docs/chunkhtml/images/contour2_ex7.png new file mode 100644 index 0000000..e00c312 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour2_ex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour_rectang.png b/includes/jpgraph/docs/chunkhtml/images/contour_rectang.png new file mode 100644 index 0000000..14e05f6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour_rectang.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/contour_triangulation.png b/includes/jpgraph/docs/chunkhtml/images/contour_triangulation.png new file mode 100644 index 0000000..f4c6359 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/contour_triangulation.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/csim-html-example-page.png b/includes/jpgraph/docs/chunkhtml/images/csim-html-example-page.png new file mode 100644 index 0000000..47c8a12 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/csim-html-example-page.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix-demoapp.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix-demoapp.png new file mode 100644 index 0000000..c7b939d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix-demoapp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix-encodation-principle.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix-encodation-principle.png new file mode 100644 index 0000000..924a07a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix-encodation-principle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix-ps-output.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix-ps-output.png new file mode 100644 index 0000000..74d4356 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix-ps-output.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix-structure-details.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix-structure-details.png new file mode 100644 index 0000000..d2059ad Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix-structure-details.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_errormsg.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_errormsg.png new file mode 100644 index 0000000..f94a120 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_errormsg.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex0.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex0.png new file mode 100644 index 0000000..caf5d4a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex00.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex00.png new file mode 100644 index 0000000..eaa1b4e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex00.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex1.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex1.png new file mode 100644 index 0000000..8b59382 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex4.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex4.png new file mode 100644 index 0000000..dc98662 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex4.png @@ -0,0 +1 @@ +Datamatrix error message: Datafile for bit placement is corrupt, crc checks fails. diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex5.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex5.png new file mode 100644 index 0000000..07d6095 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex6.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex6.png new file mode 100644 index 0000000..71f1dc3 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex6.png @@ -0,0 +1 @@ +Barcode sucessfully written to file: "/root/jpgraph/trunk/src/Examples/dm_ex6.png" \ No newline at end of file diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex7.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex7.png new file mode 100644 index 0000000..84bf81b --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/datamatrix_ex7.png @@ -0,0 +1,62 @@ +
XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___
+XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___
+XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___XXX___
+XXX___XXX___XXX___XXXXXX_________XXXXXXXXXXXX______XXXXXXXXX
+XXX___XXX___XXX___XXXXXX_________XXXXXXXXXXXX______XXXXXXXXX
+XXX___XXX___XXX___XXXXXX_________XXXXXXXXXXXX______XXXXXXXXX
+XXX_______________XXXXXXXXX_________XXX___XXX______XXX______
+XXX_______________XXXXXXXXX_________XXX___XXX______XXX______
+XXX_______________XXXXXXXXX_________XXX___XXX______XXX______
+XXX_________XXXXXX______XXX___XXX___XXXXXXXXXXXXXXXXXXXXXXXX
+XXX_________XXXXXX______XXX___XXX___XXXXXXXXXXXXXXXXXXXXXXXX
+XXX_________XXXXXX______XXX___XXX___XXXXXXXXXXXXXXXXXXXXXXXX
+XXX___XXXXXX_________XXXXXX______XXXXXX____________XXXXXX___
+XXX___XXXXXX_________XXXXXX______XXXXXX____________XXXXXX___
+XXX___XXXXXX_________XXXXXX______XXXXXX____________XXXXXX___
+XXXXXXXXX______XXXXXXXXXXXX______XXX____________XXXXXX___XXX
+XXXXXXXXX______XXXXXXXXXXXX______XXX____________XXXXXX___XXX
+XXXXXXXXX______XXXXXXXXXXXX______XXX____________XXXXXX___XXX
+XXX______XXXXXXXXX______XXXXXX_________XXX_________XXXXXX___
+XXX______XXXXXXXXX______XXXXXX_________XXX_________XXXXXX___
+XXX______XXXXXXXXX______XXXXXX_________XXX_________XXXXXX___
+XXX___XXX_________XXX___XXXXXX___XXX___XXXXXX___XXX___XXXXXX
+XXX___XXX_________XXX___XXXXXX___XXX___XXXXXX___XXX___XXXXXX
+XXX___XXX_________XXX___XXXXXX___XXX___XXXXXX___XXX___XXXXXX
+XXX______XXXXXXXXX___XXXXXXXXXXXXXXX___XXX___XXX______XXX___
+XXX______XXXXXXXXX___XXXXXXXXXXXXXXX___XXX___XXX______XXX___
+XXX______XXXXXXXXX___XXXXXXXXXXXXXXX___XXX___XXX______XXX___
+XXXXXX_________XXXXXXXXXXXX___XXXXXXXXXXXX______XXX______XXX
+XXXXXX_________XXXXXXXXXXXX___XXXXXXXXXXXX______XXX______XXX
+XXXXXX_________XXXXXXXXXXXX___XXXXXXXXXXXX______XXX______XXX
+XXXXXXXXX_________XXXXXX___XXX_________XXX___XXX____________
+XXXXXXXXX_________XXXXXX___XXX_________XXX___XXX____________
+XXXXXXXXX_________XXXXXX___XXX_________XXX___XXX____________
+XXX____________XXXXXXXXX___XXXXXXXXXXXX___XXX______XXXXXXXXX
+XXX____________XXXXXXXXX___XXXXXXXXXXXX___XXX______XXXXXXXXX
+XXX____________XXXXXXXXX___XXXXXXXXXXXX___XXX______XXXXXXXXX
+XXXXXXXXX___XXXXXXXXXXXX______XXXXXXXXXXXXXXXXXXXXX_________
+XXXXXXXXX___XXXXXXXXXXXX______XXXXXXXXXXXXXXXXXXXXX_________
+XXXXXXXXX___XXXXXXXXXXXX______XXXXXXXXXXXXXXXXXXXXX_________
+XXX___XXX___XXX____________XXXXXX_________XXX____________XXX
+XXX___XXX___XXX____________XXXXXX_________XXX____________XXX
+XXX___XXX___XXX____________XXXXXX_________XXX____________XXX
+XXXXXX___XXX___XXXXXX___XXX______XXX___XXXXXXXXXXXX_________
+XXXXXX___XXX___XXXXXX___XXX______XXX___XXXXXXXXXXXX_________
+XXXXXX___XXX___XXXXXX___XXX______XXX___XXXXXXXXXXXX_________
+XXX______XXXXXX______XXX___XXXXXX___XXXXXXXXXXXX_________XXX
+XXX______XXXXXX______XXX___XXXXXX___XXXXXXXXXXXX_________XXX
+XXX______XXXXXX______XXX___XXXXXX___XXXXXXXXXXXX_________XXX
+XXX______XXXXXX_________XXX____________XXXXXX___XXXXXXXXX___
+XXX______XXXXXX_________XXX____________XXXXXX___XXXXXXXXX___
+XXX______XXXXXX_________XXX____________XXXXXX___XXXXXXXXX___
+XXX______XXX_________XXX___XXX______XXXXXXXXXXXX___XXX___XXX
+XXX______XXX_________XXX___XXX______XXXXXXXXXXXX___XXX___XXX
+XXX______XXX_________XXX___XXX______XXXXXXXXXXXX___XXX___XXX
+XXX____________XXX___XXXXXXXXX______XXXXXXXXXXXX______XXX___
+XXX____________XXX___XXXXXXXXX______XXXXXXXXXXXX______XXX___
+XXX____________XXX___XXXXXXXXX______XXXXXXXXXXXX______XXX___
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+
\ No newline at end of file diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_rect.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_rect.png new file mode 100644 index 0000000..2b56869 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_rect.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datamatrix_square.png b/includes/jpgraph/docs/chunkhtml/images/datamatrix_square.png new file mode 100644 index 0000000..f961576 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datamatrix_square.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/dateaxisex1.png b/includes/jpgraph/docs/chunkhtml/images/dateaxisex1.png new file mode 100644 index 0000000..d9f6184 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/dateaxisex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/dateaxisex2.png b/includes/jpgraph/docs/chunkhtml/images/dateaxisex2.png new file mode 100644 index 0000000..78bbf11 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/dateaxisex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/dateaxisex4.png b/includes/jpgraph/docs/chunkhtml/images/dateaxisex4.png new file mode 100644 index 0000000..6212477 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/dateaxisex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/datescaleticksex01.png b/includes/jpgraph/docs/chunkhtml/images/datescaleticksex01.png new file mode 100644 index 0000000..73108af Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/datescaleticksex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/dateutilex01.png b/includes/jpgraph/docs/chunkhtml/images/dateutilex01.png new file mode 100644 index 0000000..40b9203 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/dateutilex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/dateutilex02.png b/includes/jpgraph/docs/chunkhtml/images/dateutilex02.png new file mode 100644 index 0000000..125b8e0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/dateutilex02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/documentation_buildprocess.png b/includes/jpgraph/docs/chunkhtml/images/documentation_buildprocess.png new file mode 100644 index 0000000..a1f2414 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/documentation_buildprocess.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/errmsg-ex1.png b/includes/jpgraph/docs/chunkhtml/images/errmsg-ex1.png new file mode 100644 index 0000000..9c783ff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/errmsg-ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/errmsg-headersent-de.png b/includes/jpgraph/docs/chunkhtml/images/errmsg-headersent-de.png new file mode 100644 index 0000000..7e59559 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/errmsg-headersent-de.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/errmsg-headersent.png b/includes/jpgraph/docs/chunkhtml/images/errmsg-headersent.png new file mode 100644 index 0000000..3e34f67 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/errmsg-headersent.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/errmsg-only-null.png b/includes/jpgraph/docs/chunkhtml/images/errmsg-only-null.png new file mode 100644 index 0000000..6812730 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/errmsg-only-null.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/errmsg-prod.png b/includes/jpgraph/docs/chunkhtml/images/errmsg-prod.png new file mode 100644 index 0000000..38e9441 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/errmsg-prod.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example0-0.png b/includes/jpgraph/docs/chunkhtml/images/example0-0.png new file mode 100644 index 0000000..294d0f7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example0-0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example0.png b/includes/jpgraph/docs/chunkhtml/images/example0.png new file mode 100644 index 0000000..2f6a4ca Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example11.png b/includes/jpgraph/docs/chunkhtml/images/example11.png new file mode 100644 index 0000000..e280bca Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example11.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example13.png b/includes/jpgraph/docs/chunkhtml/images/example13.png new file mode 100644 index 0000000..27b59c8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example13.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example14.png b/includes/jpgraph/docs/chunkhtml/images/example14.png new file mode 100644 index 0000000..c369289 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example14.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example15.png b/includes/jpgraph/docs/chunkhtml/images/example15.png new file mode 100644 index 0000000..24df644 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example15.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example16.1.png b/includes/jpgraph/docs/chunkhtml/images/example16.1.png new file mode 100644 index 0000000..8b96759 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example16.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example16.3.png b/includes/jpgraph/docs/chunkhtml/images/example16.3.png new file mode 100644 index 0000000..d17c14a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example16.3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example16.4.png b/includes/jpgraph/docs/chunkhtml/images/example16.4.png new file mode 100644 index 0000000..b163639 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example16.4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example16.6.png b/includes/jpgraph/docs/chunkhtml/images/example16.6.png new file mode 100644 index 0000000..64484b0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example16.6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example16.png b/includes/jpgraph/docs/chunkhtml/images/example16.png new file mode 100644 index 0000000..6f9d456 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example16.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example17.png b/includes/jpgraph/docs/chunkhtml/images/example17.png new file mode 100644 index 0000000..cdb7d46 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example17.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example19.1.png b/includes/jpgraph/docs/chunkhtml/images/example19.1.png new file mode 100644 index 0000000..c65f8bf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example19.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example19.png b/includes/jpgraph/docs/chunkhtml/images/example19.png new file mode 100644 index 0000000..636ab4c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example19.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example2.png b/includes/jpgraph/docs/chunkhtml/images/example2.png new file mode 100644 index 0000000..f4870d8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example20.3.png b/includes/jpgraph/docs/chunkhtml/images/example20.3.png new file mode 100644 index 0000000..849c24e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example20.3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example21.png b/includes/jpgraph/docs/chunkhtml/images/example21.png new file mode 100644 index 0000000..3219492 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example21.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example22.png b/includes/jpgraph/docs/chunkhtml/images/example22.png new file mode 100644 index 0000000..47708f0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example22.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example23.png b/includes/jpgraph/docs/chunkhtml/images/example23.png new file mode 100644 index 0000000..1166492 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example23.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example24.png b/includes/jpgraph/docs/chunkhtml/images/example24.png new file mode 100644 index 0000000..dcd993d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example24.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example25.1.png b/includes/jpgraph/docs/chunkhtml/images/example25.1.png new file mode 100644 index 0000000..4532367 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example25.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example25.2.png b/includes/jpgraph/docs/chunkhtml/images/example25.2.png new file mode 100644 index 0000000..555d605 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example25.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example25.png b/includes/jpgraph/docs/chunkhtml/images/example25.png new file mode 100644 index 0000000..7188629 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example25.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example26.1.png b/includes/jpgraph/docs/chunkhtml/images/example26.1.png new file mode 100644 index 0000000..4f43f5e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example26.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example26.png b/includes/jpgraph/docs/chunkhtml/images/example26.png new file mode 100644 index 0000000..1ae5598 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example26.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example27.1.png b/includes/jpgraph/docs/chunkhtml/images/example27.1.png new file mode 100644 index 0000000..4e2d0c8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example27.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example27.2.png b/includes/jpgraph/docs/chunkhtml/images/example27.2.png new file mode 100644 index 0000000..18edbb4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example27.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example27.3.png b/includes/jpgraph/docs/chunkhtml/images/example27.3.png new file mode 100644 index 0000000..1e20876 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example27.3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example27.png b/includes/jpgraph/docs/chunkhtml/images/example27.png new file mode 100644 index 0000000..4852670 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example27.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example28.1.png b/includes/jpgraph/docs/chunkhtml/images/example28.1.png new file mode 100644 index 0000000..c9b27e9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example28.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example28.2.png b/includes/jpgraph/docs/chunkhtml/images/example28.2.png new file mode 100644 index 0000000..43a06f2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example28.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example28.3.png b/includes/jpgraph/docs/chunkhtml/images/example28.3.png new file mode 100644 index 0000000..d725a40 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example28.3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example28.png b/includes/jpgraph/docs/chunkhtml/images/example28.png new file mode 100644 index 0000000..7ab430a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example28.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.0.1.png b/includes/jpgraph/docs/chunkhtml/images/example3.0.1.png new file mode 100644 index 0000000..5625af4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.0.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.0.2.png b/includes/jpgraph/docs/chunkhtml/images/example3.0.2.png new file mode 100644 index 0000000..6d3303e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.0.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.0.3.png b/includes/jpgraph/docs/chunkhtml/images/example3.0.3.png new file mode 100644 index 0000000..fcd4a0f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.0.3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.1.1.png b/includes/jpgraph/docs/chunkhtml/images/example3.1.1.png new file mode 100644 index 0000000..a747702 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.1.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.1.png b/includes/jpgraph/docs/chunkhtml/images/example3.1.png new file mode 100644 index 0000000..f2e9db9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.2.1.png b/includes/jpgraph/docs/chunkhtml/images/example3.2.1.png new file mode 100644 index 0000000..193ecc9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.2.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.2.2.png b/includes/jpgraph/docs/chunkhtml/images/example3.2.2.png new file mode 100644 index 0000000..2b9ac6c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.2.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.2.png b/includes/jpgraph/docs/chunkhtml/images/example3.2.png new file mode 100644 index 0000000..1c101d1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.3.png b/includes/jpgraph/docs/chunkhtml/images/example3.3.png new file mode 100644 index 0000000..f2e9db9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.4.1.png b/includes/jpgraph/docs/chunkhtml/images/example3.4.1.png new file mode 100644 index 0000000..f2e9db9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.4.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.4.png b/includes/jpgraph/docs/chunkhtml/images/example3.4.png new file mode 100644 index 0000000..f2e9db9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example3.png b/includes/jpgraph/docs/chunkhtml/images/example3.png new file mode 100644 index 0000000..52edb83 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example4.png b/includes/jpgraph/docs/chunkhtml/images/example4.png new file mode 100644 index 0000000..18f2304 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example5.png b/includes/jpgraph/docs/chunkhtml/images/example5.png new file mode 100644 index 0000000..97c712a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example6.1.png b/includes/jpgraph/docs/chunkhtml/images/example6.1.png new file mode 100644 index 0000000..4d49352 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example6.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example6.2.png b/includes/jpgraph/docs/chunkhtml/images/example6.2.png new file mode 100644 index 0000000..9891c2d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example6.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example6.png b/includes/jpgraph/docs/chunkhtml/images/example6.png new file mode 100644 index 0000000..73f0cb7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example7.png b/includes/jpgraph/docs/chunkhtml/images/example7.png new file mode 100644 index 0000000..6e2b0fc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example8.png b/includes/jpgraph/docs/chunkhtml/images/example8.png new file mode 100644 index 0000000..74d380f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example9.1.png b/includes/jpgraph/docs/chunkhtml/images/example9.1.png new file mode 100644 index 0000000..2f42c9c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example9.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example9.2.png b/includes/jpgraph/docs/chunkhtml/images/example9.2.png new file mode 100644 index 0000000..fd4942b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example9.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/example9.png b/includes/jpgraph/docs/chunkhtml/images/example9.png new file mode 100644 index 0000000..2f551f2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/example9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/field_arrow_sizes.png b/includes/jpgraph/docs/chunkhtml/images/field_arrow_sizes.png new file mode 100644 index 0000000..f95209f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/field_arrow_sizes.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/fieldscatterex1.png b/includes/jpgraph/docs/chunkhtml/images/fieldscatterex1.png new file mode 100644 index 0000000..215a80f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/fieldscatterex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/filledgridex1.png b/includes/jpgraph/docs/chunkhtml/images/filledgridex1.png new file mode 100644 index 0000000..628cd2f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/filledgridex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/filledlineex01.1.png b/includes/jpgraph/docs/chunkhtml/images/filledlineex01.1.png new file mode 100644 index 0000000..2248eba Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/filledlineex01.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/filledlineex01.png b/includes/jpgraph/docs/chunkhtml/images/filledlineex01.png new file mode 100644 index 0000000..ee4019b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/filledlineex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/filledlineex03.png b/includes/jpgraph/docs/chunkhtml/images/filledlineex03.png new file mode 100644 index 0000000..8bfdb30 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/filledlineex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/fixscale_radarex1.png b/includes/jpgraph/docs/chunkhtml/images/fixscale_radarex1.png new file mode 100644 index 0000000..09dd517 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/fixscale_radarex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-afgh.png b/includes/jpgraph/docs/chunkhtml/images/flag-afgh.png new file mode 100644 index 0000000..69d23d8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-afgh.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-agla.png b/includes/jpgraph/docs/chunkhtml/images/flag-agla.png new file mode 100644 index 0000000..c720812 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-agla.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-alba.png b/includes/jpgraph/docs/chunkhtml/images/flag-alba.png new file mode 100644 index 0000000..4fa461f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-alba.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-alde.png b/includes/jpgraph/docs/chunkhtml/images/flag-alde.png new file mode 100644 index 0000000..acb9e3b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-alde.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-alge.png b/includes/jpgraph/docs/chunkhtml/images/flag-alge.png new file mode 100644 index 0000000..31dc609 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-alge.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-amsa.png b/includes/jpgraph/docs/chunkhtml/images/flag-amsa.png new file mode 100644 index 0000000..527d70d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-amsa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-andr.png b/includes/jpgraph/docs/chunkhtml/images/flag-andr.png new file mode 100644 index 0000000..0bbc80d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-andr.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-angu.png b/includes/jpgraph/docs/chunkhtml/images/flag-angu.png new file mode 100644 index 0000000..19392da Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-angu.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-anta.png b/includes/jpgraph/docs/chunkhtml/images/flag-anta.png new file mode 100644 index 0000000..e601744 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-anta.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-arge.png b/includes/jpgraph/docs/chunkhtml/images/flag-arge.png new file mode 100644 index 0000000..d774d40 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-arge.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-arle.png b/includes/jpgraph/docs/chunkhtml/images/flag-arle.png new file mode 100644 index 0000000..6946d63 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-arle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-arme.png b/includes/jpgraph/docs/chunkhtml/images/flag-arme.png new file mode 100644 index 0000000..154da90 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-arme.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-arub.png b/includes/jpgraph/docs/chunkhtml/images/flag-arub.png new file mode 100644 index 0000000..4aa6662 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-arub.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-astl.png b/includes/jpgraph/docs/chunkhtml/images/flag-astl.png new file mode 100644 index 0000000..6ae7c07 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-astl.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-aust.png b/includes/jpgraph/docs/chunkhtml/images/flag-aust.png new file mode 100644 index 0000000..c6236a6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-aust.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-azer.png b/includes/jpgraph/docs/chunkhtml/images/flag-azer.png new file mode 100644 index 0000000..608e156 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-azer.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bant.png b/includes/jpgraph/docs/chunkhtml/images/flag-bant.png new file mode 100644 index 0000000..dcaaff0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bant.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-belg.png b/includes/jpgraph/docs/chunkhtml/images/flag-belg.png new file mode 100644 index 0000000..9ddd1b3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-belg.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-berm.png b/includes/jpgraph/docs/chunkhtml/images/flag-berm.png new file mode 100644 index 0000000..1503e89 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-berm.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bhms.png b/includes/jpgraph/docs/chunkhtml/images/flag-bhms.png new file mode 100644 index 0000000..27f2c40 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bhms.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bhrn.png b/includes/jpgraph/docs/chunkhtml/images/flag-bhrn.png new file mode 100644 index 0000000..4fdf43d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bhrn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-blru.png b/includes/jpgraph/docs/chunkhtml/images/flag-blru.png new file mode 100644 index 0000000..d58c917 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-blru.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-blva.png b/includes/jpgraph/docs/chunkhtml/images/flag-blva.png new file mode 100644 index 0000000..3f43bba Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-blva.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-blze.png b/includes/jpgraph/docs/chunkhtml/images/flag-blze.png new file mode 100644 index 0000000..5225330 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-blze.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bngl.png b/includes/jpgraph/docs/chunkhtml/images/flag-bngl.png new file mode 100644 index 0000000..e443668 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bngl.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bnin.png b/includes/jpgraph/docs/chunkhtml/images/flag-bnin.png new file mode 100644 index 0000000..bf4aa0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bnin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bots.png b/includes/jpgraph/docs/chunkhtml/images/flag-bots.png new file mode 100644 index 0000000..e946aa4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bots.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-braz.png b/includes/jpgraph/docs/chunkhtml/images/flag-braz.png new file mode 100644 index 0000000..9dad404 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-braz.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-brbd.png b/includes/jpgraph/docs/chunkhtml/images/flag-brbd.png new file mode 100644 index 0000000..1d5806d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-brbd.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-brin.png b/includes/jpgraph/docs/chunkhtml/images/flag-brin.png new file mode 100644 index 0000000..382dc5e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-brin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-brun.png b/includes/jpgraph/docs/chunkhtml/images/flag-brun.png new file mode 100644 index 0000000..af8a3e1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-brun.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bufa.png b/includes/jpgraph/docs/chunkhtml/images/flag-bufa.png new file mode 100644 index 0000000..c01b99e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bufa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bulg.png b/includes/jpgraph/docs/chunkhtml/images/flag-bulg.png new file mode 100644 index 0000000..f058bd7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bulg.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-buru.png b/includes/jpgraph/docs/chunkhtml/images/flag-buru.png new file mode 100644 index 0000000..873aebf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-buru.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-bvis.png b/includes/jpgraph/docs/chunkhtml/images/flag-bvis.png new file mode 100644 index 0000000..d4c96a8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-bvis.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cafr.png b/includes/jpgraph/docs/chunkhtml/images/flag-cafr.png new file mode 100644 index 0000000..19b789d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cafr.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-camb.png b/includes/jpgraph/docs/chunkhtml/images/flag-camb.png new file mode 100644 index 0000000..8cf9cde Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-camb.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-came.png b/includes/jpgraph/docs/chunkhtml/images/flag-came.png new file mode 100644 index 0000000..92959ab Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-came.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cana.png b/includes/jpgraph/docs/chunkhtml/images/flag-cana.png new file mode 100644 index 0000000..80013f0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cana.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cari.png b/includes/jpgraph/docs/chunkhtml/images/flag-cari.png new file mode 100644 index 0000000..00d9128 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cari.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cave.png b/includes/jpgraph/docs/chunkhtml/images/flag-cave.png new file mode 100644 index 0000000..4b15b8d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cave.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-chad.png b/includes/jpgraph/docs/chunkhtml/images/flag-chad.png new file mode 100644 index 0000000..3fe4040 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-chad.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-chil.png b/includes/jpgraph/docs/chunkhtml/images/flag-chil.png new file mode 100644 index 0000000..262e9fc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-chil.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-chin.png b/includes/jpgraph/docs/chunkhtml/images/flag-chin.png new file mode 100644 index 0000000..77e1009 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-chin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-chms.png b/includes/jpgraph/docs/chunkhtml/images/flag-chms.png new file mode 100644 index 0000000..b30dbb5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-chms.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cins.png b/includes/jpgraph/docs/chunkhtml/images/flag-cins.png new file mode 100644 index 0000000..e16b556 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cins.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ckis.png b/includes/jpgraph/docs/chunkhtml/images/flag-ckis.png new file mode 100644 index 0000000..40d30d0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ckis.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-clmb.png b/includes/jpgraph/docs/chunkhtml/images/flag-clmb.png new file mode 100644 index 0000000..014c04c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-clmb.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cois.png b/includes/jpgraph/docs/chunkhtml/images/flag-cois.png new file mode 100644 index 0000000..35bcbb5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cois.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-comn.png b/includes/jpgraph/docs/chunkhtml/images/flag-comn.png new file mode 100644 index 0000000..16f3805 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-comn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-como.png b/includes/jpgraph/docs/chunkhtml/images/flag-como.png new file mode 100644 index 0000000..1bf7b4c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-como.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cong.png b/includes/jpgraph/docs/chunkhtml/images/flag-cong.png new file mode 100644 index 0000000..43cd859 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cong.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-corc.png b/includes/jpgraph/docs/chunkhtml/images/flag-corc.png new file mode 100644 index 0000000..f925900 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-corc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-croa.png b/includes/jpgraph/docs/chunkhtml/images/flag-croa.png new file mode 100644 index 0000000..fb70abb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-croa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cuba.png b/includes/jpgraph/docs/chunkhtml/images/flag-cuba.png new file mode 100644 index 0000000..f65fedf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cuba.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cyis.png b/includes/jpgraph/docs/chunkhtml/images/flag-cyis.png new file mode 100644 index 0000000..6954ad5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cyis.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-cypr.png b/includes/jpgraph/docs/chunkhtml/images/flag-cypr.png new file mode 100644 index 0000000..27b7302 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-cypr.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-czec.png b/includes/jpgraph/docs/chunkhtml/images/flag-czec.png new file mode 100644 index 0000000..fe79dee Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-czec.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-denm.png b/includes/jpgraph/docs/chunkhtml/images/flag-denm.png new file mode 100644 index 0000000..95416ff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-denm.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-djib.png b/includes/jpgraph/docs/chunkhtml/images/flag-djib.png new file mode 100644 index 0000000..c44b989 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-djib.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-domn.png b/includes/jpgraph/docs/chunkhtml/images/flag-domn.png new file mode 100644 index 0000000..54ebfcc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-domn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-dore.png b/includes/jpgraph/docs/chunkhtml/images/flag-dore.png new file mode 100644 index 0000000..ada8ec4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-dore.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ecua.png b/includes/jpgraph/docs/chunkhtml/images/flag-ecua.png new file mode 100644 index 0000000..8743389 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ecua.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-egyp.png b/includes/jpgraph/docs/chunkhtml/images/flag-egyp.png new file mode 100644 index 0000000..25ea94e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-egyp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-elsa.png b/includes/jpgraph/docs/chunkhtml/images/flag-elsa.png new file mode 100644 index 0000000..1a212af Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-elsa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-engl.png b/includes/jpgraph/docs/chunkhtml/images/flag-engl.png new file mode 100644 index 0000000..19042f0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-engl.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-eqgu.png b/includes/jpgraph/docs/chunkhtml/images/flag-eqgu.png new file mode 100644 index 0000000..2be56f9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-eqgu.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-erit.png b/includes/jpgraph/docs/chunkhtml/images/flag-erit.png new file mode 100644 index 0000000..6d971a0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-erit.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-estn.png b/includes/jpgraph/docs/chunkhtml/images/flag-estn.png new file mode 100644 index 0000000..0d226e7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-estn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ethp.png b/includes/jpgraph/docs/chunkhtml/images/flag-ethp.png new file mode 100644 index 0000000..86c4bd6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ethp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-euun.png b/includes/jpgraph/docs/chunkhtml/images/flag-euun.png new file mode 100644 index 0000000..532109b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-euun.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-fais.png b/includes/jpgraph/docs/chunkhtml/images/flag-fais.png new file mode 100644 index 0000000..704d482 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-fais.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-fiav.png b/includes/jpgraph/docs/chunkhtml/images/flag-fiav.png new file mode 100644 index 0000000..f0c6172 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-fiav.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-fiji.png b/includes/jpgraph/docs/chunkhtml/images/flag-fiji.png new file mode 100644 index 0000000..f00b64c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-fiji.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-finl.png b/includes/jpgraph/docs/chunkhtml/images/flag-finl.png new file mode 100644 index 0000000..43d68ff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-finl.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-fpol.png b/includes/jpgraph/docs/chunkhtml/images/flag-fpol.png new file mode 100644 index 0000000..a8b6fb7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-fpol.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-fran.png b/includes/jpgraph/docs/chunkhtml/images/flag-fran.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-fran.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-frgu.png b/includes/jpgraph/docs/chunkhtml/images/flag-frgu.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-frgu.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-gabn.png b/includes/jpgraph/docs/chunkhtml/images/flag-gabn.png new file mode 100644 index 0000000..78ac5c0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-gabn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-gamb.png b/includes/jpgraph/docs/chunkhtml/images/flag-gamb.png new file mode 100644 index 0000000..f455b56 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-gamb.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-geor.png b/includes/jpgraph/docs/chunkhtml/images/flag-geor.png new file mode 100644 index 0000000..c303513 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-geor.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-germ.png b/includes/jpgraph/docs/chunkhtml/images/flag-germ.png new file mode 100644 index 0000000..5c30dcd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-germ.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ghan.png b/includes/jpgraph/docs/chunkhtml/images/flag-ghan.png new file mode 100644 index 0000000..631aa15 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ghan.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-gibr.png b/includes/jpgraph/docs/chunkhtml/images/flag-gibr.png new file mode 100644 index 0000000..84e4fb2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-gibr.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-grec.png b/includes/jpgraph/docs/chunkhtml/images/flag-grec.png new file mode 100644 index 0000000..07638c7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-grec.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-gren.png b/includes/jpgraph/docs/chunkhtml/images/flag-gren.png new file mode 100644 index 0000000..c83af61 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-gren.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-guad.png b/includes/jpgraph/docs/chunkhtml/images/flag-guad.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-guad.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-guam.png b/includes/jpgraph/docs/chunkhtml/images/flag-guam.png new file mode 100644 index 0000000..4d221ef Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-guam.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-guat.png b/includes/jpgraph/docs/chunkhtml/images/flag-guat.png new file mode 100644 index 0000000..9cfba2b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-guat.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-guer.png b/includes/jpgraph/docs/chunkhtml/images/flag-guer.png new file mode 100644 index 0000000..d325b15 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-guer.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-guin.png b/includes/jpgraph/docs/chunkhtml/images/flag-guin.png new file mode 100644 index 0000000..e9032f5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-guin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-hait.png b/includes/jpgraph/docs/chunkhtml/images/flag-hait.png new file mode 100644 index 0000000..500228f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-hait.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-hokn.png b/includes/jpgraph/docs/chunkhtml/images/flag-hokn.png new file mode 100644 index 0000000..34b384c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-hokn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-hond.png b/includes/jpgraph/docs/chunkhtml/images/flag-hond.png new file mode 100644 index 0000000..73651f9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-hond.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-hung.png b/includes/jpgraph/docs/chunkhtml/images/flag-hung.png new file mode 100644 index 0000000..cd1958b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-hung.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-icel.png b/includes/jpgraph/docs/chunkhtml/images/flag-icel.png new file mode 100644 index 0000000..63a2a5b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-icel.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-icrc.png b/includes/jpgraph/docs/chunkhtml/images/flag-icrc.png new file mode 100644 index 0000000..4c8e2a7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-icrc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-inda.png b/includes/jpgraph/docs/chunkhtml/images/flag-inda.png new file mode 100644 index 0000000..7de6e21 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-inda.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-indn.png b/includes/jpgraph/docs/chunkhtml/images/flag-indn.png new file mode 100644 index 0000000..8ba6ef0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-indn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-iraq.png b/includes/jpgraph/docs/chunkhtml/images/flag-iraq.png new file mode 100644 index 0000000..f9b4527 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-iraq.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-irel.png b/includes/jpgraph/docs/chunkhtml/images/flag-irel.png new file mode 100644 index 0000000..4d660aa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-irel.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-isco.png b/includes/jpgraph/docs/chunkhtml/images/flag-isco.png new file mode 100644 index 0000000..4956cb1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-isco.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-isma.png b/includes/jpgraph/docs/chunkhtml/images/flag-isma.png new file mode 100644 index 0000000..6467fd5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-isma.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-isra.png b/includes/jpgraph/docs/chunkhtml/images/flag-isra.png new file mode 100644 index 0000000..8e84c22 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-isra.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ital.png b/includes/jpgraph/docs/chunkhtml/images/flag-ital.png new file mode 100644 index 0000000..8c8716c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ital.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-jama.png b/includes/jpgraph/docs/chunkhtml/images/flag-jama.png new file mode 100644 index 0000000..c285ea5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-jama.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-japa.png b/includes/jpgraph/docs/chunkhtml/images/flag-japa.png new file mode 100644 index 0000000..97664b3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-japa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-jers.png b/includes/jpgraph/docs/chunkhtml/images/flag-jers.png new file mode 100644 index 0000000..771cd6b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-jers.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-jord.png b/includes/jpgraph/docs/chunkhtml/images/flag-jord.png new file mode 100644 index 0000000..d2930bb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-jord.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-kazk.png b/includes/jpgraph/docs/chunkhtml/images/flag-kazk.png new file mode 100644 index 0000000..3eb3ef1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-kazk.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-keny.png b/includes/jpgraph/docs/chunkhtml/images/flag-keny.png new file mode 100644 index 0000000..64d9943 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-keny.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-kirb.png b/includes/jpgraph/docs/chunkhtml/images/flag-kirb.png new file mode 100644 index 0000000..6394828 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-kirb.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-kuwa.png b/includes/jpgraph/docs/chunkhtml/images/flag-kuwa.png new file mode 100644 index 0000000..58fdf8a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-kuwa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-kyrg.png b/includes/jpgraph/docs/chunkhtml/images/flag-kyrg.png new file mode 100644 index 0000000..dae02a8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-kyrg.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-latv.png b/includes/jpgraph/docs/chunkhtml/images/flag-latv.png new file mode 100644 index 0000000..8f05ee0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-latv.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-leba.png b/includes/jpgraph/docs/chunkhtml/images/flag-leba.png new file mode 100644 index 0000000..965a07d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-leba.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-lest.png b/includes/jpgraph/docs/chunkhtml/images/flag-lest.png new file mode 100644 index 0000000..6b31c64 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-lest.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-libe.png b/includes/jpgraph/docs/chunkhtml/images/flag-libe.png new file mode 100644 index 0000000..dfd9989 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-libe.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-liec.png b/includes/jpgraph/docs/chunkhtml/images/flag-liec.png new file mode 100644 index 0000000..6ff745f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-liec.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-lith.png b/includes/jpgraph/docs/chunkhtml/images/flag-lith.png new file mode 100644 index 0000000..f213220 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-lith.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-luxe.png b/includes/jpgraph/docs/chunkhtml/images/flag-luxe.png new file mode 100644 index 0000000..1df36ab Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-luxe.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-maca.png b/includes/jpgraph/docs/chunkhtml/images/flag-maca.png new file mode 100644 index 0000000..224795e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-maca.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mace.png b/includes/jpgraph/docs/chunkhtml/images/flag-mace.png new file mode 100644 index 0000000..ded7527 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mace.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mada.png b/includes/jpgraph/docs/chunkhtml/images/flag-mada.png new file mode 100644 index 0000000..5c1f172 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mada.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mais.png b/includes/jpgraph/docs/chunkhtml/images/flag-mais.png new file mode 100644 index 0000000..797a1c2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mais.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mali.png b/includes/jpgraph/docs/chunkhtml/images/flag-mali.png new file mode 100644 index 0000000..f1b9171 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mali.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mals.png b/includes/jpgraph/docs/chunkhtml/images/flag-mals.png new file mode 100644 index 0000000..298628f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mals.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-malt.png b/includes/jpgraph/docs/chunkhtml/images/flag-malt.png new file mode 100644 index 0000000..6621bba Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-malt.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-malw.png b/includes/jpgraph/docs/chunkhtml/images/flag-malw.png new file mode 100644 index 0000000..3043524 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-malw.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mart.png b/includes/jpgraph/docs/chunkhtml/images/flag-mart.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mart.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-maur.png b/includes/jpgraph/docs/chunkhtml/images/flag-maur.png new file mode 100644 index 0000000..963c6f7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-maur.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mayt.png b/includes/jpgraph/docs/chunkhtml/images/flag-mayt.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mayt.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mexc.png b/includes/jpgraph/docs/chunkhtml/images/flag-mexc.png new file mode 100644 index 0000000..2d54b6b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mexc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-micr.png b/includes/jpgraph/docs/chunkhtml/images/flag-micr.png new file mode 100644 index 0000000..3269c17 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-micr.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-miis.png b/includes/jpgraph/docs/chunkhtml/images/flag-miis.png new file mode 100644 index 0000000..a1e9e27 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-miis.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mold.png b/includes/jpgraph/docs/chunkhtml/images/flag-mold.png new file mode 100644 index 0000000..8184700 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mold.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mona.png b/includes/jpgraph/docs/chunkhtml/images/flag-mona.png new file mode 100644 index 0000000..837faef Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mona.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mong.png b/includes/jpgraph/docs/chunkhtml/images/flag-mong.png new file mode 100644 index 0000000..8f903e2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mong.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mont.png b/includes/jpgraph/docs/chunkhtml/images/flag-mont.png new file mode 100644 index 0000000..318f4fa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mont.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-morc.png b/includes/jpgraph/docs/chunkhtml/images/flag-morc.png new file mode 100644 index 0000000..2d8d6c8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-morc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-moza.png b/includes/jpgraph/docs/chunkhtml/images/flag-moza.png new file mode 100644 index 0000000..389b287 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-moza.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-mrts.png b/includes/jpgraph/docs/chunkhtml/images/flag-mrts.png new file mode 100644 index 0000000..ae2c98f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-mrts.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-myan.png b/includes/jpgraph/docs/chunkhtml/images/flag-myan.png new file mode 100644 index 0000000..2d46b84 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-myan.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-namb.png b/includes/jpgraph/docs/chunkhtml/images/flag-namb.png new file mode 100644 index 0000000..6fb1120 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-namb.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nato.png b/includes/jpgraph/docs/chunkhtml/images/flag-nato.png new file mode 100644 index 0000000..ce919b2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nato.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-naur.png b/includes/jpgraph/docs/chunkhtml/images/flag-naur.png new file mode 100644 index 0000000..d771bf1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-naur.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ncyp.png b/includes/jpgraph/docs/chunkhtml/images/flag-ncyp.png new file mode 100644 index 0000000..250e77b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ncyp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nean.png b/includes/jpgraph/docs/chunkhtml/images/flag-nean.png new file mode 100644 index 0000000..10f3ce0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nean.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nepa.png b/includes/jpgraph/docs/chunkhtml/images/flag-nepa.png new file mode 100644 index 0000000..7008eb8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nepa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-neth.png b/includes/jpgraph/docs/chunkhtml/images/flag-neth.png new file mode 100644 index 0000000..e0b21cd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-neth.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nfis.png b/includes/jpgraph/docs/chunkhtml/images/flag-nfis.png new file mode 100644 index 0000000..6aa562f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nfis.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ngra.png b/includes/jpgraph/docs/chunkhtml/images/flag-ngra.png new file mode 100644 index 0000000..d8d06d2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ngra.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nica.png b/includes/jpgraph/docs/chunkhtml/images/flag-nica.png new file mode 100644 index 0000000..edd3dcd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nica.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nigr.png b/includes/jpgraph/docs/chunkhtml/images/flag-nigr.png new file mode 100644 index 0000000..a2c62d5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nigr.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-niue.png b/includes/jpgraph/docs/chunkhtml/images/flag-niue.png new file mode 100644 index 0000000..851e97e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-niue.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nmar.png b/includes/jpgraph/docs/chunkhtml/images/flag-nmar.png new file mode 100644 index 0000000..cdeeb34 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nmar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-noir.png b/includes/jpgraph/docs/chunkhtml/images/flag-noir.png new file mode 100644 index 0000000..2741573 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-noir.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nord.png b/includes/jpgraph/docs/chunkhtml/images/flag-nord.png new file mode 100644 index 0000000..059a704 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nord.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-norw.png b/includes/jpgraph/docs/chunkhtml/images/flag-norw.png new file mode 100644 index 0000000..bbe4717 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-norw.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nwca.png b/includes/jpgraph/docs/chunkhtml/images/flag-nwca.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nwca.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-nwze.png b/includes/jpgraph/docs/chunkhtml/images/flag-nwze.png new file mode 100644 index 0000000..7f63566 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-nwze.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-oast.png b/includes/jpgraph/docs/chunkhtml/images/flag-oast.png new file mode 100644 index 0000000..82263fc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-oast.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-oaun.png b/includes/jpgraph/docs/chunkhtml/images/flag-oaun.png new file mode 100644 index 0000000..933cf36 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-oaun.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-olym.png b/includes/jpgraph/docs/chunkhtml/images/flag-olym.png new file mode 100644 index 0000000..8b06637 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-olym.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-oman.png b/includes/jpgraph/docs/chunkhtml/images/flag-oman.png new file mode 100644 index 0000000..b74be0f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-oman.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-paks.png b/includes/jpgraph/docs/chunkhtml/images/flag-paks.png new file mode 100644 index 0000000..34a48ba Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-paks.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-pala.png b/includes/jpgraph/docs/chunkhtml/images/flag-pala.png new file mode 100644 index 0000000..6e14b73 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-pala.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-pang.png b/includes/jpgraph/docs/chunkhtml/images/flag-pang.png new file mode 100644 index 0000000..4c64626 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-pang.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-para.png b/includes/jpgraph/docs/chunkhtml/images/flag-para.png new file mode 100644 index 0000000..cd11b43 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-para.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-peru.png b/includes/jpgraph/docs/chunkhtml/images/flag-peru.png new file mode 100644 index 0000000..b4366d0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-peru.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-phil.png b/includes/jpgraph/docs/chunkhtml/images/flag-phil.png new file mode 100644 index 0000000..a24085a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-phil.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-piis.png b/includes/jpgraph/docs/chunkhtml/images/flag-piis.png new file mode 100644 index 0000000..c35e64b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-piis.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-pola.png b/includes/jpgraph/docs/chunkhtml/images/flag-pola.png new file mode 100644 index 0000000..16da9a4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-pola.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-port.png b/includes/jpgraph/docs/chunkhtml/images/flag-port.png new file mode 100644 index 0000000..224795e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-port.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-purc.png b/includes/jpgraph/docs/chunkhtml/images/flag-purc.png new file mode 100644 index 0000000..5fa88e3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-purc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-qata.png b/includes/jpgraph/docs/chunkhtml/images/flag-qata.png new file mode 100644 index 0000000..2c2b6d1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-qata.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-rmna.png b/includes/jpgraph/docs/chunkhtml/images/flag-rmna.png new file mode 100644 index 0000000..9c347f5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-rmna.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-russ.png b/includes/jpgraph/docs/chunkhtml/images/flag-russ.png new file mode 100644 index 0000000..d1960a1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-russ.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-rwan.png b/includes/jpgraph/docs/chunkhtml/images/flag-rwan.png new file mode 100644 index 0000000..12b69a3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-rwan.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-saar.png b/includes/jpgraph/docs/chunkhtml/images/flag-saar.png new file mode 100644 index 0000000..fb9ba6f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-saar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sama.png b/includes/jpgraph/docs/chunkhtml/images/flag-sama.png new file mode 100644 index 0000000..ffc600b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sama.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sami.png b/includes/jpgraph/docs/chunkhtml/images/flag-sami.png new file mode 100644 index 0000000..a3209ae Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sami.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sark.png b/includes/jpgraph/docs/chunkhtml/images/flag-sark.png new file mode 100644 index 0000000..2afb121 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sark.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-scot.png b/includes/jpgraph/docs/chunkhtml/images/flag-scot.png new file mode 100644 index 0000000..bf4fb8d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-scot.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sebo.png b/includes/jpgraph/docs/chunkhtml/images/flag-sebo.png new file mode 100644 index 0000000..426a21b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sebo.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-serb.png b/includes/jpgraph/docs/chunkhtml/images/flag-serb.png new file mode 100644 index 0000000..6020f56 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-serb.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sile.png b/includes/jpgraph/docs/chunkhtml/images/flag-sile.png new file mode 100644 index 0000000..eb42b0a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sile.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sing.png b/includes/jpgraph/docs/chunkhtml/images/flag-sing.png new file mode 100644 index 0000000..1813283 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sing.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-skor.png b/includes/jpgraph/docs/chunkhtml/images/flag-skor.png new file mode 100644 index 0000000..010e0dd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-skor.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-slva.png b/includes/jpgraph/docs/chunkhtml/images/flag-slva.png new file mode 100644 index 0000000..9279ad5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-slva.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-smla.png b/includes/jpgraph/docs/chunkhtml/images/flag-smla.png new file mode 100644 index 0000000..e515708 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-smla.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-smld.png b/includes/jpgraph/docs/chunkhtml/images/flag-smld.png new file mode 100644 index 0000000..0d6451b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-smld.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-soaf.png b/includes/jpgraph/docs/chunkhtml/images/flag-soaf.png new file mode 100644 index 0000000..4ccaaba Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-soaf.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-sois.png b/includes/jpgraph/docs/chunkhtml/images/flag-sois.png new file mode 100644 index 0000000..ac3bd04 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-sois.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-span.png b/includes/jpgraph/docs/chunkhtml/images/flag-span.png new file mode 100644 index 0000000..7b3cf71 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-span.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-spco.png b/includes/jpgraph/docs/chunkhtml/images/flag-spco.png new file mode 100644 index 0000000..0a133c0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-spco.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-srla.png b/includes/jpgraph/docs/chunkhtml/images/flag-srla.png new file mode 100644 index 0000000..5d3c7ad Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-srla.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-stlu.png b/includes/jpgraph/docs/chunkhtml/images/flag-stlu.png new file mode 100644 index 0000000..1c9f2bf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-stlu.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-suda.png b/includes/jpgraph/docs/chunkhtml/images/flag-suda.png new file mode 100644 index 0000000..6916f16 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-suda.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-surn.png b/includes/jpgraph/docs/chunkhtml/images/flag-surn.png new file mode 100644 index 0000000..10be0d4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-surn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-svka.png b/includes/jpgraph/docs/chunkhtml/images/flag-svka.png new file mode 100644 index 0000000..681158c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-svka.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-swdn.png b/includes/jpgraph/docs/chunkhtml/images/flag-swdn.png new file mode 100644 index 0000000..ff3c715 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-swdn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-swit.png b/includes/jpgraph/docs/chunkhtml/images/flag-swit.png new file mode 100644 index 0000000..4c6a05e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-swit.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-syra.png b/includes/jpgraph/docs/chunkhtml/images/flag-syra.png new file mode 100644 index 0000000..af7b524 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-syra.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-szld.png b/includes/jpgraph/docs/chunkhtml/images/flag-szld.png new file mode 100644 index 0000000..db598e7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-szld.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-taiw.png b/includes/jpgraph/docs/chunkhtml/images/flag-taiw.png new file mode 100644 index 0000000..ffd7d77 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-taiw.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tajk.png b/includes/jpgraph/docs/chunkhtml/images/flag-tajk.png new file mode 100644 index 0000000..498874c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tajk.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tanz.png b/includes/jpgraph/docs/chunkhtml/images/flag-tanz.png new file mode 100644 index 0000000..b5e9663 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tanz.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-thal.png b/includes/jpgraph/docs/chunkhtml/images/flag-thal.png new file mode 100644 index 0000000..881faf4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-thal.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tibe.png b/includes/jpgraph/docs/chunkhtml/images/flag-tibe.png new file mode 100644 index 0000000..70f6c7d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tibe.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tkst.png b/includes/jpgraph/docs/chunkhtml/images/flag-tkst.png new file mode 100644 index 0000000..688d386 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tkst.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-togo.png b/includes/jpgraph/docs/chunkhtml/images/flag-togo.png new file mode 100644 index 0000000..83aaefb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-togo.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-toke.png b/includes/jpgraph/docs/chunkhtml/images/flag-toke.png new file mode 100644 index 0000000..7a844f2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-toke.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tong.png b/includes/jpgraph/docs/chunkhtml/images/flag-tong.png new file mode 100644 index 0000000..fd0b482 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tong.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-trdc.png b/includes/jpgraph/docs/chunkhtml/images/flag-trdc.png new file mode 100644 index 0000000..c96bbbd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-trdc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tris.png b/includes/jpgraph/docs/chunkhtml/images/flag-tris.png new file mode 100644 index 0000000..84f7c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tris.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tuns.png b/includes/jpgraph/docs/chunkhtml/images/flag-tuns.png new file mode 100644 index 0000000..9a1fd4f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tuns.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-turk.png b/includes/jpgraph/docs/chunkhtml/images/flag-turk.png new file mode 100644 index 0000000..507c6f8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-turk.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-tuva.png b/includes/jpgraph/docs/chunkhtml/images/flag-tuva.png new file mode 100644 index 0000000..83b3257 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-tuva.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-uaem.png b/includes/jpgraph/docs/chunkhtml/images/flag-uaem.png new file mode 100644 index 0000000..e79703f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-uaem.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ugan.png b/includes/jpgraph/docs/chunkhtml/images/flag-ugan.png new file mode 100644 index 0000000..469e5d7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ugan.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-ukrn.png b/includes/jpgraph/docs/chunkhtml/images/flag-ukrn.png new file mode 100644 index 0000000..7cc01a4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-ukrn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-unkg.png b/includes/jpgraph/docs/chunkhtml/images/flag-unkg.png new file mode 100644 index 0000000..5caf5b5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-unkg.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-unna.png b/includes/jpgraph/docs/chunkhtml/images/flag-unna.png new file mode 100644 index 0000000..93ff5a9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-unna.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-unst.png b/includes/jpgraph/docs/chunkhtml/images/flag-unst.png new file mode 100644 index 0000000..a1e9e27 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-unst.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-urgy.png b/includes/jpgraph/docs/chunkhtml/images/flag-urgy.png new file mode 100644 index 0000000..95c1932 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-urgy.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-usvs.png b/includes/jpgraph/docs/chunkhtml/images/flag-usvs.png new file mode 100644 index 0000000..c0cfd36 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-usvs.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-uzbk.png b/includes/jpgraph/docs/chunkhtml/images/flag-uzbk.png new file mode 100644 index 0000000..496bf97 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-uzbk.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-vacy.png b/includes/jpgraph/docs/chunkhtml/images/flag-vacy.png new file mode 100644 index 0000000..08d5b78 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-vacy.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-vant.png b/includes/jpgraph/docs/chunkhtml/images/flag-vant.png new file mode 100644 index 0000000..9ff600b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-vant.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-venz.png b/includes/jpgraph/docs/chunkhtml/images/flag-venz.png new file mode 100644 index 0000000..9919798 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-venz.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-yemn.png b/includes/jpgraph/docs/chunkhtml/images/flag-yemn.png new file mode 100644 index 0000000..b8260d5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-yemn.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-zare.png b/includes/jpgraph/docs/chunkhtml/images/flag-zare.png new file mode 100644 index 0000000..1fb3a23 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-zare.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/flag-zbwe.png b/includes/jpgraph/docs/chunkhtml/images/flag-zbwe.png new file mode 100644 index 0000000..b828aca Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/flag-zbwe.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/footer1.png b/includes/jpgraph/docs/chunkhtml/images/footer1.png new file mode 100644 index 0000000..a37a69b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/footer1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/footerex1.png b/includes/jpgraph/docs/chunkhtml/images/footerex1.png new file mode 100644 index 0000000..1e03ad5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/footerex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/funcex2.png b/includes/jpgraph/docs/chunkhtml/images/funcex2.png new file mode 100644 index 0000000..dc0ef08 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/funcex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_3dplane.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_3dplane.png new file mode 100644 index 0000000..17fcfcb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_3dplane.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_caption.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_caption.png new file mode 100644 index 0000000..c9e1e3c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_caption.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_diagcross.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_diagcross.png new file mode 100644 index 0000000..4fd1963 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_diagcross.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_hline.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_hline.png new file mode 100644 index 0000000..02f9de8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_hline.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_hvcross.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_hvcross.png new file mode 100644 index 0000000..d201de3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_hvcross.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_ldiag.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_ldiag.png new file mode 100644 index 0000000..16ff10b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_ldiag.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_rdiag.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_rdiag.png new file mode 100644 index 0000000..59328bc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_rdiag.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_rightmarker.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_rightmarker.png new file mode 100644 index 0000000..ff18c0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_rightmarker.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_solid.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_solid.png new file mode 100644 index 0000000..1feb899 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_solid.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-bar_vline.png b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_vline.png new file mode 100644 index 0000000..4518b0b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-bar_vline.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-end-to-end.png b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-end-to-end.png new file mode 100644 index 0000000..9fba038 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-end-to-end.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-end-to-start.png b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-end-to-start.png new file mode 100644 index 0000000..7b566e2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-end-to-start.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-start-to-end.png b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-start-to-end.png new file mode 100644 index 0000000..df1f038 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-start-to-end.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-start-to-start.png b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-start-to-start.png new file mode 100644 index 0000000..e7f6ecb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-constraint-start-to-start.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-divider-lines-original-amended.png b/includes/jpgraph/docs/chunkhtml/images/gantt-divider-lines-original-amended.png new file mode 100644 index 0000000..122e58b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-divider-lines-original-amended.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-divider-lines-original.png b/includes/jpgraph/docs/chunkhtml/images/gantt-divider-lines-original.png new file mode 100644 index 0000000..7502b10 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-divider-lines-original.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-group-illustration.png b/includes/jpgraph/docs/chunkhtml/images/gantt-group-illustration.png new file mode 100644 index 0000000..41dd821 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-group-illustration.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-locale-error.png b/includes/jpgraph/docs/chunkhtml/images/gantt-locale-error.png new file mode 100644 index 0000000..737ef5c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-locale-error.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original-amended-small.png b/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original-amended-small.png new file mode 100644 index 0000000..acd7276 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original-amended-small.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original-amended.png b/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original-amended.png new file mode 100644 index 0000000..51755f4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original-amended.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original.png b/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original.png new file mode 100644 index 0000000..6fcc08c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-properties-original.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-scale-headers-amended.png b/includes/jpgraph/docs/chunkhtml/images/gantt-scale-headers-amended.png new file mode 100644 index 0000000..61402d0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-scale-headers-amended.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt-scale-headers.png b/includes/jpgraph/docs/chunkhtml/images/gantt-scale-headers.png new file mode 100644 index 0000000..7c98bf5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt-scale-headers.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt_samerowex1.png b/includes/jpgraph/docs/chunkhtml/images/gantt_samerowex1.png new file mode 100644 index 0000000..5917e43 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt_samerowex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt_samerowex2.png b/includes/jpgraph/docs/chunkhtml/images/gantt_samerowex2.png new file mode 100644 index 0000000..ea82bd8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt_samerowex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantt_textex1.png b/includes/jpgraph/docs/chunkhtml/images/gantt_textex1.png new file mode 100644 index 0000000..6311494 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantt_textex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttcolumnfontsex01.png b/includes/jpgraph/docs/chunkhtml/images/ganttcolumnfontsex01.png new file mode 100644 index 0000000..ec4fa61 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttcolumnfontsex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttconstrainex2.png b/includes/jpgraph/docs/chunkhtml/images/ganttconstrainex2.png new file mode 100644 index 0000000..4aa0669 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttconstrainex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex00.png b/includes/jpgraph/docs/chunkhtml/images/ganttex00.png new file mode 100644 index 0000000..87b336d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex00.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex01.png b/includes/jpgraph/docs/chunkhtml/images/ganttex01.png new file mode 100644 index 0000000..a7fcf6c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex03.png b/includes/jpgraph/docs/chunkhtml/images/ganttex03.png new file mode 100644 index 0000000..54e0bf6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex04.png b/includes/jpgraph/docs/chunkhtml/images/ganttex04.png new file mode 100644 index 0000000..fc1d000 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex06.png b/includes/jpgraph/docs/chunkhtml/images/ganttex06.png new file mode 100644 index 0000000..8d22f45 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex06.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex07.png b/includes/jpgraph/docs/chunkhtml/images/ganttex07.png new file mode 100644 index 0000000..8d22f45 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex07.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex08.png b/includes/jpgraph/docs/chunkhtml/images/ganttex08.png new file mode 100644 index 0000000..8f949eb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex08.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex13-zoom1.png b/includes/jpgraph/docs/chunkhtml/images/ganttex13-zoom1.png new file mode 100644 index 0000000..f910279 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex13-zoom1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex13-zoom2.png b/includes/jpgraph/docs/chunkhtml/images/ganttex13-zoom2.png new file mode 100644 index 0000000..39032ab Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex13-zoom2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex14.png b/includes/jpgraph/docs/chunkhtml/images/ganttex14.png new file mode 100644 index 0000000..211e0fa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex14.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex15.png b/includes/jpgraph/docs/chunkhtml/images/ganttex15.png new file mode 100644 index 0000000..5eebe39 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex15.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex16.png b/includes/jpgraph/docs/chunkhtml/images/ganttex16.png new file mode 100644 index 0000000..e0d1939 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex16.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex17-flag.png b/includes/jpgraph/docs/chunkhtml/images/ganttex17-flag.png new file mode 100644 index 0000000..459b0ce Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex17-flag.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex18.png b/includes/jpgraph/docs/chunkhtml/images/ganttex18.png new file mode 100644 index 0000000..47bfd6a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex18.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex19.png b/includes/jpgraph/docs/chunkhtml/images/ganttex19.png new file mode 100644 index 0000000..87bd7c7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex19.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttex30.png b/includes/jpgraph/docs/chunkhtml/images/ganttex30.png new file mode 100644 index 0000000..fe1317a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttex30.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantthourex1.png b/includes/jpgraph/docs/chunkhtml/images/gantthourex1.png new file mode 100644 index 0000000..bb4dd93 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantthourex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantthourminex1.png b/includes/jpgraph/docs/chunkhtml/images/gantthourminex1.png new file mode 100644 index 0000000..b2f0eed Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantthourminex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_calc.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_calc.png new file mode 100644 index 0000000..23cfb77 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_calc.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_edit.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_edit.png new file mode 100644 index 0000000..22b4ecb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_edit.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_endconstrain.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_endconstrain.png new file mode 100644 index 0000000..a029166 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_endconstrain.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_error.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_error.png new file mode 100644 index 0000000..7c63a39 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_error.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_file_important.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_file_important.png new file mode 100644 index 0000000..59dd95a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_file_important.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_folder_orange.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_folder_orange.png new file mode 100644 index 0000000..111fedf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_folder_orange.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_folder_orange_open.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_folder_orange_open.png new file mode 100644 index 0000000..ddf1d17 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_folder_orange_open.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_lock.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_lock.png new file mode 100644 index 0000000..df1b2e0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_lock.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_mail.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_mail.png new file mode 100644 index 0000000..06f2d82 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_mail.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_startconstrain.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_startconstrain.png new file mode 100644 index 0000000..b983feb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_startconstrain.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_stop.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_stop.png new file mode 100644 index 0000000..51ecc27 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_stop.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_viewmag.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_viewmag.png new file mode 100644 index 0000000..b6e504c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_viewmag.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticon_warning.png b/includes/jpgraph/docs/chunkhtml/images/gantticon_warning.png new file mode 100644 index 0000000..53336ca Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticon_warning.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gantticonex1.png b/includes/jpgraph/docs/chunkhtml/images/gantticonex1.png new file mode 100644 index 0000000..d699b8f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gantticonex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex2.png b/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex2.png new file mode 100644 index 0000000..49f0574 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex3.png b/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex3.png new file mode 100644 index 0000000..33e215a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex4.png b/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex4.png new file mode 100644 index 0000000..6c88cee Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttmonthyearex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ganttsimpleex1.png b/includes/jpgraph/docs/chunkhtml/images/ganttsimpleex1.png new file mode 100644 index 0000000..5744ab0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ganttsimpleex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grace_ex0.png b/includes/jpgraph/docs/chunkhtml/images/grace_ex0.png new file mode 100644 index 0000000..7819839 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grace_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grace_ex1.png b/includes/jpgraph/docs/chunkhtml/images/grace_ex1.png new file mode 100644 index 0000000..ae76068 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grace_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grace_ex2.png b/includes/jpgraph/docs/chunkhtml/images/grace_ex2.png new file mode 100644 index 0000000..cac8477 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grace_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grace_ex3.png b/includes/jpgraph/docs/chunkhtml/images/grace_ex3.png new file mode 100644 index 0000000..5daba94 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grace_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_frame.png b/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_frame.png new file mode 100644 index 0000000..64d3cc9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_frame.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_margin.png b/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_margin.png new file mode 100644 index 0000000..1d57205 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_margin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_plot.png b/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_plot.png new file mode 100644 index 0000000..1d466d8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_bgrad_plot.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_center.png b/includes/jpgraph/docs/chunkhtml/images/grad_center.png new file mode 100644 index 0000000..bdf3c54 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_center.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_diagonal.png b/includes/jpgraph/docs/chunkhtml/images/grad_diagonal.png new file mode 100644 index 0000000..3f2d1a5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_diagonal.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_hor.png b/includes/jpgraph/docs/chunkhtml/images/grad_hor.png new file mode 100644 index 0000000..5d7ba0b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_hor.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_left_reflection.png b/includes/jpgraph/docs/chunkhtml/images/grad_left_reflection.png new file mode 100644 index 0000000..b4d1189 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_left_reflection.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_midhor.png b/includes/jpgraph/docs/chunkhtml/images/grad_midhor.png new file mode 100644 index 0000000..b7a6415 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_midhor.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_midver.png b/includes/jpgraph/docs/chunkhtml/images/grad_midver.png new file mode 100644 index 0000000..a8362a3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_midver.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_raised_panel.png b/includes/jpgraph/docs/chunkhtml/images/grad_raised_panel.png new file mode 100644 index 0000000..0aacb26 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_raised_panel.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_right_reflection.png b/includes/jpgraph/docs/chunkhtml/images/grad_right_reflection.png new file mode 100644 index 0000000..19dafcc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_right_reflection.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_vert.png b/includes/jpgraph/docs/chunkhtml/images/grad_vert.png new file mode 100644 index 0000000..2b1100a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_vert.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_wide_midhor.png b/includes/jpgraph/docs/chunkhtml/images/grad_wide_midhor.png new file mode 100644 index 0000000..865fc5e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_wide_midhor.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/grad_wide_midver.png b/includes/jpgraph/docs/chunkhtml/images/grad_wide_midver.png new file mode 100644 index 0000000..f49cb63 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/grad_wide_midver.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gradbkgex1.png b/includes/jpgraph/docs/chunkhtml/images/gradbkgex1.png new file mode 100644 index 0000000..1c7a00b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gradbkgex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gradlinefillex1.png b/includes/jpgraph/docs/chunkhtml/images/gradlinefillex1.png new file mode 100644 index 0000000..4f96e1e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gradlinefillex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gradlinefillex2.png b/includes/jpgraph/docs/chunkhtml/images/gradlinefillex2.png new file mode 100644 index 0000000..471dd44 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gradlinefillex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gradlinefillex3.png b/includes/jpgraph/docs/chunkhtml/images/gradlinefillex3.png new file mode 100644 index 0000000..210c835 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/gradlinefillex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/graph-obj-overview.png b/includes/jpgraph/docs/chunkhtml/images/graph-obj-overview.png new file mode 100644 index 0000000..ebed360 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/graph-obj-overview.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/graph_for_background_example.png b/includes/jpgraph/docs/chunkhtml/images/graph_for_background_example.png new file mode 100644 index 0000000..9fdf8bd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/graph_for_background_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/green_example.png b/includes/jpgraph/docs/chunkhtml/images/green_example.png new file mode 100644 index 0000000..10f04e7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/green_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/gridstylesex1.png b/includes/jpgraph/docs/chunkhtml/images/gridstylesex1.png new file mode 100644 index 0000000..e69de29 diff --git a/includes/jpgraph/docs/chunkhtml/images/groupbarex1.png b/includes/jpgraph/docs/chunkhtml/images/groupbarex1.png new file mode 100644 index 0000000..2b66633 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/groupbarex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/heat1.jpg b/includes/jpgraph/docs/chunkhtml/images/heat1.jpg new file mode 100644 index 0000000..07f04d7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/heat1.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/horizbarex1.png b/includes/jpgraph/docs/chunkhtml/images/horizbarex1.png new file mode 100644 index 0000000..7169a71 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/horizbarex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/horizbarex4.png b/includes/jpgraph/docs/chunkhtml/images/horizbarex4.png new file mode 100644 index 0000000..cf3c105 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/horizbarex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/horizbarex6.png b/includes/jpgraph/docs/chunkhtml/images/horizbarex6.png new file mode 100644 index 0000000..d1cdfce Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/horizbarex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_circle.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_circle.png new file mode 100644 index 0000000..236c7a1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_circle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_cross.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_cross.png new file mode 100644 index 0000000..433c83a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_cross.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_diamond.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_diamond.png new file mode 100644 index 0000000..23befa4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_diamond.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_dtriangle.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_dtriangle.png new file mode 100644 index 0000000..8f5896c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_dtriangle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_filledcircle.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_filledcircle.png new file mode 100644 index 0000000..61eecff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_filledcircle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_flash.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_flash.png new file mode 100644 index 0000000..5746b0b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_flash.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_lefttriangle.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_lefttriangle.png new file mode 100644 index 0000000..0428fff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_lefttriangle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_none.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_none.png new file mode 100644 index 0000000..94d29fb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_none.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_righttriangle.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_righttriangle.png new file mode 100644 index 0000000..a3a5a24 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_righttriangle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_square.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_square.png new file mode 100644 index 0000000..c6149a6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_square.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_star.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_star.png new file mode 100644 index 0000000..0a9ba10 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_star.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_utriangle.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_utriangle.png new file mode 100644 index 0000000..b23fa9d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_utriangle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_marker_x.png b/includes/jpgraph/docs/chunkhtml/images/img_marker_x.png new file mode 100644 index 0000000..7fbe1d8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_marker_x.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaccbar.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaccbar.png new file mode 100644 index 0000000..8714e57 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaccbar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaccbar90.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaccbar90.png new file mode 100644 index 0000000..cd9108d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaccbar90.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1.png new file mode 100644 index 0000000..16acd82 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis10.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis10.png new file mode 100644 index 0000000..051510e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1top.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1top.png new file mode 100644 index 0000000..59715d7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1top.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1topbox.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1topbox.png new file mode 100644 index 0000000..2b53b0f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis1topbox.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis2.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis2.png new file mode 100644 index 0000000..91025cb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis3.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis3.png new file mode 100644 index 0000000..91e2a74 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis4.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis4.png new file mode 100644 index 0000000..b5b5f2a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis5.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis5.png new file mode 100644 index 0000000..05735cc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis6.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis6.png new file mode 100644 index 0000000..a811930 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmaxis9.png b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis9.png new file mode 100644 index 0000000..e0b895e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmaxis9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmbar.png b/includes/jpgraph/docs/chunkhtml/images/img_mmbar.png new file mode 100644 index 0000000..e17b694 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmbar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmbar90.png b/includes/jpgraph/docs/chunkhtml/images/img_mmbar90.png new file mode 100644 index 0000000..801ac43 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmbar90.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmgroupaccbar.png b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupaccbar.png new file mode 100644 index 0000000..75f8f1d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupaccbar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmgroupaccbar90.png b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupaccbar90.png new file mode 100644 index 0000000..3eddad8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupaccbar90.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmgroupbar.png b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupbar.png new file mode 100644 index 0000000..bedeb9a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupbar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmgroupbar90.png b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupbar90.png new file mode 100644 index 0000000..de880d8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmgroupbar90.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend1.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend1.png new file mode 100644 index 0000000..cdc5da9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend10.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend10.png new file mode 100644 index 0000000..e8e3de7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend15.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend15.png new file mode 100644 index 0000000..c6c51ec Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend15.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend2.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend2.png new file mode 100644 index 0000000..8057aec Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend3.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend3.png new file mode 100644 index 0000000..621a116 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend35.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend35.png new file mode 100644 index 0000000..c91dd06 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend35.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend4.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend4.png new file mode 100644 index 0000000..7dc7f28 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend5.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend5.png new file mode 100644 index 0000000..5a26242 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend55.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend55.png new file mode 100644 index 0000000..6ae53de Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend55.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend6.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend6.png new file mode 100644 index 0000000..3e76e6d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend7.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend7.png new file mode 100644 index 0000000..be60277 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend75.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend75.png new file mode 100644 index 0000000..29b75f2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend75.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend8.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend8.png new file mode 100644 index 0000000..d366fe4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmlegend9.png b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend9.png new file mode 100644 index 0000000..f8def49 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmlegend9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_10.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_10.png new file mode 100644 index 0000000..ac27ecb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_20.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_20.png new file mode 100644 index 0000000..527f907 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_20.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_30.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_30.png new file mode 100644 index 0000000..557086b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_30.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_40.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_40.png new file mode 100644 index 0000000..30a330d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_40.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_50.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_50.png new file mode 100644 index 0000000..653e111 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_50.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_60.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_60.png new file mode 100644 index 0000000..0262275 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_60.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_70.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_70.png new file mode 100644 index 0000000..9773303 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_70.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_80.png b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_80.png new file mode 100644 index 0000000..7a93366 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/img_mmpie3d_80.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/imgmarkerex1.png b/includes/jpgraph/docs/chunkhtml/images/imgmarkerex1.png new file mode 100644 index 0000000..086394e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/imgmarkerex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/impulsex1.png b/includes/jpgraph/docs/chunkhtml/images/impulsex1.png new file mode 100644 index 0000000..52bdd8b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/impulsex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/impulsex3.png b/includes/jpgraph/docs/chunkhtml/images/impulsex3.png new file mode 100644 index 0000000..bb0e3fe Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/impulsex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/impulsex4.png b/includes/jpgraph/docs/chunkhtml/images/impulsex4.png new file mode 100644 index 0000000..a14dfa7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/impulsex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/interpolation-growth-log.png b/includes/jpgraph/docs/chunkhtml/images/interpolation-growth-log.png new file mode 100644 index 0000000..2322df6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/interpolation-growth-log.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/interpolation-growth.png b/includes/jpgraph/docs/chunkhtml/images/interpolation-growth.png new file mode 100644 index 0000000..62a76b9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/interpolation-growth.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/inyaxisex2.png b/includes/jpgraph/docs/chunkhtml/images/inyaxisex2.png new file mode 100644 index 0000000..436bc8f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/inyaxisex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/jpgraph-and-php.png b/includes/jpgraph/docs/chunkhtml/images/jpgraph-and-php.png new file mode 100644 index 0000000..b14c2f9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/jpgraph-and-php.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/led_cyrillic1.png b/includes/jpgraph/docs/chunkhtml/images/led_cyrillic1.png new file mode 100644 index 0000000..5128409 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/led_cyrillic1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/led_cyrillic2.png b/includes/jpgraph/docs/chunkhtml/images/led_cyrillic2.png new file mode 100644 index 0000000..eb7992a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/led_cyrillic2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex1.png b/includes/jpgraph/docs/chunkhtml/images/ledex1.png new file mode 100644 index 0000000..bd7e3b5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex10.png b/includes/jpgraph/docs/chunkhtml/images/ledex10.png new file mode 100644 index 0000000..58b16ad Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex11.png b/includes/jpgraph/docs/chunkhtml/images/ledex11.png new file mode 100644 index 0000000..a78a6fd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex11.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex12.png b/includes/jpgraph/docs/chunkhtml/images/ledex12.png new file mode 100644 index 0000000..030e9d6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex12.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex13.png b/includes/jpgraph/docs/chunkhtml/images/ledex13.png new file mode 100644 index 0000000..86b0886 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex13.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex14.png b/includes/jpgraph/docs/chunkhtml/images/ledex14.png new file mode 100644 index 0000000..e4791d4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex14.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex15.png b/includes/jpgraph/docs/chunkhtml/images/ledex15.png new file mode 100644 index 0000000..5cbd813 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex15.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex16.png b/includes/jpgraph/docs/chunkhtml/images/ledex16.png new file mode 100644 index 0000000..2bac173 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex16.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex17.png b/includes/jpgraph/docs/chunkhtml/images/ledex17.png new file mode 100644 index 0000000..969819b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex17.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex2.png b/includes/jpgraph/docs/chunkhtml/images/ledex2.png new file mode 100644 index 0000000..a51ba17 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex3.png b/includes/jpgraph/docs/chunkhtml/images/ledex3.png new file mode 100644 index 0000000..18175c0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex4.1.png b/includes/jpgraph/docs/chunkhtml/images/ledex4.1.png new file mode 100644 index 0000000..086aec6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex4.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex4.2.png b/includes/jpgraph/docs/chunkhtml/images/ledex4.2.png new file mode 100644 index 0000000..8544824 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex4.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex4.png b/includes/jpgraph/docs/chunkhtml/images/ledex4.png new file mode 100644 index 0000000..8be7e14 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex5.png b/includes/jpgraph/docs/chunkhtml/images/ledex5.png new file mode 100644 index 0000000..019411c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex6.png b/includes/jpgraph/docs/chunkhtml/images/ledex6.png new file mode 100644 index 0000000..2cac430 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex7.png b/includes/jpgraph/docs/chunkhtml/images/ledex7.png new file mode 100644 index 0000000..faa66b6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex8.png b/includes/jpgraph/docs/chunkhtml/images/ledex8.png new file mode 100644 index 0000000..98e5c28 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ledex9.png b/includes/jpgraph/docs/chunkhtml/images/ledex9.png new file mode 100644 index 0000000..8a36f53 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ledex9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/legend-1col.png b/includes/jpgraph/docs/chunkhtml/images/legend-1col.png new file mode 100644 index 0000000..00d7f01 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/legend-1col.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/legend-2col.png b/includes/jpgraph/docs/chunkhtml/images/legend-2col.png new file mode 100644 index 0000000..b840941 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/legend-2col.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/legend-3col.png b/includes/jpgraph/docs/chunkhtml/images/legend-3col.png new file mode 100644 index 0000000..bdcc9c6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/legend-3col.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/legend-4col.png b/includes/jpgraph/docs/chunkhtml/images/legend-4col.png new file mode 100644 index 0000000..873bb48 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/legend-4col.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/legend-col-layouts.png b/includes/jpgraph/docs/chunkhtml/images/legend-col-layouts.png new file mode 100644 index 0000000..b7f69e3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/legend-col-layouts.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linebarcentex1.png b/includes/jpgraph/docs/chunkhtml/images/linebarcentex1.png new file mode 100644 index 0000000..5baf7ae Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linebarcentex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/lineiconex1.png b/includes/jpgraph/docs/chunkhtml/images/lineiconex1.png new file mode 100644 index 0000000..0199900 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/lineiconex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/lineiconex2.png b/includes/jpgraph/docs/chunkhtml/images/lineiconex2.png new file mode 100644 index 0000000..2d7c91f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/lineiconex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/lineimagefillex1.png b/includes/jpgraph/docs/chunkhtml/images/lineimagefillex1.png new file mode 100644 index 0000000..4c131e4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/lineimagefillex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linestyle_antialias.png b/includes/jpgraph/docs/chunkhtml/images/linestyle_antialias.png new file mode 100644 index 0000000..8cb46fc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linestyle_antialias.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linestyle_dashed.png b/includes/jpgraph/docs/chunkhtml/images/linestyle_dashed.png new file mode 100644 index 0000000..4962be9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linestyle_dashed.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linestyle_dotted.png b/includes/jpgraph/docs/chunkhtml/images/linestyle_dotted.png new file mode 100644 index 0000000..3b571f2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linestyle_dotted.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linestyle_longdash.png b/includes/jpgraph/docs/chunkhtml/images/linestyle_longdash.png new file mode 100644 index 0000000..e79d50b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linestyle_longdash.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linestyle_standard.png b/includes/jpgraph/docs/chunkhtml/images/linestyle_standard.png new file mode 100644 index 0000000..c8eef06 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linestyle_standard.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/linestyle_thick.png b/includes/jpgraph/docs/chunkhtml/images/linestyle_thick.png new file mode 100644 index 0000000..3d1c198 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/linestyle_thick.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/listfontsex1.png b/includes/jpgraph/docs/chunkhtml/images/listfontsex1.png new file mode 100644 index 0000000..c651527 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/listfontsex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/loglogex1.png b/includes/jpgraph/docs/chunkhtml/images/loglogex1.png new file mode 100644 index 0000000..b02b437 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/loglogex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manscaleex1.png b/includes/jpgraph/docs/chunkhtml/images/manscaleex1.png new file mode 100644 index 0000000..688c5b5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manscaleex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manscaleex2.png b/includes/jpgraph/docs/chunkhtml/images/manscaleex2.png new file mode 100644 index 0000000..4af484a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manscaleex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manscaleex3.png b/includes/jpgraph/docs/chunkhtml/images/manscaleex3.png new file mode 100644 index 0000000..804d38b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manscaleex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex1.png b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex1.png new file mode 100644 index 0000000..a9b6fed Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex2.png b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex2.png new file mode 100644 index 0000000..512f6a1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex3.png b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex3.png new file mode 100644 index 0000000..40419fb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex4.png b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex4.png new file mode 100644 index 0000000..3e06817 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manual_textscale_ex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manualtickex1.png b/includes/jpgraph/docs/chunkhtml/images/manualtickex1.png new file mode 100644 index 0000000..24c16a4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manualtickex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manualtickex1a.png b/includes/jpgraph/docs/chunkhtml/images/manualtickex1a.png new file mode 100644 index 0000000..750954f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manualtickex1a.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manualtickex2.png b/includes/jpgraph/docs/chunkhtml/images/manualtickex2.png new file mode 100644 index 0000000..d23b94c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manualtickex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manualtickex3.png b/includes/jpgraph/docs/chunkhtml/images/manualtickex3.png new file mode 100644 index 0000000..a83e666 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manualtickex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/manualtickex4.png b/includes/jpgraph/docs/chunkhtml/images/manualtickex4.png new file mode 100644 index 0000000..5e9c4e7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/manualtickex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/markflagex1.png b/includes/jpgraph/docs/chunkhtml/images/markflagex1.png new file mode 100644 index 0000000..fcfb96f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/markflagex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix-colormap-contrast.png b/includes/jpgraph/docs/chunkhtml/images/matrix-colormap-contrast.png new file mode 100644 index 0000000..e893c9a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix-colormap-contrast.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_csimex01.png b/includes/jpgraph/docs/chunkhtml/images/matrix_csimex01.png new file mode 100644 index 0000000..abd6bce --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/matrix_csimex01.png @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_edgeex01.png b/includes/jpgraph/docs/chunkhtml/images/matrix_edgeex01.png new file mode 100644 index 0000000..b1d8cad Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_edgeex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex0.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex0.png new file mode 100644 index 0000000..a220d03 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex03.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex03.png new file mode 100644 index 0000000..0d0577c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.1.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.1.png new file mode 100644 index 0000000..d3ac48f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.2.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.2.png new file mode 100644 index 0000000..ff3dd42 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.png new file mode 100644 index 0000000..48de09e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex05.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex05.png new file mode 100644 index 0000000..2c8b9bd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex05.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_ex06.png b/includes/jpgraph/docs/chunkhtml/images/matrix_ex06.png new file mode 100644 index 0000000..0b74afb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_ex06.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_introex.png b/includes/jpgraph/docs/chunkhtml/images/matrix_introex.png new file mode 100644 index 0000000..ebaf597 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_introex.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_layout_ex1.png b/includes/jpgraph/docs/chunkhtml/images/matrix_layout_ex1.png new file mode 100644 index 0000000..400c23a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_layout_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_legend_pos.png b/includes/jpgraph/docs/chunkhtml/images/matrix_legend_pos.png new file mode 100644 index 0000000..99dd5c7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_legend_pos.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_mesh1.png b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh1.png new file mode 100644 index 0000000..747f1cf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_mesh2.png b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh2.png new file mode 100644 index 0000000..435ee84 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_mesh3.png b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh3.png new file mode 100644 index 0000000..ffdcffa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_mesh4.png b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh4.png new file mode 100644 index 0000000..c8a8311 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/matrix_mesh5.png b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh5.png new file mode 100644 index 0000000..db85104 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/matrix_mesh5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/mkgrad.png b/includes/jpgraph/docs/chunkhtml/images/mkgrad.png new file mode 100644 index 0000000..6094768 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/mkgrad.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/mulyaxisex1.png b/includes/jpgraph/docs/chunkhtml/images/mulyaxisex1.png new file mode 100644 index 0000000..45f2f99 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/mulyaxisex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/mulycsim_example_static.png b/includes/jpgraph/docs/chunkhtml/images/mulycsim_example_static.png new file mode 100644 index 0000000..df9605c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/mulycsim_example_static.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/nullvalues1.png b/includes/jpgraph/docs/chunkhtml/images/nullvalues1.png new file mode 100644 index 0000000..09b56aa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/nullvalues1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/nullvalues2.png b/includes/jpgraph/docs/chunkhtml/images/nullvalues2.png new file mode 100644 index 0000000..2a3b9fa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/nullvalues2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/nullvalues3.png b/includes/jpgraph/docs/chunkhtml/images/nullvalues3.png new file mode 100644 index 0000000..3ec3824 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/nullvalues3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ocean_example.png b/includes/jpgraph/docs/chunkhtml/images/ocean_example.png new file mode 100644 index 0000000..bedd09f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ocean_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odometer_bulletin.png b/includes/jpgraph/docs/chunkhtml/images/odometer_bulletin.png new file mode 100644 index 0000000..5bcbe9c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odometer_bulletin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex00.png b/includes/jpgraph/docs/chunkhtml/images/odotutex00.png new file mode 100644 index 0000000..4e84848 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex00.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex01.png b/includes/jpgraph/docs/chunkhtml/images/odotutex01.png new file mode 100644 index 0000000..a242a75 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex02.png b/includes/jpgraph/docs/chunkhtml/images/odotutex02.png new file mode 100644 index 0000000..5460db4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex03.png b/includes/jpgraph/docs/chunkhtml/images/odotutex03.png new file mode 100644 index 0000000..02547a2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex03.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex04.png b/includes/jpgraph/docs/chunkhtml/images/odotutex04.png new file mode 100644 index 0000000..853dc58 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex06.png b/includes/jpgraph/docs/chunkhtml/images/odotutex06.png new file mode 100644 index 0000000..b3a2941 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex06.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex07.png b/includes/jpgraph/docs/chunkhtml/images/odotutex07.png new file mode 100644 index 0000000..fe4d1f5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex07.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex08.png b/includes/jpgraph/docs/chunkhtml/images/odotutex08.png new file mode 100644 index 0000000..6d63eff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex08.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex09.png b/includes/jpgraph/docs/chunkhtml/images/odotutex09.png new file mode 100644 index 0000000..0029d1c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex09.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex10.png b/includes/jpgraph/docs/chunkhtml/images/odotutex10.png new file mode 100644 index 0000000..5c1208a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex11.png b/includes/jpgraph/docs/chunkhtml/images/odotutex11.png new file mode 100644 index 0000000..60024e2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex11.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex12.png b/includes/jpgraph/docs/chunkhtml/images/odotutex12.png new file mode 100644 index 0000000..fae0af3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex12.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex13.png b/includes/jpgraph/docs/chunkhtml/images/odotutex13.png new file mode 100644 index 0000000..a33619d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex13.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex14.png b/includes/jpgraph/docs/chunkhtml/images/odotutex14.png new file mode 100644 index 0000000..87e222e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex14.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex15.png b/includes/jpgraph/docs/chunkhtml/images/odotutex15.png new file mode 100644 index 0000000..a0b4b4e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex15.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex16.1.png b/includes/jpgraph/docs/chunkhtml/images/odotutex16.1.png new file mode 100644 index 0000000..72defce Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex16.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex16.png b/includes/jpgraph/docs/chunkhtml/images/odotutex16.png new file mode 100644 index 0000000..8223a82 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex16.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex17.png b/includes/jpgraph/docs/chunkhtml/images/odotutex17.png new file mode 100644 index 0000000..be15413 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex17.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex18.png b/includes/jpgraph/docs/chunkhtml/images/odotutex18.png new file mode 100644 index 0000000..fa6d8d9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex18.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/odotutex19.png b/includes/jpgraph/docs/chunkhtml/images/odotutex19.png new file mode 100644 index 0000000..cc96d8a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/odotutex19.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/orange-scale.png b/includes/jpgraph/docs/chunkhtml/images/orange-scale.png new file mode 100644 index 0000000..b45533d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/orange-scale.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/orange_example.png b/includes/jpgraph/docs/chunkhtml/images/orange_example.png new file mode 100644 index 0000000..3c32518 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/orange_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/partiallyfilledlineex1.png b/includes/jpgraph/docs/chunkhtml/images/partiallyfilledlineex1.png new file mode 100644 index 0000000..c6b397c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/partiallyfilledlineex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pastel_example.png b/includes/jpgraph/docs/chunkhtml/images/pastel_example.png new file mode 100644 index 0000000..4ec60f7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pastel_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417-demoapp.png b/includes/jpgraph/docs/chunkhtml/images/pdf417-demoapp.png new file mode 100644 index 0000000..3fc1e0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417-demoapp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417-encodation-principle.png b/includes/jpgraph/docs/chunkhtml/images/pdf417-encodation-principle.png new file mode 100644 index 0000000..aceda2a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417-encodation-principle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-details.png b/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-details.png new file mode 100644 index 0000000..08ba6f7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-details.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-overview-smaller.png b/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-overview-smaller.png new file mode 100644 index 0000000..4f25350 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-overview-smaller.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-overview.png b/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-overview.png new file mode 100644 index 0000000..6e984e4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417-structure-overview.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_PDF-417.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_PDF-417.png new file mode 100644 index 0000000..ecb20bf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_PDF-417.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex0.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex0.png new file mode 100644 index 0000000..a23b8f8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex1.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex1.png new file mode 100644 index 0000000..a23b8f8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex1b.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex1b.png new file mode 100644 index 0000000..a24f8a5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex1b.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex2.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex2.png new file mode 100644 index 0000000..c4ce14a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex3.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex3.png new file mode 100644 index 0000000..d1ed84d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex4.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex4.png new file mode 100644 index 0000000..14d980f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex5.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex5.png new file mode 100644 index 0000000..9924ecc --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex5.png @@ -0,0 +1,102 @@ +%!PS-Adobe-3.0
+%%Title: PDF417 Barcode for "PDF-417"
+%%Creator: JpGraph Barcode http://jpgraph.net/
+%%CreationDate: Wed 6 Oct 23:36:04 2010
+%%DocumentPaperSizes: A4
+%%EndComments
+%%BeginProlog
+%%EndProlog
+
+%%Page: 1 1
+
+%%Module width: 0.8 pt
+
+%%Font definition for normal and small fonts
+/f {/Helvetica findfont 9 scalefont setfont} def
+/fs {/Helvetica findfont 9 scalefont setfont} def
+
+%%Data for bars. Only black bars are defined.
+%%The figures are for each row and in format: [height xpos width]
+[ [2.4 15.2 6.4] [2.4 19.6 0.8] [2.4 21.2 0.8] [2.4 22.8 0.8]
+ [2.4 27.2 3.2] [2.4 30 0.8] [2.4 32.8 3.2] [2.4 36.8 3.2]
+ [2.4 40.8 3.2] [2.4 44.4 0.8] [2.4 47.6 0.8] [2.4 49.2 0.8]
+ [2.4 53.2 0.8] [2.4 54.8 0.8] [2.4 59.2 3.2] [2.4 63.6 0.8]
+ [2.4 66.8 0.8] [2.4 70 0.8] [2.4 76 3.2] [2.4 78.8 0.8]
+ [2.4 80.4 0.8] [2.4 84.4 0.8] [2.4 89.6 3.2] [2.4 92.4 0.8]
+ [2.4 95.2 3.2] [2.4 99.6 0.8] [2.4 101.2 0.8] [2.4 104.4 0.8]
+ [2.4 108.8 3.2] [2.4 111.6 0.8] [2.4 115.6 0.8] [2.4 118.8 0.8]
+ [2.4 121.6 1.6] [2.4 126 0.8] [2.4 130 2.4] [2.4 132.4 0.8]
+ [2.4 134.8 0.8] [2.4 138.4 3.2] [2.4 142.8 0.8] [2.4 145.6 3.2]
+ [2.4 149.2 2.4] [2.4 151.6 0.8] [2.4 154 2.4] [2.4 157.6 1.6]
+ [2.4 164.4 5.6] [2.4 168.4 0.8] [2.4 171.6 0.8] [2.4 173.2 0.8] [2.4 175.6 0.8]
+] {{} forall setlinewidth 22.4 moveto -1 mul 0 exch rlineto stroke} forall
+
+[ [2.4 15.2 6.4] [2.4 19.6 0.8] [2.4 21.2 0.8] [2.4 22.8 0.8]
+ [2.4 26 0.8] [2.4 27.6 0.8] [2.4 30.4 3.2] [2.4 35.2 3.2]
+ [2.4 39.6 0.8] [2.4 43.6 0.8] [2.4 45.6 1.6] [2.4 51.2 1.6]
+ [2.4 54 2.4] [2.4 57.2 2.4] [2.4 59.6 0.8] [2.4 64.4 0.8]
+ [2.4 67.6 2.4] [2.4 70.8 2.4] [2.4 74 0.8] [2.4 78 0.8]
+ [2.4 80.4 0.8] [2.4 82.8 2.4] [2.4 86.4 3.2] [2.4 89.6 1.6]
+ [2.4 94 0.8] [2.4 96 1.6] [2.4 101.6 1.6] [2.4 105.2 0.8]
+ [2.4 107.6 0.8] [2.4 109.2 0.8] [2.4 113.6 1.6] [2.4 119.2 1.6]
+ [2.4 121.2 0.8] [2.4 122.8 0.8] [2.4 125.6 1.6] [2.4 128.8 1.6]
+ [2.4 135.2 1.6] [2.4 139.6 2.4] [2.4 144 1.6] [2.4 146 0.8]
+ [2.4 150 4] [2.4 153.2 0.8] [2.4 155.6 0.8] [2.4 158.8 4]
+ [2.4 164.4 5.6] [2.4 168.4 0.8] [2.4 171.6 0.8] [2.4 173.2 0.8] [2.4 175.6 0.8]
+] {{} forall setlinewidth 24.8 moveto -1 mul 0 exch rlineto stroke} forall
+
+[ [2.4 15.2 6.4] [2.4 19.6 0.8] [2.4 21.2 0.8] [2.4 22.8 0.8]
+ [2.4 26.8 2.4] [2.4 29.2 0.8] [2.4 30.8 0.8] [2.4 36 4.8]
+ [2.4 39.6 0.8] [2.4 42.8 2.4] [2.4 45.2 0.8] [2.4 48 1.6]
+ [2.4 53.2 0.8] [2.4 56.4 4] [2.4 62 2.4] [2.4 64.8 1.6]
+ [2.4 66.8 0.8] [2.4 70.8 2.4] [2.4 76.4 0.8] [2.4 78.4 1.6]
+ [2.4 80.4 0.8] [2.4 83.2 3.2] [2.4 86.8 0.8] [2.4 90.8 0.8]
+ [2.4 94 0.8] [2.4 96.4 0.8] [2.4 99.6 2.4] [2.4 104 4.8]
+ [2.4 108 1.6] [2.4 113.2 0.8] [2.4 114.8 0.8] [2.4 118 4]
+ [2.4 121.2 0.8] [2.4 122.8 0.8] [2.4 127.2 1.6] [2.4 130.8 4]
+ [2.4 134.8 0.8] [2.4 138.4 3.2] [2.4 141.2 0.8] [2.4 144.4 0.8]
+ [2.4 148.8 1.6] [2.4 150.8 0.8] [2.4 152.8 1.6] [2.4 156.8 4.8]
+ [2.4 164.4 5.6] [2.4 168.4 0.8] [2.4 171.6 0.8] [2.4 173.2 0.8] [2.4 175.6 0.8]
+] {{} forall setlinewidth 27.2 moveto -1 mul 0 exch rlineto stroke} forall
+
+[ [2.4 15.2 6.4] [2.4 19.6 0.8] [2.4 21.2 0.8] [2.4 22.8 0.8]
+ [2.4 27.2 3.2] [2.4 30 0.8] [2.4 32 1.6] [2.4 34.4 1.6]
+ [2.4 40.4 2.4] [2.4 46 0.8] [2.4 48.8 1.6] [2.4 51.6 0.8]
+ [2.4 53.6 1.6] [2.4 56 1.6] [2.4 59.2 3.2] [2.4 64.4 0.8]
+ [2.4 66.8 0.8] [2.4 69.6 3.2] [2.4 73.2 0.8] [2.4 76 3.2]
+ [2.4 81.6 3.2] [2.4 85.6 1.6] [2.4 88.8 1.6] [2.4 92.4 0.8]
+ [2.4 94.8 2.4] [2.4 97.2 0.8] [2.4 100 1.6] [2.4 105.2 0.8]
+ [2.4 108.4 2.4] [2.4 112.4 0.8] [2.4 115.6 2.4] [2.4 118.4 1.6]
+ [2.4 123.2 4.8] [2.4 127.2 1.6] [2.4 130 0.8] [2.4 132 1.6]
+ [2.4 136.4 4] [2.4 140.8 1.6] [2.4 143.6 0.8] [2.4 145.2 0.8]
+ [2.4 150.4 4.8] [2.4 154 0.8] [2.4 155.6 0.8] [2.4 158 2.4]
+ [2.4 164.4 5.6] [2.4 168.4 0.8] [2.4 171.6 0.8] [2.4 173.2 0.8] [2.4 175.6 0.8]
+] {{} forall setlinewidth 29.6 moveto -1 mul 0 exch rlineto stroke} forall
+
+[ [2.4 15.2 6.4] [2.4 19.6 0.8] [2.4 21.2 0.8] [2.4 22.8 0.8]
+ [2.4 27.2 3.2] [2.4 30 0.8] [2.4 31.6 0.8] [2.4 34.4 3.2]
+ [2.4 40 1.6] [2.4 42 0.8] [2.4 43.6 0.8] [2.4 48 1.6]
+ [2.4 54 2.4] [2.4 57.2 2.4] [2.4 60 1.6] [2.4 63.2 1.6]
+ [2.4 67.6 2.4] [2.4 70.4 1.6] [2.4 72.4 0.8] [2.4 75.2 1.6]
+ [2.4 81.2 2.4] [2.4 84.8 1.6] [2.4 88.4 0.8] [2.4 90.4 1.6]
+ [2.4 94 0.8] [2.4 95.6 0.8] [2.4 100 1.6] [2.4 105.6 1.6]
+ [2.4 108.4 2.4] [2.4 111.2 1.6] [2.4 114 0.8] [2.4 117.6 1.6]
+ [2.4 121.2 0.8] [2.4 125.6 1.6] [2.4 129.6 1.6] [2.4 132.4 0.8]
+ [2.4 134.8 0.8] [2.4 139.2 1.6] [2.4 143.2 1.6] [2.4 146 0.8]
+ [2.4 149.2 2.4] [2.4 151.6 0.8] [2.4 153.2 0.8] [2.4 157.2 2.4]
+ [2.4 164.4 5.6] [2.4 168.4 0.8] [2.4 171.6 0.8] [2.4 173.2 0.8] [2.4 175.6 0.8]
+] {{} forall setlinewidth 32 moveto -1 mul 0 exch rlineto stroke} forall
+
+
+
+%%Readable text
+f
+[[(PDF-417) 94]]
+{ {} forall 1 index stringwidth pop 2 div sub 1 10 add moveto show} forall
+
+
+%%End of PDF417 barcode
+
+showpage
+
+%%Trailer
diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_ex6.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex6.png new file mode 100644 index 0000000..c062ba7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_ex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_trunc01.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_trunc01.png new file mode 100644 index 0000000..5d5040d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_trunc01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pdf417_trunc02.png b/includes/jpgraph/docs/chunkhtml/images/pdf417_trunc02.png new file mode 100644 index 0000000..863844f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pdf417_trunc02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/php-htmlerr-missing-key.png b/includes/jpgraph/docs/chunkhtml/images/php-htmlerr-missing-key.png new file mode 100644 index 0000000..b4491fd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/php-htmlerr-missing-key.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/phpinfo-gd.png b/includes/jpgraph/docs/chunkhtml/images/phpinfo-gd.png new file mode 100644 index 0000000..90ef245 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/phpinfo-gd.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie2daa.png b/includes/jpgraph/docs/chunkhtml/images/pie2daa.png new file mode 100644 index 0000000..3a17a83 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie2daa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie2dnoaa.png b/includes/jpgraph/docs/chunkhtml/images/pie2dnoaa.png new file mode 100644 index 0000000..1a46db6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie2dnoaa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie3daa.png b/includes/jpgraph/docs/chunkhtml/images/pie3daa.png new file mode 100644 index 0000000..fa4ea98 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie3daa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie3dnoaa.png b/includes/jpgraph/docs/chunkhtml/images/pie3dnoaa.png new file mode 100644 index 0000000..01e3657 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie3dnoaa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie_theme_earth.png b/includes/jpgraph/docs/chunkhtml/images/pie_theme_earth.png new file mode 100644 index 0000000..18f8ea0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie_theme_earth.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie_theme_pastel.png b/includes/jpgraph/docs/chunkhtml/images/pie_theme_pastel.png new file mode 100644 index 0000000..18f3919 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie_theme_pastel.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie_theme_sand.png b/includes/jpgraph/docs/chunkhtml/images/pie_theme_sand.png new file mode 100644 index 0000000..24e4c91 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie_theme_sand.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pie_theme_water.png b/includes/jpgraph/docs/chunkhtml/images/pie_theme_water.png new file mode 100644 index 0000000..aaad275 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pie_theme_water.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/piebkgex1.png b/includes/jpgraph/docs/chunkhtml/images/piebkgex1.png new file mode 100644 index 0000000..e0d10e9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/piebkgex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/piecex1.png b/includes/jpgraph/docs/chunkhtml/images/piecex1.png new file mode 100644 index 0000000..833600e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/piecex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/piecex2.png b/includes/jpgraph/docs/chunkhtml/images/piecex2.png new file mode 100644 index 0000000..8f271c4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/piecex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pieex3.png b/includes/jpgraph/docs/chunkhtml/images/pieex3.png new file mode 100644 index 0000000..67c6441 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pieex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pieex8.png b/includes/jpgraph/docs/chunkhtml/images/pieex8.png new file mode 100644 index 0000000..668301b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pieex8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pieex9.png b/includes/jpgraph/docs/chunkhtml/images/pieex9.png new file mode 100644 index 0000000..32617d3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pieex9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/piegraph-obj-overview.png b/includes/jpgraph/docs/chunkhtml/images/piegraph-obj-overview.png new file mode 100644 index 0000000..ce145d1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/piegraph-obj-overview.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pielabelsex1.png b/includes/jpgraph/docs/chunkhtml/images/pielabelsex1.png new file mode 100644 index 0000000..7a42b91 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pielabelsex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pielabelsex2.png b/includes/jpgraph/docs/chunkhtml/images/pielabelsex2.png new file mode 100644 index 0000000..3520897 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pielabelsex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pielabelsex4.png b/includes/jpgraph/docs/chunkhtml/images/pielabelsex4.png new file mode 100644 index 0000000..7d2fed8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pielabelsex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pielabelsex5.png b/includes/jpgraph/docs/chunkhtml/images/pielabelsex5.png new file mode 100644 index 0000000..23bbaf8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pielabelsex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/piepercent1.png b/includes/jpgraph/docs/chunkhtml/images/piepercent1.png new file mode 100644 index 0000000..b194c21 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/piepercent1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/piepercent2.png b/includes/jpgraph/docs/chunkhtml/images/piepercent2.png new file mode 100644 index 0000000..2375e98 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/piepercent2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex0.png b/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex0.png new file mode 100644 index 0000000..bb65d35 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex1.png b/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex1.png new file mode 100644 index 0000000..a77c23a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex2.png b/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex2.png new file mode 100644 index 0000000..6740cd0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotbanddensity_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_antispam.jpg b/includes/jpgraph/docs/chunkhtml/images/ploticon_antispam.jpg new file mode 100644 index 0000000..53ff6ca Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_antispam.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_area.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_area.png new file mode 100644 index 0000000..201b7e9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_area.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_balloon.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_balloon.png new file mode 100644 index 0000000..a06cf1b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_balloon.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_bar.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_bar.png new file mode 100644 index 0000000..8714e57 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_bar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_barcode.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_barcode.png new file mode 100644 index 0000000..8b87e1e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_barcode.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_canvas.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_canvas.png new file mode 100644 index 0000000..88f0232 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_canvas.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_contour.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_contour.png new file mode 100644 index 0000000..607ce0e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_contour.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_error.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_error.png new file mode 100644 index 0000000..4a99078 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_error.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_field.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_field.png new file mode 100644 index 0000000..869cf9b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_field.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_gantt.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_gantt.png new file mode 100644 index 0000000..30a20a1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_gantt.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_geomap.jpg b/includes/jpgraph/docs/chunkhtml/images/ploticon_geomap.jpg new file mode 100644 index 0000000..164c4ab Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_geomap.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_impuls.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_impuls.png new file mode 100644 index 0000000..87a81a4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_impuls.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_line.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_line.png new file mode 100644 index 0000000..1ee5146 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_line.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_odo.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_odo.png new file mode 100644 index 0000000..5ca98d4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_odo.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_pie2d.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_pie2d.png new file mode 100644 index 0000000..5e39003 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_pie2d.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_pie3d.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_pie3d.png new file mode 100644 index 0000000..653e111 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_pie3d.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_polar.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_polar.png new file mode 100644 index 0000000..e5f233b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_polar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_radar.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_radar.png new file mode 100644 index 0000000..9a45b24 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_radar.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_ring.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_ring.png new file mode 100644 index 0000000..0c1f4c7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_ring.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_scatter.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_scatter.png new file mode 100644 index 0000000..2e08aa0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_scatter.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_spline.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_spline.png new file mode 100644 index 0000000..eef2bfe Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_spline.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_stock.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_stock.png new file mode 100644 index 0000000..bbc9ca8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_stock.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/ploticon_windrose.png b/includes/jpgraph/docs/chunkhtml/images/ploticon_windrose.png new file mode 100644 index 0000000..1afd23d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/ploticon_windrose.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_bevel.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_bevel.png new file mode 100644 index 0000000..2d8d8b1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_bevel.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_diamond.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_diamond.png new file mode 100644 index 0000000..e579887 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_diamond.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_lball.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_lball.png new file mode 100644 index 0000000..300b28c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_lball.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_mball.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_mball.png new file mode 100644 index 0000000..230da35 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_mball.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_pushpin.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_pushpin.png new file mode 100644 index 0000000..8d5d6ed Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_pushpin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_sball.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_sball.png new file mode 100644 index 0000000..876d15f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_sball.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_square.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_square.png new file mode 100644 index 0000000..60aea60 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_square.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_star.png b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_star.png new file mode 100644 index 0000000..77ac4fb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/plotmark_colors_img_star.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarclockex1.png b/includes/jpgraph/docs/chunkhtml/images/polarclockex1.png new file mode 100644 index 0000000..8ded8d2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarclockex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarclockex2.png b/includes/jpgraph/docs/chunkhtml/images/polarclockex2.png new file mode 100644 index 0000000..432f894 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarclockex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex0-180.png b/includes/jpgraph/docs/chunkhtml/images/polarex0-180.png new file mode 100644 index 0000000..f24a7fe Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex0-180.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex0.png b/includes/jpgraph/docs/chunkhtml/images/polarex0.png new file mode 100644 index 0000000..461957d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex3-lin.png b/includes/jpgraph/docs/chunkhtml/images/polarex3-lin.png new file mode 100644 index 0000000..85b464c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex3-lin.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex3.png b/includes/jpgraph/docs/chunkhtml/images/polarex3.png new file mode 100644 index 0000000..9cc6dfe Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex4.png b/includes/jpgraph/docs/chunkhtml/images/polarex4.png new file mode 100644 index 0000000..8448142 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex5.png b/includes/jpgraph/docs/chunkhtml/images/polarex5.png new file mode 100644 index 0000000..3abfe9c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex7-1.png b/includes/jpgraph/docs/chunkhtml/images/polarex7-1.png new file mode 100644 index 0000000..a347f2a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex7-1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex7-2.png b/includes/jpgraph/docs/chunkhtml/images/polarex7-2.png new file mode 100644 index 0000000..f0997fa Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex7-2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/polarex9.png b/includes/jpgraph/docs/chunkhtml/images/polarex9.png new file mode 100644 index 0000000..40dc6a8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/polarex9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/post_request_phase1.png b/includes/jpgraph/docs/chunkhtml/images/post_request_phase1.png new file mode 100644 index 0000000..7dae1f8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/post_request_phase1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/post_request_phase2.png b/includes/jpgraph/docs/chunkhtml/images/post_request_phase2.png new file mode 100644 index 0000000..437eba3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/post_request_phase2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/post_vs_header.png b/includes/jpgraph/docs/chunkhtml/images/post_vs_header.png new file mode 100644 index 0000000..797045e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/post_vs_header.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/prepaccdata_example.png b/includes/jpgraph/docs/chunkhtml/images/prepaccdata_example.png new file mode 100644 index 0000000..a3fa7af Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/prepaccdata_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pro-login.jpg b/includes/jpgraph/docs/chunkhtml/images/pro-login.jpg new file mode 100644 index 0000000..ecd0442 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pro-login.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pro-login.png b/includes/jpgraph/docs/chunkhtml/images/pro-login.png new file mode 100644 index 0000000..a28fefe Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pro-login.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/pushpinex1.png b/includes/jpgraph/docs/chunkhtml/images/pushpinex1.png new file mode 100644 index 0000000..ac492db Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/pushpinex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-ASCII.png b/includes/jpgraph/docs/chunkhtml/images/qr-ASCII.png new file mode 100644 index 0000000..a9a669a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-ASCII.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-code-large.png b/includes/jpgraph/docs/chunkhtml/images/qr-code-large.png new file mode 100644 index 0000000..4cf141e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-code-large.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-code-medium.png b/includes/jpgraph/docs/chunkhtml/images/qr-code-medium.png new file mode 100644 index 0000000..8fcc8de Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-code-medium.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-code-small.png b/includes/jpgraph/docs/chunkhtml/images/qr-code-small.png new file mode 100644 index 0000000..ea6774e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-code-small.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-demoapp.png b/includes/jpgraph/docs/chunkhtml/images/qr-demoapp.png new file mode 100644 index 0000000..57a01d2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-demoapp.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-encodation-principle.png b/includes/jpgraph/docs/chunkhtml/images/qr-encodation-principle.png new file mode 100644 index 0000000..c3905f2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-encodation-principle.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-postscript.png b/includes/jpgraph/docs/chunkhtml/images/qr-postscript.png new file mode 100644 index 0000000..084945e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-postscript.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr-structure-details.png b/includes/jpgraph/docs/chunkhtml/images/qr-structure-details.png new file mode 100644 index 0000000..9363701 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr-structure-details.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr_errmsg.png b/includes/jpgraph/docs/chunkhtml/images/qr_errmsg.png new file mode 100644 index 0000000..be079b5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr_errmsg.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr_template.png b/includes/jpgraph/docs/chunkhtml/images/qr_template.png new file mode 100644 index 0000000..03244d2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr_template.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr_usage1.jpg b/includes/jpgraph/docs/chunkhtml/images/qr_usage1.jpg new file mode 100644 index 0000000..44d552b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr_usage1.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr_usage2.jpg b/includes/jpgraph/docs/chunkhtml/images/qr_usage2.jpg new file mode 100644 index 0000000..cecd4da Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr_usage2.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qr_usage3.jpg b/includes/jpgraph/docs/chunkhtml/images/qr_usage3.jpg new file mode 100644 index 0000000..370f62f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qr_usage3.jpg differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample0.png b/includes/jpgraph/docs/chunkhtml/images/qrexample0.png new file mode 100644 index 0000000..bdcb6c5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample00.png b/includes/jpgraph/docs/chunkhtml/images/qrexample00.png new file mode 100644 index 0000000..bdcb6c5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample00.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample01.png b/includes/jpgraph/docs/chunkhtml/images/qrexample01.png new file mode 100644 index 0000000..c175f65 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample03.png b/includes/jpgraph/docs/chunkhtml/images/qrexample03.png new file mode 100644 index 0000000..8bc7de6 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/qrexample03.png @@ -0,0 +1 @@ +QR Barcode, (Version: 3-M), image stored in file qrexample03.png \ No newline at end of file diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample04.png b/includes/jpgraph/docs/chunkhtml/images/qrexample04.png new file mode 100644 index 0000000..450feb9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample04.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample05.png b/includes/jpgraph/docs/chunkhtml/images/qrexample05.png new file mode 100644 index 0000000..4a8aeb8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample05.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample06.png b/includes/jpgraph/docs/chunkhtml/images/qrexample06.png new file mode 100644 index 0000000..d863678 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample06.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample07.png b/includes/jpgraph/docs/chunkhtml/images/qrexample07.png new file mode 100644 index 0000000..e9be625 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample07.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample08.png b/includes/jpgraph/docs/chunkhtml/images/qrexample08.png new file mode 100644 index 0000000..d785373 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample08.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample09.png b/includes/jpgraph/docs/chunkhtml/images/qrexample09.png new file mode 100644 index 0000000..3bdb669 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample09.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample10.png b/includes/jpgraph/docs/chunkhtml/images/qrexample10.png new file mode 100644 index 0000000..6d91624 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/qrexample10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample11.png b/includes/jpgraph/docs/chunkhtml/images/qrexample11.png new file mode 100644 index 0000000..69b6e2c --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/qrexample11.png @@ -0,0 +1,49 @@ +
%!PS-Adobe-3.0
+%%Title: QR Barcode 2-H, mask=6
+%%Creator: JpGraph Barcode http://jpgraph.net/
+%%CreationDate: Wed 6 Oct 23:36:10 2010
+%%DocumentPaperSizes: A4
+%%EndComments
+%%BeginProlog
+%%EndProlog
+%%Page: 1 1
+
+%Module width: 3 pt
+
+%Data: ABCDEFGH01234567
+%Each line represents one row and the x-position for black modules: [xpos]
+
+3.05 setlinewidth
+[[12][15][18][21][24][27][30][45][51][66][69][72][75][78][81][84]] {{} forall 87 moveto 0 -3.05 rlineto stroke} forall
+[[12][30][45][66][84]] {{} forall 84 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][21][24][30][36][39][42][45][51][66][72][75][78][84]] {{} forall 81 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][21][24][30][36][39][45][48][51][54][66][72][75][78][84]] {{} forall 78 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][21][24][30][45][66][72][75][78][84]] {{} forall 75 moveto 0 -3.05 rlineto stroke} forall
+[[12][30][39][45][48][51][54][60][66][84]] {{} forall 72 moveto 0 -3.05 rlineto stroke} forall
+[[12][15][18][21][24][27][30][36][42][48][54][60][66][69][72][75][78][81][84]] {{} forall 69 moveto 0 -3.05 rlineto stroke} forall
+[[39][42][51][60]] {{} forall 66 moveto 0 -3.05 rlineto stroke} forall
+[[21][24][30][33][39][48][51][54][60][75][78]] {{} forall 63 moveto 0 -3.05 rlineto stroke} forall
+[[15][18][27][39][42][45][48][51][54][57][69][78][81][84]] {{} forall 60 moveto 0 -3.05 rlineto stroke} forall
+[[12][21][27][30][33][36][42][51][54][57][60][66][75][78][84]] {{} forall 57 moveto 0 -3.05 rlineto stroke} forall
+[[18][21][27][39][45][51][57][60][63][66][81][84]] {{} forall 54 moveto 0 -3.05 rlineto stroke} forall
+[[12][15][18][24][27][30][33][39][51][57][63][69][75][84]] {{} forall 51 moveto 0 -3.05 rlineto stroke} forall
+[[12][15][21][48][66][69][81][84]] {{} forall 48 moveto 0 -3.05 rlineto stroke} forall
+[[12][15][18][21][24][30][36][51][54][57][72][78][81]] {{} forall 45 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][24][27][39][45][51][60][75][78][84]] {{} forall 42 moveto 0 -3.05 rlineto stroke} forall
+[[12][24][27][30][33][42][48][57][60][63][66][69][72]] {{} forall 39 moveto 0 -3.05 rlineto stroke} forall
+[[36][42][45][60][72][75][78][84]] {{} forall 36 moveto 0 -3.05 rlineto stroke} forall
+[[12][15][18][21][24][27][30][36][39][48][51][54][57][60][66][72][81][84]] {{} forall 33 moveto 0 -3.05 rlineto stroke} forall
+[[12][30][39][42][45][51][54][57][60][72][84]] {{} forall 30 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][21][24][30][36][42][45][51][54][60][63][66][69][72][75][78]] {{} forall 27 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][21][24][30][36][39][42][54][72][84]] {{} forall 24 moveto 0 -3.05 rlineto stroke} forall
+[[12][18][21][24][30][39][45][51][60][63][66][72][75][81][84]] {{} forall 21 moveto 0 -3.05 rlineto stroke} forall
+[[12][30][39][42][45][48][51][60][63][66][69][78][81]] {{} forall 18 moveto 0 -3.05 rlineto stroke} forall
+[[12][15][18][21][24][27][30][42][48][54][57][60][63][66][69][72][75][78][81][84]] {{} forall 15 moveto 0 -3.05 rlineto stroke} forall
+
+%End of QR Barcode 
+
+showpage 
+
+%%Trailer
+
+
\ No newline at end of file diff --git a/includes/jpgraph/docs/chunkhtml/images/qrexample12.png b/includes/jpgraph/docs/chunkhtml/images/qrexample12.png new file mode 100644 index 0000000..dda7ad2 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/images/qrexample12.png @@ -0,0 +1,28 @@ +
XXXXXXX----X-X----XXXXXXX
+X-----X----X------X-----X
+X-XXX-X-XXXX-X----X-XXX-X
+X-XXX-X-XX-XXXX---X-XXX-X
+X-XXX-X----X------X-XXX-X
+X-----X--X-XXXX-X-X-----X
+XXXXXXX-X-X-X-X-X-XXXXXXX
+---------XX--X--X--------
+---XX-XX-X--XXX-X----XX--
+-XX--X---XXXXXXX---X--XXX
+X--X-XXXX-X--XXXX-X--XX-X
+--XX-X---X-X-X-XXXX----XX
+XXX-XXXX-X---X-X-X-X-X--X
+XX-X--------X-----XX---XX
+XXXXX-X-X----XXX----X-XX-
+X-X-XX---X-X-X--X----XX-X
+X---XXXX--X-X--XXXXXX----
+--------X-XX----X---XXX-X
+XXXXXXX-XX--XXXXX-X-X--XX
+X-----X--XXX-XXXX---X---X
+X-XXX-X-X-XX-XX-XXXXXXX--
+X-XXX-X-XXX---X-----X---X
+X-XXX-X--X-X-X--XXX-XX-XX
+X-----X--XXXXX--XXXX--XX-
+XXXXXXX---X-X-XXXXXXXXXXX
+
+
+
\ No newline at end of file diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex1.png b/includes/jpgraph/docs/chunkhtml/images/radarex1.png new file mode 100644 index 0000000..940d3db Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex2.png b/includes/jpgraph/docs/chunkhtml/images/radarex2.png new file mode 100644 index 0000000..0f58759 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex4.png b/includes/jpgraph/docs/chunkhtml/images/radarex4.png new file mode 100644 index 0000000..41adc7c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex6.png b/includes/jpgraph/docs/chunkhtml/images/radarex6.png new file mode 100644 index 0000000..7756036 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex7.png b/includes/jpgraph/docs/chunkhtml/images/radarex7.png new file mode 100644 index 0000000..aa0bbc9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex8.1.png b/includes/jpgraph/docs/chunkhtml/images/radarex8.1.png new file mode 100644 index 0000000..34c7337 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex8.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarex8.png b/includes/jpgraph/docs/chunkhtml/images/radarex8.png new file mode 100644 index 0000000..8abe1b8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarex8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarlogex1-aa.png b/includes/jpgraph/docs/chunkhtml/images/radarlogex1-aa.png new file mode 100644 index 0000000..8f3f00e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarlogex1-aa.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarlogex1.png b/includes/jpgraph/docs/chunkhtml/images/radarlogex1.png new file mode 100644 index 0000000..2009357 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarlogex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/radarmarkex1.png b/includes/jpgraph/docs/chunkhtml/images/radarmarkex1.png new file mode 100644 index 0000000..51458a0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/radarmarkex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rect_step0.png b/includes/jpgraph/docs/chunkhtml/images/rect_step0.png new file mode 100644 index 0000000..d7da76a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rect_step0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rect_step1.png b/includes/jpgraph/docs/chunkhtml/images/rect_step1.png new file mode 100644 index 0000000..9a0541a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rect_step1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rect_step2.png b/includes/jpgraph/docs/chunkhtml/images/rect_step2.png new file mode 100644 index 0000000..76c9dd4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rect_step2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rose_example.png b/includes/jpgraph/docs/chunkhtml/images/rose_example.png new file mode 100644 index 0000000..87368ab Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rose_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rotex0.png b/includes/jpgraph/docs/chunkhtml/images/rotex0.png new file mode 100644 index 0000000..f5978a7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rotex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rotex1.png b/includes/jpgraph/docs/chunkhtml/images/rotex1.png new file mode 100644 index 0000000..d924d80 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rotex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rotex2.png b/includes/jpgraph/docs/chunkhtml/images/rotex2.png new file mode 100644 index 0000000..2086266 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rotex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rotex3.png b/includes/jpgraph/docs/chunkhtml/images/rotex3.png new file mode 100644 index 0000000..d924d80 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rotex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rotex4.png b/includes/jpgraph/docs/chunkhtml/images/rotex4.png new file mode 100644 index 0000000..2086266 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rotex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/rotex5.png b/includes/jpgraph/docs/chunkhtml/images/rotex5.png new file mode 100644 index 0000000..071da13 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/rotex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/scale-headers.png b/includes/jpgraph/docs/chunkhtml/images/scale-headers.png new file mode 100644 index 0000000..8bf120f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/scale-headers.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/scatterex1.png b/includes/jpgraph/docs/chunkhtml/images/scatterex1.png new file mode 100644 index 0000000..47b969a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/scatterex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/scatterex2.png b/includes/jpgraph/docs/chunkhtml/images/scatterex2.png new file mode 100644 index 0000000..0354309 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/scatterex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/scatterlinkex3.png b/includes/jpgraph/docs/chunkhtml/images/scatterlinkex3.png new file mode 100644 index 0000000..776a370 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/scatterlinkex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/scatterlinkex4.png b/includes/jpgraph/docs/chunkhtml/images/scatterlinkex4.png new file mode 100644 index 0000000..66559a9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/scatterlinkex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/shear-original.png b/includes/jpgraph/docs/chunkhtml/images/shear-original.png new file mode 100644 index 0000000..7194de3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/shear-original.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/shear0.png b/includes/jpgraph/docs/chunkhtml/images/shear0.png new file mode 100644 index 0000000..a640357 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/shear0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/shear1.png b/includes/jpgraph/docs/chunkhtml/images/shear1.png new file mode 100644 index 0000000..d4d946c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/shear1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/shear2.png b/includes/jpgraph/docs/chunkhtml/images/shear2.png new file mode 100644 index 0000000..968e085 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/shear2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/shear3.png b/includes/jpgraph/docs/chunkhtml/images/shear3.png new file mode 100644 index 0000000..2b73aea Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/shear3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/shearing-params.png b/includes/jpgraph/docs/chunkhtml/images/shearing-params.png new file mode 100644 index 0000000..b6aa03d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/shearing-params.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex1.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex1.png new file mode 100644 index 0000000..ce27208 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex10.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex10.png new file mode 100644 index 0000000..7e173b3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex2.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex2.png new file mode 100644 index 0000000..79022b0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex3.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex3.png new file mode 100644 index 0000000..dc1230a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex4.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex4.png new file mode 100644 index 0000000..b78270e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex5.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex5.png new file mode 100644 index 0000000..5707741 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex6.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex6.png new file mode 100644 index 0000000..91f2377 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex7.png b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex7.png new file mode 100644 index 0000000..f8b97fd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/smallstaticbandsex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/softy_example.png b/includes/jpgraph/docs/chunkhtml/images/softy_example.png new file mode 100644 index 0000000..05b6e74 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/softy_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/spamstat.png b/includes/jpgraph/docs/chunkhtml/images/spamstat.png new file mode 100644 index 0000000..15a1581 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/spamstat.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/splineex1.png b/includes/jpgraph/docs/chunkhtml/images/splineex1.png new file mode 100644 index 0000000..8601291 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/splineex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/staticbandbarex7.png b/includes/jpgraph/docs/chunkhtml/images/staticbandbarex7.png new file mode 100644 index 0000000..ad0f35a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/staticbandbarex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/stock-detail-explanation.png b/includes/jpgraph/docs/chunkhtml/images/stock-detail-explanation.png new file mode 100644 index 0000000..99c0fe1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/stock-detail-explanation.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/stockex1.png b/includes/jpgraph/docs/chunkhtml/images/stockex1.png new file mode 100644 index 0000000..5a4df2d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/stockex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex1.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex1.png new file mode 100644 index 0000000..abfb841 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex2.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex2.png new file mode 100644 index 0000000..a829867 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex3.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex3.png new file mode 100644 index 0000000..d7db6b6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex4.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex4.png new file mode 100644 index 0000000..d5919f7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex5.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex5.png new file mode 100644 index 0000000..4e8922c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex6.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex6.png new file mode 100644 index 0000000..0518515 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sunspotsex7.png b/includes/jpgraph/docs/chunkhtml/images/sunspotsex7.png new file mode 100644 index 0000000..8c9dcc2 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sunspotsex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sym-char-list-capital.png b/includes/jpgraph/docs/chunkhtml/images/sym-char-list-capital.png new file mode 100644 index 0000000..d6cba89 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sym-char-list-capital.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/sym-char-list.png b/includes/jpgraph/docs/chunkhtml/images/sym-char-list.png new file mode 100644 index 0000000..20895d0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/sym-char-list.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_clipboard.png b/includes/jpgraph/docs/chunkhtml/images/table_clipboard.png new file mode 100644 index 0000000..306df53 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_clipboard.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_flagex1.png b/includes/jpgraph/docs/chunkhtml/images/table_flagex1.png new file mode 100644 index 0000000..42e333e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_flagex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto1.png b/includes/jpgraph/docs/chunkhtml/images/table_howto1.png new file mode 100644 index 0000000..b015cb0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto2.png b/includes/jpgraph/docs/chunkhtml/images/table_howto2.png new file mode 100644 index 0000000..700a404 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto3.png b/includes/jpgraph/docs/chunkhtml/images/table_howto3.png new file mode 100644 index 0000000..ed0aa58 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto4.png b/includes/jpgraph/docs/chunkhtml/images/table_howto4.png new file mode 100644 index 0000000..193896e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto5.png b/includes/jpgraph/docs/chunkhtml/images/table_howto5.png new file mode 100644 index 0000000..be84eaf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto6.png b/includes/jpgraph/docs/chunkhtml/images/table_howto6.png new file mode 100644 index 0000000..77ed12e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto7.1.png b/includes/jpgraph/docs/chunkhtml/images/table_howto7.1.png new file mode 100644 index 0000000..f1fd40a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto7.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto7.2.png b/includes/jpgraph/docs/chunkhtml/images/table_howto7.2.png new file mode 100644 index 0000000..62178a3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto7.2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto8.png b/includes/jpgraph/docs/chunkhtml/images/table_howto8.png new file mode 100644 index 0000000..0b3aa26 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_howto9.png b/includes/jpgraph/docs/chunkhtml/images/table_howto9.png new file mode 100644 index 0000000..c39f544 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_howto9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_iconex1.png b/includes/jpgraph/docs/chunkhtml/images/table_iconex1.png new file mode 100644 index 0000000..e69de29 diff --git a/includes/jpgraph/docs/chunkhtml/images/table_mex0.png b/includes/jpgraph/docs/chunkhtml/images/table_mex0.png new file mode 100644 index 0000000..0907df4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_mex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_mex00.png b/includes/jpgraph/docs/chunkhtml/images/table_mex00.png new file mode 100644 index 0000000..af709dc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_mex00.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_mex1.png b/includes/jpgraph/docs/chunkhtml/images/table_mex1.png new file mode 100644 index 0000000..b0c7dff Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_mex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_mex3.png b/includes/jpgraph/docs/chunkhtml/images/table_mex3.png new file mode 100644 index 0000000..5102426 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_mex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/table_vtext.png b/includes/jpgraph/docs/chunkhtml/images/table_vtext.png new file mode 100644 index 0000000..faf1906 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/table_vtext.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/tablebarex1.png b/includes/jpgraph/docs/chunkhtml/images/tablebarex1.png new file mode 100644 index 0000000..d4adcb5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/tablebarex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/textalignex1.png b/includes/jpgraph/docs/chunkhtml/images/textalignex1.png new file mode 100644 index 0000000..ae839e8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/textalignex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/textpalignex1.png b/includes/jpgraph/docs/chunkhtml/images/textpalignex1.png new file mode 100644 index 0000000..d9f8934 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/textpalignex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/theme_example.png b/includes/jpgraph/docs/chunkhtml/images/theme_example.png new file mode 100644 index 0000000..7337a64 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/theme_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/theme_samplele.png b/includes/jpgraph/docs/chunkhtml/images/theme_samplele.png new file mode 100644 index 0000000..e69de29 diff --git a/includes/jpgraph/docs/chunkhtml/images/timestampex01.png b/includes/jpgraph/docs/chunkhtml/images/timestampex01.png new file mode 100644 index 0000000..d40aa44 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/timestampex01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground00.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground00.png new file mode 100644 index 0000000..c216a0d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground00.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground01.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground01.png new file mode 100644 index 0000000..fc47592 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground01.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground02.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground02.png new file mode 100644 index 0000000..5d38a03 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground02.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground10.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground10.png new file mode 100644 index 0000000..098f397 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground10.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground100.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground100.png new file mode 100644 index 0000000..8b17a72 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground100.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground101.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground101.png new file mode 100644 index 0000000..f76350d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground101.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground102.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground102.png new file mode 100644 index 0000000..5f78c77 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground102.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground11.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground11.png new file mode 100644 index 0000000..ad6e929 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground11.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground110.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground110.png new file mode 100644 index 0000000..8611f1b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground110.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground111.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground111.png new file mode 100644 index 0000000..9936ec7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground111.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground112.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground112.png new file mode 100644 index 0000000..d34b6bc Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground112.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground12.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground12.png new file mode 100644 index 0000000..175bf94 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground12.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground20.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground20.png new file mode 100644 index 0000000..213e863 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground20.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground21.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground21.png new file mode 100644 index 0000000..52e9b48 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground21.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground22.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground22.png new file mode 100644 index 0000000..1d2a15e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground22.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground30.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground30.png new file mode 100644 index 0000000..c9ff25a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground30.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground31.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground31.png new file mode 100644 index 0000000..46ffa9f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground31.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground32.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground32.png new file mode 100644 index 0000000..1b25814 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground32.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground40.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground40.png new file mode 100644 index 0000000..95ddf31 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground40.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground41.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground41.png new file mode 100644 index 0000000..bed882b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground41.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground42.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground42.png new file mode 100644 index 0000000..08e5d4b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground42.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground50.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground50.png new file mode 100644 index 0000000..2475e19 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground50.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground51.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground51.png new file mode 100644 index 0000000..34fde58 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground51.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground52.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground52.png new file mode 100644 index 0000000..bb4981a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground52.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground60.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground60.png new file mode 100644 index 0000000..3612e5e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground60.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground61.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground61.png new file mode 100644 index 0000000..c914fb1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground61.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground62.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground62.png new file mode 100644 index 0000000..71d71f8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground62.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground70.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground70.png new file mode 100644 index 0000000..abc36f4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground70.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground71.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground71.png new file mode 100644 index 0000000..c7dd07a Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground71.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground72.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground72.png new file mode 100644 index 0000000..ee68ee6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground72.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground80.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground80.png new file mode 100644 index 0000000..079cbb8 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground80.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground81.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground81.png new file mode 100644 index 0000000..9cb607c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground81.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground82.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground82.png new file mode 100644 index 0000000..c2c1cae Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground82.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground90.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground90.png new file mode 100644 index 0000000..f69e61f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground90.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground91.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground91.png new file mode 100644 index 0000000..d5378c5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground91.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titlebackground92.png b/includes/jpgraph/docs/chunkhtml/images/titlebackground92.png new file mode 100644 index 0000000..f8d4663 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titlebackground92.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/titleex1.png b/includes/jpgraph/docs/chunkhtml/images/titleex1.png new file mode 100644 index 0000000..3d103d5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/titleex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/topxaxisex1.png b/includes/jpgraph/docs/chunkhtml/images/topxaxisex1.png new file mode 100644 index 0000000..5d09f8f Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/topxaxisex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/tri_step0.png b/includes/jpgraph/docs/chunkhtml/images/tri_step0.png new file mode 100644 index 0000000..979b5cf Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/tri_step0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/tri_step1.png b/includes/jpgraph/docs/chunkhtml/images/tri_step1.png new file mode 100644 index 0000000..ba6f40d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/tri_step1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/tri_step2.png b/includes/jpgraph/docs/chunkhtml/images/tri_step2.png new file mode 100644 index 0000000..632eaf5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/tri_step2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/universal_example.png b/includes/jpgraph/docs/chunkhtml/images/universal_example.png new file mode 100644 index 0000000..daef405 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/universal_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/uri-link.png b/includes/jpgraph/docs/chunkhtml/images/uri-link.png new file mode 100644 index 0000000..1aac1c7 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/uri-link.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/usps_ex1.png b/includes/jpgraph/docs/chunkhtml/images/usps_ex1.png new file mode 100644 index 0000000..99a9e09 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/usps_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/usps_ex2.png b/includes/jpgraph/docs/chunkhtml/images/usps_ex2.png new file mode 100644 index 0000000..a3419b9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/usps_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/usps_exhibit44.png b/includes/jpgraph/docs/chunkhtml/images/usps_exhibit44.png new file mode 100644 index 0000000..550ee2e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/usps_exhibit44.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/vivid_example.png b/includes/jpgraph/docs/chunkhtml/images/vivid_example.png new file mode 100644 index 0000000..636c2f9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/vivid_example.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/wind-legend-methods.png b/includes/jpgraph/docs/chunkhtml/images/wind-legend-methods.png new file mode 100644 index 0000000..8afe17e Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/wind-legend-methods.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/wind-legend-orig.png b/includes/jpgraph/docs/chunkhtml/images/wind-legend-orig.png new file mode 100644 index 0000000..2b4dc74 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/wind-legend-orig.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/wind-legend-styles.png b/includes/jpgraph/docs/chunkhtml/images/wind-legend-styles.png new file mode 100644 index 0000000..128af47 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/wind-legend-styles.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_2plots_ex1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_2plots_ex1.png new file mode 100644 index 0000000..64fc828 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_2plots_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_bgimg_ex1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_bgimg_ex1.png new file mode 100644 index 0000000..94e3de4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_bgimg_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex0.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex0.png new file mode 100644 index 0000000..a694e6c Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex1.png new file mode 100644 index 0000000..80326b6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex2.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex2.png new file mode 100644 index 0000000..8fc9bf4 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex3.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex3.png new file mode 100644 index 0000000..7d93239 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex3.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex4.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex4.png new file mode 100644 index 0000000..785dcb6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex5.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex5.png new file mode 100644 index 0000000..90b41dd Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex5.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex6.1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex6.1.png new file mode 100644 index 0000000..b2e34b1 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex6.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex6.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex6.png new file mode 100644 index 0000000..30eb7f3 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex6.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex7.1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex7.1.png new file mode 100644 index 0000000..c111d60 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex7.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex7.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex7.png new file mode 100644 index 0000000..f1b9dcb Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex7.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex8.1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex8.1.png new file mode 100644 index 0000000..9de843b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex8.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex8.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex8.png new file mode 100644 index 0000000..0a8fc71 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex9.1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex9.1.png new file mode 100644 index 0000000..fbb443b Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex9.1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_ex9.png b/includes/jpgraph/docs/chunkhtml/images/windrose_ex9.png new file mode 100644 index 0000000..4114250 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_ex9.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_icon_ex1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_icon_ex1.png new file mode 100644 index 0000000..13f1330 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_icon_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_intro.png b/includes/jpgraph/docs/chunkhtml/images/windrose_intro.png new file mode 100644 index 0000000..94d1b3d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_intro.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_label-align1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_label-align1.png new file mode 100644 index 0000000..1b6c076 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_label-align1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_label-align2.png b/includes/jpgraph/docs/chunkhtml/images/windrose_label-align2.png new file mode 100644 index 0000000..33723b9 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_label-align2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_layout_ex0.png b/includes/jpgraph/docs/chunkhtml/images/windrose_layout_ex0.png new file mode 100644 index 0000000..a7e5a47 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_layout_ex0.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_layout_ex1.png b/includes/jpgraph/docs/chunkhtml/images/windrose_layout_ex1.png new file mode 100644 index 0000000..4f967f0 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_layout_ex1.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_type16.png b/includes/jpgraph/docs/chunkhtml/images/windrose_type16.png new file mode 100644 index 0000000..2f91df5 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_type16.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_type4.png b/includes/jpgraph/docs/chunkhtml/images/windrose_type4.png new file mode 100644 index 0000000..c7c7307 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_type4.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_type8.png b/includes/jpgraph/docs/chunkhtml/images/windrose_type8.png new file mode 100644 index 0000000..e85cb5d Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_type8.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/windrose_typefree.png b/includes/jpgraph/docs/chunkhtml/images/windrose_typefree.png new file mode 100644 index 0000000..3b36552 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/windrose_typefree.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/y2synch.png b/includes/jpgraph/docs/chunkhtml/images/y2synch.png new file mode 100644 index 0000000..315a0ac Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/y2synch.png differ diff --git a/includes/jpgraph/docs/chunkhtml/images/y2synch2.png b/includes/jpgraph/docs/chunkhtml/images/y2synch2.png new file mode 100644 index 0000000..5fa97e6 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/images/y2synch2.png differ diff --git a/includes/jpgraph/docs/chunkhtml/index.html b/includes/jpgraph/docs/chunkhtml/index.html new file mode 100644 index 0000000..c968809 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/index.html @@ -0,0 +1,37 @@ +JpGraph Manual

JpGraph Manual

Version : 3.5.0b1

+ Asial Co. Ltd. (Asial USA) +

2010-10-06


Table of Contents

Preface and history of the JpGraph library
I. Installing and verifying the configuring
1. About the library
1.1. What is JpGraph?
1.2. Software license
1.3. Versions of the library covered
1.4. Purpose and usage
1.5. Prerequisites for running the library
1.6. Who can use the library
1.7. What you can do with the library
1.8. What you shouldn't or cannot do with this library
1.9. Feature-matrix for the library
1.10. Where to find additional information
2. The Short Version: Installing the library (for PHP/Apache experts)
2.1. Installing
2.2. Running the examples
2.3. Basic trouble shooting
3. The Long Version: Installing the Library
3.1. Downloading the library
3.2. Necessary system requirements for the library
3.3. Installing the library
3.4. Installing and configuring Font support
3.5. Adapting and customizing the installation
3.6. Verifying the library installation
3.7. Troubleshooting the installation
II. Basic graph creation
4. Your first graph script
4.1. Some words of caution
4.2. Graphing the number of sun spots during the 19th Century
5. Fundamentals of dynamic graph generation
5.1. Making sense of HTTP streams and MIME types
5.2. What is an image?
5.3. Static vs dynamic images
5.4. Dynamic images on the command line
5.5. How to generate images with JpGraph library
5.6. Efficient graph generation using the built-in cache subsystem
6. Error handling
6.1. The problem with error messages and images
6.2. Available error messages
6.3. Using PHP Exceptions
6.4. Adding a new locale
7. Color handling
7.1. Specifying colors by name
7.2. Specifying colors by RGB triples
7.3. Using HTML color specifications
7.4. Fine tuning the color
7.5. Additional color handling
8. Text and font handling
8.1. Different types of fonts
8.2. Font families and font styles
8.3. Understanding text alignment and anchor point
8.4. Rotating text
8.5. Formatting text paragraphs
8.6. Adding custom TTF fonts
8.7. Inserting Unicode entities
8.8. Character encoding
9. Using the JpGraph cache system
9.1. Enabling the library cache system
9.2. Permission settings for the cache files
9.3. Using the cache in your script
9.4. Using the cache with Client Side Image Maps (CSIM)
10. Using CSIM (Client side image maps)
10.1. The principles
10.2. The basic structure of an image map script
10.3. Specifying targets for image map plots
10.4. Using StrokeCSIM()
10.5. Getting hold of the image map
10.6. Mixing several CSIM images in an HTML page with text
11. NuSphere PHP accelerator
11.1. Introduction and purpose
11.2. Installing PhpExpress
III. Common features
12. Commonalities for all graphs
12.1. Common objects for cartesian graphs (x-, y-graphs)
12.2. Common object for Pie Graphs
13. Getting hold of the data to be displayed
13.1. Static data
13.2. Reading data from a file
13.3. Sending data to a graph script with URI arguments (GET and POST)
13.4. Reading data from a database
13.5. Reading binary data from a file
13.6. Different types of NULL data handling
13.7. Troubleshooting input data
14. Common features for all Cartesian (x,y) graph types
14.1. The definition of linear graphs
14.2. Specifying and formatting the overall displayed graph
14.3. Adjusting the look and feel of the plot area
14.4. Adjusting the position and layout of the legend
14.5. Other formatting options of the axis
14.6. Using multiple y-axis
14.7. Understanding and using different scales on the axis
14.8. Adjusting the appearance of the scale labels
14.9. Using a logarithmic scale
14.10. Using a date/time scale
14.11. Adding shearing image transformation to the graph
14.12. Rotating graphs
14.13. Using anti-aliasing in the graph generation
14.14. Adding icons (and small images) to the graph
14.15. Adding images and country flags to the background of the graph
14.16. Using background gradients
14.17. Adding arbitrary texts to the graph
IV. Creating linear and non-linear graphs
15. Different types of linear (cartesian) graph types
15.1. Basic Line and area graphs
15.2. Bar graphs
15.3. Error plot graphs
15.4. Stock graphs
15.5. Scatter graphs
15.6. Contour graphs
15.7. Combining several different plot types in the same graph
15.8. Creating several graphs in the same image
16. Non-Linear graph types
16.1. Pie graphs
16.2. Radar graphs
16.3. Polar graphs
16.4. Gantt charts
17. Additional graph types
17.1. LED bill boards
17.2. Captcha generation
17.3. Canvas graphs
18. Miscellaneous formatting and tools
18.1. Linear regression analysis
V. Additional graph types available in the professional version
19. Graphical tables
19.1. Introduction
19.2. Constructing tables
19.3. CSIM Table support
19.4. Table API Overview
19.5. Examples
19.6. Case study: Adding a table to a bar graph
20. Odometer
20.1. Introduction
20.2. Creating and formatting basic odometer graphs
20.3. Working with the odometer scale
20.4. Adding and positioning multiple odometers to a graph
20.5. Adding icon and text objects to the graph
21. Windrose
21.1. Introduction
21.2. Creating and formatting basic Windrose graphs
21.3. Formatting the plot
21.4. Some more advanced formatting
21.5. Adding icon and text objects to the graph
21.6. Using layout classes to position Windrose plots
21.7. Example section
22. Matrix graphs
22.1. Introduction
22.2. Creating and formatting a basic matrix graph
22.3. Mesh interpolating of input data
22.4. Formatting the matrix plot
22.5. Adding icon and text objects to the graph
22.6. Adding marker lines to the matrix plot
22.7. Using layout classes to position matrix plots
22.8. Built in color maps
22.9. Using CSIM with matrix plots
22.10. Matrix graph examples
23. Filled contour graphs
23.1. Filled Contour graphs
VI. Barcodes
24. Linear Barcodes (One Dimensional Barcodes)
24.1. Introduction
24.2. How does linear barcodes work?
24.3. Barcode symbologies
24.4. Features
24.5. Creating barcodes - quick start
24.6. Error handling
24.7. Generating barcodes on the command line
24.8. Format options for barcodes
24.9. Short description of supported symbologies
25. PDF417 (2D-Barcode)
25.1. Principle of PDF417 Barcodes
25.2. Creating barcodes
25.3. Creating barcodes
25.4. Specifying the PDF417 parameters
25.5. Adjusting the output
25.6. A template to create barcodes
25.7. Method reference
25.8. Example scripts
26. Datamatrix (2D-Barcode)
26.1. Principle of Datamatrix Barcodes
26.2. Creating barcodes
26.3. Example script
27. QR (2D-Barcode)
27.1. Principle of QR Barcodes
27.2. Creating barcodes
27.3. Example scripts
VII. Theme Class
28. Applying the prepared theme
29. Attention
29.1. The order of SetTheme() and changing settings
29.2. Changing the display settings of line/bar graphs
30. Examples of applying a theme
31. Creating original themes
VIII. Case studies
32. Synchronized Y-axis
32.1. Creating two scales
33. USPS Confirmation Barcodes
33.1. Creating the confirmation codes
34. Showing SPAM statistics
34.1. Introduction and purpose
34.2. Step 1: Parsing the log file
34.3. Step 2: Creating the graph
34.4. Step 3: Uploading the image file to a server
34.5. Step 0: The full driver script
35. Creating Critical chain buffer penetration charts
35.1. Introduction and purpose
35.2. Creating a utility class to construct CC BP charts
35.3. The Init() method
35.4. Suggested improvements
35.5. The implementation of class CCBPGraph
35.6. References
IX. Appendices
A. How this manual was produced
B. JpGraph Professional License
B.1. Single License
B.2. Bulk (Re-seller license)
C. FAQ
D. Named color list
E. Available plot marks
E.1. Built in basic plot marks
E.2. Built in image plot marks
F. List of all country flags
G. List of files included in the library
H. Error messages
H.1. Core error messages
H.2. QR 2D Barcode error messages
H.3. Datamatrix 2D barcode error messages
I. Compiling PHP
I.1. Compiling PHP4
I.2. Compiling PHP5
J. Setting up PHP5 in parallel with PHP4 in SuSE 10.1
J.1. Configuration files and directories for Apache2 in SuSE 10.1
J.2. Making sure you have the correct Apache2 setup
J.3. Approaches to running multiple PHP versions
J.4. Outline of the remainder of the chapter
J.5. Part I - Installing PHP4
J.6. Part II - Creating a virtual host
J.7. Part III - Installing PHP5
J.8. Part IV - Verifying the setup
K. Why it is not possible to add a SVG backend to JpGraph
K.1. Background
K.2. Summary of findings
K.3. Detailing the issue
L. The JpGraph configuration file

List of Figures

1. Link to highlighted graph source
1.1. JpGraph and PHP
1.2. This is the very first example (example0.php)
2.1. phpinfo() GD sections
3.1. Pro-login dialogue on JpGraph Website
3.2. phphinfo() GD-Information
3.3. Verifying the GD installations (checkgd.php)
3.4. Verifying GD2 (checkgd2.php)
3.5. Verifying TTF with a known font (checkttf.php)
4.1. The first ten rows of data of sunspot activities from year + 1700
4.2. Reading numeric tabulated sunspot data from a file
4.3. Line plot showing the number of sun spots since 1700 (sunspotsex1.php)
4.4. Displaying sun spots with a semi filled line graph (sunspotsex2.php)
4.5. Adding tick labels to the graph (sunspotsex3.php)
4.6. Manually specifying the X scale to use just the supplied X values (sunspotsex4.php)
4.7. Using a callback to get correct values on the x axis (sunspotsex5.php)
4.8. Changing the plot type to a bar plot instead (sunspotsex6.php)
4.9. Sunspots zoomed to only show the last 20 years (sunspotsex7.php)
6.1. Typical image error message
6.2. The "Header already sent error message"
6.3. The "Header already sent" error message using German locale
6.4. Using the production "pseudo" locale
7.1. Using alpha channel modifiers
7.2. Making use of transparency to combine two plots (barlinealphaex1.php)
7.3. Adjusting brightness of named color specifier
7.4. Adjusting brightness of a HTML color specifier
8.1. List of all latin TTF fonts. (listfontsex1.php)
8.2. Illustration of anchor point alignment (textalignex1.php)
8.3. Example of how to use rotated labels (bargradex1.php)
8.4. Example of using rotated data point values (example20.3.php)
8.5. The different types of paragraph alignments (textpalignex1.php)
8.6. Rendered symbol characters corresponding to + +
8.7. Rendered capital symbol characters corresponding to Table 8.3. Supported character entities in class SymChar.
8.8. Specifying manual ticks as fraction of Pi. (manualtickex2.php)
9.1. Library cache principle
10.1. Example of generated HTML code for StrokeCSIM()
10.2. Browser window after calling HTML page in Example 10.4. Example of HTML page that includes two Graph CSIM scripts + ("Examples/csim_in_html_ex2.html") (Note: The image has been + scaled down to better fit this manual.)
12.1. Commonly used objects in a graph (common-obj-graph.php)
12.2. Commonly used objects in Piegraphs ( + common-obj-piegraph.php)
13.1. Post vs. header() data direction
13.2. The request phase of a POST header
13.3. The reply phase of a POST request
13.4. Original graph with all values
13.5. Value at x=2 as ''
13.6. Value at x=2 as '-'
13.7. Error when only null values are specified
13.8. PHP (HTML) error when missing data keys
14.1. Supported principle linear graph types in the library
14.2. Using alternating fill colors in the grid (filledgridex1.php)
14.3. Using different grid styles for major and minor grids (gridstylesex1.php)
14.4. Predefined scientific axis positions
14.5. Example of AXSTYLE_BOXIN axis style (funcex2.php)
14.6. The various titles in a graph (titleex1.php)
14.7. Tabtitle and gradient background (gradbkgex1.php)
14.8. Tabtitle and image marker in a line plot (imgmarkerex1.php)
14.9. Different line formatting
14.10. Using a footer in a graph
14.11. Adding a left,right and center footer (footerex1.php)
14.12. Adding a timer to the graph (in the footer) (example11.php)
14.13. Original plot without clipping (clipping_ex1.php)
14.14. Plot with clipping enabled (clipping_ex2.php)
14.15. Some example of ways to position the legend box in the graph
14.16. Some example of different legend layouts
14.17. Basic example of multiple y-axis (mulyaxisex1.php)
14.18. Illustration of mulyaxiscsimex1.php
14.19. Inverted y-scale to show a dive profile (inyaxisex2.php)
14.20. Setting tick density to TICKD_DENSE (manscaleex3.php)
14.21. Fully automatic not so good scaling (manscaleex2.php)
14.22. Manually specified tick distance which gives a much better appearance (manscaleex1.php)
14.23. Manually specifying the tick position for each month (manualtickex1.php)
14.24. Adjusting the side which have the tick marks and position the x-axis at the top (topxaxisex1.php)
14.25. LABELBKG_NONE (axislabelbkgex01.php)
14.26. LABELBKG_XAXIS (axislabelbkgex02.php)
14.27. LABELBKG_YAXIS (axislabelbkgex03.php)
14.28. LABELBKG_YAXISFULL (axislabelbkgex04.php)
14.29. LABELBKG_XAXISFULL (axislabelbkgex05.php)
14.30. LABELBKG_XYFULL (axislabelbkgex06.php)
14.31. LABELBKG_XY (axislabelbkgex07.php)
14.32. The original graph (grace_ex0.php)
14.33. Using a 10% grace (grace_ex1.php)
14.34. Using a 50% grace (grace_ex2.php)
14.35. Using a 100% grace (grace_ex3.php)
14.36. The original line graph (example3.2.php)
14.37. Adding grace values. Note x-axis position at y=0 (example3.2.1.php)
14.38. Adjusting the position of the x-axis manually (example3.2.2.php)
14.39. Manual text scale example
14.40. Manual text scale with month labels (manual_textscale_ex1.php)
14.41. Setting text tick interval=2 (manual_textscale_ex2.php)
14.42. Labels at every 2:nd tick mark (manual_textscale_ex3.php)
14.43. Tick marks every 40 points and labels every 2:nd tick mark (manual_textscale_ex4.php)
14.44. BAND_RDIAG (smallstaticbandsex1.php)
14.45. BAND_LDIAG (smallstaticbandsex2.php)
14.46. BAND_DIAGCROSS (smallstaticbandsex10.php)
14.47. BAND_HLINE (smallstaticbandsex7.php)
14.48. BAND_VLINE (smallstaticbandsex6.php)
14.49. BAND_HVCROSS (smallstaticbandsex5.php)
14.50. BAND_3DPLANE (smallstaticbandsex4.php)
14.51. BAND_SOLID (smallstaticbandsex3.php)
14.52. SetDensity(10) (plotbanddensity_ex0.php)
14.53. SetDensity(40) (plotbanddensity_ex1.php)
14.54. SetDensity(80) (plotbanddensity_ex2.php)
14.55. Creative use of plot bands
14.56. Creative use of plot bands (staticbandbarex7.php)
14.57. Use of a static line to simulate an extra x-axis at y=0
14.58. Adding a static line at y=0 to simulate an extra 0-axis (impulsex4.php)
14.59. Changing the Y2 scale from linear to logarithmic (example7.php)
14.60. Enabling minor grid lines on the y-axis and also grid lines on the x-axis (example8.php)
14.61. An example of a log-log plot (where both the y- and x-axis use a logarithmic scale) (loglogex1.php)
14.62. Using a text-log scale (example9.php)
14.63. Adjusting the text scale so that only every second labels are displayed. (example9.1.php)
14.64. Rotating the x-axis labels 90 degree (example9.2.php)
14.65. A first date scale example (dateaxisex2.php)
14.66. Manually adjusting the tick labels for a date scale (datescaleticksex01.php)
14.67. Adjusting label formatting of a date scale (dateaxisex4.php)
14.68. Manually creating a date scale (dateaxisex1.php)
14.69. Adding a label at the start of every month (manualtickex1a.php)
14.70. Manually specified date scale (dateutilex01.php)
14.71. Using an automatic date scale (dateutilex02.php)
14.72. Different types of shearing transformation
14.73. Explaining the shearing parameters
14.74. Original unrotated graph (rotex0.php)
14.75. Rotating the plot area 45 degrees (rotex1.php)
14.76. Rotating the plot area 90 degrees (rotex2.php)
14.77. Rotating the plot area 45 degrees (rotex3.php)
14.78. Rotating the plot area 90 degrees (rotex4.php)
14.79. Rotating the plot area -30 degree around the bottom left corner (rotex5.php)
14.80. Plain radar plot (radarex8.php)
14.81. Anti-aliased radar plot (radarex8.1.php)
14.82. Anti-aliasing up-close. The figure shows the difference + between a standard line (on-top) and the corresponding + anti-aliased line (on-the bottom)
14.83. Affects of using anti-alias for Pie-graphs
14.84. Mixing an icon image into the background of the graph. The area plot in the graph uses alpha blending to achieve see-through affect (lineiconex1.php)
14.85. Adding a country flag icon in the background (lineiconex2.php)
14.86. The graph that will be used to add backgrounds + to
14.87. Background image (a closeup of our burnt + server)
14.88. BGIMG_COPY (background_type_ex0.php)
14.89. BGIMG_CENTER (background_type_ex1.php)
14.90. BGIMG_FREE (background_type_ex2.php)
14.91. BGIMG_FILLPLOT (background_type_ex3.php)
14.92. BGIMG_FILLFRAME (background_type_ex4.php)
14.93. What area of the graph the gradient should affect
14.94. Different types of gradient fills
14.95. The "mkgrad" utiliy to create gradient images
14.96. Adding a text object to a graph (example25.php)
14.97. Making the text stand out a bit more by adding a background color and frame (example25.1.php)
14.98. Adding a text object with multiple rows of text. Paragraph alignment is set to "center" (example25.2.php)
15.1. Supported linear graph types in the library
15.2. The most simple line graph (example0-0.php)
15.3. Adding some titles (example2.php)
15.4. Changing fonts of the axis titles and adjusting plot weight (example3.php)
15.5. Adding drop shadow and changing axis color (example3.0.1.php)
15.6. Original null values (example3.0.3.php)
15.7. Using '-' to get interpolated lines (example3.0.2.php)
15.8. Adding basic plot marks to the plot (example3.1.php)
15.9. Using one of the built-in images as plot mark, MARK_IMG_DIAMOND (example3.1.1.php)
15.10. Using country flags as plot marks (markflagex1.php)
15.11. (example3.3.php)
15.12. Changing the appearance of data labels (example3.4.php)
15.13. Formatting display values as roman numerals (example3.4.1.php)
15.14. Adding a second data series (example4.php)
15.15. Adding a second y-axis to the graph (example5.php)
15.16. Adding and adjusting the position of the legend box (example6.php)
15.17. Adjusting the layout of the texts in the legend box (example6.1.php)
15.18. Using plot marks with several data series and a legend (builtinplotmarksex1.php)
15.19. Using the "Step style" for line plots (example6.2.php)
15.20. A basic filled line graph (filledlineex01.php)
15.21. Having the grid line on top of a filled line plot (filledlineex01.1.php)
15.22. Creating the effect of an area fill with an image (lineimagefillex1.php)
15.23. Filling from the 0-line (The default) (manualtickex3.php)
15.24. Filling from the bottom (manualtickex4.php)
15.25. A basic gradient fill using default values (gradlinefillex1.php)
15.26. Using the default number of intermediate colors (gradlinefillex2.php)
15.27. Only using 4 colors in total between start and finish color (gradlinefillex3.php)
15.28. Adding two partially filled areas to a line plot (partiallyfilledlineex1.php)
15.29. Area plot with 'x' NULL values (filledlineex03.php)
15.30. A basic accumulated area plot (example17.php)
15.31. Area plot with specified x coordinates (prepaccdata_example.php)
15.32. Constructing a smooth spline curve from 8 control points (splineex1.php)
15.33. Different types of supported bar graphs
15.34. Using "int" scale for the x-axis (example19.1.php)
15.35. Using "text" scale for the x-axis (example19.php)
15.36. An accumulated bar plot (example23.php)
15.37. Accumulated bar with individual frame colors (accbarframeex01.php)
15.38. Accumulated bar with unit frame color (accbarframeex02.php)
15.39. Setting individual frames to weight=0 (accbarframeex03.php)
15.40. A grouped bar plot (example21.php)
15.41. Adjusting the width of a group bar plot (example22.php)
15.42. All data series in a grouped bar graph must have the same number of data points (groupbarex1.php)
15.43. A grouped accumulated bar graph (example24.php)
15.44. A basic horizontal bar graph (horizbarex1.php)
15.45. Using multiple line labels in a horizontal bar graph (horizbarex4.php)
15.46. Supported gradient fills for bar plots
15.47. GRAD_MIDVER (bargradsmallex1.php)
15.48. GRAD_MIDHOR (bargradsmallex2.php)
15.49. GRAD_HOR (bargradsmallex3.php)
15.50. GRAD_VER (bargradsmallex4.php)
15.51. GRAD_WIDE_MIDVER (bargradsmallex5.php)
15.52. GRAD_WIDE_MIDHOR (bargradsmallex6.php)
15.53. GRAD_CENTER (bargradsmallex7.php)
15.54. GRAD_RAISED_PANEL (bargradsmallex8.php)
15.55. Horizontal bar graph with gradient fill (horizbarex6.php)
15.56. Supported pattern fills for bar plots
15.57. Using a callback to format the labels on a bar (barscalecallbackex1.php)
15.58. A basic error plot (example13.php)
15.59. Making use of SetCenter() with error plots (example14.php)
15.60. A basic Line error plot (example15.php)
15.61. A line error plot with a legend (example16.php)
15.62. A stock graph (stockex1.php)
15.63. Explaining stock graphs
15.64. A typical boxplot (boxstockex1.php)
15.65. A basic scatter plot (scatterex1.php)
15.66. Adjusting the size and color of the marker (scatterex2.php)
15.67. Combining data points with a dotted line (scatterlinkex3.php)
15.68. Combining data points with a red line (scatterlinkex4.php)
15.69. Stem plot (impulsex1.php)
15.70. Adjusting the overall look and feel for the stem graph (impulsex3.php)
15.71. Possible sizes of arrow heads for field plots
15.72. A field plot (fieldscatterex1.php)
15.73. Using format callback to create a balloon plot (balloonex2.php)
15.74. An example with geo maps (pushpinex1.php)
15.75. A basic contour graph (basic_contourex01.php)
15.76. Adding axis on all sides (basic_contourex02.php)
15.77. Flipping the data around the center line (basic_contourex05.php)
15.78. Using only 5 isobar lines (basic_contourex04.php)
15.79. Interpolation factor=1 (basic_contourex03-1.php)
15.80. Interpolation factor=2 (basic_contourex03-2.php)
15.81. Interpolation factor=3 (basic_contourex03-3.php)
15.82. The exponential growth of the data size due to grid interpolation factor (interpolation-growth.php)
15.83. The exponential growth of the data size due to the grid interpolation factor (log scale) (interpolation-growth-log.php)
15.84. Mixing a line and area plot in the same graph (example16.1.php)
15.85. Mixing a line and bar plot in the same graph (example16.3.php)
15.86. Centering the line plot in the middle of the bar (linebarcentex1.php)
15.87. Mixing bar and line using an integer x-scale (example16.4.php)
15.88. A combination of a line graph at top and a bar graph in the bottom (combgraphex1.php)
15.89. Mixing a background image with two subgraphs. In this case the mixing factor was 85 for both subgraphs. (Note: To reduce load time the image is quite hard compressed in JPEG so there are some artifacts in high-frequency areas.) (combgraphex2.php)
15.90. Combining three graphs in one image (comb90dategraphex03.php)
16.1. Pie graphs
16.2. Pie3D graphs
16.3. Ring graphs
16.4. Radar graphs
16.5. Polar graphs
16.6. Gantt charts
16.7. Hare/Niemeyer pie plot integer compensation
16.8. A basic Pie graph (example26.php)
16.9. Adding a legend to a pie plot (example26.1.php)
16.10. Adding several pie plots to the same pie graph (pieex3.php)
16.11. Adding guide lines to a pie labels (pielabelsex1.php)
16.12. Lining up guide lines vertically (pielabelsex2.php)
16.13. Adjusting the distance between the labels for guide lines (pielabelsex4.php)
16.14. A basic 3D pie plot (example27.php)
16.15. Adjusting the perspective angle (example27.1.php)
16.16. Affect of adjusting the perspective angle for a 3D pie plot
16.17. A ring plot (piecex1.php)
16.18. A ring graph with several formatting options adjusted (piecex2.php)
16.19. Exploding the second slice (example27.2.php)
16.20. Exploding the second slice (example27.3.php)
16.21. Adjusting the position of the pie labels (pieex8.php)
16.22. Pie chart with manually specified labels for each slice (pielabelsex5.php)
16.23. Adding a drop shadow to exploded pie (pieex9.php)
16.24. Pie plots with a background image (piebkgex1.php)
16.25. (example28.1.php)
16.26. (example28.2.php)
16.27. (example28.php)
16.28. (example28.3.php)
16.29. Earth theme
16.30. Pastel theme
16.31. Sand theme
16.32. Water theme
16.33. A typical radar graph with two radar plots added (radarex7.php)
16.34. A basic radargraph with no formatting (radarex1.php)
16.35. A basic radargraph with minimal formatting (radarex2.php)
16.36. Adding plot marks to a radar graph (radarmarkex1.php)
16.37. Enabling a dashed grid line (radarex4.php)
16.38. Enabling a dashed grid line with red (radarex6.php)
16.39. Using a logarithmic scale (radarlogex1.php)
16.40. Enabling anti-alias for the logarithmic radar example (radarlogex1-aa.php)
16.41. A more complex example of a radar graph with a manual scale (fixscale_radarex1.php)
16.42. A full 360 degree polar graph (polarex0.php)
16.43. A 180 degree (half) polar graph (polarex0-180.php)
16.44. A 360 polar plot with background gradient and alpha blending (polarex7-2.php)
16.45. Clockwise polar graph (polarclockex1.php)
16.46. Rotated clockwise polar graph (polarclockex2.php)
16.47. Adding plot marks to a polar graph (polarex7-1.php)
16.48. Linear scale for radius (polarex3-lin.php)
16.49. Logarithmic scale for radius (polarex3.php)
16.50. Logarithmic scale with only major grid lines (polarex4.php)
16.51. Logarithmic scale with both major and minor grid lines (polarex5.php)
16.52. Different colors for labels, specifying both a tabbed title as well as a axis title (polarex9.php)
16.53. A typical small Gantt chart (ganttmonthyearex2.php)
16.54. Building block of a Gantt chart
16.55. The Gantt scale properties
16.56. Gantt chart with day and hour scale enabled (gantthourex1.php)
16.57. The simplest possible Gantt graph (ganttex00.php)
16.58. Making some minor alterations to the Gantt graph (ganttex01.php)
16.59. Specifying a large vertical position (ganttex03.php)
16.60. Adding a milestone marker to a gantt graph (ganttex04.php)
16.61. Adding a vertical line in the Gantt graph (ganttex06.php)
16.62. Adjusting the position of the vertical line within the day (ganttex07.php)
16.63. Adding several activity bars on the same row (gantt_samerowex1.php)
16.64. Adding a hollow "break" bar (gantt_samerowex2.php)
16.65. Example of adding a right marker to the activity bar
16.66. A large marker will force the row to become larger since it by default always fills 60% of the allocated height for each row (ganttex08.php)
16.67. Adding a caption to a Gantt bar
16.68. Adding progress bars ot the gantt chart (ganttex14.php)
16.69. Modifying the format for the progress pattern (ganttex15.php)
16.70. Start to end constraint
16.71. Start to start constraint
16.72. End to start constraint
16.73. End to end constraint
16.74. Group markers
16.75. Using the CreateSimple() wrapper method (ganttsimpleex1.php)
16.76. Using multiple columns as titles for activties (ganttmonthyearex3.php)
16.77. Using different fonts for individual columns (ganttcolumnfontsex01.php)
16.78. Adding a spanning title over all title columns (ganttmonthyearex4.php)
16.79. Built-in icons for Gantt charts
16.80. Adding built in icons in titles (gantticonex1.php)
16.81. A zoom factor of 0.7 (ganttex13-zoom1.php)
16.82. A zoom factor of 1.5 (ganttex13-zoom2.php)
16.83. Adding a table title in the top left corner (ganttex16.php)
16.84. Gantt divider lines
16.85. Adjusting the plot box around the gantt chart (ganttex18.php)
16.86. (gantthgridex1.php)
16.87. Adding a country flag to the top left corner of the gantt graph (ganttex17-flag.php)
16.88. Adding two text objects to a Gantt graph (gantt_textex1.php)
16.89. Error message when using an unsupported Locale in Gantt chart
16.90. Using Swedish locale. Notice the L for Lordag instead of S for Saturday (ganttex19.php)
16.91. Using multiple title columns with a scale of one day (gantthourminex1.php)
16.92. Using multiple markers and indenting titles in the Gantt chart (ganttex30.php)
16.93. Using a grouping bar together with constraints (ganttconstrainex2.php)
17.1. LEDC_GREEN (ledex1.php)
17.2. LEDC_RED (ledex2.php)
17.3. LEDC_YELLOW (ledex3.php)
17.4. LEDC_BLUE (ledex5.php)
17.5. LEDC_GRAY (ledex6.php)
17.6. LEDC_INVERTGRAY (ledex17.php)
17.7. LEDC_CHOCOLATE (ledex7.php)
17.8. LEDC_PERU (ledex8.php)
17.9. LEDC_GOLDENROD (ledex9.php)
17.10. LEDC_KHAKI (ledex10.php)
17.11. LEDC_OLIVE (ledex11.php)
17.12. LEDC_LIMEGREEN (ledex12.php)
17.13. LEDC_FORESTGREEN (ledex13.php)
17.14. LEDC_TEAL (ledex14.php)
17.15. LEDC_STEELBLUE (ledex15.php)
17.16. LEDC_NAVY (ledex16.php)
17.17. Supersampling=1 (ledex4.php)
17.18. Supersampling=2 (default) (ledex4.1.php)
17.19. Supersampling=4 (ledex4.2.php)
17.20. LED 4x7 Cyrillic alphabet support
17.21. Sample illustration of captcha challenge (antispamex01.php)
17.22. A simple canvas graph to draw a text box (canvasex01.php)
17.23. Drawing some basic geometric shapes on a canvas (canvasex02.php)
17.24. Creating a canvas graph with a scale and using the shape class (canvasex03.php)
17.25. Changing the image size to create a smaller version of the previous example (canvasex04.php)
17.26. Keeping the image size but changing the scale (canvasex05.php)
17.27. Example of using an indented rectangle (canvasex06.php)
18.1. Linear regression using utility class (example16.6.php)
19.1. Standalone table examples
19.2. Combining a graphic table and a bar graph
19.3. The most basic 2x4 table (table_howto1.php)
19.4. Merging the rightmost 4 cells in the table (table_howto2.php)
19.5. Merging the top row (table_howto3.php)
19.6. Adjusting the font in the top row (table_howto5.php)
19.7. Merging and setting the colors the top row (table_howto4.php)
19.8. Setting the minimum column width to 35 pixels. (table_howto6.php)
19.9. Double lines 1 (table_howto7.1.php)
19.10. Double lines 2 (table_howto7.2.php)
19.11. Removing some grid lines and border. In addition we have right aligned all the cells as is common practice for numeric data. (table_howto8.php)
19.12. Applying a number format to the data in the cells (table_howto9.php)
19.13. Using country flags in the table cells (table_flagex1.php)
19.14. xx (table_mex00.php)
19.15. xx (table_mex0.php)
19.16. xx (table_mex1.php)
19.17. xx (table_mex3.php)
19.18. Vertical text (table_vtext.php)
19.19. Adding an icon (image) in a table cell (table_iconex1.php)
19.20. Combining a bar graph and a table (tablebarex1.php)
20.1. Odometers
20.2. A basic odometer (odotutex00.php)
20.3. A full circle odometer (odotutex01.php)
20.4. Adding titles and captions (odotutex02.php)
20.5. Adding a multi line caption (odotutex03.php)
20.6. Changing colors (odotutex04.php)
20.7. Possible shapes of the odometer indicator (odotutex06.php)
20.8. Illustration of various sizes of arrow heads (odotutex07.php)
20.9. Adding drop shadows (odotutex08.php)
20.10. Increasing the individual margins around the plots (odotutex09.php)
20.11. Adding colored scale indicators (odotutex10.php)
20.12. Adjusting the non-colored center area (odotutex11.php)
20.13. Adding a second scale indicator (odotutex12.php)
20.14. Adding a scale legend by using the label property (odotutex13.php)
20.15. (odotutex14.php)
20.16. Adjusting the scale format (odotutex15.php)
20.17. Adjusting start and end angles of scale (odotutex16.php)
20.18. Adding gray areas below the min and max scale values (odotutex16.1.php)
20.19. Manually specifying the position of odometer plots (odotutex17.php)
20.20. Using layout classes for automatic positioning (odotutex18.php)
20.21. Adding an icon and text to a Odometer graph (odotutex19.php)
21.1. An basic Windrose plot
21.2. WINDROSE_TYPE4
21.3. WINDROSE_TYPE8
21.4. WINDROSE_TYPE16
21.5. WINDROSE_TYPEFREE
21.6. A basic 16 direction windrose graph (windrose_ex0.php)
21.7. Adding two windrose plots to the same graph (windrose_2plots_ex1.php)
21.8. Positioning with LBLPOSITION_CENTER
21.9. Positioning with LBLPOSITION_EDGE
21.10. Windrose legend methods
21.11. Using chinese fonts (windrose_ex6.1.php)
21.12. Japanese locale (windrose_ex7.1.php)
21.13. Adding label background (windrose_ex8.1.php)
21.14. Different legend label styles
21.15. Interpretation of ordinal keys (windrose_ex9.1.php)
21.16. Adding a "tornado" icon to the top left corner (windrose_icon_ex1.php)
21.17. Using layout classes to position 4 windrose plots (windrose_layout_ex0.php)
21.18. Using layout classes to position 5 windrose plots (windrose_layout_ex1.php)
21.19. (windrose_ex1.php)
21.20. (windrose_ex2.php)
21.21. (windrose_ex3.php)
21.22. (windrose_ex4.php)
21.23. (windrose_ex5.php)
21.24. (windrose_ex6.php)
21.25. (windrose_ex7.php)
21.26. Show how to set different styles for individual radial grid lines (windrose_ex8.php)
21.27. (windrose_ex9.php)
21.28. (windrose_bgimg_ex1.php)
22.1. A medium complex example to shows some capabilities of matrix plots (matrix_introex.php)
22.2. A basic matrix graph with all default values (matrix_ex0.php)
22.3. The effects of changing the value range for the colormap
22.4. Using a circular module type (matrix_ex05.php)
22.5. Matrix alpha blending=0.2 (matrix_ex04.1.php)
22.6. Matrix alpha blending=0.7 (matrix_ex04.2.php)
22.7. Matrix legend positions
22.8. Adding row and column legends to a matrix plot (matrix_edgeex01.php)
22.9. Adding an icon to the lower right corner (matrix_ex03.php)
22.10. Adding a background image to the matrix graph (matrix_ex04.php)
22.11. Adding plot lines to the matrix plot (matrix_ex06.php)
22.12. Using layout classes with Matrix plots (matrix_layout_ex1.php)
22.13. Standard color maps
22.14. Centered color map
22.15. Continues color map
23.1. Filled contour with labels (contour2_ex1.php)
23.2. Filled contour with no isobar lines (contour2_ex2.php)
23.3. Manual colors for contour (contour2_ex3.php)
23.4. Labels that follows the gradients (contour2_ex4.php)
23.5. Labels that are always horizontal. In this example we have also shown how to change the colors. (contour2_ex5.php)
23.6. Triangulation step 0
23.7. Triangulation step 1
23.8. Triangulation step 2
23.9. "Rectangularization" step 0
23.10. "Rectangularization" step 1
23.11. "Rectangularization" step 2
23.12. 7 Isobars, "rect" method (contour2_ex6.php)
23.13. 7 Isobars, "tri" method (contour2_ex7.php)
23.14. Rectangular sub-division
23.15. Triangular sub-division
24.1. Understanding linear barcodes. Example with Code 25 symbology
24.2. Linear Barcode Demo application (screen shot from running in + WEB-browser)
24.3. Encoding "ABC123" with CODE 39.
24.4. Encoding "ABC123" with CODE 128.
24.5. Image error - Failed barcode data validation
24.6. Encoding "ABC123" with CODE 39 adding checksum (checksum=4).
24.7. Encoding "ABC123" with CODE 39, hiding the text.
24.8. UPC A Example
24.9. UPC E Encoding of "05510000120"
24.10. UPC A Encoding of "05510000120"
24.11. EAN 8 Example
24.12. EAN 13 Example
24.13. EAN 128 Example
24.14. Industrial 2 of 5, without check + digit
24.15. Industrial 2 of 5, with check digit
24.16. Industrial 2 of 5, without check + digit
24.17. Industrial 2 of 5, with check digit
24.18. Code 11, without check digit
24.19. Code 11, with check digit
24.20. Code 39, without check digit
24.21. Code 39, with check digit
24.22. Code 39 Extended, without check + digit
24.23. Code 39 Extended, with check digit
24.24. Code 128
24.25. Codabar
24.26. Bookland (ISBN)
25.1. PDF417 Structure - Overview
25.2. PDF417 Structure - Details of a real barcode
25.3. PDF417 WEB-based demo application
25.4. Overview of the interaction between encoder and backends
25.5. The most basic PDF417 script (pdf417_ex0.php)
25.6. Adding error handling (pdf417_ex1.php)
25.7. Adjusting the number of columns and error correction level (pdf417_ex1b.php)
25.8. Adjusting the module width and showing human readable text (pdf417_ex2.php)
25.9. Structure for manually specified encodation schema
25.10. Normal PDF417
25.11. Truncated PDF417
25.12. Showing human readable text (pdf417_ex3.php)
25.13. Changing colors (pdf417_ex4.php)
25.14. (pdf417_ex6.php)
26.1. Datamatrix structure.
26.2. Datamatrix - Square symbol shape
26.3. Datamatrix - Rectangle symbol shape
26.4. Datamatrix encodation principle
26.5. The simplest possible datamatrix script (datamatrix_ex00.php)
26.6. Datamatrix error image
26.7. Datamatrix with basic error handling (datamatrix_ex0.php)
26.8. Datamatrix with modified module width (datamatrix_ex1.php)
26.9. Datamatrix WEB-based demo application
26.10. Datamatrix example, setting quiet zone and ASCII encoding (datamatrix_ex4.php)
26.11. Datamatrix postscript output
26.12. Datamatrix example, changing colors (datamatrix_ex5.php)
27.1. QR Code high level structure
27.2. Creative usage of QR Barcodes
27.3. A small sized QR Code (version=2)
27.4. A medium sized QR code (version=13)
27.5. QR Encodation Process
27.6. The first very basic QR code (qrexample00.php)
27.7. QR Error message
27.8. Adding basic exception handling (qrexample0.php)
27.9. Adjusting the module width for the QR code (qrexample01.php)
27.10. Structure for manually specify QR encodation schema
27.11. QR Code - Example Postscript Output
27.12. A QR code template (qr_template.php)
27.13. QR Code WEB-based demo application
27.14. Specified error correction level (qrexample04.php)
27.15. QR Barcode with manually specified encodation (qrexample05.php)
27.16. QR Barcode with image in JPG format (qrexample06.php)
27.17. multiple manually specified encodation schema. (qrexample07.php)
27.18. data read from file (qrexample08.php)
27.19. (qrexample09.php)
27.20. Specified error correction level (qrexample10.php)
27.21. QR With ASCII rendering
28.1. Aqua Theme (aqua_example.php)
28.2. Green Theme (green_example.php)
28.3. Ocean Theme (ocean_example.php)
28.4. Pastel Theme (pastel_example.php)
28.5. Softy Theme (softy_example.php)
28.6. Vivid Theme (vivid_example.php)
28.7. Orange Theme (orange_example.php)
28.8. Rose Theme (rose_example.php)
28.9. Universal Theme (universal_example.php)
30.1. Theme Sample (theme_example.php)
32.1. Synchronized y and y2 scales (y2synch.php)
32.2. Using a barplot with two different scales (y2synch2.php)
33.1. usps_exhibit44.png
33.2. USPS example 1
33.3. USPS example 2
34.1. Spam statistics
35.1. Critical chain buffer penetration. Each white scatter dot represents the + state of one task.
35.2. Buffer penetration chart for example
35.3. Buffer penetration chart with "historic" tail
35.4. Complete buffer penetration example with history trace (ccbp_ex1.php)
35.5. Using the alternative color map (ccbp_ex2.php)
35.6. Steps to create the background
A.1. The documentation build process
E.1. Small size
E.2. Medium size
E.3. Large size
E.4. Standard size
E.5. Standard size
E.6. Standard size
E.7. Standard size
E.8. Standard size

List of Examples

1.1. This is the very first example (example0.php)
3.1. Verifying the GD installations (checkgd.php)
3.2. Verifying GD2 (checkgd2.php)
3.3. Installing GD through RPM packet manager
3.4. Verifying TTF with a known font (checkttf.php)
3.5. Alias configuration for a development server running Apache with + Eclipse-PDT
6.1. Throwing a JpGraph exception
6.2. Catching a JpGraph exception and sending it back as an image to the + client
8.1. Specifying and installing a user specified font
8.2. Using the SymChar class to display the Greek letter "pi"
9.1. Using an automatic cache filename and a 60min timeout of the cached + images.
9.2. General structure for a CSIM script that uses CSIM
10.1. Principles of including CSIM graph in a HTML page
10.2. Creating CSIM URL targets to open in same browser window
10.3. Creating CSIM URL targets to open in a fresh window
10.4. Example of HTML page that includes two Graph CSIM scripts + ("Examples/csim_in_html_ex2.html")
13.1. Illustration of different types of NULL values in graphs
14.1. Adjusting the axis font and color
14.2. Adjusting manual text tick interval
14.3. Adjusting the interval for the labels
14.4. Adjusting both text tick mark and label interval
14.5. Different densities for plot bands
14.6. Different densities for various plot bands
14.7. We want the time adjustment to start on an even quarter of an hour, + i.e. an even 15 minute period.
14.8. We want the time to start on an even 2 hour
14.9. Manually creating a date/time scale (timestampex01.php)
15.1. The most simple line graph (example0-0.php)
15.2. Adding some titles (example2.php)
15.3. A basic scatter plot (scatterex1.php)
15.4. An example with geo maps (pushpinex1.php)
16.1. A basic Pie graph (example26.php)
16.2. Adding several pie plots to the same pie graph (pieex3.php)
16.3. Pie plots with a background image (piebkgex1.php)
16.4. Having the name of the months as title of the axis
16.5. A more complex example of a radar graph with a manual scale (fixscale_radarex1.php)
16.6. The simplest possible Gantt graph (ganttex00.php)
17.1. A simple canvas graph to draw a text box (canvasex01.php)
17.2. Drawing some basic geometric shapes on a canvas (canvasex02.php)
17.3. Creating a canvas graph with a scale and using the shape class (canvasex03.php)
18.1. Linear regression using utility class (example16.6.php)
19.1. The most basic 2x4 table (table_howto1.php)
20.1. A basic odometer (odotutex00.php)
20.2. Adding titles and captions (odotutex02.php)
20.3. Adding a multi line caption (odotutex03.php)
20.4. Adjusting the scale format (odotutex15.php)
20.5. Using layout classes for automatic positioning (odotutex18.php)
21.1. Examples of input data for compass (regular) Windrose plots
21.2. Examples of input data for free Windrose plots
21.3. A basic 16 direction windrose graph (windrose_ex0.php)
21.4. Adding two windrose plots to the same graph (windrose_2plots_ex1.php)
21.5. Adding a "tornado" icon to the top left corner (windrose_icon_ex1.php)
21.6. Using layout classes to position 5 windrose plots (windrose_layout_ex1.php)
21.7. (windrose_ex1.php)
21.8. (windrose_ex2.php)
21.9. (windrose_ex3.php)
21.10. (windrose_ex4.php)
21.11. (windrose_ex5.php)
21.12. (windrose_ex6.php)
21.13. (windrose_ex7.php)
21.14. Show how to set different styles for individual radial grid lines (windrose_ex8.php)
21.15. (windrose_ex9.php)
21.16. (windrose_bgimg_ex1.php)
22.1. A basic matrix graph with all default values (matrix_ex0.php)
22.2. Adding an icon to the lower right corner (matrix_ex03.php)
22.3. Adding a background image to the matrix graph (matrix_ex04.php)
22.4. Using layout classes with Matrix plots (matrix_layout_ex1.php)
22.5. Matrix example with CSIM (matrix_csimex01.php)
25.1. The most basic PDF417 script (pdf417_ex0.php)
25.2. Adding error handling (pdf417_ex1.php)
25.3. Adjusting the number of columns and error correction level (pdf417_ex1b.php)
25.4. Adjusting the module width and showing human readable text (pdf417_ex2.php)
25.5. Showing human readable text (pdf417_ex3.php)
25.6. Changing colors (pdf417_ex4.php)
25.7. (pdf417_ex5.php)
25.8. (pdf417_ex6.php)
26.1. The simplest possible datamatrix script (datamatrix_ex00.php)
26.2. Datamatrix with basic error handling (datamatrix_ex0.php)
26.3. Datamatrix with modified module width (datamatrix_ex1.php)
26.4. Datamatrix example, setting quiet zone and ASCII encoding (datamatrix_ex4.php)
26.5. Datamatrix example, writing to a file (datamatrix_ex6.php)
26.6. Datamatrix example, creating postscript output (datamatrix_ex7.php)
26.7. Datamatrix example, changing colors (datamatrix_ex5.php)
27.1. The first very basic QR code (qrexample00.php)
27.2. Adding basic exception handling (qrexample0.php)
27.3. Adjusting the module width for the QR code (qrexample01.php)
27.4. Generating Postscript output (qrexample11.php)
27.5. A QR code template (qr_template.php)
27.6. Storing image to a file (qrexample03.php)
27.7. Specified error correction level (qrexample04.php)
27.8. QR Barcode with manually specified encodation (qrexample05.php)
27.9. QR Barcode with image in JPG format (qrexample06.php)
27.10. multiple manually specified encodation schema. (qrexample07.php)
27.11. data read from file (qrexample08.php)
27.12. (qrexample09.php)
27.13. Specified error correction level (qrexample10.php)
27.14. Using the ASCII backend (qrexample12.php)
32.1. (y2synch.php)
35.1. Buffer penetration example
35.2. (ccbpgraph.class.php)
+ + + + + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/manual.css b/includes/jpgraph/docs/chunkhtml/manual.css new file mode 100644 index 0000000..2ea1203 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/manual.css @@ -0,0 +1,498 @@ +/** + * DocBook CSS Stylesheet for producing the JpGraph HTML manual + * + * Version: $Id: jpg_style.css 1705 2009-07-27 18:38:54Z ljp $ + * + */ + +@import "phphl.css"; + +/* This is reserved for the part header */ +h1 { + font-size: 1.7em; + font-weight: bold; + color: white; + background-color: #3780aE; + border:2px solid #17608E; + margin-left: 0px; + margin-bottom: 15px; + margin-top: 0px; + padding-left: 5px; + padding-right: 5px; + padding-bottom: 15px; + padding-top: 15px; +} +/* This is reserved for the chapter header */ +h2 { + font-size: 1.8em; + font-weight: bold; + font-variant: small-caps; + color: #555; + /*color: #a85;*/ + line-height: 1.7em; + margin: 15px 0 15px 0; + border-bottom: 1px solid #cbb; + /*border-bottom: 2px solid #a85;*/ +} + +/* This is reserved for the sect1 header */ +div[class=sect1] h2 { + font-size: 1.4em; + font-weight: normal; + /*font-variant: small-caps;*/ + color: #555; + line-height: 1.7em; + margin: 15px 0 15px 0; + border-bottom: none; +} + +/* This is used for generic h3 header, e.g. sect2 */ +h3 { + font-size: 1.33em; + font-weight: normal; + color: #555; + text-align: left; + padding-left: 15px; +} +/* This is used for generic h3 header, e.g. sect3 */ +h4 { + font-size: 1em; + font-weight: bold; + padding-left: 15px; +} + +.filename, .option { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; +} +.guimenu, .guimenuitem { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; + padding: 0 3px; + background-color:#FF7; +} +.classname { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; + font-weight:bold; +} +.methodname { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; + font-weight:bold; +} +.command { + font-weight: bold; +} +.parameter { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; +} +.envar { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; + font-weight:bold; +} +.function { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; +} +.variablelist { + margin-left: 15px; +} +.variablelist td { + font-size: 1em; +} +.variablelist th { + font-size: 1em; +} +.screen { + font-family: "Bitstream Vera Sans Mono", Courier, monospace; + padding: 5px; + overflow: hidden; +} +.synopsis { + padding-left: 5px; + font-family: "Bitstream Vera Sans Mono", Courier, monospace; + background-color: #fef3c1; +} + +.important { + margin-top: 10px; + margin-bottom: 10px; +} + +div.mediaobject { + margin-top: 15px; + margin-bottom: 15px; +} + +.mediaobject img { + margin-left: auto; + margin-right: auto; + display: block; +} + +/* Admonitions */ +.note, +.tip { + background-color: #F8F7EF; + padding-bottom: 2px; + margin-bottom:10px; + padding-left:60px; + border-left:6px solid #56a; + background-image: url("admon-note.png"); + background-position: 6px 0.5em; + background-repeat: no-repeat; +} + +.tip h3, +.note h3 { + padding-top: 4px; + background-color: #F8F7EF; + color:#56a; + font-weight: bold; + font-style: italic; + font-size: 1.05em; +} + +.tip { + background-image: url("admon-tip.png"); +} + +.note p, +.tip p, +.caution p, +.warning p { + font-size: .85em; + font: italic .85em Georgia, serif; +} + +.caution, +.warning { + background-color: #F8F7EF; + padding-bottom: 2px; + margin-bottom:10px; + padding-left:60px; + border-left:6px solid #D55C21; + background-image: url("admon-warning.png"); + background-position: 6px 0.5em; + background-repeat: no-repeat; +} + +.caution h3, +.warning h3 { + padding-top: 4px; + color: #922; + font-weight: bold; + font-style: italic; + font-size: 1.05em; +} + + +.warning { + background-image: url("admon-bug2_small.png"); +} + + +.important { + background-color: #f18b8b; +} + +.important h1 { + background-color: #f18b8b; +} + +.important .important_content { + background-color: #f8cbcb; + border-left: 4px solid #f18b8b; + border-right: 4px solid #f18b8b; + border-bottom: 4px solid #f18b8b; + padding: 5px 0; +} + + +.screenshot { + margin: 10px; + text-align: center; +} +.variablelist { + margin-left: 15px; + margin-right: 15px; +} + +p, .synopsis, .example, .important, .formaltable { + margin: 0 15px 1em 15px; +} + +a:hover { + border-bottom: 1px solid gray; +} + +a, a:visited { + color: #000055; + font-weight: normal; + text-decoration: none; +} + +.example { + background: #fff; + border: none; + margin-left: 0px; + margin-right: 15px; +} + +.example p.title, +.figure p.title{ + font-size: 0.85em; +} + +.example-contents { + background-color: #fff; + padding: 2px; +} + +.programlisting { + padding: 1ex; + background-color: #eee; + border: 1px dashed #ccc; + margin-left:10px; + margin-right:15px; + white-space: normal; + overflow : hidden; +} + +.screen { + margin-left: 15px; +} + +code { + white-space: pre; + font-size: 1.05em; +} + +code.filename { + font-weight: bold; + font-size: 0.9em; + color: #00688b; +} + +a.uri { + font-weight: bold; + font-size: 1.1em; + color: #00283b; +} + +.uri .filename, uri.filename { + font-size: 1.25em; + background-image: url("text-document.png"); + background-position: 1px 0px; + background-repeat: no-repeat; + margin-left:1px; + padding-left:18px; +} + + +span.markup { + font-weight: bold; + color: #8b2500; + background-color: #eee; +} + +.figure { + margin-top: 15px; + margin-bottom: 15px; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +/* +.titlepage h2.title { + font-weight:bold; +} +*/ + +/* Tables */ + +div.informaltable table { + width: 100%; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +thead { + background: #eee; +} + +thead th { + border: 1px solid #ccc; +} + +div.table { + margin-left: 15px; +} + +div.table-contents table { + border: 1px solid #ccc; + border-collapse: collapse; +} + +div.table-contents td { + border: 1px solid #ccc; +} + +div.table-contents td p.checkmark:before { + content: url("checkmark.png"); +} + +/* TOC */ + +.toc span.preface { + padding-left: 15px; + font: bold 1.05em Arial, serif; + font-style: italic; +} + + +.toc span.part { + padding-left: 15px; + font: bold 1.3em Arial, serif; +} + +span.chapter { + padding-left: 15px; + font: normal 1.05em Arial, serif; +} + +span.sect1 { + padding-left: 15px; + font-size: .85em; + font: normal .85em Georgia, serif; + +} + +div.toc { + background-color:#efeedd; + border:1px solid #cebcac; + padding-bottom:2px; + padding-top:10px; + margin-bottom:15px; +} + +span.sect2 { + padding-left: 15px; + font-size: .85em; + font: normal .85em Georgia, serif; + +} + + +.toc b { + font-size: 1.5em; + color:#555; +} + +div.list-of-examples, +div.list-of-tables +{ + padding-top:10px; + padding-bottom:5px; + background-color:#e5ded2; + background-color:#efeedd; + border:1px solid #c5beb2; + margin-bottom: -1px; +} + +div.list-of-tables dl, +div.list-of-examples dl { + margin-left: 25px; +} + +div.list-of-figures { + padding-top:10px; + padding-bottom:5px; + background-color:#e5ded2; + background-color:#efeedd; + border:1px solid #c5beb2; + margin-bottom: -1px; + margin-top: -16px; +} + +div.list-of-figures dl { + margin-left: 25px; +} + +/* Navigation part of the output */ + +div.navheader { + background-color:#ebf1e8; +} + +div.navfooter { + background-color:#ebf1e8; +} + +div.navheader td { + font-size:0.85em; +} + +div.navfooter td { + font-size:0.85em; +} + +/* Q & A */ +.qandaset dl { + margin-left: 15px; + font-style: italic; + background-color:#efeedd; + border:1px solid #cebcac; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 5px; +} + +.qandaset tr.question { + font-weight: bold; + font-style: italic; +} + +/* Some special handling for manually formatted tables */ + +.bdtable { + border: #000 solid 1px; +} + +.bdhdr { + background: #ccc; +} + +.bdu { + border-bottom: #ccc solid 1px; + font-size: small; +} + +.bdu2 { + border-bottom: #333 solid 1px; + border-left: hidden; + font-size: small; +} + +.bdur { + border-right: #ccc solid 1px; + border-bottom: #ccc solid 1px; + border-left: hidden; + font-size: small; +} + +.bdur2 { + border-right: #ccc solid 1px; + border-bottom: #333 solid 1px; + border-left: hidden; + font-size: small; +} + +.error-text { + font-size: small; + color: #700000; +} + +.error-number { + font-size: small; + color: #700000; +} + diff --git a/includes/jpgraph/docs/chunkhtml/phphl.css b/includes/jpgraph/docs/chunkhtml/phphl.css new file mode 100644 index 0000000..5670816 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/phphl.css @@ -0,0 +1,70 @@ +/** + * CSS file for syntax highlightning together with Text_Highlighter + * $Id: phphl.css 1285 2009-06-13 14:59:40Z ljp $ + */ +.hl-default { + color: #000; +} +.hl-code { + color: #333; +} +.hl-brackets { + color: #808000; +} +.hl-comment { + color: #333; + font: italic 1.0em Georgia, serif; +} +.hl-quotes { + color: #8B0000; +} +.hl-string { + color: #F00; +} +.hl-identifier { + color: #00F; +} +.hl-builtin { + color: #008080; +} +.hl-reserved { + color: #008000; +} +.hl-inlinedoc { + color: #483D8B; +} +.hl-var { + color: #00008B; +} +.hl-url { + color: #00F; +} +.hl-special { + color: #000080; +} +.hl-number { + color: #800000; +} +.hl-inlinetags { + color: #00F; +} +.hl-main { + margin-right: 10px; + margin-left: 15px; + margin-bottom: 1em; + font-size: 0.95em; + background-color: #f9f9f9; +} +.hl-gutter { + background-color: #999999; + color: White; + width: 30px; + font-size: 0.95em; + border: solid 0px red; + padding-right:3px; +} +.hl-table { + font-family: courier; + border: dashed 1px gray; + background-color: #f9f9f9; +} diff --git a/includes/jpgraph/docs/chunkhtml/pr01.html b/includes/jpgraph/docs/chunkhtml/pr01.html new file mode 100644 index 0000000..7583732 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pr01.html @@ -0,0 +1,93 @@ +Preface and history of the JpGraph library

Preface and history of the JpGraph library

+ +

PHP has over the last 10 years developed from a rather small language for the enthusiasts + to a major platform for WEB based application development. The reason we call it a platform + rather than a script language is the fact that when referring to PHP it is impossible not to + include the very large library of included standard modules which makes it more of a platform + than a scripting language. As such there are more extensions to PHP both in the form of + external libraries as well as core language extension than any single person can have a + working knowledge of. This means that development teams have to select carefully where best to + invest time and training. So how can the JpGraph extension library motivate its existence? + Perhaps a quick personal reflection of how this library came about might give some insights.

+

When I first became aware of PHP at the end of 1998 the PHP 3 version was the new shiny + kid on the block after a complete rewrite of the previous PHP2. Initially I proposed to a + client I was then working for to use this new script language to build some - what was then - + state of the art interfaces to a legacy mainframe system. As part of that some basic graphic + capabilities was needed and as part of that work I put together some fairly crude and not very + generic small library that would just fit the need to my client. This was not a major part of + the development and it didn't make sense at the time to spend a lot of complex design effort + into this very small part of the system. After the work for that client was done I felt that I + should rewrite the small library I put together so that it would be both a little bit more + generic and also a bit more maintainable. (Side note: As part of the contract with the client + I was explicitly forbidden to use any object-oriented-technology since my client had been + terrible burnt by some previous contractors in this area). Hence the original library was + basically a function library and the first thing that was needed was a proper design using a + more maintainable OO-design philosophy.

+

This rewrite of the library and the "plugin" architecture/framework it is based on tried + to make the best of the very crude object oriented support available in PHP3 at that time. The + support available then was almost nothing more then some syntactic sugar. However, the initial + design from then is almost unchanged to this day, almost 11 years later. To the best of my + knowledge this makes it one (if not the) oldest object oriented library for PHP that is still + actively maintained and developed.

+

Philosophy of the manual

+

Writing a good user manual for feature rich library is a bit of a challenge. Learning to + efficiently use a library of this size is not a linear undertaking. One start with some + basics, jump to a bit that is needed at the moment, (perhaps not fully understanding the + details), and then goes back to the beginning again. This makes writing a manual that suits + everyone impossible. What we have tried is to mainly follow a "from-the-basics-to-the-advanced" style as much as possible.

+

At certain times we find ourself in the need of some more advanced concept that have not + yet been introduced. In those circumstances we will briefly introduce the concept before + making use of it and refer to other parts of the manual that discuss the particular feature in + more detail. In this way we hope that the more advanced features will at least register as an + area for further exploration even early on in the study of the library and help build up the + mental map on what is possible to do in the library. This of course has the result that the + same information might be in two or three places, but from a slightly different angle, when it + is needed. This manual is deliberately not a long list of API - a detailed description of all + API and classes are available in the reference manual.

+

A final note on the examples shown in this manual might be in place. It is custom to keep + introductory examples clean of any real error handling in order to keep them short. We do not + believe that this is a good idea. Error and exception handling is one of the most crucial part + in design and implementation of any system. For this reason we have included, where + appropriate, a basic error handling even though it will make some examples slightly + larger.

+

Typographic conventions used in this manual

+

+

  • +

    Inline code are set in monotype black fonts. Example: + Graph::Stroke()

    +
  • +

    Filenames mentioned in running text and in titles are set in bluish monotype font. + Example: php.ini

    +
  • +

    Code snippets or examples are set as block with gray background separated from the + text with line numbering. If the code snippet is PHP code it will also be syntax + highlighted.

    +

    +

    1
    +2
    +3
    +
    <?php
    +echo "Hello world!";
    +?>

    +

    +

    Note that for technical reasons with typesetting this manual even one lines code + snippets will have a surrounding of PHP tags i.e. <?php and + ?>

    +
  • +

    Described inline markup tags, i.e. HTML/XML, are set in a dark red color with light + gray background. Example: <img>

    +
  • +

    All generated graphs will have the name of the graph file in the title which is + hyper-linked to a syntax highlighted full version of the actual source that generated + the graph. The link is marked with a small icon and an example is shown in Figure 1. Link to highlighted graph source

    +

    +

    Figure 1. Link to highlighted graph source

    + +

    Link to highlighted graph source

    +


    +

    +
  • +

    Numbering of sections are only done down to three level depths, e.g. 3.4.2

    +

+

+
diff --git a/includes/jpgraph/docs/chunkhtml/pt01.html b/includes/jpgraph/docs/chunkhtml/pt01.html new file mode 100644 index 0000000..136356e --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt01.html @@ -0,0 +1,23 @@ +Part I. Installing and verifying the configuring

Part I. Installing and verifying the configuring

+ +
+

The goal of this first part is to introduce the necessary configurations options in + order to install and use the library. It will describe all necessary steps in order to + successfully install and verify the installation of the library.

+

+

Caution

+

All files in the library uses utf-8 character encoding to be able to show a + wide range of locales. The same applies to all examples. Since some example + shows how to use extended character sets , i.e. Chinese and Japanese, and the + extended characters are entered directly in the source file the editor/viewer + used to view these files must be able to show utf-8 encoded files properly. + Since utf-8 character set coincide with the ASCII character set for the usual + latin (e.g. a-z, 0-9, etc) characters most files can however be seen with non + utf-8 compliant editor/viewers.

+

+

+
+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt02.html b/includes/jpgraph/docs/chunkhtml/pt02.html new file mode 100644 index 0000000..0155bed --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt02.html @@ -0,0 +1,20 @@ +Part II. Basic graph creation

Part II. Basic graph creation

+ +
+

The goal of this part is to introduce some basic concepts that must be known when + creating graphs with the JpGraph library. It will also serve as a gentle introduction on + how to structure a basic graph script.

+

The challenge of writing a good manual is that it is sometimes necessary to use + concepts that might not have been fully explained in order to clarify some even more + basic concept. So if there are parts that you do not fully understand do not despair. + The remainder of the manual will explain a lot more of the details.

+

Table of Contents

4. Your first graph script
4.1. Some words of caution
4.2. Graphing the number of sun spots during the 19th Century
4.2.1. The historic data
4.2.2. Preparing the data
4.2.3. A basic line graph
4.2.4. A basic bar graph
5. Fundamentals of dynamic graph generation
5.1. Making sense of HTTP streams and MIME types
5.2. What is an image?
5.3. Static vs dynamic images
5.4. Dynamic images on the command line
5.5. How to generate images with JpGraph library
5.5.1. The standard steps of setting up a graph
5.5.2. Choosing the image compression format for JpGraph
5.5.3. Sending back the image to the browser
5.5.4. Writing the image directly to a file
5.5.5. Alternatives to streaming or storing the image
5.5.6. Forcing the browser to update your graph
5.5.7. Printing the generated image
5.6. Efficient graph generation using the built-in cache subsystem
6. Error handling
6.1. The problem with error messages and images
6.1.1. Catching errors in other parts of the system while creating images
6.2. Available error messages
6.2.1. Localizing error messages
6.2.2. Error messages on a production server
6.3. Using PHP Exceptions
6.3.1. Selecting between text and image based error handling
6.3.2. Writing error message to a log file (or system logger)
6.4. Adding a new locale
7. Color handling
7.1. Specifying colors by name
7.2. Specifying colors by RGB triples
7.3. Using HTML color specifications
7.4. Fine tuning the color
7.4.1. Specifying the alpha channel (color transparency)
7.4.2. Adjusting the brightness
7.4.3. Combining brightness and transparency adjustment
7.5. Additional color handling
8. Text and font handling
8.1. Different types of fonts
8.2. Font families and font styles
8.2.1. Default TrueType Font
8.3. Understanding text alignment and anchor point
8.4. Rotating text
8.5. Formatting text paragraphs
8.6. Adding custom TTF fonts
8.7. Inserting Unicode entities
8.7.1. The utility class "SymChar"
8.7.2. Graph example with Greek labels
8.8. Character encoding
8.8.1. Japanese encoding options
8.8.2. Chinese encoding options
8.8.3. Cyrillic encoding options
8.8.4. Hebrew encoding options
8.8.5. Greek encoding options
9. Using the JpGraph cache system
9.1. Enabling the library cache system
9.2. Permission settings for the cache files
9.3. Using the cache in your script
9.3.1. Manually controlling the cached image
9.4. Using the cache with Client Side Image Maps (CSIM)
10. Using CSIM (Client side image maps)
10.1. The principles
10.2. The basic structure of an image map script
10.3. Specifying targets for image map plots
10.3.1. Creating popup-windows as targets for CSIM
10.4. Using StrokeCSIM()
10.4.1. Optional argument to StrokeCSIM()
10.4.2. How does StrokeCSIM() work?
10.4.3. Image maps and the cache system
10.5. Getting hold of the image map
10.6. Mixing several CSIM images in an HTML page with text
10.6.1. Adding one CSIM graph in a HTML page
10.6.2. Adding multiple CSIM graphs in a HTML page
11. NuSphere PHP accelerator
11.1. Introduction and purpose
11.2. Installing PhpExpress
+ + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt03.html b/includes/jpgraph/docs/chunkhtml/pt03.html new file mode 100644 index 0000000..fc04607 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt03.html @@ -0,0 +1,12 @@ +Part III. Common features

Part III. Common features

+ +
+

This part will describe the common features for all graphs as well as explaining the + structure of a typical graph script. After reading through this part the user should + have a basic understanding how to create simple graph scripts and understand what core + settings and naming conventions are used.

+

Table of Contents

12. Commonalities for all graphs
12.1. Common objects for cartesian graphs (x-, y-graphs)
12.2. Common object for Pie Graphs
13. Getting hold of the data to be displayed
13.1. Static data
13.2. Reading data from a file
13.3. Sending data to a graph script with URI arguments (GET and POST)
13.3.1. Using GET arguments
13.3.2. Using a POST request
13.4. Reading data from a database
13.5. Reading binary data from a file
13.6. Different types of NULL data handling
13.7. Troubleshooting input data
14. Common features for all Cartesian (x,y) graph types
14.1. The definition of linear graphs
14.1.1. Axis and coordinate systems
14.1.2. Adjusting the axis look and feel
14.1.3. Adding grid lines in the plot
14.1.4. Predefined scientific axis setups
14.1.5. Other possible ways to position the axis
14.2. Specifying and formatting the overall displayed graph
14.2.1. Adjusting size, margins and frame
14.2.2. Adding drop shadow to the graph
14.2.3. Formatting and specifying the titles of the graph
14.2.4. Specifying the image format to use
14.2.5. Generic line formatting
14.2.6. Adding a footer to the graph
14.2.7. Adding timing of graphs
14.3. Adjusting the look and feel of the plot area
14.3.1. Plot area and margin areas
14.3.2. Clipping to the plot area
14.4. Adjusting the position and layout of the legend
14.5. Other formatting options of the axis
14.5.1. Adjusting and positioning titles on the axis
14.5.2. Adjusting the font and color of the title
14.6. Using multiple y-axis
14.6.1. Adding additional y-axis
14.6.2. Using CSIM together with multiple y-axis
14.6.3. Restrictions with multiple y-axis
14.7. Understanding and using different scales on the axis
14.7.1. Different scale types
14.7.2. Manual vs automatic scale handling
14.7.3. Major and minor ticks
14.8. Adjusting the appearance of the scale labels
14.8.1. Adjusting the position
14.8.2. Adjusting font and color
14.8.3. Adjusting the background of the labels
14.8.4. Hiding and rotating labels
14.8.5. Fine tuning the automatic scales
14.8.6. Manually altering the appearance of tick marks
14.8.7. Manually specifying scale labels
14.8.8. Emphasize of parts of the scale
14.8.9. Adding static lines for specific scale values in the graph
14.9. Using a logarithmic scale
14.10. Using a date/time scale
14.10.1. Specifying the input data
14.10.2. Adjusting the start and end date alignment
14.10.3. Manually adjusting the ticks
14.10.4. Adjusting the label format
14.10.5. Adjusting the automatic density of date labels
14.10.6. Creating a date/time scale with a manual label call-back
14.10.7. Using the "DateScaleUtils" class to make manual date scale
14.10.8. When to use manual and when to use automatic date scale?
14.11. Adding shearing image transformation to the graph
14.12. Rotating graphs
14.12.1. Free rotation of the plot area
14.12.2. Rotating the plot area 90 degree
14.13. Using anti-aliasing in the graph generation
14.13.1. Anti-aliasing for line drawing graphs
14.13.2. Anti-aliasing in pie graphs
14.13.3. Anti-aliasing in Windrose plots
14.13.4. Anti-aliasing for Contour plots
14.14. Adding icons (and small images) to the graph
14.15. Adding images and country flags to the background of the graph
14.15.1. Using country flags as backgrounds
14.16. Using background gradients
14.16.1. Generating gradient background off-line
14.17. Adding arbitrary texts to the graph
+ + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt04.html b/includes/jpgraph/docs/chunkhtml/pt04.html new file mode 100644 index 0000000..abb2939 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt04.html @@ -0,0 +1,7 @@ +Part IV. Creating linear and non-linear graphs

Part IV. Creating linear and non-linear graphs

Table of Contents

15. Different types of linear (cartesian) graph types
15.1. Basic Line and area graphs
15.1.1. Creating a line graph
15.1.2. Automatic interpolation of unknown data
15.1.3. Adding marks to the plot (a.k.a. plot marks)
15.1.4. Displaying the values at the data points
15.1.5. Adding several data series to the same graph
15.1.6. Adding a second Y-axis
15.1.7. Adding a legend box to the graph
15.1.8. Changing the style of the line plot - using the step-style
15.1.9. Optimizing line plot using "fast drawing"
15.1.10. Creating a filled line graphs (a.k.a. area plots)
15.1.11. Partially filled area graphs
15.1.12. Filled lines with NULL values
15.1.13. Accumulated line graphs
15.1.14. Accumulated line graphs with given X-labels
15.1.15. Constructing smooth line plots with Cubic Splines
15.2. Bar graphs
15.2.1. Accumulated bar plots
15.2.2. Grouped bar plots
15.2.3. Grouped accumulated bar graphs
15.2.4. Horizontal bar graphs
15.2.5. Adjusting the appearance of bar graphs
15.3. Error plot graphs
15.3.1. Line error plots
15.4. Stock graphs
15.4.1. Stock plot variant: Boxplot
15.4.2. Image maps for Box and Stock charts
15.5. Scatter graphs
15.5.1. Combining marks with a line
15.5.2. Creating impulse (or stem) - plots
15.5.3. Field plots
15.5.4. Balloon plots
15.5.5. Creating Geo-maps
15.6. Contour graphs
15.6.1. Input data for contour graphs
15.6.2. Creating a contour graph
15.6.3. Adjusting the color and number of isobar lines
15.6.4. Understanding mesh interpolation
15.7. Combining several different plot types in the same graph
15.8. Creating several graphs in the same image
15.8.1. Creating a combined graph
15.8.2. Adding background images
15.8.3. Creating rotated combined graphs
15.8.4. Some caveats when using MGraph
16. Non-Linear graph types
16.1. Pie graphs
16.1.1. Hare/Niemeyer Integer compensation for Pie Plots
16.1.2. 2D-Pie plots
16.1.3. 3D-Pie plots
16.1.4. Ring plots
16.1.5. Exploding pie slices
16.1.6. Specifying and adjusting labels on pie plots
16.1.7. Adding drop shadows to the slices
16.1.8. Adding background images to Pie graphs
16.1.9. Specifying slice colors and using themes
16.2. Radar graphs
16.2.1. Adding radar plots to a radar graph
16.2.2. Adding plot-marks to radar plots
16.2.3. Client Side Image maps
16.2.4. Adjusting the overall properties of the radar graph
16.2.5. Adjusting the axis formatting
16.2.6. Adjusting grid lines for the radar graph
16.2.7. Using a logarithmic scale
16.2.8. Enabling anti-aliasing for radar graphs
16.2.9. A final example
16.3. Polar graphs
16.3.1. Rotating the polar graph
16.3.2. Changing the angle direction
16.3.3. Adding polar plots to a polar graph
16.3.4. Adding plot-marks to polar plots
16.3.5. Client Side Image maps
16.3.6. Adjusting the radius scale
16.3.7. Adjusting the grid lines
16.3.8. Adjusting the labels
16.4. Gantt charts
16.4.1. The structure of a Gantt chart
16.4.2. Creating a Gantt graph
16.4.3. Adjusting the scale headers
16.4.4. Adding gantt objects to the chart
16.4.5. Additional formatting for activity bars (Gantt bars)
16.4.6. Adding visual indication of constraints between gantt objects
16.4.7. Grouping activities
16.4.8. Simplifying creation of basic Gantt charts
16.4.9. Using multiple title columns
16.4.10. Built-in icons for use in activity titles
16.4.11. More general Gantt formatting
16.4.12. Localizing the Gantt chart scale
16.4.13. CSIM Support in Gantt charts
16.4.14. Some final Gantt graph examples
17. Additional graph types
17.1. LED bill boards
17.1.1. Cyrillic character support
17.2. Captcha generation
17.2.1. Generating Captchas
17.3. Canvas graphs
17.3.1. Creating a simple canvas
17.3.2. Adding lines and rectangles to a canvas
17.3.3. Using a canvas scale together with the shape class
18. Miscellaneous formatting and tools
18.1. Linear regression analysis
+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt05.html b/includes/jpgraph/docs/chunkhtml/pt05.html new file mode 100644 index 0000000..2c7f107 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt05.html @@ -0,0 +1,8 @@ +Part V. Additional graph types available in the professional version

Part V. Additional graph types available in the professional version

Table of Contents

19. Graphical tables
19.1. Introduction
19.2. Constructing tables
19.2.1. Basic tables
19.2.2. Merging cells
19.2.3. Font adjustment
19.2.4. Color adjustment
19.2.5. Adjusting table and cell sizes
19.2.6. Fine tuning cell alignment and cell padding
19.2.7. Adjusting border and grid lines
19.2.8. Specific number formatting
19.2.9. Using images and country flags in the table
19.3. CSIM Table support
19.4. Table API Overview
19.5. Examples
19.5.1. Example 1
19.5.2. Example 2
19.5.3. Example 3
19.5.4. Example 4
19.5.5. Example 5
19.5.6. Example 6
19.6. Case study: Adding a table to a bar graph
20. Odometer
20.1. Introduction
20.1.1. Features
20.2. Creating and formatting basic odometer graphs
20.2.1. A basic odometer
20.2.2. Half and Full Odometers
20.2.3. Adding titles and captions
20.2.4. Adjusting colors
20.2.5. Changing indicator needle style
20.2.6. Adding drop shadows
20.2.7. Changing sizes and margins
20.2.8. Adding color indications in the scale
20.2.9. Changing size of the non-colored center area
20.2.10. Using multiple indicator needles in one odometer
20.2.11. Adding an odometer legend (label)
20.2.12. Adjusting the width and color of the odometer frame (border)
20.3. Working with the odometer scale
20.3.1. Adjusting the scale, ticks and labels
20.3.2. Adjusting scale label format
20.3.3. Adjusting the start and stop angle for the scale
20.4. Adding and positioning multiple odometers to a graph
20.4.1. Manual positioning
20.4.2. Using layout classes
20.5. Adding icon and text objects to the graph
20.5.1. Adding a text object
20.5.2. Adding icons to the graph
20.5.3. Adding background images
21. Windrose
21.1. Introduction
21.1.1. Features
21.1.2. Different types of Windrose plots
21.2. Creating and formatting basic Windrose graphs
21.2.1. Specifying the windrose scale
21.2.2. Specifying direction labels
21.3. Formatting the plot
21.3.1. Positioning the plot
21.3.2. Specifying the size of the plot
21.3.3. Specifying the size of the Zero-circle (middle circle)
21.3.4. Formatting the plot legend
21.3.5. Adjusting the grid colors
21.3.6. Adjusting the weight of the grid circles
21.3.7. Adding a box around the plot
21.3.8. Adjusting the size of the center zero circle
21.3.9. Localizing the default names for the compass directions
21.3.10. Adjusting the formatting of the windrose plot legs
21.4. Some more advanced formatting
21.4.1. Turning off Anti-aliasing
21.4.2. More on formatting scale-labels
21.4.3. Formatting the legend
21.4.4. Highlighting specific compass directions
21.4.5. Including a graph in a PDF
21.4.6. Adding a background image
21.4.7. Adjusting the interpretation for ordinal keys in data
21.5. Adding icon and text objects to the graph
21.5.1. Adding a text object
21.5.2. Adding icons to the graph
21.6. Using layout classes to position Windrose plots
21.7. Example section
21.7.1. Example 1
21.7.2. Example 2
21.7.3. Example 3
21.7.4. Example 4
21.7.5. Example 5
21.7.6. Example 6
21.7.7. Example 7
21.7.8. Example 8
21.7.9. Example 9
21.7.10. Example 10
22. Matrix graphs
22.1. Introduction
22.1.1. Features of the matrix plots
22.2. Creating and formatting a basic matrix graph
22.3. Mesh interpolating of input data
22.4. Formatting the matrix plot
22.4.1. Color maps
22.4.2. Changing the module type (rectangle vs. circle)
22.4.3. Adjusting the alpha blending of the plots
22.4.4. Specifying the size
22.4.5. Specifying the position of the plot on the graph
22.4.6. Adjusting the legend
22.4.7. Adding row and column legends
22.5. Adding icon and text objects to the graph
22.5.1. Adding a text object
22.5.2. Adding icons to the graph
22.5.3. Adding background images
22.6. Adding marker lines to the matrix plot
22.7. Using layout classes to position matrix plots
22.8. Built in color maps
22.8.1. Standard maps
22.8.2. Normalized center
22.8.3. Continues map
22.9. Using CSIM with matrix plots
22.10. Matrix graph examples
22.10.1. Example 1
22.10.2. Example 2
22.10.3. Example 3
22.10.4. Example 4
23. Filled contour graphs
23.1. Filled Contour graphs
23.1.1. Creating a filled contour graph
23.1.2. Enabling and disabling contour lines
23.1.3. Specifying a filled contour
23.1.4. Adjusting the labels in the contour
23.1.5. Selecting the adaptive method to use
+ + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt06.html b/includes/jpgraph/docs/chunkhtml/pt06.html new file mode 100644 index 0000000..88867e4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt06.html @@ -0,0 +1,15 @@ +Part VI. Barcodes

Part VI. Barcodes

+ +
+

For a good historic overview of barcodes and there usage we refer to Wikipedia http://en.wikipedia.org/wiki/Barcode

+

Table of Contents

24. Linear Barcodes (One Dimensional Barcodes)
24.1. Introduction
24.2. How does linear barcodes work?
24.3. Barcode symbologies
24.3.1. Numerical only barcode symbologies
24.3.2. Alphanumerical barcode symbologies
24.3.3. Which symbology should be used?
24.4. Features
24.4.1. Sample application
24.5. Creating barcodes - quick start
24.6. Error handling
24.7. Generating barcodes on the command line
24.8. Format options for barcodes
24.8.1. Adjusting the encodation process
24.8.2. Selecting output format
24.8.3. Writing barcodes to a file
24.8.4. Hiding the human readable text
24.8.5. Adjusting the module width
24.8.6. Setting vertical or horizontal layout
24.8.7. Adjusting height of bar code
24.8.8. Scaling of bar codes
24.8.9. Add frame around bar code
24.8.10. Examples of adjusting the output
24.9. Short description of supported symbologies
24.9.1. UPC A
24.9.2. UPC E
24.9.3. EAN 8
24.9.4. EAN 13
24.9.5. EAN 128
24.9.6. Industrial 2 of 5
24.9.7. Interleaved 2 of 5
24.9.8. CODE 11 (USD 8)
24.9.9. CODE 39
24.9.10. CODE 39 Extended
24.9.11. CODE 128
24.9.12. CODABAR
24.9.13. Bookland (ISBN)
25. PDF417 (2D-Barcode)
25.1. Principle of PDF417 Barcodes
25.1.1. PDF417 standard
25.1.2. Data capacity
25.1.3. Structure of PDF417 barcodes
25.2. Creating barcodes
25.2.1. Introduction
25.3. Creating barcodes
25.4. Specifying the PDF417 parameters
25.4.1. Specifying encoding and input data
25.4.2. Encoder option: Adjusting the number of data columns
25.4.3. Encoder option: Adjusting the error level
25.4.4. Truncated PDF417
25.5. Adjusting the output
25.5.1. Output format
25.5.2. Summary of user settings for the backend
25.6. A template to create barcodes
25.7. Method reference
25.7.1. Encoder methods
25.7.2. Common backend methods
25.7.3. Image backend methods
25.7.4. Postscript backend methods
25.8. Example scripts
25.8.1. Showing human readable text
25.8.2. Altering colors
25.8.3. Creating postscript output
25.8.4. Manually selecting compaction schema
26. Datamatrix (2D-Barcode)
26.1. Principle of Datamatrix Barcodes
26.1.1. Summary of features offered in the library
26.1.2. Limitation of the JpGraph Datamatrix implementation
26.1.3. Datamatrix standard
26.1.4. Structure of Data Matrix codes
26.1.5. Encodation efficiency
26.1.6. More on ECC Datamatrix subsets
26.1.7. Symbology Data capacity
26.2. Creating barcodes
26.2.1. Getting started
26.2.2. Error handling
26.2.3. Encodation options
26.2.4. Processing special input characters
26.2.5. Creating different backends
26.2.6. Generic backend methods
26.2.7. Image backend methods
26.2.8. Postscript backend format options
26.2.9. A template to create barcodes
26.2.10. Sample application
26.3. Example script
26.3.1. Example 1 - Setting the shape
26.3.2. Example 2 - Writing to a file
26.3.3. Example 3 - Creating postscript output
26.3.4. Example 4 - Changing background color
27. QR (2D-Barcode)
27.1. Principle of QR Barcodes
27.1.1. Summary of library features
27.1.2. Limitation in the JpGraph QR implementation
27.1.3. QR Standard
27.1.4. Structure and capacity of QR barcodes
27.1.5. QR versions and symbol size
27.1.6. Error correction level
27.1.7. Comparing the visual output with other QR-generating software
27.2. Creating barcodes
27.2.1. Getting started
27.2.2. Error handling
27.2.3. Creating an encoder
27.2.4. Encodation of input data options
27.2.5. Reading input data from a file
27.2.6. Creating different backends
27.2.7. Generic backend methods
27.2.8. Image backend methods
27.2.9. Postscript backend methods
27.2.10. A template to create barcodes
27.2.11. Sample application
27.3. Example scripts
27.3.1. Example 1 - Store QR code to file
27.3.2. Example 2 - Specified error correction level
27.3.3. Example 3 - Manual specified encoding
27.3.4. Example 4 - JPEG image format
27.3.5. Example 5 - Multiple manual encoding
27.3.6. Example 6 - Reading data from file
27.3.7. Example 7 - Adjusting colors
27.3.8. Example 8 - Setting error correction level
27.3.9. Example 9 - Generating ASCII output
+ + + + + + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt07.html b/includes/jpgraph/docs/chunkhtml/pt07.html new file mode 100644 index 0000000..8e8e534 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt07.html @@ -0,0 +1,14 @@ +Part VII. Theme Class

Part VII. Theme Class

+ +
+

It is easy to create great graphs using the theme class. +Themes automatically apply settings to every part of the graph; including the background, legend and design. The AquaTheme for example uses a base color of blue. +It is also possible to create entirely new themes by customizing the original designs. +

+
+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt08.html b/includes/jpgraph/docs/chunkhtml/pt08.html new file mode 100644 index 0000000..ec1b128 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt08.html @@ -0,0 +1,7 @@ +Part VIII. Case studies

Part VIII. Case studies

+ + + + + +
diff --git a/includes/jpgraph/docs/chunkhtml/pt09.html b/includes/jpgraph/docs/chunkhtml/pt09.html new file mode 100644 index 0000000..8ce55c4 --- /dev/null +++ b/includes/jpgraph/docs/chunkhtml/pt09.html @@ -0,0 +1,16 @@ +Part IX. Appendices

Part IX. Appendices

Table of Contents

A. How this manual was produced
B. JpGraph Professional License
B.1. Single License
B.2. Bulk (Re-seller license)
C. FAQ
D. Named color list
E. Available plot marks
E.1. Built in basic plot marks
E.2. Built in image plot marks
E.2.1. Image plot mark: Balls
E.2.2. Image plot mark: Squares
E.2.3. Image plot mark: Diamonds
E.2.4. Image plot mark: Stars
E.2.5. Image plot mark: Bevels
E.2.6. Image plot mark: Pushpins
F. List of all country flags
G. List of files included in the library
H. Error messages
H.1. Core error messages
H.2. QR 2D Barcode error messages
H.3. Datamatrix 2D barcode error messages
I. Compiling PHP
I.1. Compiling PHP4
I.1.1. Client version
I.1.2. Apache module
I.1.3. CGI extension
I.2. Compiling PHP5
I.2.1. Client version
I.2.2. Apache module
I.2.3. CGI extension
J. Setting up PHP5 in parallel with PHP4 in SuSE 10.1
J.1. Configuration files and directories for Apache2 in SuSE 10.1
J.2. Making sure you have the correct Apache2 setup
J.3. Approaches to running multiple PHP versions
J.4. Outline of the remainder of the chapter
J.5. Part I - Installing PHP4
J.5.1. Step one; Compiling PHP4 as a module for Apache2
J.5.2. Step two; Enable the PHP4 module in the Apache2 configuration
J.6. Part II - Creating a virtual host
J.6.1. Step 1; Adding an alias IP-address to Your server
J.6.2. Step 2; Creating different document and cgi roots
J.6.3. Step 3; Configure Apache with a virtual host
J.7. Part III - Installing PHP5
J.8. Part IV - Verifying the setup
J.8.1. Troubleshooting
K. Why it is not possible to add a SVG backend to JpGraph
K.1. Background
K.2. Summary of findings
K.3. Detailing the issue
K.3.1. The core problem
K.3.2. Why is this a problem ?
K.3.3. Possible workarounds
K.3.4. What would be required ?
K.3.5. DOM scripting and GetBBox()
K.3.6. A final comment
L. The JpGraph configuration file
+ + + + + + + + + + + + + + <xi:include></xi:include> +
diff --git a/includes/jpgraph/docs/chunkhtml/text-document.png b/includes/jpgraph/docs/chunkhtml/text-document.png new file mode 100644 index 0000000..a4a3522 Binary files /dev/null and b/includes/jpgraph/docs/chunkhtml/text-document.png differ diff --git a/includes/jpgraph/docs/classref/AccBarPlot.html b/includes/jpgraph/docs/classref/AccBarPlot.html new file mode 100644 index 0000000..ba7a64a --- /dev/null +++ b/includes/jpgraph/docs/classref/AccBarPlot.html @@ -0,0 +1,88 @@ +
Class AccBarPlot Extends BarPlot
+(Defined in: jpgraph_bar.php : 706)
 
 AccBarPlot  BarPlot 
 Max() 
Min() 
__construct() 
+
 RotatePattern() 
SetAbsWidth() 
SetAlign() 
SetFillColor() 
SetFillGradient() 
SetNoFill() 
SetPattern() 
SetShadow() 
SetValuePos() 
SetWidth() 
SetYBase() 
SetYMin() 
__construct() 
+
 

Class usage and Overview
Accumulated bar plot.
+Used to create bars where the data series are stacked on top of each other. +

+Features: +

    +
  1. Can be combined with Image maps for each series. +
  2. Values for each series can be displayed when the pointer is hovering over the corresponding part of the bar +
  3. Unlimited number of series +
+

+Examples: +

  +

See also related classes:
BarPlot, GroupBarPlot and AccLinePlot

 


Class Methods

+

 

AccBarPlot ::
Max()
+ +Return the maximum value of the bars

+
+ +

Description:
Return the maximum value of the bars 
+ +

Example:

+list($xmin,$ymin) = $accbar->Max(); + +

+

+

 

AccBarPlot ::
Min()
+ +Return minimum data values for the bars

+
+ +

Description:
Return minimum data values for the bars 
+ +

Example:

+list($xmin,$ymin) = $accbar->Min(); + +

+

+

 

AccBarPlot ::
__construct($plots)
+ +Construct a new accumulated bar graph

+ + + + +
ArgumentDefaultDescription
+$plots + + + Array of bar plots
+ +

Description:
Create a new accumulated bar plot based on the given array of ordinary bar plots. 
+  
See also:
+

Example:

+$b1 = new BarPlot($y1data);
$b2 = new BarPlot($y2data);
$accbar = new AccBarPlot(array($b1,$b2));

+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/AccLinePlot.html b/includes/jpgraph/docs/classref/AccLinePlot.html new file mode 100644 index 0000000..348b740 --- /dev/null +++ b/includes/jpgraph/docs/classref/AccLinePlot.html @@ -0,0 +1,100 @@ +


Class AccLinePlot Extends Plot
+(Defined in: jpgraph_line.php : 450)
 
 AccLinePlot  Plot 
 Max() 
Min() 
SetInterpolateMode() 
__construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
Accumulated bar plot.
+Used to create a line plot where each individual data point is the sum of the individual series data points. +

+Features: +

    +
  1. Unlimited number of series +
+

  +

See also related classes:
AccBarPlot and LinePlot

 


Class Methods

+

 

AccLinePlot ::
Max()
+ +Return the max value of data points in plot.

+
+ +

Description:
Takes into account all series and returns the maximum Y and X values for all the data series. Used internally to determine the autoscaling. 
+  
See also:
+

Example:

+list($xmax,$ymax) = $acclineplot->Max(); + +

+

+

 

AccLinePlot ::
Min()
+ +Return the min value of all data points in plot.

+
+ +

Description:
Takes into account all series and returns the minimum Y and X value. Used internally to determine autoscaling. 
+  
See also:
+

Example:

+list($xmin,$ymin) = $acclineplot->Min()
+
+

+

+

 

AccLinePlot ::
SetInterpolateMode($aIntMode)
+ +Enable interpolate mode

+ + + + +
ArgumentDefaultDescription
+$aIntMode + + + TRUE=Enable interpolation
+ +

Description:
When plotting accumulated line plots which have NULL values as data (i.e. '-') they will distort the accumulated plot since they will in effect be interpretated as having value 0. This means that there will be a drop in the plot. The only way to avoid this is to calculate the intermediate value. + +This can be achieved by calculating a linear interpoaltion for the missing value(s). Calling this method will replace all '-' values with an interpolated value. + 
+ +

Example:

+$accline->SetInterpolateMode() + +

+

+

 

AccLinePlot ::
__construct($plots)
+ +Constructor

+ + + + +
ArgumentDefaultDescription
+$plots + + + Array of line plots to use
+ +

Description:
Creates a new accumulated line plot from a number of line plots. 
+  
See also:
+

Example:

+$line1 = new LinePlot($datay1);
$line2 = new LinePlot($datay2);
$aline = array($line1,$line2);
$acclineplot = new AccLinePlot($aline); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/AntiSpam.html b/includes/jpgraph/docs/classref/AntiSpam.html new file mode 100644 index 0000000..092d9df --- /dev/null +++ b/includes/jpgraph/docs/classref/AntiSpam.html @@ -0,0 +1,96 @@ +


Class AntiSpam
+(Defined in: jpgraph_antispam.php : 546)
 
 AntiSpam 
 Rand() 
Set() 
Stroke() 
__construct() 
+
 

Class usage and Overview
This module is used to create AntiSpam challenges that can be used to prevent automatic signup by robots on WEB-pages.

  +


Class Methods

+

 

AntiSpam ::
Rand($aLen)
+ +Generate a random spam challenge string

+ + + + +
ArgumentDefaultDescription
+$aLen + + + Sets the length of the generated string
+ +

Description:
Instead of specifying the string manually that should be used as a challenge the string can be automatically generated. This is done witha call to the Rand() method.  
+ +

Example:

+$antispam = new AntiSpam();
$rval $antispam->Rand();
...
+
+

+

+

 

AntiSpam ::
Set($aData)
+ +Set the spam challenge string

+ + + + +
ArgumentDefaultDescription
+$aData + + + Spam challenge
+ +

Description:
This is an alternative way of specifying the AntiSpam string. This can also be specified in the initial creation of the ANtiSpam object ro be automatically generated with a call to the Rand() method 
+  
See also:
+

Example:

+$antispam = new AntiSpam();
...
$antispam->Set($mySpamVal); +
+

+

+

 

AntiSpam ::
Stroke()
+ +Send the antispam image back to the browser

+
+ +

Description:
This sends the antispam image back to the browser or to an optional file named as the first and only argument. 
+  
See also:
+

Example:

+$antispam = new AntiSpam();
$rval $antispam->Rand();
...
$antispam->Stroke() +
+

+

+

 

AntiSpam ::
__construct($aData)
+ +Create a new ANtiSpam challenge image

+ + + + +
ArgumentDefaultDescription
+$aData + + + +'' + +Data to be displayed
+ +

Description:
This method creates a new instance of the AntiSpam challenge. When the anti-spam imga eis created it is possible to directly use a supplied data string that should be displayed. + +The data can also be added afterwards with a call to Set() 
+  
See also:
+

Example:

+$spam = new AntiSpam(); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Axis.html b/includes/jpgraph/docs/classref/Axis.html new file mode 100644 index 0000000..d14de5b --- /dev/null +++ b/includes/jpgraph/docs/classref/Axis.html @@ -0,0 +1,133 @@ +


Class Axis Extends AxisPrototype
+(Defined in: jpgraph.php : 3661)
 
 Axis  AxisPrototype 
 Stroke() 
StrokeLabels() 
__construct() 
+
 Hide() 
HideFirstLastLabel() 
HideFirstTickLabel() 
HideLabels() 
HideLastTickLabel() 
HideLine() 
HideTicks() 
HideZeroLabel() 
SetColor() 
SetFont() 
SetLabelAlign() 
SetLabelAngle() 
SetLabelFormat() 
SetLabelFormatCallback() 
SetLabelFormatString() 
SetLabelMargin() 
SetLabelSide() 
SetMajTickPositions() 
SetPos() 
SetPosAbsDelta() 
SetTextLabelInterval() 
SetTextTickInterval() 
SetTickLabels() 
SetTickPositions() 
SetTickSide() 
SetTickSize() 
SetTitle() 
SetTitleMargin() 
SetTitleSide() 
SetWeight() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

Axis ::
Stroke($aOtherAxisScale, $aStrokeLabels)
+ +// Stroke the axis.

+ + + + + + +
ArgumentDefaultDescription
+$aOtherAxisScale + + + No description available
+$aStrokeLabels + + + +true + +No description available
+ +

Description:
No description available.

+

 

Axis ::
StrokeLabels($aPos, $aMinor, $aAbsLabel)
+ +//---------------// PRIVATE METHODS// Draw all the tick labels on major tick marks

+ + + + + + + + +
ArgumentDefaultDescription
+$aPos + + + No description available
+$aMinor + + + +false + +No description available
+$aAbsLabel + + + +false + +No description available
+ +

Description:
No description available.

+

 

Axis ::
__construct($img, $aScale, $color)
+ +//===================================================// CLASS Axis// Description: Defines X and Y axis. Notes that at the// moment the code is not really good since the axis on// several occasion must know wheter it's an X or Y axis.// This was a design d

+ + + + + + + + +
ArgumentDefaultDescription
+$img + + + No description available
+$aScale + + + No description available
+$color + + + +'black' + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/AxisPrototype.html b/includes/jpgraph/docs/classref/AxisPrototype.html new file mode 100644 index 0000000..0b6e839 --- /dev/null +++ b/includes/jpgraph/docs/classref/AxisPrototype.html @@ -0,0 +1,875 @@ +


Class AxisPrototype
+(Defined in: jpgraph.php : 3441)
 
 AxisPrototype 
 Hide() 
HideFirstLastLabel() 
HideFirstTickLabel() 
HideLabels() 
HideLastTickLabel() 
HideLine() 
HideTicks() 
HideZeroLabel() 
SetColor() 
SetFont() 
SetLabelAlign() 
SetLabelAngle() 
SetLabelFormat() 
SetLabelFormatCallback() 
SetLabelFormatString() 
SetLabelMargin() 
SetLabelSide() 
SetMajTickPositions() 
SetPos() 
SetPosAbsDelta() 
SetTextLabelInterval() 
SetTextTickInterval() 
SetTickLabels() 
SetTickPositions() 
SetTickSide() 
SetTickSize() 
SetTitle() 
SetTitleMargin() 
SetTitleSide() 
SetWeight() 
__construct() 
+
 

Class usage and Overview
The Axis class represents either the X or Y axis in a graph. This class is noramlly accessed through the instance variables graph->xaxis, $graph->yaxis, or $graph->y2axis + +Public properties: + + + + + + + +
Name Type Description
title Text Axis title text
scale LinearScale/LogScale Scale used for axis

  +

See also related classes:
LinearScale, LogScale and Text

 


Class Methods

+

 

AxisPrototype ::
Hide($aHide)
+ +Hide the axis

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +Flag.
+ +

Description:
This method is used to hide the axis. 
+ +

Example:

+$graph->xaxis->Hide(); // Hide xaxis
$graph->yaxis->Hide(); // Hide y-axis
+
+

+

+

 

AxisPrototype ::
HideFirstLastLabel()
+ +Hide the first and last label on the scale.

+
+ +

Description:
Hide the first and last label on the scale. Usefull whe you are using Axis Type of AXSTYLE_BOXIN or AXSTYLE_BOXOUT to avoid the labels to owerwrite a box around the plot. 
+  
See also:
+

Example:

+//...
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
$graph->SetBox();
$graph->xaxis->HideFirstLastLabel();
$graph->yaxis->HideFirstLastLabel();
//...
+
+

+

+

 

AxisPrototype ::
HideFirstTickLabel($aShow)
+ +Hide the first label

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +false + +Flag.
+ +

Description:
Calling this method will hide the first label on the axis. This is usefull when the y axis have negative values and a value on the x-axis would be partially obscured by the values on the y-axis. +This gets automatically called in this case. +

+This is probably of less use for the end user of the library. 
+ +

Example:

+$graph->xaxis->HideFirstTicklabel() + +

+

+

 

AxisPrototype ::
HideLabels($aHide)
+ +Hide all labels on the axis

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +true=Hide all labels
+ +

Description:
Hide all labels on the axis but keep tick marks and axis line. 
+  
See also:
+

Example:

+$graph->xaxis->HideLabels() + +

+

+

 

AxisPrototype ::
HideLastTickLabel($aShow)
+ +Hide the last tick label on the axis.

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +false + +Flag
+ +

Description:
The mirror of HideFirstTickLabel() 
+  
See also:
+

Example:

+$graph->xaxis->HideLastTickLabel(); + +

+

+

 

AxisPrototype ::
HideLine($aHide)
+ +// Hide the actual axis-line, but still print the labels

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide axis line
+ +

Description:
Hide the line of the axis. This only hides the axis-line but will keep the tick marks and labels. If you want to hide the tick marks you should call HideTicks(). To hide the axis completely, line, ticks and labels use Hide(). 
+  
See also:
+

Example:

+// Hide line and tick marks
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
+
+

+

+

 

AxisPrototype ::
HideTicks($aHideMinor, $aHideMajor)
+ +Hide minor or major tick marks.

+ + + + + + +
ArgumentDefaultDescription
+$aHideMinor + + + +true + +True = Hide minor tick marks
+$aHideMajor + + + +true + +True = Hide major tick marks
+ +

Description:
Hide major or minor tick makrs on the axis. 
+ +

Example:

+// Only display major tick marks
$graph->yaxis->HideTicks(true,false); +
+

+

+

 

AxisPrototype ::
HideZeroLabel($aFlag)
+ +Hide zero label

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +Flag.
+ +

Description:
Hide the zero label. Usefull if the axis cross at zero and the label would owerwrite the other axis scale. + 
+  
See also:
+

Example:

+$graph->yaxis->HideZeroLabel();
+
+

+

+

 

AxisPrototype ::
SetColor($aColor, $aLabelColor)
+ +Specify color of Axis and it's labels

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + Color for axis
+$aLabelColor + + + +false + +Color for labels on axis
+ +

Description:
Specifies the color of the axis line as well as the labels on the axis. If the label color is not specified it will be the same as the axis color. 
+ +

Example:

+$graph->xaxis->SetColor('blue');
$graph->yaxis->SetColor('blue','black'); +
+

+

+

 

AxisPrototype ::
SetFont($aFamily, $aStyle, $aSize)
+ +Set the font for labels on the axis

+ + + + + + + + +
ArgumentDefaultDescription
+$aFamily + + + Font family
+$aStyle + + + +FS_NORMAL + +Font style
+$aSize + + + +10 + +Font size
+ +

Description:
Specify font for labels on axis. Please note that if you need labels to be rotated an angle other than 0 or 90 you must use TTF fonts and not the builtin fonts (i.e. FF_FONT1, FF_FONT2, FF_FONT3) + + 
+  
See also:
+

Example:

+$graph->xaxis->SetFont(FF_ARIAL); + +

+

+

 

AxisPrototype ::
SetLabelAlign($aHAlign, $aVAlign, $aParagraphAlign)
+ +Specify horizontal and vertical alignment for labels

+ + + + + + + + +
ArgumentDefaultDescription
+$aHAlign + + + Horizontal alignment
+$aVAlign + + + +'top' + +Vertical alignment
+$aParagraphAlign + + + +'left' + +paragraph align for multi-line texts
+ +

Description:
Specifies the horizontal and vertical alignment for the labels on the axis. The alignment specifies how the labels is adjusted relative to the tickmark. +

+Note that this is handled automatically but on some occasion there is a genuine need to override the automtic values. For example if the graph is rotated it might be necessary to adjust the alignment to get a visual acceptable label alignment. +

+Possible horizontal alignment are: 'left', 'center', 'right'
+Possible vertical alignment are: 'top', 'center', 'bottom'
+

+See horizbarex1.php, horizbarex2.php for real life examples. + 
+ +

Example:

+$graph->xaxis->SetLabelAlign('right','center'); + +

+

+

 

AxisPrototype ::
SetLabelAngle($aAngle)
+ +Specify the angle for the tick labels

+ + + + +
ArgumentDefaultDescription
+$aAngle + + + Angle in degrees
+ +

Description:
Specify the rotation angle for the labels on the axis. +

+Note:
+If you want to use any angles other than 0 and 90 degrees you must make sure that the labels are using TTF fonts. Internal fonts only support vertical and horizontal angles. 
+  

See also:
+

Example:

+$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,11);
$graph->xaxis->SetLabelAngle(45); // 45 degrees angle +
+

+

+

 

AxisPrototype ::
SetLabelFormat($aFormStr)
+ +Specify printf() format string for labels

+ + + + +
ArgumentDefaultDescription
+$aFormStr + + + Format string
+ +

Description:
Specify a printf() format string for the axis labels. if you need more advanced control of the formatting you can install a label format callbacl routine with Axis::SetLabelFormatCallback() 
+  
See also:
+

Example:

+$graph->xaxis->SetLabelFormat('%0.1f%%'); + +

+

+

 

AxisPrototype ::
SetLabelFormatCallback($aFuncName)
+ +Specify callback function for labels on axis

+ + + + +
ArgumentDefaultDescription
+$aFuncName + + + Callback function
+ +

Description:
This can be used when more advance formatting of the axis labels are required. For example this could be used to format numbers with space or commas betwen the '1000. +

+The callback routine is called with one argument, the current number to be displayed and should return the number to be displayed. +

+For simple formatting use SetlabelFormat() to specify a printf() style formatting string. +

+The callback function specified should can either be a +global function or a class method, for example + +

+$SomeClass = new SomeClass(...); 
+... 
+$g->SetXLabelFormatCallback(array($SomeClass,'xLabelCallback'));
+
+

+There is, however, one caution. Any $this data used within LabelFormatCallbackInDerivedClass MUST BE SET BEFORE SetLabelFormatCallback is invoked! it appears that $this is bound/copied when SetLabelFormatCallback is invoked. Only $this data defined at that time is available within the callback function! Likewise, modifications to $this data AFTER SetLabelFormatCallback have no effect since the $this object used by the callback function has already been bound/copied. +

+The same issues obtain when the callback function is in a seperate class! +

+For a full example see barscalecallbackex1.php + 
+  

See also:
+

Example:

+function yLabelFormat($aLabel) {
    
// Format '1000 english style
    
return number_format($aLabel)
    
// Format '1000 french style
    // return number_format($aLabel, 2, ',', ' ');
}

$graph->yaxis->SetLabelFormatCallback('yLabelFormat');

+
+

+

+

 

AxisPrototype ::
SetLabelFormatString($aFormStr, $aDate)
+ +Specify a printf()-style format string for labels.

+ + + + + + +
ArgumentDefaultDescription
+$aFormStr + + + Format string
+$aDate + + + +false + +No description available
+ +

Description:
Synonym for SetLabelFormat(). +Will be deprecated in a future release. Use SetLabelFormat() instead. 
+  
See also:
+

Example:

+$graph->xaxis->SetLabelFormatString('%0.1f%%'); + +

+

+

 

AxisPrototype ::
SetLabelMargin($aMargin)
+ +Specify margin between labels and tick marks

+ + + + +
ArgumentDefaultDescription
+$aMargin + + + Margin in pixels
+ +

Description:
Specify margin between labels and tick marks. 
+ +

Example:

+$graph->xaxis->SetLabelMargin(15);
+
+

+

+

 

AxisPrototype ::
SetLabelSide($aSidePos)
+ +Specify what side of the axis labels should be on.

+ + + + +
ArgumentDefaultDescription
+$aSidePos + + + Which side of the axis the labels should be on
+ +

Description:
Specify which side the labels should go on. For horizontal axis valid arguments are SIDE_UP, SIDE_DOWN and for vertical axis it is SIDE_LEFT, SIDE_RIGHT. +

+See topaxisex1.php for an example when this is usefull. +

+Note: Synonym to SetLabelPos() + 
+  

See also:
+

Example:

+$graph->xaxis->SetLabelSide(SIDE_UP); + +

+

+

 

AxisPrototype ::
SetMajTickPositions($aMajPos, $aLabels)
+ +// Manually specify major tick positions and optional labels

+ + + + + + +
ArgumentDefaultDescription
+$aMajPos + + + No description available
+$aLabels + + + +NULL + +No description available
+ +

Description:
No description available.

+

 

AxisPrototype ::
SetPos($aPosOnOtherScale)
+ +Position for axis line on the "other" scale

+ + + + +
ArgumentDefaultDescription
+$aPosOnOtherScale + + + Position in world-coordinate
+ +

Description:
Specifies the position of the axis on the other axis. This can be specified as either a numeric value (which gives the absolute position on the other scale). OIt can also be specified as a string value as either 'min' or 'max' which sould position the axis either at the beginning or the end of the opposite axis scale. +

+See topaxisex1.php for a real life example. 
+ +

Example:

+$graph->xaxis->SetPos('max'); // Locate x-axis at the top + +

+

+

 

AxisPrototype ::
SetPosAbsDelta($aDelta)
+ +Position the multiple Y-axis

+ + + + +
ArgumentDefaultDescription
+$aDelta + + + Delta in pixels
+ +

Description:
Set the position of the Y-axis to be X-pixels delta to the right of the max X-position (used to position the multiple Y-axis) 
+

+

 

AxisPrototype ::
SetTextLabelInterval($aStep)
+ +Specify interval for for test labels

+ + + + +
ArgumentDefaultDescription
+$aStep + + + Intervall
+ +

Description:
Specify that every $step tick mark should have a label + 
+  
See also:
+

Example:

+// Only draw labels on every 2nd tick mark
$graph->xaxis->SetTextLabelInterval(2); +
+

+

+

 

AxisPrototype ::
SetTextTickInterval($aStep, $aStart)
+ +Specify what ticks should be displayed

+ + + + + + +
ArgumentDefaultDescription
+$aStep + + + Intervall between ticks
+$aStart + + + +0 + +Start tick
+ +

Description:
Specify that every $step of the ticks should be displayed starting at $start. + 
+  
See also:
+

Example:

+$graph->xaxis->SetTextTickInterval(1,2); + +

+

+

 

AxisPrototype ::
SetTickLabels($aLabelArray, $aLabelColorArray)
+ +Specify text labels for the ticks. One label for each data point

+ + + + + + +
ArgumentDefaultDescription
+$aLabelArray + + + Array with labels
+$aLabelColorArray + + + +null + +Individual colors for each label
+ +

Description:
Specify the labels for a text axis. This is used to manually set labels for the x-axis when a text scale has been specified. +

+If fewer labels than data points are specified then the missing labels will be set to the data points ordinal numbers. +

+The color argment is an array that can be used to specify individual colors for each of the labels. If fewer colors than labels are specified then the colors will wrap around. + + 
+  

See also:
+

Example:

+// Set the x-axel to the month of the years using the
// gloablly available $gDateLocale

$a $gDateLocale->GetShortMonth();
$graph->xaxis->SetTickLabels($a);
$graph->xaxis->SetFont(FF_FONT2);
+
+

+

+

 

AxisPrototype ::
SetTickPositions($aMajPos, $aMinPos, $aLabels)
+ +// Manually specify the major and (optional) minor tick position and labels

+ + + + + + + + +
ArgumentDefaultDescription
+$aMajPos + + + No description available
+$aMinPos + + + +NULL + +No description available
+$aLabels + + + +NULL + +No description available
+ +

Description:
No description available.

+

 

AxisPrototype ::
SetTickSide($aDir)
+ +Specify what side of the axis the ticks should be at

+ + + + +
ArgumentDefaultDescription
+$aDir + + + Specify side
+ +

Description:
Specify which side of the axis the tick marks should be on. Valid positions for a horizontal axis are SIDE_TOP, SIDE_BOTTOM and for verticla axis SIDE_LEFT and SIDE_RIGHT. +

+This is a shortform for accessing the tick method directly via the scale in the axis. +

+See topaxisex1.php for real life example. + 
+  

See also:
+

Example:

+$graph->xaxis->SetTickSide(SIDE_TOP); + +

+

+

 

AxisPrototype ::
SetTickSize($aMajSize, $aMinSize)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aMajSize + + + No description available
+$aMinSize + + + +3 + +No description available
+ +

Description:
No description available.

+

 

AxisPrototype ::
SetTitle($aTitle, $aAdjustAlign)
+ +Title for axis

+ + + + + + +
ArgumentDefaultDescription
+$aTitle + + + Title string
+$aAdjustAlign + + + +'high' + +Alignment of title along the axis
+ +

Description:
Set the title for the axis. You can specify the alignment as being either "high", "middle" and "low". To adjust the titles font and color you have to access the label instance variable. For example, $graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD) 
+ +

Example:

+$graph->xaxis->SetTitle('Values for 2002','middle');
+
+

+

+

 

AxisPrototype ::
SetTitleMargin($aMargin)
+ +Specify distance from the axis

+ + + + +
ArgumentDefaultDescription
+$aMargin + + + Margin in pixels
+ +

Description:
Specify the distance between the axis and the title. 
+  
See also:
+

Example:

+$graph->SetTitlemargin(50); + +

+

+

 

AxisPrototype ::
SetTitleSide($aSideOfAxis)
+ +Specify what side of the axis the title should be at

+ + + + +
ArgumentDefaultDescription
+$aSideOfAxis + + + Side
+ +

Description:
For horizontal axis the side can be either SIDE_TOP or SIDE_BOTTOM and for vertical axis the position can be either SIDE_LEF or SIDE_RIGHT. +

+By default x-axis have the title below the axis and y-axis have it on the left and y2 on the right. +

+See topaxisex1.php for real life example 
+  

See also:
+

Example:

+$graph->xaxis->SetTitleSide(SIDE_TOP);
+
+

+

+

 

AxisPrototype ::
SetWeight($aWeight)
+ +Weight of axis

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Weight in pixels
+ +

Description:
Specify the thickness of the axis in pixels 
+ +

Example:

+$graph->SetWeight(3); + +

+

+

 

AxisPrototype ::
__construct($img, $aScale, $color, , )
+ +// should be labeled.

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$img + + + No description available
+$aScale + + + No description available
+$color + + + No description available
+ + + + No description available
+ + + + +array(0,0,0) + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/BarPlot.html b/includes/jpgraph/docs/classref/BarPlot.html new file mode 100644 index 0000000..e62cefe --- /dev/null +++ b/includes/jpgraph/docs/classref/BarPlot.html @@ -0,0 +1,404 @@ +


Class BarPlot Extends Plot
+(Defined in: jpgraph_bar.php : 30)
 
 BarPlot  Plot 
 RotatePattern() 
SetAbsWidth() 
SetAlign() 
SetFillColor() 
SetFillGradient() 
SetNoFill() 
SetPattern() 
SetShadow() 
SetValuePos() 
SetWidth() 
SetYBase() 
SetYMin() 
__construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
Concrete class which implements the standard vertical bar plot functionality.

+To show horizontal plots you can rotate the graph 90 degrees by $graph->Angle(90); +

  +

See also related classes:
AccBarPlot and GroupBarPlot

 


Class Methods

+

 

BarPlot ::
RotatePattern($aPat, $aRotate)
+ +// The method will take the specified pattern anre// return a pattern index that corresponds to the original// patterm being rotated 90 degreees. This is needed when plottin// Horizontal bars

+ + + + + + +
ArgumentDefaultDescription
+$aPat + + + No description available
+$aRotate + + + +true + +No description available
+ +

Description:
No description available.

+

 

BarPlot ::
SetAbsWidth($aWidth)
+ +Specify width in absolute pixels.

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + Width in pixels
+ +

Description:
Specify width in absolute pixels. If specified this overrides any calls to SetWidth() 
+  
See also:
+

Example:

+$barplot->SetAbsWidth(20);
+
+

+

+

 

BarPlot ::
SetAlign($aAlign)
+ +Set the alignment between the major tick marks doe the bars.

+ + + + +
ArgumentDefaultDescription
+$aAlign + + + String to specify alignment
+ +

Description:
Bars can be aligned when using a text scale. Valid arguments for align are 'left', 'center' and 'right'. +

+Default is to center the bars. 
+ +

Example:

+$graph->SetScale("textlin");

// ...

$barplot = new BarPlot($ydata,$xdata);
$barplot->SetAlign("center");

// ...
+
+

+

+

 

BarPlot ::
SetFillColor($aColor)
+ +Specify fill color for bars.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color specification
+ +

Description:
Set fill color for the bars. The color for the frame around the bar is specified with BarPlot::SetColor() method. + +By specifying an array as argument you can assign individual colors to each of the bars. If there are more bars than colors the colros will wrap around. + 
+  
See also:
+

Example:

+// All bars will have the same color
$barplot->SetFillColor('#E234A9');

// The bars will haev individual colors
$barplot->SetFillColor(array('red','blue','green'));
+
+

+

+

 

BarPlot ::
SetFillGradient($aFromColor, $aToColor, $aStyle)
+ +Specify a gradient fill for the bars.

+ + + + + + + + +
ArgumentDefaultDescription
+$aFromColor + + + No description available
+$aToColor + + + +null + +No description available
+$aStyle + + + +null + +No description available
+ +

Description:
Gradient fill provides a smooth transition from the 'start' color to the 'end' color. The type of gradient fill can be + + + +Since gradient fills make use of many colors and bitmapped images which doesn't use truecolor is limited to 256 colors you might find yourself out of colors if using to many different gadient fills in your graph. +

+You should also be observant that gradient fills makes use of more CPU time than solid fills. + 
+  

See also:
+

Example:

+$barplot->SetFillgradient('orange','darkred',GRAD_VER);
+
+

+

+

 

BarPlot ::
SetNoFill()
+ +Dont's paint the interior of the bars with any color.

+
+ +

Description:
Bar plots are filled by default. Calling this method disable the fill of barplots. + +This is usefull when you have a background in the image that you want to be shown underneth the bars. 
+  
See also:
+

Example:

+$barplot->SetNoFill();
+
+

+

+

 

BarPlot ::
SetPattern($aPattern, $aColor)
+ +Add one of the line patterns to the bar

+ + + + + + +
ArgumentDefaultDescription
+$aPattern + + + Pattern
+$aColor + + + +'black' + +Color of pattern
+ +

Description:
Add one of the line patterns as fill effect to the bar. Available patterns are: +
    +
  1. 'PATTERN_DIAG1' +
  2. 'PATTERN_DIAG2' +
  3. 'PATTERN_DIAG3' +
  4. 'PATTERN_DIAG4' +
  5. 'PATTERN_CROSS1' +
  6. 'PATTERN_CROSS2' +
  7. 'PATTERN_CROSS3' +
  8. 'PATTERN_CROSS4' +
  9. 'PATTERN_STRIPE1' +
  10. 'PATTERN_STRIPE2' +

+ +

Example:

+$barplot->SetPattern('PATTERN_CROSS2');
+
+

+

+

 

BarPlot ::
SetShadow($aColor, $aHSize, $aVSize, $aShow)
+ +Set a drop shadow for the bar (or rather an "up-right" shadow)

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aColor + + + +"black" + +No description available
+$aHSize + + + +3 + +No description available
+$aVSize + + + +3 + +No description available
+$aShow + + + +true + +No description available
+ +

Description:
Set a drop shadow for the bar (or rather an "up-right" shadow) 
+ +

Example:

+$barplot->SetShadow();
+
+

+

+

 

BarPlot ::
SetValuePos($aPos)
+ +Specify position for displayed values on bars

+ + + + +
ArgumentDefaultDescription
+$aPos + + + Postision
+ +

Description:
Specify position for the values on the bar. Teh position can either be +
+ +

Example:

+// Put the values in the middle of the bars
$barplot->SetValuePos('center'); +
+

+

+

 

BarPlot ::
SetWidth($aWidth)
+ +Specify width as fractions of the major step size

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + No description available
+ +

Description:
Specify width as fractions of the major step size when the scale used is a text scale (which is the normal scale to use for bars). + +If the X-axis scale is a linear scale (i.e. lin, int or date) then the width must be specified in absolute pixels. 
+  
See also:
+

Example:

+// Specify fractions for a text scale
$barplot->SetWidth(0.4);

// Specify absolute width 25 pixels
$barplot->SetWidth(25); +
+

+

+

 

BarPlot ::
SetYBase($aYStartValue)
+ +Specify the base value for the bars

+ + + + +
ArgumentDefaultDescription
+$aYStartValue + + + Strta Y-value for bars.
+ +

Description:
Specify the start plot for bars, (minimum Y-value). By default the base uses the value 0 as base. 
+ +

Example:

+$barplot->SetYBase(100);
+
+

+

+

 

BarPlot ::
SetYMin($aYStartValue)
+ +DEPRECATED use SetYBase instead

+ + + + +
ArgumentDefaultDescription
+$aYStartValue + + + Y-Value for base of bars
+ +

Description:
DEPRECATED use SetYBase() instead 
+ +

Example:

+DEPRECATED use SetYBase() instead + +

+

+

 

BarPlot ::
__construct($datay, $datax)
+ +Create a new bar plot

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + No description available
+$datax + + + +false + +X-positions
+ +

Description:
Create a new bar plot 
+ +

Example:

+$bar = new BarPlot($ydata);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Bezier.html b/includes/jpgraph/docs/classref/Bezier.html new file mode 100644 index 0000000..5fde48f --- /dev/null +++ b/includes/jpgraph/docs/classref/Bezier.html @@ -0,0 +1,99 @@ +


Class Bezier
+(Defined in: jpgraph_regstat.php : 112)
 
 Bezier 
 Get() 
__construct() 
+
 

Class usage and Overview
Utility class to help construct an interpolated data points given an arbitrary number of data points. +

+This class doesn't draw any graphs by itself it is only used to generate a new set of data points representing the smooth line from the input which are the control lines for a bezier interpolated curve. +

+The principle of using this class is that you first create an instance of this class and giving it the X,Y values for your control points. +

+You can then get back an interpolated smooth dataset by calling the Get() method. This method takeas as argument how many data points you want the interpolated graph to have. +

+In order to use this method the file jpgraph_regstat.php must be included. +

+Technical note: The control points for a bezier curve does not necessary lie on the curve. Using the alternative method of spline interpolation guarantees that the specified control point lie on the generated curve. +

+Technical note 2: An alternmative Bezier curve is also availabe in the Canvas tools (jpgraph_canvtools.php). The difference is that that method will not return any data points it will directly draw an interpolate bezier curve on the canvas. +

  +

See also related classes:
Spline and Shape

 


Class Methods

+

 

Bezier ::
Get($steps)
+ +Return two arrays of X and Y coordinates that represents the curve

+ + + + +
ArgumentDefaultDescription
+$steps + + + Number of data points
+ +

Description:
Return a data set representing the interpolated smooth curve passing through all the specified control points. 
+ +

Example:

+// Control points for bezier curve
$xdata = array(1,3,12,15);
$ydata = array(5,15,2,19);

// Get the interpolated values by creating
// a new Spline object.
$bez = new Bezier($xdata,$ydata);

// For the new data set we want 50 points to
// get a smooth curve.
list($newx,$newy) = $bez->Get(50);
+
+

+

+

 

Bezier ::
__construct($datax, $datay, $attraction_factor, , )
+ +Create a new bezier object

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$datax + + + X-coordinates for control points
+$datay + + + Y-coordinates for control points
+$attraction_factor + + + Attraction factor
+ + + + No description available
+ + + + +1 + +No description available
+ +

Description:
Creates a new Bezier interpoaltion object. The arguments specifies the X, and Y coordinate sof the control points to be used. + +The attraction factor is an integer >1 and determines how much "gracity" each control point should have. A higher value makes the resulting curve bend much more sharper against the control points. The default value is 1. 
+ +

Example:

+// Control points
$xdata = array(1,3,12,15);
$ydata = array(5,15,2,19);

// Get the interpolated values by creating
// a new bezier object.
$bez = new Bezier($xdata,$ydata);

// For the new data set we want 50 points to
// get a smooth curve.
list($newx,$newy) = $bez->Get(50); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/BoxPlot.html b/includes/jpgraph/docs/classref/BoxPlot.html new file mode 100644 index 0000000..3b96f19 --- /dev/null +++ b/includes/jpgraph/docs/classref/BoxPlot.html @@ -0,0 +1,80 @@ +


Class BoxPlot Extends StockPlot
+(Defined in: jpgraph_stock.php : 173)
 
 BoxPlot  StockPlot 
 SetMedianColor() 
__construct() 
+
 HideEndLines() 
SetColor() 
SetWidth() 
__construct() 
+
 

Class usage and Overview
Create a box plot. This is the same as a stock plot but with the added feature of a median line. For each X-value 5 Y values must be specified: +(open,close,min,max,median) +

  +

See also related classes:
StockPlot

 


Class Methods

+

 

BoxPlot ::
SetMedianColor($aPos, $aNeg)
+ +Specify color for median line

+ + + + + + +
ArgumentDefaultDescription
+$aPos + + + Positive color
+$aNeg + + + Negative color
+ +

Description:
Specify color for median line.  
+ +

Example:

+$bplot->SetMedianColor('black','white'); + +

+

+

 

BoxPlot ::
__construct($datay, $datax)
+ +Create a new Box plot

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + Y-tuples
+$datax + + + +false + +If specified, X-positions
+ +

Description:
Create a new Box plot. Each data point in a box plotconsists of 5 values; (open,close,min,max,median) + + 
+  
See also:
+

Example:

+$bplot = new BoxPlot($ydata); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/CanvasGraph.html b/includes/jpgraph/docs/classref/CanvasGraph.html new file mode 100644 index 0000000..f94e03e --- /dev/null +++ b/includes/jpgraph/docs/classref/CanvasGraph.html @@ -0,0 +1,169 @@ +


Class CanvasGraph Extends Graph
+(Defined in: jpgraph_canvas.php : 20)
 
 CanvasGraph  Graph 
 InitFrame() 
Stroke() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview
If you for some reason just want plain canvas to draw on using the direct drawing method you can create a new canvas with this class. +

+The canvas is meant to be manipulated through the Image class which can be found as an instance variable ($graph->img) in the canvas class. +

+Please remeber taht using the drawing methods in the Image class assumes screen (pixels) coordinates. +

  +

See also related classes:
Graph

 


Class Methods

+

 

CanvasGraph ::
InitFrame()
+ +Strokes plot area and margin

+
+ +

Description:
Calling this method will fill the margin (with the margin color) and fill the plot area with the plot color. You should call this method before stroking anything else to the canvas as otherwise what you have stroken will be overwritten. 
+ +

Example:

+// 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();

// 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);

// Stroke the text
$t->Stroke($g->img);

// Stroke the graph
$g->Stroke();
+
+

+

+

 

CanvasGraph ::
Stroke($aStrokeFileName)
+ +Stroke graph to browser or file

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +Filename to stroke to
+ +

Description:
Stroke a file to browser or file. See Graph::Stroke() for more details. 
+  
See also:
+

Example:

+$canvas->Stroke(); + +

+

+

 

CanvasGraph ::
__construct($aWidth, $aHeight, $aCachedName, $timeout, $inline)
+ +Construct a new Cnavas graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aWidth + + + +300 + +Width of graph
+$aHeight + + + +200 + +Height of graph
+$aCachedName + + + +"" + +Cache file name
+$timeout + + + +0 + +Cache timeout
+$inline + + + +1 + +Inline or not
+ +

Description:
See Graph::Graph() for description, this method is identical. 
+  
See also:
+

Example:

+// Create a new canvas and draw a line from top left to
// bottom right
$canvas = new CanvasGraph(300,200);
$canvas->img->SetColor(black*);
$canvas->img->Line(0,0,300,200);
$canvas->Stroke(); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/CanvasRectangleText.html b/includes/jpgraph/docs/classref/CanvasRectangleText.html new file mode 100644 index 0000000..99349fe --- /dev/null +++ b/includes/jpgraph/docs/classref/CanvasRectangleText.html @@ -0,0 +1,471 @@ +


Class CanvasRectangleText
+(Defined in: jpgraph_canvtools.php : 375)
 
 CanvasRectangleText 
 ParagraphAlign() 
Pos() 
Set() 
SetAutoMargin() 
SetColor() 
SetCornerRadius() 
SetFillColor() 
SetFont() 
SetFontColor() 
SetPos() 
SetShadow() 
SetTxt() 
Stroke() 
__construct() 
+
 

Class usage and Overview
YOu can use this class to convieniently draw a text on canvas. The text may have multiple lines wher each line is separated by a "\n" (newline) character. +

+The text may also be enclosed in a rounded (possibly filled) rectangle. +

  +

See also related classes:
CanvasGraph and CanvasScale

 


Class Methods

+

 

CanvasRectangleText ::
ParagraphAlign($aParaAlign)
+ +Specify paragraph alignment for the text

+ + + + +
ArgumentDefaultDescription
+$aParaAlign + + + Alignment
+ +

Description:
Specify paragraph alignment for the text. Alignments can be: + + 
+ +

Example:

+
$g 
= new CanvasGraph(550,450);
$scale = new CanvasScale($g);
$scale->Set(0,27,0,53);
//
$t = new CanvasRectangleText();
$t->SetFillColor('lightgreen');
$t->SetFontColor('navy');
$t->SetFont(FF_ARIAL,FS_NORMAL,16);
$t->ParagraphAlign('center');
$t->Set("First line\nSecond line",0.5,19,26,32);
$t->Stroke($g->img,$scale);
+
+

+

+

 

CanvasRectangleText ::
Pos($xl, $yt, $w, $h)
+ +Specify position for text

+ + + + + + + + + + +
ArgumentDefaultDescription
+$xl + + + +0 + +Top left X
+$yt + + + +0 + +Top left Y
+$w + + + +0 + +Width
+$h + + + +0 + +Height
+ +

Description:
Set position for text. All coordinates will be translaed according to the current scale used. + 
+

+

 

CanvasRectangleText ::
Set($aTxt, $xl, $yt, $w, $h)
+ +Specify the text and position

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aTxt + + + Text
+$xl + + + Top left X
+$yt + + + Top left Y
+$w + + + +0 + +Width
+$h + + + +0 + +Height
+ +

Description:
Specify the text and position. All coordinates will be translated using the specified scale when stroked. 
+ +

Example:

+$t->SetShadow('');
$t->SetFont(FF_ARIAL,FS_BOLD,18);
$t->Set('Family',1,1,8);
$t->Stroke($g->img,$scale); +
+

+

+

 

CanvasRectangleText ::
SetAutoMargin($aMargin)
+ +Specify auto margin when no specific size is specified

+ + + + +
ArgumentDefaultDescription
+$aMargin + + + Margin in pixels
+ +

Description:
Specify auto margin when no specific size is specified. This margin is used to add extra space around the text and the border around the text. 
+

+

 

CanvasRectangleText ::
SetColor($aColor)
+ +Set border color for rectangle

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Border color
+ +

Description:
Set border color for rectangle 
+  
See also:
+

Example:

+$t->SetColor('navy'); + +

+

+

 

CanvasRectangleText ::
SetCornerRadius($aRad)
+ +Set radius for corners

+ + + + +
ArgumentDefaultDescription
+$aRad + + + +5 + +Radius in pixels
+ +

Description:
Specify the radius for the rounded corners. Specifying the value as 0 will give normal square corners. + + 
+ +

Example:

+$t->SetCornerRadius(15); + +

+

+

 

CanvasRectangleText ::
SetFillColor($aFillColor)
+ +Specify fill color for rectangle

+ + + + +
ArgumentDefaultDescription
+$aFillColor + + + Color
+ +

Description:
Specify fill color for rectangle 
+ +

Example:

+$t->SetFillColor('#12A73C');

+
+

+

+

 

CanvasRectangleText ::
SetFont($FontFam, $aFontStyle, $aFontSize)
+ +Specify font

+ + + + + + + + +
ArgumentDefaultDescription
+$FontFam + + + Font family
+$aFontStyle + + + Font style
+$aFontSize + + + +12 + +Font size
+ +

Description:
Specify font 
+ +

Example:

+$t->SetFont(FF_ARIAL,FS_BOLD,24); + +

+

+

 

CanvasRectangleText ::
SetFontColor($aColor)
+ +Specify text (font) color

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color specification
+ +

Description:
Set color for text. Use SetColor() to specify border colro and SetFillColor() to set fill color. 
+  
See also:
+

Example:

+$t->SetFontCOlor('black') + +

+

+

 

CanvasRectangleText ::
SetPos($xl, $yt, $w, $h)
+ +Specify position

+ + + + + + + + + + +
ArgumentDefaultDescription
+$xl + + + +0 + +Top left X
+$yt + + + +0 + +Top left Y
+$w + + + +0 + +Width
+$h + + + +0 + +Height
+ +

Description:
Specify position. All coordinates will be transalted with the specified scale when stroked. 
+

+

 

CanvasRectangleText ::
SetShadow($aColor, $aWidth)
+ +Add a drop shadow

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + +'gray' + +Color of shadow
+$aWidth + + + +3 + +Width of shadow
+ +

Description:
Add a drop shadow to the rounded reactangle surranding the text 
+ +

Example:

+$t->SetShadow();  // Use default values
+
+

+

+

 

CanvasRectangleText ::
SetTxt($aTxt)
+ +Specify text string

+ + + + +
ArgumentDefaultDescription
+$aTxt + + + Textt
+ +

Description:
Set text string to be displayed. The text string may have multiple lines separated by a newline character "\n" 
+ +

Example:

+$t->Set("This is a text!");
+
+

+

+

 

CanvasRectangleText ::
Stroke($aImg, $scale)
+ +Stroke text to canvas

+ + + + + + +
ArgumentDefaultDescription
+$aImg + + + Image context
+$scale + + + Scale
+ +

Description:
Stroke text to canvas 
+  
See also:
+

Example:

+$t->Stroke($graph->img,$scale);
+
+

+

+

 

CanvasRectangleText ::
__construct($aTxt, $xl, $yt, $w, $h)
+ +Draws a text paragraph inside a rounded, possibly filled, rectangle

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aTxt + + + +'' + +Text
+$xl + + + +0 + +Top left X
+$yt + + + +0 + +Top left Y
+$w + + + +0 + +Width
+$h + + + +0 + +Height
+ +

Description:
Draws a text paragraph inside a rounded, possible filled, rectangle. 
+ +

Example:

+
$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);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/CanvasScale.html b/includes/jpgraph/docs/classref/CanvasScale.html new file mode 100644 index 0000000..6b2c7a9 --- /dev/null +++ b/includes/jpgraph/docs/classref/CanvasScale.html @@ -0,0 +1,179 @@ +


Class CanvasScale
+(Defined in: jpgraph_canvtools.php : 24)
 
 CanvasScale 
 Set() 
Translate() 
TranslateX() 
TranslateY() 
__construct() 
+
 

Class usage and Overview
This class defines a scale which is meant to be used with canvas graphs to make it possibles to pecify a more convinient scale compared to absoilute pixels coordinates. +
+This will also let you scale the canvas without any coordinate changes.

  +


Class Methods

+

 

CanvasScale ::
Set($xmin, $xmax, $ymin, $ymax)
+ +Specify scale to use

+ + + + + + + + + + +
ArgumentDefaultDescription
+$xmin + + + +0 + +Min X value
+$xmax + + + +10 + +Max X-value
+$ymin + + + +0 + +Min Y-value
+$ymax + + + +10 + +Max Y-value
+ +

Description:
SPecify min/max values for scale. 
+ +

Example:

+// 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);
+
+

+

+

 

CanvasScale ::
Translate($x, $y)
+ +Translate a point to absolute screen coordinates

+ + + + + + +
ArgumentDefaultDescription
+$x + + + X-value
+$y + + + Y-value
+ +

Description:
Translate a point to absolute screen coordinates 
+  
See also:
+

Example:

+list($xt,$yt) = $scale->Translate($x,$y);
$graph->img->Point($xt,$yt); +
+

+

+

 

CanvasScale ::
TranslateX($x)
+ +Translate X-coordinate

+ + + + +
ArgumentDefaultDescription
+$x + + + X-value
+ +

Description:
Translate X-value into absolute screen coordinates 
+  
See also:

+

 

CanvasScale ::
TranslateY($y)
+ +Translate Y-value to absolute screen coordinates

+ + + + +
ArgumentDefaultDescription
+$y + + + Y-value
+ +

Description:
Translate Y-value to absolute screen coordinates 
+  
See also:

+

 

CanvasScale ::
__construct($graph, $xmin, $xmax, $ymin, $ymax)
+ +Define a scale for canvas graphs

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$graph + + + No description available
+$xmin + + + +0 + +Min X-value for scale
+$xmax + + + +10 + +Max X-value for scale
+$ymin + + + +0 + +Min Y-value for scale
+$ymax + + + +10 + +Max Y-value for scale
+ +

Description:
Define a scale for canvas graphs. Note the scale values is optionally in this call. The may be later set witha call to the Set() method. 
+  
See also:


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ColorFactory.html b/includes/jpgraph/docs/classref/ColorFactory.html new file mode 100644 index 0000000..8dcecc0 --- /dev/null +++ b/includes/jpgraph/docs/classref/ColorFactory.html @@ -0,0 +1,22 @@ +


Class ColorFactory
+(Defined in: jpgraph.php : 5284)
 
 ColorFactory 
 getColor() 
+
 

Class usage and Overview

  +


Class Methods

+

 

ColorFactory ::
getColor()
+ +// Provide a deterministic list of new colors whenever the getColor() method// is called. Used to automatically set colors of plots.

+
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Contour.html b/includes/jpgraph/docs/classref/Contour.html new file mode 100644 index 0000000..632c4a2 --- /dev/null +++ b/includes/jpgraph/docs/classref/Contour.html @@ -0,0 +1,230 @@ +


Class Contour
+(Defined in: jpgraph_contour.php : 22)
 
 Contour 
 adjustDataPointValues() 
CalculateColors() 
determineIsobarEdgeCrossings() 
getCrossingCoord() 
getIsobars() 
getMinMaxVal() 
isobarHCrossing() 
isobarVCrossing() 
resetEdgeMatrices() 
SetInvert() 
UseHighContrastColor() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

Contour ::
adjustDataPointValues()
+ +// In order to avoid numerical problem when two vertices are very close// we have to check and avoid dividing by close to zero denumerator.

+
+ +

Description:
No description available.

+

 

Contour ::
CalculateColors()
+ +

+
+ +

Description:
No description available.

+

 

Contour ::
determineIsobarEdgeCrossings($aIsobar)
+ +//'isobarVCrossing: Col index too large

+ + + + +
ArgumentDefaultDescription
+$aIsobar + + + No description available
+ +

Description:
No description available.

+

 

Contour ::
getCrossingCoord($aRow, $aCol, $aEdgeDir, $aIsobarVal)
+ +// We now have the bottom and rightmost edges unsearched

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + No description available
+$aCol + + + No description available
+$aEdgeDir + + + No description available
+$aIsobarVal + + + No description available
+ +

Description:
No description available.

+

 

Contour ::
getIsobars()
+ +// Use only blue/red scale

+
+ +

Description:
No description available.

+

 

Contour ::
getMinMaxVal()
+ +

+
+ +

Description:
No description available.

+

 

Contour ::
isobarHCrossing($aRow, $aCol, $aIsobar)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + No description available
+$aCol + + + No description available
+$aIsobar + + + No description available
+ +

Description:
No description available.

+

 

Contour ::
isobarVCrossing($aRow, $aCol, $aIsobar)
+ +//'ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)'

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + No description available
+$aCol + + + No description available
+$aIsobar + + + No description available
+ +

Description:
No description available.

+

 

Contour ::
resetEdgeMatrices()
+ +

+
+ +

Description:
No description available.

+

 

Contour ::
SetInvert($aFlg)
+ +//'Number of colors must equal the number of isobar lines specified';

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

Contour ::
UseHighContrastColor($aFlg, $aBW)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+$aBW + + + +false + +No description available
+ +

Description:
No description available.

+

 

Contour ::
__construct($aMatrix, $aIsobars, $aColors)
+ +// File: JPGRAPH_CONTOUR.PHP// Description: Contour plot// Created: 2009-03-08// Ver: $Id: jpgraph_contour.php 1576 2009-07-13 10:35:22Z ljp $//// Copyright (c) Aditus Consulting. All rights reserved.//==================================

+ + + + + + + + +
ArgumentDefaultDescription
+$aMatrix + + + No description available
+$aIsobars + + + +10 + +No description available
+$aColors + + + +null + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ContourPlot.html b/includes/jpgraph/docs/classref/ContourPlot.html new file mode 100644 index 0000000..d2ff189 --- /dev/null +++ b/includes/jpgraph/docs/classref/ContourPlot.html @@ -0,0 +1,240 @@ +


Class ContourPlot Extends Plot
+(Defined in: jpgraph_contour.php : 387)
 
 ContourPlot  Plot 
 Invertlegend() 
Legend() 
Max() 
Min() 
PreScaleSetup() 
SetInvert() 
SetIsobarColors() 
ShowLegend() 
Stroke() 
UseHighContrastColor() 
__construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview

  +


Class Methods

+

 

ContourPlot ::
Invertlegend($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
Legend($aGraph)
+ +

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
Max()
+ +

+
+ +

Description:
No description available.

+

 

ContourPlot ::
Min()
+ +

+
+ +

Description:
No description available.

+

 

ContourPlot ::
PreScaleSetup($aGraph)
+ +

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
SetInvert($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
SetIsobarColors($aColorArray)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColorArray + + + No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
ShowLegend($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
Stroke($img, $xscale, $yscale)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$img + + + No description available
+$xscale + + + No description available
+$yscale + + + No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
UseHighContrastColor($aFlg, $aBW)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+$aBW + + + +false + +No description available
+ +

Description:
No description available.

+

 

ContourPlot ::
__construct($aDataMatrix, $aIsobar, $aFactor, $aInvert, $aIsobarColors)
+ +// No manually specified colors. Calculate them automatically.

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aDataMatrix + + + No description available
+$aIsobar + + + +10 + +No description available
+$aFactor + + + +1 + +No description available
+$aInvert + + + +false + +No description available
+$aIsobarColors + + + +array() + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/DateLocale.html b/includes/jpgraph/docs/classref/DateLocale.html new file mode 100644 index 0000000..699ce96 --- /dev/null +++ b/includes/jpgraph/docs/classref/DateLocale.html @@ -0,0 +1,543 @@ +


Class DateLocale
+(Defined in: jpgraph.php : 349)
 
 DateLocale 
 GetDayAbb() 
GetLongMonthName() 
GetMonth() 
GetShortDay() 
GetShortMonth() 
GetShortMonthName() 
Set() 
__construct() 
+
 

Class usage and Overview
This class is mainly used (so far) by the Gantt graphs to get localized names of weekdays and months. There is nothing that prevents you from using this to get hold of localized names in your script. +

+To help with this JpGraph instantiates the global variable $gDateLocale which can be used to access the methods. +

+A quick example could be to for example get hold of the shortform of the names of the month to use as labels. By default this is set to the dafult locale for the installation. +

+// Get localized array of short form of month names +$months = $gDateLocale->GetShortMonth();

  +


Class Methods

+

 

DateLocale ::
GetDayAbb()
+ +Return array with day abbreviation in the current locale.

+
+ +

Description:
Returns an array with the abbrevation for weekdays using the current locale. 
+  
See also:
+

Example:

+$weekdays $gDateLocale->GetDayAbb(); + +

+

+

 

DateLocale ::
GetLongMonthName($aNbr)
+ +Get long month name for the specified month

+ + + + +
ArgumentDefaultDescription
+$aNbr + + + Number of month [0-11]
+ +

Description:
Get the full month name as specified by integer 0-11 
+  
See also:
+

Example:

+$jan $gDateLocale->GetLongMonthName(0);
+
+

+

+

 

DateLocale ::
GetMonth()
+ +Get array of all month names

+
+ +

Description:
Return an array with all months of the year in their long form. 
+  
See also:
+

Example:

+$allmonths $gDateLocale->GetMonth();
$graph->xaxis->SetTickLabels($allmonths); +
+

+

+

 

DateLocale ::
GetShortDay()
+ +Return an array with all weekdays in the short form.

+
+ +

Description:
Return an array with all weekdays in the short form according to the specified locale. + +For english locale this would return +array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); 
+ +

Example:

+$alldays $gDateLocale->GetShortDay(); + +

+

+

 

DateLocale ::
GetShortMonth()
+ +Short month description

+
+ +

Description:
Return an array of the short names for all months 
+ +

Example:

+$allmonths $gDateLocale->GetShortMonth(); + +

+

+

 

DateLocale ::
GetShortMonthName($aNbr)
+ +Return the short month name for the specified month.

+ + + + +
ArgumentDefaultDescription
+$aNbr + + + Number of month [0-11]
+ +

Description:
Return the short month name for the specified month. 
+  
See also:
+

Example:

+$april $gDateLocale->GetShortMonthName(3); + +

+

+

 

DateLocale ::
Set($aLocale)
+ +Set locale

+ + + + +
ArgumentDefaultDescription
+$aLocale + + + Locale
+ +

Description:
See PHP manual for more details. The argument should be a valid locale setting. For example 'EN_US' or 'EN_UK' + +The following table lists some commonly used locales. The exact locales available depends on the system + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
af_ZAar_AEar_AE.utf8
ar_BHar_BHar_BH.utf8ar_DZar_DZ.utf8
ar_EGar_EGar_EG.utf8ar_INar_IQ
ar_IQ.utf8ar_IQ.utf8ar_JOar_JO.utf8ar_KW
ar_KW.utf8ar_KW.utf8ar_LBar_LB.utf8ar_LY
ar_LY.utf8ar_LY.utf8ar_MAar_MA.utf8ar_OM
ar_OM.utf8ar_OM.utf8ar_QAar_QA.utf8ar_SA
ar_SA.utf8ar_SA.utf8ar_SDar_SD.utf8ar_SY
ar_SY.utf8ar_SY.utf8ar_TNar_TN.utf8ar_YE
ar_YE.utf8ar_YE.utf8be_BYbe_BY.utf8bg_BG
bg_BG.utf8bg_BG.utf8bokmalbokm?lbr_FR
bs_BAbs_BAca_ESca_ES.utf8ca_ES@euro
catalancatalancroatiancs_CZcs_CZ.utf8
cy_GBcy_GBczechda_DKda_DK.utf8
danishdanishdanskde_ATde_AT.utf8
de_AT@eurode_AT@eurode_BEde_BE@eurode_CH
de_CH.utf8de_CH.utf8de_DEde_DE.utf8de_DE@euro
de_LUde_LUde_LU.utf8de_LU@eurodeutsch
dutchdutcheestiel_GRel_GR.utf8
en_AUen_AUen_AU.utf8en_BEen_BE.utf8
en_BE@euroen_BE@euroen_BWen_CAen_CA.utf8
en_DKen_DKen_GBen_GB.utf8en_HK
en_IEen_IEen_IE.utf8en_IE@euroen_IN
en_NZen_NZen_NZ.utf8en_PHen_SG
en_USen_USen_US.utf8en_ZAen_ZA.utf8
en_ZWen_ZWes_ARes_AR.utf8es_BO
es_BO.utf8es_BO.utf8es_CLes_CL.utf8es_CO
es_CO.utf8es_CO.utf8es_CRes_CR.utf8es_DO
es_DO.utf8es_DO.utf8es_ECes_EC.utf8es_ES
es_ES.utf8es_ES.utf8es_ES@euroes_GTes_GT.utf8
es_HNes_HNes_HN.utf8es_MXes_MX.utf8
es_NIes_NIes_NI.utf8es_PAes_PA.utf8
es_PEes_PEes_PE.utf8es_PRes_PR.utf8
es_PYes_PYes_PY.utf8es_SVes_SV.utf8
es_USes_USes_UYes_UY.utf8es_VE
es_VE.utf8es_VE.utf8estonianet_EEet_EE.utf8
eu_ESeu_ESeu_ES@eurofa_IR.utf8fi_FI
fi_FI.utf8fi_FI.utf8fi_FI@eurofinnishfo_FO
fo_FO.utf8fo_FO.utf8fr_BEfr_BE.utf8fr_BE@euro
fr_CAfr_CAfr_CA.utf8fr_CHfr_CH.utf8
fr_FRfr_FRfr_FR.utf8fr_FR@eurofr_LU
fr_LU.utf8fr_LU.utf8fr_LU@eurofran?aisfrench
ga_IEga_IEga_IE.utf8ga_IE@eurogalego
galiciangaliciangermangl_ESgl_ES.utf8
gl_ES@eurogl_ES@eurogreekgv_GBhe_IL
he_IL.utf8he_IL.utf8hebrewhi_IN.utf8hr_HR
hr_HR.utf8hr_HR.utf8hrvatskihu_HUhu_HU.utf8
hungarianhungarianicelandicid_IDid_ID.utf8
is_ISis_ISis_IS.utf8it_CHit_CH.utf8
it_ITit_ITit_IT.utf8it_IT@euroitalian
iw_ILiw_ILja_JPja_JP.eucjpja_JP.sjis
ja_JP.ujisja_JP.ujisja_JP.utf8japanesejapanese.euc
japanese.sjisjapanese.sjiska_GEkl_GLkl_GL.utf8
ko_KRko_KRko_KR.euckrko_KR.utf8korean
korean.euckorean.euckw_GBlithuanianlt_LT
lt_LT.utf8lt_LT.utf8lv_LVlv_LV.utf8mi_NZ
mk_MKmk_MKmk_MK.utf8mr_IN.utf8ms_MY
mt_MTmt_MTnb_NOnb_NO.ISO-8859-1nl_BE
nl_BE.utf8nl_BE.utf8nl_BE@euronl_NLnl_NL.utf8
nl_NL@euronl_NL@euronn_NOno_NOno_NO.utf8
norwegiannorwegiannynorskoc_FRpl_PL
pl_PL.utf8pl_PL.utf8polishportuguesept_BR
pt_BR.utf8pt_BR.utf8pt_PTpt_PT.utf8pt_PT@euro
ro_ROro_ROro_RO.utf8romanianru_RU
ru_RU.koi8rru_RU.koi8rru_RU.utf8ru_UArussian
sh_YUsh_YUsh_YU.utf8sk_SKsk_SK.utf8
sl_SIsl_SIsl_SI.utf8slovakslovene
slovenianslovenianspanishsq_ALsq_AL.utf8
sr_YUsr_YUsr_YU.utf8sr_YU@cyrillicsv_FI
sv_FI.utf8sv_FI.utf8sv_FI@eurosv_SEsv_SE.utf8
swedishswedishta_INte_INtg_TJ
th_THth_THth_TH.utf8thaitl_PH
tr_TRtr_TRtr_TR.utf8turkishuk_UA
uk_UA.utf8uk_UA.utf8ur_PKuz_UZvi_VN
vi_VN.utf8vi_VN.utf8yi_USzh_CNzh_CN.gb18030
zh_CN.gbkzh_CN.gbkzh_CN.utf8zh_HKzh_HK.utf8
zh_TWzh_TWzh_TW.euctwzh_TW.utf8
 
+ +

Example:

+$gDateLocale->Set('sv_SE'); // Set Swedish locale + +

+

+

 

DateLocale ::
__construct()
+ +Constructor

+
+ +

Description:
Construct a new DateLocale. 
+ +

Example:

+$dateLocale = new DateLocale();
// Use Swedish locale
$dateLocale->Set('sv_SE'); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/DateScale.html b/includes/jpgraph/docs/classref/DateScale.html new file mode 100644 index 0000000..3be7bf1 --- /dev/null +++ b/includes/jpgraph/docs/classref/DateScale.html @@ -0,0 +1,166 @@ +


Class DateScale Extends LinearScale
+(Defined in: jpgraph_date.php : 49)
 
 DateScale  LinearScale 
 AdjustForDST() 
SetDateAlign() 
SetDateFormat() 
SetTimeAlign() 
+
 SetAutoMax() 
SetAutoMin() 
SetAutoTicks() 
SetGrace() 
+
 

Class usage and Overview
Module used to create a date/time X-axis scale

  +


Class Methods

+

 

DateScale ::
AdjustForDST($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

DateScale ::
SetDateAlign($aStartAlign, $aEndAlign)
+ +Specify start and end date alignment for the scale

+ + + + + + +
ArgumentDefaultDescription
+$aStartAlign + + + Start alignment
+$aEndAlign + + + +false + +End alignment
+ +

Description:
Specify start and end date alignment for the scale +Possible values are +
    +
  1. Alignment on a day basis +
      +
    • DAYADJ_1, Align on the start of a day +
    • DAYADJ_7, Align on the start of a week +
    • DAYADJ_WEEK, Synonym to DAYADJ_7 +
    + +
  2. Alignment on a monthly basis +
      +
    • MONTHADJ_1, Align on a month start +
    • MONTHADJ_6, Align on the start of halfyear +
    + +
  3. Alignment on a yearly basis +
      +
    • YEARADJ_1, Align on a year +
    • YEARADJ_2, Align on a bi-yearly basis +
    • YEARADJ_5, Align on a 5 year basis +
    +

+  
See also:
+

Example:

+$graph->xaxis->scale->SetDateAlign(DAYADJ_1); + +

+

+

 

DateScale ::
SetDateFormat($aFormat)
+ +// Overrides the automatic determined date format. Must be a valid date() format string

+ + + + +
ArgumentDefaultDescription
+$aFormat + + + No description available
+ +

Description:
No description available.

+

 

DateScale ::
SetTimeAlign($aStartAlign, $aEndAlign)
+ +Specify start and end date alignment for the scale

+ + + + + + +
ArgumentDefaultDescription
+$aStartAlign + + + Start time alignment
+$aEndAlign + + + +false + +End time alignment
+ +

Description:
Specify the start and end alignment with the time granularity. For date granularity see SetDateAlign(). Note that only one of SetDateAlign() and SetTimeAlign() can be used. + +For start and end alignment the following values are valid + +
    +
  1. Alignment on seconds +
      +
    • MINADJ_1, Align on a single second (This is the lowest resolution) +
    • MINADJ_5, Align on the nearest 5 seconds +
    • MINADJ_10, Align on the nearest 10 seconds +
    • MINADJ_15, Align on the nearest 15 seconds +
    • MINADJ_30, Align on the nearest 30 seconds +
    +
  2. Alignment on minutes +
      +
    • MINADJ_1, Align to the nearest minute +
    • MINADJ_5, Align on the nearest 5 minutes +
    • MINADJ_10, Align on the nearest 10 minutes +
    • MINADJ_15, Align on the nearest 15 minutes +
    • MINADJ_30, Align on the nearest 30 minutes +
    +
  3. Alignment on hours +
      +
    • HOURADJ_1, Align to the nearest hour +
    • HOURADJ_2, Align to the nearest two hour +
    • HOURADJ_3, Align to the nearest three hour +
    • HOURADJ_4, Align to the nearest four hour +
    • HOURADJ_6, Align to the nearest six hour +
    • HOURADJ_12, Align to the nearest tolw hour +
    +

+  
See also:
+

Example:

+$graph->xaxis->scale->SetTimeAlign(MINADJ_15); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/DateScaleUtils.html b/includes/jpgraph/docs/classref/DateScaleUtils.html new file mode 100644 index 0000000..723c29d --- /dev/null +++ b/includes/jpgraph/docs/classref/DateScaleUtils.html @@ -0,0 +1,252 @@ +


Class DateScaleUtils
+(Defined in: jpgraph_utils.inc.php : 69)
 
 DateScaleUtils 
 doDaily() 
doMonthly() 
doWeekly() 
doYearly() 
GetAutoTicks() 
GetTicks() 
GetTicksFromMinMax() 
UseWeekFormat() 
+
 

Class usage and Overview

  +


Class Methods

+

 

DateScaleUtils ::
doDaily($aType, $aMinor)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+$aMinor + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
doMonthly($aType, $aMinor)
+ +// The assumption is that the weeks start on Monday. If the first day// is later in the week then the first week tick has to be on the following// week.

+ + + + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+$aMinor + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
doWeekly($aType, $aMinor)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+$aMinor + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
doYearly($aType, $aMinor)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+$aMinor + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
GetAutoTicks($aMin, $aMax, $aMaxTicks, $aMinor)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aMin + + + No description available
+$aMax + + + No description available
+$aMaxTicks + + + +10 + +No description available
+$aMinor + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
GetTicks($aData, $aType, $aMinor, $aEndPoints)
+ +// For the case where all dates are within the same month// we want to make sure we have at least two ticks on the scale// since the scale want work properly otherwise

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aData + + + No description available
+$aType + + + +1 + +No description available
+$aMinor + + + +false + +No description available
+$aEndPoints + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor, $aEndPoints)
+ +// Decision table for suitable scales// First value: Main decision point// Second value: Array of formatting depending on divisor for wanted max number of ticks. ,..

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aMin + + + No description available
+$aMax + + + No description available
+$aType + + + No description available
+$aMinor + + + +false + +No description available
+$aEndPoints + + + +false + +No description available
+ +

Description:
No description available.

+

 

DateScaleUtils ::
UseWeekFormat($aFlg)
+ +//=============================================================================// CLASS DateScaleUtils// Description: Help to create a manual date scale//=============================================================================

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/DigitalLED74.html b/includes/jpgraph/docs/classref/DigitalLED74.html new file mode 100644 index 0000000..878bdbf --- /dev/null +++ b/includes/jpgraph/docs/classref/DigitalLED74.html @@ -0,0 +1,142 @@ +


Class DigitalLED74
+(Defined in: jpgraph_led.php : 37)
 
 DigitalLED74 
 SetSupersampling() 
Stroke() 
StrokeNumber() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

DigitalLED74 ::
SetSupersampling($aSuperSampling)
+ +Set level of supersampling used in the creation led digits

+ + + + +
ArgumentDefaultDescription
+$aSuperSampling + + + +2 + +Level of supersampling
+ +

Description:
Specifies the amount of oversampling that sould be used to create a smoother looking image. A higher value will generate a smoother image. + +The value used for supersampling should be an integer in the range 2-4. A higher value could be used but the increase in CPU time will not generate any perceivable improvements in image quality. + +For each integer step increased supersampling the processor time needed is multipled by 2 
+ +

Example:

+$led = new DigitalLED74(5);
$led->SetSupersampling(4);
$led->StrokeNumber('ABC123.',LEDC_RED);  +
+

+

+

 

DigitalLED74 ::
Stroke($aValStr, $aColor, $aFileName)
+ +// Margin in between "Led" dots

+ + + + + + + + +
ArgumentDefaultDescription
+$aValStr + + + No description available
+$aColor + + + +0 + +No description available
+$aFileName + + + +'' + +No description available
+ +

Description:
No description available.

+

 

DigitalLED74 ::
StrokeNumber($aValStr, $aColor, $aFileName)
+ +// Margin in between "Led" dots

+ + + + + + + + +
ArgumentDefaultDescription
+$aValStr + + + No description available
+$aColor + + + +0 + +No description available
+$aFileName + + + +'' + +No description available
+ +

Description:
No description available.

+

 

DigitalLED74 ::
__construct($aRadius, $aMargin)
+ +Constructor for 4x7 module LED digits

+ + + + + + +
ArgumentDefaultDescription
+$aRadius + + + +2 + +Radius in pixel for each "led"
+$aMargin + + + +0.6 + +Margin around the "led"
+ +

Description:
Instantiate a LED digit class that is used to genereta text which looks like LED digits 
+  
See also:
+

Example:

+$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GREEN); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/DisplayValue.html b/includes/jpgraph/docs/classref/DisplayValue.html new file mode 100644 index 0000000..267d32c --- /dev/null +++ b/includes/jpgraph/docs/classref/DisplayValue.html @@ -0,0 +1,290 @@ +


Class DisplayValue
+(Defined in: jpgraph.php : 4959)
 
 DisplayValue 
 ApplyFont() 
HideZero() 
SetAlign() 
SetAngle() 
SetColor() 
SetFont() 
SetFormat() 
SetFormatCallback() 
SetMargin() 
Show() 
__construct() 
+
 

Class usage and Overview
Property class which is used to represent the display value for graphs. For line and bar graphs they represent the propertied of the value that can be displayed at each data point. For bars it represents the value of each bar that can be displayed at top of the bars. +

+This class should never be used directly instead this is an internal class which is accessed through it's instance variable, for example, +

+ +$lineplot = new LinePlot($datay); +// Access the instance of DisplayValue +$lineplot->value->Show();

  +

See also related classes:
LinePlot and BarPlot

 


Class Methods

+

 

DisplayValue ::
ApplyFont($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

DisplayValue ::
HideZero($aFlag)
+ +Hide zero values

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=Hide zero values
+ +

Description:
Hide labels that have zero value 
+  
See also:
+

Example:

+$pieplot->value->HideZero(); + +

+

+

 

DisplayValue ::
SetAlign($aHAlign, $aVAlign)
+ +Specify horizontal and vertical alignment

+ + + + + + +
ArgumentDefaultDescription
+$aHAlign + + + Horizontal alignment
+$aVAlign + + + +'' + +Vertical alignment
+ +

Description:
Specify the alignment of the display value in relation to the data point. Possible values are 'left', 'right', 'center' 
+ +

Example:

+$lineplot->value->SetAlign('center');
$lineplot->value->Show();
+
+

+

+

 

DisplayValue ::
SetAngle($aAngle)
+ +Rotate the value a specified angle

+ + + + +
ArgumentDefaultDescription
+$aAngle + + + Angle in degrees
+ +

Description:
Roates the text label a number of degrees. 0 degrees is horizontal. +

+Please rememberthat you must use TTF fonts if you need any angle other than 0 or 90 degrees (horizontal or vertical) 
+  

See also:
+

Example:

+$bplot = new barPlot($datay);

// Setup the values that are displayed on top of each bar
$bplot->value->Show();

// Must use TTF fonts if we want text at an arbitrary angle
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
$bplot->value->SetAngle(45);

// Black color for positive values and darkred for negative values
$bplot->value->SetColor("black","darkred");
+
+

+

+

 

DisplayValue ::
SetColor($aColor, $aNegcolor)
+ +Specify color for values

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + Color for positive values
+$aNegcolor + + + +'' + +Color for negative values
+ +

Description:
Specify the value for the labels. You can have one color for positive and one color for negative values. If no negative color value is specified it will be the same as the positive color. 
+ +

Example:

+// Black color for positive values and darkred for negative values
$bplot->value->SetColor("black","darkred");
+
+

+

+

 

DisplayValue ::
SetFont($aFontFamily, $aFontStyle, $aFontSize)
+ +Specify font for values

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + Font family
+$aFontStyle + + + +FS_NORMAL + +Font style
+$aFontSize + + + +10 + +Font size
+ +

Description:
Specify font for display value 
+  
See also:
+

Example:

+// Must use TTF fonts if we want text at an arbitrary angle
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
+
+

+

+

 

DisplayValue ::
SetFormat($aFormat, $aNegFormat)
+ +Specify printf() format string.

+ + + + + + +
ArgumentDefaultDescription
+$aFormat + + + Format for positive values
+$aNegFormat + + + +'' + +Format for negative values
+ +

Description:
Specify the format string for positive and negative values. The format string follows the same riules as the standard printf() format. +

+Please remember that if you want to format a number with a '%' sign you must use double '%%' as escape format, e.g. '%01.2.f%%' will format a number with two decimal places and a following '%' sign. + + 
+ +

Example:

+// Format label as floating point with 2 decimal points and
// a dollar sign in front, e.g. '$237.56'
$bplot->SetFormt('$%01.2f');
+
+

+

+

 

DisplayValue ::
SetFormatCallback($aFunc)
+ +Specify format callback function

+ + + + +
ArgumentDefaultDescription
+$aFunc + + + Name of callback function
+ +

Description:
Specify a function that get's called to format any value. 
+  
See also:
+

Example:

+function barValueFormat($aLabel) {
    
// Format '1000 english style
    
return number_format($aLabel)
    
// Format '1000 french style
    // return number_format($aLabel, 2, ',', ' ');
}

$barplot->value->SetFormatCallback('barValueFormat');
+
+

+

+

 

DisplayValue ::
SetMargin($aMargin)
+ +Set nargin between value and anchor point in plot

+ + + + +
ArgumentDefaultDescription
+$aMargin + + + Margin in pixels
+ +

Description:
Specify the margin between the data point and the label. 
+ +

Example:

+$bplot->value->SetMargin(50); + +

+

+

 

DisplayValue ::
Show($aFlag)
+ +Show value

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=show value
+ +

Description:
Enable display of the label. If you want to display a value you must enable it since it is turned off by default. 
+ +

Example:

+// Enable display of each slice value
$pieplot->value->Show();
+
+

+

+

 

DisplayValue ::
__construct()
+ +//===================================================// CLASS DisplayValue// Description: Used to print data values at data points//===================================================

+
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ErrMsgText.html b/includes/jpgraph/docs/classref/ErrMsgText.html new file mode 100644 index 0000000..0770e38 --- /dev/null +++ b/includes/jpgraph/docs/classref/ErrMsgText.html @@ -0,0 +1,22 @@ +


Class ErrMsgText
+(Defined in: jpgraph_errhandler.inc.php : 24)
 
 ErrMsgText 
 __construct() 
+
 

Class usage and Overview
Internal helper class to work extract localized error messages.

  +


Class Methods

+

 

ErrMsgText ::
__construct()
+ +//=======================================================================// File: JPGRAPH_ERRHANDLER.PHP// Description: Error handler class together with handling of localized// error messages. All localized error messages are stored//

+
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ErrorLinePlot.html b/includes/jpgraph/docs/classref/ErrorLinePlot.html new file mode 100644 index 0000000..7aa74a9 --- /dev/null +++ b/includes/jpgraph/docs/classref/ErrorLinePlot.html @@ -0,0 +1,49 @@ +


Class ErrorLinePlot Extends ErrorPlot
+(Defined in: jpgraph_error.php : 87)
 
 ErrorLinePlot  ErrorPlot 
 __construct() 
+
 __construct() 
+
 

Class usage and Overview
The error line plot is much the same as the error plot with the addition of a line between the average value of each error plot pair. The properties of the line may be accessed through the ?line? property of the ErrLinePlot, so for example to draw a red line you issue the statement + +$errlineplot->line->SetColor(?red?);

  +

See also related classes:
LinePlot and ErrorPlot

 


Class Methods

+

 

ErrorLinePlot ::
__construct($datay, $datax)
+ +//---------------// CONSTRUCTOR +

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + No description available
+$datax + + + +false + +X-data value
+ +

Description:
In the same way as for Error plots each data value is represnted by two y-values, a minimum and maximum value for each point. 
+  
See also:
+

Example:

+$errlineplot = new ErrorLinePlot($ydata); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ErrorPlot.html b/includes/jpgraph/docs/classref/ErrorPlot.html new file mode 100644 index 0000000..abc3e66 --- /dev/null +++ b/includes/jpgraph/docs/classref/ErrorPlot.html @@ -0,0 +1,55 @@ +


Class ErrorPlot Extends Plot
+(Defined in: jpgraph_error.php : 17)
 
 ErrorPlot  Plot 
 __construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
Concrete class which implements error plots. Error plots takes two y-values for each X-value, min and max. It then marks each pair of min/max values with a vertical bar.

  +


Class Methods

+

 

ErrorPlot ::
__construct($datay, $datax)
+ +//---------------// CONSTRUCTOR +

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + No description available
+$datax + + + +false + +X-data
+ +

Description:
Create a new error plot. Each data value is specified by two y-values, a minimum and maximum value. +

+The X-vector is optional. 
+ +

Example:

+$errplot = new ErrorPlot($ydata);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/FieldArrow.html b/includes/jpgraph/docs/classref/FieldArrow.html new file mode 100644 index 0000000..0aaab22 --- /dev/null +++ b/includes/jpgraph/docs/classref/FieldArrow.html @@ -0,0 +1,68 @@ +


Class FieldArrow
+(Defined in: jpgraph_scatter.php : 17)
 
 FieldArrow 
 SetColor() 
SetSize() 
+
 

Class usage and Overview
Internal helper class which represents the arrow head of the arrow in the field plot. +

+Only accessed as FieldPlot::arrow

  +

See also related classes:
FieldPlot

 


Class Methods

+

 

FieldArrow ::
SetColor($aColor)
+ +Specify color for arrow head

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color specification
+ +

Description:
Set color for arrow head 
+ +

Example:

+$fieldplot->arrow->SetColor('red'); + +

+

+

 

FieldArrow ::
SetSize($aSize, $aArrowSize)
+ +Specify arrow and arrow head size

+ + + + + + +
ArgumentDefaultDescription
+$aSize + + + Arrow size in pixels
+$aArrowSize + + + +2 + +Arrow head size (and shape) as integer in range (0-9)
+ +

Description:
Arrow size is specified in pixels (length of arrow including arrow head). The size of the arrow head is specified as an integer in the range (0,9) inclusive. 
+ +

Example:

+// 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');
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/FieldPlot.html b/includes/jpgraph/docs/classref/FieldPlot.html new file mode 100644 index 0000000..55efbec --- /dev/null +++ b/includes/jpgraph/docs/classref/FieldPlot.html @@ -0,0 +1,88 @@ +


Class FieldPlot Extends Plot
+(Defined in: jpgraph_scatter.php : 65)
 
 FieldPlot  Plot 
 SetCallback() 
__construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
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.

  +

See also related classes:
FieldArrow

 


Class Methods

+

 

FieldPlot ::
SetCallback($aFunc)
+ +Specify callback for each arrow in the field plot

+ + + + +
ArgumentDefaultDescription
+$aFunc + + + Function name
+ +

Description:
Specify a callback that gets clled for each arrow in the field plot +The callback should return an array with the elements +
    +
  1. Color +
  2. Size of arrow (in pixels) +
  3. Arrow head size (as integer between0 and 9) +

+ +

Example:

+// Gradient. Make the arrows red at the pole and colder (blue)
// teh further we get from the pole
function FldCallback($x,$y,$a) {
    
$polex=4;
    
$poley=40;
    
$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 $f=1;
    
$red floor((1-$f)*255);
    
$blue floor($f*255);
    
$color = array($red,0,$blue);
    return array(
$color,$size,$arrowsize);
}

// Setup the field plot
$fp = new FieldPlot($datay,$datax,$angle);

// Setup formatting callback
$fp->SetCallback('FldCallback'); +
+

+

+

 

FieldPlot ::
__construct($datay, $datax, $angles)
+ +Create an instance of FieldPlot

+ + + + + + + + +
ArgumentDefaultDescription
+$datay + + + Y-coordinate
+$datax + + + X-coordinate
+$angles + + + Angle
+ +

Description:
Create a new instance of a field plot 
+ +

Example:

+$fp = new FieldPlot($datay,$datax,$angle); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Footer.html b/includes/jpgraph/docs/classref/Footer.html new file mode 100644 index 0000000..c8b004a --- /dev/null +++ b/includes/jpgraph/docs/classref/Footer.html @@ -0,0 +1,80 @@ +


Class Footer
+(Defined in: jpgraph.php : 442)
 
 Footer 
 SetMargin() 
SetTimer() 
+
 

Class usage and Overview
Represents the footer in all graphs. The footer consists of three fields accessed by properties "left", "center" and "right" representing. This lets you have footer text to the left, center and to the right. +

+For example +

+$graph->footer->left->Set("(C) 2002"); +

  +


Class Methods

+

 

Footer ::
SetMargin($aLeft, $aRight, $aBottom)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aLeft + + + +3 + +No description available
+$aRight + + + +3 + +No description available
+$aBottom + + + +3 + +No description available
+ +

Description:
No description available.

+

 

Footer ::
SetTimer($aTimer, $aTimerPostString)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aTimer + + + No description available
+$aTimerPostString + + + +'' + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/FuncGenerator.html b/includes/jpgraph/docs/classref/FuncGenerator.html new file mode 100644 index 0000000..2c69b00 --- /dev/null +++ b/includes/jpgraph/docs/classref/FuncGenerator.html @@ -0,0 +1,95 @@ +


Class FuncGenerator
+(Defined in: jpgraph_utils.inc.php : 17)
 
 FuncGenerator 
 E() 
__construct() 
+
 

Class usage and Overview
A utility class to help with function plots. This class supprots both ordinary one-variable plots with one dependent variable as well as polar plots. + +Basically you create an instance of this class with the function you want to plot as a string argument. The function should be created using 'x' as the independent variable. You then invoke its evaluation method 'E()' with the range for the independent variable and possibly a step size. The method then returns an array of X, and Y values that represents the plot. + +Please remember that the string should be specified with single quotes since otherwise PHP will try to interpret the variable in the string. + +For example, to specify a simple cos() plot you specify: + +$f = new FuncGenerator('cos($x)'; +

  +


Class Methods

+

 

FuncGenerator ::
E($aXMin, $aXMax, $aSteps)
+ +Evaluate a X-Y function

+ + + + + + + + +
ArgumentDefaultDescription
+$aXMin + + + Min x-value
+$aXMax + + + Max x-value
+$aSteps + + + +50 + +Number of steps
+ +

Description:
Evaluate the previous specified function between the specified values. The return two arrays representing the X and Y coordinates for the function. 
+ +

Example:

+// Create a simple linear plot
$f = new FuncGenerator('cos($x) * sin($x)');
list(
$xdata,$ydata) = $f->E(-2*M_PI2*M_PI);

$lp1 = new LinePlot($ydata,$xdata);

// Create a simple polar plot (a circle)
$p = new FuncGenerator('cos($i)''sin($i)');
list(
$x2data,$y2data) = $f->E(-2*M_PI2*M_PI);

$lp2 = new LinePlot($y2data,$x2data);

//... +
+

+

+

 

FuncGenerator ::
__construct($aFunc, $aXFunc)
+ +Create a new function generator.

+ + + + + + +
ArgumentDefaultDescription
+$aFunc + + + Function
+$aXFunc + + + +'' + +X-Function
+ +

Description:
Creates a new funciton generator. You can create both a linear plot as well as polar plot. + +For linear, one-variable plots, you must use '$x' as the independent variable. + +For polar plots you should use the index '$i' for the generating functions. + 
+ +

Example:

+// Create a simple linear plot
$f = new FuncGenerator('cos($x) * sin($x)');
list(
$xdata,$ydata) = $f->E(-2*M_PI2*M_PI);

$lp1 = new LinePlot($ydata,$xdata);

// Create a simple polar plot (a circle)
$p = new FuncGenerator('cos($i)''sin($i)');
list(
$x2data,$y2data) = $f->E(-2*M_PI2*M_PI);

$lp2 = new LinePlot($y2data,$x2data);

//...
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GTextTable.html b/includes/jpgraph/docs/classref/GTextTable.html new file mode 100644 index 0000000..0a3f0ba --- /dev/null +++ b/includes/jpgraph/docs/classref/GTextTable.html @@ -0,0 +1,2237 @@ +


Class GTextTable
+(Defined in: jpgraph_table.php : 459)
 
 GTextTable 
 Init() 
MergeCells() 
MergeCol() 
MergeRow() 
Set() 
SetAlign() 
SetAnchorPos() 
SetBorder() 
SetCellAlign() 
SetCellColor() 
SetCellCountryFlag() 
SetCellCSIMTarget() 
SetCellFillColor() 
SetCellFont() 
SetCellImage() 
SetCellImageConstrain() 
SetCellNumberFormat() 
SetCellPadding() 
SetCellTextOrientation() 
SetColAlign() 
SetColColor() 
SetColFillColor() 
SetColFont() 
SetColGrid() 
SetColImage() 
SetColNumberFormat() 
SetColor() 
SetColPadding() 
SetColTextOrientation() 
SetCSIMTarget() 
SetFillColor() 
SetFont() 
SetGrid() 
SetImage() 
SetMinColWidth() 
SetMinRowHeight() 
SetNumberFormat() 
SetPadding() 
SetPos() 
SetRowAlign() 
SetRowColor() 
SetRowFillColor() 
SetRowFont() 
SetRowGrid() 
SetRowImage() 
SetRowNumberFormat() 
SetRowPadding() 
SetRowTextOrientation() 
SetScalePos() 
SetTextOrientation() 
toString() 
__construct() 
+
 

Class usage and Overview
When visualizing data it is often useful to have both a quick graphical view which can show high level trends and a detailed view with the exact figures. The pro-version of JpGraph now supports the creation of graphic tables in all available graph types. + +The specification of the tables data, position, fonts, alignment, colors, borders etc. is all fully flexible with an intuitive set of APIs to control the table. In this HowTo we will start by showing how to build basic tables which we will augment with more advanced formatting by introducing the formatting capabilities one by one. + +In addition to adding data tables to graphs it is also possible to create graphic tables on the fly all by its own. This has the advantage compared with HTML tables to allow users to make copies of the table while maintaining the exact formatting of the table. Figure 2. shows an example with just a graphical table

  +


Class Methods

+

 

GTextTable ::
Init($aRows, $aCols, $aFillText)
+ +Initialize the size for a newly created table

+ + + + + + + + +
ArgumentDefaultDescription
+$aRows + + + +0 + +Number of rows in table
+$aCols + + + +0 + +Number of columns in table
+$aFillText + + + +'' + +Deafult fill value for each cell
+ +

Description:
After the table has been created the size of the table has to be established. This can either be done by a call to this method or by supplying a matrix in the call to Set(). +

+If You plan on specifying the cells by individual calls to Set($row,$col,$value) then this method must have been called after the creation of the table. +

+When You set the entire table content with a call to Set() with a full 2D-matrix as argument the size of the matrix will be used to determine the size of the table. 
+ +

Example:

+$table = new GTextTable();
$table->Init(5,7);

+
+

+

+

 

GTextTable ::
MergeCells($aR1, $aC1, $aR2, $aC2, $aHAlign, $aVAlign)
+ +Merge cells in the specified range

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aR1 + + + Top left row
+$aC1 + + + Top left column
+$aR2 + + + Bottom right row
+$aC2 + + + Bottom right column
+$aHAlign + + + +'center' + +Horizontal alignment
+$aVAlign + + + +'center' + +Vertical alignment
+ +

Description:
Merge cells in the specified range. The alignment of the merged cells cab be set by the laet two optional arguments. + +Note: To merge all cells in a specific row or column use the alternative methods MergeCol() and MergeRow() 
+  
See also:
+

Example:

+// Merge the top 2x2 cells
$table->MergeCells(0,0,1,1,"right"); +
+

+

+

 

GTextTable ::
MergeCol($aCol, $aHAlign, $aVAlign)
+ +Merge all cells in one column

+ + + + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aHAlign + + + +'center' + +Horizontal alignment
+$aVAlign + + + +'center' + +Vertical alignment
+ +

Description:
Merge all cells in one column. + +Note: By default if no alignment is given the content in the merged cells will be centered both horixontally and vertically. 
+  
See also:
+

Example:

+$table->MergeCol(3); + +

+

+

 

GTextTable ::
MergeRow($aRow, $aHAlign, $aVAlign)
+ +Merge all cells in one row.

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aHAlign + + + +'center' + +Horizontal alignment
+$aVAlign + + + +'center' + +Vertical alignment
+ +

Description:
Merge all cells in one row. + +Note: By default if no alignment is given the content in the merged cells will be centered both horixontally and vertically. 
+  
See also:
+

Example:

+$table->MergeRow(2,"right","top"); + +

+

+

 

GTextTable ::
Set($aArg1, $aArg2, $aArg3)
+ +Set the value in cell or cells

+ + + + + + + + +
ArgumentDefaultDescription
+$aArg1 + + + 2D-Array or Row index
+$aArg2 + + + +NULL + +[Oprional] Columns index
+$aArg3 + + + +NULL + +(Optional) Value for cell
+ +

Description:
This method is used to put values in a cell or initialize the table using a 2D-matrix. The method is polymorphic and can be called in two ways +
    +
  1. Set($aTableMatrix), Specify the entire table by supplying a 2D-Matrix +
  2. Set($aRow,$aCol,$aValue), Set the value in a specific cell. Note that if You use this method then the size of the table muts have been previously specified with a call to Init() +
+ +Note: If the table is initialized with an 2D-matrix then there is no need to call the Init() method since the ovberall size of the table will be set to the same as the supplied matrix. + +Note: After the entire table have beedn specified with an initial 2D-array it is of course still possible to modify/set individual values with a call to the second version of the table. + 
+  
See also:
+

Example:

+// Create a new table from a 2D-array
$data = array(
   array(
"Jun",34,18,13), 
   array(
"Jul",15,9,12));
$table = new GTextTable();
$table->Set($data);
$table->SetAlign("right");
...


// Create a table by setting individual cells
$table = new GTextTable();
$table->Init(5,7); // 5 rows by 7 column sized table

for($i=0$i 5; ++$i) {
  for(
$j=0$j 7; ++$j) {
    
$table->Set(0,0,$data[$i][$j]);
  }
}
...

$table->Set(0,0,$data1);


+
+

+

+

 

GTextTable ::
SetAlign($aR1HAlign, $aC1VAlign, $aR2, $aC2, $aHArg, $aVArg)
+ +Set cell alignment for entire table or range of cells

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aR1HAlign + + + +null + +Top left row OR horizontal alignment
+$aC1VAlign + + + +null + +Top left column OR vertical alignment
+$aR2 + + + +null + +Bottom right row
+$aC2 + + + +null + +Bottom right column
+$aHArg + + + +null + +Horizontal alignment
+$aVArg + + + +'center' + +Vertical alignment
+ +

Description:
Set cell alignment for entire table or range of cells. The alignment fcan be specifed both horizontally and vertically. + +The possible settings for horizontal alignment are +"left", "center", "right" + +Vertical alignment can be set as +"top","center","bottom" + +Note that the alignment options are specified as strings. + 
+  
See also:
+

Example:

+// Set the default alignment for the entire table
$table->SetAlign("right");

// The set the first column to use left alignment
$table->SetColAlign(0,"left");
+
+

+

+

 

GTextTable ::
SetAnchorPos($aXAnchor, $aYAnchor)
+ +Specify where the anchor position of the table should be

+ + + + + + +
ArgumentDefaultDescription
+$aXAnchor + + + Horizontal anchor
+$aYAnchor + + + +'top' + +Vertical anchor
+ +

Description:
Specify where the anchor of the table should be. By default the anchor is top left corner so that the positoin you specify for the table is taken as the top left corner. + +This can be adjusted horixontally as +"left", "center" or "right" + +Vertically it can be adjusted as +"top","center","bottom" + 
+  
See also:
+

Example:

+// Make the position refer to the center of the table
$table->SetAnchorPos('center','center');
+
+

+

+

 

GTextTable ::
SetBorder($aWeight, $aColor)
+ +Set the color and weight on the border around the table-

+ + + + + + +
ArgumentDefaultDescription
+$aWeight + + + +1 + +Weight of border
+$aColor + + + +'black' + +Color of border
+ +

Description:
Set the color and weight on the border around the table. By default the border is a 1 pixel black solid line. + +Note: Specify a weight of 0 to disable the border entirely. 
+  
See also:
+

Example:

+...
$table->SetBorder(2,"navy");
...
+
+

+

+

 

GTextTable ::
SetCellAlign($aRow, $aCol, $aHorAlign, $aVertAlign)
+ +Set cell alignment for a specified cell.

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aHorAlign + + + Horizontal alignment
+$aVertAlign + + + +'bottom' + +Vertical alignment
+ +

Description:
Set cell alignment for a specified cell. The alignment can be specifed both horizontally and vertically. + +The possible settings for horizontal alignment are +"left", "center", "right" + +Vertical alignment can be set as +"top","center","bottom" + +Note that the alignment options are specified as strings. + 
+  
See also:
+

Example:

+$table->SetCellAlign(2,5,'left'); + +

+

+

 

GTextTable ::
SetCellColor($aRow, $aCol, $aColor)
+ +Set font color for a specific cell

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aColor + + + Font color
+ +

Description:
Set font color for a specific cell. + +Note: To set the default color for all cells use the SetColor() method. 
+  
See also:
+

Example:

+$table->SetCellColor(3,1,'darkred'); + +

+

+

 

GTextTable ::
SetCellCountryFlag($aRow, $aCol, $aFlag, $aScale, $aMix, $aStdSize)
+ +Set a country flag in the background of the specified cell

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aFlag + + + Flag specification partial name or index
+$aScale + + + +1.0 + +Scaling factor to be used
+$aMix + + + +100 + +Blending factor (0-100)
+$aStdSize + + + +3 + +Which original size of flag image to use
+ +

Description:
Set a country flag in the background of the specified cell. + +Before this method can be used make sure that the file "jpgraph_flags.php" is included in the script. + +All supported countries can be specified by setting the '$aFlag" parameter to either +
    +
  1. Numeric index, (0-238) +
  2. Full or partial name, e.g. "norway" +
  3. The unique string index for the country +
+ +For a list of all available flags please run the file "listallflags.php" in the Example directory. +

+The parameter "$aMix" is a value between 0-100 and specifies the blend factor for the flag. +

+The paraneter $aStdSize specifes one of three orignal izes of flag where size can be one of +

    +
  1. FLAGSIZE1, corresponds to an original flag size of 35x35 pixels +
  2. FLAGSIZE2, corresponds to an original flag size of 60x60', +
  3. FLAGSIZE3, corresponds to an original flag size of 100x100', +
  4. FLAGSIZE4, corresponds to an original flag size of roughly 400x400 +
+ +For best result always use an original flag that is at least as big as the size that is wanted, i.e. even though the scaling factor can be used to arbitrary change the size of any of these original flags the result when up scaling is not optimal since there is a need to interpolate. By starting with a larger original image which is the downsampled the result is much better. +

+Note 1: In order to lock either the height or the width of the flag to a specific value use the SetImageConstrain() +method. + + + 
+  

See also:
+

Example:

+// Set one row with a number of country flags and constrain
// the height to be 20 pixels
$countries = array('united states','united kingdom','french republic','denmark','iceland','canada');
$n count($countries);
for(
$i=0$i $n; ++$i ) {
    
$table->SetCellCountryFlag(1,$i+1,$countries[$i]);
    
$table->SetCellImageConstrain(1,$i+1,TIMG_HEIGHT,20);
}
+
+

+

+

 

GTextTable ::
SetCellCSIMTarget($aRow, $aCol, $aTarget, $aAlt)
+ +Specify URL for CSIM target

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aTarget + + + Target URL
+$aAlt + + + +null + +ALT text
+ +

Description:
Specify URL and optional ALT text for CSIM target for the specified cell. + 
+  
See also:
+

Example:

+$table->SetCellCSIMTarget(3,0,'detail.php','View detailes'); + +

+

+

 

GTextTable ::
SetCellFillColor($aRow, $aCol, $aColor)
+ +Specify background color in a cell

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aColor + + + background color
+ +

Description:
Specify background color in a cell. + +Note: To set the default background fill color for all cells usde the SetFillColor() method. 
+  
See also:
+

Example:

+// Highlight cell (7,0)
$table->SetCellFillColor(7,0,'yellow'); +
+

+

+

 

GTextTable ::
SetCellFont($aRow, $aCol, $aFF, $aFS, $aFSize)
+ +Specify font family and style for a specific cell

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aFF + + + Font family
+$aFS + + + Font style
+$aFSize + + + +10 + +Font size
+ +

Description:
Specify font family and style for a specific cell. + +Note:To set the default font for all cells use the SetFont() method. 
+  
See also:
+

Example:

+// Highlight cell (4,1) with red on yellow background
$table->SetCellFillColor(4,1,'yellow');
$table->SetCellColor(4,1,'darkred');
$table->SetCellFont(4,1,FF_ARIAL,FS_BOLD,12); +
+

+

+

 

GTextTable ::
SetCellImage($aRow, $aCol, $aFile, $aScale, $aMix)
+ +Set a background image in the specified cell

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aFile + + + Image file name
+$aScale + + + +1.0 + +Image scale factor
+$aMix + + + +100 + +Blending factor (0-100)
+ +

Description:
Set a background image in the specified cell. The image is stored in the file with the name given as the third parameter. + +The image name must end with a valid image prefix, i.e. one of ".png", ".jpg" or possibly ".gif" + +Note: To set a default background image for all cells in the table use the SetImage() method. 
+  
See also:
+

Example:

+// Put the image 'warning.jpg' in cell (3,6) and
// scale the image to half size
$table->SetCellImage(3,6,'warning.jpg',0.5); +
+

+

+

 

GTextTable ::
SetCellImageConstrain($aRow, $aCol, $aType, $aVal)
+ +Lock either the image height or width in a particular cell

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aType + + + Specify width or height constrain
+$aVal + + + Value of constrain
+ +

Description:
Use this method to locj either the width or height of the image ina a cell. The non-specified image width or height will be automatically determied so that the orignal propertion of the image is maintained. + +The $aType parameter is used to indicate if the value given should be interpretated as width or height constarin and is specifed as either +
    +
  1. TIMG_WIDTH, Interpret as width +
  2. TIMG_HEIGHT,Interpret as height +
 
+  
See also:
+

Example:

+// Make sure image in cell (3,1) is exactlyb 20 pixels 
// in height
$table->SetCellImageConstrain(3,1,TIMG_HEIGHT,20); +
+

+

+

 

GTextTable ::
SetCellNumberFormat($aRow, $aCol, $aF)
+ +Set number format in cell

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aF + + + Format string
+ +

Description:
Set number format in cell. The number format should be given in the style of printf() family format strings. A cell that contains non numeric data will not be affected in any way by this method. + +Note: It is the resposnibility of the client to make any necessary rounding of the numbers. 
+ +

Example:

+// Use two decimals with leading 0 on numbers
$this->SetCellNumberFormat(3,1,'%0.2f'); +
+

+

+

 

GTextTable ::
SetCellPadding($aRow, $aCol, $aPad)
+ +Set internal cell margin

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aCol + + + Column index
+$aPad + + + Internal cell margin (in pixels)
+ +

Description:
Set internal cell margins in pixels. + +By default the internal cell padding is 5 pixels. + +Note: To change the default cell padding for all cells in the table use the Setpadding() method. 
+ +

Example:

+// Set 8 pixel cell padding for cell (1,3)
$table->SerCellPadding(3,1,8); +
+

+

+

 

GTextTable ::
SetCellTextOrientation($aRow, $aCol, $aO)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + No description available
+$aCol + + + No description available
+$aO + + + No description available
+ +

Description:
No description available.

+

 

GTextTable ::
SetColAlign($aCol, $aHorAlign, $aVertAlign)
+ +Set cell alignment for an entire column of cells.

+ + + + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aHorAlign + + + Horizontal alignment
+$aVertAlign + + + +'bottom' + +Vertical alignment
+ +

Description:
Set cell alignment for an entire column of cells. The alignment can be specifed both horizontally and vertically. + +The possible settings for horizontal alignment are +"left", "center", "right" + +Vertical alignment can be set as +"top","center","bottom" + +Note that the alignment options are specified as strings. + +Note2: In order to set the default alignment for all cells in the table use the SetAlign() method. 
+  
See also:
+

Example:

+$table->SetColAlign(3,'center'); + +

+

+

 

GTextTable ::
SetColColor($aCol, $aColor)
+ +Set font color for a entire column.

+ + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aColor + + + Font color
+ +

Description:
Set font color for a entire column. + +Note: To set the default color for all cells use the SetColor() method. 
+  
See also:
+

Example:

+$table->SetColColor(2,'blue'); + +

+

+

 

GTextTable ::
SetColFillColor($aCol, $aColor)
+ +Specify background color in an entire column of cells

+ + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aColor + + + Background color
+ +

Description:
Specify background color in an entire column of cells. + +Note: To set the default background fill color for all cells usde the SetFillColor() method. 
+  
See also:
+

Example:

+// Highlight column 3 with white text on gray bakground
$table->SetColFillColor(3,'darkgray');
$table->SetColColor(3,'white'); +
+

+

+

 

GTextTable ::
SetColFont($aCol, $aFF, $aFS, $aFSize)
+ +Specify font family and style for an entire column of cells

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aFF + + + Font family
+$aFS + + + Font style
+$aFSize + + + +10 + +Font size
+ +

Description:
Specify font family and style for an entire column of cells + +Note:To set the default font for all cells use the SetFont() method. 
+  
See also:
+

Example:

+$table->SetColFont(0,FF_ARIAL,FS_NORMAL,12); + +

+

+

 

GTextTable ::
SetColGrid($aCol, $aWeight, $aColor, $aStyle)
+ +Set style, color and width of a specified vertical grid line

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aCol + + + Grind line to specify
+$aWeight + + + +1 + +Width of line
+$aColor + + + +'black' + +Color of line
+$aStyle + + + +TGRID_SINGLE + +Grid line style (see below)
+ +

Description:
Set style, color and width of a specified vertical grid line in the table. The grid lines are numbered from 1 to columns-1 and from left to right. The grid lines are defined as the internal lines in the table. The outer border of the table is controlled separately with the SetBorder() method. +

+The style for the grid lines can be one of the following three +

    +
  1. TGRID_SINGLE, Single solid line of the given color and weight +
  2. TGRID_DOUBLE, Two solid lines of the given color and weight. The distance between the lines is the same as the weight. +
  3. TGRID_DOUBLE2, Two solid lines of the given color. The first line has twice the weight as the second. This type of line is often used to mark a summation line in a table. +
+ +Note: In order to remove all grid lines in the table set the width to 0. + 
+ +

Example:

+$table->SetColGrid(1,1,'black',TGRID_DOUBLE2);
+
+

+

+

 

GTextTable ::
SetColImage($aCol, $aFile, $aScale, $aMix)
+ +Set background image for an entire column of cells

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aFile + + + Filename of image
+$aScale + + + +1.0 + +Scale of image
+$aMix + + + +100 + +Blend factor for image (0-100)
+ +

Description:
Set background image for an entire column of cells. The should be stored in a file whos filename is given as the second parameter. The scdaling factor can be specifed as an arbitary floating point value between 0-1. +

+The Blend factor is specified as an integer between 0 and 100 where 100 is 100% blend factor. + 
+  

See also:
+

Example:

+$table->SetColImage(2,$imageFileNmae,0.7); + +

+

+

 

GTextTable ::
SetColNumberFormat($aCol, $aF)
+ +Set number format in an entire column of cells

+ + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aF + + + Format string
+ +

Description:
Set number format in an entire column of cells. The number format should be given in the style of printf() family format strings. A cell that contains non numeric data will not be affected in any way by this method. + +Note: It is the resposnibility of the client to make any necessary rounding of the numbers. 
+  
See also:
+

Example:

+// Use two decimals with leading zero
$table->SetColNumberFormat(4,'%0.2f'); +
+

+

+

 

GTextTable ::
SetColor($aArgR1, $aC1, $aR2, $aC2, $aArg)
+ +Set font color for the whole table or a range of cells.

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aArgR1 + + + Top left row OR font color
+$aC1 + + + +null + +Top left column
+$aR2 + + + +null + +Bottom right row
+$aC2 + + + +null + +Bottom right column
+$aArg + + + +null + +Font color
+ +

Description:
Set font color for the whol table or a range of cells. +Thie method is polymorphic an can be called in two ways +
+  
See also:
+

Example:

+// Set the font color for the entire table
$table->SetColor('darkgray');

// Set the font color for the top left 2x2 cells
$table->SetColor(0,0,1,1,'blue');
+
+

+

+

 

GTextTable ::
SetColPadding($aCol, $aPad)
+ +Set internal cell margins in pixels for all cells in the specified column.

+ + + + + + +
ArgumentDefaultDescription
+$aCol + + + Column index
+$aPad + + + Internal cell margin
+ +

Description:
Set internal cell margins in pixels for all cells in the specified column. + +By default the internal cell padding is 5 pixels. + +Note: To change the default cell padding for all cells in the table use the Setpadding() method. 
+  
See also:
+

Example:

+$table->SetColPadding(3,12): + +

+

+

 

GTextTable ::
SetColTextOrientation($aCol, $aO)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aCol + + + No description available
+$aO + + + No description available
+ +

Description:
No description available.

+

 

GTextTable ::
SetCSIMTarget($aTarget, $aAlt, $aAutoTarget)
+ +Set URL CSIM target for all cells in the table

+ + + + + + + + +
ArgumentDefaultDescription
+$aTarget + + + Target URL
+$aAlt + + + +null + +ALT etxt
+$aAutoTarget + + + +false + +TRUE=Append auto row and column argument
+ +

Description:
Set URL CSIM target for all cells in the table. If the $aAutoTarget is set to TRUE then an additional GET method argument will be appended to the base URL. This makes it possible to spcify a base URL which will then be called with the two additional arguments "row" and "col". This can be used to determien from which cell the click was made. +

+An example will clarify this. +

+Assume that the base URL is "target.php". If we then setup the table with + +$table->SetCSIMTarget('target.php','Click for details',true); + +then if the user clicks the cell (1,1) the url called will be "target.php?row=1&col=1", for cell (2,3) the call would be "target.php?row=2&col=3" and so on. + 
+ +

Example:

+// Assume that the base URL is "target.php". 
$table->SetCSIMTarget('taregt.php','Click for details',true); +
+

+

+

 

GTextTable ::
SetFillColor($aArgR1, $aC1, $aR2, $aC2, $aArg)
+ +Set background image for an entire range of cells or entire table

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aArgR1 + + + Top left row OR color
+$aC1 + + + +null + +Top left column
+$aR2 + + + +null + +Bottom right row
+$aC2 + + + +null + +Bottom right column
+$aArg + + + +null + +Color for range
+ +

Description:
Set background image for an entire range of cells or entire table. + +This method is polymorphic and can be called in two ways +
    +
  1. SetFillColor($aFillColor), Set fill color for all cells in the table +
  2. SetFillColor($aR1,$aC1,$aR2,$aC2,$aFillColor), Set fill color for a range of cells +

+  
See also:
+

Example:

+// Set default fill color for entire table
$table->SetFillColor('lightgray');

// Highlight top left 2x2 cells
$table->SetFillColor(0,0,1,1,'yellow');
+
+

+

+

 

GTextTable ::
SetFont()
+ +Set font for entire table or range of cells.

+
+ +

Description:
Set font for entire table or range of cells. This si a polymorphic method and can be called in two ways- +
    +
  1. SetFont($aFF,$aFS,$aFSize), Set default font for entire table +
  2. SetFont($aR1,$aC1,$aR2,$aC2,$aFF,$aFS,$aFSize), Set default font for range of cells table +

+  
See also:
+

Example:

+// Set default font for entire table
$table->SetFont(FF_TIMES,FS_NORMAL,11);

// Set font for the two top rows
$table->SetFont(0,0,1,5,FF_ARIAL,FS_BOLD,12);
+
+

+

+

 

GTextTable ::
SetGrid($aWeight, $aColor, $aStyle)
+ +Set style, color and width of all table grid lines

+ + + + + + + + +
ArgumentDefaultDescription
+$aWeight + + + +1 + +Width of grid lines
+$aColor + + + +'black' + +Color of grid lines
+$aStyle + + + +TGRID_SINGLE + +Style of grid lines
+ +

Description:
Set style, color and width of all table grid lines. The grid lines are defined as the internal lines in the table. The outer border of the table is controlled separately with the SetBorder() method. +

+The style for the grid lines can be one of the following three +

    +
  1. TGRID_SINGLE, Single solid line of the given color and weight +
  2. TGRID_DOUBLE, Two solid lines of the given color and weight. The distance between the lines is the same as the weight. +
  3. TGRID_DOUBLE2, Two solid lines of the given color. The first line has twice the weight as the second. This type of line is often used to mark a summation line in a table. +
+ +Note: In order to remove all grid lines in the table set the width to 0. + 
+  
See also:
+

Example:

+// Set the default grid lines for whole table
$table->SetGrid(1,'gray',TGRID_SOLID); +
+

+

+

 

GTextTable ::
SetImage($aFileR1, $aScaleC1, $aMixR2, $aC2, $aFile, $aScale, $aMix)
+ +Set background image for an entire range of cells or entire table

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aFileR1 + + + Top left row OR file name
+$aScaleC1 + + + +null + +Top left column OR scale
+$aMixR2 + + + +null + +Bottom right row OR blend factor
+$aC2 + + + +null + +Bottom right column
+$aFile + + + +null + +Image filename
+$aScale + + + +1.0 + +Image scale
+$aMix + + + +100 + +Blend factor (0-100)
+ +

Description:
Set background image for an entire rnage of cells or entire table. The should be stored in a file whos filename is given as the second parameter. The scdaling factor can be specifed as an arbitary floating point value between 0-1. +

+The Blend factor is specified as an integer between 0 and 100 where 100 is 100% blend factor. 
+  

See also:
+

Example:

+// Set the same background image for all cells in the table
$table->SetImage($fileName,0.8);

// Set the background image for the top 2x2 cells
$table->SetImage(0,0,1,1,$fileName,0.8);
+
+

+

+

 

GTextTable ::
SetMinColWidth($aColWidth, $aWidth)
+ +Specify minimum column width

+ + + + + + +
ArgumentDefaultDescription
+$aColWidth + + + Width or column index
+$aWidth + + + +null + +Width
+ +

Description:
Specify minimum column width of all columns or a specific column. The method is polymorphic and can be called in two different ways. +
    +
  1. SetMinColWidth($aWidth), Set the minimum width for all columns in the table +
  2. SetMinColWidth($aColIndex,$aWidth), Set the minimum width for the specified column +
+ +Note that the column width will always be wide enough to hold the widest text or image. This means that the table will never to adny clipping of data. 
+  
See also:
+

Example:

+// Make all columns at least 50 pixels wide
$table->SetMinColWidth(50); +
+

+

+

 

GTextTable ::
SetMinRowHeight($aRowHeight, $aHeight)
+ +Specify minimum row height of all rows or a specific row.

+ + + + + + +
ArgumentDefaultDescription
+$aRowHeight + + + Row index or height
+$aHeight + + + +null + +Height
+ +

Description:
Specify minimum row height of all rows or a specific row. The method is polymorphic and can be called in two different ways. +
    +
  1. SetMinRowHeight($aWidth), Set the minimum height for all rows in the table +
  2. SetMinRowHeight($aRowIndex,$aWidth), Set the minimum height for the specified table row +
+ +Note that the row height will always be tall enough to hold the highest text or image. This means that the table will never to adny clipping of the data. 
+  
See also:
+

Example:

+// Make the top row at least 40 pixels in height
$table->SetMinRowHeight(0,40); +
+

+

+

 

GTextTable ::
SetNumberFormat($aArgR1, $aC1, $aR2, $aC2, $aArg)
+ +Set number format for entire table or a range of cells.

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aArgR1 + + + Top left row OR format string
+$aC1 + + + +null + +Top left column
+$aR2 + + + +null + +Bottom right row
+$aC2 + + + +null + +Bottom right column
+$aArg + + + +null + +Format string
+ +

Description:
Set number format for entire table or a range of cells. The number format should be given in the style of printf() family format strings. A cell that contains non numeric data will not be affected in any way by this method. + +The method is polymorphic and can be called in two ways +
    +
  1. SetNumberFormat($aFormat), Set the number format for the entire table +
  2. SetNumberFormat($aFormat), Set the number format for a range of cells +
+ +Note: It is the resposnibility of the client to make any necessary rounding of the numbers. 
+  
See also:
+

Example:

+$table->SetNumberFormat('%0.2f'); + +

+

+

 

GTextTable ::
SetPadding($aArgR1, $aC1, $aR2, $aC2, $aPad)
+ +Set internal cell margins for all cells in the specified range or entire table

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aArgR1 + + + Top left row OR cell padding
+$aC1 + + + +null + +Top left column
+$aR2 + + + +null + +Bottom right row
+$aC2 + + + +null + +Bottom right column
+$aPad + + + +null + +Cell padding
+ +

Description:
Set internal cell margins for all cells in the specified range or entire table + +By default the internal cell padding is 5 pixels. + +This method is polymorphic and can be called in two ways +
    +
  1. SetPadding($aPadding), Set padding for all cells in the table +
  2. SetPadding($aR1,$aC1,$aR2,$aC2,$aPadding), Set padding for the specified range of cells +
+ + 
+  
See also:
+

Example:

+// First set the default padding for all cells
$table->SetPadding(8);

// Set the padding much larger in the top left 2x2 cells
$table->SetPadding(0,0,1,1,20); +
+

+

+

 

GTextTable ::
SetPos($aX, $aY)
+ +Set absolute pixel position the table

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + X Coordinate of top left corner
+$aY + + + Y Coordinate of top left corner
+ +

Description:
Set absolute pixel position for top left corner of the table. This is the simplest way of positioning a table in the graph area. +

+Note: The anchor position of the table can also be adjusted by the method SetAnchorPos(). By deagule the top left corner of the table is aligned with the specified coordinates. 
+  

See also:
+

Example:

+$table->SetPos(10,10); + +

+

+

 

GTextTable ::
SetRowAlign($aRow, $aHorAlign, $aVertAlign)
+ +Set cell alignment for an entire row of cells.

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aHorAlign + + + Horizontal alignment
+$aVertAlign + + + +'bottom' + +Vertical alignment
+ +

Description:
Set cell alignment for an entire row of cells. The alignment can be specifed both horizontally and vertically. + +The possible settings for horizontal alignment are +"left", "center", "right" + +Vertical alignment can be set as +"top","center","bottom" + +Note that the alignment options are specified as strings. + +Note2: In order to set the default alignment for all cells in the table use the SetAlign() method. 
+  
See also:
+

Example:

+$table->SetRowAlign(6,'right'); + +

+

+

 

GTextTable ::
SetRowColor($aRow, $aColor)
+ +Set font color for an entire row.

+ + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aColor + + + Font color
+ +

Description:
Set font color for an entire row. + +Note: To set the default color for all cells use the SetColor() method. 
+  
See also:
+

Example:

+$table->SetRowColor(5,'red'); + +

+

+

 

GTextTable ::
SetRowFillColor($aRow, $aColor)
+ +Specify background color in an entire row of cells.

+ + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aColor + + + Background color
+ +

Description:
Specify background color in an entire row of cells. + +Note: To set the default background fill color for all cells usde the SetFillColor() method. 
+  
See also:
+

Example:

+// Highlight row 0 with white text on gray bakground
$table->SetRowFillColor(0,'darkgray');
$table->SetRowColor(0,'white'); +
+

+

+

 

GTextTable ::
SetRowFont($aRow, $aFF, $aFS, $aFSize)
+ +Specify font family and style for an entire row of cells

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aFF + + + Font family
+$aFS + + + Font style
+$aFSize + + + +10 + +Font size
+ +

Description:
Specify font family and style for an entire row of cells + +Note:To set the default font for all cells use the SetFont() method. 
+  
See also:
+

Example:

+$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,12); + +

+

+

 

GTextTable ::
SetRowGrid($aRow, $aWeight, $aColor, $aStyle)
+ +Set style, color and width of a specified horizontal grid line

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Grind line to specify
+$aWeight + + + +1 + +Width of line
+$aColor + + + +'black' + +Color of line
+$aStyle + + + +TGRID_SINGLE + +Grid line style (see below)
+ +

Description:
Set style, color and width of a specified horizontal grid line in the table. The grid lines are numbered from 1 to columns-1 and from top to bottom. The grid lines are defined as the internal lines in the table. The outer border of the table is controlled separately with the SetBorder() method. +

+The style for the grid lines can be one of the following three +

    +
  1. TGRID_SINGLE, Single solid line of the given color and weight +
  2. TGRID_DOUBLE, Two solid lines of the given color and weight. The distance between the lines is the same as the weight. +
  3. TGRID_DOUBLE2, Two solid lines of the given color. The first line has twice the weight as the second. This type of line is often used to mark a summation line in a table. +
+ +Note: In order to remove a grid line in the table set the width to 0. + 
+  
See also:
+

Example:

+// Add a double line of width=2 to mark the summation row
// in a atable
$table->SetRowGrid(4,2,'black',TGRID_DOUBLE2); +
+

+

+

 

GTextTable ::
SetRowImage($aRow, $aFile, $aScale, $aMix)
+ +Set background image for an entire row of cells

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aFile + + + Filename of image
+$aScale + + + +1.0 + +Scale of image
+$aMix + + + +100 + +Blend factor for image (0-100)
+ +

Description:
Set background image for an entire row of cells. The should be stored in a file whos filename is given as the second parameter. The scdaling factor can be specifed as an arbitary floating point value between 0-1. +

+The Blend factor is specified as an integer between 0 and 100 where 100 is 100% blend factor. + 
+  

See also:
+

Example:

+$table->SetRowImage(1,$fileName,0.5,60); + +

+

+

 

GTextTable ::
SetRowNumberFormat($aRow, $aF)
+ +Set number format in an entire row of cells.

+ + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aF + + + Format string
+ +

Description:
Set number format in an entire row of cells. The number format should be given in the style of printf() family format strings. A cell that contains non numeric data will not be affected in any way by this method. + +Note: It is the resposnibility of the client to make any necessary rounding of the numbers. 
+  
See also:
+

Example:

+// Use 2 decimals with leading zero
$table->SetRowNumberFormat('%0.2f'); +
+

+

+

 

GTextTable ::
SetRowPadding($aRow, $aPad)
+ +Set internal cell margins in pixels for all cells in the specified row

+ + + + + + +
ArgumentDefaultDescription
+$aRow + + + Row index
+$aPad + + + Internal cell margin
+ +

Description:
Set internal cell margins in pixels for all cells in the specified row. + +By default the internal cell padding is 5 pixels. + +Note: To change the default cell padding for all cells in the table use the Setpadding() method. 
+  
See also:
+

Example:

+$table->SetRowPadding(4,12); + +

+

+

 

GTextTable ::
SetRowTextOrientation($aRow, $aO)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aRow + + + No description available
+$aO + + + No description available
+ +

Description:
No description available.

+

 

GTextTable ::
SetScalePos($aX, $aY)
+ +Set position of the entire table on the graphn using the current X,Y sclae

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + X-position according to current scle
+$aY + + + Y position according to curent scale
+ +

Description:
This method makes it possible to place the table at specific scale coordinates within the plot area of the graph. This could for example be used to place a small table at each of the data points in a line graph (or some other type of plot) to show fyrther details. +

+Note: The anchor position of the table can also be adjusted by the method SetAnchorPos(). By deagule the top left corner of the table is aligned with the specified coordinates. 
+  

See also:
+

Example:

+// Create the tables and position them at each data point
// In the line plot
// The data for each table is held in $tabledata[] array
// and the plot data is available in $datay[] array.

$n count($datay);
$table=array();
for(
$i=0$i $n; ++$i ) {
    
$table[$i] = new GTextTable();
    
$table[$i]->Set($tabledata[$i]);
    
$table[$i]->SetScalePos($i,$datay[$i]);
    
$table[$i]->SetFillColor('lightyellow@0.5');
    
// We center all tables on the data point
    
$table[$i]->SetAnchorPos('center','middle');
    
$graph->Add($table[$i]);
}
...
// Create the line
$l1 = new LinePlot($datay);
$l1->SetWeight(2);
$graph->Add($l1);
...
+
+

+

+

 

GTextTable ::
SetTextOrientation($aArgR1, $aC1, $aR2, $aC2, $aO)
+ +

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aArgR1 + + + No description available
+$aC1 + + + +null + +No description available
+$aR2 + + + +null + +No description available
+$aC2 + + + +null + +No description available
+$aO + + + +null + +No description available
+ +

Description:
No description available.

+

 

GTextTable ::
toString()
+ +Return basic HTML version of the table

+
+ +

Description:
Return basic HTML version of the table. Note that this is just a very basic representation of the table without any of the formatting applied the table. 
+ +

Example:

+$str $table->toString(); + +

+

+

 

GTextTable ::
__construct()
+ +Create a new Graphic text table

+
+ +

Description:
Create a new Graphic text table. The next call should either be to specify a value for the table (using GTextTable::Set() ) or a call to GTextTable::Init() to specify the size of table. 
+  
See also:
+

Example:

+$table = new GTextTable();
$table->Set($tableData);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GanttActivityInfo.html b/includes/jpgraph/docs/classref/GanttActivityInfo.html new file mode 100644 index 0000000..b5aaf1e --- /dev/null +++ b/includes/jpgraph/docs/classref/GanttActivityInfo.html @@ -0,0 +1,281 @@ +


Class GanttActivityInfo
+(Defined in: jpgraph_gantt.php : 142)
 
 GanttActivityInfo 
 Hide() 
SetBackgroundColor() 
SetColor() 
SetColTitles() 
SetColumnMargin() 
SetFont() 
SetFontColor() 
SetHeaderAlign() 
SetStyle() 
Show() 
+
 

Class usage and Overview
This class is responsible for handling the titles of the columns in the left section of the Gantt graph, i.e. the information columns for each activity. +

+It is instantiated in the scale and is accessed through the Gantt scale for example as in +

+ +$graph->scale->actinfo->SetColTitles( + array('Note','Name','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'); + +

+It is optional to use titles for the columns, so if you don't want to use titles you never have to add the above lines to a Gantt graph (but it sure looks nicer if you do ... ) +

  +


Class Methods

+

 

GanttActivityInfo ::
Hide($aF)
+ +Hide titles

+ + + + +
ArgumentDefaultDescription
+$aF + + + +true + +TRUE=Hide titles
+ +

Description:
Hide titles 
+ +

Example:

+// Hide the titles
$graph->scale->actinfo->Hide(); +
+

+

+

 

GanttActivityInfo ::
SetBackgroundColor($aColor)
+ +Specify backgound color for titles

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color specification
+ +

Description:
Specify backgound color for titles 
+ +

Example:

+$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5'); + +

+

+

 

GanttActivityInfo ::
SetColor($aColor)
+ +Specify color of vertical dividers between each title column

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color specification
+ +

Description:
Specify color of vertical dividers between each title column 
+ +

Example:

+$graph->scale->actinfo->SetColor('navy'); + +

+

+

 

GanttActivityInfo ::
SetColTitles($aTitles, $aWidth)
+ +Specify texts to be used as titles

+ + + + + + +
ArgumentDefaultDescription
+$aTitles + + + Array of titles
+$aWidth + + + +null + +Optional width for each column
+ +

Description:
Specify texts to be used as titles. The columns automatically becoms wide enough to hold the widest text in any columns. However you can also specify a specific width of each column by supplying an array of widths. However, the width can never be made smaller than the width of the texts, just larger. +

+It is perfectly legal to just specify the explicit width of the first few columns and have the rest of them become automatically sized. See eamplebelow. + 
+ +

Example:

+// Specify some titles and explicitely set the size of the
// first two columns.
$graph->scale->actinfo->SetColTitles(
    array(
'Note','Name','Duration','Start','Finish'),array(30,100));
+
+

+

+

 

GanttActivityInfo ::
SetColumnMargin($aLeft, $aRight)
+ +Specify extra margin to the left and right of the text in each column

+ + + + + + +
ArgumentDefaultDescription
+$aLeft + + + Left margin (in pixels)
+$aRight + + + Right margin (in pixels)
+ +

Description:
Specify extra margin to the left and right of the text in each column 
+ +

Example:

+$graph->scale->actinfo->SetColumnMargin(30,30);
+
+

+

+

 

GanttActivityInfo ::
SetFont($aFFamily, $aFStyle, $aFSize)
+ +Specify title font

+ + + + + + + + +
ArgumentDefaultDescription
+$aFFamily + + + Font family
+$aFStyle + + + +FS_NORMAL + +Font style
+$aFSize + + + +10 + +Font size
+ +

Description:
Specify title font 
+ +

Example:

+$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); + +

+

+

 

GanttActivityInfo ::
SetFontColor($aFontColor)
+ +Specify title font color

+ + + + +
ArgumentDefaultDescription
+$aFontColor + + + Color specification
+ +

Description:
Specify title font color 
+ +

Example:

+$graph->scale->actinfo->SetFontColor('navy'); + +

+

+

 

GanttActivityInfo ::
SetHeaderAlign($aAlign)
+ +Adjust headers left, right or centered

+ + + + +
ArgumentDefaultDescription
+$aAlign + + + Header alignment
+ +

Description:
Adjust headers left, right or centered. By default headers are centered. 
+ +

Example:

+$graph->scale->actinfo->SetHeaderAlign('left'); + +

+

+

 

GanttActivityInfo ::
SetStyle($aStyle)
+ +Enable 3D header style

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + 1=3D style
+ +

Description:
Enable 3D header style. This is enabled by default. 
+ +

Example:

+// No 3D style for titles
$graph->scale->actinfo->SetStyle(0); +
+

+

+

 

GanttActivityInfo ::
Show($aF)
+ +Show titles

+ + + + +
ArgumentDefaultDescription
+$aF + + + +true + +TRUE=Show headers
+ +

Description:
Show titles. If you specify titles they are by default displayed. 
+  
See also:
+

Example:

+// Hide the titles
$graph->scale->actinfo->Show(false); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GanttBar.html b/includes/jpgraph/docs/classref/GanttBar.html new file mode 100644 index 0000000..8ca9c9a --- /dev/null +++ b/includes/jpgraph/docs/classref/GanttBar.html @@ -0,0 +1,274 @@ +


Class GanttBar Extends GanttPlotObject
+(Defined in: jpgraph_gantt.php : 3192)
 
 GanttBar  GanttPlotObject 
 SetBreakStyle() 
SetColor() 
SetFillColor() 
SetHeight() 
SetPattern() 
SetShadow() 
__construct() 
+
 SetCaptionMargin() 
SetConstrain() 
SetCSIMAlt() 
SetCSIMTarget() 
SetLabelLeftMargin() 
+
 

Class usage and Overview
This class represents each activity bar. The activity bars can then be added to a GanttChart vi the GanttGraph::Add()

  +


Class Methods

+

 

GanttBar ::
SetBreakStyle($aFlg, $aLineStyle, $aLineWeight)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+$aLineStyle + + + +'dotted' + +No description available
+$aLineWeight + + + +1 + +No description available
+ +

Description:
No description available.

+

 

GanttBar ::
SetColor($aColor)
+ +Specify frame color for the activity bar

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color for gantt bar
+ +

Description:
Specify frame color for the activity bar. 
+ +

Example:

+$bar->SetColor('orange');
+
+

+

+

 

GanttBar ::
SetFillColor($aColor)
+ +Specify fill color for activity bar.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Fill color
+ +

Description:
Specify fill color for activity bar. +

+Note: It is perfectly possible to use both a background color as weel as a pattern. + 
+ +

Example:

+$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red");
+
+

+

+

 

GanttBar ::
SetHeight($aHeight)
+ +Set height for the bar.

+ + + + +
ArgumentDefaultDescription
+$aHeight + + + Height specification for bars
+ +

Description:
Specify height of the activity bar. The height can be specified as either as fraction (0.0 to 1.0) or as an absolute value (1 to 200). In the first case the height is interpreted as the fraction of the row height and in the second case as an absolute height in pixels. 
+ +

Example:

+$bar->SetHeight(0.6);
+
+

+

+

 

GanttBar ::
SetPattern($aPattern, $aColor, $aDensity)
+ +Specify what pattern to use for the activity bars.

+ + + + + + + + +
ArgumentDefaultDescription
+$aPattern + + + Pattern specification
+$aColor + + + +"blue" + +Pattern color
+$aDensity + + + +95 + +Density
+ +

Description:
The following patterns are currently implemented: +
    +
  1. GANTT_RDIAG, Right diagonal lines +
  2. GANTT_LDIAG, Left diagonal lines +
  3. GANTT_SOLID, Solid one color +
  4. GANTT_LVERT, Vertical lines +
  5. GANTT_LHOR, Horizontal lines +
  6. GANTT_VLINE, Vertical lines +
  7. GANTT_HLINE, Horizontal lines +
  8. GANTT_3DPLANE, A 3D plane +
  9. GANTT_HVCROSS, Crosses +
  10. GANTT_DIAGCROSS, Diagonal crosses +

+  
See also:
+

Example:

+$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red"); +
+

+

+

 

GanttBar ::
SetShadow($aShadow, $aColor)
+ +Add a drop shadow to the bar.

+ + + + + + +
ArgumentDefaultDescription
+$aShadow + + + +true + +True=Add drop shadow to bars
+$aColor + + + +"gray" + +Colro fo shadow
+ +

Description:
Add a drop shadow to the bar. + 
+ +

Example:

+$bar->SetShadow(); + +

+

+

 

GanttBar ::
__construct($aPos, $aLabel, $aStart, $aEnd, $aCaption, $aHeightFactor)
+ +Create a new activity bar.

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aPos + + + Vertical position (row)
+$aLabel + + + Text label
+$aStart + + + Start date
+$aEnd + + + End date
+$aCaption + + + +"" + +Caption string for bar
+$aHeightFactor + + + +0.6 + +Height factor
+ +

Description:
Create a new activity bar. An activity bar is created by specifyin : +
    +
  1. The row in gentt chart to draw the activity bar in +
  2. Specify a label(titel) for the activity. +
  3. A start date +
  4. An end date +
  5. A caption which is a string that gets stroked to the right of the activity bar. +
  6. Height as either an asbolute value or as a fraction of the available row height. +

+ +

Example:

+$bar = new GanttBar(4,"Group 2""2001-11-30","2001-12-22","[5%]",10); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GanttGraph.html b/includes/jpgraph/docs/classref/GanttGraph.html new file mode 100644 index 0000000..0bfc629 --- /dev/null +++ b/includes/jpgraph/docs/classref/GanttGraph.html @@ -0,0 +1,454 @@ +


Class GanttGraph Extends Graph
+(Defined in: jpgraph_gantt.php : 331)
 
 GanttGraph  Graph 
 Add() 
CreateSimple() 
SetDateRange() 
SetLabelVMarginFactor() 
SetSimpleFont() 
SetSimpleStyle() 
SetVMarginFactor() 
SetZoomFactor() 
ShowHeaders() 
Stroke() 
StrokeTexts() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview
Create a Gantt graph. The Gantt graph can then be built up by adding activity bars and milestones.

  +

See also related classes:
GanttBar, GanttVLine and MileStone

 


Class Methods

+

 

GanttGraph ::
Add($aObject)
+ +Add a new Gantt object

+ + + + +
ArgumentDefaultDescription
+$aObject + + + Gantt plot object
+ +

Description:
Add a gantt object to the graph. A gantt object is an instance of either: + 
+ +

Example:

+$vline = new GanttVLine("2002-02-28");
$vline->title->Set("2002-02-28");
$vline->title->SetFont(FF_FONT1,FS_BOLD,10);
$graph->Add($vline);
+
+

+

+

 

GanttGraph ::
CreateSimple($data, $constrains, $progress)
+ +A utility function to help create the Gantt charts

+ + + + + + + + +
ArgumentDefaultDescription
+$data + + + Gantt bar specification (See below)
+$constrains + + + +array() + +Constrain specification (see below)
+$progress + + + +array() + +Progress specification (see below)
+ +

Description:
For a simple Gantt graphs this will simplify it's creation. The idea is that this method accepts a number of data arrays which specifies the activities in the Gantt graph. +

+Description of arguments
+

+ + 
+  
See also:
+

Example:

+$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));

$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(); +
+

+

+

 

GanttGraph ::
SetDateRange($aStart, $aEnd)
+ +Specify date range for Gantt chart.

+ + + + + + +
ArgumentDefaultDescription
+$aStart + + + Start date
+$aEnd + + + End date
+ +

Description:
Specify the date range for Gantt graphs. If this is not set it will be automtically determined from the input data. +

+All gantt chart objects, like bar activities, will be clipped to the spcified date range should they happen to be wider then the specified range. +

+The date is specified as a normal date string according to the chosen locale. + 
+ +

Example:

+$graph->SetDateRange('2001-11-22','2002-1-24');
+
+

+

+

 

GanttGraph ::
SetLabelVMarginFactor($aVal)
+ +Set margin vertical factor.

+ + + + +
ArgumentDefaultDescription
+$aVal + + + Margin factor
+ +

Description:
Specify the fraction of the font height that should be added as vertical margin between the labels. 
+ +

Example:

+$ganttgraph->SetLabelVMarginFactor(0.7); + +

+

+

 

GanttGraph ::
SetSimpleFont($aFont, $aSize)
+ +Specify font for simplified Gantt graph

+ + + + + + +
ArgumentDefaultDescription
+$aFont + + + Font family
+$aSize + + + Font size
+ +

Description:
Specify font for simplified Gantt graph constructed with CreateSimple 
+  
See also:
+

Example:

+$ganttgraph->SetSimpleFont(FF_FONT2); + +

+

+

 

GanttGraph ::
SetSimpleStyle($aBand, $aColor, $aBkgColor)
+ +Specify style parameters for graphs constructed with CreateSimple

+ + + + + + + + +
ArgumentDefaultDescription
+$aBand + + + Patern style
+$aColor + + + Pattern color
+$aBkgColor + + + Pattern background color
+ +

Description:
Specify looks for bars in Gantt graph when the gantt chart is created with CreateSimple. +

+The pattern style can be one of + +

    +
  1. GANTT_RDIAG, Right diagonal lines +
  2. GANTT_LDIAG, Left diagonal lines +
  3. GANTT_SOLID, Solid one color +
  4. GANTT_LVERT, Vertical lines +
  5. GANTT_LHOR, Horizontal lines +
  6. GANTT_VLINE, Vertical lines +
  7. GANTT_HLINE, Horizontal lines +
  8. GANTT_3DPLANE, A 3D plane +
  9. GANTT_HVCROSS, Crosses +
  10. GANTT_DIAGCROSS, Diagonal crosses +

+  
See also:
+

Example:

+$ganttgraph->SetSimpleStyle(GANTT_SOLID,'orange','orange'); + +

+

+

 

GanttGraph ::
SetVMarginFactor($aVal)
+ +Specify the margin factor for lines in the gantt graph

+ + + + +
ArgumentDefaultDescription
+$aVal + + + Vertical margin factor
+ +

Description:
Specify the margin factor for lines in the Gantt graph. A factor of 1 makes each line take just as much space as it needs. A factor of 1.5 makes it 1.5 linmes apart and a factor of 2 makes it double-line spacing and so on. +

+Hint: When using icon in titles it is usually a good idea to use a margin factor > 1 + 
+  

See also:
+

Example:

+$graph->SetVMarginFactor(2); + +

+

+

 

GanttGraph ::
SetZoomFactor($aZoom)
+ +// Set user specified scale zoom factor when auto sizing is used

+ + + + +
ArgumentDefaultDescription
+$aZoom + + + No description available
+ +

Description:
No description available.

+

 

GanttGraph ::
ShowHeaders($aFlg)
+ +Determine what headers/scales to display.

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + Logic OR of flags to specify what headers should be displayed.
+ +

Description:
Specify what headers should be displayed on the Gantt charts. Possible headers are: + +To specify multiple header you just bitwise OR the wanted number of headers together. + 
+ +

Example:

+// Show all headers
$graph->ShowHeaders(GANTT_HYEAR GANTT_HMONTH GANTT_HDAY GANTT_HWEEK); +
+

+

+

 

GanttGraph ::
Stroke($aStrokeFileName)
+ +Internal. Stroke the gantt chart.

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +Filename to stroke image to
+ +

Description:
Internal. Stroke the gantt chart. If a filename is specified then the graph will be stroked to that file and will not be sent back to the browser. +

+This should as usual be the last method called in your script. + 
+  

See also:
+

Example:

+$ganttgraph->Stroke();
+
+

+

+

 

GanttGraph ::
StrokeTexts()
+ +

+
+ +

Description:
No description available.

+

 

GanttGraph ::
__construct($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline)
+ +Create a new GanttGraph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aWidth + + + +0 + +Width of graph
+$aHeight + + + +0 + +Height of graph
+$aCachedName + + + +"" + +Filename to use if cache is enables
+$aTimeOut + + + +0 + +Timeout in minutes
+$aInline + + + +true + +True=Stream back to browser
+ +

Description:
Construct a new GanttGraph. This differs slightly from the standard Graph or PlotGraph in that you are not required to specify width and height of the graph. Instead these can be left out and will be automatically be determined. +

+As a further refinement you can just specify width and have the height be automtically determined. + 
+  

See also:
+

Example:

+// Setup Gantt graph
$graph = new GanttGraph();
$graph->SetShadow();
$graph->SetBox();

// Only show part of the Gantt
$graph->SetDateRange('2001-11-22','2002-1-24');
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GanttPlotObject.html b/includes/jpgraph/docs/classref/GanttPlotObject.html new file mode 100644 index 0000000..b271ecc --- /dev/null +++ b/includes/jpgraph/docs/classref/GanttPlotObject.html @@ -0,0 +1,199 @@ +


Class GanttPlotObject
+(Defined in: jpgraph_gantt.php : 2987)
 
 GanttPlotObject 
 SetCaptionMargin() 
SetConstrain() 
SetCSIMAlt() 
SetCSIMTarget() 
SetLabelLeftMargin() 
+
 

Class usage and Overview
Abstract base class to hold common properties for all objects that are drawn on the Gantt plot like activity bars, milestones, vertical markers. +

+Internal method that can't be instantiated directly. Used to capture the common properties of all objects that can be added to the Ganttgraph, i.e. GanttBar, MileStones GanttVLine. + +

  +

See also related classes:
GanttGraph, GanttBar, GanttVLine and MileStone

 


Class Methods

+

 

GanttPlotObject ::
SetCaptionMargin($aMarg)
+ +Specify margin (in pixels) between object and caption string

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + Margin in pixels
+ +

Description:
Specify margin (in pixels) between object and caption string 
+ +

Example:

+$ms->SetCaptionMargin(20);
+
+

+

+

 

GanttPlotObject ::
SetConstrain($aRow, $aType, $aColor, $aArrowSize, $aArrowType)
+ +Specify a constrain link between this object and another

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + Gantt row where tarhet for constrain is
+$aType + + + Type of constrain
+$aColor + + + +'black' + +Color of constrain
+$aArrowSize + + + +ARROW_S2 + +Size of ending arrow
+$aArrowType + + + +ARROWT_SOLID + +Type of arrow
+ +

Description:
Specify a constrain link between this object and another. The possible constrain types are + +

+The possible arrow sizes are +

+ +

+Type of arrow can be either of +

 
+ +

Example:

+// Add a constrain from the end of this activity to 
// the start of the activity on row 2
$bar->SetConstrain(2,CONSTRAIN_ENDSTART);
+
+

+

+

 

GanttPlotObject ::
SetCSIMAlt($aAlt)
+ +Specify ALT-tag text for hotspot

+ + + + +
ArgumentDefaultDescription
+$aAlt + + + Alt text
+ +

Description:
The ALT text used in conjunction with image map is handled slightly diffrent between different browsers. Most browser show this text if you let the mouse pointer hoover over a hotspot in the image for 1 or 2 seconds. +

+Note: You must have specified a CSIM atrget for this to have any effect. 
+  

See also:
+

Example:

+$bar->SetCSIMAlt('Main activity'); + +

+

+

 

GanttPlotObject ::
SetCSIMTarget($aTarget, $aAlt, $aWinTarget)
+ +Specify URL when object is used in a CSIM

+ + + + + + + + +
ArgumentDefaultDescription
+$aTarget + + + Target URL
+$aAlt + + + +'' + +Alt texts
+$aWinTarget + + + +'' + +No description available
+ +

Description:
Used to specify the target URL for for a hotspot 
+  
See also:
+

Example:

+$bar->SetCSIMTarget('http://localhost/show_details.php'); + +

+

+

 

GanttPlotObject ::
SetLabelLeftMargin($aOff)
+ +Specify offset (in pixels) for the title of this object.

+ + + + +
ArgumentDefaultDescription
+$aOff + + + Offset in pixels
+ +

Description:
Specify offset (in pixels) for the title of this object 
+ +

Example:

+$ms->SetLabelLeftMargin(20);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GanttScale.html b/includes/jpgraph/docs/classref/GanttScale.html new file mode 100644 index 0000000..c3ca4af --- /dev/null +++ b/includes/jpgraph/docs/classref/GanttScale.html @@ -0,0 +1,173 @@ +


Class GanttScale
+(Defined in: jpgraph_gantt.php : 1890)
 
 GanttScale 
 SetDateLocale() 
SetRange() 
SetTableTitleBackground() 
SetVertLayout() 
SetWeekStart() 
UseWeekendBackground() 
+
 

Class usage and Overview
Internal class to represent the scale used for Gantt graphs. + +The scale is accessible as GanttGraph::scale + +The following public available subobjects are available + +

  +

See also related classes:
GanttGraph, HeaderProperty, GanttActivityInfo and TextProperty

 


Class Methods

+

 

GanttScale ::
SetDateLocale($aLocale)
+ +Specify locale to use for scale.

+ + + + +
ArgumentDefaultDescription
+$aLocale + + + String to specify locale
+ +

Description:
Specify locale to use for scale. If no locale is specified then the default locale for the installed system will be used. 
+  
See also:
+

Example:

+$ganttgraph->scale->SetDateLocale('US_en'); + +

+

+

 

GanttScale ::
SetRange($aMin, $aMax)
+ +Specify date range for scale.

+ + + + + + +
ArgumentDefaultDescription
+$aMin + + + Min date
+$aMax + + + Max date
+ +

Description:
Specify scale min and max date either as timestamp or as date strings. Always round to the nearest week boundary 
+ +

Example:

+$ganttgraph->scale->SetRange("2002-11-23""2003-03-31");
+
+

+

+

 

GanttScale ::
SetTableTitleBackground($aColor)
+ +Specify background for the table title area.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify background for the table title area (upper left corner of the table). 
+ +

Example:

+$ganttgraph->scale->SetTableTitleBackground('lightblue'); + +

+

+

 

GanttScale ::
SetVertLayout($aLayout)
+ +Specify the vertical layout fro rows.

+ + + + +
ArgumentDefaultDescription
+$aLayout + + + Vertical layout parameter
+ +

Description:
Should the layout be from top or even. Valid parameters are + + +Note that if you use auto-sizing of the Gantt chart these parameters have little effect since the total height of the image will always be so that all rows fit exactly. + 
+ +

Example:

+$granntgraph->scale->SetVertLayout(GANTT_FROMTOP); + +

+

+

 

GanttScale ::
SetWeekStart($aStartDay)
+ +Specify which weekday should start the week

+ + + + +
ArgumentDefaultDescription
+$aStartDay + + + Weekday, (0-6)
+ +

Description:
Which day should the week start? +0==Sun, 1==Monday, 2==Tuesday etc + +By default weeks start on Mondays. 
+  
See also:
+

Example:

+$granttgraph->SetWeekStart(1); + +

+

+

 

GanttScale ::
UseWeekendBackground($aShow)
+ +Determine if the background color for weekends in the scale should extend down in the plot area.

+ + + + +
ArgumentDefaultDescription
+$aShow + + + True=Use the weekend background color in the ganttgraph
+ +

Description:
Determine if the background color for weekends in the scale should extend down in the plot area. 
+ +

Example:

+$ganttgraph->scale->USeWeekendBackground();
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GanttVLine.html b/includes/jpgraph/docs/classref/GanttVLine.html new file mode 100644 index 0000000..29d79f0 --- /dev/null +++ b/includes/jpgraph/docs/classref/GanttVLine.html @@ -0,0 +1,145 @@ +


Class GanttVLine Extends GanttPlotObject
+(Defined in: jpgraph_gantt.php : 3567)
 
 GanttVLine  GanttPlotObject 
 SetDayOffset() 
SetTitleMargin() 
SetWeight() 
__construct() 
+
 SetCaptionMargin() 
SetConstrain() 
SetCSIMAlt() 
SetCSIMTarget() 
SetLabelLeftMargin() 
+
 

Class usage and Overview
This class represents a vertical line on the gantt scale. It can for example be used to illustrate the boundaries between different phases in a project plan. + +To access the title property just use the 'title' property of the line, for example + +$line = new GantVLine(.....); +$line->title->SetFont(FF_FONT1, FS_BOLD); + +$ganttgraph->Add($line); +

  +

See also related classes:
GanttGraph, GanttBar and MileStone

 


Class Methods

+

 

GanttVLine ::
SetDayOffset($aOff)
+ +Specify where in the single day the line sould be drawn.

+ + + + +
ArgumentDefaultDescription
+$aOff + + + +0.5 + +Fraction of day (0,1)
+ +

Description:
Specify where in the single day the line sould be drawn.  
+ +

Example:

+// Draw line in the middle of the day
$line->SetDayOffset(0.5); +
+

+

+

 

GanttVLine ::
SetTitleMargin($aMarg)
+ +Set distance between end of line and title.

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + Margin in pixels
+ +

Description:
Set distance between end of line and title. 
+ +

Example:

+$line->SetTitleMargin(20); + +

+

+

 

GanttVLine ::
SetWeight($aWeight)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + No description available
+ +

Description:
No description available.

+

 

GanttVLine ::
__construct($aDate, $aTitle, $aColor, $aWeight, $aStyle)
+ +Create a new vertical line in the Gantt graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aDate + + + Date where the line should be
+$aTitle + + + +"" + +Title of line
+$aColor + + + +"darkred" + +Color for line
+$aWeight + + + +2 + +Line weight
+$aStyle + + + +"solid" + +Line style (dotted, slashed etc)
+ +

Description:
Create a new verticla line according to specification that later on can be added to the gantt graph vis its Add() method. 
+  
See also:
+

Example:

+$line = new GanttVLine('2002-11-02','System test starts','darkblue',2,'solid');

$granttgraph->Add($line);

+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Graph.html b/includes/jpgraph/docs/classref/Graph.html new file mode 100644 index 0000000..1432e17 --- /dev/null +++ b/includes/jpgraph/docs/classref/Graph.html @@ -0,0 +1,2132 @@ +


Class Graph
+(Defined in: jpgraph.php : 491)
 
 Graph 
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview
The Graph class is the main container class for all x,y-axis based plots which controls the creation of the entire graph. You must always instantiate one instance to create a graph. Through this class one controls many overall settings of the image displayed. +

+Please note that to create Pie, Gantt, Canvas and Spider charts you have to use their respective creation classes. +

+Public properties: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
xaxisAxisX-axis
yaxisAxisY-axis
xgridGridGrid lines for X-axis
ygridGridGrid lines for Y-axis
legendLegendProperties for legend box
titleTextGraph main title
subtitleTextSub title
subsubtitleTextSub title
tabtitleGraphTabTitleOption Tab title for graph
imgRotImageThe image canvas
+

  +

See also related classes:
Axis, Grid, Text and Image

 


Class Methods

+

 

Graph ::
Add($aPlot)
+ +Add any plot object to the graph

+ + + + +
ArgumentDefaultDescription
+$aPlot + + + No description available
+ +

Description:
Each plot that should be displayed within the graph has to be added to the graph. This is the main method to add object. You can use this method to add + + +This method will add a plopt for use with the ?Left? Y-scale, (the normal Y scale). To add a plot to the second Y scale you should use AddY2(). +

+Note that since the plot is added as a reference any changes you make to the original plot will also happen to the plot you have added to the graph. +

+Add() will always add plots to the first Y-scale. If you are using two Y-axis then you must use AddY2() to add plots to the second Y-scale. + 
+  

See also:
+

Example:

+$graph = new Graph(300,200,"auto");    
$graph->img->SetMargin(40,30,20,40);
$graph->SetScale("textlin");
$graph->SetShadow();

// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$graph->Add($bplot);

// Display the graph
$graph->Stroke();
+
+

+

+

 

Graph ::
AddBand($aBand, $aToY2)
+ +Add vertical or horizontal band

+ + + + + + +
ArgumentDefaultDescription
+$aBand + + + No description available
+$aToY2 + + + +false + +Add object to Y2 axis
+ +

Description:
A plot may have one or several filled horizontal or vertical "bands" to emphasise certain scale areas. +

+Each band is an instance of the PlotBand class. For types of plot band see the documentation of class PlotBand +

+Note: You can alos use the standard method Add() to add bands. 
+  

See also:
+

Example:

+$graph->AddBand(new PlotBand(HORIZONTAL,BAND_RDIAG,0"max""red"2)); + +

+

+

 

Graph ::
AddLine($aLine, $aToY2)
+ +Add a line object (class PlotLine) to the graph

+ + + + + + +
ArgumentDefaultDescription
+$aLine + + + No description available
+$aToY2 + + + +false + +Add line to Y2 axis
+ +

Description:
Add a vertical or horizontal line to the graph. The line will extend over the entire length of the plot. The plot object is an instance of the PlotLine class +

+Note: You can alos use the standard method Add() to add lines. 
+  

See also:
+

Example:

+// Add mark graph with static lines
$graph->AddLine(new PlotLine(HORIZONTAL,0,"black",2));
$graph->AddLine(new PlotLine(VERTICAL,3,"black",2)); +
+

+

+

 

Graph ::
AddText($aTxt, $aToY2)
+ +Add text object to the graph

+ + + + + + +
ArgumentDefaultDescription
+$aTxt + + + No description available
+$aToY2 + + + +false + +Add text to Y2 axis
+ +

Description:
Adds an instance of the Text class to the graph, allowing arbitrary text to be placed anywhere in the graph. +

+Note: You can alos use the standard method Add() to add bands. + 
+  

See also:
+

Example:

+// You can specify the position as fraction of the
// image width and height
$caption=new Text(?Figure 1. Temperature over time?,0.1,0.8);
$caption->SetFont(FONT1_BOLD);
$graph->AddText($caption);
+
+

+

+

 

Graph ::
AddY($aN, $aPlot)
+ +Add plot to second Y-axis n

+ + + + + + +
ArgumentDefaultDescription
+$aN + + + Number of axis to add data to
+$aPlot + + + No description available
+ +

Description:
This method is used to add a plot in the case the graph has multiple Y-axis. The first argument should be the index of the Y-axis. 
+ +

Example:

+<?php
include ("../jpgraph.php");
include (
"../jpgraph_line.php");

$datay = array(5,3,7,2);
$datay2 = array(88,10,55,42);
$datay3 = array(255,35,745,244);
$datay4 = array(130,97,68,119);

// Setup the graph
$graph = new Graph(600,250);
$graph->SetMargin(30,200,20,20);
$graph->SetMarginColor('white');
$graph->SetColor('lightgray');

$graph->SetScale("intlin");

$graph->SetYScale(0,"lin");
$graph->SetYScale(1,"lin");
$graph->SetYScale(2,"lin");

$p1 = new LinePlot($datay);
$p1->SetColor('blue');
$graph->Add($p1);

$p2 = new LinePlot($datay2);
$p2->SetColor('darkred');
$graph->AddY(0,$p2);
$graph->ynaxis[0]->SetColor('darkred');

$p3 = new LinePlot($datay3);
$p3->SetColor('red');
$graph->AddY(1,$p3);
$graph->ynaxis[1]->SetColor('red');

$p4 = new LinePlot($datay4);
$p4->SetColor('blue');
$graph->AddY(2,$p4);
$graph->ynaxis[2]->SetColor('blue');

// Output line
$graph->Stroke();


+

+

+

 

Graph ::
AddY2($aPlot)
+ +Add plot to second Y-axis

+ + + + +
ArgumentDefaultDescription
+$aPlot + + + No description available
+ +

Description:
Works the same way as Add() but the plot is added for use with the Y2 scale (the right Y scale) instead. 
+  
See also:
+

Example:

+$graph = new Graph(300,200);
$graph->SetScale('linlin');
$graph->SetY2Scale('linlog');
$lineplot = new LinePlot($datay);
$graph->AddY2($lineplot); +
+

+

+

 

Graph ::
CheckCSIMCache($aCacheName, $aTimeOut)
+ +Check if cached CSIM graph exists

+ + + + + + +
ArgumentDefaultDescription
+$aCacheName + + + Cache file name
+$aTimeOut + + + +60 + +Timeout (in minutes)
+ +

Description:
This method is used to enable caching for graphs that use image maps (CSIM). It should be called as the first method after the creation of the Graph(). If the cached image and image map exists this will be directly sent back to the browser and script execution will stop. +

+This specifically means that no lines of code after this method will be executed in case the image/map is found in the cache. + 
+  

See also:
+

Example:

+$graph Graph(300,200);
$graph->CheckCSIMCache('myimage01',10);

// .. Lopt of code to create the image

$graph->StrokeCSIM();
+
+

+

+

 

Graph ::
GetCSIMImgHTML($aCSIMName, $aScriptName, $aBorder)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aCSIMName + + + No description available
+$aScriptName + + + +'auto' + +No description available
+$aBorder + + + +0 + +No description available
+ +

Description:
No description available.

+

 

Graph ::
GetHTMLImageMap($aMapName)
+ +Get a complete .. tag for the final image map

+ + + + +
ArgumentDefaultDescription
+$aMapName + + + Image map name
+ +

Description:
When you are using image maps for a plot then this routine is called in your script to get the resulting image map as a string for the graph. The image map is given the name specified as the first argument to the method. +

+Please note that due to the way client side image maps work you need to have both the image map and the image available in the script that is sent back to the browser. Since you can't do this at the same time you will have to create an image to disk and read the image map. The you have to stream the HTML page with an tag to load the previously generated image as well as the image map. + 
+ +

Example:

+// The image must be stroked to find out the image maps
$graph->Stroke($myfile);

// Then read the image map
$imagemap $graph->GetHTMLImageMap('MainMap');

echo 
$imagemap;
echo 
"<img src=$myfile>";
+
+

+

+

 

Graph ::
Set3DPerspective($aDir, $aHorizon, $aSkewDist, $aQuality, $aFillColor, $aBorder, $aMinSize, $aHorizonPos)
+ +Enable image perspective transformation

+ + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aDir + + + +1 + +Direction for 3D perspective
+$aHorizon + + + +100 + +Distance (in pixels) from the bottom of the image to the horizon
+$aSkewDist + + + +120 + +Skew distance (in pixels) on the horizon
+$aQuality + + + +false + +Boolean. High quality =
+$aFillColor + + + +'#FFFFFF' + +What fill color to use
+$aBorder + + + +false + +Boolean. Border around?
+$aMinSize + + + +true + +Boolean. Make the transformed image canvas as small as possible
+$aHorizonPos + + + +0.5 + +Distance from left on the horizon for the point of focus
+ +

Description:
Enable final image perspective transformation before sending the image back to the browser. This makes a "skewing" tansformation of the image to emulate a 3D depth. + +

+Allowed argument for $aDir are +

    +
  1. 'SKEW3D_UP' +
  2. 'SKEW3D_DOWN' +
  3. 'SKEW3D_LEFT' +
  4. 'SKEW3D_RIGHT' +
+ +$aHorizon Determines how far away the horizon are from the bottom of the picture (in pixels) +

+aSkewDist How far to the right on the horizon is the +"skewing point", a large value gives a very strong for-shortening. +

+aQuality Use high quality (takes longer time) TRUE or FALSE +

+aFIllColor Fill background color in the image on places where the original image no longer cover the entire canvas. +

+aBorder Border around or not +

+aMinSize Just make the image as large as it has to be. TRUE or FALSE. If this argument is set to false then the original image size will be preserved. +

+aHorizonPosHow far, in fraction, should the point of focus be from the left edge of the image. 
+ +

Example:

+$graph->Set3DPerspective(SKEW3D_UP,100,120,true); + +

+

+

 

Graph ::
Set90AndMargin($lm, $rm, $tm, $bm)
+ +Rotate the graph 90 degrees and set the margins

+ + + + + + + + + + +
ArgumentDefaultDescription
+$lm + + + +0 + +Left margin
+$rm + + + +0 + +Right Margin
+$tm + + + +0 + +Top margin
+$bm + + + +0 + +Bottom margin
+ +

Description:
Rotates the graph 90 degrees and sets the margin as specified. +

+Remember that when rotating the graph it might be a good idea to adjust the axis so that the alignment of the labels for x and Y axis. For example by setting them as: + +

+$graph->xaxis->SetLabelAlign('right','center','right'); +
+$graph->yaxis->SetLabelAlign('center','bottom'); +

+Note: This is slightly different from using SetAngle() and SetMargin() in that this method automatically adjusts the margin so that width becomes height and vice versa due to the rotation. + + + 
+  

See also:
+

Example:

+$graph = new Graph(300,200,"auto");
$graph->SetScale('linlin');

$graph->Set90AndMargin(40,40,40,40);        
$graph->SetShadow();

$graph->title->Set("A 90 degrees rotated scatter plot");
$graph->title->SetFont(FF_FONT1,FS_BOLD);

// Adjust the label align for X-axis so they look good rotated
$graph->xaxis->SetLabelAlign('right','center','right');

// Adjust the label align for Y-axis so they look good rotated
$graph->yaxis->SetLabelAlign('center','bottom');

$sp1 = new ScatterPlot($datay,$datax);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(5);

$graph->Add($sp1);
$graph->Stroke();
+
+

+

+

 

Graph ::
SetAlphaBlending($aFlg)
+ +Eanble/disable alpha blending

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +TRUE=Enable alpha blending
+ +

Description:
Enable disable alpha blending. The transparency factor is specified in the color as transparency fraction. For example, to specify a red color which is 50% transparent you specify this as: +

+"red@0.5" (or "#FF0000@0.5") +

+can then use this color specification in all places where the color may be specified. If the alpha blending is not active then the alpha parameter will have no effect. +

+Note that the use of alpha blending requires GD 2.01 or higher. By default alpha blending is enabled. + 
+ +

Example:

+$graph->SetAlphaBlending(); + +

+

+

 

Graph ::
SetAngle($aAngle)
+ +Specify graph angle 0-360 degrees.

+ + + + +
ArgumentDefaultDescription
+$aAngle + + + Rotation angle for graph
+ +

Description:
The graph can be rotated an arbitrary number of degrees. This will allow you to easily create, for example, horizontal bar graphs by rotating a normal bar graph 90 degrees. +

+See horizbarex1.php for a real life example. +

+Note: If you want a 90 degrees rotated graph consider using Graph::Set90AndMargin() which greatly simplifies this with just one call + 
+  

See also:
+

Example:

+$graph = new Graph(300,200);
$graph->SetScale('textlin');
$graph->SetAngle(90); +
+

+

+

 

Graph ::
SetAxisLabelBackground($aType, $aXFColor, $aXColor, $aYFColor, $aYColor)
+ +// Finally stream the generated picture

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+$aXFColor + + + +'lightgray' + +No description available
+$aXColor + + + +'black' + +No description available
+$aYFColor + + + +'lightgray' + +No description available
+$aYColor + + + +'black' + +No description available
+ +

Description:
No description available.

+

 

Graph ::
SetAxisStyle($aStyle)
+ +Specify axis style (boxed or single)

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + Style of axis
+ +

Description:
The most common type of axis is two axis which crosses at a specified point. However for scientific plot it is often common to want to mirror the axis (and the scale) around the plot area. +This method controls which type to use + + + +See funcex1.php, funcex2.php and funcex3.php for real life examples. 
+ +

Example:

+$graph->SetAxisStyle(AXSTYLE_BOXIN);
+
+

+

+

 

Graph ::
SetBackgroundCFlag($aName, $aBgType, $aMix)
+ +Set a country flag in the background

+ + + + + + + + +
ArgumentDefaultDescription
+$aName + + + Index or (partial) name of Country
+$aBgType + + + +BGIMG_FILLPLOT + +Background fill type
+$aMix + + + +100 + +Mix percentage
+ +

Description:
[Synonym for SetBackgroundCountryFlag() ) +Set a country flag in the background. All supported countries can be specified by either +
    +
  1. Numeric index, (0-238) +
  2. Full or partial name, e.g. "norway" +
  3. The unique string index for the country +
+ +For a list of all available flags please run the file "listallflags.php" in the Example directory. +

+The final arcgument "aMix" is a value between 0-100 and specifies the blend factor for the flag. 
+

+

 

Graph ::
SetBackgroundCountryFlag($aName, $aBgType, $aMix)
+ +Set a country flag in the graph background

+ + + + + + + + +
ArgumentDefaultDescription
+$aName + + + Full or partial country name
+$aBgType + + + +BGIMG_FILLPLOT + +Normal background fill type
+$aMix + + + +100 + +Mix fraction
+ +

Description:
Set a country flag in the background. All supported countries can be specified by either +
    +
  1. Numeric index, (0-238) +
  2. Full or partial name, e.g. "norway" +
  3. The unique string index for the country +
+ +For a list of all available flags please run the file "listallflags.php" in the Example directory. +

+The final arcgument "aMix" is a value between 0-100 and specifies the blend factor for the flag. + 
+

+

 

Graph ::
SetBackgroundGradient($aFrom, $aTo, $aGradType, $aStyle)
+ +Set a color gradient as the background

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aFrom + + + +'navy' + +Color 1
+$aTo + + + +'silver' + +Color 2
+$aGradType + + + +2 + +Gradient type
+$aStyle + + + +BGRAD_FRAME + +Gardient layout style
+ +

Description:
This method allows you to specify a color gradient as the background of the graph. The color gradient can either fill the entire graph, just the plopt area or just the margin. This is specified by the $aStyle argument by specifyin one of the following values: + + +The gradient type can be one of + + +Note: In order for the gradient to be visible the Frame must be enabled, i.e. graph->ShowFrame(false) will hide the gradient. If you like to hide the frame around the entire graph set the color to the margin color or set the weight of the frame line to 0. + 
+  
See also:
+

Example:

+$graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_MARGIN); + +

+

+

 

Graph ::
SetBackgroundImage($aFileName, $aBgType, $aImgFormat)
+ +Specify a background image fro the plot

+ + + + + + + + +
ArgumentDefaultDescription
+$aFileName + + + Filename for background image
+$aBgType + + + +BGIMG_FILLPLOT + +Style of background image
+$aImgFormat + + + +'auto' + +Image format ("jpeg", "gif", "png")
+ +

Description:
A graph may have a background image. The image is loaded from a specified file and may be of type GIF, JPG or PNG. The image type may also be specified as "auto", in this case the image format is determined by the file ending. +

+The positioning and sizing of the background image can be controlled by the $aBgType parameter. Possible values are +

+ +If you want ot use a background image on a canvas graph you must be carefull. Since canvas graph use no buffering, i.e everythng is written directly in the order you specify the commands. For canvas graph the background image get's stroked when you call the Initframe() method. +SO, this call should eb among the very first. Every graph object after that will be stroked on top of the specified background image. + + 
+  
See also:
+

Example:

+// 
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);

// If you use a canvas graph, and only canvas graphs,
// you must manually call the InitFrame() method.
$graph->InitFrame(); +
+

+

+

 

Graph ::
SetBackgroundImageMix($aMix)
+ +Specifes what how much the background image should be blendid in with the background

+ + + + +
ArgumentDefaultDescription
+$aMix + + + Mix value (0-100)
+ +

Description:
Specifes what how much the background image should be blendid in with the background. 
+

+

 

Graph ::
SetBackgroundImagePos($aXpos, $aYpos)
+ +// Adjust background image position

+ + + + + + +
ArgumentDefaultDescription
+$aXpos + + + No description available
+$aYpos + + + No description available
+ +

Description:
No description available.

+

 

Graph ::
SetBox($aDrawPlotFrame, $aPlotFrameColor, $aPlotFrameWeight)
+ +Set a frame around the plot area

+ + + + + + + + +
ArgumentDefaultDescription
+$aDrawPlotFrame + + + +true + +True=Draw the frame
+$aPlotFrameColor + + + +array(0,0,0) + +Frame color
+$aPlotFrameWeight + + + +1 + +Width fo frame line
+ +

Description:
This is used to specify whether the plot-area should have a rectangle around it and the specifics of that rectangle. 
+  
See also:
+

Example:

+$graph = new Graph(300,200);
$graph->SetScale('linlin');
$graph->Box();
+
+

+

+

 

Graph ::
SetClipping($aFlg)
+ +Enable clipping of graph outside the plotarea

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +Enable/disbale clipping
+ +

Description:
Enable or disable clipping outside the plot area. If clipping is enabled then only the part of the graph exactly inside the plot area will be visible. +

+Clipping may come in handy when you for example set a manual scale and have data points outside the specified range. +

+By default clipping is disabled. +

+Note 1: Clipping is only supported for graphs at 0 or 90 degrees rotation and will generate an error message if enabled together with any other angle. +

+Note 2: The clipping is implemented with a O(1) algorithm in terns of data size. + 
+ +

Example:

+$graph->SetClipping(); + +

+

+

 

Graph ::
SetColor($aColor)
+ +Specify color for the plotarea (not the margins)

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify color for the plotarea (not the margins) 
+  
See also:
+

Example:

+$graph->SetColor(?wheat?); + +

+

+

 

Graph ::
SetCSIMImgAlt($aAlt)
+ +Set the Alt text used for the IMG tag generated for CSIM

+ + + + +
ArgumentDefaultDescription
+$aAlt + + + Alt text
+ +

Description:
Set the ALt text used for the IMG tag generated for CSIM. Whne calling StrokeCSIM() a HTML page will be returned witha recusrive call to teh same script in an IMG tag. This method allows you to specify the Alt text to be used in the returned HTML page. 
+  
See also:
+

Example:

+$graph->SetCSIMImgAlt('Yearly values');
$graph->StrokeCSIM();
+
+

+

+

 

Graph ::
SetFrame($aDrawImgFrame, $aImgFrameColor, $aImgFrameWeight)
+ +Set a frame around the entire image

+ + + + + + + + +
ArgumentDefaultDescription
+$aDrawImgFrame + + + +true + +True=Draw a frame around the entire image
+$aImgFrameColor + + + +array(0,0,0) + +Frame color
+$aImgFrameWeight + + + +1 + +Width of frame
+ +

Description:
Sets a frame (rectangle) of the chosen color around the edges of the image. + +Note: For implementation reasons the frame must be enabled in order to for a specified gradient background to show up. + 
+  
See also:
+

Example:

+$graph->SetFrame(true,'darkblue',2); + +

+

+

 

Graph ::
SetFrameBevel($aDepth, $aBorder, $aBorderColor, $aColor1, $aColor2, $aFlg)
+ +Specify a abevel frame around the entire graph

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aDepth + + + +3 + +Depth (Height) in pixels for bevel
+$aBorder + + + +false + +True=Add 1 pixel border around
+$aBorderColor + + + +'black' + +Border color
+$aColor1 + + + +'white@0.4' + +Right and bottom shadow
+$aColor2 + + + +'darkgray@0.4' + +Left and top shadow
+$aFlg + + + +true + +True=Show bevel frame
+ +

Description:
Specify a a bevel frame around the entire graph. A Bevel frame will give the entire graph a "3D" uprised feel. 
+ +

Example:

+$graph->SetFrameBevel(2,true,'black'); + +

+

+

 

Graph ::
SetGridDepth($aDepth)
+ +Should the grid be in front or back of the plot?

+ + + + +
ArgumentDefaultDescription
+$aDepth + + + Grid depth
+ +

Description:
Specify if the grid in the plot should be drawn under or on top of the actual plots. +

+Valid values for grid depth are +

+

+The default is to draw the grid lines under the plots. 
+ +

Example:

+$graph->SetGridDepth(DEPTH_FRONT);
+
+

+

+

 

Graph ::
SetIconDepth($aDepth)
+ +Determine if Icons should be under or over the plot

+ + + + +
ArgumentDefaultDescription
+$aDepth + + + Depth of icons (see description)
+ +

Description:
Determine if Icons should be under or over the plot. The argument is one of + + +By default the icons are drawn under the plots 
+ +

Example:

+// Put the icons in front of the plot
$graph->SetIconDepth(DEPTH_FRONT); +
+

+

+

 

Graph ::
SetImgFormat($aFormat, $aQuality)
+ +Set Image format and optional quality

+ + + + + + +
ArgumentDefaultDescription
+$aFormat + + + Format (see description)
+$aQuality + + + +75 + +Quality parameter for JPEG
+ +

Description:
Specify what image format the generated image should use. By default the library will try to create PNG images and if the PNG libraries are not available then it will try to use foirst JPEG and finally GIF encoding. +

+The image format is specified as a string that can be one of +

+ +The PNG format gives in general best compression for ordinary data plots and is also a looseless format. +

+If the graph has complicated background images or 100s of colors then there is a good chance that JPEG will give better compression on the expense of image quality. +

+The quality parameter is a value between (0,100) inclusively. = gives best compression but worst quality and 100 give the best quality. Suitable ranges is 60-90. + 
+ +

Example:

+// Set JPEG format with 60% quality
$graph->SetImgFormat('jpeg',60); +
+

+

+

 

Graph ::
SetMargin($lm, $rm, $tm, $bm)
+ +Specify side margins for graph

+ + + + + + + + + + +
ArgumentDefaultDescription
+$lm + + + Left margin (in pixels)
+$rm + + + Right margin (in pixels)
+$tm + + + Top margin (in pixels)
+$bm + + + Bottom margin (in pixels)
+ +

Description:
Specify the margin around the actual plot area. This is actually just a shortcut for the Image::SetMargin() +

+Note: If you want to set the margin for a 90 degrees rotated graph please consider using Graph::Set90AndMargin() instead since this will automatically adjust for the rotated image and the swapped meaning of width and height. + 
+  

See also:
+

Example:

+$graph->SetMargin(40,20,60,20); + +

+

+

 

Graph ::
SetMarginColor($aColor)
+ +Specify color for the margins (all areas outside the plotarea)

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specifies the color of the area between the plot area and the edge of the image. 
+  
See also:
+

Example:

+$graph->SetMarginColor('silver'); + +

+

+

 

Graph ::
SetScale($aAxisType, $aYMin, $aYMax, $aXMin, $aXMax)
+ +Specify scale to use for X and Y axis

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aAxisType + + + Type of axis
+$aYMin + + + +1 + +Y-min
+$aYMax + + + +1 + +Y-max
+$aXMin + + + +1 + +X-min
+$aXMax + + + +1 + +X-max
+ +

Description:
Specifies what kind of scales should be used in the graph. The following combinations are allowed + + + +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. It is also used when you need to have text labesl you specify (via $graph->xaxis->SetTickLabels($labels) ). +

+To specify which combination of X and Y scales you want to use the $axtype parameter is specified. In this parameter you specify, by a text string, the type of scale you want to use for both X and Y scale. +

+Possible values for each axis are:
+X: 'lin', 'text', 'log', 'int'
+Y: 'lin', 'log', 'int'
+

+Example of possible combination:
+

+It is normally recommended to use the auto-scaling feature since for most practical purposes it is good enough. However on rare occasions you might want to specify the limits yourself. This is then done by the rest of the parameters to the method. +

+Note: If you want to use a logarithmic scale you must make sure that the ?jpgraph_log.php? is included. +

+Note1: +Note that if you manually specify the scale you can also specify the tick distance with a call to Ticks::Set(). For example $graph->yaxis->scale->ticks->Set(10,5) If yiou don't ste it manually a suitable tick distance will be automatically choosen. + +Note2: +If you want to keep the autoscaling for Y-axis but specify the X-axis then just call the method with both min and max set to 0 (e.g. SetScale('linlin',0,0,0,50); ) + + 
+ +

Example:

+//----------------------
// EXAMPLE1: Using autoscaling
$graph->SetScale('textlin');

//----------------------
// EXAMPLE2: Using manual scale for Y-scale and only major ticks
$graph->SetScale('linlin',5,75);
$graph->yaxis->scale->ticks->Set(10); // Set major and minor tick to 10

//----------------------
// EXAMPLE3: Using manual scale for Y-scale 
$graph->SetScale('linlin',5,200);
// Set major tick dist to 40 and minor to 20 
$graph->yaxis->scale->ticks->Set(40,20); 

//----------------------
// EXAMPLE4: Using manual scale for both X and Y-scale 
$graph->SetScale('linlin',5,200,0,100);
// Set major tick dist to 40 and minor to 20 
$graph->yaxis->scale->ticks->Set(40,20);
// Set major and minor tick dist to 20 
$graph->xaxis->scale->ticks->Set(20); 

// Keeping the Autoscaling for Y-axis but fixing the X
// scale to an integer scale between [0,50]
$graph->SetScale('intlin',0,0,0,50);
+
+

+

+

 

Graph ::
SetShadow($aShowShadow, $aShadowWidth, $aShadowColor)
+ +Add a drop shadow to the image

+ + + + + + + + +
ArgumentDefaultDescription
+$aShowShadow + + + +true + +True=add a drop shadow
+$aShadowWidth + + + +5 + +Width (in pixels of shadow)
+$aShadowColor + + + +array(102,102,102) + +Shadow color
+ +

Description:
Sets a frame with a drop down shadow around the entire image 
+  
See also:
+

Example:

+$graph->SetShadow(); + +

+

+

 

Graph ::
SetTextScaleAbsCenterOff($aOff)
+ +// Text width of bar to be centered in absolute pixels

+ + + + +
ArgumentDefaultDescription
+$aOff + + + No description available
+ +

Description:
No description available.

+

 

Graph ::
SetTickDensity($aYDensity, $aXDensity)
+ +Specify how dense the ticks should be drawn

+ + + + + + +
ArgumentDefaultDescription
+$aYDensity + + + +TICKD_NORMAL + +Y-density
+$aXDensity + + + +TICKD_NORMAL + +X-density
+ +

Description:
This method is used to hint how many ticks the auto-scaling should try to fit on each of the axis. +

+The following DEFINES may be used to hint to the auto-scaling how many ticks should be allocated + +

 
+ +

Example:

+$graph->SetTickDensity(TICKD_DENSE); // Many Y-ticks + +

+

+

 

Graph ::
SetTitleBackground($aBackColor, $aStyle, $aFrameStyle, $aFrameColor, $aFrameWeight, $aBevelHeight, $aEnable)
+ +Specify background style for graph titles

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aBackColor + + + +'gray' + +Background color
+$aStyle + + + +TITLEBKG_STYLE1 + +Background size style, see description
+$aFrameStyle + + + +TITLEBKG_FRAME_NONE + +Frame style, see description
+$aFrameColor + + + +'black' + +Frame color
+$aFrameWeight + + + +1 + +Frame thickness (weight)
+$aBevelHeight + + + +3 + +Bevel height used for frame style bevel
+$aEnable + + + +true + +Enable/disable background
+ +

Description:
Specify background style for graph titles, i.e. the background style for Graph::title, Graph::subtitle, Graph::subsubtitle. The actual background style is specified with the two arguments $aStyle and $aFrameStyle. +

+The first argument $aStyle determines the size the background should cover. The two possibilities are +

+ +The second style parameter specifies what type of frame should be drawn. The weight of the frame is adjustable by specifying the $aFrameweight argument. The possible options for frame styles are: + + +You can further adjust the style of the background fill by the SetTitleBackgroundFillStyle() method. + 
+  
See also:
+

Example:

+$graph->SetTitleBackground('wheat2',TITLEBKG_STYLE1,TITLEBKG_FRAME_BOTTOM); + +

+

+

 

Graph ::
SetTitleBackgroundFillStyle($aStyle, $aColor1, $aColor2)
+ +Adjust the title background fill style

+ + + + + + + + +
ArgumentDefaultDescription
+$aStyle + + + Fill style (see description)
+$aColor1 + + + +'black' + +Color 1
+$aColor2 + + + +'white' + +Color 2
+ +

Description:
The background for the graph titles as set by SetTitleBackground() can be further adjusted with this method. The style can be sepcified as one of +
+ +

Example:

+$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'darkgreen','black'); + +

+

+

 

Graph ::
SetUserFont($aNormal, $aBold, $aItalic, $aBoldIt)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aNormal + + + No description available
+$aBold + + + +'' + +No description available
+$aItalic + + + +'' + +No description available
+$aBoldIt + + + +'' + +No description available
+ +

Description:
No description available.

+

 

Graph ::
SetUserFont1($aNormal, $aBold, $aItalic, $aBoldIt)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aNormal + + + No description available
+$aBold + + + +'' + +No description available
+$aItalic + + + +'' + +No description available
+$aBoldIt + + + +'' + +No description available
+ +

Description:
No description available.

+

 

Graph ::
SetUserFont2($aNormal, $aBold, $aItalic, $aBoldIt)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aNormal + + + No description available
+$aBold + + + +'' + +No description available
+$aItalic + + + +'' + +No description available
+$aBoldIt + + + +'' + +No description available
+ +

Description:
No description available.

+

 

Graph ::
SetUserFont3($aNormal, $aBold, $aItalic, $aBoldIt)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aNormal + + + No description available
+$aBold + + + +'' + +No description available
+$aItalic + + + +'' + +No description available
+$aBoldIt + + + +'' + +No description available
+ +

Description:
No description available.

+

 

Graph ::
SetY2OrderBack($aBack)
+ +Specify that plots on the Y2 axis should be under Y axis plots

+ + + + +
ArgumentDefaultDescription
+$aBack + + + +true + +TRUE=under Y axis, FALSE=above
+ +

Description:
Set the depth for Y2 plots as compare to plots added to the Y axis 
+ +

Example:

+$graph->SetY2OrderBack(); + +

+

+

 

Graph ::
SetY2Scale($aAxisType, $aY2Min, $aY2Max)
+ +Specify secondary Y scale

+ + + + + + + + +
ArgumentDefaultDescription
+$aAxisType + + + +'lin' + +Type of scale
+$aY2Min + + + +1 + +Y2Min value
+$aY2Max + + + +1 + +Y2Max value
+ +

Description:
The graph allows two different Y-scales to be used and you can choose which one you want to use for a specific plot by the way you are adding the plot to the graph, either by Add() or by AddY2() method. +

+This method works in the exact same way for the Y2 axis as the SetScale() method previously described. +

+Allowed values for the $axtype are +

+ +Note: If you want to use a logarithmic scale you must make sure that the ?jpgraph_log.php? is included. + 
+  
See also:
+

Example:

+// Left Y scale linear and right Y-scale logarithmic
$graph = new Graph(300,200);
$graph->SetScale(?textlin?);
$graph->SetY2Scale(?log?); +
+

+

+

 

Graph ::
SetYDeltaDist($aDist)
+ +Set the delta position (in pixels) between the multiple Y-axis

+ + + + +
ArgumentDefaultDescription
+$aDist + + + Distance in pixels
+ +

Description:
Set the delta position (in pixels) between the multiple Y-axis 
+

+

 

Graph ::
SetYScale($aN, $aAxisType, $aYMin, $aYMax)
+ +Specify scale for additional Y-axis

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aN + + + Index of axis
+$aAxisType + + + +"lin" + +Scale type of axis
+$aYMin + + + +1 + +Optional min scale value
+$aYMax + + + +1 + +Optional max scale value
+ +

Description:
Specify scale for additional Y-axis 
+ +

Example:

+<?php
include ("../jpgraph.php");
include (
"../jpgraph_line.php");

$datay = array(5,3,7,2);
$datay2 = array(88,10,55,42);
$datay3 = array(255,35,745,244);
$datay4 = array(130,97,68,119);

// Setup the graph
$graph = new Graph(600,250);
$graph->SetMargin(30,200,20,20);
$graph->SetMarginColor('white');
$graph->SetColor('lightgray');

$graph->SetScale("intlin");

$graph->SetYScale(0,"lin");
$graph->SetYScale(1,"lin");
$graph->SetYScale(2,"lin");

$p1 = new LinePlot($datay);
$p1->SetColor('blue');
$graph->Add($p1);

$p2 = new LinePlot($datay2);
$p2->SetColor('darkred');
$graph->AddY(0,$p2);
$graph->ynaxis[0]->SetColor('darkred');

$p3 = new LinePlot($datay3);
$p3->SetColor('red');
$graph->AddY(1,$p3);
$graph->ynaxis[1]->SetColor('red');

$p4 = new LinePlot($datay4);
$p4->SetColor('blue');
$graph->AddY(2,$p4);
$graph->ynaxis[2]->SetColor('blue');

// Output line
$graph->Stroke();


+

+

+

 

Graph ::
Stroke($aStrokeFileName)
+ +Stroke graph to browser or file

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +'' + +File name* (or special handle, see below)
+ +

Description:
Should be the final method called in the script that generates a graph. This will generate the image and send it back to the browser. +

+If $aStrokeFileName != "" the image will be written to this file and NOT streamed back to the browser +

+If the file name is specified with the define __IMG_HANDLER (Note: Thre are 2 '_' in the beginning) then no image will be streamed to file or browser. Instead the Stroke() method will simply return the image handle used by the GD library. This can come in handy of you like to post manipulate the image or use the raw GD image in other context. Such as in creating dynamic PDF documents. +

+Note: If you want to use the image in a PDF file you can't take the handle directly since this is a GD handle. To use it in PDF you must first create an PDF image by calling pdf_open_memory_image() to get a proper PDF image handle. See example below. + +

+You may also specify the file name as "auto" in which case the filename will be created from the script name but with the extension changed to reflect the choosen image format. + 
+ +

Example:

+// Example 1 : (Normal case) Stream back to browser
$graph->Stroke();

// Example 2 : Stream to the file with absolute file path
$graph->Stroke($fileName);

// Example 3
// Get the image handle. NOTE: No image will be 
// streamed to the browser in this case.
$ih $graph->Stroke(__IMG_HANDLER);

// PDF example
//....
$im $graph->Stroke(_IMG_HANDLER);
$pdf pdf_new();
pdf_open_file($pdf"");

$pimg pdf_open_memory_image($pdf$im);
pdf_begin_page($pdf595842);
pdf_add_outline($pdf"Page 1");
pdf_place_image($pdf$pimg05001); 
pdf_close_image($pdf$pimg); 
pdf_end_page($pdf);
pdf_close($pdf);
$buf pdf_get_buffer($pdf);
$len strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=jpimage.pdf");
echo 
$buf;
pdf_delete($pdf);




+
+

+

+

 

Graph ::
StrokeCSIM($aScriptName, $aCSIMName, $aBorder)
+ +Stroke an image with a CSIM

+ + + + + + + + +
ArgumentDefaultDescription
+$aScriptName + + + +'auto' + +Name of the image generating script
+$aCSIMName + + + +'' + +Image map name
+$aBorder + + + +0 + +Should the image be bordered?
+ +

Description:
To generate an CSIM you must use this method at the end of your script instead of the normal Graph::Stroke() method. This method does not send back an image to the browser but rather a HTML page which contains an image map and a "recursive call" back to the image script. See the full JpGraph manual for a detailed explanation on how this works. +

+Please note that it is abolutely imperative that you specify the image generating scripts name as the first argument. +

+Why that? Because it is impossible for JpGraph to find out the name of the script it is executed from in the case where it is included as oart of a "standard" HTML/PHP page. Using the PHP_SELF will only return the master document and not the actual script name. +

+If you use several image map images on the same HTML page you must also specify unique names of each of the image maps as the second argument for this function. +

+To specify targets for the image maps you must call the individual plots Pot::SetCSIMTargets() +

+Tip: You can easily specify the script name by using the construction +basename(__FILE__) as the first argument 
+  

See also:
+

Example:

+...
$graph->StrokeCSIM(basename(__FILE__));
+
+

+

+

 

Graph ::
StrokeCSIMImage()
+ +// Construct wrapper HTML and write to file and send it back to browser// In the src URL we must replace the '?' with its encoding to prevent the arguments// to be converted to real arguments.

+
+ +

Description:
No description available.

+

 

Graph ::
StrokeFrameBackground()
+ +Stroke the frames background and border

+
+ +

Description:
Semi Internal routine. Exclusively used together with canvas graphs where object are added directly to the canvas and we therefore must make sure that the background is stroked first. + 
+ +

Example:

+e + +

+

+

 

Graph ::
StrokeStore($aStrokeFileName)
+ +// DO Nothing. It gets too messy to do this properly for 90 deg...

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + No description available
+ +

Description:
No description available.

+

 

Graph ::
__construct($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline)
+ +Creates a new graph.

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aWidth + + + +300 + +Width
+$aHeight + + + +200 + +Height
+$aCachedName + + + +'' + +Cache file name
+$aTimeOut + + + +0 + +Timeout value for cache
+$aInline + + + +true + +True=Stream the image back to the browser
+ +

Description:
Creates a new graph. This is often the first call made to set-up a new graph. +
+If the cache name is specified (via the $aCachedname) argument then this method will first try to locate the named file in the cache directory (as specified by the DEFINE in jpgraph.php) rather then generating the graph on the fly. If the file is not there or if it is older then the specified timeout value ($aTimeOut) the graph will be generated and saved as the specified file. +

+If the cache name is specifed as 'auto' then the cache name will be based on the basename of the script with an extension indicating the image format used, i.e. JPG, GIF or PNG. +

+If the specified file is found in the cache directory then it will be streamed back to the browser directly. +

+If no cache name is specified then the graph will always be generated and the cache bypassed. The same is true if the DEFINE 'USE_CACHE' or 'READ_CACHE' is set to false. +

+Before any other operation is performed on the graph a call to SetScale() should be made to finish the initialisation of the graph. + 
+  

See also:
+

Example:

+// Example 1. use cache and automtic create the cache name
$graph = new Graph(400,200,"auto");    
$graph->img->SetMargin(60,20,30,50);
$graph->SetScale("textlin");
$graph->SetMarginColor("silver");
$graph->SetShadow();

// Example 2 . Don't use the cache
$graph = new Graph(400,200);    
$graph->SetScale("textint");
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GraphTabTitle.html b/includes/jpgraph/docs/classref/GraphTabTitle.html new file mode 100644 index 0000000..de77b25 --- /dev/null +++ b/includes/jpgraph/docs/classref/GraphTabTitle.html @@ -0,0 +1,189 @@ +


Class GraphTabTitle Extends Text
+(Defined in: jpgraph.php : 2990)
 
 GraphTabTitle  Text 
 Set() 
SetColor() 
SetCorner() 
SetFillColor() 
SetTabAlign() 
SetWidth() 
+
 Align() 
Center() 
GetFontHeight() 
GetTextHeight() 
GetWidth() 
Hide() 
ParagraphAlign() 
Set() 
SetAlign() 
SetAngle() 
SetBox() 
SetColor() 
SetCSIMTarget() 
SetFont() 
SetMargin() 
SetOrientation() 
SetParagraphAlign() 
SetPos() 
SetScalePos() 
SetShadow() 
SetWordWrap() 
Show() 
__construct() 
+
 

Class usage and Overview
Represents the tab that can be placed on top of the graph

  +


Class Methods

+

 

GraphTabTitle ::
Set($t)
+ +Specify text string for tabbed title

+ + + + +
ArgumentDefaultDescription
+$t + + + Text
+ +

Description:
Specify text string for tabbed title 
+ +

Example:

+$graph->tabtitle->Set('First Quarter'); + +

+

+

 

GraphTabTitle ::
SetColor($aTxtColor, $aFillColor, $aBorderColor)
+ +Specify color for tab

+ + + + + + + + +
ArgumentDefaultDescription
+$aTxtColor + + + Text color
+$aFillColor + + + +'lightyellow' + +Background fill color
+$aBorderColor + + + +'black' + +Border color
+ +

Description:
Specify all the possible colors for the tab 
+ +

Example:

+$graph->tabtitle->SetColor('navy','lightyellow','navy'); + +

+

+

 

GraphTabTitle ::
SetCorner($aD)
+ +Specify size (in pixels) of the cut in the upper left and right corner

+ + + + +
ArgumentDefaultDescription
+$aD + + + Cut in pixels
+ +

Description:
Specify size (in pixels) of the cut in the upper left and right corner 
+ +

Example:

+$graph->tabtitle->SetCorner(8); + +

+

+

 

GraphTabTitle ::
SetFillColor($aFillColor)
+ +Specify background color for tab title

+ + + + +
ArgumentDefaultDescription
+$aFillColor + + + Fill color
+ +

Description:
Specify background color for tab title 
+ +

Example:

+$graph->tabtitle->SetFillColor('darkgreen'); + +

+

+

 

GraphTabTitle ::
SetTabAlign($aAlign)
+ +Specify position of the tab

+ + + + +
ArgumentDefaultDescription
+$aAlign + + + Left right or center position
+ +

Description:
Teh tab can be positioned at the left edge on top of the plot area, center or at the right. 
+ +

Example:

+$graph->tabtitle->SetTabAlign('right'); + +

+

+

 

GraphTabTitle ::
SetWidth($aWidth)
+ +Specify width for tab title

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + Width of tab (see below)
+ +

Description:
The width of the tab title can be specified in either absolute pixels or as the two special values 'TABTITLE_WIDTHFIT' and 'TABTITLE_WIDTHFULL'. +

+The TABTITLE_WIDTHFIT will make the tab just wide enough to hold the text in the tab and the TABTITLE_WIDTHFULL will extend the tab across the entire plot area. +

+By default the tab will be formatted as it had been specified as TABTITLE_WIDTHFIT + + + 
+ +

Example:

+// Specify the tab title width in absolute pixels
$graph->tabtitle->SetWidth(120); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Grid.html b/includes/jpgraph/docs/classref/Grid.html new file mode 100644 index 0000000..9146c70 --- /dev/null +++ b/includes/jpgraph/docs/classref/Grid.html @@ -0,0 +1,168 @@ +


Class Grid
+(Defined in: jpgraph.php : 3296)
 
 Grid 
 SetColor() 
SetFill() 
SetLineStyle() 
SetWeight() 
Show() 
+
 

Class usage and Overview
This class is used to hold all properties of the gridline for a specific axis. The grid setting is accessed through the xgrid and ygrid properties of graph. + +By default JpGraph has grid lines for Y-lines turned on and gridlines for X-axis turned off. + +

  +


Class Methods

+

 

Grid ::
SetColor($aMajColor, $aMinColor)
+ +Set color of grid lines

+ + + + + + +
ArgumentDefaultDescription
+$aMajColor + + + Major color
+$aMinColor + + + +false + +Minor color
+ +

Description:
Set color of grid lines 
+ +

Example:

+$graph->xgrid->SetColor('lightblue'); + +

+

+

 

Grid ::
SetFill($aFlg, $aColor1, $aColor2)
+ +Specify fill style for grid

+ + + + + + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +Flag, True=enable fill
+$aColor1 + + + +'lightgray' + +Fill color 1
+$aColor2 + + + +'lightblue' + +Fill color 2
+ +

Description:
The area between the gridline can be filled with two alternating colors. This method specifies this style. See 'filledgridex1.php' for an example of this. By using this feature with alpha-blending you can achieve very nice layouts. + 
+ +

Example:

+// Use 50% blending
$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5');
$graph->ygrid->Show();
$graph->xgrid->Show();
+
+

+

+

 

Grid ::
SetLineStyle($aType)
+ +Specify if grid line should be dashed, dotted or solid

+ + + + +
ArgumentDefaultDescription
+$aType + + + String to specify line type
+ +

Description:
Specify if grid should be dashed, dotted or solid. The type is specified with a string which can be either "solid", "dashed" or "dotted". + 
+  
See also:
+

Example:

+$graph->ygrid->SetLineStyle('dashed'); + +

+

+

 

Grid ::
SetWeight($aWeight)
+ +Set line weight for grid line

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Line width in pixels
+ +

Description:
Set line weight for grid line 
+ +

Example:

+$graph->xgrid->SetWeight(2); + +

+

+

 

Grid ::
Show($aShowMajor, $aShowMinor)
+ +Specify if both major and minor grid should be displayed

+ + + + + + +
ArgumentDefaultDescription
+$aShowMajor + + + +true + +True=Show major grid lines
+$aShowMinor + + + +false + +True=Show minor grid lines
+ +

Description:
Specify if both major and minor grid should be displayed 
+ +

Example:

+$graph->ygrid->Show();
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/GroupBarPlot.html b/includes/jpgraph/docs/classref/GroupBarPlot.html new file mode 100644 index 0000000..168ce99 --- /dev/null +++ b/includes/jpgraph/docs/classref/GroupBarPlot.html @@ -0,0 +1,63 @@ +


Class GroupBarPlot Extends BarPlot
+(Defined in: jpgraph_bar.php : 615)
 
 GroupBarPlot  BarPlot 
 GroupBarPlot() 
+
 RotatePattern() 
SetAbsWidth() 
SetAlign() 
SetFillColor() 
SetFillGradient() 
SetNoFill() 
SetPattern() 
SetShadow() 
SetValuePos() 
SetWidth() 
SetYBase() 
SetYMin() 
__construct() 
+
 

Class usage and Overview
A group bar plot has several bars side by side for each X-label. The group bar is constructed from any number of ordinary bar graphs. + +For example: + +$b1 = new BarPlot(...); +$b2 = new BarPlot(...); + +$gb = new GroupBarPlot(array($b1,$b2)); +... +$graph->Add($gb); +... + + +Each individual bar can be either a BarPlor or an AccBarPlot. +

  +


Class Methods

+

 

GroupBarPlot ::
GroupBarPlot($plots)
+ +Create a new Group bar plot

+ + + + +
ArgumentDefaultDescription
+$plots + + + Array of individual plots
+ +

Description:
Create a new Group bar plot from a number of BarPlot or AccBarPlot plots. 
+  
See also:
+

Example:

+$b1 = new BarPlot(...);
$b2 = new BarPlot(...);

$gb = new GroupBarPlot(array($b1,$b2));
...
$graph->Add($gb); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/HeaderProperty.html b/includes/jpgraph/docs/classref/HeaderProperty.html new file mode 100644 index 0000000..6e27e18 --- /dev/null +++ b/includes/jpgraph/docs/classref/HeaderProperty.html @@ -0,0 +1,366 @@ +


Class HeaderProperty
+(Defined in: jpgraph_gantt.php : 1781)
 
 HeaderProperty 
 SetBackgroundColor() 
SetFont() 
SetFontColor() 
SetFormatString() 
SetFrameColor() 
SetFrameWeight() 
SetInterval() 
SetIntervall() 
SetLabelFormatString() 
SetStyle() 
SetSundayFontColor() 
SetTitleVertMargin() 
SetWeekendColor() 
+
 

Class usage and Overview
Data encapsulating class to hold properties for each type of the scale headers of the Gantt chart. + +It is instantiated in (and accessible through) + + +$ganttgraph->scale->min +$ganttgraph->scale->hour +$ganttgraph->scale->day +$ganttgraph->scale->week +$ganttgraph->scale->month +$ganttgraph->scale->year + + +You use the methods on these object to specify how you want the scale to be displayed. For example specifying if the week view will show start date or week number.

  +


Class Methods

+

 

HeaderProperty ::
SetBackgroundColor($aColor)
+ +Specify background color in scale

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify background color in scale 
+ +

Example:

+$ganttgraph->scale->week->SetBackgroundColor('lightblue'); + +

+

+

 

HeaderProperty ::
SetFont($aFFamily, $aFStyle, $aFSize)
+ +Specify font for scale

+ + + + + + + + +
ArgumentDefaultDescription
+$aFFamily + + + Font family
+$aFStyle + + + +FS_NORMAL + +Font style
+$aFSize + + + +10 + +Font size
+ +

Description:
Specify font for scale 
+ +

Example:

+$ganttgraph->scale->week->SetFont(FF_FONT0); + +

+

+

 

HeaderProperty ::
SetFontColor($aColor)
+ +Specify font (text) color

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify font (text) color 
+ +

Example:

+$ganttgraph->scale->week->SetFontColor('darkred'); + +

+

+

 

HeaderProperty ::
SetFormatString($aStr)
+ +Specify format string for scales

+ + + + +
ArgumentDefaultDescription
+$aStr + + + Format string
+ +

Description:
Specify printf() style format string for scales 
+

+

 

HeaderProperty ::
SetFrameColor($aColor)
+ +Set color of frame around scale

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Set color of frame around scale 
+ +

Example:

+$ganttgraph->scale->year->SetFrameCOlor('darkblue');
+
+

+

+

 

HeaderProperty ::
SetFrameWeight($aWeight)
+ +Specify width of frame around scale

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Width in pixels
+ +

Description:
Specify width of frame around scale 
+ +

Example:

+$ganttgraph->scale->year->SetFrameWeight(2); + +

+

+

 

HeaderProperty ::
SetInterval($aInt)
+ +

+ + + + +
ArgumentDefaultDescription
+$aInt + + + No description available
+ +

Description:
No description available.

+

 

HeaderProperty ::
SetIntervall($aInt)
+ +Set scale interval

+ + + + +
ArgumentDefaultDescription
+$aInt + + + Integer intervall
+ +

Description:
Set scale interval. The exact behaviour depends on if this is evoked on a day, hour or minute scale. +

+For example if the scale is an hour scale then SetIntervall() will give number of hours between each scale interball. 
+ +

Example:

+// 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'); +
+

+

+

 

HeaderProperty ::
SetLabelFormatString($aStr)
+ +Specify format string for use in scale

+ + + + +
ArgumentDefaultDescription
+$aStr + + + printf() style format string
+ +

Description:
Specify format string for use in scale. 
+ +

Example:

+$ganttgraph->scale->week->SetLabelFormatString('week %d'); + +

+

+

 

HeaderProperty ::
SetStyle($aStyle)
+ +Specify style of scale.

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + Scale style
+ +

Description:
Specifies how the week, month, day, hour and minute scale should appear. For year scale this method has no meaning. + +For week scale: + + +For month scale: + + +For Day style + + +For hour style + + +Minute style + + + 
+ +

Example:

+$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4); + +

+

+

 

HeaderProperty ::
SetSundayFontColor($aColor)
+ +Only used by day scale. Specify font color for sunday.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Only used by day scale. Specify font color for sunday. The default is toi display Sundays in red color as per convention. 
+  
See also:
+

Example:

+$ganttgraph->SetSundayFontColor('red'); + +

+

+

 

HeaderProperty ::
SetTitleVertMargin($aMargin)
+ +Specify margin above and below text in scale

+ + + + +
ArgumentDefaultDescription
+$aMargin + + + Margin in pixels
+ +

Description:
Specify margin above and below text in scale 
+ +

Example:

+$ganttgraph->scale->year->SetTitleVertMargin(7);
+
+

+

+

 

HeaderProperty ::
SetWeekendColor($aColor)
+ +Only valid if if used by day scale

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Background color for the weekend
+ +

Description:
Specify the background color for weekends. +

+Tip: If you want the weekend background color to continue down the gantt chart theh use the GanttScale::UseWeekendBackground() method. +  
+  

See also:
+

Example:

+$ganttgraph->scale->day->SetWeekendColor('lightgray');
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/HorizontalGridLine.html b/includes/jpgraph/docs/classref/HorizontalGridLine.html new file mode 100644 index 0000000..ade3159 --- /dev/null +++ b/includes/jpgraph/docs/classref/HorizontalGridLine.html @@ -0,0 +1,87 @@ +


Class HorizontalGridLine
+(Defined in: jpgraph_gantt.php : 3113)
 
 HorizontalGridLine 
 SetRowFillColor() 
SetStart() 
Show() 
+
 

Class usage and Overview
Handles the alternating row colors in the Gantt chart

  +


Class Methods

+

 

HorizontalGridLine ::
SetRowFillColor($aColor1, $aColor2)
+ +Specify alternating row fill color

+ + + + + + +
ArgumentDefaultDescription
+$aColor1 + + + Color 1
+$aColor2 + + + +'' + +Color 2
+ +

Description:
Specify alternating row fill color for the Gantt chart. + +See gantthgridex1.php for a full example. 
+ +

Example:

+...
$graph->hgrid->Show();
$graph->hgrid->SetRowFillColor('darkblue@0.9');
+
+

+

+

 

HorizontalGridLine ::
SetStart($aStart)
+ +Specify start row for alternating colors

+ + + + +
ArgumentDefaultDescription
+$aStart + + + Start row
+ +

Description:
Specify start row for alternating colors. By default it will start from row 0 (first row) 
+

+

 

HorizontalGridLine ::
Show($aShow)
+ +Enable alternating row colors

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +TRUE/FALSE
+ +

Description:
Enable alternating row colors 
+ +

Example:

+$graph->hgrid->Show(); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/IconImage.html b/includes/jpgraph/docs/classref/IconImage.html new file mode 100644 index 0000000..cac5916 --- /dev/null +++ b/includes/jpgraph/docs/classref/IconImage.html @@ -0,0 +1,127 @@ +


Class IconImage
+(Defined in: jpgraph_gantt.php : 1482)
 
 IconImage 
 SetAlign() 
__construct() 
+
 

Class usage and Overview
Icon object to be used in a title for a Gantt plot object, e.g. bar or milestones. +

+The icons are then used exactly as you would use text strings when specifying a title for the gantt object. For example: + +$icon = new IconImage(GICON_WARNING,0.7); +$titles = array($icon,'65 days','3 Aug','5 sep'); +$bar = new GanttBar(0,$titles,$startdat,$enddate); +... + +

+Hint: When using icons togehter with titles the height of each bar is not affected (by design!) of the icons height. If you are using icons in several rows it might therefore be usefull to increase the vertical margin factor between each row. This is done by a call to the method GanttGarph::SetVMarginFactor()

  +


Class Methods

+

 

IconImage ::
SetAlign($aX, $aY)
+ +Specify anchor point for icon

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + +'left' + +Horizontal anchor point
+$aY + + + +'center' + +Vertical anchor point
+ +

Description:
Specify where the anchor point for the icon should be. valid anchor points (for both hor and ver - directions) are: + +The anchor points determines what position on the icon shoudl be aligned with the specifed x,y position for the icon. + + 
+ +

Example:

+$icon = new IconImage("../smiley.png",0.7);
$icon->SetAlign('center','center');
+
+

+

+

 

IconImage ::
__construct($aIcon, $aScale)
+ +Create a new icon for use in Gantt title columns

+ + + + + + +
ArgumentDefaultDescription
+$aIcon + + + Icon specification. Either an image file or one of the builtin icons
+$aScale + + + +1 + +Scale of icon
+ +

Description:
Create a new icon object to be used in a title for a Gantt plot object, e.g. bar or milestones. +

+An icon can either be created from an arbitrary image file (type is determined by the file extension) or it can also be one of the builtin icons. The builtin icons are: +

+

+A graphic illustration of the differenmt icons can be found in the manual. +

+The second argument specifies an optional scaling factor for the image/builtin icon. +

+The icons are then used exactly as you would use text strings when specifying a title for the gantt object. For example: + +$icon = new IconImage(GICON_WARNING,0.7); +$titles = array($icon,'65 days','3 Aug','5 sep'); +$bar = new GanttBar(0,$titles,$startdat,$enddate); +... + +

+Hint: When using icons togehter with titles the height of each bar is not affected (by design!) of the icons height. If you are using icons in several rows it might therefore be usefull to increase the vertical margin factor between each row. This is done by a call to the method GanttGarph::SetVMarginFactor() 
+  

See also:
+

Example:

+// Creating an icon from an image file and scaling it to 70%
// of original size
$icon = new IconImage("smiley.png",0.7);

// Using on of the bultin icons
$icon = new IconImage(GICON_TEXT,0.8); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/IconPlot.html b/includes/jpgraph/docs/classref/IconPlot.html new file mode 100644 index 0000000..e6902c5 --- /dev/null +++ b/includes/jpgraph/docs/classref/IconPlot.html @@ -0,0 +1,464 @@ +


Class IconPlot
+(Defined in: jpgraph_iconplot.php : 17)
 
 IconPlot 
 CreateFromString() 
DoLegend() 
GetAbsHeight() 
GetLineNbr() 
GetMaxDate() 
GetMinDate() 
GetWidthHeight() 
Max() 
Min() 
PreStrokeAdjust() 
SetAnchor() 
SetCountryFlag() 
SetMix() 
SetPos() 
SetScale() 
SetScalePos() 
StrokeMargin() 
StrokeWithScale() 
_Stroke() 
__construct() 
+
 

Class usage and Overview
Make it possible to add one or several images on top of the background in the graph. This is constructed in the same way as normal plots are created and the images are added as normal with the GRaph::Add() method. + +It is possoble to specify arbitrary positions as well as mix (blend) and scaling. + +Example: + +$icon = new IconPlot('myicon.png',0.5,0.5); +.. +$graph->Add($icon);

  +


Class Methods

+

 

IconPlot ::
CreateFromString($aStr)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStr + + + No description available
+ +

Description:
No description available.

+

 

IconPlot ::
DoLegend($aGraph)
+ +// Nothing to do ...

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

IconPlot ::
GetAbsHeight()
+ +

+
+ +

Description:
No description available.

+

 

IconPlot ::
GetLineNbr()
+ +

+
+ +

Description:
No description available.

+

 

IconPlot ::
GetMaxDate()
+ +// The next four function are framework function tht gets called// from Gantt and is not menaiungfull in the context of Icons but// they must be implemented to avoid errors.

+
+ +

Description:
No description available.

+

 

IconPlot ::
GetMinDate()
+ +

+
+ +

Description:
No description available.

+

 

IconPlot ::
GetWidthHeight()
+ +

+
+ +

Description:
No description available.

+

 

IconPlot ::
Max()
+ +// Nothing to do ...

+
+ +

Description:
No description available.

+

 

IconPlot ::
Min()
+ +

+
+ +

Description:
No description available.

+

 

IconPlot ::
PreStrokeAdjust($aGraph)
+ +

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

IconPlot ::
SetAnchor($aXAnchor, $aYAnchor)
+ +Specify anchor point for image

+ + + + + + +
ArgumentDefaultDescription
+$aXAnchor + + + +'left' + +Horizontal anchor
+$aYAnchor + + + +'center' + +Verticla anchor
+ +

Description:
Specify anchor point for image. + +Horizontal anchor can be "left','center','right' and vertical anchor can be 'top','center','bottom' + +By default the anchor is the top left corner ('left','top') 
+ +

Example:

+$icon->SetAnchor('center','center'); + +

+

+

 

IconPlot ::
SetCountryFlag($aFlag, $aX, $aY, $aScale, $aMix, $aStdSize)
+ +Use one of the country flags as icons

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aFlag + + + Partial or full country name
+$aX + + + +0 + +X-position
+$aY + + + +0 + +Y-position
+$aScale + + + +1.0 + +Scaleing of image
+$aMix + + + +100 + +Blend factor (0-100)
+$aStdSize + + + +3 + +Which of the flag standard sizes should be used as the original image (1-4)
+ +

Description:
Use one of the country flags as icons + 
+ +

Example:

+$icon = new IconPlot();
$icon->SetCountryFlag('norway',0.1,0.1);
+
+

+

+

 

IconPlot ::
SetMix($aMix)
+ +Specify mix value in percent (0-100) for image-

+ + + + +
ArgumentDefaultDescription
+$aMix + + + Mix value (0-100)
+ +

Description:
Specify mix value in percent (0-100) for image. The mix value can also be specified directly in the constructor IconPlot(). + 
+ +

Example:

+$icon->SetMix(50); + +

+

+

 

IconPlot ::
SetPos($aX, $aY)
+ +Specify position for image

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + X-position
+$aY + + + Y-position
+ +

Description:
Specify position for image. Position can be specified as either absolute coordinates or as fractions of the width and height. + +The anchor point in the image can be adjusted with a call to SetAnchor(). By default the anchor point is the top left corner. + 
+  
See also:
+

Example:

+$icon->SetPos(0.5,0.5); + +

+

+

 

IconPlot ::
SetScale($aScale)
+ +Set scaling for image

+ + + + +
ArgumentDefaultDescription
+$aScale + + + Scale value.
+ +

Description:
Set scaling for image. This allows you to adjust the size of the image. 
+ +

Example:

+$icon->SetScale(0.8); + +

+

+

 

IconPlot ::
SetScalePos($aX, $aY)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + No description available
+$aY + + + No description available
+ +

Description:
No description available.

+

 

IconPlot ::
StrokeMargin(&$aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+&$aImg + + + No description available
+ +

Description:
No description available.

+

 

IconPlot ::
StrokeWithScale($aImg, $axscale, $ayscale)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+$axscale + + + No description available
+$ayscale + + + No description available
+ +

Description:
No description available.

+

 

IconPlot ::
_Stroke($aImg, $x, $y, $aReturnWidthHeight)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+$x + + + +null + +No description available
+$y + + + +null + +No description available
+$aReturnWidthHeight + + + +false + +No description available
+ +

Description:
No description available.

+

 

IconPlot ::
__construct($aFile, $aX, $aY, $aScale, $aMix)
+ +Create a new icon image to be added to the graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aFile + + + +"" + +File name of image
+$aX + + + +0 + +X-position
+$aY + + + +0 + +Y-position
+$aScale + + + +1.0 + +Scale
+$aMix + + + +100 + +Mixin value
+ +

Description:
Create a new icon image to be added to the graph. The position can be specified as either absolute coordinates or as fractions of the width and height repsectively. + +Scale can be an arbitrary floating point number indicating the scaling of the image. + +The mix values specifies (in percent 1-100) how much of the image should be mixed in on top of the background. + 
+ +

Example:

+$icon = new IconPlot('myfile.png',0.5,0.5,1,50);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Image.html b/includes/jpgraph/docs/classref/Image.html new file mode 100644 index 0000000..70a45e9 --- /dev/null +++ b/includes/jpgraph/docs/classref/Image.html @@ -0,0 +1,294 @@ +


Class Image
+(Defined in: jpgraph.php : 5929)
 
 Image 
 RoundedRectangle() 
SetAlphaBlending() 
SetAntiAliasing() 
SetCanvasColor() 
SetExpired() 
SetImgFormat() 
SetMargin() 
SetQuality() 
SetTransparent() 
+
 

Class usage and Overview
The Image class encapsulates the very lowest layer in the jpgraph library. It encapsulates the GD library function and presents a coherent interface hiding som of the details in the setup and management of GD. +

+By replacing Image (and RotImage) it is possible to change the output driver for the whole library withou any further changes. +

+A very close related class is RotImage which builds directly on Image but in additoin provides a 2D rotation featire, i.e the image may be rotated around a given point and possible also translated. +

+The image gets instantiated through in the Graph::Img property, or more accurate the RotImage class gets instantiated. The only method in this class that any end user is likely to need (and use) is the SetMargin() method used to give the margins around between the end of the image and the actual plotarea. +

+Note that all coordinates in methods belonging to Image is given in direct screen coordinates. + + + +

  +

See also related classes:
RotImage, RGB and TTF

 


Class Methods

+

 

Image ::
RoundedRectangle($xt, $yt, $xr, $yl, $r)
+ +Draw a rectangle with rounded corners

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$xt + + + Top left X
+$yt + + + Top left Y
+$xr + + + Bottom right X
+$yl + + + Bottom right Y
+$r + + + +5 + +Corner radius
+ +

Description:
Draw a rectangle with rounded corners. 
+ +

Example:

+$img->RoundedRectangle(0,0,100,100,10); + +

+

+

 

Image ::
SetAlphaBlending($aFlg)
+ +Enable alpha blending of colors

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +True/false = Enable/Disable alpha blending
+ +

Description:
Alpha blending for colors can only be used with GD 2.x and above. You specify the alpha channel by adding a '@[alpha-value]' to your normal color specification. The alpha value is specified as a fraction in the range [0, 1] and indicated how much of the background color should be visible. +

+Alphablending is enabled by default (when GD2 is used) but can be turned off by a call to this function with the argument false. 
+ +

Example:

+$graph->img->SetAlphaBlending();
...
$lineplot->SetFillColor('orange@0.5');
+
+

+

+

 

Image ::
SetAntiAliasing()
+ +Specify if anti-aliasing should be used

+
+ +

Description:
Specify if anti-aliasing should be used. + +Enabling anti-aliasing will greatly improve the visual apperance of certain graphs. For example spider graphs greatly benefit from this. + +Note: Using anti-aliasing makes line drawing roughly 8 time slower than normal lines !! So you image will take longer to construct. + 
+  
See also:
+

Example:

+$graph->img->SetAntiAliasing();
+
+

+

+

 

Image ::
SetCanvasColor($aColor)
+ +Set canvas color

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Set canvas color. The canvas color is the fill color for the frame when it is first created. This is white by defult. If you specify a frame or plot area color this background color will never be visible. +

+The one time it matters is when you use a drop shadow on the graph. In the small area (top right and bottom left) where there is an empty are which is covered by neither the shadow nor the graph margin this area will have the canvas color. + 
+  

See also:
+

Example:

+$graph->SetCanvasColor('lightblue'); + +

+

+

 

Image ::
SetExpired($aFlg)
+ +Turn on/off expired header

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +True=Return expired header.
+ +

Description:
Specify that the header returned should not only contain the image format but also the meta tags to force the browser not to cache and reload the image every time the script is called. +

+By default this is turned on. +

+Note: There is no reason as far as we can tell to turn this off. + 
+ +

Example:

+$graph->img->SetExpired(false); + +

+

+

 

Image ::
SetImgFormat($aFormat, $aQuality)
+ +Specify what image format to use

+ + + + + + +
ArgumentDefaultDescription
+$aFormat + + + Image format
+$aQuality + + + +75 + +No description available
+ +

Description:
Specify image format. Note depending on your installation of PHP not all formats may be supported. + +Supported formats are: +
+  
See also:
+

Example:

+$graph->img->SetImgFormat('jpeg'); + +

+

+

 

Image ::
SetMargin($lm, $rm, $tm, $bm)
+ +Specify margin for the plot area

+ + + + + + + + + + +
ArgumentDefaultDescription
+$lm + + + Left margin
+$rm + + + Right margin
+$tm + + + Top margin
+$bm + + + Bottom margin
+ +

Description:
Specify margin for the plot area. + 
+ +

Example:

+$graph->img->SetMargin(20,20,40,20);
+
+

+

+

 

Image ::
SetQuality($q)
+ +Specify JPEG image quality

+ + + + +
ArgumentDefaultDescription
+$q + + + Image quality paramer (0-100)
+ +

Description:
Specify JPEG image quality. For this to have any effect the image format, as specified with SetImgFormat(), must have been set to "jpeg". + +The quality is specified as an integer in the range 0 (worst quality) to 100 (best quality) . By default the quality is set o 75. 
+  
See also:
+

Example:

+$graph->image->SetQuality(40); + +

+

+

 

Image ::
SetTransparent($color)
+ +Specify transparent color

+ + + + +
ArgumentDefaultDescription
+$color + + + Color
+ +

Description:
Specify transparent color for image. 
+ +

Example:

+$graph->img->SetTransparent("white");
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ImgTrans.html b/includes/jpgraph/docs/classref/ImgTrans.html new file mode 100644 index 0000000..572fd9e --- /dev/null +++ b/includes/jpgraph/docs/classref/ImgTrans.html @@ -0,0 +1,354 @@ +


Class ImgTrans
+(Defined in: jpgraph_imgtrans.php : 15)
 
 ImgTrans 
 Skew3D() 
_Skew3D() 
_TransHor3D() 
_TransVert3D() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

ImgTrans ::
Skew3D($aHorizon, $aSkewDist, $aDir, $aHiQuality, $aMinSize, $aFillColor, $aBorder)
+ +// --------------------------------------------------------------------// Skew image for the apperance of a 3D effect// This transforms an image into a 3D-skewed version// of the image. The transformation is specified by giving the height// of the artific

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aHorizon + + + +120 + +No description available
+$aSkewDist + + + +150 + +No description available
+$aDir + + + +SKEW3D_DOWN + +No description available
+$aHiQuality + + + +false + +No description available
+$aMinSize + + + +true + +No description available
+$aFillColor + + + +'#FFFFFF' + +No description available
+$aBorder + + + +false + +No description available
+ +

Description:
No description available.

+

 

ImgTrans ::
_Skew3D($aGdImg, $aHorizon, $aSkewDist, $aDir, $aHiQuality, $aMinSize, $aFillColor, $aBorder)
+ +

+ + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aGdImg + + + No description available
+$aHorizon + + + +120 + +No description available
+$aSkewDist + + + +150 + +No description available
+$aDir + + + +SKEW3D_DOWN + +No description available
+$aHiQuality + + + +false + +No description available
+$aMinSize + + + +true + +No description available
+$aFillColor + + + +'#FFFFFF' + +No description available
+$aBorder + + + +false + +No description available
+ +

Description:
No description available.

+

 

ImgTrans ::
_TransHor3D($aGdImg, $aHorizon, $aSkewDist, $aDir, $aMinSize, $aFillColor, $aQuality, $aBorder, $aHorizonPos)
+ +// --------------------------------------------------------------------// _TransVert3D() and _TransHor3D() are helper methods to// Skew3D().// --------------------------------------------------------------------

+ + + + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aGdImg + + + No description available
+$aHorizon + + + +100 + +No description available
+$aSkewDist + + + +120 + +No description available
+$aDir + + + +SKEW3D_LEFT + +No description available
+$aMinSize + + + +true + +No description available
+$aFillColor + + + +'#FFFFFF' + +No description available
+$aQuality + + + +false + +No description available
+$aBorder + + + +false + +No description available
+$aHorizonPos + + + +0.5 + +No description available
+ +

Description:
No description available.

+

 

ImgTrans ::
_TransVert3D($aGdImg, $aHorizon, $aSkewDist, $aDir, $aMinSize, $aFillColor, $aQuality, $aBorder, $aHorizonPos)
+ +// --------------------------------------------------------------------// _TransVert3D() and _TransHor3D() are helper methods to// Skew3D().// --------------------------------------------------------------------

+ + + + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aGdImg + + + No description available
+$aHorizon + + + +100 + +No description available
+$aSkewDist + + + +120 + +No description available
+$aDir + + + +SKEW3D_DOWN + +No description available
+$aMinSize + + + +true + +No description available
+$aFillColor + + + +'#FFFFFF' + +No description available
+$aQuality + + + +false + +No description available
+$aBorder + + + +false + +No description available
+$aHorizonPos + + + +0.5 + +No description available
+ +

Description:
No description available.

+

 

ImgTrans ::
__construct($aGdImg)
+ +//=======================================================================// File: JPGRAPH_IMGTRANS.PHP// Description: Extension for JpGraph to do some simple img transformations// Created: 2003-09-06// Ver: $Id: jpgraph_imgtrans.php 110

+ + + + +
ArgumentDefaultDescription
+$aGdImg + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/JpGraphException.html b/includes/jpgraph/docs/classref/JpGraphException.html new file mode 100644 index 0000000..0603fb1 --- /dev/null +++ b/includes/jpgraph/docs/classref/JpGraphException.html @@ -0,0 +1,65 @@ +


Class JpGraphException Extends Exception
+(Defined in: jpgraph_errhandler.inc.php : 139)
 
 JpGraphException  Exception 
 Stroke() 
_toString() 
__construct() 
+
 
 

Class usage and Overview

  +


Class Methods

+

 

JpGraphException ::
Stroke()
+ +// custom representation of error as an image

+
+ +

Description:
No description available.

+

 

JpGraphException ::
_toString()
+ +// custom string representation of object

+
+ +

Description:
No description available.

+

 

JpGraphException ::
__construct($message, $code, , )
+ +// Redefine the exception so message isn't optional

+ + + + + + + + + + +
ArgumentDefaultDescription
+$message + + + No description available
+$code + + + No description available
+ + + + No description available
+ + + + +0 + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/JpGraphExceptionL.html b/includes/jpgraph/docs/classref/JpGraphExceptionL.html new file mode 100644 index 0000000..135155f --- /dev/null +++ b/includes/jpgraph/docs/classref/JpGraphExceptionL.html @@ -0,0 +1,78 @@ +


Class JpGraphExceptionL Extends JpGraphException
+(Defined in: jpgraph_errhandler.inc.php : 177)
 
 JpGraphExceptionL  JpGraphException 
 __construct() 
+
 Stroke() 
_toString() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

JpGraphExceptionL ::
__construct($errcode, $a1, $a2, $a3, $a4, $a5)
+ +// Redefine the exception so message isn't optional

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$errcode + + + No description available
+$a1 + + + +null + +No description available
+$a2 + + + +null + +No description available
+$a3 + + + +null + +No description available
+$a4 + + + +null + +No description available
+$a5 + + + +null + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LayoutHor.html b/includes/jpgraph/docs/classref/LayoutHor.html new file mode 100644 index 0000000..3dba4f3 --- /dev/null +++ b/includes/jpgraph/docs/classref/LayoutHor.html @@ -0,0 +1,76 @@ +


Class LayoutHor Extends RectLayout
+(Defined in: jpgraph_odo.php : 779)
 
 LayoutHor  RectLayout 
 getHeight() 
getWidth() 
Stroke() 
__construct() 
+
 LayoutSize() 
+
 

Class usage and Overview

  +


Class Methods

+

 

LayoutHor ::
getHeight($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

LayoutHor ::
getWidth($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

LayoutHor ::
Stroke($graph)
+ +

+ + + + +
ArgumentDefaultDescription
+$graph + + + No description available
+ +

Description:
No description available.

+

 

LayoutHor ::
__construct($aObjArr)
+ +

+ + + + +
ArgumentDefaultDescription
+$aObjArr + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LayoutRect.html b/includes/jpgraph/docs/classref/LayoutRect.html new file mode 100644 index 0000000..7de6f40 --- /dev/null +++ b/includes/jpgraph/docs/classref/LayoutRect.html @@ -0,0 +1,102 @@ +


Class LayoutRect
+(Defined in: jpgraph_glayout_vh.inc.php : 14)
 
 LayoutRect 
 getHeight() 
getWidth() 
SetCenterPos() 
Stroke() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

LayoutRect ::
getHeight($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

LayoutRect ::
getWidth($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

LayoutRect ::
SetCenterPos($x, $y)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$x + + + No description available
+$y + + + No description available
+ +

Description:
No description available.

+

 

LayoutRect ::
Stroke($graph)
+ +

+ + + + +
ArgumentDefaultDescription
+$graph + + + No description available
+ +

Description:
No description available.

+

 

LayoutRect ::
__construct($width, $height)
+ +// File: JPGRAPH_GLAYOUT_VH.INC.PHP// Description: JpGraph Layout classes for automatic layout of// objects in a graph. The layout is a simple even division// depending on the objects sizes// Created: 2009-07-08// Ver:

+ + + + + + +
ArgumentDefaultDescription
+$width + + + No description available
+$height + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LayoutVert.html b/includes/jpgraph/docs/classref/LayoutVert.html new file mode 100644 index 0000000..352f0ca --- /dev/null +++ b/includes/jpgraph/docs/classref/LayoutVert.html @@ -0,0 +1,76 @@ +


Class LayoutVert Extends RectLayout
+(Defined in: jpgraph_odo.php : 736)
 
 LayoutVert  RectLayout 
 getHeight() 
getWidth() 
Stroke() 
__construct() 
+
 LayoutSize() 
+
 

Class usage and Overview

  +


Class Methods

+

 

LayoutVert ::
getHeight($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

LayoutVert ::
getWidth($aImg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

LayoutVert ::
Stroke($graph)
+ +

+ + + + +
ArgumentDefaultDescription
+$graph + + + No description available
+ +

Description:
No description available.

+

 

LayoutVert ::
__construct($aObjArr)
+ +//echo "w=$w, x1=".($xstart + $w/2.0).", y1=".($this->icy)."
";

+ + + + +
ArgumentDefaultDescription
+$aObjArr + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Legend.html b/includes/jpgraph/docs/classref/Legend.html new file mode 100644 index 0000000..900839e --- /dev/null +++ b/includes/jpgraph/docs/classref/Legend.html @@ -0,0 +1,546 @@ +


Class Legend
+(Defined in: jpgraph_legend.inc.php : 22)
 
 Legend 
 Hide() 
Pos() 
SetAbsPos() 
SetColor() 
SetColumns() 
SetFillColor() 
SetFont() 
SetFrameWeight() 
SetHColMargin() 
SetLayout() 
SetLeftMargin() 
SetLineSpacing() 
SetLineWeight() 
SetMarkAbsHSize() 
SetMarkAbsSize() 
SetMarkAbsVSize() 
SetPos() 
SetReverse() 
SetShadow() 
SetVColMargin() 
+
 

Class usage and Overview
This class is responsible for drawing a legend at the specified position in the graph. Individual data series are added by calling it's Add() method. +

+This is all handled by the framework. Legend is instantiated in the graph as instance variable legend. When stroking individual plots this instance variable is used by the individual Legend() methods in the plot classes to add whatever the individual plots need to add. +

  +


Class Methods

+

 

Legend ::
Hide($aHide)
+ +Hide legend box

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True = hide
+ +

Description:
Hides the legend. 
+ +

Example:

+$graph->legend->Hide(); + +

+

+

 

Legend ::
Pos($aX, $aY, $aHAlign, $aVAlign)
+ +Specify the position for the legend box

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aX + + + X coordinate
+$aY + + + Y coordinate
+$aHAlign + + + +'right' + +Horizontal alignment
+$aVAlign + + + +'top' + +Vertical alignment
+ +

Description:
Set the position of the legend box on the Graph. The alignment arguments determine how the position of the legend box should be interpretated, i.e from what position on the Graph should the fraction be counted. ('right' uses the right side and positoins the legend with its left side according to the specified fraction and so on). Possible alignemts are: +

+Horizontal: 'left','right','center'
+Vertical: 'bottom','top','center' +

+Please note that the X and Y positions should be give as fractions , i.e Pos(0.1,0.1) +

+If the alignment is not given the the default is 'right','top' 
+ +

Example:

+$graph->legend->Pos(0.05,0.1); + +

+

+

 

Legend ::
SetAbsPos($aX, $aY, $aHAlign, $aVAlign)
+ +Specify X and Y coordinate for the legend box

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aX + + + x Coordinate
+$aY + + + y Coordinate
+$aHAlign + + + +'right' + +Horizontal anchor point
+$aVAlign + + + +'top' + +Vertical Anchor point
+ +

Description:
Specify X and Y coordinate for the legend box 
+ +

Example:

+// 10x10 pixels from the upper right corner
$graph->legend->SetAbsPos(10,10,'right','top') +
+

+

+

 

Legend ::
SetColor($aFontColor, $aColor)
+ +Set color on frame around box

+ + + + + + +
ArgumentDefaultDescription
+$aFontColor + + + Font coor
+$aColor + + + +'black' + +Frame color
+ +

Description:
Specify the color for both the frame around the legend box as well as the font color used for the legend texts. Please note that this does not affect the fill color of the legend box. 
+  
See also:
+

Example:

+$graph->legend->SetColor('blue'); + +

+

+

 

Legend ::
SetColumns($aCols)
+ +Specify the number of text columns to use

+ + + + +
ArgumentDefaultDescription
+$aCols + + + Number of columns
+ +

Description:
Specify the number of text columns to use in the legend text box. For graphs which have a large number of plots it might be necessary to specify 2 or more columns to avois that the legend box become to large. +

+By default i column us used. 
+ +

Example:

+$graph->legend->SetColumns(2); + +

+

+

 

Legend ::
SetFillColor($aColor)
+ +Specify fill color for legend box

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Fill color
+ +

Description:
Specify the background color for the legend box. The properties for the legend is noramlly accessed through the graph instance variable '$legend' 
+  
See also:
+

Example:

+$graph->legend->SetFillColor('lightblue'); + +

+

+

 

Legend ::
SetFont($aFamily, $aStyle, $aSize)
+ +Set font for texts in legend box.

+ + + + + + + + +
ArgumentDefaultDescription
+$aFamily + + + Font family
+$aStyle + + + +FS_NORMAL + +Font style
+$aSize + + + +10 + +Font size
+ +

Description:
Set font for texts in legend box. 
+ +

Example:

+$graph->legend->SetFont(FF_FONT2,FS_NORMAL); + +

+

+

 

Legend ::
SetFrameWeight($aWeight)
+ +Specify the width of the frame around the Legend box

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Width in pixels
+ +

Description:
Specify the width of the frame around the Legend box 
+ +

Example:

+$graph->legend->SetFrameWeight(2); + +

+

+

 

Legend ::
SetHColMargin($aXMarg)
+ +Specify margin between columns in te legend

+ + + + +
ArgumentDefaultDescription
+$aXMarg + + + No description available
+ +

Description:
Specify margin between columns in te legend 
+

+

 

Legend ::
SetLayout($aDirection)
+ +Specify vertical or horizontal legend layout

+ + + + +
ArgumentDefaultDescription
+$aDirection + + + +LEGEND_VERT + +Layout for legend box
+ +

Description:
The legend box can either have the legend stacke vertically or horizontally. The default is vertically stacked legends. +

+Allowed arguments: LEGEND_VERT,LEGEND_HOR +

+Please note that horizontal layout is only suitable for a few legends since it makes use of quite a lot of horizontal space. 
+ +

Example:

+// Put a horizontal legend box at the bottom of the graph
$graph->legend->Pos(0.5,0.0.5,'left','bottom');
$graph->legend->SetLayout(LEGEND_HOR); +
+

+

+

 

Legend ::
SetLeftMargin($aXMarg)
+ +Specify marging between the left edge and the first column

+ + + + +
ArgumentDefaultDescription
+$aXMarg + + + No description available
+ +

Description:
Specify marging between the left edge and the first column 
+

+

 

Legend ::
SetLineSpacing($aSpacing)
+ +Extra vertical spacing (in pixels) between rows

+ + + + +
ArgumentDefaultDescription
+$aSpacing + + + Extra margin (in pixels)
+ +

Description:
Extra vertical spacing (in pixels) between rows 
+ +

Example:

+// Add 5 pixels extra margin between each legend row
$graph->legend->SetLineSpacing(5); +
+

+

+

 

Legend ::
SetLineWeight($aWeight)
+ +Set the line width for the indicators.

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Line weight in pixels
+ +

Description:
Specify the line width for the color boxes that are used as indicators. 
+ +

Example:

+$graph->legend->SetLineWeight(2); + +

+

+

 

Legend ::
SetMarkAbsHSize($aSize)
+ +

+ + + + +
ArgumentDefaultDescription
+$aSize + + + No description available
+ +

Description:
No description available.

+

 

Legend ::
SetMarkAbsSize($aSize)
+ +Specify the size of the marker in pixels

+ + + + +
ArgumentDefaultDescription
+$aSize + + + Size in pixels
+ +

Description:
Specify the size of the marker in pixels to be used in the legend. This is used for the plot marks, for example squares or circles, when you want to control what the size used in the legend should be. +

+It is often desirable to use a smaller size for the marks in the legend than in the graph itself. 
+ +

Example:

+$graph->legend->SetMarkAbsSize(6); + +

+

+

 

Legend ::
SetMarkAbsVSize($aSize)
+ +

+ + + + +
ArgumentDefaultDescription
+$aSize + + + No description available
+ +

Description:
No description available.

+

 

Legend ::
SetPos($aX, $aY, $aHAlign, $aVAlign)
+ +Alias for Pos. Specify Position for Legend

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aX + + + X position
+$aY + + + Y position
+$aHAlign + + + +'right' + +Horizontal anchor point
+$aVAlign + + + +'top' + +Vertical anchor point
+ +

Description:
See Legend::Pos() 
+  
See also:
+

Example:

+$graph->legend->SetPos(0.05,0.5,'right','center'); + +

+

+

 

Legend ::
SetReverse($f)
+ +Print the legend in reverse order

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +TRUE=In reverse order
+ +

Description:
Print the legend in reverse order 
+ +

Example:

+$graph->legend->SetReverse(); + +

+

+

 

Legend ::
SetShadow($aShow, $aWidth)
+ +Add a drop shadow to the legend box

+ + + + + + +
ArgumentDefaultDescription
+$aShow + + + +'gray' + +True = show drop shadow
+$aWidth + + + +2 + +Width of drop shadow in pixels
+ +

Description:
Add a drop down shadow for the legend box. 
+ +

Example:

+// Use a shadow width default width
$graph->legend->SetShadow(); +
+

+

+

 

Legend ::
SetVColMargin($aSpacing)
+ +Specify the margin between rows in the legend

+ + + + +
ArgumentDefaultDescription
+$aSpacing + + + No description available
+ +

Description:
Specify the margin between rows in the legend 
+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LegendStyle.html b/includes/jpgraph/docs/classref/LegendStyle.html new file mode 100644 index 0000000..282fe06 --- /dev/null +++ b/includes/jpgraph/docs/classref/LegendStyle.html @@ -0,0 +1,372 @@ +


Class LegendStyle
+(Defined in: jpgraph_windrose.php : 275)
 
 LegendStyle 
 Hide() 
SetCFont() 
SetCFontColor() 
SetCircleColor() 
SetCircleRadius() 
SetCircleText() 
SetCircleWeight() 
SetFont() 
SetFontColor() 
SetFormat() 
SetLength() 
SetLFont() 
SetLFontColor() 
SetMargin() 
SetText() 
SetTFont() 
SetTFontColor() 
Show() 
+
 

Class usage and Overview

  +


Class Methods

+

 

LegendStyle ::
Hide($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetCFont($aFontFamily, $aFontStyle, $aFontSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + No description available
+$aFontStyle + + + +FS_NORMAL + +No description available
+$aFontSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetCFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetCircleColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetCircleRadius($aRadius)
+ +

+ + + + +
ArgumentDefaultDescription
+$aRadius + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetCircleText($aTxt)
+ +

+ + + + +
ArgumentDefaultDescription
+$aTxt + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetCircleWeight($aWeight)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetFont($aFontFamily, $aFontStyle, $aFontSize)
+ +//===================================================// CLASS LegendStyle//===================================================

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + No description available
+$aFontStyle + + + +FS_NORMAL + +No description available
+$aFontSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetFormat($aFmt)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFmt + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetLength($aLength)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLength + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetLFont($aFontFamily, $aFontStyle, $aFontSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + No description available
+$aFontStyle + + + +FS_NORMAL + +No description available
+$aFontSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetLFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetMargin($aMarg, $aBottomMargin)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aMarg + + + No description available
+$aBottomMargin + + + +5 + +No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetText($aTxt)
+ +

+ + + + +
ArgumentDefaultDescription
+$aTxt + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetTFont($aFontFamily, $aFontStyle, $aFontSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + No description available
+$aFontStyle + + + +FS_NORMAL + +No description available
+$aFontSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
SetTFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

LegendStyle ::
Show($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LineErrorPlot.html b/includes/jpgraph/docs/classref/LineErrorPlot.html new file mode 100644 index 0000000..4aeb071 --- /dev/null +++ b/includes/jpgraph/docs/classref/LineErrorPlot.html @@ -0,0 +1,48 @@ +


Class LineErrorPlot Extends ErrorPlot
+(Defined in: jpgraph_error.php : 120)
 
 LineErrorPlot  ErrorPlot 
 __construct() 
+
 __construct() 
+
 

Class usage and Overview
A line error plot is in principle a line plot but with the added feature that each point also have a two error values. Low and high error. + +This means that data array must be an even number of three values.

  +

See also related classes:
LinePlot

 


Class Methods

+

 

LineErrorPlot ::
__construct($datay, $datax)
+ +Constructor for a line plot with error bars

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + No description available
+$datax + + + +false + +X-Data [optional]
+ +

Description:
Same as a line plot but each data point has three values, the value, and error min, and error max. The error bars are then drawn as vertical lines at each data point. 
+ +

Example:

+$leplot = new LineErrorPlot($ydata); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LinePlot.html b/includes/jpgraph/docs/classref/LinePlot.html new file mode 100644 index 0000000..e10a24a --- /dev/null +++ b/includes/jpgraph/docs/classref/LinePlot.html @@ -0,0 +1,354 @@ +


Class LinePlot Extends Plot
+(Defined in: jpgraph_line.php : 24)
 
 LinePlot  Plot 
 AddArea() 
LinePlot() 
SetBarCenter() 
SetColor() 
SetFastStroke() 
SetFillColor() 
SetFillFromYMin() 
SetFillGradient() 
SetStepStyle() 
SetStyle() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
This class is used to creat line graph plots. Line graph plots are used to draw standard lineplots where datapoints are connected by lines. Each data point can also be marked by a plotmark. +

+A line plot can only be added to a Graph() image. + +Public properties: + + + + PlotMark + + DisplayValue + + +
Name Type Description
mark Mark at each data point
value Determine if and hhow each data value should be displayed in the plot

  +

See also related classes:
AccLinePlot

 


Class Methods

+

 

LinePlot ::
AddArea($aMin, $aMax, $aFilled, $aColor, $aBorder)
+ +Create a colored area under part of the lien graph.

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aMin + + + +0 + +Start X-value
+$aMax + + + +0 + +End X-value
+$aFilled + + + +LP_AREA_NOT_FILLED + +Fill area or not (true/false)
+$aColor + + + +"gray9" + +Color of fill
+$aBorder + + + +LP_AREA_BORDER + +Use a border (true/false)
+ +

Description:
Create a vertical colored area under the line between two X-values and to the top of the line. +

+Predefined values for $aFilled are:
+LP_AREA_FILLED
+LP_AREA_NOT_FILLED

+ +

Example:

+$lineplot->AddArea(2,5,LP_AREA_FILLED,"indianred1"); + +

+

+

 

LinePlot ::
LinePlot($datay, $datax)
+ +Public Constructor for LinePlot +

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + No description available
+$datax + + + +false + +X-data
+ +

Description:
Create a new LinePlot which later can be added to the graph with the Graph::Add() or Graph::AddY2() method. +

+A plot can be specified with either only Y-values or both Y-and X-values. If both X and Y values are specified they should have the same number of elements. 
+  

See also:
+

Example:

+
$lineplot 
= new LinePlot($ydata); +
+

+

+

 

LinePlot ::
SetBarCenter($aFlag)
+ +Adjust the positioning of line plots when combined with a bar plot

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +TRUE = Align line points to center of bars
+ +

Description:
By default the lineplots gets aligned to the left side of the bars when using a text X-scale. By calling this method the line points instead gets aligned to the center of the bars. +

+This method is only to be used in the case where line and bar plots are combined. Any other use is undefined. 
+ +

Example:

+$ydata = array(12,15,22,19,5);
$graph = new Graph(400,200);
$graph->SetScale("textlin");
$line = new LinePlot($ydata);
$line->SetBarCenter();
$bar = new BarPlot($ydata);
$graph->Add($bar);
$graph->Add($line);
+
+

+

+

 

LinePlot ::
SetColor($aColor)
+ +Set color for the line plot.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify color for line. 
+ +

Example:

+$lp = new LinePlot($ydata);

// Set full blue
$lp->SetColor('#0000FF'); +
+

+

+

 

LinePlot ::
SetFastStroke($aFlg)
+ +Use Fast version of Stroke()

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +TRUE=Use fast stroke
+ +

Description:
Use Fast version of Stroke(). This is useful for line plots which have many thousand points. This method is a lot faster than the usual Stroke() but also have a lot less functionality and puts restriction on the complexity of the line. The lines can have no plotmarks, must be solid and have a line width of 1 
+ +

Example:

+$lineplot->SetFastStroke() + +

+

+

 

LinePlot ::
SetFillColor($aColor, $aFilled)
+ +Specify fill color

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+$aFilled + + + +true + +Flag. Filled or not
+ +

Description:
Specify that a lineplot should be filled as well as the fill color. 
+  
See also:
+

Example:

+$lp->SetFillColor('green');
+
+

+

+

 

LinePlot ::
SetFillFromYMin($f)
+ +Fill line not from 0 but from the minimum Y value

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +TRUE=fill from minimum
+ +

Description:
Fill line not from 0 (as default) but from the minimum Y value. This is mostly usefull when a plot have the negative value and the X-axis is placed at the minimum Y-alue (at the bottom) 
+ +

Example:

+$lineplot->SetFillFromYMin();
+
+

+

+

 

LinePlot ::
SetFillGradient($aFromColor, $aToColor, $aNumColors, $aFilled)
+ +Specify a gradient fill for the line plot

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aFromColor + + + Start color
+$aToColor + + + End color
+$aNumColors + + + +100 + +Number of colors to use in transition
+$aFilled + + + +true + +TRUE=Enable gradient fill
+ +

Description:
Specify a gradient fill for the line plot. Currently only vertical gradient fill is supported, i.e. the transiiton from color 1 to color 2 is vertical. + 
+ +

Example:

+$p1 = new LinePlot($datay);
$p1->SetFillGradient('white','darkgreen');
+
+

+

+

 

LinePlot ::
SetStepStyle($aFlag)
+ +Use step style for line graph.

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +Flag. true to use step style.
+ +

Description:
If the step style is enabled then each point will be connected not with a straight line between the points but with one horizontal and one vertical line. This makes the graph look like a stair where the next data point indicates if the stair is going up or down. + 
+ +

Example:

+$lp->SetStepStyle();
+
+

+

+

 

LinePlot ::
SetStyle($aStyle)
+ +Specify line style.

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + Text string to specify line
+ +

Description:
Linestyle for lines. Valid linestyles are:
+'solid', 'dotted', 'dashed' +

+The default line style is 'solid' + 
+  

See also:
+

Example:

+$lp->SetStyle('dotted');
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LineProperty.html b/includes/jpgraph/docs/classref/LineProperty.html new file mode 100644 index 0000000..67e504d --- /dev/null +++ b/includes/jpgraph/docs/classref/LineProperty.html @@ -0,0 +1,141 @@ +


Class LineProperty
+(Defined in: jpgraph.php : 2945)
 
 LineProperty 
 SetColor() 
SetStyle() 
SetWeight() 
Show() 
__construct() 
+
 

Class usage and Overview
Property class to define properties for a line. Currently used only by Gantt chart to specify the grid line properties.

  +


Class Methods

+

 

LineProperty ::
SetColor($aColor)
+ +Set line color

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Set line color 
+ +

Example:

+$gantgraph->grid->SetColor('darkgrey'); + +

+

+

 

LineProperty ::
SetStyle($aStyle)
+ +Set line style

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + Line style
+ +

Description:
Linestyle for lines. Valid linestyles are:
+'solid', 'dotted', 'dashed' +

+The default line style is 'solid' 
+  

See also:
+

Example:

+$gantgraph->grid->SetColor('darkgrey'); + +

+

+

 

LineProperty ::
SetWeight($aWeight)
+ +Specify weight of the line

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Line width in pixels
+ +

Description:
Set line width 
+ +

Example:

+$gantgraph->grid->SetWeight(2); + +

+

+

 

LineProperty ::
Show($aShow)
+ +Determine if the line should be hidden or not

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +True=Display line
+ +

Description:
Show line, default is to hide the line. 
+ +

Example:

+$gantgraph->grid->Show(false); // Hide the grid + +

+

+

 

LineProperty ::
__construct($aWeight, $aColor, $aStyle)
+ +//===================================================// CLASS LineProperty// Description: Holds properties for a line//===================================================

+ + + + + + + + +
ArgumentDefaultDescription
+$aWeight + + + +1 + +No description available
+$aColor + + + +'black' + +No description available
+$aStyle + + + +'solid' + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LinearRegression.html b/includes/jpgraph/docs/classref/LinearRegression.html new file mode 100644 index 0000000..c7dee8c --- /dev/null +++ b/includes/jpgraph/docs/classref/LinearRegression.html @@ -0,0 +1,87 @@ +


Class LinearRegression
+(Defined in: jpgraph_utils.inc.php : 508)
 
 LinearRegression 
 Calc() 
GetAB() 
GetStat() 
GetY() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

LinearRegression ::
Calc()
+ +

+
+ +

Description:
No description available.

+

 

LinearRegression ::
GetAB()
+ +

+
+ +

Description:
No description available.

+

 

LinearRegression ::
GetStat()
+ +

+
+ +

Description:
No description available.

+

 

LinearRegression ::
GetY($aMinX, $aMaxX, $aStep)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aMinX + + + No description available
+$aMaxX + + + No description available
+$aStep + + + +1 + +No description available
+ +

Description:
No description available.

+

 

LinearRegression ::
__construct($aDataX, $aDataY)
+ +//=============================================================================// Class LinearRegression//=============================================================================

+ + + + + + +
ArgumentDefaultDescription
+$aDataX + + + No description available
+$aDataY + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LinearScale.html b/includes/jpgraph/docs/classref/LinearScale.html new file mode 100644 index 0000000..7b178a3 --- /dev/null +++ b/includes/jpgraph/docs/classref/LinearScale.html @@ -0,0 +1,134 @@ +


Class LinearScale
+(Defined in: jpgraph.php : 4397)
 
 LinearScale 
 SetAutoMax() 
SetAutoMin() 
SetAutoTicks() 
SetGrace() 
+
 

Class usage and Overview
This class is the main scale class and implements the linear and integer scale for the axis.

  +

See also related classes:
Axis and LogScale

 


Class Methods

+

 

LinearScale ::
SetAutoMax($aMax)
+ +Fix the maximum value for a scale

+ + + + +
ArgumentDefaultDescription
+$aMax + + + Maximum value
+ +

Description:
Fix a maximum value for a scale eventhough autoscaling is used for the min value. 
+ +

Example:

+// For a negative scale we might want to make sure it
// always start at the top from 0
$graph->y2scale->SetAutoMax(0); +
+

+

+

 

LinearScale ::
SetAutoMin($aMin)
+ +Set the minimum data value when the autoscaling is used.

+ + + + +
ArgumentDefaultDescription
+$aMin + + + Min value
+ +

Description:
Set the minimum data value when the autoscaling is used. Usefull if you want a fix minimum (like 0) but automtic maximum value. 
+ +

Example:

+// Just let the maximum be autoscaled
$graph->yaxis->scale->SetAutoMin(0); +
+

+

+

 

LinearScale ::
SetAutoTicks($aFlag)
+ +Determine ticks automtically with manual scale

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +TRUE = determine ticks automatically
+ +

Description:
This is used in conjunction when a manual scale is specified. In normall cases one has also to specify major and minor tick steps. +

+For example:
+ +$graph->SetScale("textlin",0,70);
+$graph->yscale->ticks->Set(10,2); +

+However by instead using +

+$graph->SetScale("textlin",0,70);
+$graph->yscale->SetAutoTicks(); +

+The major and minor ticks are determined automatically. +

+The thing you have to be aware of is that the specified min and max values might be slightly modified so that the end/beginning of the scale will fall on a major tick step. +

+By default the auto ticks are off. + + + 
+  

See also:
+

Example:

+// Manually set Y-scale min=30, max=90
$graph->SetScale('textlin',30,90);

// Let JpGraph figure out suitable tick marks
$graph->yscale->SetAutoTicks();

+
+

+

+

 

LinearScale ::
SetGrace($aGraceTop, $aGraceBottom)
+ +// Specify scale "grace" value (top and bottom)

+ + + + + + +
ArgumentDefaultDescription
+$aGraceTop + + + Top grace value
+$aGraceBottom + + + +0 + +Bottom grace value
+ +

Description:
By default the autoscaling determines the minimum and maximum as close to the plots min and max values as possible. Sometimes this might not be suitable and you need some more "air". For example if you plot a bar plot with values on top of the bar. If the bar reaces the max value (which is also the scale end point) the value on top of the bar might be out in the margin.) +

+By specifyin the grace you get added space. The value specified is interpretated as extra percentage of the total scale range. +

+For example if the scale range (without grace) is (0,100) and you add 10% top grace (with SetGrace(10)) the modified scale will be (0,110) and if you use a 100% top grace the scale will be (0,200) and so on. 
+ +

Example:

+$graph->xaxis->scale->SetGrace(50); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LinearTicks.html b/includes/jpgraph/docs/classref/LinearTicks.html new file mode 100644 index 0000000..09432ef --- /dev/null +++ b/includes/jpgraph/docs/classref/LinearTicks.html @@ -0,0 +1,189 @@ +


Class LinearTicks Extends Ticks
+(Defined in: jpgraph.php : 4032)
 
 LinearTicks  Ticks 
 AdjustForDST() 
GetMajor() 
GetMinor() 
Set() 
SetMajTickPositions() 
SetTextLabelStart() 
SetTickPositions() 
+
 SetColor() 
SetFormatCallback() 
SetLabelFormat() 
SetSide() 
SetSize() 
SetWeight() 
SupressFirst() 
SupressLast() 
SupressMinorTickMarks() 
SupressTickMarks() 
SupressZeroLabel() 
+
 

Class usage and Overview
Internal class that handles the drawing and formatting of the tick marks on each axis. This class is accessed through it'sinstance variable in the scale, e.g. +

+$graph->xaxis->scale->ticks->Set(20,10); +

+Note: When you manually specify a scale you must also specify the major/minor tick intervall.

  +

See also related classes:
LinearScale and LogScale

 


Class Methods

+

 

LinearTicks ::
AdjustForDST($aFlg)
+ +// For a normal linear type of scale the major ticks will always be multiples// of the minor ticks. In order to avoid any rounding issues the major ticks are// defined as every "step" minor ticks and not calculated separately

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

LinearTicks ::
GetMajor()
+ +Return major step size in world coordinates

+
+ +

Description:
Return major step size in world coordinates 
+ +

Example:

+$majintervall $graph->xaxis->scale->ticks->Getmajor(); + +

+

+

 

LinearTicks ::
GetMinor()
+ +// Return minor step size in world coordinates

+
+ +

Description:
Return minor step size in world coordinates. 
+ +

Example:

+$majintervall $graph->xaxis->scale->ticks->Getmajor(); + +

+

+

 

LinearTicks ::
Set($aMajStep, $aMinStep)
+ +// Set Minor and Major ticks (in world coordinates)

+ + + + + + +
ArgumentDefaultDescription
+$aMajStep + + + Distance between major tick marks
+$aMinStep + + + +false + +Distance between minor tick marks
+ +

Description:
Set Minor and Major tick intervall (in world coordinates) 
+ +

Example:

+$graph->yaxis->scale->ticks->Set(40,20); + +

+

+

 

LinearTicks ::
SetMajTickPositions($aMajPos, $aLabels)
+ +//(" Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem."

+ + + + + + +
ArgumentDefaultDescription
+$aMajPos + + + No description available
+$aLabels + + + +NULL + +No description available
+ +

Description:
No description available.

+

 

LinearTicks ::
SetTextLabelStart($aTextLabelOff)
+ +Which tick label should we start with?

+ + + + +
ArgumentDefaultDescription
+$aTextLabelOff + + + The number thaht the automatic textscale should start with.
+ +

Description:
Normally text labels start at 0. However, automtic text labels can be started with an arbitrary number as specified with the argument to this method. + 
+ +

Example:

+$graph->xaxis->scale->ticks->SetTextLabelStart(10);
+
+

+

+

 

LinearTicks ::
SetTickPositions($aMajPos, $aMinPos, $aLabels)
+ +Manually specify tick positions for the axis

+ + + + + + + + +
ArgumentDefaultDescription
+$aMajPos + + + Array of major positions
+$aMinPos + + + +NULL + +Array of minor positions
+$aLabels + + + +NULL + +Array of major label strings
+ +

Description:
Manually specify major and minor tick positions for the axis together with the optional label strings. If no label array is specified then the numerical values at the positions of the major tick marks will be used as label strings. 
+ +

Example:

+$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LogScale.html b/includes/jpgraph/docs/classref/LogScale.html new file mode 100644 index 0000000..c84dde6 --- /dev/null +++ b/includes/jpgraph/docs/classref/LogScale.html @@ -0,0 +1,45 @@ +


Class LogScale Extends LinearScale
+(Defined in: jpgraph_log.php : 19)
 
 LogScale  LinearScale 
 GetMaxVal() 
GetMinVal() 
+
 SetAutoMax() 
SetAutoMin() 
SetAutoTicks() 
SetGrace() 
+
 

Class usage and Overview
Implements a logarithmic scale. Normally accessed through the axis 'scale' property, for example $graph->xaxis->sclal

  +

See also related classes:
LinearScale and Axis

 


Class Methods

+

 

LogScale ::
GetMaxVal()
+ +Get max value for scale.

+
+ +

Description:
Get max scale value for scale. 
+  
See also:
+

Example:

+$max $graph->yaxis->scale->GetMaxVal(); + +

+

+

 

LogScale ::
GetMinVal()
+ +Get minimum scale value.

+
+ +

Description:
Get minimum scale value. 
+  
See also:
+

Example:

+$max $graph->yaxis->scale->GetMinVal(); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/LogTicks.html b/includes/jpgraph/docs/classref/LogTicks.html new file mode 100644 index 0000000..0ec4198 --- /dev/null +++ b/includes/jpgraph/docs/classref/LogTicks.html @@ -0,0 +1,56 @@ +


Class LogTicks Extends Ticks
+(Defined in: jpgraph_log.php : 129)
 
 LogTicks  Ticks 
 SetLabelLogType() 
+
 SetColor() 
SetFormatCallback() 
SetLabelFormat() 
SetSide() 
SetSize() 
SetWeight() 
SupressFirst() 
SupressLast() 
SupressMinorTickMarks() 
SupressTickMarks() 
SupressZeroLabel() 
+
 

Class usage and Overview
This class represents ticks on a logarithmic scale axis. It is responsible for drawing and positioning ticks.

  +

See also related classes:
LogScale and Axis

 


Class Methods

+

 

LogTicks ::
SetLabelLogType($aType)
+ +Should the log labels be dispalyed with magnitudes ot plain numbers

+ + + + +
ArgumentDefaultDescription
+$aType + + + Magnitude (10^x) or plain
+ +

Description:
Specify how labels for log scales should be formatted as magnitude (scientific) or plain. +

+$aType can be either +

+ +By default log scale uses magnitude type of labels. + 
+ +

Example:

+$graph->yaxis->scale->ticks->SetLabelLogType(LOGLABELS_PLAIN); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/MGraph.html b/includes/jpgraph/docs/classref/MGraph.html new file mode 100644 index 0000000..2e5115d --- /dev/null +++ b/includes/jpgraph/docs/classref/MGraph.html @@ -0,0 +1,484 @@ +


Class MGraph
+(Defined in: jpgraph_mgraph.php : 16)
 
 MGraph 
 Add() 
AddMix() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetExpired() 
SetFillColor() 
SetFrame() 
SetImgFormat() 
SetMargin() 
Stroke() 
_gdImgHandle() 
_strokeBackgroundImage() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

MGraph ::
Add($aGraph, $x, $y, $fx, $fy, $w, $h)
+ +

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+$x + + + +0 + +No description available
+$y + + + +0 + +No description available
+$fx + + + +0 + +No description available
+$fy + + + +0 + +No description available
+$w + + + +0 + +No description available
+$h + + + +0 + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
AddMix($aGraph, $x, $y, $mix, $fx, $fy, $w, $h)
+ +// Just copy the image from left corner, no resizing

+ + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+$x + + + +0 + +No description available
+$y + + + +0 + +No description available
+$mix + + + +100 + +No description available
+$fx + + + +0 + +No description available
+$fy + + + +0 + +No description available
+$w + + + +0 + +No description available
+$h + + + +0 + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetBackgroundImage($aFileName, $aCenter_aX, $aY)
+ +// Specify a background image

+ + + + + + + + +
ArgumentDefaultDescription
+$aFileName + + + No description available
+$aCenter_aX + + + +NULL + +No description available
+$aY + + + +NULL + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetBackgroundImageMix($aMix)
+ +// Specify a background image blend

+ + + + +
ArgumentDefaultDescription
+$aMix + + + No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetExpired($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetFillColor($aColor)
+ +// Specify background fill color for the combined graph

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetFrame($aFlg, $aColor, $aWeight)
+ +// Add a frame around the combined graph

+ + + + + + + + +
ArgumentDefaultDescription
+$aFlg + + + No description available
+$aColor + + + +'black' + +No description available
+$aWeight + + + +1 + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetImgFormat($aFormat, $aQuality)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aFormat + + + No description available
+$aQuality + + + +75 + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
SetMargin($lm, $rm, $tm, $bm)
+ +//('Argument to MGraph::Add() is not a valid GD image handle.');

+ + + + + + + + + + +
ArgumentDefaultDescription
+$lm + + + No description available
+$rm + + + No description available
+$tm + + + No description available
+$bm + + + No description available
+ +

Description:
No description available.

+

 

MGraph ::
Stroke($aFileName)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFileName + + + +'' + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
_gdImgHandle($agdCanvas, $x, $y, $fx, $fy, $w, $h, $mix)
+ +

+ + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$agdCanvas + + + No description available
+$x + + + No description available
+$y + + + No description available
+$fx + + + +0 + +No description available
+$fy + + + +0 + +No description available
+$w + + + +0 + +No description available
+$h + + + +0 + +No description available
+$mix + + + +100 + +No description available
+ +

Description:
No description available.

+

 

MGraph ::
_strokeBackgroundImage()
+ +//('Unknown file extension ($aImgFormat) in MGraph::SetBackgroundImage() for filename: '.$aFileName);

+
+ +

Description:
No description available.

+

 

MGraph ::
__construct($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline)
+ +// Create a new instane of the combined graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aWidth + + + +NULL + +No description available
+$aHeight + + + +NULL + +No description available
+$aCachedName + + + +'' + +No description available
+$aTimeOut + + + +0 + +No description available
+$aInline + + + +true + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/MatrixGraph.html b/includes/jpgraph/docs/classref/MatrixGraph.html new file mode 100644 index 0000000..da9ec2a --- /dev/null +++ b/includes/jpgraph/docs/classref/MatrixGraph.html @@ -0,0 +1,207 @@ +


Class MatrixGraph Extends Graph
+(Defined in: jpgraph_matrix.php : 22)
 
 MatrixGraph  Graph 
 Add() 
AddText() 
SetColor() 
Stroke() 
StrokeIcons() 
StrokeTexts() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

MatrixGraph ::
Add($aObj)
+ +// Since Windrose graphs doesn't have any linear scale the position of// each icon has to be given as absolute coordinates

+ + + + +
ArgumentDefaultDescription
+$aObj + + + No description available
+ +

Description:
No description available.

+

 

MatrixGraph ::
AddText($aTxt, $aToY2)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aTxt + + + No description available
+$aToY2 + + + +false + +No description available
+ +

Description:
No description available.

+

 

MatrixGraph ::
SetColor($c)
+ +

+ + + + +
ArgumentDefaultDescription
+$c + + + No description available
+ +

Description:
No description available.

+

 

MatrixGraph ::
Stroke($aStrokeFileName)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +No description available
+ +

Description:
No description available.

+

 

MatrixGraph ::
StrokeIcons()
+ +// Since Windrose graphs doesn't have any linear scale the position of// each icon has to be given as absolute coordinates

+
+ +

Description:
No description available.

+

 

MatrixGraph ::
StrokeTexts()
+ +

+
+ +

Description:
No description available.

+

 

MatrixGraph ::
__construct($width, $height, $cachedName, $timeout, $inline)
+ +// Internal debug flag

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$width + + + +300 + +No description available
+$height + + + +200 + +No description available
+$cachedName + + + +"" + +No description available
+$timeout + + + +0 + +No description available
+$inline + + + +1 + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/MatrixLegend.html b/includes/jpgraph/docs/classref/MatrixLegend.html new file mode 100644 index 0000000..5231bcc --- /dev/null +++ b/includes/jpgraph/docs/classref/MatrixLegend.html @@ -0,0 +1,363 @@ +


Class MatrixLegend
+(Defined in: jpgraph_matrix.php : 159)
 
 MatrixLegend 
 getLength() 
getWidth() 
InitSize() 
SetBox() 
SetFont() 
SetFormatString() 
SetLabelMargin() 
SetLayout() 
SetMargin() 
SetMinMax() 
SetModuleSize() 
SetSize() 
Show() 
Stroke() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

MatrixLegend ::
getLength(, $aImg)
+ +

+ + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
getWidth(, $aImg)
+ +

+ + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
InitSize(, $aImg)
+ +

+ + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetBox($aColor, $aWeight, $aStyle, $aFlg)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aColor + + + +'black' + +No description available
+$aWeight + + + +1 + +No description available
+$aStyle + + + +'solid' + +No description available
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetFont($aFamily, $aStyle, $aSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFamily + + + No description available
+$aStyle + + + No description available
+$aSize + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetFormatString($aStr)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStr + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetLabelMargin($aMarg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetLayout($aLayout)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLayout + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetMargin($aMarg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetMinMax($aMin, $aMax)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aMin + + + No description available
+$aMax + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetModuleSize($aBucketWidth, $aBucketHeight)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aBucketWidth + + + No description available
+$aBucketHeight + + + +5 + +No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
SetSize($aWidth, $aHeight)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aWidth + + + No description available
+$aHeight + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
Show($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
Stroke(, $aImg, $xs, $ys)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+$xs + + + No description available
+$ys + + + No description available
+ +

Description:
No description available.

+

 

MatrixLegend ::
__construct(, $aColorMap)
+ +// Finally stream the generated picture

+ + + + + + +
ArgumentDefaultDescription
+ + + + +ColorMap + +No description available
+$aColorMap + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/MatrixPlot.html b/includes/jpgraph/docs/classref/MatrixPlot.html new file mode 100644 index 0000000..1d7ce6f --- /dev/null +++ b/includes/jpgraph/docs/classref/MatrixPlot.html @@ -0,0 +1,376 @@ +


Class MatrixPlot
+(Defined in: jpgraph_matrix.php : 413)
 
 MatrixPlot 
 GetHeight() 
GetWidth() 
InitSize() 
SetAlpha() 
SetAutoContrast() 
SetBackgroundColor() 
SetBox() 
SetCenterPos() 
SetLegendLayout() 
SetMargin() 
SetModuleSize() 
SetModuleType() 
SetPos() 
SetSize() 
SetupColormap() 
Stroke() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

MatrixPlot ::
GetHeight(, $aImg)
+ +// On bottom or top

+ + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
GetWidth(, $aImg)
+ +// Setup the colormap based on the values in the matrix

+ + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
InitSize(, $aImg)
+ +// On right or left

+ + + + + + +
ArgumentDefaultDescription
+ + + + +Image + +No description available
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetAlpha($aAlpha)
+ +

+ + + + +
ArgumentDefaultDescription
+$aAlpha + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetAutoContrast($aContrast)
+ +

+ + + + +
ArgumentDefaultDescription
+$aContrast + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetBackgroundColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetBox($aColor, $aWeight, $aStyle, $aFlg)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aColor + + + +'black' + +No description available
+$aWeight + + + +1 + +No description available
+$aStyle + + + +'solid' + +No description available
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetCenterPos($aX, $aY)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + No description available
+$aY + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetLegendLayout($aLayout, $aMargin)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aLayout + + + No description available
+$aMargin + + + +25 + +No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetMargin($aMarg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetModuleSize($aW, $aH)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aW + + + No description available
+$aH + + + +null + +No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetModuleType($aType)
+ +

+ + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetPos($aX, $aY)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + No description available
+$aY + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetSize($aWidth, $aHeight)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aWidth + + + No description available
+$aHeight + + + +null + +No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
SetupColormap()
+ +

+
+ +

Description:
No description available.

+

 

MatrixPlot ::
Stroke(, $aGraph)
+ +// Now adjust module size to get close to the specified with/height

+ + + + + + +
ArgumentDefaultDescription
+ + + + +MatrixGraph + +No description available
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

MatrixPlot ::
__construct($aData, $aMeshInt)
+ +// Max value

+ + + + + + +
ArgumentDefaultDescription
+$aData + + + No description available
+$aMeshInt + + + +1 + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/MeshInterpolate.html b/includes/jpgraph/docs/classref/MeshInterpolate.html new file mode 100644 index 0000000..97167eb --- /dev/null +++ b/includes/jpgraph/docs/classref/MeshInterpolate.html @@ -0,0 +1,63 @@ +


Class MeshInterpolate
+(Defined in: jpgraph_meshinterpolate.inc.php : 26)
 
 MeshInterpolate 
 IntSquare() 
Linear() 
+
 

Class usage and Overview

  +


Class Methods

+

 

MeshInterpolate ::
IntSquare($aRow, $aCol, $aFactor)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aRow + + + No description available
+$aCol + + + No description available
+$aFactor + + + No description available
+ +

Description:
No description available.

+

 

MeshInterpolate ::
Linear(&$aData, $aIntFactor)
+ +

+ + + + + + +
ArgumentDefaultDescription
+&$aData + + + No description available
+$aIntFactor + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/MileStone.html b/includes/jpgraph/docs/classref/MileStone.html new file mode 100644 index 0000000..6547c4d --- /dev/null +++ b/includes/jpgraph/docs/classref/MileStone.html @@ -0,0 +1,63 @@ +


Class MileStone Extends GanttPlotObject
+(Defined in: jpgraph_gantt.php : 3460)
 
 MileStone  GanttPlotObject 
 __construct() 
+
 SetCaptionMargin() 
SetConstrain() 
SetCSIMAlt() 
SetCSIMTarget() 
SetLabelLeftMargin() 
+
 

Class usage and Overview
Represents a milestone in the GanttChart. A milstone is created by specifyin a date.

  +

See also related classes:
GanttGraph

 


Class Methods

+

 

MileStone ::
__construct($aVPos, $aLabel, $aDate, $aCaption)
+ +Create a new milestone in a GanttGraph

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aVPos + + + Row for milestone
+$aLabel + + + Label
+$aDate + + + Position on the date scale
+$aCaption + + + +"" + +Caption string
+ +

Description:
A milestone is by default displayed as a "Diamond" mark at a specified row at a specified date. It can also have a caption to the right of the milestone mark. + 
+  
See also:
+

Example:

+$graph = new GanttGraph();

// Setup the gantt graph...
...

$ms = new MileStone(7,"M5","2002-01-28","28/1");
$graph->Add($ms); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/OdoGraph.html b/includes/jpgraph/docs/classref/OdoGraph.html new file mode 100644 index 0000000..d2df977 --- /dev/null +++ b/includes/jpgraph/docs/classref/OdoGraph.html @@ -0,0 +1,168 @@ +


Class OdoGraph Extends Graph
+(Defined in: jpgraph_odo.php : 60)
 
 OdoGraph  Graph 
 Add() 
Stroke() 
StrokeIcons() 
StrokeTexts() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

OdoGraph ::
Add($aObj)
+ +

+ + + + +
ArgumentDefaultDescription
+$aObj + + + No description available
+ +

Description:
No description available.

+

 

OdoGraph ::
Stroke($aStrokeFileName)
+ +// Since Windrose graphs doesn't have any linear scale the position of// each icon has to be given as absolute coordinates

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +No description available
+ +

Description:
No description available.

+

 

OdoGraph ::
StrokeIcons()
+ +// Since Windrose graphs doesn't have any linear scale the position of// each icon has to be given as absolute coordinates

+
+ +

Description:
No description available.

+

 

OdoGraph ::
StrokeTexts()
+ +

+
+ +

Description:
No description available.

+

 

OdoGraph ::
__construct($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline)
+ +//===================================================// CLASS OdoGraph// Description: Main class to handle odometer graphs//===================================================

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aWidth + + + +-1 + +No description available
+$aHeight + + + +-1 + +No description available
+$aCachedName + + + +"" + +No description available
+$aTimeOut + + + +0 + +No description available
+$aInline + + + +true + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/OdoNeedle.html b/includes/jpgraph/docs/classref/OdoNeedle.html new file mode 100644 index 0000000..5ba51ca --- /dev/null +++ b/includes/jpgraph/docs/classref/OdoNeedle.html @@ -0,0 +1,229 @@ +


Class OdoNeedle
+(Defined in: jpgraph_odo.php : 204)
 
 OdoNeedle 
 Set() 
SetColor() 
SetFillColor() 
SetLength() 
SetLineWeight() 
SetShadow() 
SetStyle() 
SetWeight() 
Show() 
Stroke() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

OdoNeedle ::
Set($aVal)
+ +

+ + + + +
ArgumentDefaultDescription
+$aVal + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetColor($aColor)
+ +// Linepropery IMPORTS

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetFillColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetLength($aLen)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLen + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetLineWeight($aWeight)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetShadow($aShadow, $aColor, $aDx, $aDy)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aShadow + + + +true + +No description available
+$aColor + + + +"darkgray@0.4" + +No description available
+$aDx + + + +4 + +No description available
+$aDy + + + +4 + +No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetStyle($aStyle, $aStyleParameter1, $aStyleParameter2)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aStyle + + + No description available
+$aStyleParameter1 + + + +-1 + +No description available
+$aStyleParameter2 + + + +-1 + +No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
SetWeight($aWeight)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
Show($aShow)
+ +

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
Stroke($img, $aOdometer)
+ +// Stroke needs dummy argument to have the same argument list as the parent

+ + + + + + +
ArgumentDefaultDescription
+$img + + + No description available
+$aOdometer + + + No description available
+ +

Description:
No description available.

+

 

OdoNeedle ::
__construct()
+ +// LineProperty attributes that has been imported

+
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/OdoScale.html b/includes/jpgraph/docs/classref/OdoScale.html new file mode 100644 index 0000000..75c2132 --- /dev/null +++ b/includes/jpgraph/docs/classref/OdoScale.html @@ -0,0 +1,231 @@ +


Class OdoScale
+(Defined in: jpgraph_odo.php : 374)
 
 OdoScale 
 Set() 
SetAngle() 
SetLabelFormat() 
SetLabelPos() 
SetTickColor() 
SetTickLength() 
SetTicks() 
SetTickWeight() 
Show() 
Stroke() 
Translate() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

OdoScale ::
Set($aMin, $aMax)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aMin + + + No description available
+$aMax + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetAngle($aStart, $aEnd)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aStart + + + No description available
+$aEnd + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetLabelFormat($aFormat)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFormat + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetLabelPos($aPos)
+ +

+ + + + +
ArgumentDefaultDescription
+$aPos + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetTickColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetTickLength($aLength)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLength + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetTicks($aMinTick, $aLabelInterval)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aMinTick + + + No description available
+$aLabelInterval + + + +1 + +No description available
+ +

Description:
No description available.

+

 

OdoScale ::
SetTickWeight($aWeight)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
Show($aShow)
+ +//("Value for odometer ($aVal) is outside specified scale [$this->iMin,$this->iMax]");

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +No description available
+ +

Description:
No description available.

+

 

OdoScale ::
Stroke($img, $aOdometer)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$img + + + No description available
+$aOdometer + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
Translate($aVal)
+ +

+ + + + +
ArgumentDefaultDescription
+$aVal + + + No description available
+ +

Description:
No description available.

+

 

OdoScale ::
__construct($aStartAngle, $aEndAngle)
+ +//===================================================// CLASS OdoScale// Description: The scale for odometer//===================================================

+ + + + + + +
ArgumentDefaultDescription
+$aStartAngle + + + No description available
+$aEndAngle + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Odometer.html b/includes/jpgraph/docs/classref/Odometer.html new file mode 100644 index 0000000..d91d3ef --- /dev/null +++ b/includes/jpgraph/docs/classref/Odometer.html @@ -0,0 +1,292 @@ +


Class Odometer
+(Defined in: jpgraph_odo.php : 497)
 
 Odometer 
 AddIndication() 
FilledCircle() 
LayoutSize() 
SetBase() 
SetBorder() 
SetCenterAreaWidth() 
SetColor() 
SetMargin() 
SetPos() 
SetSize() 
Stroke() 
StrokeFascia() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

Odometer ::
AddIndication($aStart, $aEnd, $aColor)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aStart + + + No description available
+$aEnd + + + No description available
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
FilledCircle($img, $aXc, $aYc, $aRadius, $aFillColor)
+ +

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$img + + + No description available
+$aXc + + + No description available
+$aYc + + + No description available
+$aRadius + + + No description available
+$aFillColor + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
LayoutSize()
+ +// Dummy method to make odometers have the same signature as the// layout classes since odometer is "leaf" classes in the hierarchy

+
+ +

Description:
No description available.

+

 

Odometer ::
SetBase($aShowBase, $aWidth, $aColor1, $aColor2, $aColor3)
+ +

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aShowBase + + + No description available
+$aWidth + + + +0.1 + +No description available
+$aColor1 + + + +"navy" + +No description available
+$aColor2 + + + +"steelblue" + +No description available
+$aColor3 + + + +"white" + +No description available
+ +

Description:
No description available.

+

 

Odometer ::
SetBorder($aColor, $aWidth)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+$aWidth + + + +1 + +No description available
+ +

Description:
No description available.

+

 

Odometer ::
SetCenterAreaWidth($aWidth)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
SetColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
SetMargin($aMargin)
+ +// Only the first needle is shown by default

+ + + + +
ArgumentDefaultDescription
+$aMargin + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
SetPos($aXc, $aYc)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aXc + + + No description available
+$aYc + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
SetSize($aRadius)
+ +// Set size. A value in the range 0 to 1 is interpretated as// fraction of min(width,heigth) while a value > 1 is interpretated// as absolute size

+ + + + +
ArgumentDefaultDescription
+$aRadius + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
Stroke($graph)
+ +// Finally draw bottom line if ODO_HALF

+ + + + +
ArgumentDefaultDescription
+$graph + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
StrokeFascia($img)
+ +// Stroke the outline of the odometer

+ + + + +
ArgumentDefaultDescription
+$img + + + No description available
+ +

Description:
No description available.

+

 

Odometer ::
__construct($aStyle)
+ +//===================================================// CLASS Odometer// Description: Main class to draw a odometer//===================================================

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + +ODO_HALF + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/OdometerLabel.html b/includes/jpgraph/docs/classref/OdometerLabel.html new file mode 100644 index 0000000..3c6d980 --- /dev/null +++ b/includes/jpgraph/docs/classref/OdometerLabel.html @@ -0,0 +1,53 @@ +


Class OdometerLabel Extends Text
+(Defined in: jpgraph_odo.php : 486)
 
 OdometerLabel  Text 
 SetVPos() 
+
 Align() 
Center() 
GetFontHeight() 
GetTextHeight() 
GetWidth() 
Hide() 
ParagraphAlign() 
Set() 
SetAlign() 
SetAngle() 
SetBox() 
SetColor() 
SetCSIMTarget() 
SetFont() 
SetMargin() 
SetOrientation() 
SetParagraphAlign() 
SetPos() 
SetScalePos() 
SetShadow() 
SetWordWrap() 
Show() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

OdometerLabel ::
SetVPos($aPos)
+ +//===================================================// CLASS OdometerLabel// Description: Text on odometer//===================================================

+ + + + +
ArgumentDefaultDescription
+$aPos + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PieGraph.html b/includes/jpgraph/docs/classref/PieGraph.html new file mode 100644 index 0000000..a129481 --- /dev/null +++ b/includes/jpgraph/docs/classref/PieGraph.html @@ -0,0 +1,227 @@ +


Class PieGraph Extends Graph
+(Defined in: jpgraph_pie.php : 1210)
 
 PieGraph  Graph 
 Add() 
SetAntiAliasing() 
SetColor() 
Stroke() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview
The canvas for use with PiePlots. You add pie plots by calling the Add() method. +

+You can add several PiePlots by adjusting their size and positioning each PiePlot so it doesn't overlap eachother. +

  +

See also related classes:
PiePlot and PiePlot3D

 


Class Methods

+

 

PieGraph ::
Add($aObj)
+ +Add object to the pie graph

+ + + + +
ArgumentDefaultDescription
+$aObj + + + Object to add
+ +

Description:
Add a pieplots or text object to the pie graph. You can specify either a single object or an array. If you specify an array all object in the array must be of the same type.  
+ +

Example:

+$piegraph = new PieGraph(300,400);
$pieplot = new PiePlot($ydata);
$piegraph->Add($pieplot);
+
+

+

+

 

PieGraph ::
SetAntiAliasing($aFlg)
+ +Enable/disable anti-alias for Pie Graphs

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +true=enable anti-aliasing
+ +

Description:
Enable/disable anti-alias for Pie Graphs. This makes for much nicer looking PieGraphs. Please note that enabling anti-alias imposes some restrictions: +
+ +

Example:

+$piegraph->SetAntiAlias(); + +

+

+

 

PieGraph ::
SetColor($c)
+ +Set the background color. Synonym to SetMarginColor()

+ + + + +
ArgumentDefaultDescription
+$c + + + Color
+ +

Description:
Set the background color. Synonym to SetMarginColor() 
+  
See also:
+

Example:

+$piegraph->SetColor('gray');
+
+

+

+

 

PieGraph ::
Stroke($aStrokeFileName)
+ +// Method description

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +Filename
+ +

Description:
Stroke the piegraph to the browser or to a specified file if specified. Works exactly the same as Graph::Stroke() + 
+ +

Example:

+...
$piegraph->Stroke()
+
+

+

+

 

PieGraph ::
__construct($width, $height, $cachedName, $timeout, $inline)
+ +//---------------// CONSTRUCTOR +

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$width + + + +300 + +Width of graph
+$height + + + +200 + +Height of graph
+$cachedName + + + +"" + +Cache file name
+$timeout + + + +0 + +Cache timeout in s
+$inline + + + +1 + +Should the image be inline.
+ +

Description:
See Graph::Graph() 
+  
See also:
+

Example:

+$piegraph = new PieGraph(300,400);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PiePlot.html b/includes/jpgraph/docs/classref/PiePlot.html new file mode 100644 index 0000000..540423d --- /dev/null +++ b/includes/jpgraph/docs/classref/PiePlot.html @@ -0,0 +1,598 @@ +


Class PiePlot
+(Defined in: jpgraph_pie.php : 24)
 
 PiePlot 
 Explode() 
ExplodeAll() 
ExplodeSlice() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetGuideLines() 
SetGuideLinesAdjust() 
SetLabelPos() 
SetLabels() 
SetLabelType() 
SetLegends() 
SetShadow() 
SetSize() 
SetSliceColors() 
SetStartAngle() 
SetTheme() 
SetValueType() 
ShowBorder() 
__construct() 
+
 

Class usage and Overview
Creates a new Pie plot from the supplied data.

+By default the value (if enabled through the $pie->label->show() ) close to each slice will have a label corresponding to the percentage of that slice. +

+Each plot may have an arbitrary title which can be accessed through the ?title? property in the PiePlot class. The title will be automatically centred on top of the PiePlot clear of any possible labels. To set the title use the Set() method , i.e. $plot->title->Set(?MyTitle?). +

+To format the slice labels use the SetFormat() method of the value class.

  +

See also related classes:
PieGraph and PiePlot3D

 


Class Methods

+

 

PiePlot ::
Explode($aExplodeArr)
+ +Explode one or more slices as specified radius.

+ + + + +
ArgumentDefaultDescription
+$aExplodeArr + + + Explode specification
+ +

Description:
To emphasise a specific slice it can be exploded, i.e moved out fro the center of the pie plot. This method will allow you to specify what slices and to waht radius you want them exploded. +

+If you only want to explode a single slice you could also use the ExplodeSlice() method. + 
+  

See also:
+

Example:

+//To explode slice 0,2 to radius 100 you would call
$pieplot->Explode(array(100,0,100));
+
+

+

+

 

PiePlot ::
ExplodeAll($radius)
+ +Explode all slices a specified amount

+ + + + +
ArgumentDefaultDescription
+$radius + + + +20 + +Explode radius
+ +

Description:
Explode all slices a specified amount. If no radius is specified it will default to 20 pixels. 
+  
See also:
+

Example:

+$p1->ExplodeAll();
+
+

+

+

 

PiePlot ::
ExplodeSlice($e, $radius)
+ +Explode a single slice a specified radius

+ + + + + + +
ArgumentDefaultDescription
+$e + + + Which slice to explode
+$radius + + + +20 + +Radius to explode to
+ +

Description:
Explode a single slice to a specific radius. 
+  
See also:
+

Example:

+// Explode slice number 2 (the third slice) using the default
// explode radius.
$pieplot->ExplodeSlice(2); +
+

+

+

 

PiePlot ::
SetCenter($x, $y)
+ +//---------------// PUBLIC METHODS +

+ + + + + + +
ArgumentDefaultDescription
+$x + + + X-position as fraction of width
+$y + + + +0.5 + +Y-position as fraction of height
+ +

Description:
Set the center point for the PiePlot 
+  
See also:
+

Example:

+$pieplot->SetCenter(0.4,0.5);
+
+

+

+

 

PiePlot ::
SetColor($aColor)
+ +Specify frame color for pie.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color.
+ +

Description:
Set the color of the border around each slice. 
+  
See also:
+

Example:

+$pieplot->SetColor('red'); + +

+

+

 

PiePlot ::
SetCSIMTargets($aTargets, $aAlts, $aWinTargets)
+ +Specify URL targets for image maps

+ + + + + + + + +
ArgumentDefaultDescription
+$aTargets + + + No description available
+$aAlts + + + +'' + +No description available
+$aWinTargets + + + +'' + +No description available
+ +

Description:
Specify list of targets for the image map for each slice. The target should be a fully qualified URL. +

+Each slice will aslo have it's own 'alt' tag. Depending on the browser this tag is usually showed when the mouse is hold over a poarticular area on the image map. When formatting the alt strings can be specified as a printf() format string. The value supplied to the string will be the value for each slice. 
+  

See also:
+

Example:

+$targets = array('godetail1.html''gotodetail2.html' 'gotodetail3.html');
$alts = array('Year %d''Year %d''Year %d');

$pieplot->SetCSIMTargets($targets,$alts); +
+

+

+

 

PiePlot ::
SetGuideLines($aFlg, $aCurved, $aAlways)
+ +Enable guideline and set drawing policy

+ + + + + + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +TRUE=Enable guide lines
+$aCurved + + + +true + +Curve the labels around the pie
+$aAlways + + + +false + +Always use a guide line to the label
+ +

Description:
Enable guideline and set drawing policy for guide lines and labels 
+ +

Example:

+$pieplot->SetGuideLines(); + +

+

+

 

PiePlot ::
SetGuideLinesAdjust($aVFactor, $aRFactor)
+ +Adjuste the distance between labels and labels and pie

+ + + + + + +
ArgumentDefaultDescription
+$aVFactor + + + Vertical fraction
+$aRFactor + + + +0.8 + +Radius factor
+ +

Description:
Adjuste the distance between labels and labels and pie 
+ +

Example:

+$graph->xaxis->scale->SetGuideLinesAdjust(1.7); + +

+

+

 

PiePlot ::
SetLabelPos($aLblPosAdj)
+ +Adjust the positoin of slice labels

+ + + + +
ArgumentDefaultDescription
+$aLblPosAdj + + + Position as fraction of radius
+ +

Description:
Specify the position of the labels for each slice as a fraction of the radius. +

+Note: The adjustment affect both manually speicfied labels with SetLabels() as well as automtic labels. + 
+  

See also:
+

Example:

+$p1 = new PiePlot($data);
$p1->SetLabelPos(0.6);
$graph->Add($p1);
+
+

+

+

 

PiePlot ::
SetLabels($aLabels, $aLblPosAdj)
+ +Specify individual text labels for all slices

+ + + + + + +
ArgumentDefaultDescription
+$aLabels + + + Arrays of strings
+$aLblPosAdj + + + +"auto" + +Position as fraction of the radius
+ +

Description:
Normally pie slice gets assigned a label which displays either the percentage or the absolute value of a slice. These automtically asigned labels are positioned in a ring around the pie. +
+However, you can also manually assign a label to each slice individually with this method. +
+Each label can contain format specification so for example the label +

+"May %.1f%%" +

+would display the in the pie "May 28.3%" assuming you had choosen to use percentage values (SetLabelType()) +

+The second parameter specifies where to position these labels. The position is specified as a fraction of the radius of the pie plot or as the special strine 'auto'. If you specify this string value JpGraph will automtically determine the best position for the labels inside the pie. This is the default if you don't explicitely specify the position. +

+If you specify a value > 1.0 then the labels will +just be move further out. For example if you specify the position as 1.5 then the labels will move out a further 50% of the current pie radius. +

+Note: The actual alignment of the labels are dependent on the position. If the labels are just outside the pie they will be individually positioned according to the angle. If the labels are positioned inside the pie then the point of gravity within the text will be aligned with the specified position in the pie. + + 
+  

See also:
+

Example:

+$p1->SetLabelType(PIE_VALUE_PER);
$lbl = array("adam\n%.1f%%","bertil\n%.1f%%","kalle\n%.1f%%","peter\n%.1f%%","daniel\n%.1f%%","erik\n%.1f%%");
$p1->SetLabels($lbl);
+
+

+

+

 

PiePlot ::
SetLabelType($aType)
+ +Should we display actual value or percentage?

+ + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+ +

Description:
Specify if the value displayed by each slice (if the $pieplot->value->Show()) have been called shold be absolute or in percent. +

+The following values are allowed arguments: +

+The defauklt is to show percent. 
+ +

Example:

+// Show absolute values
$pieplot->SetLabelType(PIE_VALUE_ABS);

// Display each label with postfix 'kr', e.g. each label will
// look like (for example) 23.5 kr
$pieplot->value->SetFormat('%d kr');
$pieplot->value->Show();
+
+

+

+

 

PiePlot ::
SetLegends($aLegend)
+ +// Set label arrays

+ + + + +
ArgumentDefaultDescription
+$aLegend + + + Array of strings
+ +

Description:
Specify an array of text strings that should be used as legends for the slices. +

+Each text string can be formatted as a printf() format string since when printed they will be passed the value for that slice. +

+Tip: If you have many evry small slices then the labels close to the pie may be overwriting each other. In this case it is probably better to hide the labels by the slices and instead just show the values ion the legends. 
+ +

Example:

+$legends = array('April (%d)','May (%d)','June (%d)');

$pieplot->SetLegends($legends);

+
+

+

+

 

PiePlot ::
SetShadow($aColor, $aDropWidth)
+ +Add a drop shadow to the pie slices

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + +'darkgray' + +Shadow color
+$aDropWidth + + + +4 + +Drop distance for shadow
+ +

Description:
Add a drop shadow to the pie slices. +

+This is often more affective if one or more slices are exploded. 
+ +

Example:

+// Explode all slices
$p1->ExplodeAll(10);

// Add drop shadow
$p1->SetShadow();
+
+

+

+

 

PiePlot ::
SetSize($aSize)
+ +// Size in percentage

+ + + + +
ArgumentDefaultDescription
+$aSize + + + Size of radius
+ +

Description:
If the value specified is between 0 and 1 then it is interpreted as a a fraction of either height or width, whatever is smallest, of the graph. +

+If the value is >1 then it is interpretated as an absolute size in pixels. + 
+  

See also:
+

Example:

+$pieplot->SetSize(0.3); + +

+

+

 

PiePlot ::
SetSliceColors($aColors)
+ +Override theme coplros for slices

+ + + + +
ArgumentDefaultDescription
+$aColors + + + Array of colors
+ +

Description:
Normally the colors of the slices are set according to what color-theme you are using. You can however, override this by supplying an array of colors to be used for the slices. +

+If you supply fewer colors than pie-slices than the colors will be re-used from the beginning of the array. + 
+  

See also:
+

Example:

+$p1->SetSliceColors(array('red','green','blue')); + +

+

+

 

PiePlot ::
SetStartAngle($aStart)
+ +Speciy start angel for first slice

+ + + + +
ArgumentDefaultDescription
+$aStart + + + Start angle in degrees
+ +

Description:
Normally the first slice is drawn at 0 degrees, i.e. 3'a clock. With this method you can adjust that to an arbitrary angle. Positive angle will rotate the slice clockwise and a negative angle will move the slice counter-clockwise. +

+The angle should be specified in degrees. + 
+ +

Example:

+$pieplot->SetStartAngle(45); + +

+

+

 

PiePlot ::
SetTheme($aTheme)
+ +//Add the last point on the arc

+ + + + +
ArgumentDefaultDescription
+$aTheme + + + Theme name
+ +

Description:
Specify what color theme should be used for this pie. As of version 1.6.4 the following themes are available: + 
+ +

Example:

+$pieplot->SetTheme('water');
+
+

+

+

 

PiePlot ::
SetValueType($aType)
+ +DEPRECATED: See SetLabelType()

+ + + + +
ArgumentDefaultDescription
+$aType + + + Value type
+ +

Description:
See SetLabelType() 
+  
See also:
+

Example:

+NA + +

+

+

 

PiePlot ::
ShowBorder($exterior, $interior)
+ +// Should the circle around a pie plot be displayed

+ + + + + + +
ArgumentDefaultDescription
+$exterior + + + +true + +Display circle on the outer edge of pieplot
+$interior + + + +true + +Display the lines between each slice
+ +

Description:
Show the lines between each slice and the border around the pie. 
+ +

Example:

+// show both
$pieplot->ShowBorder(); +
+

+

+

 

PiePlot ::
__construct($data)
+ +Constructor for PiePlots

+ + + + +
ArgumentDefaultDescription
+$data + + + Data array for Pie
+ +

Description:
Construct a new pie plot which later can be added to Piegraph 
+  
See also:
+

Example:

+$pieplot = new PiePlot($slicedata);
$piegraph->Add($pieplot);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PiePlot3D.html b/includes/jpgraph/docs/classref/PiePlot3D.html new file mode 100644 index 0000000..54c4204 --- /dev/null +++ b/includes/jpgraph/docs/classref/PiePlot3D.html @@ -0,0 +1,345 @@ +


Class PiePlot3D Extends PiePlot
+(Defined in: jpgraph_pie3d.php : 17)
 
 PiePlot3D  PiePlot 
 Add3DSliceToCSIM() 
SetAngle() 
SetCSIMTargets() 
SetEdge() 
SetHeight() 
SetLabelMargin() 
SetLabels() 
SetLegends() 
SetSliceColors() 
SetStartAngle() 
__construct() 
+
 Explode() 
ExplodeAll() 
ExplodeSlice() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetGuideLines() 
SetGuideLinesAdjust() 
SetLabelPos() 
SetLabels() 
SetLabelType() 
SetLegends() 
SetShadow() 
SetSize() 
SetSliceColors() 
SetStartAngle() 
SetTheme() 
SetValueType() 
ShowBorder() 
__construct() 
+
 

Class usage and Overview
A 3D pie plot is much like a normal pie plot but in a 3D setting. You can control the apperance by specifying the angle of attack for the pie. A small angle show a very "flat" pie while a large angle shows almost a 2D pie. + +Please note that a 3D pie is much more CPU intensive to draw then the normal pie. To reduce the time you might want to keep the height of the pie as small as you think looks good. The height has a direct linear impact on how long it takes to draw a 3D pie. (See SetHeight()). + +To view a 3D pieplot you start by constructing a PieGraph() and then adding a numerb of constructed PiePlot3D to this graph. +

  +

See also related classes:
PieGraph and PiePlot

 


Class Methods

+

 

PiePlot3D ::
Add3DSliceToCSIM($i, $xc, $yc, $height, $width, $thick, $sa, $ea)
+ +//("PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees.");

+ + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$i + + + No description available
+$xc + + + No description available
+$yc + + + No description available
+$height + + + No description available
+$width + + + No description available
+$thick + + + No description available
+$sa + + + No description available
+$ea + + + No description available
+ +

Description:
No description available.

+

 

PiePlot3D ::
SetAngle($a)
+ +Specify projection angle for 3D in degrees.

+ + + + +
ArgumentDefaultDescription
+$a + + + Projection angle in degrees
+ +

Description:
Specify projection angle for 3D in degrees. Must be between 10 and 80 degrees. A small angle will make the pie very flat and a large angle will make it present much more of pie circle. 
+ +

Example:

+$pieplot->SetAngle(45);
+
+

+

+

 

PiePlot3D ::
SetCSIMTargets($aTargets, $aAlts, $aWinTargets)
+ +Specify URL for each slice for the image map

+ + + + + + + + +
ArgumentDefaultDescription
+$aTargets + + + No description available
+$aAlts + + + +'' + +No description available
+$aWinTargets + + + +'' + +No description available
+ +

Description:
Specify URL for each slice for the image map 
+ +

Example:

+$targets = array('nextimage.php?1''nextimage.php?2''nextimage.php?3');
// Show the actual value in the alt text when user hovers the
// cursor over the slice
$alts = array('More details..(%.1f)''More details..(%.1f)''More details..(%.1f)' );
$pie->SetCSIMTargets($targets,$alts);
+
+

+

+

 

PiePlot3D ::
SetEdge($aColor, $aWeight)
+ +Add a line around pie slices

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + +'black' + +Color for line
+$aWeight + + + +1 + +Width of line
+ +

Description:
Specify if the slices should be separated by a line? If color is specified as "" no line will be used to separate pie slices. + +Default is to not show any lines. 
+ +

Example:

+$pieplot3d->SetEdge('blue',1); + +

+

+

 

PiePlot3D ::
SetHeight($aHeight)
+ +Specify thickness of the 3D pie plot

+ + + + +
ArgumentDefaultDescription
+$aHeight + + + Height in pixels
+ +

Description:
Specify thickness of 3D pie plot. To minimize CPU usuage you should try to keep the thickness to the visual accepatble minimum. 
+ +

Example:

+$pieplot->SetHeight(20); + +

+

+

 

PiePlot3D ::
SetLabelMargin($m)
+ +Specify the distance from the pie to the labels

+ + + + +
ArgumentDefaultDescription
+$m + + + Margin in pixels
+ +

Description:
Specify the distance from the pie to the labels 
+ +

Example:

+$pieplot3d->SetLabelMargin(20); + +

+

+

 

PiePlot3D ::
SetLabels($aLabels, $aLblPosAdj)
+ +Specify slice labels for 3D pies

+ + + + + + +
ArgumentDefaultDescription
+$aLabels + + + Label arrays
+$aLblPosAdj + + + +"auto" + +Label position [0.2- 1]
+ +

Description:
Specify slice labels for 3D pies. Positoin specify the fraction of the radius wher the labels should be positoined. A values of 1 will position the labels outside the pie. +

+The labels may include an optional sprintf() formatting string. Before stroking the label to the graph it will be formatted with the actual value (absolute or percentage) depending on what has been specified with the SetLabelType() method. + 
+  

See also:
+

Example:

+// Specify explicit labels and position them outside the pie
$p1->SetLabels(array("Jan\n%.1f%%","Feb\n%.1f%%","Mar\n%.1f%%","Apr\n%.1f%%"),1);
+
+

+

+

 

PiePlot3D ::
SetLegends($aLegend)
+ +Set legends for slices

+ + + + +
ArgumentDefaultDescription
+$aLegend + + + Array of legends
+ +

Description:
Set legends for slices 
+ +

Example:

+$plot->SetLegends(array('Jan','Feb','Mar','Apr'); + +

+

+

 

PiePlot3D ::
SetSliceColors($aColors)
+ +Specify color of the individual slices

+ + + + +
ArgumentDefaultDescription
+$aColors + + + Array of colors
+ +

Description:
Specify color of the individual slices. If there are more slices than colors then the colors will wrap around. 
+ +

Example:

+$pieplot->SetSliceColors(array('red','blue','green','navy','orange')); + +

+

+

 

PiePlot3D ::
SetStartAngle($aStart)
+ +Specify start angle for first slice in the Pie

+ + + + +
ArgumentDefaultDescription
+$aStart + + + Start angle (in degrees)
+ +

Description:
Specify the start angle in degrees for the first slice in the Pie. Angles are counted counter-clockwise starting at "3'clock". 
+ +

Example:

+$pieplot->SetStartAngle(45); + +

+

+

 

PiePlot3D ::
__construct($data)
+ +//---------------// CONSTRUCTOR

+ + + + +
ArgumentDefaultDescription
+$data + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PiePlotC.html b/includes/jpgraph/docs/classref/PiePlotC.html new file mode 100644 index 0000000..47fa421 --- /dev/null +++ b/includes/jpgraph/docs/classref/PiePlotC.html @@ -0,0 +1,207 @@ +


Class PiePlotC Extends PiePlot
+(Defined in: jpgraph_pie.php : 1015)
 
 PiePlotC  PiePlot 
 SetMid() 
SetMidColor() 
SetMidCSIM() 
SetMidSize() 
SetMidTitle() 
__construct() 
+
 Explode() 
ExplodeAll() 
ExplodeSlice() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetGuideLines() 
SetGuideLinesAdjust() 
SetLabelPos() 
SetLabels() 
SetLabelType() 
SetLegends() 
SetShadow() 
SetSize() 
SetSliceColors() 
SetStartAngle() 
SetTheme() 
SetValueType() 
ShowBorder() 
__construct() 
+
 

Class usage and Overview
The PiePlotC is an extesnion of the normal pie plot where there is a filled circle in the center of the pie. This filled circle can have it's own labels and CSIM.

  +

See also related classes:
PiePlot

 


Class Methods

+

 

PiePlotC ::
SetMid($aTitle, $aColor, $aSize)
+ +Specify all parameters for the center circle

+ + + + + + + + +
ArgumentDefaultDescription
+$aTitle + + + Title text for center circle
+$aColor + + + +'white' + +Fill color for center circle
+$aSize + + + +0.5 + +Size of center. Specified as fraction of radius
+ +

Description:
Specify all parameters for the center circle 
+ +

Example:

+$piec->SetMid('Halteberg','red:0.6',0.3); + +

+

+

 

PiePlotC ::
SetMidColor($aColor)
+ +Specify fill color for center circle

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify fill color for center circle.  
+  
See also:
+

Example:

+$piec->SetMidColor('yellow:0.6');
+
+

+

+

 

PiePlotC ::
SetMidCSIM($aTarget, $aAlt, $aWinTarget)
+ +Specify URL target for filled middle circle

+ + + + + + + + +
ArgumentDefaultDescription
+$aTarget + + + Target URL string
+$aAlt + + + +'' + +Alt text
+$aWinTarget + + + +'' + +No description available
+ +

Description:
Specify URL target for filled middle circle. Use SetCSIMtargets() to specify the individual targets for the slices in the pie. + 
+  
See also:
+

Example:

+$pie->SetMidCSIM('depth.php?t=32','Details');
+
+

+

+

 

PiePlotC ::
SetMidSize($aSize)
+ +Specify size for center circle

+ + + + +
ArgumentDefaultDescription
+$aSize + + + Size in fraction of the radius
+ +

Description:
Specify size for center circle as fraction of the radius. 
+ +

Example:

+$piec->SetMidSize(0.5); + +

+

+

 

PiePlotC ::
SetMidTitle($aTitle)
+ +Specify title for the center circle.

+ + + + +
ArgumentDefaultDescription
+$aTitle + + + Title
+ +

Description:
Specify title for the center circle. The title can also be set in the inital creation of the Pie as well as with the SetMidTitle() 
+  
See also:
+

Example:

+$piec->SetMidTitle("Center title\nSecond line title"); + +

+

+

 

PiePlotC ::
__construct($data, $aCenterTitle)
+ +Create a Pie plot with a filled circle in the middle

+ + + + + + +
ArgumentDefaultDescription
+$data + + + Data array
+$aCenterTitle + + + +'' + +Title for center circle
+ +

Description:
Create a variant of the Pie plot with a filled circle in the middle. The title, color and size of the center circle ca be modified. 
+  
See also:
+

Example:

+$piec = new PiePlotC($data); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Plot.html b/includes/jpgraph/docs/classref/Plot.html new file mode 100644 index 0000000..c8939df --- /dev/null +++ b/includes/jpgraph/docs/classref/Plot.html @@ -0,0 +1,220 @@ +


Class Plot
+(Defined in: jpgraph.php : 5093)
 
 Plot 
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
Abstract base class for all plots. This abstract base class defines the signature that all plots must adhere to. It also provides the default trivial implementation for these framework methods. + +Public properties: + + + + + +
Name Type Description
value DisplayValue Control the data value displayed at each data point
+

  +

See also related classes:
DisplayValue, LinePlot, ErrorPlot and ScatterPlot

 


Class Methods

+

 

Plot ::
HideLegend($f)
+ +Hide legend for this plot

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +TRUE=Hide legend
+ +

Description:
Hide legend for this plot even if it was specified (with SetLegend() )  
+ +

Example:

+$bar = new GanttBar(...);
$bar->HideLegend();
+
+

+

+

 

Plot ::
PreScaleSetup($aGraph)
+ +// Virtual function to the the concrete plot class to make any changes to the graph// and scale before the stroke process begins

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

Plot ::
SetCenter($aCenter)
+ +Center the data pointr between tick labels

+ + + + +
ArgumentDefaultDescription
+$aCenter + + + +true + +True=Center each data point
+ +

Description:
Used for text scales. Centers the data values between the ticvk marks instead if falling exactly on them. + 
+ +

Example:

+$barplot->SetCenter(); + +

+

+

 

Plot ::
SetColor($aColor)
+ +Specify color for plot.

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify color for plot. Each plot type is free to interpret it to its own choosing. 
+ +

Example:

+$lineplot->SetColor('red');
+
+

+

+

 

Plot ::
SetCSIMTargets($aTargets, $aAlts, $aWinTargets)
+ +Set URL targets for CSIM

+ + + + + + + + +
ArgumentDefaultDescription
+$aTargets + + + Array of URL targets
+$aAlts + + + +'' + +Alt texts for each CSIM point
+$aWinTargets + + + +'' + +No description available
+ +

Description:
Set the URL links for the CSIM if the plot type support this. 
+ +

Example:

+$url1 "http://someotherurl.html"
$url2 = ..
...

$targetarray = array($url1$url2$url3$url4);
$barplot->SetCSIMTargets($targetarray); +
+

+

+

 

Plot ::
SetLegend($aLegend, $aCSIM, $aCSIMAlt, $aCSIMWinTarget)
+ +Set legend string for this plot

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aLegend + + + Legend string
+$aCSIM + + + +'' + +URL for image map
+$aCSIMAlt + + + +'' + +Alt text for image map
+$aCSIMWinTarget + + + +'' + +No description available
+ +

Description:
Set legend string for this plot. If the CSIM string is epscified then the legend will become an image map. To use image maps you need to use the StrokeCSIM() instead of the normal Stroke() 
+  
See also:
+

Example:

+$lineplot->SetLegend('Year 2002'); + +

+

+

 

Plot ::
SetLineWeight($aWeight)
+ +Specify line weight for plot

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + +1 + +Line weight in pixels
+ +

Description:
Specify line weight for plot 
+ +

Example:

+$lineplot->SetWeight(2); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PlotBand.html b/includes/jpgraph/docs/classref/PlotBand.html new file mode 100644 index 0000000..fe5d3b9 --- /dev/null +++ b/includes/jpgraph/docs/classref/PlotBand.html @@ -0,0 +1,194 @@ +


Class PlotBand
+(Defined in: jpgraph_plotband.php : 538)
 
 PlotBand 
 PreStrokeAdjust() 
SetDensity() 
SetOrder() 
ShowFrame() 
__construct() 
+
 

Class usage and Overview
A "Plotband" repesent a rectangualr area in the graph that can be given a specific pattern ranging from 3D grid to simple horizntal grid lines. +

+A Plot band is then added to the graph via the Graph::AddBand() method. +

  +

See also related classes:
Graph

 


Class Methods

+

 

PlotBand ::
PreStrokeAdjust($aGraph)
+ +

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

PlotBand ::
SetDensity($aDens)
+ +Specify density for pattern

+ + + + +
ArgumentDefaultDescription
+$aDens + + + Density [1,100]
+ +

Description:
Specify density for pattern as an integer value between 1 and 100, 100 being very dense and 1 being very sparse. + 
+ +

Example:

+$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$uband->ShowFrame(false);
$uband->SetDensity(50); // 50% line density
$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red");
$lband->ShowFrame(false);
$lband->SetDensity(20); // 20% line density

$graph->AddBand($uband);
$graph->AddBand($lband);
+
+

+

+

 

PlotBand ::
SetOrder($aDepth)
+ +Specify z-order parameter for plot

+ + + + +
ArgumentDefaultDescription
+$aDepth + + + Pattern Z-order parameter
+ +

Description:
Specify if the pattern should be in front of plot or behind the plot. Valid parameters are + +
+ +

Example:

+$band=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$band->ShowFrame(false);
$band->SetOrder(DEPTH_BACK);
$graph->AddBand($band);
+
+

+

+

 

PlotBand ::
ShowFrame($aFlag)
+ +Display frame around pattern

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=Display border
+ +

Description:
Display frame around pattern 
+ +

Example:

+$band=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$band->ShowFrame(false);
$band->SetOrder(DEPTH_BACK);
$graph->AddBand($band);
+
+

+

+

 

PlotBand ::
__construct($aDir, $aPattern, $aMin, $aMax, $aColor, $aWeight, $aDepth)
+ +Create a new Plot band of the specified type

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aDir + + + Direction of plot band
+$aPattern + + + Type of pattern
+$aMin + + + Min value for plot area
+$aMax + + + Max value for plot area
+$aColor + + + +"black" + +Color of pattern
+$aWeight + + + +1 + +Line weight
+$aDepth + + + +DEPTH_BACK + +Depth. Over or under the plot.
+ +

Description:
Create a new Plot band that later on can be added to the graph. The following pattern types are supported + + + +A plotband extends completely along one of the axis in the graph. This axis is determined by the first argument, the direction. + +Valid directions are +
    +
  1. HORIZONTAL +
  2. VERTICAL +

+ +

Example:

+$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$uband->ShowFrame(false);
$uband->SetDensity(50); // 50% line density
$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red");
$lband->ShowFrame(false);
$lband->SetDensity(20); // 20% line density

$graph->AddBand($uband);
$graph->AddBand($lband);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PlotLine.html b/includes/jpgraph/docs/classref/PlotLine.html new file mode 100644 index 0000000..134cb9c --- /dev/null +++ b/includes/jpgraph/docs/classref/PlotLine.html @@ -0,0 +1,244 @@ +


Class PlotLine
+(Defined in: jpgraph_plotline.php : 17)
 
 PlotLine 
 HideLegend() 
SetColor() 
SetDirection() 
SetLegend() 
SetLineStyle() 
SetPosition() 
SetWeight() 
__construct() 
+
 

Class usage and Overview
A plot line represents a horizontal or vertical line in the plot at an arbitrary position. A plot line can be added to all X-Y types of plots/graphs.

  +

See also related classes:
Graph

 


Class Methods

+

 

PlotLine ::
HideLegend($f)
+ +Hide legend

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +True/False
+ +

Description:
Hide legend 
+

+

 

PlotLine ::
SetColor($aColor)
+ +Specify color of line

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Set color for line. + +Note. Colors can also be set in the creation of a PlotLine + 
+  
See also:
+

Example:

+$plotline->SetColor('red');
+
+

+

+

 

PlotLine ::
SetDirection($aDir)
+ +Specify direction of line

+ + + + +
ArgumentDefaultDescription
+$aDir + + + Direction, horizontal or vertical line
+ +

Description:
Specify direction of line. Valid arguments are: + + +Note: Direction can also be specified in the creation of a plot line. + 
+  
See also:
+

Example:

+$plotline->SetDirection(VERTICAL);
$plotline->SetColor('red');
$graph->AddLine($plotline); +
+

+

+

 

PlotLine ::
SetLegend($aLegend, $aCSIM, $aCSIMAlt, $aCSIMWinTarget)
+ +Set legend text

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aLegend + + + Legend text
+$aCSIM + + + +'' + +CSIM target
+$aCSIMAlt + + + +'' + +CSIM Alt text
+$aCSIMWinTarget + + + +'' + +No description available
+ +

Description:
Set legend text 
+

+

 

PlotLine ::
SetLineStyle($aStyle)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + No description available
+ +

Description:
No description available.

+

 

PlotLine ::
SetPosition($aScalePosition)
+ +Specify position for plot line

+ + + + +
ArgumentDefaultDescription
+$aScalePosition + + + Scale position
+ +

Description:
Specify position for plot line. If the line is vertical the position is interpretated as the x-coordinate and if it is horizontal then the positoin is interpretatedas the Y-coordinate. + +Note: Position can also be specified in the creation of the line. 
+ +

Example:

+$plotline->SetDirection(HORIZONTAL);
$plotline->SetPosition(25);
$graph->AddLine($plotline); +
+

+

+

 

PlotLine ::
SetWeight($aWeight)
+ +Specify line weight

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Line weight in pixels
+ +

Description:
Specify line weight. + +Note. Line weight can also be specified in the creation of the line. + 
+  
See also:
+

Example:

+$plotline->SetColor('red');
$plotline->SetDirection(VERTICAL);
$plotline->SetPosition(35);
$plotline->SetWeight(2);

+
+

+

+

 

PlotLine ::
__construct($aDir, $aPos, $aColor, $aWeight)
+ +Construct a new plot line

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aDir + + + +HORIZONTAL + +Direction, HORIZONTAL or VERTICAL
+$aPos + + + +0 + +Position
+$aColor + + + +'black' + +Color
+$aWeight + + + +1 + +Line weight
+ +

Description:
Create a new horizontal or vertical line in the graph at a specific position. + +The graph can the be added to the graph with a call to the AddLine 
+ +

Example:

+// Add mark graph with static lines
$line = new PlotLine(HORIZONTAL,0,"black",2);
$graph->AddLine($line); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PlotMark.html b/includes/jpgraph/docs/classref/PlotMark.html new file mode 100644 index 0000000..4c3397f --- /dev/null +++ b/includes/jpgraph/docs/classref/PlotMark.html @@ -0,0 +1,516 @@ +


Class PlotMark
+(Defined in: jpgraph_plotmark.inc.php : 17)
 
 PlotMark 
 Hide() 
SetCallback() 
SetCallbackYX() 
SetColor() 
SetDefaultWidth() 
SetFillColor() 
SetSize() 
SetType() 
SetWeight() 
SetWidth() 
Show() 
+
 

Class usage and Overview
In scatter plots and (possible) line plots each data point have a marker. This class implements these markers and the mtethod to modify it's apperance. +

+There are a number of possible marker, circle, filled circle, square, filled square, star, triangle and so on. +See PlotMark::PlotMark() below for details on how to specify what mark. +

+Marks are accessed thtough the 'mark' property in line and scatter plot, i.e LinePlot::mark and ScatterPlot::mark. Marks in line plot are by default turned off. To enable marks use the construction $lineplot->mark->Show(). +

+You can modify the type of plotmarks by calling the SetType() method. Possible plot marks are: + +

    +
  1. MARK_SQUARE, A filled square +
  2. MARK_UTRIANGLE, A triangle pointed upwards +
  3. MARK_DTRIANGLE, A triangle pointed downwards +
  4. MARK_DIAMOND, A diamond +
  5. MARK_CIRCLE, A circle +
  6. MARK_FILLEDCIRCLE, A filled circle +
  7. MARK_CROSS, A cross +
  8. MARK_STAR, A star +
  9. MARK_X, An 'X' +
  10. MARK_LEFTTRIANGLE, A half triangle, vertical line to left (used as group markers for Gantt charts) +
  11. MARK_RIGHTTRIANGLE, A half triangle, vertical line to right (used as group markers for Gantt charts) +
  12. MARK_FLASH, A Zig-Zag vertical flash +
+

  +

See also related classes:
LinePlot and ScatterPlot

 


Class Methods

+

 

PlotMark ::
Hide($aHide)
+ +Hide plot mark

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide plot mark
+ +

Description:
Hide plot mark + 
+  
See also:
+

Example:

+$linerplot->mark->Hide(); + +

+

+

 

PlotMark ::
SetCallback($aFunc)
+ +Specify callback function for plotmark

+ + + + +
ArgumentDefaultDescription
+$aFunc + + + Function name
+ +

Description:
Callback for plotmarks is only really used in one circumstance. Scatter plot. The callback can be used to individually adjust, sixe and color of the plot marks. +

+The specified callback function gets called with the Y-value for the current plotmark. The callback function should return an array consisting of three elements +

    +
  1. Plot size +
  2. Color +
  3. Fill color +

+ +

Example:

+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);
}

...

// Specify the callback
$scatterplot->mark->SetCallback("FCallback");


+
+

+

+

 

PlotMark ::
SetCallbackYX($aFunc)
+ +Specify callback function

+ + + + +
ArgumentDefaultDescription
+$aFunc + + + Callback function
+ +

Description:
Callback for plotmarks is only really used in one circumstance. Scatter plot. The callback can be used to individually adjust, sixe and color of the plot marks. +

+The specified callback function gets called with the Y-value for the current plotmark. The callback function should return an array consisting of three elements +

    +
  1. Plot size +
  2. Color +
  3. Fill color +
+The difference from the ordinary SetCallback() is that the callback function specified in SetCallbackYX() gets passed both the Y and X coordinate (note the order!) as arguments. + 
+ +

Example:

+function FCallback($aYVal,$aXVal) {
    
// Some code to the size and color
    
return array( ... );
}

...

// Specify the callback
$scatterplot->mark->SetCallbackYX("FCallback");


+
+

+

+

 

PlotMark ::
SetColor($aColor)
+ +Specify color for plot mark

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify the line color for plot mark + 
+  
See also:
+

Example:

+$lineplot->mark->SetColor('navy');
+
+

+

+

 

PlotMark ::
SetDefaultWidth()
+ +Restore default size of mark

+
+ +

Description:
Restore default size of mark 
+ +

Example:

+$lineplot->mark->SetDefaultWidth() + +

+

+

 

PlotMark ::
SetFillColor($aFillColor)
+ +Set fill color for mark

+ + + + +
ArgumentDefaultDescription
+$aFillColor + + + Color
+ +

Description:
Set fill color for mark 
+  
See also:
+

Example:

+$lineplot->mark->SetFillColor('blue');
+
+

+

+

 

PlotMark ::
SetSize($aWidth)
+ +Set size of mark

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + WIdth of mark in pixels
+ +

Description:
Synonym for SetWidth() 
+  
See also:
+

Example:

+$lineplot->mark->SetSize(10); + +

+

+

 

PlotMark ::
SetType($aType, $aFileName, $aScale)
+ +Specify type of plot mark

+ + + + + + + + +
ArgumentDefaultDescription
+$aType + + + Type of plotmark, shape or built-in image
+$aFileName + + + +'' + +Filename or country name depending on type of plotmark. See below.
+$aScale + + + +1.0 + +Scaling of image
+ +

Description:
This method is used to specify what type of plotmarks should be be displayed. There are two classes of plotmarks. The first class is a number of different shapes and the second class is a number of built-in renderd images. +

+The following shape (the first class) plot marks are available + +

    +
  1. MARK_SQUARE, A filled square +
  2. MARK_UTRIANGLE, A triangle pointed upwards +
  3. MARK_DTRIANGLE, A triangle pointed downwards +
  4. MARK_DIAMOND, A diamond +
  5. MARK_CIRCLE, A circle +
  6. MARK_FILLEDCIRCLE, A filled circle +
  7. MARK_CROSS, A cross +
  8. MARK_STAR, A star +
  9. MARK_X, An 'X' +
  10. MARK_IMAGE, Use the image specified with the filename and scale as the second and third argument as the mark. +
  11. MARK_FLAG, Use one of MARK_FLAG1, MARK_FLAG2, MARK_FLAG3, MARK_FLAG4 to indicate that you want to display a country flag. The numbers indicate which original size of the flag you want to use. 1 is the smallest size and 4 is the largest flag size. You can of course also scale a flag by specifying the scale as the third argument. Which country flag you want is specified in the second argument as either the full country name, partial country name or by ordinal number as specified in the table below. Please note that if you specify a partial name then the first country in alphabetic order that matches the partial name will be used. +
+ +

+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: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionColors
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_SBALLA round 3D rendered ball'bluegreen','cyan','darkgray','greengray', + 'gray','graypurple','green','greenblue','lightblue', + 'lightred','navy','orange','purple','red','yellow'
MARK_IMAGE_MBALLA medium sized round 3D rendered ball +'blue','bluegreen','brown','cyan', +'darkgray','greengray','gray','green', +'greenblue','lightblue','lightred', +'purple','red','white','yellow' +
MARK_IMAGE_LBALLA large sized round 3D rendered ball +'blue','lightblue','brown','darkgreen', +'green','purple','red','gray','yellow','silver','gray' +
MARK_IMAGE_SQUAREA 3D rendered square'bluegreen','blue','green', +'lightblue','orange','purple','red','yellow'
MARK_IMG_STARA 3D rendered star image'bluegreen','lightblue','purple','blue','green','pink','red','yellow'
MARK_IMG_DIAMONDA 3D rendered diamond'lightblue','darkblue','gray', +'blue','pink','purple','red','yellow'
MARK_IMG_BEVELA 3D rendered bevel style round ring'green','purple','orange','red','yellow'
+

+In terms of the builtin flags 230 countries are supported. The following table lists all available flags: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1: 'Afghanistan' 2: 'Republic of Angola'
3: 'Republic of Albania' 4: 'Alderney'
5: 'Democratic and Popular Republic of Algeria' 6: 'Territory of American Samoa'
7: 'Principality of Andorra' 8: 'British Overseas Territory of Anguilla'
9: 'Antarctica' 10: 'Argentine Republic'
11: 'League of Arab States' 12: 'Republic of Armenia'
13: 'Aruba' 14: 'Commonwealth of Australia'
15: 'Republic of Austria' 16: 'Azerbaijani Republic'
17: 'British Antarctic Territory' 18: 'Kingdom of Belgium'
19: 'British Overseas Territory of Bermuda' 20: 'Commonwealth of the Bahamas'
21: 'Kingdom of Bahrain' 22: 'Republic of Belarus'
23: 'Republic of Bolivia' 24: 'Belize'
25: 'Republic of Benin' 26: 'Republic of Botswana'
27: 'Federative Republic of Brazil' 28: 'Barbados'
29: 'British Indian Ocean Territory' 30: 'Brunei Darussalam'
31: 'Republic of Burkina' 32: 'Republic of Bulgaria'
33: 'Republic of Burundi' 34: 'Overseas Territory of the British Virgin Islands'
35: 'Central African Republic' 36: 'Kingdom of Cambodia'
37: 'Republic of Cameroon' 38: 'Dominion of Canada'
39: 'Caribbean Community' 40: 'Republic of Cape Verde'
41: 'Republic of Chad' 42: 'Republic of Chile'
43: 'Territory of Christmas Island' 44: 'Commonwealth of Independent States'
45: 'Cook Islands' 46: 'Republic of Colombia'
47: 'Territory of Cocos Islands' 48: 'Commonwealth'
49: 'Union of the Comoros' 50: 'Republic of the Congo'
51: 'Republic of Costa Rica' 52: 'Republic of Croatia'
53: 'Republic of Cuba' 54: 'British Overseas Territory of the Cayman Islands'
55: 'Republic of Cyprus' 56: 'The Czech Republic'
57: 'Kingdom of Denmark' 58: 'Republic of Djibouti'
59: 'Commonwealth of Dominica' 60: 'Dominican Republic'
61: 'Republic of Ecuador' 62: 'Arab Republic of Egypt'
63: 'Republic of El Salvador' 64: 'England'
65: 'Republic of Equatorial Guinea' 66: 'State of Eritrea'
67: 'Republic of Estonia' 68: 'Ethiopia'
69: 'European Union' 70: 'British Overseas Territory of the Falkland Islands'
71: 'International Federation of Vexillological Associations' 72: 'Republic of Fiji'
73: 'Republic of Finland' 74: 'Territory of French Polynesia'
75: 'French Republic' 76: 'Overseas Department of French Guiana'
77: 'Gabonese Republic' 78: 'Republic of the Gambia'
79: 'Republic of Georgia' 80: 'Federal Republic of Germany'
81: 'Republic of Ghana' 82: 'Gibraltar'
83: 'Hellenic Republic' 84: 'State of Grenada'
85: 'Overseas Department of Guadeloupe' 86: 'Territory of Guam'
87: 'Republic of Guatemala' 88: 'The Bailiwick of Guernsey'
89: 'Republic of Guinea' 90: 'Republic of Haiti'
91: 'Hong Kong Special Administrative Region' 92: 'Republic of Honduras'
93: 'Republic of Hungary' 94: 'Republic of Iceland'
95: 'International Committee of the Red Cross' 96: 'Republic of India'
97: 'Republic of Indonesia' 98: 'Republic of Iraq'
99: 'Republic of Ireland' 100: 'Organization of the Islamic Conference'
101: 'Isle of Man' 102: 'State of Israel'
103: 'Italian Republic' 104: 'Jamaica'
105: 'Japan' 106: 'The Bailiwick of Jersey'
107: 'Hashemite Kingdom of Jordan' 108: 'Republic of Kazakhstan'
109: 'Republic of Kenya' 110: 'Republic of Kiribati'
111: 'State of Kuwait' 112: 'Kyrgyz Republic'
113: 'Republic of Latvia' 114: 'Lebanese Republic'
115: 'Kingdom of Lesotho' 116: 'Republic of Liberia'
117: 'Principality of Liechtenstein' 118: 'Republic of Lithuania'
119: 'Grand Duchy of Luxembourg' 120: 'Macao Special Administrative Region'
121: 'Republic of Macedonia' 122: 'Republic of Madagascar'
123: 'Republic of the Marshall Islands' 124: 'Republic of Mali'
125: 'Federation of Malaysia' 126: 'Republic of Malta'
127: 'Republic of Malawi' 128: 'Overseas Department of Martinique'
129: 'Islamic Republic of Mauritania' 130: 'Territorial Collectivity of Mayotte'
131: 'United Mexican States' 132: 'Federated States of Micronesia'
133: 'Midway Islands' 134: 'Republic of Moldova'
135: 'Principality of Monaco' 136: 'Republic of Mongolia'
137: 'British Overseas Territory of Montserrat' 138: 'Kingdom of Morocco'
139: 'Republic of Mozambique' 140: 'Republic of Mauritius'
141: 'Union of Myanmar' 142: 'Republic of Namibia'
143: 'North Atlantic Treaty Organization' 144: 'Republic of Nauru'
145: 'Turkish Republic of Northern Cyprus' 146: 'Netherlands Antilles'
147: 'Kingdom of Nepal' 148: 'Kingdom of the Netherlands'
149: 'Territory of Norfolk Island' 150: 'Federal Republic of Nigeria'
151: 'Republic of Nicaragua' 152: 'Republic of Niger'
153: 'Niue' 154: 'Commonwealth of the Northern Mariana Islands'
155: 'Province of Northern Ireland' 156: 'Nordic Council'
157: 'Kingdom of Norway' 158: 'Territory of New Caledonia and Dependencies'
159: 'New Zealand' 160: 'Organization of American States'
161: 'Organization of African Unity' 162: 'International Olympic Committee'
163: 'Sultanate of Oman' 164: 'Islamic Republic of Pakistan'
165: 'Republic of Palau' 166: 'Independent State of Papua New Guinea'
167: 'Republic of Paraguay' 168: 'Republic of the Philippines'
169: 'British Overseas Territory of the Pitcairn Islands' 170: 'Republic of Poland'
171: 'Republic of Portugal' 172: 'Commonwealth of Puerto Rico'
173: 'State of Qatar' 174: 'Russian Federation'
175: 'Republic of Rwanda' 176: 'Kingdom of Saudi Arabia'
177: 'Republic of San Marino' 178: 'Nordic Sami Conference'
179: 'Sark' 180: 'Scotland'
181: 'Principality of Seborga' 182: 'Republic of Sierra Leone'
183: 'Republic of Singapore' 184: 'Republic of Korea'
185: 'Republic of Slovenia' 186: 'Somali Republic'
187: 'Republic of Somaliland' 188: 'Republic of South Africa'
189: 'Solomon Islands' 190: 'Kingdom of Spain'
191: 'Secretariat of the Pacific Community' 192: 'Democratic Socialist Republic of Sri Lanka'
193: 'Saint Lucia' 194: 'Republic of the Sudan'
195: 'Republic of Suriname' 196: 'Slovak Republic'
197: 'Kingdom of Sweden' 198: 'Swiss Confederation'
199: 'Syrian Arab Republic' 200: 'Kingdom of Swaziland'
201: 'Republic of China' 202: 'Republic of Tajikistan'
203: 'United Republic of Tanzania' 204: 'Kingdom of Thailand'
205: 'Autonomous Region of Tibet' 206: 'Turkmenistan'
207: 'Togolese Republic' 208: 'Tokelau'
209: 'Kingdom of Tonga' 210: 'Tristan da Cunha'
211: 'Tromelin' 212: 'Republic of Tunisia'
213: 'Republic of Turkey' 214: 'Tuvalu'
215: 'United Arab Emirates' 216: 'Republic of Uganda'
217: 'Ukraine' 218: 'United Kingdom of Great Britain'
219: 'United Nations' 220: 'United States of America'
221: 'Oriental Republic of Uruguay' 222: 'Virgin Islands of the United States'
223: 'Republic of Uzbekistan' 224: 'State of the Vatican City'
225: 'Republic of Vanuatu' 226: 'Bolivarian Republic of Venezuela'
227: 'Republic of Yemen' 228: 'Democratic Republic of Congo'
229: 'Republic of Zimbabwe'
+ + 
+ +

Example:

+// A standard shape
$lineplot->mark->SetType(MARK_FILLEDCIRCLE);
$lineplot->mark->Show();

// Use image in file 'mark.jpg' as mark., aslo scale it to
// half the size
$lineplot->mark->SetType(MARK_IMAGE,'mark.jpg',0.5);
$lineplot->mark->Show();

// Using the built-in image diamond in yellow color and 70% of originally size
$lineplot->mark->SetType(MARK_IMG_DIAMOND'yellow'0.7);
$lineplot->mark->Show();

// Setting the plotmarks to a Swedish flag showing the three
// ways of doing it
....
$p1->mark->SetType(MARK_FLAG1,'sweden');
// OR
$p1->mark->SetType(MARK_FLAG1,197);
// OR
$p1->mark->SetType(MARK_FLAG1,'Kingdom of Sweden');

+
+

+

+

 

PlotMark ::
SetWeight($aWeight)
+ +Specify line weight

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Line weight
+ +

Description:
Specify line weight 
+ +

Example:

+$line->mark->SetWeight(2); + +

+

+

 

PlotMark ::
SetWidth($aWidth)
+ +Set width of plot mark

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + Width in pixels
+ +

Description:
Set width of plot mark 
+ +

Example:

+$lineplot->mark->SetWidth(10);
+
+

+

+

 

PlotMark ::
Show($aShow)
+ +Enable or disable plotmarks

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +True=Show plot marks
+ +

Description:
Enable or disable plotmarks. By default plot marks are not shown so if you want to display them you need to use this method. + 
+ +

Example:

+$lineplot->mark->Show(); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PolarAxis.html b/includes/jpgraph/docs/classref/PolarAxis.html new file mode 100644 index 0000000..ffc082c --- /dev/null +++ b/includes/jpgraph/docs/classref/PolarAxis.html @@ -0,0 +1,308 @@ +


Class PolarAxis Extends Axis
+(Defined in: jpgraph_polar.php : 151)
 
 PolarAxis  Axis 
 HideTicks() 
SetAngleFont() 
SetAngleStep() 
SetColor() 
SetGridColor() 
SetTickColors() 
ShowAngleDegreeMark() 
ShowAngleLabel() 
ShowGrid() 
+
 StrokeLabels() 
__construct() 
+
 

Class usage and Overview
Represents the different axis for a polar plot. This class holds the property both for the radius and the angle axis classes. It is accessed throught the 'axis' property in the PolarGraph class.

  +

See also related classes:
PolarGraph

 


Class Methods

+

 

PolarAxis ::
HideTicks($aFlg, $aAngleFlg)
+ +HIde ticks marks

+ + + + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +Hide radius tick marks
+$aAngleFlg + + + +true + +Hide angle tick marks
+ +

Description:
HIde ticks marks 
+ +

Example:

+// Hide just the angle tick marks
$polargraph->axis->HideTicks(false,true); +
+

+

+

 

PolarAxis ::
SetAngleFont($aFontFam, $aFontStyle, $aFontSize)
+ +Set font for angles

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFam + + + Font family
+$aFontStyle + + + +FS_NORMAL + +Font style
+$aFontSize + + + +10 + +Font size
+ +

Description:
Set font for angle labels on the polar graph. 
+ +

Example:

+$polargraph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); + +

+

+

 

PolarAxis ::
SetAngleStep($aStep)
+ +Set angle step

+ + + + +
ArgumentDefaultDescription
+$aStep + + + Step in degrees
+ +

Description:
Specify the angle step, in degrees, between the angle markers. 
+ +

Example:

+// Set 20 degrees between each marker
$polargraph->axis->SetAngleStep(20); +
+

+

+

 

PolarAxis ::
SetColor($aColor, $aRadColor, $aAngleColor)
+ +Specify axis and label colors

+ + + + + + + + +
ArgumentDefaultDescription
+$aColor + + + Color for radius axis
+$aRadColor + + + +'' + +Color for radius labels
+$aAngleColor + + + +'' + +Color for angle labels
+ +

Description:
Specify axis and label colors. 
+  
See also:
+

Example:

+$polargraph->axis->SetColor('black','navy','darkred'); + +

+

+

 

PolarAxis ::
SetGridColor($aMajorColor, $aMinorColor, $aAngleColor)
+ +Set colors for the various grids

+ + + + + + + + +
ArgumentDefaultDescription
+$aMajorColor + + + Major radius grid color
+$aMinorColor + + + +'' + +Minor radius grid color
+$aAngleColor + + + +'' + +Angle grid color
+ +

Description:
Set colors for the various grids 
+ +

Example:

+// Set "Soft" colors for the grid
$polargraph->axis->SetGridColor('lightgray','lightgray','lightgray'); +
+

+

+

 

PolarAxis ::
SetTickColors($aRadColor, $aAngleColor)
+ +Specify color for axis tick marks

+ + + + + + +
ArgumentDefaultDescription
+$aRadColor + + + Radius axis colors
+$aAngleColor + + + +'' + +Angle axis colors
+ +

Description:
Specify color for axis tick marks 
+ +

Example:

+$polargraph->axis->SetTickColor('red'); + +

+

+

 

PolarAxis ::
ShowAngleDegreeMark($aFlg)
+ +Add a degree mark after each angel label

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +True=Add mark
+ +

Description:
Add a degree mark after each angel label ( a small sperscripted 'o' ). This is enabled by default. 
+ +

Example:

+$polargraph->axis->ShowAngleDegreeMark(true); + +

+

+

 

PolarAxis ::
ShowAngleLabel($aFlg)
+ +Show angle labels

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +True=show labels
+ +

Description:
Show angle labels. This is on by default. 
+ +

Example:

+// Enable angle labels
$polargraph->axis->ShowAngleLabel(); +
+

+

+

 

PolarAxis ::
ShowGrid($aMajor, $aMinor, $aAngle)
+ +Determine what grid lines should be visible

+ + + + + + + + +
ArgumentDefaultDescription
+$aMajor + + + +true + +Show major radius grid lines
+$aMinor + + + +false + +Show minor radius grid lines
+$aAngle + + + +true + +Show angle grid lines
+ +

Description:
Determine what grid lines should be visible. 
+ +

Example:

+// Just display major radius grid line and angles
$polargraph->axis->ShowGrid(true,false,true); +
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PolarGraph.html b/includes/jpgraph/docs/classref/PolarGraph.html new file mode 100644 index 0000000..a994775 --- /dev/null +++ b/includes/jpgraph/docs/classref/PolarGraph.html @@ -0,0 +1,361 @@ +


Class PolarGraph Extends Graph
+(Defined in: jpgraph_polar.php : 641)
 
 PolarGraph  Graph 
 Set90AndMargin() 
SetDensity() 
SetPlotSize() 
SetScale() 
SetType() 
Stroke() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview
Represent a polar graph. Accessible properties are + +

  +

See also related classes:
PolarAxis

 


Class Methods

+

 

PolarGraph ::
Set90AndMargin($lm, $rm, $tm, $bm)
+ +Rotate the polar graph 90 degrees

+ + + + + + + + + + +
ArgumentDefaultDescription
+$lm + + + +0 + +Left margin
+$rm + + + +0 + +Right Margin
+$tm + + + +0 + +Top margin
+$bm + + + +0 + +Bottom margin
+ +

Description:
Rotate the polar graph 90 degrees 
+ +

Example:

+$polargraph->Set90AndMargin(40,40,40,40); + +

+

+

 

PolarGraph ::
SetDensity($aDense)
+ +Specify density for the radius axis

+ + + + +
ArgumentDefaultDescription
+$aDense + + + Density
+ +

Description:
This is analog to the density specification for the X, and Y-scale s for the standard X-Y-plots. +This specifies how close the autoscaling algorithm will place the tick marks to each other. + +The tick density can be one of + + + +By default the radius density os set to TICKD_DENSE + 
+ +

Example:

+// Slightly fewer ticks than default
$polargraph->SetDensity(TICKD_NORMAL); +
+

+

+

 

PolarGraph ::
SetPlotSize($w, $h)
+ +Alternative way to specify size of the plot area

+ + + + + + +
ArgumentDefaultDescription
+$w + + + Width
+$h + + + Height
+ +

Description:
You can specify the plot area size an posiion in the graph in two ways. The frst is the standard way of specifying the margins on the sides with SetMargins() method. + +This method centers a plot area with the specified width and height inthe middle of the graph, it is basically a short form for + +SetMargins( +$graphwidth-($w/2),$graphwidth-($w/2), +$graphheight-($h/2),$graphheight-($h/2)); + 
+ +

Example:

+$polargraph->SetPlotSize(200,250); + +

+

+

 

PolarGraph ::
SetScale($aScale, $rmax, $dummy1, $dummy2, $dummy3)
+ +Specify scale type (linear or log)

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aScale + + + Linear "lin" or logarithmic "log" scale
+$rmax + + + +0 + +Manual maximum value
+$dummy1 + + + +1 + +No description available
+$dummy2 + + + +1 + +No description available
+$dummy3 + + + +1 + +No description available
+ +

Description:
Specify scale type (linear or log) for the radius scale. A linear scale is specified as 'lin' and a logarithmic scale is specified as 'log' 
+ +

Example:

+// Specify a logarithmic scale for the radius
$polargraph->SetScale('log'); +
+

+

+

 

PolarGraph ::
SetType($aType)
+ +Specify if the graphs should be 360 or 180

+ + + + +
ArgumentDefaultDescription
+$aType + + + Type
+ +

Description:
Specify if the polargraph should be a full 360 degrees or just 180 degrees. The possible values for type are + + + +By default the graph is a full 260 degrees. 
+ +

Example:

+$polargraph->SetType(POLAR_360);
+
+

+

+

 

PolarGraph ::
Stroke($aStrokeFileName)
+ +Send graph back to browser or file

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +File name
+ +

Description:
Send a graph back to browser or to a file. This must be the last call in your script. + + 
+ +

Example:

+$polargraph->Stroke(); + +

+

+

 

PolarGraph ::
__construct($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline)
+ +Construct a new graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aWidth + + + +300 + +Width (in pixels)
+$aHeight + + + +200 + +Height (in pixels)
+$aCachedName + + + +"" + +Cache name
+$aTimeOut + + + +0 + +Cache timeout
+$aInline + + + +true + +Inline flag (DEPRECATED)
+ +

Description:
Construct a new Polar Graph. This is completely analog to the standard Graph() creation and follows the exactly same pattern.  
+ +

Example:

+$polargraph = new PolarGraph(300,500); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/PolarPlot.html b/includes/jpgraph/docs/classref/PolarPlot.html new file mode 100644 index 0000000..a1fe2ad --- /dev/null +++ b/includes/jpgraph/docs/classref/PolarPlot.html @@ -0,0 +1,176 @@ +


Class PolarPlot
+(Defined in: jpgraph_polar.php : 34)
 
 PolarPlot 
 SetColor() 
SetCSIMTargets() 
SetFillColor() 
SetLegend() 
SetWeight() 
__construct() 
+
 

Class usage and Overview
Represents a polar plot. A polar plot is a line plot that may have marks or be filled. + +Public properties are + +

  +

See also related classes:
PlotMark

 


Class Methods

+

 

PolarPlot ::
SetColor($aColor)
+ +Specify line color for polar plot

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Line Color
+ +

Description:
Specify line color for polar plot 
+ +

Example:

+$polarplot->SetColor('navy'); + +

+

+

 

PolarPlot ::
SetCSIMTargets($aTargets, $aAlts)
+ +Specify URL targets for markers

+ + + + + + +
ArgumentDefaultDescription
+$aTargets + + + URL targets
+$aAlts + + + +null + +Alt texts
+ +

Description:
Specify URL targets for markers on the polar plot. If you have specified a mark the polar plot you can add URL targets for each mark with this method. + +Remember that to create an image map graph you need to construct the graph with the Graph::StrokeCSIM() method instead of the ordinary Graph::Stroke() 
+  
See also:
+

Example:

+// Dummy targets
$t = array('#1','#2','#3','#4','#5','#6');

$polarplot->SetCSIMTargets($t);

+
+

+

+

 

PolarPlot ::
SetFillColor($aColor)
+ +Specify fill color for plot

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Fill color
+ +

Description:
Specify fill color for plot. If the fill color is specified as '' then no fill will be used. 
+  
See also:
+

Example:

+$polarplot->SetFillColor('orange'); + +

+

+

 

PolarPlot ::
SetLegend($aLegend, $aCSIM, $aCSIMAlt)
+ +Specify legend text for the plot

+ + + + + + + + +
ArgumentDefaultDescription
+$aLegend + + + Legend text
+$aCSIM + + + +"" + +URL target for this legend
+$aCSIMAlt + + + +"" + +ALT text for this legend
+ +

Description:
Specify legend text for the plot. When image maps are used you can also specify a URL for this legend. 
+ +

Example:

+$polarplot->SetLegend('Year 2002'); + +

+

+

 

PolarPlot ::
SetWeight($aWeight)
+ +Sepcify line weight (in pixels)

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Line weight
+ +

Description:
Sepcify line weight for plot 
+ +

Example:

+$polarplot->SetWeight(2); + +

+

+

 

PolarPlot ::
__construct($aData)
+ +Constructor. Create a new Polar plot

+ + + + +
ArgumentDefaultDescription
+$aData + + + Data array
+ +

Description:
A polar plot is created form an array of (angle,radius) specification for each plot point.. 
+ +

Example:

+$pdata = array(0,0,15,35,40,70,70,120);

$polarplot = new PolarPlot($pdata);
$polarplot->SetFillColor('lightblue@0.5');

$polargraph->Add($polarplot);

$polargraph->Stroke();
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Progress.html b/includes/jpgraph/docs/classref/Progress.html new file mode 100644 index 0000000..a1a2a04 --- /dev/null +++ b/includes/jpgraph/docs/classref/Progress.html @@ -0,0 +1,111 @@ +


Class Progress
+(Defined in: jpgraph_gantt.php : 3077)
 
 Progress 
 Set() 
SetFillColor() 
SetPattern() 
+
 

Class usage and Overview
Represents the progress bar inside the activity bar in Gantt Charts

  +

See also related classes:
GanttGraph and GanttBar

 


Class Methods

+

 

Progress ::
Set($aProg)
+ +Specify progress of activity in percent.

+ + + + +
ArgumentDefaultDescription
+$aProg + + + Progress in percent (0-1)
+ +

Description:
Specify progress of activity in percent. The shape of the progress bar can be specified with Progress::SetPattern() 
+  
See also:
+

Example:

+$bar->progress->Set(0.8); + +

+

+

 

Progress ::
SetFillColor($aColor)
+ +Set fill (background) color for progress bar

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Set fill (background) color for progress bar 
+ +

Example:

+$bar->progress->SetFillColor('white'); + +

+

+

 

Progress ::
SetPattern($aPattern, $aColor, $aDensity)
+ +Specify pattern class to use for progress bar

+ + + + + + + + +
ArgumentDefaultDescription
+$aPattern + + + Pattern
+$aColor + + + +"blue" + +Color
+$aDensity + + + +98 + +Density
+ +

Description:
Specify pattern class to use for progress bar. Valid patterns for the first argument are: + + + + 
+  
See also:
+

Example:

+$activity->Set(0.8);
$activity->progress->SetPattern(BAND_RDIAG,"blue");
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RadarAxis.html b/includes/jpgraph/docs/classref/RadarAxis.html new file mode 100644 index 0000000..46a356b --- /dev/null +++ b/includes/jpgraph/docs/classref/RadarAxis.html @@ -0,0 +1,46 @@ +


Class RadarAxis Extends AxisPrototype
+(Defined in: jpgraph_radar.php : 219)
 
 RadarAxis  AxisPrototype 
 Hide() 
HideFirstLastLabel() 
HideFirstTickLabel() 
HideLabels() 
HideLastTickLabel() 
HideLine() 
HideTicks() 
HideZeroLabel() 
SetColor() 
SetFont() 
SetLabelAlign() 
SetLabelAngle() 
SetLabelFormat() 
SetLabelFormatCallback() 
SetLabelFormatString() 
SetLabelMargin() 
SetLabelSide() 
SetMajTickPositions() 
SetPos() 
SetPosAbsDelta() 
SetTextLabelInterval() 
SetTextTickInterval() 
SetTickLabels() 
SetTickPositions() 
SetTickSide() 
SetTickSize() 
SetTitle() 
SetTitleMargin() 
SetTitleSide() 
SetWeight() 
__construct() 
+
 

Class usage and Overview
Represents the axis for a spider plot

  +


Class Methods


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RadarGraph.html b/includes/jpgraph/docs/classref/RadarGraph.html new file mode 100644 index 0000000..e0b484b --- /dev/null +++ b/includes/jpgraph/docs/classref/RadarGraph.html @@ -0,0 +1,481 @@ +


Class RadarGraph Extends Graph
+(Defined in: jpgraph_radar.php : 554)
 
 RadarGraph  Graph 
 Add() 
HideTickMarks() 
SetCenter() 
SetColor() 
SetPlotSize() 
SetPos() 
SetScale() 
SetSize() 
SetTickDensity() 
SetTitles() 
ShowMinorTickmarks() 
Stroke() 
StrokeIcons() 
StrokeTexts() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview
Spider graph. This graph type can only be used together with spider plots.

  +


Class Methods

+

 

RadarGraph ::
Add($aPlot)
+ +Add a spider plot to the spider graph

+ + + + +
ArgumentDefaultDescription
+$aPlot + + + No description available
+ +

Description:
Add a spider plot to the spider graph 
+ +

Example:

+$spidergraph->Add($spiderplot1); + +

+

+

 

RadarGraph ::
HideTickMarks($aFlag)
+ +Hide tick marks on spider axis

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=Hide tick marks
+ +

Description:
Hide tick marks on spider axis 
+ +

Example:

+$spidergraph->HideTickMarks();
+
+

+

+

 

RadarGraph ::
SetCenter($px, $py)
+ +Specify position for center of spider graph

+ + + + + + +
ArgumentDefaultDescription
+$px + + + Fraction of width
+$py + + + +0.5 + +Fraction of height
+ +

Description:
Specify the position for the center of the spider graph in fractions of the image width and height. 
+ +

Example:

+$spidergraph->SetCenter(0.60.5); + +

+

+

 

RadarGraph ::
SetColor($aColor)
+ +Set background color for graph

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
Set background color for graph 
+ +

Example:

+$spidergraph->SetColor('lightyellow');
+
+

+

+

 

RadarGraph ::
SetPlotSize($aSize)
+ +Specify size of spider graph

+ + + + +
ArgumentDefaultDescription
+$aSize + + + Fraction of image size
+ +

Description:
DEPRECATED
+Use SetSize() instead +
+Specify the length of the axis of the spider plot as fraction of the min(height,width) 
+  
See also:
+

Example:

+$radargraph->SetPlotSize(0.7);
+
+

+

+

 

RadarGraph ::
SetPos($px, $py)
+ +Alias for Set Center. Specify position of the center of the graph

+ + + + + + +
ArgumentDefaultDescription
+$px + + + Fraction of width
+$py + + + +0.5 + +Fraction of height
+ +

Description:
Alias for SetCenter. Specify position for the center of the graph. 
+  
See also:
+

Example:

+$graph->SetPos(0.5,0.6); + +

+

+

 

RadarGraph ::
SetScale($axtype, $ymin, $ymax, $dummy1, $dumy2)
+ +Specify manual scale for spider graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$axtype + + + Axis type
+$ymin + + + +1 + +Min Y-value
+$ymax + + + +1 + +Max Y-value
+$dummy1 + + + +null + +No description available
+$dumy2 + + + +null + +No description available
+ +

Description:
Specify axis type and min/max value for the scale. 
+ +

Example:

+$spidergraph->SetScale('lin',0,50); + +

+

+

 

RadarGraph ::
SetSize($aSize)
+ +Specify the length of the axis

+ + + + +
ArgumentDefaultDescription
+$aSize + + + Fraction of image size
+ +

Description:
pecify the length of the axis of the spider plot as fraction of the min(height,width) 
+ +

Example:

+$radargraph->SetPlotSize(0.7); + +

+

+

 

RadarGraph ::
SetTickDensity($densy, $dummy1)
+ +Specify tick density

+ + + + + + +
ArgumentDefaultDescription
+$densy + + + +TICKD_NORMAL + +Density
+$dummy1 + + + +null + +No description available
+ +

Description:
Tick density can be specified as +
+ +

Example:

+$spidergraph->SetTickDensity(TICKD_VERYSPARSE); + +

+

+

 

RadarGraph ::
SetTitles($aTitleArray)
+ +Specify titles for all the spider axis

+ + + + +
ArgumentDefaultDescription
+$aTitleArray + + + No description available
+ +

Description:
Set the title for the axis in the spider graph. If no titles have been specified then they will be numbered from 1 to maximum number of axis. 
+ +

Example:

+$spidergraph->SetTitles(array('Jan','Feb','March','Apr')); + +

+

+

 

RadarGraph ::
ShowMinorTickmarks($aFlag)
+ +Show minor tick marks

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=Show minor tick marks
+ +

Description:
By default the minor tick marks are hidden. This method turns them on. 
+ +

Example:

+$spidergraph->ShowMinorTickMArks();
+
+

+

+

 

RadarGraph ::
Stroke($aStrokeFileName)
+ +Stroke the Spider graph

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +'' + +Filename
+ +

Description:
Stroke the spider graph and send it back to the browser or write it to a file if a filename have been specified. + +This is normally the last method call in your script. 
+  
See also:
+

Example:

+$spidergraph->Stroke();
+
+

+

+

 

RadarGraph ::
StrokeIcons()
+ +//("Minimum data $min (Radar plots should only be used when all data points > 0)");

+
+ +

Description:
No description available.

+

 

RadarGraph ::
StrokeTexts()
+ +

+
+ +

Description:
No description available.

+

 

RadarGraph ::
__construct($width, $height, $cachedName, $timeout, $inline)
+ +Construct a new radar graph

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$width + + + +300 + +Imaghe width
+$height + + + +200 + +Image Height
+$cachedName + + + +"" + +Cache file name
+$timeout + + + +0 + +Cache timout (in minutes)
+$inline + + + +1 + +Inline image
+ +

Description:
See Graph::Graph(). + 
+  
See also:
+

Example:

+$radargraph = new RadarGraph(300,300); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RadarGrid.html b/includes/jpgraph/docs/classref/RadarGrid.html new file mode 100644 index 0000000..e8adf5b --- /dev/null +++ b/includes/jpgraph/docs/classref/RadarGrid.html @@ -0,0 +1,78 @@ +


Class RadarGrid
+(Defined in: jpgraph_radar.php : 336)
 
 RadarGrid 
 SetColor() 
SetLineStyle() 
SetWeight() 
Show() 
+
 

Class usage and Overview
Represents the grid for a spider plot

  +

See also related classes:
SpiderAxis and SpiderGraph

 


Class Methods

+

 

RadarGrid ::
SetColor($aMajColor)
+ +// Empty

+ + + + +
ArgumentDefaultDescription
+$aMajColor + + + No description available
+ +

Description:
No description available.

+

 

RadarGrid ::
SetLineStyle($aType)
+ +// Specify if grid should be dashed, dotted or solid

+ + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+ +

Description:
No description available.

+

 

RadarGrid ::
SetWeight($aWeight)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + No description available
+ +

Description:
No description available.

+

 

RadarGrid ::
Show($aShowMajor)
+ +// Decide if both major and minor grid should be displayed

+ + + + +
ArgumentDefaultDescription
+$aShowMajor + + + +true + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RadarLinearTicks.html b/includes/jpgraph/docs/classref/RadarLinearTicks.html new file mode 100644 index 0000000..b050145 --- /dev/null +++ b/includes/jpgraph/docs/classref/RadarLinearTicks.html @@ -0,0 +1,64 @@ +


Class RadarLinearTicks Extends Ticks
+(Defined in: jpgraph_radar.php : 108)
 
 RadarLinearTicks  Ticks 
 GetMajor() 
GetMinor() 
Set() 
+
 SetColor() 
SetFormatCallback() 
SetLabelFormat() 
SetSide() 
SetSize() 
SetWeight() 
SupressFirst() 
SupressLast() 
SupressMinorTickMarks() 
SupressTickMarks() 
SupressZeroLabel() 
+
 

Class usage and Overview
Handle linear ticks on a single spider axis

  +

See also related classes:
SpiderGraph and SpiderLogTicks

 


Class Methods

+

 

RadarLinearTicks ::
GetMajor()
+ +// Return major step size in world coordinates

+
+ +

Description:
No description available.

+

 

RadarLinearTicks ::
GetMinor()
+ +// Return minor step size in world coordinates

+
+ +

Description:
No description available.

+

 

RadarLinearTicks ::
Set($aMajStep, $aMinStep)
+ +// Set Minor and Major ticks (in world coordinates)

+ + + + + + +
ArgumentDefaultDescription
+$aMajStep + + + No description available
+$aMinStep + + + +false + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RadarLogTicks.html b/includes/jpgraph/docs/classref/RadarLogTicks.html new file mode 100644 index 0000000..0c1304c --- /dev/null +++ b/includes/jpgraph/docs/classref/RadarLogTicks.html @@ -0,0 +1,26 @@ +


Class RadarLogTicks Extends Ticks
+(Defined in: jpgraph_radar.php : 18)
 
 RadarLogTicks  Ticks 
 SetColor() 
SetFormatCallback() 
SetLabelFormat() 
SetSide() 
SetSize() 
SetWeight() 
SupressFirst() 
SupressLast() 
SupressMinorTickMarks() 
SupressTickMarks() 
SupressZeroLabel() 
+
 

Class usage and Overview
Represent logarithmic ticks on a single spider axis

  +


Class Methods


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RadarPlot.html b/includes/jpgraph/docs/classref/RadarPlot.html new file mode 100644 index 0000000..1e64c24 --- /dev/null +++ b/includes/jpgraph/docs/classref/RadarPlot.html @@ -0,0 +1,213 @@ +


Class RadarPlot
+(Defined in: jpgraph_radar.php : 399)
 
 RadarPlot 
 SetColor() 
SetCSIMTargets() 
SetFill() 
SetFillColor() 
SetLegend() 
SetLineStyle() 
SetLineWeight() 
__construct() 
+
 

Class usage and Overview
Create a new spider plot. + +A spider plot can only be added to a SpiderGraph

  +

See also related classes:
SpiderGraph

 


Class Methods

+

 

RadarPlot ::
SetColor($aColor, $aFillColor)
+ +Specify color for the plot

+ + + + + + +
ArgumentDefaultDescription
+$aColor + + + Color for line
+$aFillColor + + + +false + +Fill color
+ +

Description:
Set the color for the plot. Note that you can also use the method SetFillColor() to specify the fill color. This non-orthogonality is in place to make the API be more flexible. + + 
+  
See also:
+

Example:

+$spideplot->SetColor('darkred','lightblue');
+
+

+

+

 

RadarPlot ::
SetCSIMTargets($aTargets, $aAlts)
+ +// Set href targets for CSIM

+ + + + + + +
ArgumentDefaultDescription
+$aTargets + + + No description available
+$aAlts + + + +null + +No description available
+ +

Description:
No description available.

+

 

RadarPlot ::
SetFill($f)
+ +Deprecated. Turn filling on and off

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +True=Use fill color and fill plot
+ +

Description:
Deprecated. Turn filling on and off. When the fill color is pecified with either SetFillColor() or SetColor() this will tuen on the filling of the plot. + +This method might be useful if you programatically have set the colro and later need to disable the fill. 
+ +

Example:

+$spiderplot->SetFillColor('lightblue');

// ... some code

// Turn off the fill
if( $doNotFillSpiderPlot )
    
$spiderplot->SetFill(false);

+
+

+

+

 

RadarPlot ::
SetFillColor($aColor)
+ +Specify fill color for plot

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify fill color for plot. + +Note. You can also use SetColor() to specify both fill and line color. 
+  
See also:
+

Example:

+$spiderplot->SetFillColor('lightblue'); + +

+

+

 

RadarPlot ::
SetLegend($legend)
+ +Specify legend text for this plot

+ + + + +
ArgumentDefaultDescription
+$legend + + + Legend string
+ +

Description:
Specify legend text for this plot. 
+ +

Example:

+$spiderplot->SetLegend('Stress level'); + +

+

+

 

RadarPlot ::
SetLineStyle($aStyle)
+ +Specify line style for the plot lines

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + Line style
+ +

Description:
The line style can be one of +
+ +

Example:

+$radarplot->SetLineStyle('dotted'); + +

+

+

 

RadarPlot ::
SetLineWeight($w)
+ +Set line weight

+ + + + +
ArgumentDefaultDescription
+$w + + + Line weight in pixels
+ +

Description:
Set line weight. 
+ +

Example:

+$spiderplot->SetLineWeight(2); + +

+

+

 

RadarPlot ::
__construct($data)
+ +Create a new Radar plot

+ + + + +
ArgumentDefaultDescription
+$data + + + Data array
+ +

Description:
Creates a new radar plot 
+ +

Example:

+$radar = new RadarPlot($data); + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ReadFileData.html b/includes/jpgraph/docs/classref/ReadFileData.html new file mode 100644 index 0000000..6752e1f --- /dev/null +++ b/includes/jpgraph/docs/classref/ReadFileData.html @@ -0,0 +1,36 @@ +


Class ReadFileData
+(Defined in: jpgraph_utils.inc.php : 411)
 
 ReadFileData 
 From1Col() 
+
 

Class usage and Overview

  +


Class Methods

+

 

ReadFileData ::
From1Col($aFile, $aCol1)
+ +// Now make sure that all data is numeric. By default// all data is read as strings

+ + + + + + +
ArgumentDefaultDescription
+$aFile + + + No description available
+$aCol1 + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RectLayout.html b/includes/jpgraph/docs/classref/RectLayout.html new file mode 100644 index 0000000..8b2f145 --- /dev/null +++ b/includes/jpgraph/docs/classref/RectLayout.html @@ -0,0 +1,22 @@ +


Class RectLayout
+(Defined in: jpgraph_odo.php : 725)
 
 RectLayout 
 LayoutSize() 
+
 

Class usage and Overview

  +


Class Methods

+

 

RectLayout ::
LayoutSize()
+ +// Should the circular base of the indicator needle be displayed

+
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/RotImage.html b/includes/jpgraph/docs/classref/RotImage.html new file mode 100644 index 0000000..2db7a56 --- /dev/null +++ b/includes/jpgraph/docs/classref/RotImage.html @@ -0,0 +1,147 @@ +


Class RotImage Extends Image
+(Defined in: jpgraph.php : 7530)
 
 RotImage  Image 
 SetAngle() 
SetCenter() 
SetMargin() 
SetTranslation() 
+
 RoundedRectangle() 
SetAlphaBlending() 
SetAntiAliasing() 
SetCanvasColor() 
SetExpired() 
SetImgFormat() 
SetMargin() 
SetQuality() 
SetTransparent() 
+
 

Class usage and Overview
A subclass of Image class which implements a rotated version of all methods in the base Image class. + +The Image class used in JpGraph is actually not the class Image but rather this class as we want to have the rotating possibility. + +The rotation is accomplished by standard 2D rotation matrices.

  +

See also related classes:
Image

 


Class Methods

+

 

RotImage ::
SetAngle($a)
+ +Specify rotation angle

+ + + + +
ArgumentDefaultDescription
+$a + + + Angle in degrees
+ +

Description:
Specify the rotation angle for the other graphic primitives in this class. + +The rotation is performed around point (0,0). + 
+  
See also:
+

Example:

+$graph->img->SetAngle(45);
+
+

+

+

 

RotImage ::
SetCenter($dx, $dy)
+ +Set rotation center

+ + + + + + +
ArgumentDefaultDescription
+$dx + + + Specify rotation center X
+$dy + + + Specify rotation center Y
+ +

Description:
Specify center of rotation. (0,0) is the upper left most point in the image. By default the rotation point is choosen as tjhe midpoint of the image when the RotImage class is initially created. + 
+  
See also:
+

Example:

+$width=600$height=400;
$graph = new Graph($width,$height);
$graph->img->SetMargin($leftm,$rightm,$topm,$bottomm);
$graph->SetAngle(20);

// Rotate graph around the plots (0,0) point, i.e
// where the graph axis intersect.
$graph->img->SetCenter($leftm,$height-($topm+$bottomm));
+
+

+

+

 

RotImage ::
SetMargin($lm, $rm, $tm, $bm)
+ +Specify margin for plot

+ + + + + + + + + + +
ArgumentDefaultDescription
+$lm + + + Left margin
+$rm + + + Right margin
+$tm + + + Top margin
+$bm + + + Bottom margin
+ +

Description:
Specify the margin, i.e. the area on the side of the actual plot which is used for titles, labels, legends ans so on. + 
+ +

Example:

+$graph->img->SetMargin(30,30,50,20);
+
+

+

+

 

RotImage ::
SetTranslation($dx, $dy)
+ +Specify translation (in pixels)

+ + + + + + +
ArgumentDefaultDescription
+$dx + + + Horizontal translation
+$dy + + + Vertical translation
+ +

Description:
The translation is applied after the rotation of the image. 
+  
See also:
+

Example:

+$graph->img->SetTranslation(10,10) + +

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/ScatterPlot.html b/includes/jpgraph/docs/classref/ScatterPlot.html new file mode 100644 index 0000000..b24f2d1 --- /dev/null +++ b/includes/jpgraph/docs/classref/ScatterPlot.html @@ -0,0 +1,149 @@ +


Class ScatterPlot Extends Plot
+(Defined in: jpgraph_scatter.php : 133)
 
 ScatterPlot  Plot 
 SetImpuls() 
SetLinkPoints() 
SetStem() 
__construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
A scatter plto is used to display a number of points specified by (x,y) coordinates. To specify the apperance of points the 'mark' property has to be set. See PlotMark class for further details. +

+The marks can also be connected with lines by calling the method SetLinkPoints()

  +

See also related classes:
LinePlot and PlotMark

 


Class Methods

+

 

ScatterPlot ::
SetImpuls($f)
+ +Specify impuls type of sctter plot

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +True=Use impuls type
+ +

Description:
By specifying the impuls type each plot is linked to the X-axis by a line. + +This type of plots is often used to illustrate signals in discrete time signal processing. 
+ +

Example:

+$scatterplot->SetImpuls();
+
+

+

+

 

ScatterPlot ::
SetLinkPoints($aFlag, $aColor, $aWeight, $aStyle)
+ +Combine the scatter plot points with a line

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=Link scatter points
+$aColor + + + +"black" + +Color of line
+$aWeight + + + +1 + +Line width
+$aStyle + + + +'solid' + +No description available
+ +

Description:
Link scatter plots with a line of specified color and width. 
+ +

Example:

+$scatterplot->SetLinkPoints();
+
+

+

+

 

ScatterPlot ::
SetStem($f)
+ +

+ + + + +
ArgumentDefaultDescription
+$f + + + +true + +No description available
+ +

Description:
No description available.

+

 

ScatterPlot ::
__construct($datay, $datax)
+ +Constructor

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + Y-data array
+$datax + + + +false + +X-data array
+ +

Description:
Create a new scatter plot 
+ +

Example:

+$datax = array( ... );
$datay = array( ... );
$scatter = new ScatterPlot($datay,$datax);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Shape.html b/includes/jpgraph/docs/classref/Shape.html new file mode 100644 index 0000000..b9661ae --- /dev/null +++ b/includes/jpgraph/docs/classref/Shape.html @@ -0,0 +1,614 @@ +


Class Shape
+(Defined in: jpgraph_canvtools.php : 69)
 
 Shape 
 Bezier() 
Circle() 
FilledCircle() 
FilledPolygon() 
FilledRectangle() 
FilledRoundedRectangle() 
IndentedRectangle() 
Line() 
Polygon() 
Rectangle() 
RoundedRectangle() 
SetColor() 
SetTextAlign() 
ShadowRectangle() 
__construct() 
+
 

Class usage and Overview
This is mainly awrapper class around thye current image class used. It is meant to make it easier to work with a Canvas graph and a Canvas scale. Basically the class uses the specified scale to trasnalte coordinates which is then passed on to the standard Image routines. +

  +

See also related classes:
CanvasScale

 


Class Methods

+

 

Shape ::
Bezier($p, $aSteps)
+ +Draw a bezier curve

+ + + + + + +
ArgumentDefaultDescription
+$p + + + Array with control points
+$aSteps + + + +40 + +Number of line segments in curve
+ +

Description:
Draw a Bezier line with specified in the $p array. The points are specified according to the current scale. The positions in the array has the following meaning +

+(0,1) x0,y0 (First point on curver)
+(2,3) x,y, (Control point 1)
+(4,5) x,y, (Control point 2)
+(6,7) x,y, (End point of curve)
+

+See example in canvasbezierex1.php + + 
+ +

Example:

+$p = array(3,6,6,9,5,3,7,4);

$shape->SetColor('black');
$shape->Bezier($p);
+
+

+

+

 

Shape ::
Circle($x1, $y1, $r)
+ +Draw a circle

+ + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Center X-coordinate
+$y1 + + + Center Y-coordinate
+$r + + + Radius
+ +

Description:
Draw a circle onto the canvas + 
+  
See also:
+

Example:

+// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g,$scale);
$shape->SetColor('black');


// .. and a circle (x,y,diameter)
$shape->Circle(5,14,2);

+
+

+

+

 

Shape ::
FilledCircle($x1, $y1, $r)
+ +Draw a filled circle to a canvas

+ + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Center X-coordinate
+$y1 + + + Center Y-coordinate
+$r + + + Radius
+ +

Description:
Draw a filled circle on the canvas using the specified scale. +

+Note: If you are using GD1.xx you will see moire-patterns in large circles. This is due to the lack of a proper filled circle function in GD 1.xx. Using GD 2.xx will avoid this problem. + 
+  

See also:
+

Example:

+// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g,$scale);
$shape->SetColor('black');


// .. and a circle (x,y,diameter)
$shape->FilledCircle(5,14,2);

+
+

+

+

 

Shape ::
FilledPolygon($p)
+ +Draw a filled polygon

+ + + + +
ArgumentDefaultDescription
+$p + + + Polygon array
+ +

Description:
Draw a filled polygon 
+

+

 

Shape ::
FilledRectangle($x1, $y1, $x2, $y2)
+ +Draw a filled rectangle on the canvas

+ + + + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Top left X
+$y1 + + + Top left Y
+$x2 + + + Bottom right X
+$y2 + + + Bottom right Y
+ +

Description:
Draw a filled rectangle on the canvas using the current sclae. + 
+ +

Example:

+
// .. add a rectangle
$shape->SetColor('green');
$shape->FilledRectangle(15,8,19,14);
+
+

+

+

 

Shape ::
FilledRoundedRectangle($x1, $y1, $x2, $y2, $r)
+ +Create a filled rectangle with rounded corners

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Top left X
+$y1 + + + Top left Y
+$x2 + + + Bottom right X
+$y2 + + + Bottom right Y
+$r + + + +null + +Corner radius
+ +

Description:
Create a filled rectangle with rounded corners 
+

+

 

Shape ::
IndentedRectangle($xt, $yt, $w, $h, $iw, $ih, $aCorner, $aFillColor, $r)
+ +A filled rectangle with one corner 'indented'

+ + + + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$xt + + + Top left X
+$yt + + + Top left Y
+$w + + + Width
+$h + + + Height
+$iw + + + +0 + +Indented width
+$ih + + + +0 + +Indeted height
+$aCorner + + + +3 + +Corner to indent
+$aFillColor + + + +"" + +Fill color
+$r + + + +4 + +Corner radius
+ +

Description:
A rounded rectangle where one of the corner has been moved "into" the rectangle. The indention is determined by the two argument +'iw' width and 'ih' height. +

+The corners (as used in the $aCorner) are numbered as +0=Top left, 1=top right, 2=bottom right, 3=bottom left + 
+

+

 

Shape ::
Line($x1, $y1, $x2, $y2)
+ +Draw a line between

+ + + + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + X1
+$y1 + + + Y1
+$x2 + + + X2
+$y2 + + + Y2
+ +

Description:
Draw a line between two points in the canvas using the current scale. 
+  
See also:
+

Example:

+
// Add a black line
$shape->SetColor('black');
$shape->Line(0,0,20,20);
+
+

+

+

 

Shape ::
Polygon($p, $aClosed)
+ +Draw a closed polygon

+ + + + + + +
ArgumentDefaultDescription
+$p + + + Array of points in polygon
+$aClosed + + + +false + +No description available
+ +

Description:
Draw a closed polygon 
+ +

Example:

+$p = array(3,6,6,9,5,3,7,4);
$shape->SetColor('blue:0.35');
$shape->Polygon($p); +
+

+

+

 

Shape ::
Rectangle($x1, $y1, $x2, $y2)
+ +Draw a rectangle on the canvas

+ + + + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Top left X
+$y1 + + + Top left Y
+$x2 + + + Bottom right X
+$y2 + + + Bottom right Y
+ +

Description:
Draw a rectangle on the canvas using the current scale. 
+ +

Example:

+// .. add a rectangle
$shape->SetColor('green');
$shape->Rectangle(15,8,19,14);
+
+

+

+

 

Shape ::
RoundedRectangle($x1, $y1, $x2, $y2, $r)
+ +Draw a rectangle with rounded corners

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Top left X
+$y1 + + + Top left Y
+$x2 + + + Bottom right X
+$y2 + + + Bottom right Y
+$r + + + +null + +Corner radius
+ +

Description:
Draw a rectangle with rounded corners 
+

+

 

Shape ::
SetColor($aColor)
+ +Specify color to use when drawing shapes

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color specification
+ +

Description:
Specify color to use when drawing shapes 
+  
See also:
+

Example:

+// Add a black line
$shape->SetColor('black');
$shape->Line(0,0,20,20);
+
+

+

+

 

Shape ::
SetTextAlign($halign, $valign)
+ +Specify bae point for StrokeText()

+ + + + + + +
ArgumentDefaultDescription
+$halign + + + Horizontal position for basepoint
+$valign + + + +"bottom" + +Vertical position for base point
+ +

Description:
Specifies how the coordinate for the text should be interpretated. Possible values for horizontal base-position are + + + +and for vertical + + +
+ +

Example:

+// Interpret the text coordinate as beeing the
// top left corner of the bounding box for the text
$shape->SetTextAlign('left','top');

$shape->StrokeText(....)
+
+

+

+

 

Shape ::
ShadowRectangle($x1, $y1, $x2, $y2, $fcolor, $shadow_width, $shadow_color)
+ +Draw a filled rectangle with a drop shadow

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$x1 + + + Top left X
+$y1 + + + Top left Y
+$x2 + + + Bottom right X
+$y2 + + + Bottom right Y
+$fcolor + + + +false + +Fill color
+$shadow_width + + + +null + +Shadow width
+$shadow_color + + + +array(102,102,102) + +Shadow color
+ +

Description:
Draw a filled rectangle with a drop shadow 
+

+

 

Shape ::
__construct($aGraph, $scale)
+ +Methods to draw shapes on canvas

+ + + + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+$scale + + + No description available
+ +

Description:
Create a new shape class used to draw siple shape onto a canvas using the specified scale. 
+  
See also:
+

Example:

+// 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);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Spline.html b/includes/jpgraph/docs/classref/Spline.html new file mode 100644 index 0000000..6f0e27b --- /dev/null +++ b/includes/jpgraph/docs/classref/Spline.html @@ -0,0 +1,77 @@ +


Class Spline
+(Defined in: jpgraph_regstat.php : 17)
 
 Spline 
 Get() 
__construct() 
+
 

Class usage and Overview
Utility class to help construct an interpolated data points given an arbitrary number of data points. +

+This class doesn't draw any graphs by itself it is only used to generate a new set of data points representing the smooth line from the input which are the control lines for the cubic spline. +

+The principle of using this class is that you first create an instance of this class and giving it the X,Y values for your control points. +

+You can then get back an interpolated smooth dataset by calling the Get() method. This method takeas as argument how many data points you want the interpolated graph to have. +

+Technical note: The spline is constructed with natural 2:nd derivates at the start and end points of the line. +

  +


Class Methods

+

 

Spline ::
Get($num)
+ +Return the two new data vectors

+ + + + +
ArgumentDefaultDescription
+$num + + + +50 + +Number of data points
+ +

Description:
Return a data set representing the interpolated smooth curve passing through all the specified control points. 
+ +

Example:

+$spline = new Spline($xcontrol_points$ycontrol_points);
list (
$xdata$ydata) = $spline->Get(100);
$lp = new LinePlot($ydata$xdata);
+
+

+

+

 

Spline ::
__construct($xdata, $ydata)
+ +Constructor. Create a new Spline object

+ + + + + + +
ArgumentDefaultDescription
+$xdata + + + Control points. X-coordinates
+$ydata + + + Control points. Y-coordinates
+ +

Description:
Constructor. Create a new Spline object. The spline is determined by it's control points which are given with it's X and Y coordinates as arguments. +

+Technical note: The spline is constructed with natural 2:nd derivates at the start and end point. 
+ +

Example:

+$spline = new Spline($xcontrol_points$ycontrol_points);
list (
$xdata$ydata) = $spline->Get(100);
$lp = new LinePlot($ydata$xdata);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/StockPlot.html b/includes/jpgraph/docs/classref/StockPlot.html new file mode 100644 index 0000000..aebc15b --- /dev/null +++ b/includes/jpgraph/docs/classref/StockPlot.html @@ -0,0 +1,156 @@ +


Class StockPlot Extends Plot
+(Defined in: jpgraph_stock.php : 15)
 
 StockPlot  Plot 
 HideEndLines() 
SetColor() 
SetWidth() 
__construct() 
+
 HideLegend() 
PreScaleSetup() 
SetCenter() 
SetColor() 
SetCSIMTargets() 
SetLegend() 
SetLineWeight() 
+
 

Class usage and Overview
Create a stock chart graph, aka Candle-chart, aka Box-graph. +Each data point is represented by four values +(open,close,min,max) + +

  +


Class Methods

+

 

StockPlot ::
HideEndLines($aHide)
+ +Show horizontal mark lines at the end of min/max lines

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +Flag true=show end lines
+ +

Description:
Show horizontal mark lines at the end of min/max lines. This is enabled by default. 
+ +

Example:

+$stock->HideEndLines(); + +

+

+

 

StockPlot ::
SetColor($aColor, $aColor1, $aColor2, $aColor3)
+ +Specify colors for the stock plot

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aColor + + + Line color for positive bars
+$aColor1 + + + +'white' + +Fill color for positive bars
+$aColor2 + + + +'darkred' + +Line color for negative bars
+$aColor3 + + + +'darkred' + +Fill color for negative bars
+ +

Description:
Specify the colros for a stock chart. A positive bar is defined as a bar where close > open. A negative bar is defined as a bar where close < open. + +The positive line color is always used for the min/max lines. + +By default positve colors are black and white. Negative colors are 'red' and 'red'. + 
+ +

Example:

+$stockplot->SetColor('black','white','red','red'); + +

+

+

 

StockPlot ::
SetWidth($aWidth)
+ +Specify width for stock bars in pixels

+ + + + +
ArgumentDefaultDescription
+$aWidth + + + Width in pixels
+ +

Description:
Specify width for stock bars in pixels 
+ +

Example:

+$stockplot->SetWidth(8); + +

+

+

 

StockPlot ::
__construct($datay, $datax)
+ +Constructor for Stock plots

+ + + + + + +
ArgumentDefaultDescription
+$datay + + + No description available
+$datax + + + +false + +X data array
+ +

Description:
Create a new Stock data plot. Each data value consists of 4 data points. (open,close,min,max) + +If the $ydata isn't an even number of data quadruples an error message will result. 
+ +

Example:

+$ydata = array( .... )
$stockplot = new StockPlot($ydata);
+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/SuperScriptText.html b/includes/jpgraph/docs/classref/SuperScriptText.html new file mode 100644 index 0000000..4f789a5 --- /dev/null +++ b/includes/jpgraph/docs/classref/SuperScriptText.html @@ -0,0 +1,228 @@ +


Class SuperScriptText Extends Text
+(Defined in: jpgraph.php : 3116)
 
 SuperScriptText  Text 
 FromReal() 
GetFontHeight() 
GetTextHeight() 
GetWidth() 
Set() 
SetSuperFont() 
__construct() 
+
 Align() 
Center() 
GetFontHeight() 
GetTextHeight() 
GetWidth() 
Hide() 
ParagraphAlign() 
Set() 
SetAlign() 
SetAngle() 
SetBox() 
SetColor() 
SetCSIMTarget() 
SetFont() 
SetMargin() 
SetOrientation() 
SetParagraphAlign() 
SetPos() 
SetScalePos() 
SetShadow() 
SetWordWrap() 
Show() 
__construct() 
+
 

Class usage and Overview
This class is responsible for formatting a text string which have a superscript at the end. This is used to generate scientific numbers. +

  +

See also related classes:
Text

 


Class Methods

+

 

SuperScriptText ::
FromReal($aVal, $aPrecision)
+ +Create a scientific representation for a number

+ + + + + + +
ArgumentDefaultDescription
+$aVal + + + Real value to be used
+$aPrecision + + + +2 + +Precision (number of digits) to be printed
+ +

Description:
Initialized the class from a real value to be used to present a scientific text string. + 
+  
See also:
+

Example:

+$t = new SuperScriptText();
$t->FromReal(12341.56);

// Will print 1.23*10^4
+
+

+

+

 

SuperScriptText ::
GetFontHeight($aImg)
+ +Hight of font (approximate the height of the text)

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
Return height of text. 
+  
See also:

+

 

SuperScriptText ::
GetTextHeight($aImg)
+ +Hight of text

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
Hight of text 
+

+

 

SuperScriptText ::
GetWidth($aImg)
+ +Total width of text

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
Total width of text 
+

+

 

SuperScriptText ::
Set($aTxt, $aSuper)
+ +Convert a floating point number to scientific notation

+ + + + + + +
ArgumentDefaultDescription
+$aTxt + + + Mantissa
+$aSuper + + + +'' + +Exponent
+ +

Description:
Specify the string manuall by specifyin mantissa and exponent. 
+  
See also:
+

Example:

+$t = new SuperScriptText();
$t->Set("1.34 10","5");
// Will generate "1.34 10^5"
+
+

+

+

 

SuperScriptText ::
SetSuperFont($aFontFam, $aFontStyle, $aFontSize)
+ +Manually set font to be used for superscript

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFam + + + Font family
+$aFontStyle + + + +FS_NORMAL + +Font style
+$aFontSize + + + +8 + +Font size
+ +

Description:
Used to manually specify font to be used for superscript. If not specified it will be detemined automatically based on the font used for the mantissa. The font for the superscript will be roughly 70% of the size of the base font.  
+

+

 

SuperScriptText ::
__construct($aTxt, $aSuper, $aXAbsPos, $aYAbsPos)
+ +Constructor

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aTxt + + + +'' + +Mantissa text
+$aSuper + + + +'' + +Suoerscript text
+$aXAbsPos + + + +0 + +X-position (in pixels)
+$aYAbsPos + + + +0 + +Y-position (in pixels)
+ +

Description:
Creates a new SUperSCriptClass 
+  
See also:


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/SymChar.html b/includes/jpgraph/docs/classref/SymChar.html new file mode 100644 index 0000000..fd301d7 --- /dev/null +++ b/includes/jpgraph/docs/classref/SymChar.html @@ -0,0 +1,39 @@ +


Class SymChar
+(Defined in: jpgraph_ttf.inc.php : 544)
 
 SymChar 
 Get() 
+
 

Class usage and Overview

  +


Class Methods

+

 

SymChar ::
Get($aSymb, $aCapital)
+ +//=============================================================================// CLASS SymChar// Description: Code values for some commonly used characters that// normally isn't available directly on the keyboard, for example//

+ + + + + + +
ArgumentDefaultDescription
+$aSymb + + + No description available
+$aCapital + + + +FALSE + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Text.html b/includes/jpgraph/docs/classref/Text.html new file mode 100644 index 0000000..58c9da2 --- /dev/null +++ b/includes/jpgraph/docs/classref/Text.html @@ -0,0 +1,767 @@ +


Class Text
+(Defined in: jpgraph_text.inc.php : 17)
 
 Text 
 Align() 
Center() 
GetFontHeight() 
GetTextHeight() 
GetWidth() 
Hide() 
ParagraphAlign() 
Set() 
SetAlign() 
SetAngle() 
SetBox() 
SetColor() 
SetCSIMTarget() 
SetFont() 
SetMargin() 
SetOrientation() 
SetParagraphAlign() 
SetPos() 
SetScalePos() 
SetShadow() 
SetWordWrap() 
Show() 
__construct() 
+
 

Class usage and Overview
All text that is to be draw onto any graph is handled by this class. You create each text you want printed as an instance of this class. + +It is possible to adjust both font, color, alignment and paragraph alignment. + +If the text contains multiple lines (separated by "\n") the paragraph alignment determines how each line is formatted (i.e. left,center or right) +

  +


Class Methods

+

 

Text ::
Align($aHAlign, $aVAlign, $aParagraphAlign)
+ +Specify alignment for the text in relation to the x,y position for text

+ + + + + + + + +
ArgumentDefaultDescription
+$aHAlign + + + Horizontal alignment
+$aVAlign + + + +"top" + +Vertical alignment
+$aParagraphAlign + + + +"" + +Paragraph alignment
+ +

Description:
This determines how the text's x,y position is to be interpretated. + +Valid horizontal alignments are + + +Valid vertical position are + + +Valid paragraph alignment +
+  
See also:
+

Example:

+$text = new Text();
+
+

+

+

 

Text ::
Center($aLeft, $aRight, $aYAbsPos)
+ +Center the text between left and right coordinates

+ + + + + + + + +
ArgumentDefaultDescription
+$aLeft + + + Left corner X-coordinate
+$aRight + + + Right corner X-coordinate
+$aYAbsPos + + + The common Y-coodinate
+ +

Description:
Center the text between left and right coordinates on the same Y-coordinate 
+ +

Example:

+$txt->Center(50,150,75); + +

+

+

 

Text ::
GetFontHeight($aImg)
+ +Height of font

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
Return the height of the font used in the text. + +The difference between this method and the GetTextHeight() is that this method uses a predefined character to determine the height while GetTextHeight() uses the actual text in the string. + 
+  
See also:
+

Example:

+$height $txt->GetFontHeight($graph->img) + +

+

+

 

Text ::
GetTextHeight($aImg)
+ +Return the height of the actual text in the text object

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
Return the height of the text in this object. + +The difference between this method and the GetFontHeight() is that that method uses a predefined character to determine the height while GetTextHeight() uses the actual text in the string. 
+  
See also:
+

Example:

+$height $txt->GetTextHeight($graph->img);
+
+

+

+

 

Text ::
GetWidth($aImg)
+ +Get total width of text

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
Get total width of text 
+  
See also:
+

Example:

+$width $txt->GetWidth($graph->img);
+
+

+

+

 

Text ::
Hide($aHide)
+ +Hide the text

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide text
+ +

Description:
The opposite of Show() 
+  
See also:
+

Example:

+$txt->Hide(); + +

+

+

 

Text ::
ParagraphAlign($aAlign)
+ +Specifies the alignment for a multi line text

+ + + + +
ArgumentDefaultDescription
+$aAlign + + + Alignment for a multiline text
+ +

Description:
Specify the paragraph alignment for a multi line text. Each text line is separated by a "\n" character. + +Valid alignments are: + 
+  
See also:
+

Example:

+$txt->Set("The first line\nSec line\nThird line");
$txt->ParagraphAlign('center');

// Will give the result:
//
//  The first line
//     Sec line
//    Third line
+
+

+

+

 

Text ::
Set($aTxt)
+ +Set text to be displayed

+ + + + +
ArgumentDefaultDescription
+$aTxt + + + Text string
+ +

Description:
Set text to be displayed 
+ +

Example:

+$txt->Set('Hello world'); + +

+

+

 

Text ::
SetAlign($aHAlign, $aVAlign, $aParagraphAlign)
+ +Alias for Align()

+ + + + + + + + +
ArgumentDefaultDescription
+$aHAlign + + + Horizontal anchor point
+$aVAlign + + + +"top" + +Vertical anchor point
+$aParagraphAlign + + + +"" + +Paragraph alignment
+ +

Description:
See Align 
+  
See also:

+

 

Text ::
SetAngle($aAngle)
+ +Specify text angle

+ + + + +
ArgumentDefaultDescription
+$aAngle + + + Angle in degrees
+ +

Description:
Specify Orientation of text. If TTF fonts are used then the orientation can be a arbitrary angle. If the builtin fonts are used then only horizontal and vertical position can be used, i.e 0 or 90 degrees, 
+ +

Example:

+$txt->SetAngle(45); + +

+

+

 

Text ::
SetBox($aFrameColor, $aBorderColor, $aShadowColor, $aCornerRadius, $aShadowWidth)
+ +Set parameters for poossible frame around text

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aFrameColor + + + +array(255,255,255) + +Color for text background
+$aBorderColor + + + +array(0,0,0) + +Color for border around text
+$aShadowColor + + + +false + +Color for shadow
+$aCornerRadius + + + +4 + +Corner radius for rectangle
+$aShadowWidth + + + +3 + +Drop shadow width
+ +

Description:
Specify parameters for background color, border and possible text drop shadow. +
+If no shadow color is specified then no shadow will appear. +

+To use the old style of stright corners specify a corner radius of 0. + + 
+  

See also:
+

Example:

+$txt = new Text("Note: Simple textnote.\nWIth two lines");
$txt->SetFont(FF_FONT1,FS_BOLD);
$txt->Pos(0.5,0.97,'center','bottom');
$txt->SetBox('yellow','black');
$graph->AddText($txt);

+
+

+

+

 

Text ::
SetColor($aColor)
+ +Set text color

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify color for text 
+ +

Example:

+$txt->SetColor('darkblue'); + +

+

+

 

Text ::
SetCSIMTarget($aURITarget, $aAlt, $aWinTarget)
+ +Specify CSIM Target for text

+ + + + + + + + +
ArgumentDefaultDescription
+$aURITarget + + + No description available
+$aAlt + + + +'' + +Alt-tag text
+$aWinTarget + + + +'' + +No description available
+ +

Description:
Specify Client Side Image Target for text 
+ +

Example:

+$graph->title->SetCSIMTarget('mainpage.html','Go to main page');
+
+

+

+

 

Text ::
SetFont($aFamily, $aStyle, $aSize)
+ +Specify font

+ + + + + + + + +
ArgumentDefaultDescription
+$aFamily + + + Font family
+$aStyle + + + +FS_NORMAL + +Font style
+$aSize + + + +10 + +Font size
+ +

Description:
Specify font family, size and style. Two major types of font families can be used, builtin bitmnapped fonts or TTF fonts. The builtin fonts have a fixed size which can't be altered. + +Valid styles are + + +Valid values for the internal font families are + + +Note: FF_FONT0 only suppor font style FS_NORMAL + +The available TTF are by default +
+  
See also:
+

Example:

+$txt->SetFont(FF_ARIALFS_BOLD14); + +

+

+

 

Text ::
SetMargin($aMarg)
+ +Set the contect sensiive margin

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + Margin in pixels
+ +

Description:
Specify a context sensitive margin for the text. Depending on in which context the text is used the margin will be interpretated accordingly. 
+ +

Example:

+// Start further away from the top of graph
$graph->title->SetMargin(15); +
+

+

+

 

Text ::
SetOrientation($aDirection)
+ +Deprecated. Use SetAngle instead. Specify text angle

+ + + + +
ArgumentDefaultDescription
+$aDirection + + + +0 + +Orientation of text in degrees
+ +

Description:
Deprecated. Use SetAngle() instead. +Specify Orientation of text. If TTF fonts are used then the orientation can be a arbitrary angle. If the builtin fonts are used then only horizontal and vertical position can be used, i.e 0 or 90 degrees, 
+ +

Example:

+$txt->SetOrientation(90); // Vertical text + +

+

+

 

Text ::
SetParagraphAlign($aAlign)
+ +Specifies the alignment for a multi line text

+ + + + +
ArgumentDefaultDescription
+$aAlign + + + Horizontal alignment
+ +

Description:
Determines how a multi-line text paragraph will be formatted. Each line in the paragraph will be treated individually. Allowed values are +
    +
  1. "center" +
  2. "left" +
  3. "right" +
+ +Note: Paragraph alignment is only applicable to horizontal text, i.e. angle = 0 . For paragraphs at an angle the alignbment will always be "left". + 
+ +

Example:

+$graph->title->Set("Multi line\ntext !");
$graph->title->SetParagraphAlign('right');

// Default for title is "center"
+
+

+

+

 

Text ::
SetPos($aXAbsPos, $aYAbsPos, $aHAlign, $aVAlign)
+ +Alias for Pos()

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aXAbsPos + + + X position
+$aYAbsPos + + + Y position
+$aHAlign + + + Horizontal align
+$aVAlign + + + Vertical align
+ +

Description:
Alias for Pos() 
+  
See also:
+

Example:

+$txt->Pos(100,150,'center'); + +

+

+

 

Text ::
SetScalePos($aX, $aY)
+ +Specify the position of the text using the plot scale positions

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + X-position
+$aY + + + Y-position
+ +

Description:
Specify the position of the text using the plot scale positions. The Y position is taken to be the Y axis. It is not possible to use Y2 scale to specify the position. 
+ +

Example:

+$txt = new Text();
$txt->SetScalePos(27.3278.9); +
+

+

+

 

Text ::
SetShadow($aShadowColor, $aShadowWidth)
+ +Add a drop shadow to boxed text

+ + + + + + +
ArgumentDefaultDescription
+$aShadowColor + + + +'gray' + +Shadow color
+$aShadowWidth + + + +3 + +Shadow width (in pixels)
+ +

Description:
If the text has been boxed (by call to SetBox()) then you can easily add a drop shadow by just calling this method. +

+Note: You can also specify the shadow directly in the SetBox() call. This method was added to make Text more like other graph objects which have a SetShadow() method. 
+  

See also:
+

Example:

+$txt = new Text("Note: Simple textnote.\nWIth two lines");
$txt->SetFont(FF_FONT1,FS_BOLD);
$txt->Pos(0.5,0.97,'center','bottom');
$txt->SetBox('yellow','black');
$txt->SetShadow();
$graph->AddText($txt);
+
+

+

+

 

Text ::
SetWordWrap($aCol)
+ +Specify a maximum line length

+ + + + +
ArgumentDefaultDescription
+$aCol + + + Number of chars in column
+ +

Description:
Specify a maximum line length. This method will insert suitable line breaks to ensure thateach line never exeeds the specified number of characters. The method will not break words. 
+ +

Example:

+$txt = new Text('A suitable long text which will be broken');
$txt->SetWordWrap(15); +
+

+

+

 

Text ::
Show($aShow)
+ +Show or hide the text string

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +True=Display text
+ +

Description:
Show or hide the text string. By default the text string is turned off. So a call to Show() is becessary for the text string to be displayed in the graph. + 
+ +

Example:

+$txt->Show();
+
+

+

+

 

Text ::
__construct($aTxt, $aXAbsPos, $aYAbsPos)
+ +Constructor. Create new text at absolute pixel coordinates

+ + + + + + + + +
ArgumentDefaultDescription
+$aTxt + + + Text string
+$aXAbsPos + + + X-coordinate
+$aYAbsPos + + + Y-coordinate
+ +

Description:
Create a new object to repesent a text string that is to be displayed on the graph. + +If the position is not specified when the object is created it can later be specified with a call to the Pos() method. + +The default alignment is to interpret the x,y coordinate as being the lower left corner of the bounding box for the text string. + +Note. The texts are hidden by default and you must remember toi call Show() to make the text appear in the image. 
+
+
Returns
An istance of class Text
+  
See also:
+

Example:

+// Possible creations of text objects

// Case 1. Text and position is specified later
$txt = new Text();

// Case 2. Position is specified later
$txt = new Text('Hello world');

// Case 3. Full specification
$txt = new Text('Hello world',100,150);

// A more real life example
$txt = new Text("Note: Simple textnote.\nWIth two lines");
$txt->SetFont(FF_FONT1,FS_BOLD);
$txt->Pos(0.5,0.97,'center','bottom');
$txt->SetBox('yellow','black');
$graph->AddText($txt);



+
+

+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/TextProperty.html b/includes/jpgraph/docs/classref/TextProperty.html new file mode 100644 index 0000000..2a66360 --- /dev/null +++ b/includes/jpgraph/docs/classref/TextProperty.html @@ -0,0 +1,200 @@ +


Class TextProperty
+(Defined in: jpgraph_gantt.php : 1547)
 
 TextProperty 
 Align() 
Set() 
SetAlign() 
SetColor() 
SetFont() 
Show() 
+
 

Class usage and Overview
This is very similair to Text but this is only used as an internal helper class in Gantt chart. In comparison with text it has the added funtionality that it can handle tabs. + +In the next version of JpGraph the extra functionality that this class has should be added to the real class Text() to make the class more orthogonal. + +Since this is just an internal helper class it has its justified position though. This was oroginally considered a very experimental text class and it made sence to compartmetn thath functionlity in a separate class to the stnadard Text() class. +

  +

See also related classes:
Text

 


Class Methods

+

 

TextProperty ::
Align($aHAlign, $aVAlign)
+ +Specify vertical and horizontal alignment

+ + + + + + +
ArgumentDefaultDescription
+$aHAlign + + + Horizontal alignment
+$aVAlign + + + +"bottom" + +Vertical alignment
+ +

Description:
Specify the anchor point fo the text. The anchor point determines how the texts x,y positions should be interpretated. + 
+

+

 

TextProperty ::
Set($aTxt)
+ +Specify text string

+ + + + +
ArgumentDefaultDescription
+$aTxt + + + Text string
+ +

Description:
Specify text string 
+ +

Example:

+$graph->title->Set("Overview for year 2002");
+
+

+

+

 

TextProperty ::
SetAlign($aHAlign, $aVAlign)
+ +Specify alignment for text

+ + + + + + +
ArgumentDefaultDescription
+$aHAlign + + + Horizontal alignment
+$aVAlign + + + +"bottom" + +Vertical alignment
+ +

Description:
Specify alignment for text. Same as TextProperty::Align() 
+  
See also:

+

 

TextProperty ::
SetColor($aColor)
+ +Set text color

+ + + + +
ArgumentDefaultDescription
+$aColor + + + Color
+ +

Description:
Specify text color 
+ +

Example:

+SetColor('red:0.6'); + +

+

+

 

TextProperty ::
SetFont($aFFamily, $aFStyle, $aFSize)
+ +Specify font

+ + + + + + + + +
ArgumentDefaultDescription
+$aFFamily + + + Font family
+$aFStyle + + + +FS_NORMAL + +Font style
+$aFSize + + + +10 + +Font size
+ +

Description:
Specify font family, size and style. Two major types of font families can be used, builtin bitmnapped fonts or TTF fonts. The builtin fonts have a fixed size which can't be altered. + +Valid styles are + + +Valid values for the internal font families are + + +Note: FF_FONT0 only suppor font style FS_NORMAL + +The available TTF are by default +
+  
See also:
+

Example:

+SetFont(FF_ARIAL,FS_NORMAL,12) + +

+

+

 

TextProperty ::
Show($aShow)
+ +Unhide/hide the text

+ + + + +
ArgumentDefaultDescription
+$aShow + + + +true + +True=Show text
+ +

Description:
Specify if the text should be displayed or hidden 
+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/Ticks.html b/includes/jpgraph/docs/classref/Ticks.html new file mode 100644 index 0000000..8ce101f --- /dev/null +++ b/includes/jpgraph/docs/classref/Ticks.html @@ -0,0 +1,292 @@ +


Class Ticks
+(Defined in: jpgraph.php : 3914)
 
 Ticks 
 SetColor() 
SetFormatCallback() 
SetLabelFormat() 
SetSide() 
SetSize() 
SetWeight() 
SupressFirst() 
SupressLast() 
SupressMinorTickMarks() 
SupressTickMarks() 
SupressZeroLabel() 
+
 

Class usage and Overview
This is the abstract base class for ticks. Specifying the common signature for both linear and logartihmic ticks. + +Ticks are normally a property of the scale and can be accessed via the $graph->scale->ticks property. +

  +


Class Methods

+

 

Ticks ::
SetColor($aMajorColor, $aMinorColor)
+ +Set color for tick marks

+ + + + + + +
ArgumentDefaultDescription
+$aMajorColor + + + Major tick mark color
+$aMinorColor + + + +'' + +Minor tick mark color
+ +

Description:
Specify tick mark colors. If no minor tick mark color is specified then it will be the same as the major tick marks color. 
+ +

Example:

+$graph->yaxis->scale->ticks->SetColor('red','black');
+
+

+

+

 

Ticks ::
SetFormatCallback($aCallbackFuncName)
+ +Specify a format callback function for labels

+ + + + +
ArgumentDefaultDescription
+$aCallbackFuncName + + + name of function
+ +

Description:
Specifies a callback function which will be called and given each tick label in turn as the argument. The callback function is supposed to return a proper formatted label to be displayed. + +Note: There is a shortcut to this method through the Axis::SetLabelFormatCallback. + +Note 2: The PHP function number_format() is often usefull in callback functions. + 
+  
See also:
+

Example:

+// Callback function for Y-scale. Use money format with
// a ',' to separate 1000:s
function yScaleCallback($aVal) {
    return 
number_format($aVal);
}


// Short for $graph->yaxis->scale->ticks->SetFormatCallback()
$graph->yaxis->SetLabelFormatCallback('yScaleCallback');

+
+

+

+

 

Ticks ::
SetLabelFormat($aFormatString, $aDate)
+ +Set format string for automatic labels

+ + + + + + +
ArgumentDefaultDescription
+$aFormatString + + + Specify a printf() style format string
+$aDate + + + +FALSE + +No description available
+ +

Description:
Specify a printf() style format string. + +Note: Can also be called trough the shortcut Axis::SetLabelFormatString() + 
+  
See also:
+

Example:

+$graph->yaxis->SetLabelFormatString("%-02.1f"); + +

+

+

 

Ticks ::
SetSide($aSide)
+ +Specify side of axis for ticks

+ + + + +
ArgumentDefaultDescription
+$aSide + + + Side
+ +

Description:
Synonym for SetDirection(). +Specify what side of the axis the tick marks should be drawn on. For Y -axis the possible directions are + + + +and for X-axis the possible parameters are + + 
+  
See also:
+

Example:

+$graph->xaxis->scale->ticks->SetSide(SIDE_UP);
+
+

+

+

 

Ticks ::
SetSize($aMajSize, $aMinSize)
+ +Specify absolute size of tick marks in pixels

+ + + + + + +
ArgumentDefaultDescription
+$aMajSize + + + Major tick size
+$aMinSize + + + +3 + +Minor tick size
+ +

Description:
Specify absolute size of tick marks in pixels 
+ +

Example:

+$graph->xaxis->scale->ticks->SetSize(8,3); + +

+

+

 

Ticks ::
SetWeight($aWeight)
+ +Specify width of tick marks

+ + + + +
ArgumentDefaultDescription
+$aWeight + + + Width (in pixels)
+ +

Description:
Specify width of tick marks 
+ +

Example:

+$graph->xaxis->scale->ticks->SetWeight(2); + +

+

+

 

Ticks ::
SupressFirst($aHide)
+ +Hide the first tick mark

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide the vbery first tick mark on the axis
+ +

Description:
Hide the first tick mark on the axis. 
+  
See also:
+

Example:

+$graph->xaxis->scale->ticks->SupressFirst();
+
+

+

+

 

Ticks ::
SupressLast($aHide)
+ +Hide the last tick mark

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide the last tick mark
+ +

Description:
Hide the last tick mark on the axis 
+  
See also:

+

 

Ticks ::
SupressMinorTickMarks($aHide)
+ +Hide all minor tick marks

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide minor tick marks
+ +

Description:
Hide all minor tick marks 
+

+

 

Ticks ::
SupressTickMarks($aHide)
+ +Hide major tick marks

+ + + + +
ArgumentDefaultDescription
+$aHide + + + +true + +True=Hide major tick marks
+ +

Description:
Hide major tick marks 
+  
See also:

+

 

Ticks ::
SupressZeroLabel($aFlag)
+ +Don't display the first zero label

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + +true + +True=Hide zero-label
+ +

Description:
Hide any label with numeric value == 0.0 
+


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/WindroseGraph.html b/includes/jpgraph/docs/classref/WindroseGraph.html new file mode 100644 index 0000000..5a66fe0 --- /dev/null +++ b/includes/jpgraph/docs/classref/WindroseGraph.html @@ -0,0 +1,207 @@ +


Class WindroseGraph Extends Graph
+(Defined in: jpgraph_windrose.php : 1436)
 
 WindroseGraph  Graph 
 Add() 
AddText() 
SetColor() 
Stroke() 
StrokeIcons() 
StrokeTexts() 
__construct() 
+
 Add() 
AddBand() 
AddLine() 
AddText() 
AddY() 
AddY2() 
CheckCSIMCache() 
GetCSIMImgHTML() 
GetHTMLImageMap() 
Set3DPerspective() 
Set90AndMargin() 
SetAlphaBlending() 
SetAngle() 
SetAxisLabelBackground() 
SetAxisStyle() 
SetBackgroundCFlag() 
SetBackgroundCountryFlag() 
SetBackgroundGradient() 
SetBackgroundImage() 
SetBackgroundImageMix() 
SetBackgroundImagePos() 
SetBox() 
SetClipping() 
SetColor() 
SetCSIMImgAlt() 
SetFrame() 
SetFrameBevel() 
SetGridDepth() 
SetIconDepth() 
SetImgFormat() 
SetMargin() 
SetMarginColor() 
SetScale() 
SetShadow() 
SetTextScaleAbsCenterOff() 
SetTickDensity() 
SetTitleBackground() 
SetTitleBackgroundFillStyle() 
SetUserFont() 
SetUserFont1() 
SetUserFont2() 
SetUserFont3() 
SetY2OrderBack() 
SetY2Scale() 
SetYDeltaDist() 
SetYScale() 
Stroke() 
StrokeCSIM() 
StrokeCSIMImage() 
StrokeFrameBackground() 
StrokeStore() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

WindroseGraph ::
Add($aObj)
+ +//---------------// PUBLIC METHODS

+ + + + +
ArgumentDefaultDescription
+$aObj + + + No description available
+ +

Description:
No description available.

+

 

WindroseGraph ::
AddText($aTxt, $aToY2)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aTxt + + + No description available
+$aToY2 + + + +false + +No description available
+ +

Description:
No description available.

+

 

WindroseGraph ::
SetColor($c)
+ +

+ + + + +
ArgumentDefaultDescription
+$c + + + No description available
+ +

Description:
No description available.

+

 

WindroseGraph ::
Stroke($aStrokeFileName)
+ +// Method description

+ + + + +
ArgumentDefaultDescription
+$aStrokeFileName + + + +"" + +No description available
+ +

Description:
No description available.

+

 

WindroseGraph ::
StrokeIcons()
+ +

+
+ +

Description:
No description available.

+

 

WindroseGraph ::
StrokeTexts()
+ +

+
+ +

Description:
No description available.

+

 

WindroseGraph ::
__construct($width, $height, $cachedName, $timeout, $inline)
+ +//============================================================// CLASS WindroseGraph//============================================================

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$width + + + +300 + +No description available
+$height + + + +200 + +No description available
+$cachedName + + + +"" + +No description available
+$timeout + + + +0 + +No description available
+$inline + + + +1 + +No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/WindrosePlot.html b/includes/jpgraph/docs/classref/WindrosePlot.html new file mode 100644 index 0000000..775c06d --- /dev/null +++ b/includes/jpgraph/docs/classref/WindrosePlot.html @@ -0,0 +1,871 @@ +


Class WindrosePlot
+(Defined in: jpgraph_windrose.php : 385)
 
 WindrosePlot 
 FixupIndexes() 
getHeight() 
getWidth() 
LayoutSize() 
NormAngle() 
SetAntiAlias() 
SetAutoScaleAngle() 
SetBox() 
SetCenterPos() 
SetCenterSize() 
SetColor() 
SetCompassLabels() 
SetDataKeyEncoding() 
SetFont() 
SetFontColor() 
SetGridColor() 
SetGridWeight() 
SetLabelFormat() 
SetLabelMargin() 
SetLabelPosition() 
SetLabels() 
SetPos() 
SetRadialColors() 
SetRadialGridStyle() 
SetRadialStyles() 
SetRadialWeights() 
SetRangeColors() 
SetRanges() 
SetRangeStyle() 
SetRangeWeights() 
SetSize() 
SetType() 
SetZCircleSize() 
Stroke() 
_StrokeFreeRose() 
_StrokeLegend() 
_StrokeRegularRose() 
_StrokeWindLeg() 
_ThickCircle() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

WindrosePlot ::
FixupIndexes($aDataArray, $num)
+ +// Translate potential string specified compass labels to their// corresponding index.

+ + + + + + +
ArgumentDefaultDescription
+$aDataArray + + + No description available
+$num + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
getHeight($aImg)
+ +// Make sure that the width of the legend fits

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
getWidth($aImg)
+ +// We want the non scaled original radius

+ + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
LayoutSize()
+ +// Dummy method to make window plots have the same signature as the// layout classes since windrose plots are "leaf" classes in the hierarchy

+
+ +

Description:
No description available.

+

 

WindrosePlot ::
NormAngle($a)
+ +// Some heuristics to have some preferred positions

+ + + + +
ArgumentDefaultDescription
+$a + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetAntiAlias($aFlag)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlag + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetAutoScaleAngle($aIsRegRose)
+ +// Draw the text under the legend

+ + + + +
ArgumentDefaultDescription
+$aIsRegRose + + + +true + +No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetBox($aColor, $aWeight, $aStyle, $aShow)
+ +

+ + + + + + + + + + +
ArgumentDefaultDescription
+$aColor + + + +'black' + +No description available
+$aWeight + + + +1 + +No description available
+$aStyle + + + +'solid' + +No description available
+$aShow + + + +true + +No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetCenterPos($aX, $aY)
+ +// Alias for SetPos()

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + No description available
+$aY + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetCenterSize($aSize)
+ +

+ + + + +
ArgumentDefaultDescription
+$aSize + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetCompassLabels($aLabels)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLabels + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetDataKeyEncoding($aEncoding)
+ +

+ + + + +
ArgumentDefaultDescription
+$aEncoding + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetFont($aFFam, $aFStyle, $aFSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFFam + + + No description available
+$aFStyle + + + +FS_NORMAL + +No description available
+$aFSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetGridColor($aColor1, $aColor2)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aColor1 + + + No description available
+$aColor2 + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetGridWeight($aGrid1, $aGrid2)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aGrid1 + + + +1 + +No description available
+$aGrid2 + + + +2 + +No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetLabelFormat($aLblFormat)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLblFormat + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetLabelMargin($aMarg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aMarg + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetLabelPosition($aPos)
+ +

+ + + + +
ArgumentDefaultDescription
+$aPos + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetLabels($aLabels)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLabels + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetPos($aX, $aY)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aX + + + No description available
+$aY + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRadialColors($aColors)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColors + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRadialGridStyle($aStyle)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRadialStyles($aStyles)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStyles + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRadialWeights($aWeights)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeights + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRangeColors($aLegColors)
+ +

+ + + + +
ArgumentDefaultDescription
+$aLegColors + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRanges($aRanges)
+ +

+ + + + +
ArgumentDefaultDescription
+$aRanges + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRangeStyle($aStyle)
+ +

+ + + + +
ArgumentDefaultDescription
+$aStyle + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetRangeWeights($aWeights)
+ +

+ + + + +
ArgumentDefaultDescription
+$aWeights + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetSize($aSize)
+ +

+ + + + +
ArgumentDefaultDescription
+$aSize + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetType($aType)
+ +

+ + + + +
ArgumentDefaultDescription
+$aType + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
SetZCircleSize($aSize)
+ +// Alias for SetCenterSize

+ + + + +
ArgumentDefaultDescription
+$aSize + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
Stroke($aGraph)
+ +// Add an extra margin of 50% the font size//$maxh += round($this->iFontSize*$scaling * 0.5) ;

+ + + + +
ArgumentDefaultDescription
+$aGraph + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
_StrokeFreeRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
+ +

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$dblImg + + + No description available
+$value + + + No description available
+$scaling + + + No description available
+$xc + + + No description available
+$yc + + + No description available
+$r + + + No description available
+$ri + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
_StrokeLegend($aImg, $x, $y, $scaling, $aReturnWidth)
+ +// If less than 1 px long then we assume this has been caused by rounding problems// and should not be stroked

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+$x + + + No description available
+$y + + + No description available
+$scaling + + + +1 + +No description available
+$aReturnWidth + + + +false + +No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
_StrokeRegularRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
+ +

+ + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$dblImg + + + No description available
+$value + + + No description available
+$scaling + + + No description available
+$xc + + + No description available
+$yc + + + No description available
+$r + + + No description available
+$ri + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
_StrokeWindLeg($aImg, $xc, $yc, $a, $ri, $r, $weight, $color)
+ +

+ + + + + + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+$xc + + + No description available
+$yc + + + No description available
+$a + + + No description available
+$ri + + + No description available
+$r + + + No description available
+$weight + + + No description available
+$color + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
_ThickCircle($aImg, $aXC, $aYC, $aRad, $aWeight, $aColor)
+ +

+ + + + + + + + + + + + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+$aXC + + + No description available
+$aYC + + + No description available
+$aRad + + + No description available
+$aWeight + + + +2 + +No description available
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlot ::
__construct($aData)
+ +//===================================================// CLASS WindrosePlot//===================================================

+ + + + +
ArgumentDefaultDescription
+$aData + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/WindrosePlotScale.html b/includes/jpgraph/docs/classref/WindrosePlotScale.html new file mode 100644 index 0000000..5847776 --- /dev/null +++ b/includes/jpgraph/docs/classref/WindrosePlotScale.html @@ -0,0 +1,371 @@ +


Class WindrosePlotScale
+(Defined in: jpgraph_windrose.php : 47)
 
 WindrosePlotScale 
 AutoScale() 
GetMax() 
GetNumCirc() 
Hide() 
RelTranslate() 
Set() 
SetAngle() 
SetFont() 
SetFontColor() 
SetLabelAlign() 
SetLabelFillColor() 
SetLabelFormat() 
SetMaxValue() 
SetZeroLabel() 
SetZFont() 
SetZFontColor() 
StrokeLabels() 
__construct() 
+
 

Class usage and Overview

  +


Class Methods

+

 

WindrosePlotScale ::
AutoScale($aRadius, $aMinDist)
+ +// Remember that user has specified interval so don't// do autoscaling

+ + + + + + +
ArgumentDefaultDescription
+$aRadius + + + No description available
+$aMinDist + + + +30 + +No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
GetMax()
+ +// Return max of all leg values

+
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
GetNumCirc()
+ +// Return number of grid circles

+
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
Hide($aFlg)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFlg + + + +true + +No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
RelTranslate($aVal, $r, $ri)
+ +// Translate a Leg value to radius distance

+ + + + + + + + +
ArgumentDefaultDescription
+$aVal + + + No description available
+$r + + + No description available
+$ri + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
Set($aMax, $aDelta)
+ +// Set step size for circular grid

+ + + + + + +
ArgumentDefaultDescription
+$aMax + + + No description available
+$aDelta + + + +null + +No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetAngle($aAngle)
+ +

+ + + + +
ArgumentDefaultDescription
+$aAngle + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetFont($aFontFamily, $aFontStyle, $aFontSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + No description available
+$aFontStyle + + + +FS_NORMAL + +No description available
+$aFontSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetLabelAlign($aAlign)
+ +

+ + + + +
ArgumentDefaultDescription
+$aAlign + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetLabelFillColor($aBkgColor, $aBorderColor)
+ +

+ + + + + + +
ArgumentDefaultDescription
+$aBkgColor + + + No description available
+$aBorderColor + + + +false + +No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetLabelFormat($aFmt)
+ +

+ + + + +
ArgumentDefaultDescription
+$aFmt + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetMaxValue($aMax)
+ +// Never return less than 1 circles

+ + + + +
ArgumentDefaultDescription
+$aMax + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetZeroLabel($aTxt)
+ +

+ + + + +
ArgumentDefaultDescription
+$aTxt + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetZFont($aFontFamily, $aFontStyle, $aFontSize)
+ +

+ + + + + + + + +
ArgumentDefaultDescription
+$aFontFamily + + + No description available
+$aFontStyle + + + +FS_NORMAL + +No description available
+$aFontSize + + + +10 + +No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
SetZFontColor($aColor)
+ +

+ + + + +
ArgumentDefaultDescription
+$aColor + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
StrokeLabels($aImg, $xc, $yc, $ri, $rr)
+ +

+ + + + + + + + + + + + +
ArgumentDefaultDescription
+$aImg + + + No description available
+$xc + + + No description available
+$yc + + + No description available
+$ri + + + No description available
+$rr + + + No description available
+ +

Description:
No description available.

+

 

WindrosePlotScale ::
__construct($aData)
+ +//===================================================// CLASS WindrosePlotScale//===================================================

+ + + + +
ArgumentDefaultDescription
+$aData + + + No description available
+ +

Description:
No description available.


\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/class_toc.html b/includes/jpgraph/docs/classref/class_toc.html new file mode 100644 index 0000000..c9b4d63 --- /dev/null +++ b/includes/jpgraph/docs/classref/class_toc.html @@ -0,0 +1,941 @@ + + + + Class index + JpGraph

+
1. AccBarPlot
+    1.1 Max
+    1.2 Min
+    1.3 __construct
+2. AccLinePlot
+    2.1 Max
+    2.2 Min
+    2.3 SetInterpolateMode
+    2.4 __construct
+3. AntiSpam
+    3.1 Rand
+    3.2 Set
+    3.3 Stroke
+    3.4 __construct
+4. AxisPrototype
+    4.1 Hide
+    4.2 HideFirstLastLabel
+    4.3 HideFirstTickLabel
+    4.4 HideLabels
+    4.5 HideLastTickLabel
+    4.6 HideLine
+    4.7 HideTicks
+    4.8 HideZeroLabel
+    4.9 SetColor
+    4.10 SetFont
+    4.11 SetLabelAlign
+    4.12 SetLabelAngle
+    4.13 SetLabelFormat
+    4.14 SetLabelFormatCallback
+    4.15 SetLabelFormatString
+    4.16 SetLabelMargin
+    4.17 SetLabelSide
+    4.18 SetMajTickPositions
+    4.19 SetPos
+    4.20 SetPosAbsDelta
+    4.21 SetTextLabelInterval
+    4.22 SetTextTickInterval
+    4.23 SetTickLabels
+    4.24 SetTickPositions
+    4.25 SetTickSide
+    4.26 SetTickSize
+    4.27 SetTitle
+    4.28 SetTitleMargin
+    4.29 SetTitleSide
+    4.30 SetWeight
+    4.31 __construct
+5. BarPlot
+    5.1 RotatePattern
+    5.2 SetAbsWidth
+    5.3 SetAlign
+    5.4 SetFillColor
+    5.5 SetFillGradient
+    5.6 SetNoFill
+    5.7 SetPattern
+    5.8 SetShadow
+    5.9 SetValuePos
+    5.10 SetWidth
+    5.11 SetYBase
+    5.12 SetYMin
+    5.13 __construct
+6. Bezier
+    6.1 Get
+    6.2 __construct
+7. BoxPlot
+    7.1 SetMedianColor
+    7.2 __construct
+8. CanvasGraph
+    8.1 InitFrame
+    8.2 Stroke
+    8.3 __construct
+9. CanvasRectangleText
+    9.1 ParagraphAlign
+    9.2 Pos
+    9.3 Set
+    9.4 SetAutoMargin
+    9.5 SetColor
+    9.6 SetCornerRadius
+    9.7 SetFillColor
+    9.8 SetFont
+    9.9 SetFontColor
+    9.10 SetPos
+    9.11 SetShadow
+    9.12 SetTxt
+    9.13 Stroke
+    9.14 __construct
+10. CanvasScale
+    10.1 Set
+    10.2 Translate
+    10.3 TranslateX
+    10.4 TranslateY
+    10.5 __construct
+11. ColorFactory
+    11.1 getColor
+12. Contour
+    12.1 adjustDataPointValues
+    12.2 CalculateColors
+    12.3 determineIsobarEdgeCrossings
+    12.4 getCrossingCoord
+    12.5 getIsobars
+    12.6 getMinMaxVal
+    12.7 isobarHCrossing
+    12.8 isobarVCrossing
+    12.9 resetEdgeMatrices
+    12.10 SetInvert
+    12.11 UseHighContrastColor
+    12.12 __construct
+13. ContourPlot
+    13.1 Invertlegend
+    13.2 Legend
+    13.3 Max
+    13.4 Min
+    13.5 PreScaleSetup
+    13.6 SetInvert
+    13.7 SetIsobarColors
+    13.8 ShowLegend
+    13.9 Stroke
+    13.10 UseHighContrastColor
+    13.11 __construct
+14. DateLocale
+    14.1 GetDayAbb
+    14.2 GetLongMonthName
+    14.3 GetMonth
+    14.4 GetShortDay
+    14.5 GetShortMonth
+    14.6 GetShortMonthName
+    14.7 Set
+    14.8 __construct
+15. DateScale
+    15.1 AdjustForDST
+    15.2 SetDateAlign
+    15.3 SetDateFormat
+    15.4 SetTimeAlign
+16. DateScaleUtils
+    16.1 doDaily
+    16.2 doMonthly
+    16.3 doWeekly
+    16.4 doYearly
+    16.5 GetAutoTicks
+    16.6 GetTicks
+    16.7 GetTicksFromMinMax
+    16.8 UseWeekFormat
+17. DigitalLED74
+    17.1 SetSupersampling
+    17.2 Stroke
+    17.3 StrokeNumber
+    17.4 __construct
+18. DisplayValue
+    18.1 ApplyFont
+    18.2 HideZero
+    18.3 SetAlign
+    18.4 SetAngle
+    18.5 SetColor
+    18.6 SetFont
+    18.7 SetFormat
+    18.8 SetFormatCallback
+    18.9 SetMargin
+    18.10 Show
+    18.11 __construct
+19. ErrMsgText
+    19.1 __construct
+20. ErrorLinePlot
+    20.1 __construct
+21. ErrorPlot
+    21.1 __construct
+22. FieldArrow
+    22.1 SetColor
+    22.2 SetSize
+23. FieldPlot
+    23.1 SetCallback
+    23.2 __construct
+24. Footer
+    24.1 SetMargin
+    24.2 SetTimer
+25. FuncGenerator
+    25.1 E
+    25.2 __construct
+26. GanttActivityInfo
+    26.1 Hide
+    26.2 SetBackgroundColor
+    26.3 SetColor
+    26.4 SetColTitles
+    26.5 SetColumnMargin
+    26.6 SetFont
+    26.7 SetFontColor
+    26.8 SetHeaderAlign
+    26.9 SetStyle
+    26.10 Show
+27. GanttBar
+    27.1 SetBreakStyle
+    27.2 SetColor
+    27.3 SetFillColor
+    27.4 SetHeight
+    27.5 SetPattern
+    27.6 SetShadow
+    27.7 __construct
+28. GanttGraph
+    28.1 Add
+    28.2 CreateSimple
+    28.3 SetDateRange
+    28.4 SetLabelVMarginFactor
+    28.5 SetSimpleFont
+    28.6 SetSimpleStyle
+    28.7 SetVMarginFactor
+    28.8 SetZoomFactor
+    28.9 ShowHeaders
+    28.10 Stroke
+    28.11 StrokeTexts
+    28.12 __construct
+29. GanttPlotObject
+    29.1 SetCaptionMargin
+    29.2 SetConstrain
+    29.3 SetCSIMAlt
+    29.4 SetCSIMTarget
+    29.5 SetLabelLeftMargin
+30. GanttScale
+    30.1 SetDateLocale
+    30.2 SetRange
+    30.3 SetTableTitleBackground
+    30.4 SetVertLayout
+    30.5 SetWeekStart
+    30.6 UseWeekendBackground
+31. GanttVLine
+    31.1 SetDayOffset
+    31.2 SetTitleMargin
+    31.3 SetWeight
+    31.4 __construct
+32. Graph
+    32.1 Add
+    32.2 AddBand
+    32.3 AddLine
+    32.4 AddText
+    32.5 AddY
+    32.6 AddY2
+    32.7 CheckCSIMCache
+    32.8 GetCSIMImgHTML
+    32.9 GetHTMLImageMap
+    32.10 Set3DPerspective
+    32.11 Set90AndMargin
+    32.12 SetAlphaBlending
+    32.13 SetAngle
+    32.14 SetAxisLabelBackground
+    32.15 SetAxisStyle
+    32.16 SetBackgroundCFlag
+    32.17 SetBackgroundCountryFlag
+    32.18 SetBackgroundGradient
+    32.19 SetBackgroundImage
+    32.20 SetBackgroundImageMix
+    32.21 SetBackgroundImagePos
+    32.22 SetBox
+    32.23 SetClipping
+    32.24 SetColor
+    32.25 SetCSIMImgAlt
+    32.26 SetFrame
+    32.27 SetFrameBevel
+    32.28 SetGridDepth
+    32.29 SetIconDepth
+    32.30 SetImgFormat
+    32.31 SetMargin
+    32.32 SetMarginColor
+    32.33 SetScale
+    32.34 SetShadow
+    32.35 SetTextScaleAbsCenterOff
+    32.36 SetTickDensity
+    32.37 SetTitleBackground
+    32.38 SetTitleBackgroundFillStyle
+    32.39 SetUserFont
+    32.40 SetUserFont1
+    32.41 SetUserFont2
+    32.42 SetUserFont3
+    32.43 SetY2OrderBack
+    32.44 SetY2Scale
+    32.45 SetYDeltaDist
+    32.46 SetYScale
+    32.47 Stroke
+    32.48 StrokeCSIM
+    32.49 StrokeCSIMImage
+    32.50 StrokeFrameBackground
+    32.51 StrokeStore
+    32.52 __construct
+33. GraphTabTitle
+    33.1 Set
+    33.2 SetColor
+    33.3 SetCorner
+    33.4 SetFillColor
+    33.5 SetTabAlign
+    33.6 SetWidth
+34. Grid
+    34.1 SetColor
+    34.2 SetFill
+    34.3 SetLineStyle
+    34.4 SetWeight
+    34.5 Show
+35. GroupBarPlot
+    35.1 GroupBarPlot
+36. GTextTable
+    36.1 Init
+    36.2 MergeCells
+    36.3 MergeCol
+    36.4 MergeRow
+    36.5 Set
+    36.6 SetAlign
+    36.7 SetAnchorPos
+    36.8 SetBorder
+    36.9 SetCellAlign
+    36.10 SetCellColor
+    36.11 SetCellCountryFlag
+    36.12 SetCellCSIMTarget
+    36.13 SetCellFillColor
+    36.14 SetCellFont
+    36.15 SetCellImage
+    36.16 SetCellImageConstrain
+    36.17 SetCellNumberFormat
+    36.18 SetCellPadding
+    36.19 SetCellTextOrientation
+    36.20 SetColAlign
+    36.21 SetColColor
+    36.22 SetColFillColor
+    36.23 SetColFont
+    36.24 SetColGrid
+    36.25 SetColImage
+    36.26 SetColNumberFormat
+    36.27 SetColor
+    36.28 SetColPadding
+    36.29 SetColTextOrientation
+    36.30 SetCSIMTarget
+    36.31 SetFillColor
+    36.32 SetFont
+    36.33 SetGrid
+    36.34 SetImage
+    36.35 SetMinColWidth
+    36.36 SetMinRowHeight
+    36.37 SetNumberFormat
+    36.38 SetPadding
+    36.39 SetPos
+    36.40 SetRowAlign
+    36.41 SetRowColor
+    36.42 SetRowFillColor
+    36.43 SetRowFont
+    36.44 SetRowGrid
+    36.45 SetRowImage
+    36.46 SetRowNumberFormat
+    36.47 SetRowPadding
+    36.48 SetRowTextOrientation
+    36.49 SetScalePos
+    36.50 SetTextOrientation
+    36.51 toString
+    36.52 __construct
+37. HeaderProperty
+    37.1 SetBackgroundColor
+    37.2 SetFont
+    37.3 SetFontColor
+    37.4 SetFormatString
+    37.5 SetFrameColor
+    37.6 SetFrameWeight
+    37.7 SetInterval
+    37.8 SetIntervall
+    37.9 SetLabelFormatString
+    37.10 SetStyle
+    37.11 SetSundayFontColor
+    37.12 SetTitleVertMargin
+    37.13 SetWeekendColor
+38. HorizontalGridLine
+    38.1 SetRowFillColor
+    38.2 SetStart
+    38.3 Show
+39. IconImage
+    39.1 SetAlign
+    39.2 __construct
+40. IconPlot
+    40.1 CreateFromString
+    40.2 DoLegend
+    40.3 GetAbsHeight
+    40.4 GetLineNbr
+    40.5 GetMaxDate
+    40.6 GetMinDate
+    40.7 GetWidthHeight
+    40.8 Max
+    40.9 Min
+    40.10 PreStrokeAdjust
+    40.11 SetAnchor
+    40.12 SetCountryFlag
+    40.13 SetMix
+    40.14 SetPos
+    40.15 SetScale
+    40.16 SetScalePos
+    40.17 StrokeMargin
+    40.18 StrokeWithScale
+    40.19 _Stroke
+    40.20 __construct
+41. Image
+    41.1 RoundedRectangle
+    41.2 SetAlphaBlending
+    41.3 SetAntiAliasing
+    41.4 SetCanvasColor
+    41.5 SetExpired
+    41.6 SetImgFormat
+    41.7 SetMargin
+    41.8 SetQuality
+    41.9 SetTransparent
+42. ImgTrans
+    42.1 Skew3D
+    42.2 _Skew3D
+    42.3 _TransHor3D
+    42.4 _TransVert3D
+    42.5 __construct
+43. JpGraphException
+    43.1 Stroke
+    43.2 _toString
+    43.3 __construct
+44. JpGraphExceptionL
+    44.1 __construct
+45. LayoutHor
+    45.1 getHeight
+    45.2 getWidth
+    45.3 Stroke
+    45.4 __construct
+46. LayoutRect
+    46.1 getHeight
+    46.2 getWidth
+    46.3 SetCenterPos
+    46.4 Stroke
+    46.5 __construct
+47. LayoutVert
+    47.1 getHeight
+    47.2 getWidth
+    47.3 Stroke
+    47.4 __construct
+48. Legend
+    48.1 Hide
+    48.2 Pos
+    48.3 SetAbsPos
+    48.4 SetColor
+    48.5 SetColumns
+    48.6 SetFillColor
+    48.7 SetFont
+    48.8 SetFrameWeight
+    48.9 SetHColMargin
+    48.10 SetLayout
+    48.11 SetLeftMargin
+    48.12 SetLineSpacing
+    48.13 SetLineWeight
+    48.14 SetMarkAbsHSize
+    48.15 SetMarkAbsSize
+    48.16 SetMarkAbsVSize
+    48.17 SetPos
+    48.18 SetReverse
+    48.19 SetShadow
+    48.20 SetVColMargin
+49. LegendStyle
+    49.1 Hide
+    49.2 SetCFont
+    49.3 SetCFontColor
+    49.4 SetCircleColor
+    49.5 SetCircleRadius
+    49.6 SetCircleText
+    49.7 SetCircleWeight
+    49.8 SetFont
+    49.9 SetFontColor
+    49.10 SetFormat
+    49.11 SetLength
+    49.12 SetLFont
+    49.13 SetLFontColor
+    49.14 SetMargin
+    49.15 SetText
+    49.16 SetTFont
+    49.17 SetTFontColor
+    49.18 Show
+50. LinearRegression
+    50.1 Calc
+    50.2 GetAB
+    50.3 GetStat
+    50.4 GetY
+    50.5 __construct
+51. LinearScale
+    51.1 SetAutoMax
+    51.2 SetAutoMin
+    51.3 SetAutoTicks
+    51.4 SetGrace
+52. LinearTicks
+    52.1 AdjustForDST
+    52.2 GetMajor
+    52.3 GetMinor
+    52.4 Set
+    52.5 SetMajTickPositions
+    52.6 SetTextLabelStart
+    52.7 SetTickPositions
+53. LineErrorPlot
+    53.1 __construct
+54. LinePlot
+    54.1 AddArea
+    54.2 LinePlot
+    54.3 SetBarCenter
+    54.4 SetColor
+    54.5 SetFastStroke
+    54.6 SetFillColor
+    54.7 SetFillFromYMin
+    54.8 SetFillGradient
+    54.9 SetStepStyle
+    54.10 SetStyle
+55. LineProperty
+    55.1 SetColor
+    55.2 SetStyle
+    55.3 SetWeight
+    55.4 Show
+    55.5 __construct
+56. LogScale
+    56.1 GetMaxVal
+    56.2 GetMinVal
+57. LogTicks
+    57.1 SetLabelLogType
+58. MatrixGraph
+    58.1 Add
+    58.2 AddText
+    58.3 SetColor
+    58.4 Stroke
+    58.5 StrokeIcons
+    58.6 StrokeTexts
+    58.7 __construct
+59. MatrixLegend
+    59.1 getLength
+    59.2 getWidth
+    59.3 InitSize
+    59.4 SetBox
+    59.5 SetFont
+    59.6 SetFormatString
+    59.7 SetLabelMargin
+    59.8 SetLayout
+    59.9 SetMargin
+    59.10 SetMinMax
+    59.11 SetModuleSize
+    59.12 SetSize
+    59.13 Show
+    59.14 Stroke
+    59.15 __construct
+60. MatrixPlot
+    60.1 GetHeight
+    60.2 GetWidth
+    60.3 InitSize
+    60.4 SetAlpha
+    60.5 SetAutoContrast
+    60.6 SetBackgroundColor
+    60.7 SetBox
+    60.8 SetCenterPos
+    60.9 SetLegendLayout
+    60.10 SetMargin
+    60.11 SetModuleSize
+    60.12 SetModuleType
+    60.13 SetPos
+    60.14 SetSize
+    60.15 SetupColormap
+    60.16 Stroke
+    60.17 __construct
+61. MeshInterpolate
+    61.1 IntSquare
+    61.2 Linear
+62. MGraph
+    62.1 Add
+    62.2 AddMix
+    62.3 SetBackgroundImage
+    62.4 SetBackgroundImageMix
+    62.5 SetExpired
+    62.6 SetFillColor
+    62.7 SetFrame
+    62.8 SetImgFormat
+    62.9 SetMargin
+    62.10 Stroke
+    62.11 _gdImgHandle
+    62.12 _strokeBackgroundImage
+    62.13 __construct
+63. MileStone
+    63.1 __construct
+64. OdoGraph
+    64.1 Add
+    64.2 Stroke
+    64.3 StrokeIcons
+    64.4 StrokeTexts
+    64.5 __construct
+65. Odometer
+    65.1 AddIndication
+    65.2 FilledCircle
+    65.3 LayoutSize
+    65.4 SetBase
+    65.5 SetBorder
+    65.6 SetCenterAreaWidth
+    65.7 SetColor
+    65.8 SetMargin
+    65.9 SetPos
+    65.10 SetSize
+    65.11 Stroke
+    65.12 StrokeFascia
+    65.13 __construct
+66. OdometerLabel
+    66.1 SetVPos
+67. OdoNeedle
+    67.1 Set
+    67.2 SetColor
+    67.3 SetFillColor
+    67.4 SetLength
+    67.5 SetLineWeight
+    67.6 SetShadow
+    67.7 SetStyle
+    67.8 SetWeight
+    67.9 Show
+    67.10 Stroke
+    67.11 __construct
+68. OdoScale
+    68.1 Set
+    68.2 SetAngle
+    68.3 SetLabelFormat
+    68.4 SetLabelPos
+    68.5 SetTickColor
+    68.6 SetTickLength
+    68.7 SetTicks
+    68.8 SetTickWeight
+    68.9 Show
+    68.10 Stroke
+    68.11 Translate
+    68.12 __construct
+69. PieGraph
+    69.1 Add
+    69.2 SetAntiAliasing
+    69.3 SetColor
+    69.4 Stroke
+    69.5 __construct
+70. PiePlot
+    70.1 Explode
+    70.2 ExplodeAll
+    70.3 ExplodeSlice
+    70.4 SetCenter
+    70.5 SetColor
+    70.6 SetCSIMTargets
+    70.7 SetGuideLines
+    70.8 SetGuideLinesAdjust
+    70.9 SetLabelPos
+    70.10 SetLabels
+    70.11 SetLabelType
+    70.12 SetLegends
+    70.13 SetShadow
+    70.14 SetSize
+    70.15 SetSliceColors
+    70.16 SetStartAngle
+    70.17 SetTheme
+    70.18 SetValueType
+    70.19 ShowBorder
+    70.20 __construct
+71. PiePlot3D
+    71.1 Add3DSliceToCSIM
+    71.2 SetAngle
+    71.3 SetCSIMTargets
+    71.4 SetEdge
+    71.5 SetHeight
+    71.6 SetLabelMargin
+    71.7 SetLabels
+    71.8 SetLegends
+    71.9 SetSliceColors
+    71.10 SetStartAngle
+    71.11 __construct
+72. PiePlotC
+    72.1 SetMid
+    72.2 SetMidColor
+    72.3 SetMidCSIM
+    72.4 SetMidSize
+    72.5 SetMidTitle
+    72.6 __construct
+73. Plot
+    73.1 HideLegend
+    73.2 PreScaleSetup
+    73.3 SetCenter
+    73.4 SetColor
+    73.5 SetCSIMTargets
+    73.6 SetLegend
+    73.7 SetLineWeight
+74. PlotBand
+    74.1 PreStrokeAdjust
+    74.2 SetDensity
+    74.3 SetOrder
+    74.4 ShowFrame
+    74.5 __construct
+75. PlotLine
+    75.1 HideLegend
+    75.2 SetColor
+    75.3 SetDirection
+    75.4 SetLegend
+    75.5 SetLineStyle
+    75.6 SetPosition
+    75.7 SetWeight
+    75.8 __construct
+76. PlotMark
+    76.1 Hide
+    76.2 SetCallback
+    76.3 SetCallbackYX
+    76.4 SetColor
+    76.5 SetDefaultWidth
+    76.6 SetFillColor
+    76.7 SetSize
+    76.8 SetType
+    76.9 SetWeight
+    76.10 SetWidth
+    76.11 Show
+77. PolarAxis
+    77.1 HideTicks
+    77.2 SetAngleFont
+    77.3 SetAngleStep
+    77.4 SetColor
+    77.5 SetGridColor
+    77.6 SetTickColors
+    77.7 ShowAngleDegreeMark
+    77.8 ShowAngleLabel
+    77.9 ShowGrid
+78. PolarGraph
+    78.1 Set90AndMargin
+    78.2 SetDensity
+    78.3 SetPlotSize
+    78.4 SetScale
+    78.5 SetType
+    78.6 Stroke
+    78.7 __construct
+79. PolarPlot
+    79.1 SetColor
+    79.2 SetCSIMTargets
+    79.3 SetFillColor
+    79.4 SetLegend
+    79.5 SetWeight
+    79.6 __construct
+80. Progress
+    80.1 Set
+    80.2 SetFillColor
+    80.3 SetPattern
+81. RadarAxis
+82. RadarGraph
+    82.1 Add
+    82.2 HideTickMarks
+    82.3 SetCenter
+    82.4 SetColor
+    82.5 SetPlotSize
+    82.6 SetPos
+    82.7 SetScale
+    82.8 SetSize
+    82.9 SetTickDensity
+    82.10 SetTitles
+    82.11 ShowMinorTickmarks
+    82.12 Stroke
+    82.13 StrokeIcons
+    82.14 StrokeTexts
+    82.15 __construct
+83. RadarGrid
+    83.1 SetColor
+    83.2 SetLineStyle
+    83.3 SetWeight
+    83.4 Show
+84. RadarLinearTicks
+    84.1 GetMajor
+    84.2 GetMinor
+    84.3 Set
+85. RadarLogTicks
+86. RadarPlot
+    86.1 SetColor
+    86.2 SetCSIMTargets
+    86.3 SetFill
+    86.4 SetFillColor
+    86.5 SetLegend
+    86.6 SetLineStyle
+    86.7 SetLineWeight
+    86.8 __construct
+87. ReadFileData
+    87.1 From1Col
+88. RectLayout
+    88.1 LayoutSize
+89. RotImage
+    89.1 SetAngle
+    89.2 SetCenter
+    89.3 SetMargin
+    89.4 SetTranslation
+90. ScatterPlot
+    90.1 SetImpuls
+    90.2 SetLinkPoints
+    90.3 SetStem
+    90.4 __construct
+91. Shape
+    91.1 Bezier
+    91.2 Circle
+    91.3 FilledCircle
+    91.4 FilledPolygon
+    91.5 FilledRectangle
+    91.6 FilledRoundedRectangle
+    91.7 IndentedRectangle
+    91.8 Line
+    91.9 Polygon
+    91.10 Rectangle
+    91.11 RoundedRectangle
+    91.12 SetColor
+    91.13 SetTextAlign
+    91.14 ShadowRectangle
+    91.15 __construct
+92. Spline
+    92.1 Get
+    92.2 __construct
+93. StockPlot
+    93.1 HideEndLines
+    93.2 SetColor
+    93.3 SetWidth
+    93.4 __construct
+94. SuperScriptText
+    94.1 FromReal
+    94.2 GetFontHeight
+    94.3 GetTextHeight
+    94.4 GetWidth
+    94.5 Set
+    94.6 SetSuperFont
+    94.7 __construct
+95. SymChar
+    95.1 Get
+96. Text
+    96.1 Align
+    96.2 Center
+    96.3 GetFontHeight
+    96.4 GetTextHeight
+    96.5 GetWidth
+    96.6 Hide
+    96.7 ParagraphAlign
+    96.8 Set
+    96.9 SetAlign
+    96.10 SetAngle
+    96.11 SetBox
+    96.12 SetColor
+    96.13 SetCSIMTarget
+    96.14 SetFont
+    96.15 SetMargin
+    96.16 SetOrientation
+    96.17 SetParagraphAlign
+    96.18 SetPos
+    96.19 SetScalePos
+    96.20 SetShadow
+    96.21 SetWordWrap
+    96.22 Show
+    96.23 __construct
+97. TextProperty
+    97.1 Align
+    97.2 Set
+    97.3 SetAlign
+    97.4 SetColor
+    97.5 SetFont
+    97.6 Show
+98. Ticks
+    98.1 SetColor
+    98.2 SetFormatCallback
+    98.3 SetLabelFormat
+    98.4 SetSide
+    98.5 SetSize
+    98.6 SetWeight
+    98.7 SupressFirst
+    98.8 SupressLast
+    98.9 SupressMinorTickMarks
+    98.10 SupressTickMarks
+    98.11 SupressZeroLabel
+99. WindroseGraph
+    99.1 Add
+    99.2 AddText
+    99.3 SetColor
+    99.4 Stroke
+    99.5 StrokeIcons
+    99.6 StrokeTexts
+    99.7 __construct
+100. WindrosePlot
+    100.1 FixupIndexes
+    100.2 getHeight
+    100.3 getWidth
+    100.4 LayoutSize
+    100.5 NormAngle
+    100.6 SetAntiAlias
+    100.7 SetAutoScaleAngle
+    100.8 SetBox
+    100.9 SetCenterPos
+    100.10 SetCenterSize
+    100.11 SetColor
+    100.12 SetCompassLabels
+    100.13 SetDataKeyEncoding
+    100.14 SetFont
+    100.15 SetFontColor
+    100.16 SetGridColor
+    100.17 SetGridWeight
+    100.18 SetLabelFormat
+    100.19 SetLabelMargin
+    100.20 SetLabelPosition
+    100.21 SetLabels
+    100.22 SetPos
+    100.23 SetRadialColors
+    100.24 SetRadialGridStyle
+    100.25 SetRadialStyles
+    100.26 SetRadialWeights
+    100.27 SetRangeColors
+    100.28 SetRanges
+    100.29 SetRangeStyle
+    100.30 SetRangeWeights
+    100.31 SetSize
+    100.32 SetType
+    100.33 SetZCircleSize
+    100.34 Stroke
+    100.35 _StrokeFreeRose
+    100.36 _StrokeLegend
+    100.37 _StrokeRegularRose
+    100.38 _StrokeWindLeg
+    100.39 _ThickCircle
+    100.40 __construct
+101. WindrosePlotScale
+    101.1 AutoScale
+    101.2 GetMax
+    101.3 GetNumCirc
+    101.4 Hide
+    101.5 RelTranslate
+    101.6 Set
+    101.7 SetAngle
+    101.8 SetFont
+    101.9 SetFontColor
+    101.10 SetLabelAlign
+    101.11 SetLabelFillColor
+    101.12 SetLabelFormat
+    101.13 SetMaxValue
+    101.14 SetZeroLabel
+    101.15 SetZFont
+    101.16 SetZFontColor
+    101.17 StrokeLabels
+    101.18 __construct
+

\ No newline at end of file diff --git a/includes/jpgraph/docs/classref/index.html b/includes/jpgraph/docs/classref/index.html new file mode 100644 index 0000000..1f70726 --- /dev/null +++ b/includes/jpgraph/docs/classref/index.html @@ -0,0 +1,11 @@ + + + + + Project documentation + + + ; + + + \ No newline at end of file diff --git a/includes/jpgraph/docs/classref/projinfo.html b/includes/jpgraph/docs/classref/projinfo.html new file mode 100644 index 0000000..995b3a3 --- /dev/null +++ b/includes/jpgraph/docs/classref/projinfo.html @@ -0,0 +1,5 @@ +
JpGraph
+

Documentation status: 73%

Total number of Classes: 135, Methods: 1362

+This version does not include private methods & classes

Generated at 20 Jul 2009 at 16:57
+


+© 2000 - 2009 Aditus Consulting. All rights reserved.
\ No newline at end of file diff --git a/includes/jpgraph/docs/index.html b/includes/jpgraph/docs/index.html new file mode 100644 index 0000000..fa97b04 --- /dev/null +++ b/includes/jpgraph/docs/index.html @@ -0,0 +1,123 @@ + + +JpGraph Documentation + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +© 2000 - 2010 Asial Co. Ltd. (Asial USA) + +
+ + + + + + diff --git a/includes/jpgraph/docs/jpgraph_logo.jpg b/includes/jpgraph/docs/jpgraph_logo.jpg new file mode 100644 index 0000000..c09464e Binary files /dev/null and b/includes/jpgraph/docs/jpgraph_logo.jpg differ diff --git a/includes/jpgraph/docs/manual.png b/includes/jpgraph/docs/manual.png new file mode 100644 index 0000000..a440215 Binary files /dev/null and b/includes/jpgraph/docs/manual.png differ diff --git a/includes/jpgraph/docs/reference.png b/includes/jpgraph/docs/reference.png new file mode 100644 index 0000000..e23dfc0 Binary files /dev/null and b/includes/jpgraph/docs/reference.png differ diff --git a/includes/jpgraph/src/Examples/accbarex1.php b/includes/jpgraph/src/Examples/accbarex1.php new file mode 100644 index 0000000..0179629 --- /dev/null +++ b/includes/jpgraph/src/Examples/accbarex1.php @@ -0,0 +1,40 @@ +SetScale("textlin"); + +$graph->SetShadow(); +$graph->img->SetMargin(40,30,20,40); + +// Create the bar plots +$b1plot = new BarPlot($data1y); +$b1plot->SetFillColor("orange"); +$b1plot->value->Show(); +$b2plot = new BarPlot($data2y); +$b2plot->SetFillColor("blue"); +$b2plot->value->Show(); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/accbarframeex01.php b/includes/jpgraph/src/Examples/accbarframeex01.php new file mode 100644 index 0000000..8b56876 --- /dev/null +++ b/includes/jpgraph/src/Examples/accbarframeex01.php @@ -0,0 +1,31 @@ +SetScale('textlin'); +$graph->SetMarginColor('white'); + +// Setup title +$graph->title->Set('Acc bar with gradient'); + +// Create the first bar +$bplot = new BarPlot($datay1); +$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT); +$bplot->SetColor('darkred'); + +// Create the second bar +$bplot2 = new BarPlot($datay2); +$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT); +$bplot2->SetColor('darkgreen'); + +// And join them in an accumulated bar +$accbplot = new AccBarPlot(array($bplot,$bplot2)); +$graph->Add($accbplot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/accbarframeex02.php b/includes/jpgraph/src/Examples/accbarframeex02.php new file mode 100644 index 0000000..aa150de --- /dev/null +++ b/includes/jpgraph/src/Examples/accbarframeex02.php @@ -0,0 +1,33 @@ +SetScale('textlin'); +$graph->SetMarginColor('white'); + +// Setup title +$graph->title->Set('Acc bar with gradient'); + +// Create the first bar +$bplot = new BarPlot($datay1); +$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT); +$bplot->SetColor('darkred'); + +// Create the second bar +$bplot2 = new BarPlot($datay2); +$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT); +$bplot2->SetColor('darkgreen'); + +// And join them in an accumulated bar +$accbplot = new AccBarPlot(array($bplot,$bplot2)); +$accbplot->SetColor('red'); +$accbplot->SetWeight(1); +$graph->Add($accbplot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/accbarframeex03.php b/includes/jpgraph/src/Examples/accbarframeex03.php new file mode 100644 index 0000000..37f3157 --- /dev/null +++ b/includes/jpgraph/src/Examples/accbarframeex03.php @@ -0,0 +1,35 @@ +SetScale('textlin'); +$graph->SetMarginColor('white'); + +// Setup title +$graph->title->Set('Acc bar with gradient'); + +// Create the first bar +$bplot = new BarPlot($datay1); +$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT); +$bplot->SetColor('darkred'); +$bplot->SetWeight(0); + +// Create the second bar +$bplot2 = new BarPlot($datay2); +$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT); +$bplot2->SetColor('darkgreen'); +$bplot2->SetWeight(0); + +// And join them in an accumulated bar +$accbplot = new AccBarPlot(array($bplot,$bplot2)); +$accbplot->SetColor('darkgray'); +$accbplot->SetWeight(1); +$graph->Add($accbplot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/alphabarex1.php b/includes/jpgraph/src/Examples/alphabarex1.php new file mode 100644 index 0000000..81c821c --- /dev/null +++ b/includes/jpgraph/src/Examples/alphabarex1.php @@ -0,0 +1,75 @@ +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_ARIAL,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(); +?> + diff --git a/includes/jpgraph/src/Examples/antispamex01.php b/includes/jpgraph/src/Examples/antispamex01.php new file mode 100644 index 0000000..57fe609 --- /dev/null +++ b/includes/jpgraph/src/Examples/antispamex01.php @@ -0,0 +1,18 @@ +Rand(5); + +// Stroke random cahllenge +if( $spam->Stroke() === false ) { + die('Illegal or no data to plot'); +} + +?> + diff --git a/includes/jpgraph/src/Examples/aqua_example.php b/includes/jpgraph/src/Examples/aqua_example.php new file mode 100644 index 0000000..9c5a650 --- /dev/null +++ b/includes/jpgraph/src/Examples/aqua_example.php @@ -0,0 +1,58 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new AquaTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "AquaTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/axislabelbkgex01.php b/includes/jpgraph/src/Examples/axislabelbkgex01.php new file mode 100644 index 0000000..99c098c --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex01.php @@ -0,0 +1,35 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_NONE"'); + +$graph->SetAxisLabelBackground(LABELBKG_NONE,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/axislabelbkgex02.php b/includes/jpgraph/src/Examples/axislabelbkgex02.php new file mode 100644 index 0000000..2b1740f --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex02.php @@ -0,0 +1,37 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_XAXIS"'); + +$graph->SetAxisLabelBackground(LABELBKG_XAXIS,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/axislabelbkgex03.php b/includes/jpgraph/src/Examples/axislabelbkgex03.php new file mode 100644 index 0000000..9e55711 --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex03.php @@ -0,0 +1,37 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_YAXIS"'); + +$graph->SetAxisLabelBackground(LABELBKG_YAXIS,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/axislabelbkgex04.php b/includes/jpgraph/src/Examples/axislabelbkgex04.php new file mode 100644 index 0000000..eb55a5f --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex04.php @@ -0,0 +1,37 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_YAXISFULL"'); + +$graph->SetAxisLabelBackground(LABELBKG_YAXISFULL,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/axislabelbkgex05.php b/includes/jpgraph/src/Examples/axislabelbkgex05.php new file mode 100644 index 0000000..29a04f0 --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex05.php @@ -0,0 +1,37 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_XAXISFULL"'); + +$graph->SetAxisLabelBackground(LABELBKG_XAXISFULL,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/axislabelbkgex06.php b/includes/jpgraph/src/Examples/axislabelbkgex06.php new file mode 100644 index 0000000..8ad0d81 --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex06.php @@ -0,0 +1,37 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_XYFULL"'); + +$graph->SetAxisLabelBackground(LABELBKG_XYFULL,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/axislabelbkgex07.php b/includes/jpgraph/src/Examples/axislabelbkgex07.php new file mode 100644 index 0000000..c23d07f --- /dev/null +++ b/includes/jpgraph/src/Examples/axislabelbkgex07.php @@ -0,0 +1,37 @@ +SetScale('intlin'); +$graph->SetMargin(30,15,40,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(true,'blue',3); + +$graph->title->Set('Label background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->subtitle->SetColor('darkred'); +$graph->subtitle->Set('"LABELBKG_XY"'); + +$graph->SetAxisLabelBackground(LABELBKG_XY,'orange','red','lightblue','red'); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($ydata); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/background_type_ex0.php b/includes/jpgraph/src/Examples/background_type_ex0.php new file mode 100644 index 0000000..1c4e745 --- /dev/null +++ b/includes/jpgraph/src/Examples/background_type_ex0.php @@ -0,0 +1,38 @@ +SetScale("textlin"); +$graph->SetMargin(40,40,50,50); + +// Setup the grid and plotarea box +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->setColor('darkgray'); +$graph->SetBox(true); + +// Steup graph titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Using background image'); +$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); +$graph->subtitle->Set('"BGIMG_COPY"'); +$graph->subtitle->SetColor('darkred'); + +// Add background with 25% mix +$graph->SetBackgroundImage('heat1.jpg',BGIMG_COPY); +$graph->SetBackgroundImageMix(25); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/background_type_ex1.php b/includes/jpgraph/src/Examples/background_type_ex1.php new file mode 100644 index 0000000..cdd3cce --- /dev/null +++ b/includes/jpgraph/src/Examples/background_type_ex1.php @@ -0,0 +1,38 @@ +SetScale("textlin"); +$graph->SetMargin(40,40,50,50); + +// Setup the grid and plotarea box +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->setColor('darkgray'); +$graph->SetBox(true); + +// Steup graph titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Using background image'); +$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); +$graph->subtitle->Set('"BGIMG_CENTER"'); +$graph->subtitle->SetColor('darkred'); + +// Add background with 25% mix +$graph->SetBackgroundImage('heat1.jpg',BGIMG_CENTER); +$graph->SetBackgroundImageMix(25); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/background_type_ex2.php b/includes/jpgraph/src/Examples/background_type_ex2.php new file mode 100644 index 0000000..932f7a5 --- /dev/null +++ b/includes/jpgraph/src/Examples/background_type_ex2.php @@ -0,0 +1,38 @@ +SetScale("textlin"); +$graph->SetMargin(40,40,50,50); + +// Setup the grid and plotarea box +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->setColor('darkgray'); +$graph->SetBox(true); + +// Steup graph titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Using background image'); +$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); +$graph->subtitle->Set('"BGIMG_FREE"'); +$graph->subtitle->SetColor('darkred'); + +// Add background with 25% mix +$graph->SetBackgroundImage('heat1.jpg',BGIMG_FREE); +$graph->SetBackgroundImageMix(25); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/background_type_ex3.php b/includes/jpgraph/src/Examples/background_type_ex3.php new file mode 100644 index 0000000..8b265c8 --- /dev/null +++ b/includes/jpgraph/src/Examples/background_type_ex3.php @@ -0,0 +1,38 @@ +SetScale("textlin"); +$graph->SetMargin(40,40,50,50); + +// Setup the grid and plotarea box +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->setColor('darkgray'); +$graph->SetBox(true); + +// Steup graph titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Using background image'); +$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); +$graph->subtitle->Set('"BGIMG_FILLPLOT"'); +$graph->subtitle->SetColor('darkred'); + +// Add background with 25% mix +$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLPLOT); +$graph->SetBackgroundImageMix(25); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/background_type_ex4.php b/includes/jpgraph/src/Examples/background_type_ex4.php new file mode 100644 index 0000000..3ff1ceb --- /dev/null +++ b/includes/jpgraph/src/Examples/background_type_ex4.php @@ -0,0 +1,38 @@ +SetScale("textlin"); +$graph->SetMargin(40,40,50,50); + +// Setup the grid and plotarea box +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->setColor('darkgray'); +$graph->SetBox(true); + +// Steup graph titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Using background image'); +$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11); +$graph->subtitle->Set('"BGIMG_FILLFRAME"'); +$graph->subtitle->SetColor('darkred'); + +// Add background with 25% mix +$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLFRAME); +$graph->SetBackgroundImageMix(25); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/backgroundex01.php b/includes/jpgraph/src/Examples/backgroundex01.php new file mode 100644 index 0000000..fac8e93 --- /dev/null +++ b/includes/jpgraph/src/Examples/backgroundex01.php @@ -0,0 +1,51 @@ +img->SetMargin(40,180,40,40); +$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLPLOT); + +$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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/backgroundex02.php b/includes/jpgraph/src/Examples/backgroundex02.php new file mode 100644 index 0000000..542be5d --- /dev/null +++ b/includes/jpgraph/src/Examples/backgroundex02.php @@ -0,0 +1,51 @@ +img->SetMargin(40,180,40,40); +$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); + +$graph->img->SetAntiAliasing(); +$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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/backgroundex03.php b/includes/jpgraph/src/Examples/backgroundex03.php new file mode 100644 index 0000000..a1c1337 --- /dev/null +++ b/includes/jpgraph/src/Examples/backgroundex03.php @@ -0,0 +1,51 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/balloonex1.php b/includes/jpgraph/src/Examples/balloonex1.php new file mode 100644 index 0000000..c963d76 --- /dev/null +++ b/includes/jpgraph/src/Examples/balloonex1.php @@ -0,0 +1,56 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/balloonex2.php b/includes/jpgraph/src/Examples/balloonex2.php new file mode 100644 index 0000000..257a664 --- /dev/null +++ b/includes/jpgraph/src/Examples/balloonex2.php @@ -0,0 +1,81 @@ +SetScale("intlin"); +$graph->SetMargin(40,40,40,40); +$graph->SetMarginColor('wheat'); + +$graph->title->Set("Example of ballon scatter plot with X,Y callback"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->SetMargin(10); + +// Use a lot of grace to get large scales since the ballon have +// size and we don't want them to collide with the X-axis +$graph->yaxis->scale->SetGrace(50,10); +$graph->xaxis->scale->SetGrace(50,10); + +// Make sure X-axis as at the bottom of the graph and not at the default Y=0 +$graph->xaxis->SetPos('min'); + +// Set X-scale to start at 0 +$graph->xscale->SetAutoMin(0); + +// 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->SetCallbackYX("FCallback"); + +// Add the scatter plot to the graph +$graph->Add($sp1); + +// ... and send to browser +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bar2scalesex1.php b/includes/jpgraph/src/Examples/bar2scalesex1.php new file mode 100644 index 0000000..9248e7c --- /dev/null +++ b/includes/jpgraph/src/Examples/bar2scalesex1.php @@ -0,0 +1,48 @@ +title->Set('Example with 2 scale bars'); + +// Setup Y and Y2 scales with some "grace" +$graph->SetScale("textlin"); +$graph->SetY2Scale("lin"); +$graph->yaxis->scale->SetGrace(30); +$graph->y2axis->scale->SetGrace(30); + +//$graph->ygrid->Show(true,true); +$graph->ygrid->SetColor('gray','lightgray@0.5'); + +// Setup graph colors +$graph->SetMarginColor('white'); +$graph->y2axis->SetColor('darkred'); + + +// Create the "dummy" 0 bplot +$bplotzero = new BarPlot($datazero); + +// Create the "Y" axis group +$ybplot1 = new BarPlot($datay); +$ybplot1->value->Show(); +$ybplot = new GroupBarPlot(array($ybplot1,$bplotzero)); + +// Create the "Y2" axis group +$ybplot2 = new BarPlot($datay2); +$ybplot2->value->Show(); +$ybplot2->value->SetColor('darkred'); +$ybplot2->SetFillColor('darkred'); +$y2bplot = new GroupBarPlot(array($bplotzero,$ybplot2)); + +// Add the grouped bar plots to the graph +$graph->Add($ybplot); +$graph->AddY2($y2bplot); + +// .. and finally stroke the image back to browser +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/bar_csimex1.php b/includes/jpgraph/src/Examples/bar_csimex1.php new file mode 100644 index 0000000..6ae7dbf --- /dev/null +++ b/includes/jpgraph/src/Examples/bar_csimex1.php @@ -0,0 +1,52 @@ +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(); + + +?> diff --git a/includes/jpgraph/src/Examples/bar_csimex2.php b/includes/jpgraph/src/Examples/bar_csimex2.php new file mode 100644 index 0000000..5a0cbce --- /dev/null +++ b/includes/jpgraph/src/Examples/bar_csimex2.php @@ -0,0 +1,51 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/bar_csimex3.php b/includes/jpgraph/src/Examples/bar_csimex3.php new file mode 100644 index 0000000..6640319 --- /dev/null +++ b/includes/jpgraph/src/Examples/bar_csimex3.php @@ -0,0 +1,88 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/barcode_errhandling_ex0.php b/includes/jpgraph/src/Examples/barcode_errhandling_ex0.php new file mode 100644 index 0000000..4f5b539 --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_errhandling_ex0.php @@ -0,0 +1,16 @@ +Stroke('abc123'); +} catch( JpGraphException $e ) { + //echo 'Error: ' . $e->getMessage()."\n"; + JpGraphError::Raise($e->getMessage()); +} + +?> diff --git a/includes/jpgraph/src/Examples/barcode_ex0.php b/includes/jpgraph/src/Examples/barcode_ex0.php new file mode 100644 index 0000000..021b5c7 --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_ex0.php @@ -0,0 +1,11 @@ +Stroke('ABC123'); + +?> diff --git a/includes/jpgraph/src/Examples/barcode_ex1.php b/includes/jpgraph/src/Examples/barcode_ex1.php new file mode 100644 index 0000000..df7653b --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_ex1.php @@ -0,0 +1,14 @@ +SetModuleWidth(2); +$e->SetHeight(20); +echo nl2br($e->Stroke('3125134772')); + + +?> diff --git a/includes/jpgraph/src/Examples/barcode_ex2.php b/includes/jpgraph/src/Examples/barcode_ex2.php new file mode 100644 index 0000000..8fce58e --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_ex2.php @@ -0,0 +1,14 @@ +SetModuleWidth(2); +$e->SetHeight(70); +$ps = $e->Stroke('3125134772'); +echo nl2br(htmlspecialchars($ps)); + +?> diff --git a/includes/jpgraph/src/Examples/barcode_ex3.php b/includes/jpgraph/src/Examples/barcode_ex3.php new file mode 100644 index 0000000..a63f4ad --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_ex3.php @@ -0,0 +1,17 @@ +"; +$encoder = BarcodeFactory::Create(ENCODING_CODEI25); +$e = BackendFactory::Create(BACKEND_PS,$encoder); +$e->SetModuleWidth(2); +$e->SetHeight(70); +$e->SetEPS(); +$ps = $e->Stroke('3125134772'); +echo nl2br(htmlspecialchars($ps)); + + +?> diff --git a/includes/jpgraph/src/Examples/barcode_ex4.php b/includes/jpgraph/src/Examples/barcode_ex4.php new file mode 100644 index 0000000..721b56b --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_ex4.php @@ -0,0 +1,12 @@ +SetModuleWidth(2); +$e->Stroke('1234'); + +?> diff --git a/includes/jpgraph/src/Examples/barcode_usps_example.php b/includes/jpgraph/src/Examples/barcode_usps_example.php new file mode 100644 index 0000000..80469be --- /dev/null +++ b/includes/jpgraph/src/Examples/barcode_usps_example.php @@ -0,0 +1,74 @@ +_USPS_chkd(substr($data,8)); + $data = '420'. $aZIP . '~191' . $aServiceType . $aDUNS . $aSeqNbr; + return $data . $cd; + } + + // Get type 2 of confirmation code (without ZIP) + function GetPIC($aServiceType,$aDUNS,$aSeqNbr) { + // Convert to USPS format with AI=91 + $data = '91' . $aServiceType . $aDUNS . $aSeqNbr; + $cd = $this->_USPS_chkd($data); + return $data . $cd; + } + +} + +$usps = new USPS_Confirmation(); +$zip = '92663'; +$service = '21'; +$DUNS = '805213907'; +$seqnr = '04508735'; +$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr); +//$data = $usps->GetPIC('01','123456789','00000001'); + +$encoder = BarcodeFactory::Create(ENCODING_EAN128); +$e = BackendFactory::Create(BACKEND_IMAGE,$encoder); +$e->SetModuleWidth(2); +$e->SetFont(FF_ARIAL,FS_NORMAL,14); +$e->Stroke($data); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/barcsim_details.php b/includes/jpgraph/src/Examples/barcsim_details.php new file mode 100644 index 0000000..68fb216 --- /dev/null +++ b/includes/jpgraph/src/Examples/barcsim_details.php @@ -0,0 +1,10 @@ +'.basename(__FILE__).'.'; +} +else { + echo 'Some details on bar with id='.$_GET['id']; +} + +?> diff --git a/includes/jpgraph/src/Examples/barcsim_popup.php b/includes/jpgraph/src/Examples/barcsim_popup.php new file mode 100644 index 0000000..5786458 --- /dev/null +++ b/includes/jpgraph/src/Examples/barcsim_popup.php @@ -0,0 +1,41 @@ +SetScale("textlin"); + +// Create a bar pot +$bplot = new BarPlot($datay); + +// Create targets for the image maps so that the details are opened in a separate window +$fmtStr = "javascript:window.open('barcsim_details.php?id=%d','_new','width=500,height=300');void(0)"; +$n = count($datay); +$targ=array(); +$alts=array(); +for($i=0; $i < $n; ++$i) { + $targ[$i] = sprintf($fmtStr,$i+1); + $alts[$i] = 'val=%d'; + // Note: The format placeholder val=%d will be replaced by the actual value in the ouput HTML by the + // library so that when the user hoovers the mouse over the bar the actual numerical value of the bar + // will be dísplayed +} +$bplot->SetCSIMTargets($targ,$alts); + +// Add plot to graph +$graph->Add($bplot); + +// Setup the title, also wih a CSIM area +$graph->title->Set("CSIM with popup windows"); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +// Assume we can give more details on the graph +$graph->title->SetCSIMTarget(sprintf($fmtStr,-1),'Title for Bar'); + +// Send back the HTML page which will call this script again to retrieve the image. +$graph->StrokeCSIM(); + +?> diff --git a/includes/jpgraph/src/Examples/barformatcallbackex1.php b/includes/jpgraph/src/Examples/barformatcallbackex1.php new file mode 100644 index 0000000..f49a9e2 --- /dev/null +++ b/includes/jpgraph/src/Examples/barformatcallbackex1.php @@ -0,0 +1,30 @@ +SetScale("textlin"); + +// Create a bar plots +$bar1 = new BarPlot($data); + +// Setup the callback function +$bar1->value->SetFormatCallback("cbFmtPercentage"); +$bar1->value->Show(); + +// Add the plot to the graph +$graph->Add($bar1); + +// .. and send the graph back to the browser +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/bargradex1.php b/includes/jpgraph/src/Examples/bargradex1.php new file mode 100644 index 0000000..e325223 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradex1.php @@ -0,0 +1,47 @@ +img->SetMargin(60,20,35,75); +$graph->SetScale("textlin"); +$graph->SetMarginColor("lightblue:1.1"); +$graph->SetShadow(); + +// Set up the title for the graph +$graph->title->Set("Bar gradient with left reflection"); +$graph->title->SetMargin(8); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor("darkred"); + +// Setup font for axis +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); +$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); + +// Show 0 label on Y-axis (default is not to show) +$graph->yscale->ticks->SupressZeroLabel(false); + +// Setup X-axis labels +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetLabelAngle(50); + +// Create the bar pot +$bplot = new BarPlot($datay); +$bplot->SetWidth(0.6); + +// Setup color for gradient fill style +$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION); + +// Set color for the frame of each bar +$bplot->SetColor("white"); +$graph->Add($bplot); + +// Finally send the graph to the browser +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/bargradex2.php b/includes/jpgraph/src/Examples/bargradex2.php new file mode 100644 index 0000000..02da925 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradex2.php @@ -0,0 +1,48 @@ +img->SetMargin(60,20,30,50); +$graph->SetScale("textlin"); +$graph->SetMarginColor("silver"); +$graph->SetShadow(); + +// Set up the title for the graph +$graph->title->Set("Example negative bars"); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,18); +$graph->title->SetColor("darkred"); + +// Setup font for axis +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12); +$graph->xaxis->SetColor("black","red"); +$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,11); + +// Show 0 label on Y-axis (default is not to show) +$graph->yscale->ticks->SupressZeroLabel(false); + +// Setup X-axis labels +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetLabelAngle(50); + +// Create the bar pot +$bplot = new BarPlot($datay); +$bplot->SetWidth(0.6); + +// Setup color for gradient fill style +$bplot->SetFillGradient("navy","steelblue",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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradex3.php b/includes/jpgraph/src/Examples/bargradex3.php new file mode 100644 index 0000000..8a3f99d --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradex3.php @@ -0,0 +1,50 @@ +img->SetMargin(60,20,30,50); +$graph->SetScale("textlin"); +$graph->SetMarginColor("silver"); +$graph->SetShadow(); + +// Set up the title for the graph +$graph->title->Set("Example negative bars"); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16); +$graph->title->SetColor("darkred"); + +// Setup font for axis +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); +$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); + +// Show 0 label on Y-axis (default is not to show) +$graph->yscale->ticks->SupressZeroLabel(false); + +// Setup X-axis labels +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetLabelAngle(50); + +// 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 + +// Create the bar pot +$bplot = new BarPlot($datay); +$bplot->SetWidth(0.6); + +// Setup color for gradient fill style +$bplot->SetFillGradient("navy","steelblue",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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradex4.php b/includes/jpgraph/src/Examples/bargradex4.php new file mode 100644 index 0000000..7de203a --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradex4.php @@ -0,0 +1,47 @@ +img->SetMargin(60,30,30,40); +$graph->SetScale("textlin"); +$graph->SetMarginColor("teal"); +$graph->SetShadow(); + +// Set up the title for the graph +$graph->title->Set("Bargraph with small variations"); +$graph->title->SetColor("white"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +// Setup color for axis and labels +$graph->xaxis->SetColor("black","white"); +$graph->yaxis->SetColor("black","white"); + +// Setup font for axis +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); +$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); + +// Setup X-axis title (color & font) +$graph->xaxis->title->Set("X-axis"); +$graph->xaxis->title->SetColor("white"); +$graph->xaxis->title->SetFont(FF_VERDANA,FS_BOLD,10); + +// Create the bar pot +$bplot = new BarPlot($datay); +$bplot->SetWidth(0.6); + +// Setup color for gradient fill style +$tcol=array(100,100,255); +$fcol=array(255,100,100); +$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR); +$graph->Add($bplot); + +// Finally send the graph to the browser +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/bargradex5.php b/includes/jpgraph/src/Examples/bargradex5.php new file mode 100644 index 0000000..e012292 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradex5.php @@ -0,0 +1,52 @@ +img->SetMargin(60,30,30,40); +$graph->SetScale("textlin"); +$graph->SetMarginColor("teal"); +$graph->SetShadow(); + +// Create the bar pot +$bplot = new BarPlot($datay); +$bplot->SetWidth(0.6); + +// This is how you make the bar graph start from something other than 0 +$bplot->SetYMin(0.302); + +// Setup color for gradient fill style +$tcol=array(100,100,255); +$fcol=array(255,100,100); +$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR); +$bplot->SetFillColor("orange"); +$graph->Add($bplot); + +// Set up the title for the graph +$graph->title->Set("Bargraph which doesn't start from y=0"); +$graph->title->SetColor("yellow"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +// Setup color for axis and labels +$graph->xaxis->SetColor("black","white"); +$graph->yaxis->SetColor("black","white"); + +// Setup font for axis +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); +$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); + +// Setup X-axis title (color & font) +$graph->xaxis->title->Set("X-axis"); +$graph->xaxis->title->SetColor("white"); +$graph->xaxis->title->SetFont(FF_VERDANA,FS_BOLD,10); + +// Finally send the graph to the browser +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/bargradex6.php b/includes/jpgraph/src/Examples/bargradex6.php new file mode 100644 index 0000000..43bf966 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradex6.php @@ -0,0 +1,51 @@ +img->SetMargin(60,150,30,50); +$graph->SetScale("textlin"); +$graph->SetMarginColor("silver"); +$graph->SetShadow(); + +// Set up the title for the graph +$graph->title->Set("Example negative bars"); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16); +$graph->title->SetColor("darkred"); + +// Setup font for axis +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); +$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10); + +// Show 0 label on Y-axis (default is not to show) +$graph->yscale->ticks->SupressZeroLabel(false); + +// Setup X-axis labels +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetLabelAngle(50); + +// 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 + +// Create the bar pot +$bplot = new BarPlot($datay); +$bplot->SetWidth(0.6); +$bplot->SetLegend("Result 1999","blue"); + +// Setup color for gradient fill style +$bplot->SetFillGradient("navy","steelblue",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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex1.php b/includes/jpgraph/src/Examples/bargradsmallex1.php new file mode 100644 index 0000000..83908a9 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex1.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex2.php b/includes/jpgraph/src/Examples/bargradsmallex2.php new file mode 100644 index 0000000..1aa1037 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex2.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex3.php b/includes/jpgraph/src/Examples/bargradsmallex3.php new file mode 100644 index 0000000..c5d31c1 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex3.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex4.php b/includes/jpgraph/src/Examples/bargradsmallex4.php new file mode 100644 index 0000000..030942d --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex4.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex5.php b/includes/jpgraph/src/Examples/bargradsmallex5.php new file mode 100644 index 0000000..8028269 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex5.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex6.php b/includes/jpgraph/src/Examples/bargradsmallex6.php new file mode 100644 index 0000000..9b1e45b --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex6.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex7.php b/includes/jpgraph/src/Examples/bargradsmallex7.php new file mode 100644 index 0000000..5f011aa --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex7.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/bargradsmallex8.php b/includes/jpgraph/src/Examples/bargradsmallex8.php new file mode 100644 index 0000000..f95cb49 --- /dev/null +++ b/includes/jpgraph/src/Examples/bargradsmallex8.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/barimgex1.php b/includes/jpgraph/src/Examples/barimgex1.php new file mode 100644 index 0000000..76aee8f --- /dev/null +++ b/includes/jpgraph/src/Examples/barimgex1.php @@ -0,0 +1,29 @@ +SetScale("textlin"); + +$graph->title->Set('Images on top of bars'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,13); + +$graph->SetTitleBackground('lightblue:1.1',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL); + +$bplot = new BarPlot($datay); +$bplot->SetFillColor("orange"); +$bplot->SetWidth(0.5); + +$lplot = new LinePlot($datay); +$lplot->SetColor('white@1'); +$lplot->SetBarCenter(); +$lplot->mark->SetType(MARK_IMG_LBALL,'red'); + +$graph->Add($bplot); +$graph->Add($lplot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/barintex1.php b/includes/jpgraph/src/Examples/barintex1.php new file mode 100644 index 0000000..9ba063d --- /dev/null +++ b/includes/jpgraph/src/Examples/barintex1.php @@ -0,0 +1,48 @@ +img->SetMargin(40,30,30,40); +$graph->SetScale("textint"); +$graph->SetShadow(); +$graph->SetFrame(false); // No border around the graph + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +$graph->yaxis->scale->SetGrace(100); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT2); + +// Setup graph title ands fonts +$graph->title->Set("Example of integer Y-scale"); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->title->Set("Year 2002"); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor("orange"); +$bplot->SetWidth(0.5); +$bplot->SetShadow(); + +// Setup the values that are displayed on top of each bar +$bplot->value->Show(); +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->SetFont(FF_ARIAL,FS_BOLD); +$bplot->value->SetAngle(45); +// Black color for positive values and darkred for negative values +$bplot->value->SetColor("black","darkred"); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/barintex2.php b/includes/jpgraph/src/Examples/barintex2.php new file mode 100644 index 0000000..59f3b73 --- /dev/null +++ b/includes/jpgraph/src/Examples/barintex2.php @@ -0,0 +1,57 @@ +img->SetMargin(40,30,40,40); +$graph->SetScale("textint"); +$graph->SetFrame(true,'blue',1); +$graph->SetColor('lightblue'); +$graph->SetMarginColor('lightblue'); + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +//$graph->yaxis->scale->SetGrace(20); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT1); +$graph->xaxis->SetColor('darkblue','black'); + +// Stup "hidden" y-axis by given it the same color +// as the background +$graph->yaxis->SetColor('lightblue','darkblue'); +$graph->ygrid->SetColor('white'); + +// Setup graph title ands fonts +$graph->title->Set('Example of integer Y-scale'); +$graph->subtitle->Set('(With "hidden" y-axis)'); + +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->title->Set("Year 2002"); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('darkblue'); +$bplot->SetColor('darkblue'); +$bplot->SetWidth(0.5); +$bplot->SetShadow('darkgray'); + +// Setup the values that are displayed on top of each bar +$bplot->value->Show(); +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); +$bplot->value->SetFormat('$%d'); +// Black color for positive values and darkred for negative values +$bplot->value->SetColor("black","darkred"); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/barline_csimex1.php b/includes/jpgraph/src/Examples/barline_csimex1.php new file mode 100644 index 0000000..1ab37ec --- /dev/null +++ b/includes/jpgraph/src/Examples/barline_csimex1.php @@ -0,0 +1,42 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/barlinealphaex1.php b/includes/jpgraph/src/Examples/barlinealphaex1.php new file mode 100644 index 0000000..95c8b98 --- /dev/null +++ b/includes/jpgraph/src/Examples/barlinealphaex1.php @@ -0,0 +1,74 @@ +GetShortMonth(); + +// Create the graph. +$graph = new Graph(300,200); +$graph->SetScale("textlin"); +$graph->SetMarginColor('white'); + +// Adjust the margin slightly so that we use the +// entire area (since we don't use a frame) +$graph->SetMargin(30,1,20,5); + +// Box around plotarea +$graph->SetBox(); + +// No frame around the image +$graph->SetFrame(false); + +// Setup the tab title +$graph->tabtitle->Set('Year 2003'); +$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10); + +// Setup the X and Y grid +$graph->ygrid->SetFill(true,'#DDDDDD@0.5','#BBBBBB@0.5'); +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->SetColor('gray'); +$graph->xgrid->Show(); +$graph->xgrid->SetLineStyle('dashed'); +$graph->xgrid->SetColor('gray'); + +// Setup month as labels on the X-axis +$graph->xaxis->SetTickLabels($months); +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); +$graph->xaxis->SetLabelAngle(45); + +// Create a bar pot +$bplot = new BarPlot($ydata); +$bplot->SetWidth(0.6); +$fcol='#440000'; +$tcol='#FF9090'; + +$bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION); + +// Set line weigth to 0 so that there are no border +// around each bar +$bplot->SetWeight(0); + +$graph->Add($bplot); + +// Create filled line plot +$lplot = new LinePlot($ydata2); +$lplot->SetFillColor('skyblue@0.5'); +$lplot->SetColor('navy@0.7'); +$lplot->SetBarCenter(); + +$lplot->mark->SetType(MARK_SQUARE); +$lplot->mark->SetColor('blue@0.5'); +$lplot->mark->SetFillColor('lightblue'); +$lplot->mark->SetSize(6); + +$graph->Add($lplot); + +// .. and finally send it back to the browser +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/barlinefreq_csimex1.php b/includes/jpgraph/src/Examples/barlinefreq_csimex1.php new file mode 100644 index 0000000..00c5977 --- /dev/null +++ b/includes/jpgraph/src/Examples/barlinefreq_csimex1.php @@ -0,0 +1,100 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/barlinefreqex1.php b/includes/jpgraph/src/Examples/barlinefreqex1.php new file mode 100644 index 0000000..c5966bb --- /dev/null +++ b/includes/jpgraph/src/Examples/barlinefreqex1.php @@ -0,0 +1,83 @@ +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 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'); +$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->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/barpatternex1.php b/includes/jpgraph/src/Examples/barpatternex1.php new file mode 100644 index 0000000..f0be38e --- /dev/null +++ b/includes/jpgraph/src/Examples/barpatternex1.php @@ -0,0 +1,33 @@ +SetScale("textlin"); + +$graph->SetMarginColor('navy:1.9'); +$graph->SetBox(); + +$graph->title->Set('Bar Pattern'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,20); + +$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL); +$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue'); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('darkorange'); +$bplot->SetWidth(0.6); + +$bplot->SetPattern(PATTERN_CROSS1,'navy'); + +$graph->Add($bplot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/barscalecallbackex1.php b/includes/jpgraph/src/Examples/barscalecallbackex1.php new file mode 100644 index 0000000..7e73f20 --- /dev/null +++ b/includes/jpgraph/src/Examples/barscalecallbackex1.php @@ -0,0 +1,63 @@ +img->SetMargin(80,30,30,40); +$graph->SetScale('textint'); +$graph->SetShadow(); +$graph->SetFrame(false); // No border around the graph + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +// The grace value is the percetage of additional scale +// value we add. Specifying 50 means that we add 50% of the +// max value +$graph->yaxis->scale->SetGrace(50); +$graph->yaxis->SetLabelFormatCallback('separator1000'); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT2); + +// Setup graph title ands fonts +$graph->title->Set('Example of Y-scale callback formatting'); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->title->Set('Year 2002'); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('orange'); +$bplot->SetWidth(0.5); +$bplot->SetShadow(); + +// Setup the values that are displayed on top of each bar +$bplot->value->Show(); + +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->SetFont(FF_ARIAL,FS_BOLD); +$bplot->value->SetAngle(45); +$bplot->value->SetFormatCallback('separator1000_usd'); + +// Black color for positive values and darkred for negative values +$bplot->value->SetColor('black','darkred'); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/bartutex1.php b/includes/jpgraph/src/Examples/bartutex1.php new file mode 100644 index 0000000..0c0f9c5 --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex1.php @@ -0,0 +1,35 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bartutex12.php b/includes/jpgraph/src/Examples/bartutex12.php new file mode 100644 index 0000000..6f97c5c --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex12.php @@ -0,0 +1,90 @@ +SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); +$graph->SetShadow(); + +// Use text X-scale so we can text labels on the X-axis +$graph->SetScale("textlin"); + +// Y2-axis is linear +$graph->SetY2Scale("lin"); + +// Color the two Y-axis to make them easier to associate +// to the corresponding plot (we keep the axis black though) +$graph->yaxis->SetColor("black","red"); +$graph->y2axis->SetColor("black","orange"); + +// Set title and subtitle +$graph->title->Set("Combined bar and line plot"); +$graph->subtitle->Set("100 data points, X-Scale: 'text'"); + +// Use built in font (don't need TTF support) +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Make the margin around the plot a little bit bigger then default +$graph->img->SetMargin(40,140,40,80); + +// Slightly adjust the legend from it's default position in the +// top right corner to middle right side +$graph->legend->Pos(0.03,0.5,"right","center"); + +// Display every 6:th tickmark +$graph->xaxis->SetTextTickInterval(6); + +// Label every 2:nd tick mark +$graph->xaxis->SetTextLabelInterval(2); + +// Setup the labels +$graph->xaxis->SetTickLabels($databarx); +$graph->xaxis->SetLabelAngle(90); + +// Create a red line plot +$p1 = new LinePlot($datay); +$p1->SetColor("red"); +$p1->SetLegend("Pressure"); + +// Create the bar plot +$b1 = new BarPlot($databary); +$b1->SetLegend("Temperature"); +$b1->SetFillColor("orange"); +$b1->SetAbsWidth(8); + +// Drop shadow on bars adjust the default values a little bit +$b1->SetShadow("steelblue",2,2); + +// The order the plots are added determines who's ontop +$graph->Add($p1); +$graph->AddY2($b1); + +// Finally output the image +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bartutex2.php b/includes/jpgraph/src/Examples/bartutex2.php new file mode 100644 index 0000000..a911c33 --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex2.php @@ -0,0 +1,40 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bartutex3.php b/includes/jpgraph/src/Examples/bartutex3.php new file mode 100644 index 0000000..addb91c --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex3.php @@ -0,0 +1,44 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bartutex4.php b/includes/jpgraph/src/Examples/bartutex4.php new file mode 100644 index 0000000..dffe16a --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex4.php @@ -0,0 +1,47 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bartutex5.php b/includes/jpgraph/src/Examples/bartutex5.php new file mode 100644 index 0000000..e41a47b --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex5.php @@ -0,0 +1,45 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/bartutex6.php b/includes/jpgraph/src/Examples/bartutex6.php new file mode 100644 index 0000000..13b0557 --- /dev/null +++ b/includes/jpgraph/src/Examples/bartutex6.php @@ -0,0 +1,47 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/basic_contourex01.php b/includes/jpgraph/src/Examples/basic_contourex01.php new file mode 100644 index 0000000..75d765a --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex01.php @@ -0,0 +1,40 @@ +SetScale('intint'); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/basic_contourex02.php b/includes/jpgraph/src/Examples/basic_contourex02.php new file mode 100644 index 0000000..f63a650 --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex02.php @@ -0,0 +1,43 @@ +SetScale('intint'); + +// Show axis on all sides +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot with multiple axis'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/basic_contourex03-1.php b/includes/jpgraph/src/Examples/basic_contourex03-1.php new file mode 100644 index 0000000..26a01de --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex03-1.php @@ -0,0 +1,40 @@ +SetScale('intint'); + +// Show axis on all sides +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot with multiple axis'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data,10,1); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/basic_contourex03-2.php b/includes/jpgraph/src/Examples/basic_contourex03-2.php new file mode 100644 index 0000000..02b9376 --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex03-2.php @@ -0,0 +1,40 @@ +SetScale('intint'); + +// Show axis on all sides +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot with multiple axis'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data,10,2); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/basic_contourex03-3.php b/includes/jpgraph/src/Examples/basic_contourex03-3.php new file mode 100644 index 0000000..1de30b7 --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex03-3.php @@ -0,0 +1,40 @@ +SetScale('intint'); + +// Show axis on all sides +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot with multiple axis'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data,10,3); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/basic_contourex04.php b/includes/jpgraph/src/Examples/basic_contourex04.php new file mode 100644 index 0000000..c32e838 --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex04.php @@ -0,0 +1,43 @@ +SetScale('intint'); + +// Show axis on all sides +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot with multiple axis'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data,5); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/basic_contourex05.php b/includes/jpgraph/src/Examples/basic_contourex05.php new file mode 100644 index 0000000..61936fc --- /dev/null +++ b/includes/jpgraph/src/Examples/basic_contourex05.php @@ -0,0 +1,46 @@ +SetScale('intint'); + +// Show axis on all sides +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +// Adjust the margins to fit the margin +$graph->SetMargin(30,100,40,30); + +// Setup +$graph->title->Set('Basic contour plot with multiple axis'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data); + +// Flip the data around its center line +$cp->SetInvert(); + +// Display the legend +$cp->ShowLegend(); + +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/bezierex1.php b/includes/jpgraph/src/Examples/bezierex1.php new file mode 100644 index 0000000..50fad51 --- /dev/null +++ b/includes/jpgraph/src/Examples/bezierex1.php @@ -0,0 +1,54 @@ +Get(50); + +// Create the graph +$g = new Graph(300,200); +$g->SetMargin(30,20,40,30); +$g->title->Set("Bezier interpolation"); +$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. +$bplot = new ScatterPlot($ydata,$xdata); +$bplot->mark->SetFillColor('red@0.3'); +$bplot->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($bplot); +$g->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/bkgimgflagex1.php b/includes/jpgraph/src/Examples/bkgimgflagex1.php new file mode 100644 index 0000000..1e47938 --- /dev/null +++ b/includes/jpgraph/src/Examples/bkgimgflagex1.php @@ -0,0 +1,79 @@ +SetScale('textlin'); +$graph->SetMargin(40,20,20,40); +$graph->SetMarginColor('white:0.9'); +$graph->SetColor('white'); +$graph->SetShadow(); + +// Adjust the position of the legend box +$graph->legend->Pos(0.03,0.10); + +// Adjust the color for theshadow of the legend +$graph->legend->SetShadow('darkgray@0.5'); +$graph->legend->SetFillColor('lightblue@0.1'); +$graph->legend->Hide(); + +// Get localised version of the month names +$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); +$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); + +// 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('navy'); + +$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->SetColor('navy'); + +//$graph->ygrid->Show(false); +$graph->ygrid->SetColor('white@0.5'); + +// Setup graph title +$graph->title->Set('Using a country flag background'); + +// Some extra margin (from the top) +$graph->title->SetMargin(3); +$graph->title->SetFont(FF_ARIAL,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('yellow@0.4'); +$bplot2->SetFillColor('red@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(); +?> + diff --git a/includes/jpgraph/src/Examples/bkgimgflagex2.php b/includes/jpgraph/src/Examples/bkgimgflagex2.php new file mode 100644 index 0000000..c6a27b3 --- /dev/null +++ b/includes/jpgraph/src/Examples/bkgimgflagex2.php @@ -0,0 +1,83 @@ +SetScale("textlin"); +$graph->SetMargin(40,20,20,40); +$graph->SetMarginColor('white:0.9'); +$graph->SetColor('white'); +$graph->SetShadow(); + +// Apply a perspective transformation at the end +$graph->Set3DPerspective(SKEW3D_UP,100,180); + +// Adjust the position of the legend box +$graph->legend->Pos(0.03,0.10); + +// Adjust the color for theshadow of the legend +$graph->legend->SetShadow('darkgray@0.5'); +$graph->legend->SetFillColor('lightblue@0.1'); +$graph->legend->Hide(); + +// Get localised version of the month names +$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); + +$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); + +// 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('navy'); + +$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->SetColor('navy'); + +//$graph->ygrid->Show(false); +$graph->ygrid->SetColor('white@0.5'); + +// Setup graph title +$graph->title->Set('Using a country flag background'); + +// Some extra margin (from the top) +$graph->title->SetMargin(3); +$graph->title->SetFont(FF_ARIAL,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('yellow@0.4'); +$bplot2->SetFillColor('red@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(); +?> + diff --git a/includes/jpgraph/src/Examples/bkgimgflagex3.php b/includes/jpgraph/src/Examples/bkgimgflagex3.php new file mode 100644 index 0000000..be9afb7 --- /dev/null +++ b/includes/jpgraph/src/Examples/bkgimgflagex3.php @@ -0,0 +1,83 @@ +SetScale("textlin"); +$graph->SetMargin(40,20,20,40); +$graph->SetMarginColor('white:0.9'); +$graph->SetColor('white'); +$graph->SetShadow(); + +// Apply a perspective transformation at the end +$graph->Set3DPerspective(SKEW3D_DOWN,100,180); + +// Adjust the position of the legend box +$graph->legend->Pos(0.03,0.10); + +// Adjust the color for theshadow of the legend +$graph->legend->SetShadow('darkgray@0.5'); +$graph->legend->SetFillColor('lightblue@0.1'); +$graph->legend->Hide(); + +// Get localised version of the month names +$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); + +$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); + +// 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('navy'); + +$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->SetColor('navy'); + +//$graph->ygrid->Show(false); +$graph->ygrid->SetColor('white@0.5'); + +// Setup graph title +$graph->title->Set('Using a country flag background'); + +// Some extra margin (from the top) +$graph->title->SetMargin(3); +$graph->title->SetFont(FF_ARIAL,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('yellow@0.4'); +$bplot2->SetFillColor('red@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(); +?> + diff --git a/includes/jpgraph/src/Examples/bkgimgflagex4.php b/includes/jpgraph/src/Examples/bkgimgflagex4.php new file mode 100644 index 0000000..d7db486 --- /dev/null +++ b/includes/jpgraph/src/Examples/bkgimgflagex4.php @@ -0,0 +1,83 @@ +SetScale("textlin"); +$graph->SetMargin(40,20,20,40); +$graph->SetMarginColor('white:0.9'); +$graph->SetColor('white'); +$graph->SetShadow(); + +// Apply a perspective transformation at the end +$graph->Set3DPerspective(SKEW3D_LEFT,350,320,true); + +// Adjust the position of the legend box +$graph->legend->Pos(0.03,0.10); + +// Adjust the color for theshadow of the legend +$graph->legend->SetShadow('darkgray@0.5'); +$graph->legend->SetFillColor('lightblue@0.1'); +$graph->legend->Hide(); + +// Get localised version of the month names +$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); + +$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); + +// 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('navy'); + +$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->SetColor('navy'); + +//$graph->ygrid->Show(false); +$graph->ygrid->SetColor('white@0.5'); + +// Setup graph title +$graph->title->Set('Using a country flag background'); + +// Some extra margin (from the top) +$graph->title->SetMargin(3); +$graph->title->SetFont(FF_ARIAL,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('yellow@0.4'); +$bplot2->SetFillColor('red@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(); +?> + diff --git a/includes/jpgraph/src/Examples/bkgimgflagex5.php b/includes/jpgraph/src/Examples/bkgimgflagex5.php new file mode 100644 index 0000000..f45a85a --- /dev/null +++ b/includes/jpgraph/src/Examples/bkgimgflagex5.php @@ -0,0 +1,83 @@ +SetScale("textlin"); +$graph->SetMargin(40,20,20,40); +$graph->SetMarginColor('white:0.9'); +$graph->SetColor('white'); +$graph->SetShadow(); + +// Apply a perspective transformation at the end +$graph->Set3DPerspective(SKEW3D_RIGHT,350,320,true); + +// Adjust the position of the legend box +$graph->legend->Pos(0.03,0.10); + +// Adjust the color for theshadow of the legend +$graph->legend->SetShadow('darkgray@0.5'); +$graph->legend->SetFillColor('lightblue@0.1'); +$graph->legend->Hide(); + +// Get localised version of the month names +$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); + +$graph->SetBackgroundCountryFlag('mais',BGIMG_COPY,50); + +// 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('navy'); + +$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->SetColor('navy'); + +//$graph->ygrid->Show(false); +$graph->ygrid->SetColor('white@0.5'); + +// Setup graph title +$graph->title->Set('Using a country flag background'); + +// Some extra margin (from the top) +$graph->title->SetMargin(3); +$graph->title->SetFont(FF_ARIAL,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('yellow@0.4'); +$bplot2->SetFillColor('red@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(); +?> + diff --git a/includes/jpgraph/src/Examples/blueblack400x300grad.png b/includes/jpgraph/src/Examples/blueblack400x300grad.png new file mode 100644 index 0000000..8852862 Binary files /dev/null and b/includes/jpgraph/src/Examples/blueblack400x300grad.png differ diff --git a/includes/jpgraph/src/Examples/boxstockcsimex1.php b/includes/jpgraph/src/Examples/boxstockcsimex1.php new file mode 100644 index 0000000..1cb765d --- /dev/null +++ b/includes/jpgraph/src/Examples/boxstockcsimex1.php @@ -0,0 +1,37 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/boxstockex1.php b/includes/jpgraph/src/Examples/boxstockex1.php new file mode 100644 index 0000000..4e09833 --- /dev/null +++ b/includes/jpgraph/src/Examples/boxstockex1.php @@ -0,0 +1,33 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/boxstockex2.php b/includes/jpgraph/src/Examples/boxstockex2.php new file mode 100644 index 0000000..d3531f4 --- /dev/null +++ b/includes/jpgraph/src/Examples/boxstockex2.php @@ -0,0 +1,38 @@ +SetScale("textlin"); +$graph->SetMarginColor('lightblue'); +$graph->title->Set('Box Stock chart example'); +$graph->subtitle->Set('(Indented X-axis)'); + +// Create a new stock plot +$p1 = new BoxPlot($datay); + +// Width of the bars (in pixels) +$p1->SetWidth(9); + +// Indent bars so they dont start and end at the edge of the +// plot area +$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->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/builtinplotmarksex1.php b/includes/jpgraph/src/Examples/builtinplotmarksex1.php new file mode 100644 index 0000000..5d265fa --- /dev/null +++ b/includes/jpgraph/src/Examples/builtinplotmarksex1.php @@ -0,0 +1,66 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/canvas_jpgarchex.php b/includes/jpgraph/src/Examples/canvas_jpgarchex.php new file mode 100644 index 0000000..a67c0cb --- /dev/null +++ b/includes/jpgraph/src/Examples/canvas_jpgarchex.php @@ -0,0 +1,143 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvasbezierex1.php b/includes/jpgraph/src/Examples/canvasbezierex1.php new file mode 100644 index 0000000..36febdf --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasbezierex1.php @@ -0,0 +1,40 @@ +title->Set('Bezier line with control points'); + +// Setup control point for bezier +$p = array(3,6, + 6,9, + 5,3, + 7,4); + +// Visualize control points +$shape->SetColor('blue'); +$shape->Line($p[0],$p[1],$p[2],$p[3]); +$shape->FilledCircle($p[2],$p[3],-6); + +$shape->SetColor('red'); +$shape->Line($p[4],$p[5],$p[6],$p[7]); +$shape->FilledCircle($p[4],$p[5],-6); + +// Draw bezier +$shape->SetColor('black'); +$shape->Bezier($p); + +// Frame it with a square +$shape->SetColor('navy'); +$shape->Rectangle(0.5,2,9.5,9.5); + +// ... and stroke it +$g->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/canvasex01.php b/includes/jpgraph/src/Examples/canvasex01.php new file mode 100644 index 0000000..6883915 --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasex01.php @@ -0,0 +1,37 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvasex02.php b/includes/jpgraph/src/Examples/canvasex02.php new file mode 100644 index 0000000..2080762 --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasex02.php @@ -0,0 +1,42 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvasex03.php b/includes/jpgraph/src/Examples/canvasex03.php new file mode 100644 index 0000000..dad3c55 --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasex03.php @@ -0,0 +1,58 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvasex04.php b/includes/jpgraph/src/Examples/canvasex04.php new file mode 100644 index 0000000..3e6ac9f --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasex04.php @@ -0,0 +1,58 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvasex05.php b/includes/jpgraph/src/Examples/canvasex05.php new file mode 100644 index 0000000..4613984 --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasex05.php @@ -0,0 +1,58 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvasex06.php b/includes/jpgraph/src/Examples/canvasex06.php new file mode 100644 index 0000000..b475c68 --- /dev/null +++ b/includes/jpgraph/src/Examples/canvasex06.php @@ -0,0 +1,42 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/canvaspiralex1.php b/includes/jpgraph/src/Examples/canvaspiralex1.php new file mode 100644 index 0000000..5d72b92 --- /dev/null +++ b/includes/jpgraph/src/Examples/canvaspiralex1.php @@ -0,0 +1,78 @@ +SetColor($color1); + $img->Line($x,$y,$x+$s1*$w,$y); + } + else { + $x = $x + $s2*$w*$r; + $w = (1-$r)*$w; + $h = $h / (1-$r) * $r; + $s2 *= -1; + $img->SetColor($color1); + $img->Line($x,$y,$x,$y-$s2*$h); + } + $img->SetColor($color2); + $img->FilledRectangle($x-1,$y-1,$x+1,$y+1); + $img->Arc($x,$y,2*$w+1,2*$h+1,$sa,$ea); + $img->Arc($x,$y,2*$w,2*$h,$sa,$ea); + $img->Arc($x,$y,2*$w-1,2*$h-1,$sa,$ea); + $img->Line($x_old,$y_old,$x,$y); + $x_old=$x; $y_old=$y; + } +} + +$g = new CanvasGraph($w,$h); +//$gr = 1.61803398874989484820; + +$p = SeaShell($g->img,0,20,$w-1,$h-21,$r,19); +$g->img->SetColor('black'); +$g->img->Rectangle(0,20,$w-1,$h-1); +$g->img->SetFont(FF_FONT2,FS_BOLD); +$g->img->SetTextAlign('center','top'); +$g->img->StrokeText($w/2,0,"Canvas Spiral"); + +$g->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/ccbp_ex1.php b/includes/jpgraph/src/Examples/ccbp_ex1.php new file mode 100644 index 0000000..5071fd3 --- /dev/null +++ b/includes/jpgraph/src/Examples/ccbp_ex1.php @@ -0,0 +1,36 @@ +SetTitle('Buffer penetration','(history added)'); +$graph->SetColorMap(0); + + // Two "fake tasks with hostory +$datax=array(75,83); $datay=array(110,64); +$datax1 = array(33,50,67,83); $datay1 = array(86,76,80,64); +$datax2 = array(18,47,58,75); $datay2 = array(80,97,105,110); + +$sp = new ScatterPlot($datay,$datax); +$sp->mark->SetType(MARK_DIAMOND); +$sp->mark->SetFillColor('white'); +$sp->mark->SetSize(12); + +$sp_hist = array(); +$sp_hist[0] = new LinePlot($datay1,$datax1); +$sp_hist[0]->SetWeight(1); +$sp_hist[0]->SetColor('white'); + +$sp_hist[1] = new LinePlot($datay2,$datax2); +$sp_hist[1]->SetWeight(1); +$sp_hist[1]->SetColor('white'); + +$graph->Add($sp_hist); +$graph->Add($sp); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/ccbp_ex2.php b/includes/jpgraph/src/Examples/ccbp_ex2.php new file mode 100644 index 0000000..c5decd3 --- /dev/null +++ b/includes/jpgraph/src/Examples/ccbp_ex2.php @@ -0,0 +1,36 @@ +SetTitle('Buffer penetration','(history added)'); +$graph->SetColorMap(1); + + // Two "fake tasks with hostory +$datax=array(75,83); $datay=array(110,64); +$datax1 = array(33,50,67,83); $datay1 = array(86,76,80,64); +$datax2 = array(18,47,58,75); $datay2 = array(80,97,105,110); + +$sp = new ScatterPlot($datay,$datax); +$sp->mark->SetType(MARK_DIAMOND); +$sp->mark->SetFillColor('white'); +$sp->mark->SetSize(12); + +$sp_hist = array(); +$sp_hist[0] = new LinePlot($datay1,$datax1); +$sp_hist[0]->SetWeight(1); +$sp_hist[0]->SetColor('white'); + +$sp_hist[1] = new LinePlot($datay2,$datax2); +$sp_hist[1]->SetWeight(1); +$sp_hist[1]->SetColor('white'); + +$graph->Add($sp_hist); +$graph->Add($sp); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/ccbpgraph.class.php b/includes/jpgraph/src/Examples/ccbpgraph.class.php new file mode 100644 index 0000000..91954e1 --- /dev/null +++ b/includes/jpgraph/src/Examples/ccbpgraph.class.php @@ -0,0 +1,257 @@ +iWidth = $aWidth; + $this->iHeight = $aHeight; + } + /** + * Set the title and subtitle for the graph + * + * @param string $aTitle + * @param string $aSubTitle + */ + public function SetTitle($aTitle, $aSubTitle) { + $this->iTitle = $aTitle; + $this->iSubTitle = $aSubTitle; + } + /** + * Set the x-axis min and max values + * + * @param int $aMin + * @param int $aMax + */ + public function SetXMinMax($aMin, $aMax) { + $this->iXMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep; + $this->iXMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep; + } + /** + * Specify what color map to use + * + * @param int $aMap + */ + public function SetColorMap($aMap) { + $this->iColorMap = $aMap % CCBPGraph::NColorMaps; + } + /** + * Set the y-axis min and max values + * + * @param int $aMin + * @param int $aMax + */ + public function SetYMinMax($aMin,$aMax) { + $this->iYMin = floor($aMin/CCBPGraph::TickStep)*CCBPGraph::TickStep; + $this->iYMax = ceil($aMax/CCBPGraph::TickStep)*CCBPGraph::TickStep; + } + /** + * Set the specification of the color backgrounds and also the + * optional exact colors to be used + * + * @param mixed $aSpec An array of 3 1x2 arrays. Each array specify the + * color indication value at x=0 and x=max x in order to determine the slope + * @param mixed $aColors An array with four elements specifying the colors + * of each color indicator + */ + public function SetColorIndication(array $aSpec,array $aColors=null) { + if( count($aSpec) !== 3 ) { + JpgraphError::Raise('Specification of scale values for background indicators must be an array with three elements.'); + } + $this->iColorInd = $aSpec; + if( $aColors !== null ) { + if( is_array($aColors) && count($aColors) == 4 ) { + $this->iColorSpec = $aColors; + } + else { + JpGraphError::Raise('Color specification for background indication must have four colors.'); + } + } + } + /** + * Construct the graph + * + */ + private function Init() { + + // Setup limits for color indications + $lowx = $this->iXMin; $highx= $this->iXMax; + $lowy = $this->iYMin; $highy = $this->iYMax; + $width=$this->iWidth; $height=$this->iHeight; + + // Margins + $lm=50; $rm=40; + $tm=60; $bm=40; + + if( $width <= 300 || $height <= 250 ) { + $labelsize = 8; + $lm=25; $rm=25; + $tm=45; $bm=25; + } + elseif( $width <= 450 || $height <= 300 ) { + $labelsize = 8; + $lm=30; $rm=30; + $tm=50; $bm=30; + } + elseif( $width <= 600 || $height <= 400 ) { + $labelsize = 9; + } + else { + $labelsize = 11; + } + + if( $this->iSubTitle == '' ) { + $tm -= $labelsize+4; + } + + $graph = new Graph($width,$height); + $graph->SetScale('intint',$lowy,$highy,$lowx,$highx); + $graph->SetMargin($lm,$rm,$tm,$bm); + $graph->SetMarginColor($this->iMarginColor[$this->iColorMap]); + $graph->SetClipping(); + + $graph->title->Set($this->iTitle); + $graph->subtitle->Set($this->iSubTitle); + + $graph->title->SetFont(FF_ARIAL,FS_BOLD,$labelsize+4); + $graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,$labelsize+1); + + $graph->SetBox(true,'black@0.3'); + + $graph->xaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize); + $graph->yaxis->SetFont(FF_ARIAL,FS_BOLD,$labelsize); + + $graph->xaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep); + $graph->yaxis->scale->ticks->Set(CCBPGraph::TickStep,CCBPGraph::TickStep); + + $graph->xaxis->HideZeroLabel(); + $graph->yaxis->HideZeroLabel(); + + $graph->xaxis->SetLabelFormatString('%d%%'); + $graph->yaxis->SetLabelFormatString('%d%%'); + + // For the x-axis we adjust the color so labels on the left of the Y-axis are in black + $n1 = floor(abs($this->iXMin/25))+1; + $n2 = floor($this->iXMax/25); + if( $this->iColorMap == 0 ) { + $xlcolors=array(); + for( $i = 0; $i < $n1; ++$i ) { + $xlcolors[$i] = 'black'; + } + for( $i = 0; $i < $n2; ++$i ) { + $xlcolors[$n1+$i] = 'lightgray:1.5'; + } + $graph->xaxis->SetColor('gray',$xlcolors); + $graph->yaxis->SetColor('gray','lightgray:1.5'); + } + else { + $graph->xaxis->SetColor('darkgray','darkgray:0.8'); + $graph->yaxis->SetColor('darkgray','darkgray:0.8'); + } + $graph->SetGridDepth(DEPTH_FRONT); + $graph->ygrid->SetColor('gray@0.6'); + $graph->ygrid->SetLineStyle('dotted'); + + $graph->ygrid->Show(); + + $graph->xaxis->SetWeight(1); + $graph->yaxis->SetWeight(1); + + $ytitle = new Text(CCBPGraph::YTitle,floor($lm*.75),($height-$tm-$bm)/2+$tm); + #$ytitle->SetFont(FF_VERA,FS_BOLD,$labelsize+1); + $ytitle->SetAlign('right','center'); + $ytitle->SetAngle(90); + $graph->Add($ytitle); + + $xtitle = new Text(CCBPGraph::XTitle,($width-$lm-$rm)/2+$lm,$height - 10); + #$xtitle->SetFont(FF_VERA,FS_BOLD,$labelsize); + $xtitle->SetAlign('center','bottom'); + $graph->Add($xtitle); + + $df = 'D j:S M, Y'; + if( $width < 400 ) { + $df = 'D j:S M'; + } + + $time = new Text(date($df),$width-10,$height-10); + $time->SetAlign('right','bottom'); + #$time->SetFont(FF_VERA,FS_NORMAL,$labelsize-1); + $time->SetColor('darkgray'); + $graph->Add($time); + + // Use an accumulated fille line graph to create the colored bands + + $n = 3; + for( $i=0; $i < $n; ++$i ) { + $b = $this->iColorInd[$i][0]; + $k = ($this->iColorInd[$i][1] - $this->iColorInd[$i][0])/$this->iXMax; + $colarea[$i] = array( array($lowx,$lowx*$k+$b), array($highx,$highx*$k+$b) ); + } + $colarea[3] = array( array($lowx,$highy), array($highx,$highy) ); + + + $cb = array(); + for( $i=0; $i < 4; ++$i ) { + $cb[$i] = new LinePlot(array($colarea[$i][0][1],$colarea[$i][1][1]), + array($colarea[$i][0][0],$colarea[$i][1][0])); + $cb[$i]->SetFillColor($this->iColorSpec[$this->iColorMap][$i]); + $cb[$i]->SetFillFromYMin(); + } + + $graph->Add(array_slice(array_reverse($cb),0,4)); + $this->graph = $graph; + } + /** + * Add a line or scatter plot to the graph + * + * @param mixed $aPlots + */ + public function Add($aPlots) { + if( is_array($aPlots) ) { + $this->iPlots = array_merge($this->iPlots,$aPlots); + } + else { + $this->iPlots[] = $aPlots; + } + } + /** + * Stroke the graph back to the client or to a file + * + * @param mixed $aFile + */ + public function Stroke($aFile='') { + $this->Init(); + if( count($this->iPlots) > 0 ) { + $this->graph->Add($this->iPlots); + } + $this->graph->Stroke($aFile); + } +} +?> diff --git a/includes/jpgraph/src/Examples/centeredlineex01.php b/includes/jpgraph/src/Examples/centeredlineex01.php new file mode 100644 index 0000000..3642f3a --- /dev/null +++ b/includes/jpgraph/src/Examples/centeredlineex01.php @@ -0,0 +1,35 @@ +img->SetMargin(40,40,40,40); +$graph->img->SetAntiAliasing(); +$graph->SetScale("textlin"); +$graph->SetShadow(); +$graph->title->Set("Example of line centered plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + + +// Use 20% "grace" to get slightly larger scale then min/max of +// data +$graph->yscale->SetGrace(20); + + +$p1 = new LinePlot($datay); +$p1->mark->SetType(MARK_FILLEDCIRCLE); +$p1->mark->SetFillColor("red"); +$p1->mark->SetWidth(4); +$p1->SetColor("blue"); +$p1->SetCenter(); +$graph->Add($p1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/centeredlineex02.php b/includes/jpgraph/src/Examples/centeredlineex02.php new file mode 100644 index 0000000..2b74229 --- /dev/null +++ b/includes/jpgraph/src/Examples/centeredlineex02.php @@ -0,0 +1,30 @@ +img->SetMargin(40,40,40,40); +$graph->img->SetAntiAliasing(); +$graph->SetScale("textlin"); +$graph->SetShadow(); +$graph->title->Set("Example of filled line centered plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$p1 = new LinePlot($datay); +$p1->SetFillColor("green"); +$p1->mark->SetType(MARK_FILLEDCIRCLE); +$p1->mark->SetFillColor("red"); +$p1->mark->SetWidth(4); +$p1->SetColor("blue"); +$p1->SetCenter(); +$graph->Add($p1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/centeredlineex03.php b/includes/jpgraph/src/Examples/centeredlineex03.php new file mode 100644 index 0000000..9c182a7 --- /dev/null +++ b/includes/jpgraph/src/Examples/centeredlineex03.php @@ -0,0 +1,31 @@ +img->SetMargin(40,40,40,80); +$graph->img->SetAntiAliasing(); +$graph->SetScale("textlin"); +$graph->SetShadow(); +$graph->title->Set("Example slanted X-labels"); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); + +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,11); +$graph->xaxis->SetTickLabels($labels); +$graph->xaxis->SetLabelAngle(45); + +$p1 = new LinePlot($datay); +$p1->mark->SetType(MARK_FILLEDCIRCLE); +$p1->mark->SetFillColor("red"); +$p1->mark->SetWidth(4); +$p1->SetColor("blue"); +$p1->SetCenter(); +$graph->Add($p1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/centerlinebarex1.php b/includes/jpgraph/src/Examples/centerlinebarex1.php new file mode 100644 index 0000000..d686bc6 --- /dev/null +++ b/includes/jpgraph/src/Examples/centerlinebarex1.php @@ -0,0 +1,35 @@ +img->SetMargin(40,80,40,40); +$graph->SetScale("textlin"); +$graph->SetShadow(); + +$graph->title->Set('Center the line points in bars'); + +$line = new LinePlot($ydata); +$line->SetBarCenter(); +$line->SetWeight(2); + +$bar = new BarPlot($ydata); +$bar2 = new BarPlot($ydata); +$bar2->SetFillColor("red"); + +$gbar = new GroupbarPlot(array($bar,$bar2)); + +$graph->Add($gbar); +$graph->Add($line); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/checkgd.php b/includes/jpgraph/src/Examples/checkgd.php new file mode 100644 index 0000000..ad252bd --- /dev/null +++ b/includes/jpgraph/src/Examples/checkgd.php @@ -0,0 +1,11 @@ + diff --git a/includes/jpgraph/src/Examples/checkgd2.php b/includes/jpgraph/src/Examples/checkgd2.php new file mode 100644 index 0000000..e5e7b3c --- /dev/null +++ b/includes/jpgraph/src/Examples/checkgd2.php @@ -0,0 +1,14 @@ + diff --git a/includes/jpgraph/src/Examples/checkttf.php b/includes/jpgraph/src/Examples/checkttf.php new file mode 100644 index 0000000..5efe737 --- /dev/null +++ b/includes/jpgraph/src/Examples/checkttf.php @@ -0,0 +1,22 @@ + diff --git a/includes/jpgraph/src/Examples/classroom.jpg b/includes/jpgraph/src/Examples/classroom.jpg new file mode 100644 index 0000000..f4cc06c Binary files /dev/null and b/includes/jpgraph/src/Examples/classroom.jpg differ diff --git a/includes/jpgraph/src/Examples/clipping_ex1.php b/includes/jpgraph/src/Examples/clipping_ex1.php new file mode 100644 index 0000000..8629fce --- /dev/null +++ b/includes/jpgraph/src/Examples/clipping_ex1.php @@ -0,0 +1,36 @@ +SetScale('intlin',0,10); +$graph->SetMargin(30,20,70,40); +$graph->SetMarginColor(array(177,191,174)); + +$graph->SetClipping(false); + +$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); + +$graph->ygrid->SetLineStyle('dashed'); + +$graph->title->Set("Manual scale"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->title->SetColor('white'); +$graph->subtitle->Set("(No clipping)"); +$graph->subtitle->SetColor('white'); +$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor("red"); +$lineplot->SetWeight(2); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/clipping_ex2.php b/includes/jpgraph/src/Examples/clipping_ex2.php new file mode 100644 index 0000000..aba939f --- /dev/null +++ b/includes/jpgraph/src/Examples/clipping_ex2.php @@ -0,0 +1,36 @@ +SetScale('intlin',0,10); +$graph->SetMargin(30,20,70,40); +$graph->SetMarginColor(array(177,191,174)); + +$graph->SetClipping(true); + +$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); + +$graph->ygrid->SetLineStyle('dashed'); + +$graph->title->Set("Manual scale"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->title->SetColor('white'); +$graph->subtitle->Set("(With clipping)"); +$graph->subtitle->SetColor('white'); +$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor("red"); +$lineplot->SetWeight(2); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/colormaps.php b/includes/jpgraph/src/Examples/colormaps.php new file mode 100644 index 0000000..2f9470f --- /dev/null +++ b/includes/jpgraph/src/Examples/colormaps.php @@ -0,0 +1,133 @@ +img->SetColor('darkgray'); + $graph->img->Rectangle(0,0,$width-1,$height-1); + + $t = new Text($aTitle, $width/2,5); + $t->SetAlign('center','top'); + $t->SetFont(FF_ARIAL,FS_BOLD,14); + $t->Stroke($graph->img); + + // Instantiate a colormap + $cm = new ColorMap(); + $cm->InitRGB($graph->img->rgb); + + for( $mapidx=$aStart; $mapidx <= $aEnd; ++$mapidx, $ys += $ymarg ) { + + $cm->SetMap($mapidx,$aReverse); + $n = $cm->SetNumColors($n); + list( $mapidx, $maparray ) = $cm->GetCurrMap(); + $ncols = count($maparray); + $colbuckets = $cm->GetBuckets(); + + // The module width will depend on the actual number of colors + $mw = round(($width-$lmarg-$rmarg)/$n); + + // Draw color map title (name) + $t->Set('Basic colors: '.$ncols.', Total colors: '.$n); + $t->SetAlign('center','bottom'); + $t->SetAngle(0); + $t->SetFont(FF_TIMES,FS_NORMAL,14); + $t->Stroke($graph->img,$width/2,$ys-3); + + // Add the name/number of the map to the left + $t->SetAlign('right','center'); + $t->Set('Map: '.$mapidx); + $t->SetFont(FF_ARIAL,FS_NORMAL,14); + $t->Stroke($graph->img,$xs-20,round($ys+$mh/2)); + + // Setup text properties for the color names + if( $addColorNames ) { + $t->SetAngle(30); + $t->SetFont(FF_ARIAL,FS_NORMAL,12); + $t->SetAlign('right','top'); + } + + // Loop through all colors in the map + $x = $xs; $y = $ys; $k=0; + for($i=0; $i < $n; ++$i){ + $graph->img->SetColor($colbuckets[$i]); + $graph->img->FilledRectangle($x,$y,$x+$mw,$y+$mh); + + // Mark all basic colors in the map with a bar and name + if( $i % (($n-$ncols)/($ncols-1)+1) == 0 ) { + $graph->img->SetColor('black'); + $graph->img->FilledRectangle($x,$y+$mh+4,$x+$mw-1,$y+$mh+6); + if( $addColorNames ) { + $t->Set($maparray[$k++]); + $t->Stroke($graph->img,$x+$mw/2,$y+$mh+10); + } + } + $x += $mw; + } + + // Draw a border around the map + $graph->img->SetColor('black'); + $graph->img->Rectangle($xs,$ys,$xs+$mw*$n,$ys+$mh); + + } + + // Send back to client + $graph->Stroke(); + } + +} + +$driver = new ColorMapDriver(); + +$title = "Standard maps"; +$reverse = false; +$n = 64; $s=0; $e=9; +$showNames = false; + + +/* +$title = "Center maps"; +$reverse = false; +$n = 64; $s=10; $e=14; +$showNames = false; +*/ + +/* +$title = "Continues maps"; +$reverse = false; +$n = 64; $s=15; $e=21; +$showNames = false; +*/ +$driver->Draw($title,$s,$e,$n,$reverse,$showNames); + +?> diff --git a/includes/jpgraph/src/Examples/comb90dategraphex01.php b/includes/jpgraph/src/Examples/comb90dategraphex01.php new file mode 100644 index 0000000..3294822 --- /dev/null +++ b/includes/jpgraph/src/Examples/comb90dategraphex01.php @@ -0,0 +1,96 @@ + 359) + $data_winddirection[$i+1] = 0; + + $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2); + if($data_windspeed[$i+1] < 0 ) + $data_windspeed[$i+1] = 0; + + $xdata[$i] = $start + $i * SAMPLERATE; +} +$xdata[$i] = $start + $i * SAMPLERATE; + + +// Setup the Wind direction graph +$graph = new Graph(300,800); +$graph->SetMarginColor('lightgray:1.7'); +$graph->SetScale('datlin',0,360); +$graph->Set90AndMargin(50,30,60,30); +$graph->SetFrame(true,'white',0); +$graph->SetBox(); + +$graph->title->Set('Wind direction'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->title->SetMargin(10); + +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xaxis->scale->SetDateFormat('h:i'); +$graph->xgrid->Show(); + +$graph->yaxis->SetLabelAngle(45); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetLabelMargin(0); +$graph->yaxis->scale->SetAutoMin(0); + +$line = new LinePlot($data_winddirection,$xdata); +$line->SetStepStyle(); +$line->SetColor('blue'); + +$graph->Add($line); + +// Setup the wind speed graph +$graph2 = new Graph(300,800); +$graph2->SetScale('datlin'); +$graph2->Set90AndMargin(50,30,60,30); +$graph2->SetMarginColor('lightgray:1.7'); +$graph2->SetFrame(true,'white',0); +$graph2->SetBox(); + +$graph2->title->Set('Windspeed'); +$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph2->title->SetMargin(10); + +$graph2->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph2->xaxis->scale->SetDateFormat('h:i'); +$graph2->xgrid->Show(); + +$graph2->yaxis->SetLabelAngle(45); +$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph2->yaxis->SetLabelMargin(0); +$graph2->yaxis->scale->SetAutoMin(0); + +$line2 = new LinePlot($data_windspeed,$xdata); +$line2->SetStepStyle(); +$line2->SetColor('red'); + +$graph2->Add($line2); + +//----------------------- +// Create a multigraph +//---------------------- +$mgraph = new MGraph(); +$mgraph->SetMargin(2,2,2,2); +$mgraph->SetFrame(true,'darkgray',2); +$mgraph->SetFillColor('lightgray'); +$mgraph->Add($graph); +$mgraph->Add($graph2,300,0); +$mgraph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/comb90dategraphex02.php b/includes/jpgraph/src/Examples/comb90dategraphex02.php new file mode 100644 index 0000000..b667181 --- /dev/null +++ b/includes/jpgraph/src/Examples/comb90dategraphex02.php @@ -0,0 +1,103 @@ + 359) + $data_winddirection[$i+1] = 0; + + $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2); + if($data_windspeed[$i+1] < 0 ) + $data_windspeed[$i+1] = 0; + + $xdata[$i] = $start + $i * SAMPLERATE; +} +$xdata[$i] = $start + $i * SAMPLERATE; + + +DEFINE('BKG_COLOR','lightgray:1.7'); +DEFINE('WIND_HEIGHT',800); +DEFINE('WIND_WIDTH',280); + +// Setup the Wind direction graph +$graph = new Graph(WIND_WIDTH,WIND_HEIGHT); +$graph->SetMarginColor(BKG_COLOR); +$graph->SetScale('datlin',0,360); +$graph->Set90AndMargin(50,10,60,30); +$graph->SetFrame(true,'white',0); +$graph->SetBox(); + +$graph->title->Set('Wind direction'); +$graph->title->SetColor('blue'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->title->SetMargin(5); + +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xaxis->scale->SetDateFormat('h:i'); +$graph->xgrid->Show(); + +$graph->yaxis->SetLabelAngle(90); +$graph->yaxis->SetColor('blue'); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetLabelMargin(0); +$graph->yaxis->scale->SetAutoMin(0); + +$line = new LinePlot($data_winddirection,$xdata); +$line->SetStepStyle(); +$line->SetColor('blue'); + +$graph->Add($line); + +// Setup the wind speed graph +$graph2 = new Graph(WIND_WIDTH-30,WIND_HEIGHT); +$graph2->SetScale('datlin'); +$graph2->Set90AndMargin(5,20,60,30); +$graph2->SetMarginColor(BKG_COLOR); +$graph2->SetFrame(true,'white',0); +$graph2->SetBox(); + +$graph2->title->Set('Windspeed'); +$graph2->title->SetColor('red'); +$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph2->title->SetMargin(5); + +$graph2->xaxis->HideLabels(); +$graph2->xgrid->Show(); + +$graph2->yaxis->SetLabelAngle(90); +$graph2->yaxis->SetColor('red'); +$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph2->yaxis->SetLabelMargin(0); +$graph2->yaxis->scale->SetAutoMin(0); + +$line2 = new LinePlot($data_windspeed,$xdata); +$line2->SetStepStyle(); +$line2->SetColor('red'); + +$graph2->Add($line2); + +//----------------------- +// Create a multigraph +//---------------------- +$mgraph = new MGraph(); +$mgraph->SetMargin(2,2,2,2); +$mgraph->SetFrame(true,'darkgray',2); +$mgraph->SetFillColor(BKG_COLOR); +$mgraph->Add($graph); +$mgraph->Add($graph2,280,0); +$mgraph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/comb90dategraphex03.php b/includes/jpgraph/src/Examples/comb90dategraphex03.php new file mode 100644 index 0000000..2911f8b --- /dev/null +++ b/includes/jpgraph/src/Examples/comb90dategraphex03.php @@ -0,0 +1,147 @@ + 359) + $data_winddirection[$i+1] = 0; + + $data_windspeed[$i+1] = $data_windspeed[$i] + rand(-2,2); + if($data_windspeed[$i+1] < 0 ) + $data_windspeed[$i+1] = 0; + + $data_windtemp[$i+1] = $data_windtemp[$i] + rand(-1.5,1.5); + + $xdata[$i] = $start + $i * SAMPLERATE; +} +$xdata[$i] = $start + $i * SAMPLERATE; + + +//DEFINE('BKG_COLOR','lightgray:1.7'); +DEFINE('BKG_COLOR','green:1.98'); +DEFINE('WIND_HEIGHT',800); +DEFINE('WIND_WIDTH',250); + +//------------------------------------------------------------------ +// Setup the Wind direction graph +//------------------------------------------------------------------ +$graph = new Graph(WIND_WIDTH,WIND_HEIGHT); +$graph->SetMarginColor(BKG_COLOR); +$graph->SetScale('datlin',0,360); +$graph->Set90AndMargin(50,10,70,30); +$graph->SetFrame(true,'white',0); +$graph->SetBox(); + +$graph->title->Set('Wind direction'); +$graph->title->SetColor('blue'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->title->SetMargin(5); + +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->xaxis->scale->SetDateFormat('H:i'); +$graph->xgrid->Show(); + +$graph->yaxis->SetLabelAngle(90); +$graph->yaxis->SetColor('blue'); +$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph->yaxis->SetLabelMargin(0); +$graph->yaxis->scale->SetAutoMin(0); + +$line = new LinePlot($data_winddirection,$xdata); +$line->SetStepStyle(); +$line->SetColor('blue'); + +$graph->Add($line); + +//------------------------------------------------------------------ +// Setup the wind speed graph +//------------------------------------------------------------------ +$graph2 = new Graph(WIND_WIDTH-30,WIND_HEIGHT); +$graph2->SetScale('datlin'); +$graph2->Set90AndMargin(5,20,70,30); +$graph2->SetMarginColor(BKG_COLOR); +$graph2->SetFrame(true,'white',0); +$graph2->SetBox(); + +$graph2->title->Set('Windspeed'); +$graph2->title->SetColor('red'); +$graph2->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph2->title->SetMargin(5); + +$graph2->xaxis->HideLabels(); +$graph2->xgrid->Show(); + +$graph2->yaxis->SetLabelAngle(90); +$graph2->yaxis->SetColor('red'); +$graph2->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph2->yaxis->SetLabelMargin(0); +$graph2->yaxis->scale->SetAutoMin(0); + +$line2 = new LinePlot($data_windspeed,$xdata); +$line2->SetStepStyle(); +$line2->SetColor('red'); + +$graph2->Add($line2); + +//------------------------------------------------------------------ +// Setup the wind temp graph +//------------------------------------------------------------------ +$graph3 = new Graph(WIND_WIDTH-30,WIND_HEIGHT); +$graph3->SetScale('datlin'); +$graph3->Set90AndMargin(5,20,70,30); +$graph3->SetMarginColor(BKG_COLOR); +$graph3->SetFrame(true,'white',0); +$graph3->SetBox(); + +$graph3->title->Set('Temperature'); +$graph3->title->SetColor('black'); +$graph3->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph3->title->SetMargin(5); + +$graph3->xaxis->HideLabels(); +$graph3->xgrid->Show(); + +$graph3->yaxis->SetLabelAngle(90); +$graph3->yaxis->SetColor('black'); +$graph3->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9); +$graph3->yaxis->SetLabelMargin(0); +$graph3->yaxis->scale->SetAutoMin(-10); + +$line3 = new LinePlot($data_windtemp,$xdata); +$line3->SetStepStyle(); +$line3->SetColor('black'); + +$graph3->Add($line3); + +//----------------------- +// Create a multigraph +//---------------------- +$mgraph = new MGraph(); +$mgraph->SetMargin(2,2,2,2); +$mgraph->SetFrame(true,'darkgray',2); +$mgraph->SetFillColor(BKG_COLOR); +$mgraph->Add($graph,0,50); +$mgraph->Add($graph2,250,50); +$mgraph->Add($graph3,460,50); +$mgraph->title->Set('Climate diagram 12 March 2009'); +$mgraph->title->SetFont(FF_ARIAL,FS_BOLD,20); +$mgraph->title->SetMargin(8); +$mgraph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/combgraphex1.php b/includes/jpgraph/src/Examples/combgraphex1.php new file mode 100644 index 0000000..b03b14b --- /dev/null +++ b/includes/jpgraph/src/Examples/combgraphex1.php @@ -0,0 +1,89 @@ +getTicks($datax,DSUTILS_MONTH1); + +// Now create the real graph +// Combine a line and a bar graph + +// We add some grace to the end of the X-axis scale so that the first and last +// data point isn't exactly at the very end or beginning of the scale +$grace = 400000; +$xmin = $datax[0]-$grace; +$xmax = $datax[$n-1]+$grace;; + +// Overall width of graphs +$w = 450; +// Left and right margin for each graph +$lm=25; $rm=15; + +//---------------------- +// Setup the line graph +//---------------------- +$graph = new Graph($w,250); +$graph->SetScale('linlin',0,0,$xmin,$xmax); +$graph->SetMargin($lm,$rm,10,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(false); +$graph->SetBox(true); +$graph->title->Set('Example of combined graph'); +$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); +$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); +$graph->xaxis->SetLabelFormatString('My',true); +$graph->xgrid->Show(); +$p1 = new LinePlot($datay,$datax); +$graph->Add($p1); + +//---------------------- +// Setup the bar graph +//---------------------- +$graph2 = new Graph($w,110); +$graph2->SetScale('linlin',0,0,$xmin,$xmax); +$graph2->SetMargin($lm,$rm,5,10); +$graph2->SetMarginColor('white'); +$graph2->SetFrame(false); +$graph2->SetBox(true); +$graph2->xgrid->Show(); +$graph2->xaxis->SetTickPositions($tickPositions,$minTickPositions); +$graph2->xaxis->SetLabelFormatString('My',true); +$graph2->xaxis->SetPos('max'); +$graph2->xaxis->HideLabels(); +$graph2->xaxis->SetTickSide(SIDE_DOWN); +$b1 = new BarPlot($datay2,$datax); +$b1->SetFillColor('teal'); +$b1->SetColor('teal:1.2'); +$graph2->Add($b1); + +//----------------------- +// Create a multigraph +//---------------------- +$mgraph = new MGraph(); +$mgraph->SetMargin(2,2,2,2); +$mgraph->SetFrame(true,'darkgray',2); +$mgraph->Add($graph); +$mgraph->Add($graph2,0,240); +$mgraph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/combgraphex2.php b/includes/jpgraph/src/Examples/combgraphex2.php new file mode 100644 index 0000000..27afa83 --- /dev/null +++ b/includes/jpgraph/src/Examples/combgraphex2.php @@ -0,0 +1,90 @@ +SetScale('linlin',0,0,$xmin,$xmax); +$graph->SetMargin($lm,$rm,10,30); +$graph->SetMarginColor('white'); +$graph->SetFrame(false); +$graph->SetBox(true); +$graph->title->Set('Example of combined graph with background'); +$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); +$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); +$graph->xaxis->SetLabelFormatString('My',true); +$graph->xgrid->Show(); +$p1 = new LinePlot($datay,$datax); +$graph->Add($p1); + +//---------------------- +// Setup the bar graph +//---------------------- +$graph2 = new Graph($w,110); +$graph2->SetScale('linlin',0,0,$xmin,$xmax); +$graph2->SetMargin($lm,$rm,5,10); +$graph2->SetMarginColor('white'); +$graph2->SetFrame(false); +$graph2->SetBox(true); +$graph2->xgrid->Show(); +$graph2->xaxis->SetTickPositions($tickPositions,$minTickPositions); +$graph2->xaxis->SetLabelFormatString('My',true); +$graph2->xaxis->SetPos('max'); +$graph2->xaxis->HideLabels(); +$graph2->xaxis->SetTickSide(SIDE_DOWN); +$b1 = new BarPlot($datay2,$datax); +$b1->SetFillColor('teal'); +$b1->SetColor('teal:1.2'); +$graph2->Add($b1); + +//----------------------- +// Create a multigraph +//---------------------- +$mgraph = new MGraph(); +$mgraph->SetImgFormat('jpeg',60); +$mgraph->SetMargin(2,2,2,2); +$mgraph->SetFrame(true,'darkgray',2); +$mgraph->SetBackgroundImage('tiger1.jpg'); +$mgraph->AddMix($graph,0,0,85); +$mgraph->AddMix($graph2,0,250,85); +$mgraph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/contour2_ex1.php b/includes/jpgraph/src/Examples/contour2_ex1.php new file mode 100644 index 0000000..764a8f2 --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex1.php @@ -0,0 +1,50 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(With lines and labels)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot +$cp = new FilledContourPlot($data); + +// Use only blue/red color schema +$cp->UseHighContrastColor(true); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); + +// Display the labels +$cp->ShowLabels(true,true); +$cp->SetFont(FF_ARIAL,FS_BOLD,9); +$cp->SetFontColor('white'); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contour2_ex2.php b/includes/jpgraph/src/Examples/contour2_ex2.php new file mode 100644 index 0000000..b702626 --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex2.php @@ -0,0 +1,51 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(No lines, no labels)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot +$cp = new FilledContourPlot($data); + +// Use only blue/red color schema +$cp->UseHighContrastColor(true); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); + +// No labels +$cp->ShowLabels(false); + +// No lines +$cp->ShowLines(false); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contour2_ex3.php b/includes/jpgraph/src/Examples/contour2_ex3.php new file mode 100644 index 0000000..93f7611 --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex3.php @@ -0,0 +1,55 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(Manual colors)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot with only 3 isobars +$cp = new FilledContourPlot($data,3); + +// Specify the colors manually +$isobar_colors = array('lightgray','teal:1.3','orange','red'); +$cp->SetIsobarColors($isobar_colors); + +// Use only blue/red color schema +$cp->UseHighContrastColor(true); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); + +// Display labels +$cp->ShowLabels(true); + +// No lines +$cp->ShowLines(false); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contour2_ex4.php b/includes/jpgraph/src/Examples/contour2_ex4.php new file mode 100644 index 0000000..79e43e8 --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex4.php @@ -0,0 +1,47 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(labels follows gradients)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot +$cp = new FilledContourPlot($data,8); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); + +// Display the labels +$cp->ShowLabels(true,true); +$cp->SetFont(FF_ARIAL,FS_BOLD,9); +$cp->SetFontColor('black'); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contour2_ex5.php b/includes/jpgraph/src/Examples/contour2_ex5.php new file mode 100644 index 0000000..1d3ac43 --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex5.php @@ -0,0 +1,52 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(horizontal labels)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot +$cp = new FilledContourPlot($data,8); + +// Use only black/and white schema +$cp->UseHighContrastColor(true,true); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); +// Show lines in red +$cp->ShowLines(true,'red'); + +// Display the labels +$cp->ShowLabels(true,false); +$cp->SetFont(FF_ARIAL,FS_BOLD,9); +$cp->SetFontColor('white'); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contour2_ex6.php b/includes/jpgraph/src/Examples/contour2_ex6.php new file mode 100644 index 0000000..49755be --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex6.php @@ -0,0 +1,53 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(With lines and labels)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot +$cp = new FilledContourPlot($data,7); + +// Use only blue/red color schema +$cp->UseHighContrastColor(true); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); + +// Specify method to use +$cp->SetMethod('rect'); + +// Display the labels +$cp->ShowLabels(true,true); +$cp->SetFont(FF_ARIAL,FS_BOLD,9); +$cp->SetFontColor('white'); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contour2_ex7.php b/includes/jpgraph/src/Examples/contour2_ex7.php new file mode 100644 index 0000000..b83d3dd --- /dev/null +++ b/includes/jpgraph/src/Examples/contour2_ex7.php @@ -0,0 +1,53 @@ +SetMargin(30, 30, 40, 30); +$graph->SetScale('intint'); +$graph->SetMarginColor('white'); + +// Setup title of graph +$graph->title->Set('Filled contour plot'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); + +$graph->subtitle->Set('(With lines and labels)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + +// Create a new contour plot +$cp = new FilledContourPlot($data,7); + +// Use only blue/red color schema +$cp->UseHighContrastColor(true); + +// Flip visually +$cp->SetInvert(); + +// Fill the contours +$cp->SetFilled(true); + +// Specify method to use +$cp->SetMethod('tri'); + +// Display the labels +$cp->ShowLabels(true,true); +$cp->SetFont(FF_ARIAL,FS_BOLD,9); +$cp->SetFontColor('white'); + +// And add the plot to the graph +$graph->Add($cp); + +// Send it back to the client +$graph->stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contourex01.php b/includes/jpgraph/src/Examples/contourex01.php new file mode 100644 index 0000000..eb2cb99 --- /dev/null +++ b/includes/jpgraph/src/Examples/contourex01.php @@ -0,0 +1,48 @@ +SetMargin(40,140,60,40); + +$graph->title->Set('Example of contour plot'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// For contour plots it is custom to use a box style ofr the axis +$graph->legend->SetPos(0.05,0.5,'right','center'); +$graph->SetScale('intint'); +$graph->SetAxisStyle(AXSTYLE_BOXOUT); +$graph->xgrid->Show(); +$graph->ygrid->Show(); + + +// A simple contour plot with default arguments (e.g. 10 isobar lines) +$cp = new ContourPlot($data); + +// Display the legend +$cp->ShowLegend(); + +// Make the isobar lines slightly thicker +$cp->SetLineWeight(2); +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contourex02.php b/includes/jpgraph/src/Examples/contourex02.php new file mode 100644 index 0000000..73dee15 --- /dev/null +++ b/includes/jpgraph/src/Examples/contourex02.php @@ -0,0 +1,42 @@ +SetMargin(40,140,60,40); + +$graph->title->Set("Example of contour plot"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// For contour plots it is custom to use a box style ofr the axis +$graph->legend->SetPos(0.05,0.5,'right','center'); +$graph->SetScale('intint'); +$graph->SetAxisStyle(AXSTYLE_BOXOUT); +$graph->xgrid->Show(); +$graph->ygrid->Show(); + + +// A simple contour plot with 12 isobar lines and flipped Y-coordinates +$cp = new ContourPlot($data,12,true); + +// Display the legend +$cp->ShowLegend(); + +// Make the isobar lines slightly thicker +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contourex03.php b/includes/jpgraph/src/Examples/contourex03.php new file mode 100644 index 0000000..ea43081 --- /dev/null +++ b/includes/jpgraph/src/Examples/contourex03.php @@ -0,0 +1,51 @@ +SetMargin(40,140,60,40); + +// Enable antialias. Note with antiaaliasing only line weight=1 is supported. +$graph->img->SetAntiAliasing(); + +$graph->title->Set("Example of contour plot"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// For contour plots it is custom to use a box style ofr the axis +$graph->legend->SetPos(0.05,0.5,'right','center'); +$graph->SetScale('intint'); +$graph->SetAxisStyle(AXSTYLE_BOXOUT); +$graph->xgrid->Show(); +$graph->ygrid->Show(); + + +// A simple contour plot with 19 isobars and flipped vertical range +$cp = new ContourPlot($data,10,true); + +// Display the legend +$cp->ShowLegend(); + +// Invert the legend to th lowest isobar is on top +$cp->Invertlegend(); +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contourex04.php b/includes/jpgraph/src/Examples/contourex04.php new file mode 100644 index 0000000..d37f13b --- /dev/null +++ b/includes/jpgraph/src/Examples/contourex04.php @@ -0,0 +1,50 @@ +SetMargin(40,140,60,40); + +$graph->title->Set("Example of interpolated contour plot"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->title->SetMargin(10); + +// For contour plots it is custom to use a box style ofr the axis +$graph->legend->SetPos(0.05,0.5,'right','center'); +$graph->SetScale('intint'); + +// Setup axis and grids +$graph->SetAxisStyle(AXSTYLE_BOXOUT); +$graph->xgrid->SetLineStyle('dashed'); +$graph->xgrid->Show(true); +$graph->ygrid->SetLineStyle('dashed'); +$graph->ygrid->Show(true); + +// A simple contour plot with 10 isobar lines and flipped Y-coordinates +// Make the data smoother by interpolate the original matrice by a factor of two +// which will make each grid cell half the original size +$cp = new ContourPlot($data,10, 2); + +$cp->UseHighContrastColor(true); + +// Display the legend +$cp->ShowLegend(); + +// Make the isobar lines slightly thicker +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/contourex05.php b/includes/jpgraph/src/Examples/contourex05.php new file mode 100644 index 0000000..4af9ca8 --- /dev/null +++ b/includes/jpgraph/src/Examples/contourex05.php @@ -0,0 +1,59 @@ +SetMargin(40,120,60,50); + +$graph->title->Set("Contour plot, high contrast color"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->SetMargin(10); + +// For contour plots it is custom to use a box style ofr the axis +$graph->SetScale('intint',0,56,0,56); + +// Setup axis and grids +$graph->SetAxisStyle(AXSTYLE_BOXOUT); +$graph->xgrid->Show(true); +$graph->ygrid->Show(true); + +// A simple contour plot with 10 isobar lines and flipped Y-coordinates +// Make the data smoother by interpolate the original matrice by a factor of two +// which will make each grid cell half the original size +$cp = new ContourPlot($data,10, 3); + +$cp->UseHighContrastColor(true); + +// Display the legend +$cp->ShowLegend(); + +// Make the isobar lines slightly thicker +$graph->Add($cp); + +// ... and send the graph back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/csim_in_html_ex1.php b/includes/jpgraph/src/Examples/csim_in_html_ex1.php new file mode 100644 index 0000000..2c08e09 --- /dev/null +++ b/includes/jpgraph/src/Examples/csim_in_html_ex1.php @@ -0,0 +1,61 @@ + + + +GetHTMLImageMap($_mapname); +echo $imgmap; + +?> + +

This is an example page with CSIM graphs with arbitrary HTML text

+ +Clicked on bar: <none>'; +} +else { + echo 'Clicked on bar: '.$_GET['clickedon'].''; +} +echo '

'; +?> + +

First we need to get hold of the image map and include it in the HTML + page.

+

For this graph it is:

+'.htmlentities($imgmap).'';?> + + tag and rebuild the +$imgtag = $graph->GetCSIMImgHTML($_mapname,$_graphfilename); +?> +

The graph is then be displayed as shown in figure 1. With the following + created <img> tag:

+

+
+
+ + +

+ +
Figure 1. The included CSIM graph. +

+ + + diff --git a/includes/jpgraph/src/Examples/csim_in_html_ex2.php b/includes/jpgraph/src/Examples/csim_in_html_ex2.php new file mode 100644 index 0000000..c94bda3 --- /dev/null +++ b/includes/jpgraph/src/Examples/csim_in_html_ex2.php @@ -0,0 +1,100 @@ + + + +GetHTMLImageMap($_mapname1); +$imgmap2 = $piegraph->GetHTMLImageMap($_mapname2); +echo $imgmap1; +echo $imgmap2; + +?> + +

This is an example page with CSIM graphs with arbitrary HTML text

+ +Clicked on bar: <none>'; +} +else { + echo 'Clicked on bar: '.$_GET['clickedon'].''; +} +echo '

'; +if( empty($_GET['pie_clickedon']) ) { + echo 'Clicked on pie slice: <none>'; +} +else { + echo 'Clicked on pie slice: '.$_GET['pie_clickedon'].''; +} +echo '

'; +?> + +

First we need to get hold of the image maps and include them in the HTML + page.

+

For these graphs the maps are:

+
'.htmlentities($imgmap1).'
'; +?> +

+and +

+
'.htmlentities($imgmap2).'
'; +?> + + tags for Figure 1 & 2 and rebuild the URL arguments +$imgtag1 = $graph->GetCSIMImgHTML($_mapname1,$_graphfilename1); +$imgtag2 = $piegraph->GetCSIMImgHTML($_mapname2,$_graphfilename2); +?> +

The graphs are then displayed as shown in figure 1 & 2. With the following + created <img> tags:

+
+
+
+ +

+Note: For the Pie the center is counted as the first slice. +

+ +

+ + + + +
+ +
Figure 1. The included Bar CSIM graph. +

+
+ +
Figure 2. The included Pie CSIM graph. +

+
+ + diff --git a/includes/jpgraph/src/Examples/csim_in_html_graph_ex1.php b/includes/jpgraph/src/Examples/csim_in_html_graph_ex1.php new file mode 100644 index 0000000..b734c86 --- /dev/null +++ b/includes/jpgraph/src/Examples/csim_in_html_graph_ex1.php @@ -0,0 +1,46 @@ +SetScale('textlin'); +$graph->SetMargin(50,80,20,40); + +// Create a bar pot +$bplot = new BarPlot($datay); + +$n = count($datay) ; // Number of bars + +global $_wrapperfilename; + +// Create targets for the image maps. One for each column +$targ = array(); $alt = array(); $wtarg = array(); +for( $i=0; $i < $n; ++$i ) { + $urlarg = 'clickedon='.($i+1); + $targ[] = $_wrapperfilename.'?'.$urlarg; + $alt[] = 'val=%d'; + $wtarg[] = ''; +} +$bplot->SetCSIMTargets($targ,$alt,$wtarg); + +$graph->Add($bplot); + +$graph->title->Set('Multiple Image maps'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->title->SetCSIMTarget('#45','Title for Bar','_blank'); + +$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->title->SetCSIMTarget('#55','Y-axis title'); +$graph->yaxis->title->Set("Y-title"); + +$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); +$graph->xaxis->title->SetCSIMTarget('#55','X-axis title'); +$graph->xaxis->title->Set("X-title"); + +// Send back the image when we are called from within the tag +$graph->StrokeCSIMImage(); + +?> diff --git a/includes/jpgraph/src/Examples/csim_in_html_graph_ex2.php b/includes/jpgraph/src/Examples/csim_in_html_graph_ex2.php new file mode 100644 index 0000000..8c59c0c --- /dev/null +++ b/includes/jpgraph/src/Examples/csim_in_html_graph_ex2.php @@ -0,0 +1,75 @@ +SetFrame(false); + +// Setup title +$piegraph->title->Set("CSIM Center Pie plot"); +$piegraph->title->SetFont(FF_ARIAL,FS_BOLD,18); +$piegraph->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); + +// Label font and color setup +$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); +$p1->value->SetColor('white'); + +// Setup the title on the center circle +$p1->midtitle->Set("Distribution\n2008 H1"); +$p1->midtitle->SetFont(FF_ARIAL,FS_NORMAL,12); + +// 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("Jan\n%.1f%%","Feb\n%.1f%%","March\n%.1f%%", + "Apr\n%.1f%%","May\n%.1f%%","Jun\n%.1f%%"); +$p1->SetLabels($lbl); + +// Add drop shadow to slices +$p1->SetShadow(); + +// Explode all slices 15 pixels +$p1->ExplodeAll(15); + +// Setup the CSIM targets +global $_wrapperfilename; +$targ = array(); $alt = array(); $wtarg = array(); +for( $i=0; $i <= $n; ++$i ) { + $urlarg = 'pie_clickedon='.($i+1); + $targ[] = $_wrapperfilename.'?'.$urlarg; + $alt[] = 'val=%d'; + $wtarg[] = ''; +} +$p1->SetCSIMTargets($targ,$alt,$wtarg); +$p1->SetMidCSIM($targ[0],$alt[0],$wtarg[0]); + +// Add plot to pie graph +$piegraph->Add($p1); + +// Send back the image when we are called from within the tag +$piegraph->StrokeCSIMImage(); + +?> + + diff --git a/includes/jpgraph/src/Examples/datamatrix_ex0.php b/includes/jpgraph/src/Examples/datamatrix_ex0.php new file mode 100644 index 0000000..8de2522 --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex0.php @@ -0,0 +1,18 @@ +SetEncoding(ENCODING_ASCII); +$backend = DatamatrixBackendFactory::Create($encoder); + +// We increase the module width to 3 pixels +$backend->SetModuleWidth(3); + +try { + $backend->Stroke($data); +} catch (Exception $e) { + echo 'Datamatrix error: '.$e->GetMessage()."\n"; + exit(1); +} +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex00.php b/includes/jpgraph/src/Examples/datamatrix_ex00.php new file mode 100644 index 0000000..1aec89f --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex00.php @@ -0,0 +1,9 @@ +Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex1.php b/includes/jpgraph/src/Examples/datamatrix_ex1.php new file mode 100644 index 0000000..a2e7358 --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex1.php @@ -0,0 +1,18 @@ +SetModuleWidth(3); + +// Create the barcode from the given data string and write to output file +try { + $backend->Stroke($data); +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo "Datamatrix error message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex2.php b/includes/jpgraph/src/Examples/datamatrix_ex2.php new file mode 100644 index 0000000..e7c9462 --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex2.php @@ -0,0 +1,21 @@ +SetEncoding(ENCODING_BASE256); + +// Create the image backend (default) +$backend = DatamatrixBackendFactory::Create($encoder); +$backend->SetModuleWidth(3); + +try { + $backend->Stroke($data); +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo "Datamatrix error message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex3.php b/includes/jpgraph/src/Examples/datamatrix_ex3.php new file mode 100644 index 0000000..6b6b827 --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex3.php @@ -0,0 +1,21 @@ +SetEncoding(ENCODING_BASE256); + +// Create the image backend (default) +$backend = DatamatrixBackendFactory::Create($encoder); +$backend->SetModuleWidth(3); + +try { + $backend->Stroke($data); +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo "Datamatrix error message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex4.php b/includes/jpgraph/src/Examples/datamatrix_ex4.php new file mode 100644 index 0000000..77b3667 --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex4.php @@ -0,0 +1,25 @@ +SetEncoding(ENCODING_TEXT); + +// Create the image backend (default) +$backend = DatamatrixBackendFactory::Create($encoder); +$backend->SetModuleWidth(3); + +// Adjust the Quiet zone +$backend->SetQuietZone(10); + +// Create the barcode from the given data string and write to output file +try { + $backend->Stroke($data); +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo "Datamatrix error message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex5.php b/includes/jpgraph/src/Examples/datamatrix_ex5.php new file mode 100644 index 0000000..9242252 --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex5.php @@ -0,0 +1,30 @@ +SetEncoding(ENCODING_TEXT); + +// Create the image backend (default) +$backend = DatamatrixBackendFactory::Create($encoder); + +// By default the module width is 2 pixel so we increase it a bit +$backend->SetModuleWidth(4); + +// Set Quiet zone +$backend->SetQuietZone(10); + +// Set other than default colors (one, zero, quiet zone/background) +$backend->SetColor('navy','white','lightgray'); + +// Create the barcode from the given data string and write to output file +try { + $backend->Stroke($data); +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo "Datamatrix error message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex6.php b/includes/jpgraph/src/Examples/datamatrix_ex6.php new file mode 100644 index 0000000..918bc4b --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex6.php @@ -0,0 +1,33 @@ +SetEncoding(ENCODING_TEXT); + +// Create the image backend (default) +$backend = DatamatrixBackendFactory::Create($encoder); +$backend->SetModuleWidth(5); +$backend->SetQuietZone(10); + +// Set other than default colors (one, zero, background) +$backend->SetColor('navy','white'); + +// Create the barcode from the given data string and write to output file +$dir = dirname(__FILE__); +$file = '"'.$dir.'/'.$outputfile.'"'; +try { + $backend->Stroke($data,$outputfile); + echo 'Barcode sucessfully written to file: '.$file; +} catch (Exception $e) { + $errstr = $e->GetMessage(); + $errcode = $e->GetCode(); + echo "Failed writing file: ".$file.'
'; + echo "Datamatrix error ($errcode). Message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/datamatrix_ex7.php b/includes/jpgraph/src/Examples/datamatrix_ex7.php new file mode 100644 index 0000000..a27d42c --- /dev/null +++ b/includes/jpgraph/src/Examples/datamatrix_ex7.php @@ -0,0 +1,22 @@ +SetEncoding(ENCODING_BASE256); + +// Create the image backend (default) +$backend = DatamatrixBackendFactory::Create($encoder, BACKEND_ASCII); +$backend->SetModuleWidth(3); + +try { + $ps_txt = $backend->Stroke($data); + echo '

'.$ps_txt.'
'; +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo "Datamatrix error message: $errstr\n"; +} + +?> diff --git a/includes/jpgraph/src/Examples/dataset01.inc.php b/includes/jpgraph/src/Examples/dataset01.inc.php new file mode 100644 index 0000000..6ac7f2b --- /dev/null +++ b/includes/jpgraph/src/Examples/dataset01.inc.php @@ -0,0 +1,275 @@ + 1.0885908919277, 1 => + 0.99034385297982, 2 => 0.97005467188578, 3 => + 0.99901201350824, 4 => 1.1263167971152, 5 => + 1.0582808133448, 6 => 1.0216740689064, 7 => + 0.96626236356644, 8 => 1.0125912828768, 9 => + 0.99047473992496, 10 => 0.99102472104561, 11 => + 0.98500781573283, 12 => 0.91933668914198, 13 => + 0.92234602792711, 14 => 0.88933863410054, 15 => + 0.94236150975178, 16 => 0.98924287679116, 17 => + 1.0342765545566, 18 => 1.0538510278089, 19 => + 0.93496076181191, 20 => 0.90944479677235, 21 => + 0.80831866316983, 22 => 0.81912434615535, 23 => + 0.83143770042109, 24 => 0.86972168159496, 25 => + 0.92645774571577, 26 => 0.81169120061422, 27 => + 0.84409853057606, 28 => 0.89065856249272, 29 => + 0.83551478929348, 30 => 0.87015680306726, 31 => + 0.76063327042172, 32 => 0.82720958380697, 33 => + 0.86565279505723, 34 => 0.77858966246836, 35 => + 0.81009606378237, 36 => 0.80485136798149, 37 => + 0.82641461943804, 38 => 0.87442020676513, 39 => + 0.89589150146825, 40 => 0.92082995956816, 41 => + 0.92614241931726, 42 => 0.96915564652581, 43 => + 1.003753706293, 44 => 0.97438809368023, 45 => + 1.011556766867, 46 => 1.0785692014115, 47 => + 1.0586915420364, 48 => 1.284210059027, 49 => + 1.3424512661794, 50 => 1.1743365450983, 51 => + 1.2387345559532, 52 => 1.2485728609648, 53 => + 1.2330096418558, 54 => 1.1857882621709, 55 => + 1.2344956522411, 56 => 1.2047675730648, 57 => + 1.292419000136, 58 => 1.3405480219013, 59 => + 1.3971752198648, 60 => 1.4359555309649, 61 => + 1.3243735045701, 62 => 1.2359389187087, 63 => + 1.2201320423161, 64 => 1.3602246705197, 65 => + 1.360886940568, 66 => 1.3493553211075, 67 => + 1.4401769929405, 68 => 1.3979767849951, 69 => + 1.4545882591647, 70 => 1.337801210539, 71 => + 1.3793601365977, 72 => 1.4586769476223, 73 => + 1.5230946076475, 74 => 1.4124735946125, 75 => + 1.4030318592551, 76 => 1.349158816711, 77 => + 1.3994840622105, 78 => 1.4239672612346, 79 => + 1.40812256221, 80 => 1.4583856197192, 81 => + 1.4613314581567, 82 => 1.6756755916668, 83 => + 1.8580313939158, 84 => 1.8342360959805, 85 => + 1.9216082598086, 86 => 1.9478846253628, 87 => + 2.0244872112436, 88 => 1.9560660777181, 89 => + 1.8415152640121, 90 => 1.8471764273372, 91 => + 1.8889886695023, 92 => 1.8195007209252, 93 => + 1.8960270595999, 94 => 1.8644490575386, 95 => + 1.971196340772, 96 => 2.015583152659, 97 => + 1.9959882430428, 98 => 2.1063668082622, 99 => + 2.1719175769191, 100 => 2.1875938345039, 101 => + 2.1587594039981, 102 => 2.1278241823627, 103 => + 2.298793912594, 104 => 2.3723774302753, 105 => + 2.4413392788904, 106 => 2.4834594954125, 107 => + 2.5164271989421, 108 => 2.48274719503, 109 => + 2.4492997581034, 110 => 2.1412357263019, 111 => + 2.0314268112566, 112 => 1.9596098764628, 113 => + 2.0250983127109, 114 => 1.924959829851, 115 => + 1.9603612943993, 116 => 2.0540576271866, 117 => + 2.0568349960689, 118 => 2.0811524692325, 119 => + 2.0581964759165, 120 => 2.020162840272, 121 => + 2.0626517638667, 122 => 1.9286563823225, 123 => + 2.0127912437563, 124 => 1.9491858277931, 125 => + 1.8692310150316, 126 => 1.6993275416762, 127 => + 1.5849680675709, 128 => 1.5422481968304, 129 => + 1.603188853916, 130 => 1.6449504349551, 131 => + 1.6570332084417, 132 => 1.7563884552262, 133 => + 1.7346008663135, 134 => 1.741307942998, 135 => + 1.7415848536123, 136 => 1.7014366147405, 137 => + 1.6719646364256, 138 => 1.7092888030342, 139 => + 1.7371529028402, 140 => 1.7019154041991, 141 => + 1.7662473702497, 142 => 1.8480766044197, 143 => + 1.8355114169662, 144 => 1.7819817315586, 145 => + 1.7148079481036, 146 => 1.6241989833489, 147 => + 1.4624626548138, 148 => 1.5040542012939, 149 => + 1.442295346913, 150 => 1.4187087000604, 151 => + 1.4225097958511, 152 => 1.5001324671865, 153 => + 1.4584802723727, 154 => 1.5342572961469, 155 => + 1.514133174734, 156 => 1.5443934302345, 157 => + 1.5476883863698, 158 => 1.6080128685721, 159 => + 1.5816649899396, 160 => 1.5310436755918, 161 => + 1.518280754595, 162 => 1.5216184249044, 163 => + 1.4393414811719, 164 => 1.409379582707, 165 => + 1.436861898056, 166 => 1.4739894373751, 167 => + 1.4512785421546, 168 => 1.496057581316, 169 => + 1.3817455776456, 170 => 1.2990312802211, 171 => + 1.3073949130374, 172 => 1.2473214566896, 173 => + 1.1105915111374, 174 => 1.0420360580822, 175 => + 1.1744654786356, 176 => 1.0602876800127, 177 => + 1.074408841208, 178 => 1.18387615056, 179 => + 1.1890999077101, 180 => 1.0549293038746, 181 => + 1.0570601708416, 182 => 1.0800216692849, 183 => + 0.96274117702549, 184 => 0.9501673977047, 185 => + 0.97710108451711, 186 => 0.89886322996001, 187 => + 0.9239453369566, 188 => 0.96299807255386, 189 => + 1.0105532418267, 190 => 1.0164009465948, 191 => + 1.0413107606824, 192 => 1.0475248122459, 193 => + 1.0266007451985, 194 => 1.0159556206533, 195 => + 1.0943852922517, 196 => 1.0750418553654, 197 => + 0.97774129938915, 198 => 0.98590717162284, 199 => + 0.87713795242119, 200 => 0.90770624057599, 201 => + 0.87557547650302, 202 => 0.95754187545856, 203 => + 1.0111465867283, 204 => 0.93224663470275, 205 => + 0.93886113881632, 206 => 0.94128877256653, 207 => + 0.9559086414866, 208 => 0.97782683000598, 209 => + 1.0648991708916, 210 => 1.1759619281479, 211 => + 1.1323001889786, 212 => 1.2173222321276, 213 => + 1.192219780365, 214 => 1.1507367671992, 215 => + 1.0062415877475, 216 => 1.0017043563084, 217 => + 0.94468309902865, 218 => 0.99384124056529, 219 => + 1.0514822705943, 220 => 1.0451723914426, 221 => + 1.0776122119814, 222 => 1.2013601009631, 223 => + 1.1765086398423, 224 => 1.2387735028784, 225 => + 1.2441365026242, 226 => 1.2694500268723, 227 => + 1.2789962941485, 228 => 1.2442094256309, 229 => + 1.2352688438234, 230 => 1.2571277155372, 231 => + 1.3291795377077, 232 => 1.2703480599183, 233 => + 1.30729508393, 234 => 1.3233030218068, 235 => + 1.2861232143244, 236 => 1.3168684998023, 237 => + 1.2499001566772, 238 => 1.2622769692485, 239 => + 1.2160789893735, 240 => 1.2288877111321, 241 => + 1.222967255453, 242 => 1.2998243638567, 243 => + 1.3443008723449, 244 => 1.339680674028, 245 => + 1.3779965791538, 246 => 1.3560080691721, 247 => + 1.3470544172094, 248 => 1.3166882067851, 249 => + 1.4452459865932, 250 => 1.4514278120119, 251 => + 1.413690283372, 252 => 1.4178934332405, 253 => + 1.4237414657565, 254 => 1.3777636409301, 255 => + 1.4041849448389, 256 => 1.4049533546771, 257 => + 1.4277375831259, 258 => 1.4224090113077, 259 => + 1.4647907974628, 260 => 1.4243190632657, 261 => + 1.4286580133998, 262 => 1.4348828641501, 263 => + 1.415409243977, 264 => 1.4476028555859, 265 => + 1.4538821661641, 266 => 1.4883184435336, 267 => + 1.4205032194634, 268 => 1.3856543933372, 269 => + 1.2716906168086, 270 => 1.3462117624752, 271 => + 1.3003015423298, 272 => 1.2148491725878, 273 => + 1.2605381058318, 274 => 1.2690047369619, 275 => + 1.3327723638582, 276 => 1.3118643588249, 277 => + 1.293007944258, 278 => 1.2548761810876, 279 => + 1.3335015938603, 280 => 1.3152744239077, 281 => + 1.2564376463182, 282 => 1.2478417859372, 283 => + 1.2518821298414, 284 => 1.2036453589032, 285 => + 1.1798564480155, 286 => 1.2062515260098, 287 => + 1.2129817801455, 288 => 1.1405762096618, 289 => + 1.0161049810033, 290 => 1.0030124197677, 291 => + 1.0111565082559, 292 => 1.0084286839061, 293 => + 0.95068297130577, 294 => 1.0450005357207, 295 => + 1.211596899292, 296 => 1.3762615912002, 297 => + 1.530127116787, 298 => 1.5167370832585, 299 => + 1.6259521507076, 300 => 1.6518467383405, 301 => + 1.7713043850286, 302 => 1.6396708687084, 303 => + 1.6116177484122, 304 => 1.5225729470695, 305 => + 1.6101471149808); + + +$xdata = array( + + 0 => 444348000, 1 => 446853600, 2 => + 449532000, 3 => 452124000, 4 => 454802400, 5 => + 457394400, 6 => 460072800, 7 => 462751200, 8 => + 465343200, 9 => 468021600, 10 => 470613600, 11 => + 473292000, 12 => 475970400, 13 => 478389600, 14 => + 481068000, 15 => 483660000, 16 => 486338400, 17 => + 488930400, 18 => 491608800, 19 => 494287200, 20 => + 496879200, 21 => 499557600, 22 => 502149600, 23 => + 504828000, 24 => 507506400, 25 => 509925600, 26 => + 512604000, 27 => 515196000, 28 => 517874400, 29 => + 520466400, 30 => 523144800, 31 => 525823200, 32 => + 528415200, 33 => 531093600, 34 => 533685600, 35 => + 536364000, 36 => 539042400, 37 => 541461600, 38 => + 544140000, 39 => 546732000, 40 => 549410400, 41 => + 552002400, 42 => 554680800, 43 => 557359200, 44 => + 559951200, 45 => 562629600, 46 => 565221600, 47 => + 567900000, 48 => 570578400, 49 => 573084000, 50 => + 575762400, 51 => 578354400, 52 => 581032800, 53 => + 583624800, 54 => 586303200, 55 => 588981600, 56 => + 591573600, 57 => 594252000, 58 => 596844000, 59 => + 599522400, 60 => 602200800, 61 => 604620000, 62 => + 607298400, 63 => 609890400, 64 => 612568800, 65 => + 615160800, 66 => 617839200, 67 => 620517600, 68 => + 623109600, 69 => 625788000, 70 => 628380000, 71 => + 631058400, 72 => 633736800, 73 => 636156000, 74 => + 638834400, 75 => 641426400, 76 => 644104800, 77 => + 646696800, 78 => 649375200, 79 => 652053600, 80 => + 654645600, 81 => 657324000, 82 => 659916000, 83 => + 662594400, 84 => 665272800, 85 => 667692000, 86 => + 670370400, 87 => 672962400, 88 => 675640800, 89 => + 678232800, 90 => 680911200, 91 => 683589600, 92 => + 686181600, 93 => 688860000, 94 => 691452000, 95 => + 694130400, 96 => 696808800, 97 => 699314400, 98 => + 701992800, 99 => 704584800, 100 => 707263200, 101 => + 709855200, 102 => 712533600, 103 => 715212000, 104 => + 717804000, 105 => 720482400, 106 => 723074400, 107 => + 725752800, 108 => 728431200, 109 => 730850400, 110 => + 733528800, 111 => 736120800, 112 => 738799200, 113 => + 741391200, 114 => 744069600, 115 => 746748000, 116 => + 749340000, 117 => 752018400, 118 => 754610400, 119 => + 757288800, 120 => 759967200, 121 => 762386400, 122 => + 765064800, 123 => 767656800, 124 => 770335200, 125 => + 772927200, 126 => 775605600, 127 => 778284000, 128 => + 780876000, 129 => 783554400, 130 => 786146400, 131 => + 788824800, 132 => 791503200, 133 => 793922400, 134 => + 796600800, 135 => 799192800, 136 => 801871200, 137 => + 804463200, 138 => 807141600, 139 => 809820000, 140 => + 812412000, 141 => 815090400, 142 => 817682400, 143 => + 820360800, 144 => 823039200, 145 => 825544800, 146 => + 828223200, 147 => 830815200, 148 => 833493600, 149 => + 836085600, 150 => 838764000, 151 => 841442400, 152 => + 844034400, 153 => 846712800, 154 => 849304800, 155 => + 851983200, 156 => 854661600, 157 => 857080800, 158 => + 859759200, 159 => 862351200, 160 => 865029600, 161 => + 867621600, 162 => 870300000, 163 => 872978400, 164 => + 875570400, 165 => 878248800, 166 => 880840800, 167 => + 883519200, 168 => 886197600, 169 => 888616800, 170 => + 891295200, 171 => 893887200, 172 => 896565600, 173 => + 899157600, 174 => 901836000, 175 => 904514400, 176 => + 907106400, 177 => 909784800, 178 => 912376800, 179 => + 915055200, 180 => 917733600, 181 => 920152800, 182 => + 922831200, 183 => 925423200, 184 => 928101600, 185 => + 930693600, 186 => 933372000, 187 => 936050400, 188 => + 938642400, 189 => 941320800, 190 => 943912800, 191 => + 946591200, 192 => 949269600, 193 => 951775200, 194 => + 954453600, 195 => 957045600, 196 => 959724000, 197 => + 962316000, 198 => 964994400, 199 => 967672800, 200 => + 970264800, 201 => 972943200, 202 => 975535200, 203 => + 978213600, 204 => 980892000, 205 => 983311200, 206 => + 985989600, 207 => 988581600, 208 => 991260000, 209 => + 993852000, 210 => 996530400, 211 => 999208800, 212 => + 1001800800, 213 => 1004479200, 214 => 1007071200, + 215 => 1009749600, 216 => 1012428000, 217 => + 1014847200, 218 => 1017525600, 219 => 1020117600, + 220 => 1022796000, 221 => 1025388000, 222 => + 1028066400, 223 => 1030744800, 224 => 1033336800, + 225 => 1036015200, 226 => 1038607200, 227 => + 1041285600, 228 => 1043964000, 229 => 1046383200, + 230 => 1049061600, 231 => 1051653600, 232 => + 1054332000, 233 => 1056924000, 234 => 1059602400, + 235 => 1062280800, 236 => 1064872800, 237 => + 1067551200, 238 => 1070143200, 239 => 1072821600, + 240 => 1075500000, 241 => 1078005600, 242 => + 1080684000, 243 => 1083276000, 244 => 1085954400, + 245 => 1088546400, 246 => 1091224800, 247 => + 1093903200, 248 => 1096495200, 249 => 1099173600, + 250 => 1101765600, 251 => 1104444000, 252 => + 1107122400, 253 => 1109541600, 254 => 1112220000, + 255 => 1114812000, 256 => 1117490400, 257 => + 1120082400, 258 => 1122760800, 259 => 1125439200, + 260 => 1128031200, 261 => 1130709600, 262 => + 1133301600, 263 => 1135980000, 264 => 1138658400, + 265 => 1141077600, 266 => 1143756000, 267 => + 1146348000, 268 => 1149026400, 269 => 1151618400, + 270 => 1154296800, 271 => 1156975200, 272 => + 1159567200, 273 => 1162245600, 274 => 1164837600, + 275 => 1167516000, 276 => 1170194400, 277 => + 1172613600, 278 => 1175292000, 279 => 1177884000, + 280 => 1180562400, 281 => 1183154400, 282 => + 1185832800, 283 => 1188511200, 284 => 1191103200, + 285 => 1193781600, 286 => 1196373600, 287 => + 1199052000, 288 => 1201730400, 289 => 1204236000, + 290 => 1206914400, 291 => 1209506400, 292 => + 1212184800, 293 => 1214776800, 294 => 1217455200, + 295 => 1220133600, 296 => 1222725600, 297 => + 1225404000, 298 => 1227996000, 299 => 1230674400, + 300 => 1233352800, 301 => 1235772000, 302 => + 1238450400, 303 => 1241042400, 304 => 1243720800, + 305 => 1246312800, + ); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/dateaxisex1.php b/includes/jpgraph/src/Examples/dateaxisex1.php new file mode 100644 index 0000000..58e4348 --- /dev/null +++ b/includes/jpgraph/src/Examples/dateaxisex1.php @@ -0,0 +1,55 @@ +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(); +?> + + diff --git a/includes/jpgraph/src/Examples/dateaxisex2.php b/includes/jpgraph/src/Examples/dateaxisex2.php new file mode 100644 index 0000000..c0a306c --- /dev/null +++ b/includes/jpgraph/src/Examples/dateaxisex2.php @@ -0,0 +1,38 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/dateaxisex3.php b/includes/jpgraph/src/Examples/dateaxisex3.php new file mode 100644 index 0000000..02db7cc --- /dev/null +++ b/includes/jpgraph/src/Examples/dateaxisex3.php @@ -0,0 +1,48 @@ +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); + +// It is possible to adjust the density for the X-axis as well +// The following call makes the dates a little more sparse +// $graph->SetTickDensity(TICKD_NORMAL,TICKD_SPARSE); + +// 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_15); + +$line = new LinePlot($data,$xdata); +$line->SetLegend('Year 2005'); +$line->SetFillColor('lightblue@0.5'); +$graph->Add($line); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/dateaxisex4.php b/includes/jpgraph/src/Examples/dateaxisex4.php new file mode 100644 index 0000000..dab6cd6 --- /dev/null +++ b/includes/jpgraph/src/Examples/dateaxisex4.php @@ -0,0 +1,44 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/datescaleticksex01.php b/includes/jpgraph/src/Examples/datescaleticksex01.php new file mode 100644 index 0000000..5bdcbe5 --- /dev/null +++ b/includes/jpgraph/src/Examples/datescaleticksex01.php @@ -0,0 +1,63 @@ +SetMargin(80,30,50,40); +$graph->SetMarginColor('white'); +$graph->SetScale('dateint'); +$graph->title->Set('Current Bids'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->subtitle->Set('(Updated every 5 minutes)'); +$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10); + +// Enable antialias +$graph->img->SetAntiAliasing(); + +// Setup the y-axis to show currency values +$graph->yaxis->SetLabelFormatCallback('number_format'); +$graph->yaxis->SetLabelFormat('$%s'); + +//Use hour:minute format for the labels +$graph->xaxis->scale->SetDateFormat('H:i'); + +// Force labels to only be displayed every 5 minutes +$graph->xaxis->scale->ticks->Set(INTERVAL); + +// Adjust the start time for an "even" 5 minute, i.e. 5,10,15,20,25, ... +$graph->xaxis->scale->SetTimeAlign(MINADJ_5); + +// Create the plots using the dummy data created at the beginning +$line = array(); +for( $i=0; $i < $m; ++$i ) { + $line[$i] = new LinePlot($bids[$i],$times); + $line[$i]->mark->SetType(MARK_SQUARE); +} +$graph->Add($line); + +// Send the graph back to the client +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/dateutilex01.php b/includes/jpgraph/src/Examples/dateutilex01.php new file mode 100644 index 0000000..75f0d33 --- /dev/null +++ b/includes/jpgraph/src/Examples/dateutilex01.php @@ -0,0 +1,53 @@ +SetScale('intlin',0,0,min($xdata),max($xdata)); +$graph->SetMargin(60,20,40,60); + +// Setup the titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Development since 1984'); +$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10); +$graph->subtitle->Set('(Example using DateScaleUtils class)'); + +// Setup the labels to be correctly format on the X-axis +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); +$graph->xaxis->SetLabelAngle(30); + +// The second paramter set to 'true' will make the library interpret the +// format string as a date format. We use a Month + Year format +$graph->xaxis->SetLabelFormatString('M, Y',true); + +// Get manual tick every second year +list($tickPos,$minTickPos) = $dateUtils->getTicks($xdata,DSUTILS_YEAR2); +$graph->xaxis->SetTickPositions($tickPos,$minTickPos); + +// First add an area plot +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetWeight(0); +$lp1->SetFillColor('orange@0.85'); +$graph->Add($lp1); + +// And then add line. We use two plots in order to get a +// more distinct border on the graph +$lp2 = new LinePlot($ydata,$xdata); +$lp2->SetColor('orange'); +$graph->Add($lp2); + +// And send back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/dateutilex02.php b/includes/jpgraph/src/Examples/dateutilex02.php new file mode 100644 index 0000000..f95db47 --- /dev/null +++ b/includes/jpgraph/src/Examples/dateutilex02.php @@ -0,0 +1,47 @@ +SetScale('datlin'); +$graph->SetMargin(60,20,40,60); + +// Setup the titles +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('Development since 1984'); +$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10); +$graph->subtitle->Set('(Example using the builtin date scale)'); + +// Setup the labels to be correctly format on the X-axis +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); +$graph->xaxis->SetLabelAngle(30); + +// The second paramter set to 'true' will make the library interpret the +// format string as a date format. We use a Month + Year format +// $graph->xaxis->SetLabelFormatString('M, Y',true); + +// First add an area plot +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetWeight(0); +$lp1->SetFillColor('orange@0.85'); +$graph->Add($lp1); + +// And then add line. We use two plots in order to get a +// more distinct border on the graph +$lp2 = new LinePlot($ydata,$xdata); +$lp2->SetColor('orange'); +$graph->Add($lp2); + +// And send back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/dm_ex6.png b/includes/jpgraph/src/Examples/dm_ex6.png new file mode 100644 index 0000000..b389990 Binary files /dev/null and b/includes/jpgraph/src/Examples/dm_ex6.png differ diff --git a/includes/jpgraph/src/Examples/dupyaxisex1.php b/includes/jpgraph/src/Examples/dupyaxisex1.php new file mode 100644 index 0000000..b4b63fe --- /dev/null +++ b/includes/jpgraph/src/Examples/dupyaxisex1.php @@ -0,0 +1,31 @@ +E(-M_PI,M_PI,25); + +$graph = new Graph(300,200); +$graph->SetScale("linlin"); +$graph->SetMargin(50,50,20,30); +$graph->SetFrame(false); +$graph->SetBox(true,'black',2); +$graph->SetMarginColor('white'); +$graph->SetColor('lightyellow'); + +$graph->title->Set('Duplicating Y-axis'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->SetAxisStyle(AXSTYLE_YBOXIN); +$graph->xgrid->Show(); + +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetColor("blue"); +$lp1->SetWeight(2); +$graph->Add($lp1); + +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/example0-0.php b/includes/jpgraph/src/Examples/example0-0.php new file mode 100644 index 0000000..d281824 --- /dev/null +++ b/includes/jpgraph/src/Examples/example0-0.php @@ -0,0 +1,25 @@ +SetScale('intlin'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example0.php b/includes/jpgraph/src/Examples/example0.php new file mode 100644 index 0000000..2667e9f --- /dev/null +++ b/includes/jpgraph/src/Examples/example0.php @@ -0,0 +1,21 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example1.1.php b/includes/jpgraph/src/Examples/example1.1.php new file mode 100644 index 0000000..e171e3b --- /dev/null +++ b/includes/jpgraph/src/Examples/example1.1.php @@ -0,0 +1,25 @@ +SetScale("textlin"); +$graph->img->SetMargin(30,90,40,50); +$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->title->Set("Example 1.1 same y-values"); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetLegend("Test 1"); +$lineplot->SetColor("blue"); +$lineplot->SetWeight(5); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example1.2.php b/includes/jpgraph/src/Examples/example1.2.php new file mode 100644 index 0000000..bbac21f --- /dev/null +++ b/includes/jpgraph/src/Examples/example1.2.php @@ -0,0 +1,29 @@ +SetScale("textlin"); +$graph->img->SetMargin(30,90,40,50); +$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->title->Set("Dashed lineplot"); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetLegend("Test 1"); +$lineplot->SetColor("blue"); + +// Style can also be specified as SetStyle([1|2|3|4]) or +// SetStyle("solid"|"dotted"|"dashed"|"lobgdashed") +$lineplot->SetStyle("dashed"); + + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example1.php b/includes/jpgraph/src/Examples/example1.php new file mode 100644 index 0000000..31437f2 --- /dev/null +++ b/includes/jpgraph/src/Examples/example1.php @@ -0,0 +1,25 @@ +SetScale("textlin"); +$graph->img->SetMargin(50,90,40,50); +$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->title->Set("Examples for graph"); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetLegend("Test 1"); +$lineplot->SetColor("blue"); + + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example10.php b/includes/jpgraph/src/Examples/example10.php new file mode 100644 index 0000000..8b9d4c6 --- /dev/null +++ b/includes/jpgraph/src/Examples/example10.php @@ -0,0 +1,59 @@ +img->SetMargin(40,110,20,40); +$graph->SetScale("textlog"); +$graph->SetY2Scale("log"); +$graph->SetShadow(); + +$graph->ygrid->Show(true,true); +$graph->xgrid->Show(true,false); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot2=new LinePlot($y2data); + +$graph->yaxis->scale->ticks->SupressFirst(); +$graph->y2axis->scale->ticks->SupressFirst(); +// 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 10"); +$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"); + +$graph->legend->Pos(0.05,0.5,"right","center"); + +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetTextTickInterval(2); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example11.php b/includes/jpgraph/src/Examples/example11.php new file mode 100644 index 0000000..898447a --- /dev/null +++ b/includes/jpgraph/src/Examples/example11.php @@ -0,0 +1,50 @@ +Push(); + +// Create the graph. These two calls are always required +$graph = new Graph(300,200); +$graph->SetScale("textlin"); + +$graph->SetMargin(40,20,20,60); + +$graph->title->Set("Timing a graph"); +$graph->footer->right->Set('Timer (ms): '); +$graph->footer->right->SetFont(FF_COURIER,FS_ITALIC); +$graph->footer->SetTimer($timer); + +// 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->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(); +?> diff --git a/includes/jpgraph/src/Examples/example13.php b/includes/jpgraph/src/Examples/example13.php new file mode 100644 index 0000000..ae0eb95 --- /dev/null +++ b/includes/jpgraph/src/Examples/example13.php @@ -0,0 +1,36 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example14.php b/includes/jpgraph/src/Examples/example14.php new file mode 100644 index 0000000..cc591cb --- /dev/null +++ b/includes/jpgraph/src/Examples/example14.php @@ -0,0 +1,37 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example15.php b/includes/jpgraph/src/Examples/example15.php new file mode 100644 index 0000000..79ebb9e --- /dev/null +++ b/includes/jpgraph/src/Examples/example15.php @@ -0,0 +1,40 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example16.1.php b/includes/jpgraph/src/Examples/example16.1.php new file mode 100644 index 0000000..edbb010 --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.1.php @@ -0,0 +1,44 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example16.2.php b/includes/jpgraph/src/Examples/example16.2.php new file mode 100644 index 0000000..649a7a9 --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.2.php @@ -0,0 +1,46 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example16.3.php b/includes/jpgraph/src/Examples/example16.3.php new file mode 100644 index 0000000..f184fa2 --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.3.php @@ -0,0 +1,45 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example16.4.php b/includes/jpgraph/src/Examples/example16.4.php new file mode 100644 index 0000000..a23c2a5 --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.4.php @@ -0,0 +1,46 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example16.5.php b/includes/jpgraph/src/Examples/example16.5.php new file mode 100644 index 0000000..bfad3ce --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.5.php @@ -0,0 +1,57 @@ +img->SetMargin(40,70,20,40); +$graph->SetScale("textlin"); +$graph->SetShadow(); +$graph->SetColor(array(250,250,250)); + +$graph->img->SetTransparent("white"); + +$t1 = new Text("This is a text"); +$t1->SetPos(0.5,0.5); +$t1->SetOrientation("h"); +$t1->SetFont(FF_FONT1,FS_BOLD); +$t1->SetBox("white","black","gray"); +$t1->SetColor("black"); +$graph->AddText($t1); + +// Create the linear error plot +$l1plot=new LinePlot($l1datay); +$l1plot->SetColor("blue"); +$l1plot->SetWeight(2); +$l1plot->SetLegend("Prediction"); + +// Create the bar plot +$l2plot = new BarPlot($l2datay); +$l2plot->SetFillColor("orange"); +$l2plot->SetLegend("Result"); + +// Add the plots to the graph +$graph->Add($l1plot); +$graph->Add($l2plot); + + +$graph->title->Set("Example 16.3"); +$graph->xaxis->title->Set("Month"); +$graph->yaxis->title->Set("x10,000 US$"); + +$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(); +?> diff --git a/includes/jpgraph/src/Examples/example16.6.php b/includes/jpgraph/src/Examples/example16.6.php new file mode 100644 index 0000000..8dac312 --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.6.php @@ -0,0 +1,59 @@ +GetStat(); +list( $xd, $yd ) = $lr->GetY(0,19); + +// Create the graph +$graph = new Graph(300,250); +$graph->SetScale('linlin'); + +// Setup title +$graph->title->Set("Linear regression"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$graph->subtitle->Set('(stderr='.sprintf('%.2f',$stderr).', corr='.sprintf('%.2f',$corr).')'); +$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,12); + +// 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($datay,$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($yd); +$lplot->SetWeight(2); +$lplot->SetColor('navy'); + +// Add the pltos to the line +$graph->Add($sp1); +$graph->Add($lplot); + +// ... and stroke +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example16.php b/includes/jpgraph/src/Examples/example16.php new file mode 100644 index 0000000..04c2427 --- /dev/null +++ b/includes/jpgraph/src/Examples/example16.php @@ -0,0 +1,44 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example17.php b/includes/jpgraph/src/Examples/example17.php new file mode 100644 index 0000000..a394ddf --- /dev/null +++ b/includes/jpgraph/src/Examples/example17.php @@ -0,0 +1,41 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example18.php b/includes/jpgraph/src/Examples/example18.php new file mode 100644 index 0000000..458219c --- /dev/null +++ b/includes/jpgraph/src/Examples/example18.php @@ -0,0 +1,32 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example19.1.php b/includes/jpgraph/src/Examples/example19.1.php new file mode 100644 index 0000000..feddf70 --- /dev/null +++ b/includes/jpgraph/src/Examples/example19.1.php @@ -0,0 +1,35 @@ +SetScale('intlin'); + +// Add a drop shadow +$graph->SetShadow(); + +// Adjust the margin a bit to make more room for titles +$graph->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 basic 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(); +?> diff --git a/includes/jpgraph/src/Examples/example19.php b/includes/jpgraph/src/Examples/example19.php new file mode 100644 index 0000000..13af5c0 --- /dev/null +++ b/includes/jpgraph/src/Examples/example19.php @@ -0,0 +1,35 @@ +SetScale('textlin'); + +// Add a drop shadow +$graph->SetShadow(); + +// Adjust the margin a bit to make more room for titles +$graph->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 basic 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(); +?> diff --git a/includes/jpgraph/src/Examples/example2.1.php b/includes/jpgraph/src/Examples/example2.1.php new file mode 100644 index 0000000..1114b1a --- /dev/null +++ b/includes/jpgraph/src/Examples/example2.1.php @@ -0,0 +1,30 @@ +SetScale("textlin"); + +// Create the linear plot +$lineplot=new LinePlot($ydata); + +$lineplot->value->Show(); +$lineplot->value->SetColor("red"); +$lineplot->value->SetFont(FF_FONT1,FS_BOLD); + + +// Add the plot to the graph +$graph->Add($lineplot); + +$graph->img->SetMargin(40,20,20,40); +$graph->title->Set("Example 2.1"); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example2.5.php b/includes/jpgraph/src/Examples/example2.5.php new file mode 100644 index 0000000..a6e5535 --- /dev/null +++ b/includes/jpgraph/src/Examples/example2.5.php @@ -0,0 +1,26 @@ +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 2.5"); +$graph->xaxis->title->Set("X-title"); +$graph->xaxis->SetPos("min"); +$graph->yaxis->title->Set("Y-title"); + + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example2.6.php b/includes/jpgraph/src/Examples/example2.6.php new file mode 100644 index 0000000..215eb4a --- /dev/null +++ b/includes/jpgraph/src/Examples/example2.6.php @@ -0,0 +1,27 @@ +SetScale("textlin"); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetStepStyle(); + +// Add the plot to the graph +$graph->Add($lineplot); + +$graph->img->SetMargin(40,20,20,40); +$graph->title->Set("Example 2.6 (Line with stepstyle)"); +$graph->xaxis->title->Set("X-title"); +$graph->xaxis->SetPos("min"); +$graph->yaxis->title->Set("Y-title"); + + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example2.php b/includes/jpgraph/src/Examples/example2.php new file mode 100644 index 0000000..ef3731e --- /dev/null +++ b/includes/jpgraph/src/Examples/example2.php @@ -0,0 +1,33 @@ +SetScale('intlin'); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + + +// Create the linear plot +$lineplot=new LinePlot($ydata); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example20.1.php b/includes/jpgraph/src/Examples/example20.1.php new file mode 100644 index 0000000..0b25144 --- /dev/null +++ b/includes/jpgraph/src/Examples/example20.1.php @@ -0,0 +1,36 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example20.2.php b/includes/jpgraph/src/Examples/example20.2.php new file mode 100644 index 0000000..b623219 --- /dev/null +++ b/includes/jpgraph/src/Examples/example20.2.php @@ -0,0 +1,37 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example20.3.php b/includes/jpgraph/src/Examples/example20.3.php new file mode 100644 index 0000000..ac2df48 --- /dev/null +++ b/includes/jpgraph/src/Examples/example20.3.php @@ -0,0 +1,40 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example20.4.php b/includes/jpgraph/src/Examples/example20.4.php new file mode 100644 index 0000000..6786efb --- /dev/null +++ b/includes/jpgraph/src/Examples/example20.4.php @@ -0,0 +1,41 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example20.5.php b/includes/jpgraph/src/Examples/example20.5.php new file mode 100644 index 0000000..a191e5a --- /dev/null +++ b/includes/jpgraph/src/Examples/example20.5.php @@ -0,0 +1,47 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example20.php b/includes/jpgraph/src/Examples/example20.php new file mode 100644 index 0000000..434860f --- /dev/null +++ b/includes/jpgraph/src/Examples/example20.php @@ -0,0 +1,36 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example21.php b/includes/jpgraph/src/Examples/example21.php new file mode 100644 index 0000000..81debb2 --- /dev/null +++ b/includes/jpgraph/src/Examples/example21.php @@ -0,0 +1,37 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example22.php b/includes/jpgraph/src/Examples/example22.php new file mode 100644 index 0000000..f5223d0 --- /dev/null +++ b/includes/jpgraph/src/Examples/example22.php @@ -0,0 +1,38 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example23.php b/includes/jpgraph/src/Examples/example23.php new file mode 100644 index 0000000..fcec9de --- /dev/null +++ b/includes/jpgraph/src/Examples/example23.php @@ -0,0 +1,39 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example24.php b/includes/jpgraph/src/Examples/example24.php new file mode 100644 index 0000000..48d48da --- /dev/null +++ b/includes/jpgraph/src/Examples/example24.php @@ -0,0 +1,46 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example25.1.php b/includes/jpgraph/src/Examples/example25.1.php new file mode 100644 index 0000000..a3afb03 --- /dev/null +++ b/includes/jpgraph/src/Examples/example25.1.php @@ -0,0 +1,40 @@ +SetScale('textlin'); + +// Add a drop shadow +$graph->SetShadow(); + +// Adjust the margin a bit to make more room for titles +$graph->img->SetMargin(40,30,40,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->SetPos(10,20); +$txt->SetColor('darkred'); +$txt->SetFont(FF_FONT2,FS_BOLD); +$txt->SetBox('yellow','navy','gray@0.5'); +$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(); +?> diff --git a/includes/jpgraph/src/Examples/example25.2.php b/includes/jpgraph/src/Examples/example25.2.php new file mode 100644 index 0000000..53f8479 --- /dev/null +++ b/includes/jpgraph/src/Examples/example25.2.php @@ -0,0 +1,41 @@ +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->SetPos(0.5,0.5,'center','center'); +$txt->SetFont(FF_FONT2,FS_BOLD); +$txt->ParagraphAlign('center'); +$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(); +?> diff --git a/includes/jpgraph/src/Examples/example25.php b/includes/jpgraph/src/Examples/example25.php new file mode 100644 index 0000000..35802ae --- /dev/null +++ b/includes/jpgraph/src/Examples/example25.php @@ -0,0 +1,39 @@ +SetScale('textlin'); + +// Add a drop shadow +$graph->SetShadow(); + +// Adjust the margin a bit to make more room for titles +$graph->img->SetMargin(40,30,40,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->SetPos(0,20); +$txt->SetColor('darkred'); +$txt->SetFont(FF_FONT2,FS_BOLD); +$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(); +?> diff --git a/includes/jpgraph/src/Examples/example26.1.php b/includes/jpgraph/src/Examples/example26.1.php new file mode 100644 index 0000000..63a9d26 --- /dev/null +++ b/includes/jpgraph/src/Examples/example26.1.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example26.php b/includes/jpgraph/src/Examples/example26.php new file mode 100644 index 0000000..9cb57eb --- /dev/null +++ b/includes/jpgraph/src/Examples/example26.php @@ -0,0 +1,18 @@ +SetShadow(); + +$graph->title->Set("A simple Pie plot"); + +$p1 = new PiePlot($data); +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example27.1.php b/includes/jpgraph/src/Examples/example27.1.php new file mode 100644 index 0000000..51d52e3 --- /dev/null +++ b/includes/jpgraph/src/Examples/example27.1.php @@ -0,0 +1,25 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example27.2.php b/includes/jpgraph/src/Examples/example27.2.php new file mode 100644 index 0000000..aad23a3 --- /dev/null +++ b/includes/jpgraph/src/Examples/example27.2.php @@ -0,0 +1,24 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example27.3.php b/includes/jpgraph/src/Examples/example27.3.php new file mode 100644 index 0000000..fb2a56e --- /dev/null +++ b/includes/jpgraph/src/Examples/example27.3.php @@ -0,0 +1,24 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example27.php b/includes/jpgraph/src/Examples/example27.php new file mode 100644 index 0000000..3feee43 --- /dev/null +++ b/includes/jpgraph/src/Examples/example27.php @@ -0,0 +1,24 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example28.1.php b/includes/jpgraph/src/Examples/example28.1.php new file mode 100644 index 0000000..7dce5d8 --- /dev/null +++ b/includes/jpgraph/src/Examples/example28.1.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example28.2.php b/includes/jpgraph/src/Examples/example28.2.php new file mode 100644 index 0000000..905be8d --- /dev/null +++ b/includes/jpgraph/src/Examples/example28.2.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example28.3.php b/includes/jpgraph/src/Examples/example28.3.php new file mode 100644 index 0000000..bc4fdbd --- /dev/null +++ b/includes/jpgraph/src/Examples/example28.3.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example28.php b/includes/jpgraph/src/Examples/example28.php new file mode 100644 index 0000000..08d28bd --- /dev/null +++ b/includes/jpgraph/src/Examples/example28.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/example3.0.1.php b/includes/jpgraph/src/Examples/example3.0.1.php new file mode 100644 index 0000000..dd10c9e --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.0.1.php @@ -0,0 +1,41 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide + + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.0.2.php b/includes/jpgraph/src/Examples/example3.0.2.php new file mode 100644 index 0000000..3c8b1e6 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.0.2.php @@ -0,0 +1,40 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Interpolated values'); +$graph->xaxis->title->Set('x-title'); +$graph->yaxis->title->Set('y-title'); + +$graph->yaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); +$graph->xaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide + + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.0.3.php b/includes/jpgraph/src/Examples/example3.0.3.php new file mode 100644 index 0000000..cc39f63 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.0.3.php @@ -0,0 +1,40 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('NULL values'); +$graph->xaxis->title->Set('x-title'); +$graph->yaxis->title->Set('y-title'); + +$graph->yaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); +$graph->xaxis->title->SetFont( FF_ARIAL , FS_BOLD, 9 ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide + + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.1.1.php b/includes/jpgraph/src/Examples/example3.1.1.php new file mode 100644 index 0000000..32e2cef --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.1.1.php @@ -0,0 +1,43 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide + +// Add an image mark scaled to 50% +$lineplot->mark->SetType(MARK_IMG_DIAMOND,'red',0.5); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.1.php b/includes/jpgraph/src/Examples/example3.1.php new file mode 100644 index 0000000..1c4e0ad --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.1.php @@ -0,0 +1,43 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide +$lineplot->mark->SetType(MARK_UTRIANGLE); +$lineplot->mark->SetColor('blue'); +$lineplot->mark->SetFillColor('red'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.2.1.php b/includes/jpgraph/src/Examples/example3.2.1.php new file mode 100644 index 0000000..c739ce8 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.2.1.php @@ -0,0 +1,35 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example3.2.2.php b/includes/jpgraph/src/Examples/example3.2.2.php new file mode 100644 index 0000000..03d22c8 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.2.2.php @@ -0,0 +1,37 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example3.2.php b/includes/jpgraph/src/Examples/example3.2.php new file mode 100644 index 0000000..f7c05c5 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.2.php @@ -0,0 +1,34 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example3.3.php b/includes/jpgraph/src/Examples/example3.3.php new file mode 100644 index 0000000..c20cd98 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.3.php @@ -0,0 +1,45 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide +$lineplot->mark->SetType(MARK_UTRIANGLE); +$lineplot->mark->SetColor('blue'); +$lineplot->mark->SetFillColor('red'); + +$lineplot->value->Show(); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.4.1.php b/includes/jpgraph/src/Examples/example3.4.1.php new file mode 100644 index 0000000..77c0b24 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.4.1.php @@ -0,0 +1,81 @@ + 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, + 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, + 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1); + + foreach ($lookup as $roman => $value) + { + // Determine the number of matches + $matches = intval($n / $value); + + // Store that many characters + $result .= str_repeat($roman, $matches); + + // Substract that from the number + $n = $n % $value; + } + + // The Roman numeral should be built, return it + return $result; +} + +function formatCallback($aVal) { + return '('.numberToRoman($aVal).')'; +} + + + // Some (random) data +$ydata = array(11,3,8,12,5,1,9,13,5,7); + +// Size of the overall graph +$width=350; +$height=250; + +// Create the graph and set a scale. +// These two calls are always required +$graph = new Graph($width,$height); +$graph->SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide +$lineplot->mark->SetType(MARK_UTRIANGLE); +$lineplot->mark->SetColor('blue'); +$lineplot->mark->SetFillColor('red'); + +$lineplot->value->Show(); +$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10); +$lineplot->value->SetColor('darkred'); +$lineplot->value->SetFormatCallback('formatCallback'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.4.php b/includes/jpgraph/src/Examples/example3.4.php new file mode 100644 index 0000000..0d223c1 --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.4.php @@ -0,0 +1,48 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +$graph->yaxis->SetColor('blue'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide +$lineplot->mark->SetType(MARK_UTRIANGLE); +$lineplot->mark->SetColor('blue'); +$lineplot->mark->SetFillColor('red'); + +$lineplot->value->Show(); +$lineplot->value->SetFont(FF_ARIAL,FS_BOLD,10); +$lineplot->value->SetColor('darkred'); +$lineplot->value->SetFormat('(%d)'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example3.php b/includes/jpgraph/src/Examples/example3.php new file mode 100644 index 0000000..4c79c1d --- /dev/null +++ b/includes/jpgraph/src/Examples/example3.php @@ -0,0 +1,38 @@ +SetScale('intlin'); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetColor( 'blue' ); +$lineplot->SetWeight( 2 ); // Two pixel wide + + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example4.php b/includes/jpgraph/src/Examples/example4.php new file mode 100644 index 0000000..42549d8 --- /dev/null +++ b/includes/jpgraph/src/Examples/example4.php @@ -0,0 +1,45 @@ +SetScale('intlin'); +$graph->SetShadow(); + +// Setup margin and titles +$graph->SetMargin(40,20,20,40); +$graph->title->Set('Calls per operator (June,July)'); +$graph->subtitle->Set('(March 12, 2008)'); +$graph->xaxis->title->Set('Operator'); +$graph->yaxis->title->Set('# of calls'); + +$graph->yaxis->title->SetFont( FF_FONT1 , FS_BOLD ); +$graph->xaxis->title->SetFont( FF_FONT1 , FS_BOLD ); + +// Create the first data series +$lineplot=new LinePlot($ydata); +$lineplot->SetWeight( 2 ); // Two pixel wide + +// Add the plot to the graph +$graph->Add($lineplot); + +// Create the second data series +$lineplot2=new LinePlot($ydata2); +$lineplot2->SetWeight( 2 ); // Two pixel wide + +// Add the second plot to the graph +$graph->Add($lineplot2); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example5.1.php b/includes/jpgraph/src/Examples/example5.1.php new file mode 100644 index 0000000..3834558 --- /dev/null +++ b/includes/jpgraph/src/Examples/example5.1.php @@ -0,0 +1,47 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example5.php b/includes/jpgraph/src/Examples/example5.php new file mode 100644 index 0000000..d4b6838 --- /dev/null +++ b/includes/jpgraph/src/Examples/example5.php @@ -0,0 +1,44 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example6.1.php b/includes/jpgraph/src/Examples/example6.1.php new file mode 100644 index 0000000..5000759 --- /dev/null +++ b/includes/jpgraph/src/Examples/example6.1.php @@ -0,0 +1,55 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example6.2.php b/includes/jpgraph/src/Examples/example6.2.php new file mode 100644 index 0000000..7d0a755 --- /dev/null +++ b/includes/jpgraph/src/Examples/example6.2.php @@ -0,0 +1,47 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example6.php b/includes/jpgraph/src/Examples/example6.php new file mode 100644 index 0000000..6cdc630 --- /dev/null +++ b/includes/jpgraph/src/Examples/example6.php @@ -0,0 +1,54 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example7.php b/includes/jpgraph/src/Examples/example7.php new file mode 100644 index 0000000..e8f75c4 --- /dev/null +++ b/includes/jpgraph/src/Examples/example7.php @@ -0,0 +1,44 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example8.1.php b/includes/jpgraph/src/Examples/example8.1.php new file mode 100644 index 0000000..8cab7e4 --- /dev/null +++ b/includes/jpgraph/src/Examples/example8.1.php @@ -0,0 +1,57 @@ +SetScale("textlog"); +$graph->SetY2Scale("log"); + +$graph->SetShadow(); +$graph->SetMargin(40,110,20,40); + +$graph->ygrid->Show(true,true); +$graph->xgrid->Show(true,false); + +// Create the linear plot +$lineplot=new LinePlot($ydata); + +$lineplot2=new LinePlot($y2data); +$lineplot2->SetColor("orange"); +$lineplot2->SetWeight(2); + +$graph->yaxis->scale->ticks->SupressFirst(); + +// Add the plot to the graph +$graph->Add($lineplot); +$graph->AddY2($lineplot2); + +$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); + +$lineplot2->SetColor("orange"); +$lineplot2->SetWeight(2); + +$graph->yaxis->SetColor("blue"); +$graph->y2axis->SetColor("orange"); + +$lineplot->SetLegend("Plot 1"); +$lineplot2->SetLegend("Plot 2"); + +$graph->legend->Pos(0.05,0.5,"right","center"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/example8.php b/includes/jpgraph/src/Examples/example8.php new file mode 100644 index 0000000..773265b --- /dev/null +++ b/includes/jpgraph/src/Examples/example8.php @@ -0,0 +1,48 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example9.1.php b/includes/jpgraph/src/Examples/example9.1.php new file mode 100644 index 0000000..addcb5f --- /dev/null +++ b/includes/jpgraph/src/Examples/example9.1.php @@ -0,0 +1,50 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example9.2.php b/includes/jpgraph/src/Examples/example9.2.php new file mode 100644 index 0000000..c765981 --- /dev/null +++ b/includes/jpgraph/src/Examples/example9.2.php @@ -0,0 +1,52 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/example9.php b/includes/jpgraph/src/Examples/example9.php new file mode 100644 index 0000000..03c5479 --- /dev/null +++ b/includes/jpgraph/src/Examples/example9.php @@ -0,0 +1,49 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/exampleex9.php b/includes/jpgraph/src/Examples/exampleex9.php new file mode 100644 index 0000000..9d87985 --- /dev/null +++ b/includes/jpgraph/src/Examples/exampleex9.php @@ -0,0 +1,63 @@ +SetScale("textlog"); + +$graph->img->SetMargin(40,110,20,40); + +$graph->SetY2Scale("log"); +$graph->SetShadow(); + +$graph->ygrid->Show(true,true); +$graph->xgrid->Show(true,false); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot2=new LinePlot($y2data); + +$graph->yaxis->scale->ticks->SupressFirst(); +$graph->y2axis->scale->ticks->SupressFirst(); +// 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("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); + +$lineplot2->SetColor("orange"); +$lineplot2->SetWeight(2); + +$graph->yaxis->SetColor("blue"); + +$lineplot->SetLegend("Plot 1"); +$lineplot2->SetLegend("Plot 2"); + +$graph->legend->Pos(0.05,0.5,"right","center"); + +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetTextTickInterval(2); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/fieldscatterex1.php b/includes/jpgraph/src/Examples/fieldscatterex1.php new file mode 100644 index 0000000..94b47fb --- /dev/null +++ b/includes/jpgraph/src/Examples/fieldscatterex1.php @@ -0,0 +1,92 @@ + 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
"; + 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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/filledgridex1.php b/includes/jpgraph/src/Examples/filledgridex1.php new file mode 100644 index 0000000..8e86379 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledgridex1.php @@ -0,0 +1,50 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/filledline01.php b/includes/jpgraph/src/Examples/filledline01.php new file mode 100644 index 0000000..4140b29 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledline01.php @@ -0,0 +1,24 @@ +img->SetMargin(40,40,40,40); +$graph->SetScale("textlin"); +$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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/filledlineex01.1.php b/includes/jpgraph/src/Examples/filledlineex01.1.php new file mode 100644 index 0000000..547d207 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledlineex01.1.php @@ -0,0 +1,24 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/filledlineex01.php b/includes/jpgraph/src/Examples/filledlineex01.php new file mode 100644 index 0000000..6ea2c88 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledlineex01.php @@ -0,0 +1,23 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/filledlineex02.php b/includes/jpgraph/src/Examples/filledlineex02.php new file mode 100644 index 0000000..1b4db02 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledlineex02.php @@ -0,0 +1,24 @@ +img->SetMargin(40,40,40,40); +$graph->SetScale("textlin"); +$graph->SetShadow(); +$graph->title->Set("Example of filled line plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->subtitle->Set("(Starting from Y=0)"); + +$graph->yaxis->scale->SetAutoMin(0); + +$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(); +?> diff --git a/includes/jpgraph/src/Examples/filledlineex03.php b/includes/jpgraph/src/Examples/filledlineex03.php new file mode 100644 index 0000000..084e655 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledlineex03.php @@ -0,0 +1,23 @@ +SetScale('intlin'); +$graph->title->Set('Filled line with NULL values'); +//Make sure data starts from Zero whatever data we have +$graph->yscale->SetAutoMin(0); + +$p1 = new LinePlot($datay); +$p1->SetFillColor('lightblue'); +$graph->Add($p1); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/filledstepstyleex1.php b/includes/jpgraph/src/Examples/filledstepstyleex1.php new file mode 100644 index 0000000..75688b5 --- /dev/null +++ b/includes/jpgraph/src/Examples/filledstepstyleex1.php @@ -0,0 +1,39 @@ +SetScale("textlin"); +$graph->SetShadow(true); +$graph->SetMarginColor("antiquewhite"); +$graph->img->SetMargin(60,40,40,50); +$graph->img->setTransparent("white"); +$graph->xaxis->SetFont(FF_FONT1); +$graph->xaxis->setTextTickInterval(1); +$graph->xaxis->SetTextLabelInterval(1); +$graph->legend->SetFillColor("antiquewhite"); +$graph->legend->SetShadow(true); +$graph->legend->SetLayout(LEGEND_VERT); +$graph->legend->Pos(0.02,0.01); +$graph->title->Set("Step Styled Example"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$lineplot = new LinePlot($ydata); +$lineplot->SetColor("black"); +$lineplot->setFillColor("gray7"); +$lineplot->SetStepStyle(); +$lineplot->SetLegend(" 2002 "); + +// add plot to the graph +$graph->Add($lineplot); +$graph->ygrid->show(false,false); + +// display graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/fireplace.jpg b/includes/jpgraph/src/Examples/fireplace.jpg new file mode 100644 index 0000000..8006e3d Binary files /dev/null and b/includes/jpgraph/src/Examples/fireplace.jpg differ diff --git a/includes/jpgraph/src/Examples/fixscale_radarex1.php b/includes/jpgraph/src/Examples/fixscale_radarex1.php new file mode 100644 index 0000000..d663d90 --- /dev/null +++ b/includes/jpgraph/src/Examples/fixscale_radarex1.php @@ -0,0 +1,36 @@ +SetScale('lin',0,50); +$graph->yscale->ticks->Set(25,5); +$graph->SetColor('white'); +$graph->SetShadow(); + +$graph->SetCenter(0.5,0.55); + +$graph->axis->SetFont(FF_FONT1,FS_BOLD); +$graph->axis->SetWeight(2); + +// Uncomment the following lines to also show grid lines. +$graph->grid->SetLineStyle('dashed'); +$graph->grid->SetColor('navy@0.5'); +$graph->grid->Show(); + +$graph->ShowMinorTickMarks(); + +$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')); + +$plot = new RadarPlot(array(12,35,20,30,33,15,37)); +$plot->SetLegend('Goal'); +$plot->SetColor('red','lightred'); +$plot->SetFillColor('lightblue'); +$plot->SetLineWeight(2); + +$graph->Add($plot); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/footerex1.php b/includes/jpgraph/src/Examples/footerex1.php new file mode 100644 index 0000000..a3d113d --- /dev/null +++ b/includes/jpgraph/src/Examples/footerex1.php @@ -0,0 +1,62 @@ +SetMarginColor('white'); +$graph->SetScale("textlin"); +$graph->SetFrame(false); +$graph->SetMargin(30,5,25,50); + +// 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()); + +$graph->footer->left->Set('L. footer'); +$graph->footer->left->SetFont(FF_ARIAL,FS_NORMAL,12); +$graph->footer->left->SetColor('darkred'); +$graph->footer->center->Set('C. footer'); +$graph->footer->center->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->footer->center->SetColor('darkred'); +$graph->footer->right->Set('R. footer'); +$graph->footer->right->SetFont(FF_ARIAL,FS_NORMAL,12); +$graph->footer->right->SetColor('darkred'); + +// 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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/funcex1.php b/includes/jpgraph/src/Examples/funcex1.php new file mode 100644 index 0000000..de12e61 --- /dev/null +++ b/includes/jpgraph/src/Examples/funcex1.php @@ -0,0 +1,58 @@ +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); +$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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/funcex2.php b/includes/jpgraph/src/Examples/funcex2.php new file mode 100644 index 0000000..5715f36 --- /dev/null +++ b/includes/jpgraph/src/Examples/funcex2.php @@ -0,0 +1,34 @@ +E(-M_PI,M_PI,25); + +$graph = new Graph(380,450); +$graph->SetScale("linlin"); +$graph->SetShadow(); +$graph->img->SetMargin(50,50,60,40); +$graph->SetBox(true,'black',2); +$graph->SetMarginColor('white'); +$graph->SetColor('lightyellow'); +$graph->SetAxisStyle(AXSTYLE_SIMPLE); + +//$graph->xaxis->SetLabelFormat('%.1f'); + +$graph->title->Set("Function plot with marker"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->subtitle->Set("(BOXOUT Axis style)"); +$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); + +$lp1 = new LinePlot($ydata,$xdata); +$lp1->mark->SetType(MARK_FILLEDCIRCLE); +$lp1->mark->SetFillColor("red"); +$lp1->SetColor("blue"); + +$graph->Add($lp1); +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/funcex3.php b/includes/jpgraph/src/Examples/funcex3.php new file mode 100644 index 0000000..a63456e --- /dev/null +++ b/includes/jpgraph/src/Examples/funcex3.php @@ -0,0 +1,37 @@ +E(-M_PI,M_PI,25); + +$graph = new Graph(350,430); +$graph->SetScale("linlin"); +$graph->SetShadow(); +$graph->img->SetMargin(50,50,60,40); +$graph->SetBox(true,'black',2); +$graph->SetMarginColor('white'); +$graph->SetColor('lightyellow'); +$graph->SetAxisStyle(AXSTYLE_BOXIN); +$graph->xgrid->Show(); + + +//$graph->xaxis->SetLabelFormat('%.0f'); + +$graph->img->SetMargin(50,50,60,40); + +$graph->title->Set("Function plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->subtitle->Set("(BOXIN Axis style)"); +$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); + +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetColor("blue"); +$lp1->SetWeight(2); + +$graph->Add($lp1); +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/funcex4.php b/includes/jpgraph/src/Examples/funcex4.php new file mode 100644 index 0000000..bcd8b4d --- /dev/null +++ b/includes/jpgraph/src/Examples/funcex4.php @@ -0,0 +1,63 @@ +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); +$graph->SetScale("linlin"); +//$graph->SetShadow(); +$graph->img->SetMargin(5,10,60,9); +$graph->SetBox(true,'green',2); +$graph->SetMarginColor('black'); +$graph->SetColor('black'); + +// ... and titles +$graph->title->Set('Example of Function plot'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->title->SetColor('lightgreen'); +$graph->subtitle->Set("(With some more advanced axis formatting\nHiding first and last label)"); +$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); +$graph->subtitle->SetColor('lightgreen'); + +$graph->xgrid->Show(); +$graph->xgrid->SetColor('darkgreen'); +$graph->ygrid->SetColor('darkgreen'); + +$graph->yaxis->SetPos(0); +$graph->yaxis->SetWeight(2); +$graph->yaxis->HideZeroLabel(); +$graph->yaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->SetColor('green','green'); +$graph->yaxis->HideTicks(true,true); +$graph->yaxis->HideFirstLastLabel(); + +$graph->xaxis->SetWeight(2); +$graph->xaxis->HideZeroLabel(); +$graph->xaxis->HideFirstLastLabel(); +$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); +$graph->xaxis->SetColor('green','green'); + +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetColor('yellow'); +$lp1->SetWeight(2); + +$lp2 = new LinePlot($y2data,$x2data); +list($xm,$ym)=$lp2->Max(); +$lp2->SetColor('blue'); +$lp2->SetWeight(2); + + +$graph->Add($lp1); +$graph->Add($lp2); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/fusion_example.php b/includes/jpgraph/src/Examples/fusion_example.php new file mode 100644 index 0000000..4e4ae00 --- /dev/null +++ b/includes/jpgraph/src/Examples/fusion_example.php @@ -0,0 +1,57 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new FusionTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "FusionTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/gantt_samerowex1.php b/includes/jpgraph/src/Examples/gantt_samerowex1.php new file mode 100644 index 0000000..6c59ceb --- /dev/null +++ b/includes/jpgraph/src/Examples/gantt_samerowex1.php @@ -0,0 +1,63 @@ +SetShadow(); + +// Add title and subtitle +$graph->title->Set("Activities on same row"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// 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); // 1=default value + +// Format the bar for the first activity +// ($row,$title,$startdate,$enddate) +$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2001-12-26",""); + +// Yellow diagonal line pattern on a red background +$activity1->SetPattern(BAND_RDIAG,"yellow"); +$activity1->SetFillColor("red"); + +// Set absolute height of activity +$activity1->SetHeight(16); + +// Format the bar for the second activity +// ($row,$title,$startdate,$enddate) +$activity2 = new GanttBar(0,"","2001-12-31","2002-01-2","[BO]"); + +// 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 of activity +$activity2->SetHeight(16); + +// Finally add the bar to the graph +$graph->Add($activity1); +$graph->Add($activity2); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/gantt_samerowex2.php b/includes/jpgraph/src/Examples/gantt_samerowex2.php new file mode 100644 index 0000000..b3e2702 --- /dev/null +++ b/includes/jpgraph/src/Examples/gantt_samerowex2.php @@ -0,0 +1,65 @@ +SetShadow(); + +// Add title and subtitle +$graph->title->Set("Activities on same row"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->subtitle->Set('Using break style'); + +// 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); // 1=default value + +// Format the bar for the first activity +// ($row,$title,$startdate,$enddate) +$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2001-12-26",""); + +// Yellow diagonal line pattern on a red background +$activity1->SetPattern(BAND_RDIAG,"yellow"); +$activity1->SetFillColor("red"); + +// Format the bar for the first activity +// ($row,$title,$startdate,$enddate) +$break1 = new GanttBar(0,'',"2001-12-27","2001-12-30",""); +$break1->SetBreakStyle(true,'dotted',2); +$break1->SetColor('red'); +$graph->Add($break1); + +// Format the bar for the second activity +// ($row,$title,$startdate,$enddate) +$activity2 = new GanttBar(0,"","2001-12-31","2002-01-2","[BO]"); + +// 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"); + +// Finally add the bar to the graph +$graph->Add($activity1); +$graph->Add($activity2); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/gantt_textex1.php b/includes/jpgraph/src/Examples/gantt_textex1.php new file mode 100644 index 0000000..dae1d56 --- /dev/null +++ b/includes/jpgraph/src/Examples/gantt_textex1.php @@ -0,0 +1,96 @@ +SetBox(); +$graph->SetShadow(); + +// Add title and subtitle +$graph->title->Set("Example with added texts"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// 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","2001-12-27","[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 text to top left corner of graph +$txt1 = new Text(); +$txt1->SetPos(5,2); +$txt1->Set("Note:\nEstimate done w148"); +$txt1->SetFont(FF_ARIAL,FS_BOLD,12); +$txt1->SetColor('darkred'); +$graph->Add($txt1); + +// Add text to the top bar +$txt2 = new Text(); +$txt2->SetScalePos("2002-01-01",1); +$txt2->SetFont(FF_ARIAL,FS_BOLD,12); +$txt2->SetAlign('left','center'); +$txt2->Set("Remember this!"); +$txt2->SetBox('yellow'); +$graph->Add($txt2); + + +// Add a vertical line +$vline = new GanttVLine("2001-12-24","Phase 1"); +$vline->SetDayOffset(0.5); +//$graph->Add($vline); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttcolumnfontsex01.php b/includes/jpgraph/src/Examples/ganttcolumnfontsex01.php new file mode 100644 index 0000000..a371f87 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttcolumnfontsex01.php @@ -0,0 +1,68 @@ +SetMarginColor('gray:1.7'); +$graph->SetColor('white'); + +// Setup the graph title and title font +$graph->title->Set("Example of column fonts"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); + +// Show three headers +$graph->ShowHeaders(GANTT_HDAY | GANTT_HMONTH| GANTT_HYEAR); + +// Set the column headers and font +$graph->scale->actinfo->SetColTitles( array('Name','Start','End'),array(100)); +$graph->scale->actinfo->SetFont(FF_ARIAL,FS_BOLD,11); + +// Some "dummy" data to be dsiplayed +$data = array( + array(0,'Group 1', '2001-11-27','2001-12-05'), + array(1,' Activity 1', '2001-11-27','2001-11-29'), + array(2,' Activity 2', '2001-11-28','2001-12-05'), + array(3,'Group 2', '2001-11-29','2001-12-10'), + array(4,' Activity 1', '2001-11-29','2001-12-03'), + array(5,' Activity 2', '2001-12-01','2001-12-10'), + +); + +// Format and add the Gantt bars to the chart +$n = count($data); +for($i=0; $i < $n; ++$i) { + if( $i === 0 || $i === 3 ) { + // Format the group bars + $bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.35); + + // For each group make the name bold but keep the dates as the default font + $bar->title->SetColumnFonts(array(array(FF_ARIAL,FS_BOLD,11))); + + // Add group markers + $bar->leftMark->SetType( MARK_LEFTTRIANGLE ); + $bar->leftMark->Show(); + $bar->rightMark->SetType( MARK_RIGHTTRIANGLE ); + $bar->rightMark->Show(); + $bar->SetFillColor('black'); + $bar->SetPattern(BAND_SOLID,'black'); + } + else { + // Format the activity bars + $bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.45); + $bar->SetPattern(BAND_RDIAG,'black'); + $bar->SetFillColor('orange'); + } + // Default font + $bar->title->SetFont(FF_ARIAL,FS_NORMAL,10); + $graph->Add($bar); +} + +// Send back the graph to the client +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/ganttconstrainex0.php b/includes/jpgraph/src/Examples/ganttconstrainex0.php new file mode 100644 index 0000000..8f5b72a --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttconstrainex0.php @@ -0,0 +1,38 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttconstrainex1.php b/includes/jpgraph/src/Examples/ganttconstrainex1.php new file mode 100644 index 0000000..7e9a3c1 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttconstrainex1.php @@ -0,0 +1,40 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttconstrainex2.php b/includes/jpgraph/src/Examples/ganttconstrainex2.php new file mode 100644 index 0000000..1e6bbba --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttconstrainex2.php @@ -0,0 +1,39 @@ +title->Set("Example with grouping and constrains"); +//$graph->SetFrame(false); + +// 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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttcsimex01.php b/includes/jpgraph/src/Examples/ganttcsimex01.php new file mode 100644 index 0000000..997d347 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttcsimex01.php @@ -0,0 +1,28 @@ +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(); + + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttcsimex02.php b/includes/jpgraph/src/Examples/ganttcsimex02.php new file mode 100644 index 0000000..b9dd4c6 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttcsimex02.php @@ -0,0 +1,40 @@ +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(); + + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttex00.php b/includes/jpgraph/src/Examples/ganttex00.php new file mode 100644 index 0000000..618b7f9 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex00.php @@ -0,0 +1,14 @@ +Add($activity); + +// Display the Gantt chart +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex01.php b/includes/jpgraph/src/Examples/ganttex01.php new file mode 100644 index 0000000..b3b9d53 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex01.php @@ -0,0 +1,40 @@ +SetShadow(); + +// Add title and subtitle +$graph->title->Set('A 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,'Activity 1','2001-12-21','2002-01-18'); + +// Yellow diagonal line pattern on a red background +$activity->SetPattern(BAND_LDIAG,'yellow'); +$activity->SetFillColor('red'); + +// Finally add the bar to the graph +$graph->Add($activity); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex02.php b/includes/jpgraph/src/Examples/ganttex02.php new file mode 100644 index 0000000..2ac42ed --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex02.php @@ -0,0 +1,42 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex03.php b/includes/jpgraph/src/Examples/ganttex03.php new file mode 100644 index 0000000..de528a5 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex03.php @@ -0,0 +1,42 @@ +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-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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex04.php b/includes/jpgraph/src/Examples/ganttex04.php new file mode 100644 index 0000000..c9ea4cb --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex04.php @@ -0,0 +1,47 @@ +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-09','MS5'); +$milestone->caption->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->Add($milestone); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex05.php b/includes/jpgraph/src/Examples/ganttex05.php new file mode 100644 index 0000000..6c0ef36 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex05.php @@ -0,0 +1,48 @@ +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-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); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex06.php b/includes/jpgraph/src/Examples/ganttex06.php new file mode 100644 index 0000000..8cf4dbb --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex06.php @@ -0,0 +1,52 @@ +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-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); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex07.php b/includes/jpgraph/src/Examples/ganttex07.php new file mode 100644 index 0000000..b1eb27a --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex07.php @@ -0,0 +1,53 @@ +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-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); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex08.php b/includes/jpgraph/src/Examples/ganttex08.php new file mode 100644 index 0000000..62d8947 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex08.php @@ -0,0 +1,63 @@ +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-15"); + +// 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-10","2002-01-10"); +$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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex09.php b/includes/jpgraph/src/Examples/ganttex09.php new file mode 100644 index 0000000..f5fff1a --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex09.php @@ -0,0 +1,66 @@ +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-02-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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex10.php b/includes/jpgraph/src/Examples/ganttex10.php new file mode 100644 index 0000000..459920c --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex10.php @@ -0,0 +1,90 @@ +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-02-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-02-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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex11.php b/includes/jpgraph/src/Examples/ganttex11.php new file mode 100644 index 0000000..2fec58b --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex11.php @@ -0,0 +1,89 @@ +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-02-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-02-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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex12.php b/includes/jpgraph/src/Examples/ganttex12.php new file mode 100644 index 0000000..e7adc7a --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex12.php @@ -0,0 +1,93 @@ +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-02-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-02-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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex13-zoom1.php b/includes/jpgraph/src/Examples/ganttex13-zoom1.php new file mode 100644 index 0000000..9a8457e --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex13-zoom1.php @@ -0,0 +1,67 @@ +SetShadow(); + +// Add title and subtitle +$graph->title->Set("Zooming a graph"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->subtitle->Set("(zoom=0.7)"); + +// 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.0); // 1=default value + +// Set zoom factor +$graph->SetZoomFactor(0.7); + +// Format the bar for the first activity +// ($row,$title,$startdate,$enddate) +$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]"); + +// Yellow diagonal line pattern on a red background +$activity1->SetPattern(BAND_RDIAG,"yellow"); +$activity1->SetFillColor("red"); + +// Set absolute height of activity +$activity1->SetHeight(16); + +// Format the bar for the second activity +// ($row,$title,$startdate,$enddate) +$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[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 of activity +$activity2->SetHeight(16); + +// Finally add the bar to the graph +$graph->Add($activity1); +$graph->Add($activity2); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex13-zoom2.php b/includes/jpgraph/src/Examples/ganttex13-zoom2.php new file mode 100644 index 0000000..882fb7b --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex13-zoom2.php @@ -0,0 +1,67 @@ +SetShadow(); + +// Add title and subtitle +$graph->title->Set("Zooming a graph"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->subtitle->Set("(zoom=1.5)"); + +// 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.0); // 1=default value + +// Set zoom factor +$graph->SetZoomFactor(1.5); + +// Format the bar for the first activity +// ($row,$title,$startdate,$enddate) +$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]"); + +// Yellow diagonal line pattern on a red background +$activity1->SetPattern(BAND_RDIAG,"yellow"); +$activity1->SetFillColor("red"); + +// Set absolute height of activity +$activity1->SetHeight(16); + +// Format the bar for the second activity +// ($row,$title,$startdate,$enddate) +$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[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 of activity +$activity2->SetHeight(16); + +// Finally add the bar to the graph +$graph->Add($activity1); +$graph->Add($activity2); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex13.php b/includes/jpgraph/src/Examples/ganttex13.php new file mode 100644 index 0000000..865a4db --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex13.php @@ -0,0 +1,64 @@ +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); // 1=default value + +// Format the bar for the first activity +// ($row,$title,$startdate,$enddate) +$activity1 = new GanttBar(0,"Activity 1","2001-12-21","2002-01-07","[ER,TR]"); + +// Yellow diagonal line pattern on a red background +$activity1->SetPattern(BAND_RDIAG,"yellow"); +$activity1->SetFillColor("red"); + +// Set absolute height of activity +$activity1->SetHeight(16); + +// Format the bar for the second activity +// ($row,$title,$startdate,$enddate) +$activity2 = new GanttBar(1,"Activity 2","2001-12-21","2002-01-01","[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 of activity +$activity2->SetHeight(16); + +// Finally add the bar to the graph +$graph->Add($activity1); +$graph->Add($activity2); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex14.php b/includes/jpgraph/src/Examples/ganttex14.php new file mode 100644 index 0000000..a53942b --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex14.php @@ -0,0 +1,67 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex15.php b/includes/jpgraph/src/Examples/ganttex15.php new file mode 100644 index 0000000..ae75983 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex15.php @@ -0,0 +1,68 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex16.php b/includes/jpgraph/src/Examples/ganttex16.php new file mode 100644 index 0000000..bf3e06f --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex16.php @@ -0,0 +1,73 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex17-flag.php b/includes/jpgraph/src/Examples/ganttex17-flag.php new file mode 100644 index 0000000..17eaca4 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex17-flag.php @@ -0,0 +1,88 @@ +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 coutnry flag +$icon = new IconPlot(); +$icon->SetAnchor('left','top'); +$icon->SetCountryFlag('norway'); +$icon->SetMix(50); +$icon->SetPos(5,5); +$graph->Add($icon); + + +// Add a vertical line +$vline = new GanttVLine("2001-12-24","Phase 1"); +$vline->SetDayOffset(0.5); +//$graph->Add($vline); + +// ... and display it +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex17.php b/includes/jpgraph/src/Examples/ganttex17.php new file mode 100644 index 0000000..cc2e7e8 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex17.php @@ -0,0 +1,78 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex18.php b/includes/jpgraph/src/Examples/ganttex18.php new file mode 100644 index 0000000..4c4b5d9 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex18.php @@ -0,0 +1,82 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex19.php b/includes/jpgraph/src/Examples/ganttex19.php new file mode 100644 index 0000000..7528412 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex19.php @@ -0,0 +1,84 @@ +SetBox(); +$graph->SetShadow(); + +// Use default 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(); +?> diff --git a/includes/jpgraph/src/Examples/ganttex30.php b/includes/jpgraph/src/Examples/ganttex30.php new file mode 100644 index 0000000..45cc80b --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex30.php @@ -0,0 +1,87 @@ +SetShadow(); +$graph->SetBox(); + +// Titles for chart +$graph->title->Set("General conversion plan"); +$graph->subtitle->Set("(Revision: 2001-11-18)"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// For illustration we enable all headers. +$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); + +// For the week we choose to show the start date of the week +// the default is to show week number (according to ISO 8601) +$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); + +// Change the scale font +$graph->scale->week->SetFont(FF_FONT0); +$graph->scale->year->SetFont(FF_ARIAL,FS_BOLD,12); + + +// Setup some data for the gantt bars +$data = array( + array(0,"Group 1", "2001-10-29","2001-11-27",FF_FONT1,FS_BOLD,8), + array(1," Label 2", "2001-11-8","2001-12-14"), + array(2," Label 3", "2001-11-01","2001-11-8"), + array(4,"Group 2", "2001-11-07","2001-12-19",FF_FONT1,FS_BOLD,8), + array(5," Label 4", "2001-11-8","2001-12-19"), + array(6," Label 5", "2001-11-01","2001-11-8") + ); + +for($i=0; $i4 ) + $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); + + // If you like each bar can have a shadow + // $bar->SetShadow(true,"darkgray"); + + // For illustration lets make each bar be red with yellow diagonal stripes + $bar->SetPattern(BAND_RDIAG,"yellow"); + $bar->SetFillColor("red"); + + // To indicate progress each bar can have a smaller bar within + // For illustrative purpose just set the progress to 50% for each bar + $bar->progress->Set(0.5); + + // Each bar may also have optional left and right plot marks + // As illustration lets put a filled circle with a number at the end + // of each bar + $bar->rightMark->SetType(MARK_FILLEDCIRCLE); + $bar->rightMark->SetFillColor("red"); + $bar->rightMark->SetColor("red"); + $bar->rightMark->SetWidth(10); + + // Title for the mark + $bar->rightMark->title->Set("".$i+1); + $bar->rightMark->title->SetColor("white"); + $bar->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,10); + $bar->rightMark->Show(); + + // ... and add the bar to the gantt chart + $graph->Add($bar); +} + +// Create a milestone mark +$ms = new MileStone(7,"M5","2001-12-10","10/12"); +$ms->title->SetFont(FF_FONT1,FS_BOLD); +$graph->Add($ms); + +// Create a vertical line to emphasize the milestone +$vl = new GanttVLine("2001-12-10 13:00","Phase 1","darkred"); +$vl->SetDayOffset(0.5); // Center the line in the day +$graph->Add($vl); + +// Output the graph +$graph->Stroke(); + +// EOF +?> diff --git a/includes/jpgraph/src/Examples/ganttex_slice.php b/includes/jpgraph/src/Examples/ganttex_slice.php new file mode 100644 index 0000000..5ec95bc --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttex_slice.php @@ -0,0 +1,78 @@ +SetShadow(); +$graph->SetBox(); + +// Only show part of the Gantt +$graph->SetDateRange('2001-11-22','2002-1-24'); + +// Weeks start on Sunday +$graph->scale->SetWeekStart(0); + +$graph->title->Set("General conversion plan"); +$graph->subtitle->Set("(Slice between 2001-11-22 to 2002-01-24)"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,20); + +$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); +$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); +$graph->scale->week->SetFont(FF_FONT1); + + +$data = array( + array(0,"Group 1\tJohan", "2002-1-23","2002-01-28",FF_FONT1,FS_BOLD,8), + array(1," Label 2", "2001-10-26","2001-11-16"), + array(2," Label 3", "2001-11-30","2001-12-01"), + array(4,"Group 2", "2001-11-30","2001-12-22",FF_FONT1,FS_BOLD,8), + array(5," Label 4", "2001-11-30","2001-12-1"), + array(6," Label 5", "2001-12-6","2001-12-8"), + array(8," Label 8", "2001-11-30","2002-01-02") + ); + + +// make up some fictionary activity bars +for($i=0; $i4 ) + $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); + + $bar->rightMark->Show(); + $bar->rightMark->SetType(MARK_FILLEDCIRCLE); + $bar->rightMark->SetWidth(8); + $bar->rightMark->SetColor("red"); + $bar->rightMark->SetFillColor("red"); + $bar->rightMark->title->Set($i+1); + $bar->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,12); + $bar->rightMark->title->SetColor("white"); + + $bar->SetPattern(BAND_RDIAG,"yellow"); + $bar->SetFillColor("red"); + $bar->progress->Set($i/10); + $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); + + $graph->Add($bar); +} + + +// The line will NOT be shown since it is outside the specified slice +$vline = new GanttVLine("2002-02-28"); +$vline->title->Set("2002-02-28"); +$vline->title->SetFont(FF_FONT1,FS_BOLD,10); +$graph->Add($vline); + +// The milestone will NOT be shown since it is outside the specified slice +$ms = new MileStone(7,"M5","2002-01-28","28/1"); +$ms->title->SetFont(FF_FONT1,FS_BOLD); +$graph->Add($ms); + +$graph->Stroke(); + + +?> + + diff --git a/includes/jpgraph/src/Examples/gantthgridex1.php b/includes/jpgraph/src/Examples/gantthgridex1.php new file mode 100644 index 0000000..70a9481 --- /dev/null +++ b/includes/jpgraph/src/Examples/gantthgridex1.php @@ -0,0 +1,63 @@ +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 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.05,0.95,1,15); +$icon->SetAnchor('left','bottom'); +$graph->Add($icon); + +// .. and finally send it back to the browser +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/gantthourex1.php b/includes/jpgraph/src/Examples/gantthourex1.php new file mode 100644 index 0000000..bfe5532 --- /dev/null +++ b/includes/jpgraph/src/Examples/gantthourex1.php @@ -0,0 +1,51 @@ +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; $i4 ) + $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(); + + + +?> + + diff --git a/includes/jpgraph/src/Examples/gantthourminex1.php b/includes/jpgraph/src/Examples/gantthourminex1.php new file mode 100644 index 0000000..8a76bf1 --- /dev/null +++ b/includes/jpgraph/src/Examples/gantthourminex1.php @@ -0,0 +1,93 @@ +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; $i4 ) + $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");//d=1006858800, +$vline = new GanttVLine("2001-11-27 9:00");//d=1006858800, +$vline->SetWeight(5); +$vline->SetDayOffset(0); +$vline->title->Set("27/11 9:00"); +$vline->title->SetFont(FF_FONT1,FS_BOLD,10); +$graph->Add($vline); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/gantticonex1.php b/includes/jpgraph/src/Examples/gantticonex1.php new file mode 100644 index 0000000..b5a3197 --- /dev/null +++ b/includes/jpgraph/src/Examples/gantticonex1.php @@ -0,0 +1,77 @@ +title->Set("Gantt chart with title columns and icons"); +$graph->title->SetFont(FF_ARIAL, FS_BOLD,12); +$graph->title->SetMargin(10); + +// 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('darkgreen@0.95'); +$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; $i4 ) + $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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttmonthyearex1.php b/includes/jpgraph/src/Examples/ganttmonthyearex1.php new file mode 100644 index 0000000..6bc7809 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttmonthyearex1.php @@ -0,0 +1,50 @@ +title->Set("Only month & year scale"); + +// Setup some "very" 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'); + +// Explicitely set the date range +// (Autoscaling will of course also work) +$graph->SetDateRange('2001-10-06','2002-4-01'); + +// 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); + +// Data for our example activities +$data = array( + array(0,"Group 1 Johan", "2001-11-23","2002-03-1",FF_FONT1,FS_BOLD,8), + array(1," Label 2", "2001-10-26","2001-11-16")); + +// Create the bars and add them to the gantt chart +for($i=0; $i4 ) + $bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]); + $bar->SetPattern(BAND_RDIAG,"yellow"); + $bar->SetFillColor("red"); + $bar->progress->Set(0.5); + $bar->progress->SetPattern(GANTT_SOLID,"darkgreen"); + $graph->Add($bar); +} + +// Output the chart +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttmonthyearex2.php b/includes/jpgraph/src/Examples/ganttmonthyearex2.php new file mode 100644 index 0000000..4ed5092 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttmonthyearex2.php @@ -0,0 +1,66 @@ +title->Set("Only month & year scale"); + +// Setup some "very" 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'); + +// Explicitely set the date range +// (Autoscaling will of course also work) +$graph->SetDateRange('2001-10-06','2002-4-10'); + +// 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); + + +// Setup activity info + +// For the titles we also add a minimum width of 100 pixels for the Task name column +$graph->scale->actinfo->SetColTitles( + array('Name','Duration','Start','Finish'),array(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'); + +// Data for our example activities +$data = array( + array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02") + , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), + array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"), + "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), + array(2,array("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; $i4 ) + $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"); + $graph->Add($bar); +} + +// Output the chart +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttmonthyearex3.php b/includes/jpgraph/src/Examples/ganttmonthyearex3.php new file mode 100644 index 0000000..fa0c3f6 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttmonthyearex3.php @@ -0,0 +1,66 @@ +title->Set("Only month & year scale"); + +// Setup some "very" 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'); + +// Explicitely set the date range +// (Autoscaling will of course also work) +$graph->SetDateRange('2001-10-06','2002-4-10'); + +// 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); + + +// Setup activity info + +// For the titles we also add a minimum width of 100 pixels for the Task name column +$graph->scale->actinfo->SetColTitles( + array('Type','Name','Duration','Start','Finish'),array(40,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'); + +// Data for our example activities +$data = array( + array(0,array("","Pre-study","102 days","23 Nov '01","1 Mar '02") + , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), + array(1,array("","Prototype","21 days","26 Oct '01","16 Nov '01"), + "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), + array(2,array("","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; $i4 ) + $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"); + $graph->Add($bar); +} + +// Output the chart +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttmonthyearex4.php b/includes/jpgraph/src/Examples/ganttmonthyearex4.php new file mode 100644 index 0000000..defa2e7 --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttmonthyearex4.php @@ -0,0 +1,71 @@ +title->Set("Adding a spaning title"); + +// Setup some "very" 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'); + +// Explicitely set the date range +// (Autoscaling will of course also work) +$graph->SetDateRange('2001-11-06','2002-1-10'); + +// Display month and year scale with the gridlines +$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR | GANTT_HWEEK ); +$graph->scale->month->grid->SetColor('gray'); +$graph->scale->month->grid->Show(true); +$graph->scale->year->grid->SetColor('gray'); +$graph->scale->year->grid->Show(true); + + +//Setup spanning title +$graph->scale->tableTitle->Set( 'Phase 1' ); +$graph->scale->tableTitle->SetFont( FF_ARIAL , FS_NORMAL , 16 ); +$graph->scale->SetTableTitleBackground( 'darkgreen@0.6' ); +$graph->scale->tableTitle->Show( true ); + +// Setup activity info + +// For the titles we also add a minimum width of 100 pixels for the Task name column +$graph->scale->actinfo->SetColTitles(array('Name','Duration','Start','Finish'),array(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'); + +// Data for our example activities +$data = array( + array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02") + , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), + array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"), + "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), + array(2,array("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; $i4 ) + $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"); + $graph->Add($bar); +} + +// Output the chart +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ganttsimpleex1.php b/includes/jpgraph/src/Examples/ganttsimpleex1.php new file mode 100644 index 0000000..63e4efb --- /dev/null +++ b/includes/jpgraph/src/Examples/ganttsimpleex1.php @@ -0,0 +1,31 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/grace_ex0.php b/includes/jpgraph/src/Examples/grace_ex0.php new file mode 100644 index 0000000..5358ae5 --- /dev/null +++ b/includes/jpgraph/src/Examples/grace_ex0.php @@ -0,0 +1,58 @@ +img->SetMargin(40,30,40,50); +$graph->SetScale("textint"); +$graph->SetFrame(true,'blue',1); +$graph->SetColor('lightblue'); +$graph->SetMarginColor('lightblue'); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT1); +$graph->xaxis->SetColor('darkblue','black'); + +// Setup "hidden" y-axis by given it the same color +// as the background (this could also be done by setting the weight +// to zero) +$graph->yaxis->SetColor('lightblue','darkblue'); +$graph->ygrid->SetColor('white'); + +// Setup graph title ands fonts +$graph->title->Set('Using grace = 0'); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->SetTitle('Year 2002','center'); +$graph->xaxis->SetTitleMargin(10); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +$graph->yaxis->scale->SetGrace(0); + + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('darkblue'); +$bplot->SetColor('darkblue'); +$bplot->SetWidth(0.5); +$bplot->SetShadow('darkgray'); + +// Setup the values that are displayed on top of each bar +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->Show(); +$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); +$bplot->value->SetFormat('$%d'); +$bplot->value->SetColor('darkred'); +$bplot->value->SetAngle(45); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/grace_ex1.php b/includes/jpgraph/src/Examples/grace_ex1.php new file mode 100644 index 0000000..7544b44 --- /dev/null +++ b/includes/jpgraph/src/Examples/grace_ex1.php @@ -0,0 +1,58 @@ +img->SetMargin(40,30,40,50); +$graph->SetScale("textint"); +$graph->SetFrame(true,'blue',1); +$graph->SetColor('lightblue'); +$graph->SetMarginColor('lightblue'); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT1); +$graph->xaxis->SetColor('darkblue','black'); + +// Setup "hidden" y-axis by given it the same color +// as the background (this could also be done by setting the weight +// to zero) +$graph->yaxis->SetColor('lightblue','darkblue'); +$graph->ygrid->SetColor('white'); + +// Setup graph title ands fonts +$graph->title->Set('Using grace = 10%'); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->SetTitle('Year 2002','center'); +$graph->xaxis->SetTitleMargin(10); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +$graph->yaxis->scale->SetGrace(10); + + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('darkblue'); +$bplot->SetColor('darkblue'); +$bplot->SetWidth(0.5); +$bplot->SetShadow('darkgray'); + +// Setup the values that are displayed on top of each bar +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->Show(); +$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); +$bplot->value->SetFormat('$%d'); +$bplot->value->SetColor('darkred'); +$bplot->value->SetAngle(45); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/grace_ex2.php b/includes/jpgraph/src/Examples/grace_ex2.php new file mode 100644 index 0000000..eff8b8d --- /dev/null +++ b/includes/jpgraph/src/Examples/grace_ex2.php @@ -0,0 +1,58 @@ +img->SetMargin(40,30,40,50); +$graph->SetScale("textint"); +$graph->SetFrame(true,'blue',1); +$graph->SetColor('lightblue'); +$graph->SetMarginColor('lightblue'); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT1); +$graph->xaxis->SetColor('darkblue','black'); + +// Setup "hidden" y-axis by given it the same color +// as the background (this could also be done by setting the weight +// to zero) +$graph->yaxis->SetColor('lightblue','darkblue'); +$graph->ygrid->SetColor('white'); + +// Setup graph title ands fonts +$graph->title->Set('Using grace = 50%'); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->SetTitle('Year 2002','center'); +$graph->xaxis->SetTitleMargin(10); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +$graph->yaxis->scale->SetGrace(50); + + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('darkblue'); +$bplot->SetColor('darkblue'); +$bplot->SetWidth(0.5); +$bplot->SetShadow('darkgray'); + +// Setup the values that are displayed on top of each bar +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->Show(); +$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); +$bplot->value->SetFormat('$%d'); +$bplot->value->SetColor('darkred'); +$bplot->value->SetAngle(45); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/grace_ex3.php b/includes/jpgraph/src/Examples/grace_ex3.php new file mode 100644 index 0000000..40f7daf --- /dev/null +++ b/includes/jpgraph/src/Examples/grace_ex3.php @@ -0,0 +1,58 @@ +img->SetMargin(40,30,40,50); +$graph->SetScale("textint"); +$graph->SetFrame(true,'blue',1); +$graph->SetColor('lightblue'); +$graph->SetMarginColor('lightblue'); + +// Setup X-axis labels +$a = $gDateLocale->GetShortMonth(); +$graph->xaxis->SetTickLabels($a); +$graph->xaxis->SetFont(FF_FONT1); +$graph->xaxis->SetColor('darkblue','black'); + +// Setup "hidden" y-axis by given it the same color +// as the background (this could also be done by setting the weight +// to zero) +$graph->yaxis->SetColor('lightblue','darkblue'); +$graph->ygrid->SetColor('white'); + +// Setup graph title ands fonts +$graph->title->Set('Using grace = 100%'); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->xaxis->SetTitle('Year 2002','center'); +$graph->xaxis->SetTitleMargin(10); +$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD); + +// Add some grace to the top so that the scale doesn't +// end exactly at the max value. +$graph->yaxis->scale->SetGrace(100); + + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('darkblue'); +$bplot->SetColor('darkblue'); +$bplot->SetWidth(0.5); +$bplot->SetShadow('darkgray'); + +// Setup the values that are displayed on top of each bar +// Must use TTF fonts if we want text at an arbitrary angle +$bplot->value->Show(); +$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8); +$bplot->value->SetFormat('$%d'); +$bplot->value->SetColor('darkred'); +$bplot->value->SetAngle(45); +$graph->Add($bplot); + +// Finally stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/gradbkgex1.php b/includes/jpgraph/src/Examples/gradbkgex1.php new file mode 100644 index 0000000..0509e41 --- /dev/null +++ b/includes/jpgraph/src/Examples/gradbkgex1.php @@ -0,0 +1,66 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/gradlinefillex1.php b/includes/jpgraph/src/Examples/gradlinefillex1.php new file mode 100644 index 0000000..06520e2 --- /dev/null +++ b/includes/jpgraph/src/Examples/gradlinefillex1.php @@ -0,0 +1,29 @@ +SetMargin(40,40,20,30); +$graph->SetScale("intlin"); +$graph->SetMarginColor('darkgreen@0.8'); + +$graph->title->Set('Gradient filled line plot'); +$graph->yscale->SetAutoMin(0); + +// Create the line +$p1 = new LinePlot($datay); +$p1->SetColor("blue"); +$p1->SetWeight(0); +$p1->SetFillGradient('red','yellow'); + +$graph->Add($p1); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/gradlinefillex2.php b/includes/jpgraph/src/Examples/gradlinefillex2.php new file mode 100644 index 0000000..9788744 --- /dev/null +++ b/includes/jpgraph/src/Examples/gradlinefillex2.php @@ -0,0 +1,30 @@ +SetMargin(40,40,20,30); +$graph->SetScale("intlin"); +$graph->SetBox(); +$graph->SetMarginColor('darkgreen@0.8'); + +// Setup a background gradient image +$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); + +$graph->title->Set('Gradient filled line plot ex2'); +$graph->yscale->SetAutoMin(0); + +// Create the line +$p1 = new LinePlot($datay); +$p1->SetFillGradient('white','darkgreen'); +$graph->Add($p1); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/gradlinefillex3.php b/includes/jpgraph/src/Examples/gradlinefillex3.php new file mode 100644 index 0000000..17b6e51 --- /dev/null +++ b/includes/jpgraph/src/Examples/gradlinefillex3.php @@ -0,0 +1,30 @@ +SetMargin(40,40,20,30); +$graph->SetScale("intlin"); +$graph->SetBox(); +$graph->SetMarginColor('darkgreen@0.8'); + +// Setup a background gradient image +$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); + +$graph->title->Set('Gradient filled line plot ex3'); +$graph->yscale->SetAutoMin(0); + +// Create the line +$p1 = new LinePlot($datay); +$p1->SetFillGradient('white','darkgreen',4); +$graph->Add($p1); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/gradlinefillex4.php b/includes/jpgraph/src/Examples/gradlinefillex4.php new file mode 100644 index 0000000..f921560 --- /dev/null +++ b/includes/jpgraph/src/Examples/gradlinefillex4.php @@ -0,0 +1,31 @@ +SetMargin(40,40,20,30); +$graph->SetScale("intlin"); +$graph->SetBox(); +$graph->SetMarginColor('darkgreen@0.8'); + +// Setup a background gradient image +$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); + +$graph->title->Set('Gradient filled line plot ex2'); +$graph->yscale->SetAutoMin(0); + +// Create the line +$p1 = new LinePlot($datay); +$p1->SetFillGradient('white','darkgreen'); +$p1->SetStepStyle(); +$graph->Add($p1); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/green_example.php b/includes/jpgraph/src/Examples/green_example.php new file mode 100644 index 0000000..4c939d2 --- /dev/null +++ b/includes/jpgraph/src/Examples/green_example.php @@ -0,0 +1,58 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new GreenTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "GreenTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/groupbarex1.php b/includes/jpgraph/src/Examples/groupbarex1.php new file mode 100644 index 0000000..40f28ee --- /dev/null +++ b/includes/jpgraph/src/Examples/groupbarex1.php @@ -0,0 +1,44 @@ +SetScale("textlin"); +$graph->SetShadow(); +$graph->img->SetMargin(40,30,40,40); +$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); + +$graph->xaxis->title->Set('Year 2002'); +$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->title->Set('Group bar plot'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$bplot1 = new BarPlot($datay1); +$bplot2 = new BarPlot($datay2); +$bplot3 = new BarPlot($datay3); + +$bplot1->SetFillColor("orange"); +$bplot2->SetFillColor("brown"); +$bplot3->SetFillColor("darkgreen"); + +$bplot1->SetShadow(); +$bplot2->SetShadow(); +$bplot3->SetShadow(); + +$bplot1->SetShadow(); +$bplot2->SetShadow(); +$bplot3->SetShadow(); + +$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); +$gbarplot->SetWidth(0.6); +$graph->Add($gbarplot); + +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/heat1.jpg b/includes/jpgraph/src/Examples/heat1.jpg new file mode 100644 index 0000000..07f04d7 Binary files /dev/null and b/includes/jpgraph/src/Examples/heat1.jpg differ diff --git a/includes/jpgraph/src/Examples/horizbarex1.php b/includes/jpgraph/src/Examples/horizbarex1.php new file mode 100644 index 0000000..bc5055f --- /dev/null +++ b/includes/jpgraph/src/Examples/horizbarex1.php @@ -0,0 +1,63 @@ +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); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/horizbarex2.php b/includes/jpgraph/src/Examples/horizbarex2.php new file mode 100644 index 0000000..d50bb7d --- /dev/null +++ b/includes/jpgraph/src/Examples/horizbarex2.php @@ -0,0 +1,70 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/horizbarex3.php b/includes/jpgraph/src/Examples/horizbarex3.php new file mode 100644 index 0000000..c0d5a49 --- /dev/null +++ b/includes/jpgraph/src/Examples/horizbarex3.php @@ -0,0 +1,99 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/horizbarex4.php b/includes/jpgraph/src/Examples/horizbarex4.php new file mode 100644 index 0000000..5f51be4 --- /dev/null +++ b/includes/jpgraph/src/Examples/horizbarex4.php @@ -0,0 +1,48 @@ +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('Number of incidents'); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor('orange'); +$bplot->SetWidth(0.5); +$bplot->SetYMin(1990); + +$graph->Add($bplot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/horizbarex6.php b/includes/jpgraph/src/Examples/horizbarex6.php new file mode 100644 index 0000000..8ab4cbc --- /dev/null +++ b/includes/jpgraph/src/Examples/horizbarex6.php @@ -0,0 +1,83 @@ +SetScale("textlin"); + +// No frame around the image +$graph->SetFrame(false); + +// Rotate graph 90 degrees and set margin +$graph->Set90AndMargin(100,20,50,30); + +// Set white margin color +$graph->SetMarginColor('white'); + +// Use a box around the plot area +$graph->SetBox(); + +// Use a gradient to fill the plot area +$graph->SetBackgroundGradient('white','lightblue',GRAD_HOR,BGRAD_PLOT); + +// Setup title +$graph->title->Set("Graphic card performance"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,11); +$graph->subtitle->Set("(Non optimized)"); + +// Setup X-axis +$graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,8); + +// 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->SetShadow(); + +//You can change the width of the bars if you like +//$bplot->SetWidth(0.5); + +// Set gradient fill for bars +$bplot->SetFillGradient('darkred','yellow',GRAD_HOR); + +// We want to display the value of each bar at the top +$bplot->value->Show(); +$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10); +//$bplot->value->SetAlign('left','center'); +$bplot->value->SetColor("white"); +$bplot->value->SetFormat('%.1f'); +$bplot->SetValuePos('max'); + +// Add the bar to the graph +$graph->Add($bplot); + +// Add some explanation text +$txt = new Text('Note: Higher value is better.'); +$txt->SetPos(190,399,'center','bottom'); +$txt->SetFont(FF_ARIAL,FS_NORMAL,8); +$graph->Add($txt); + +// .. and stroke the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/icon.jpg b/includes/jpgraph/src/Examples/icon.jpg new file mode 100644 index 0000000..dc3b302 Binary files /dev/null and b/includes/jpgraph/src/Examples/icon.jpg differ diff --git a/includes/jpgraph/src/Examples/imgmarkercsimex1.php b/includes/jpgraph/src/Examples/imgmarkercsimex1.php new file mode 100644 index 0000000..2c91a0d --- /dev/null +++ b/includes/jpgraph/src/Examples/imgmarkercsimex1.php @@ -0,0 +1,55 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/imgmarkerex1.php b/includes/jpgraph/src/Examples/imgmarkerex1.php new file mode 100644 index 0000000..9f5e8ce --- /dev/null +++ b/includes/jpgraph/src/Examples/imgmarkerex1.php @@ -0,0 +1,52 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/impulsex1.php b/includes/jpgraph/src/Examples/impulsex1.php new file mode 100644 index 0000000..ff89383 --- /dev/null +++ b/includes/jpgraph/src/Examples/impulsex1.php @@ -0,0 +1,23 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/impulsex2.php b/includes/jpgraph/src/Examples/impulsex2.php new file mode 100644 index 0000000..8ea4597 --- /dev/null +++ b/includes/jpgraph/src/Examples/impulsex2.php @@ -0,0 +1,29 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/impulsex3.php b/includes/jpgraph/src/Examples/impulsex3.php new file mode 100644 index 0000000..f7b5182 --- /dev/null +++ b/includes/jpgraph/src/Examples/impulsex3.php @@ -0,0 +1,53 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/impulsex4.php b/includes/jpgraph/src/Examples/impulsex4.php new file mode 100644 index 0000000..ac497ad --- /dev/null +++ b/includes/jpgraph/src/Examples/impulsex4.php @@ -0,0 +1,76 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/index.html b/includes/jpgraph/src/Examples/index.html new file mode 100644 index 0000000..6731a85 --- /dev/null +++ b/includes/jpgraph/src/Examples/index.html @@ -0,0 +1,36 @@ +

Examples of odometers

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/includes/jpgraph/src/Examples/interpolation-growth-log.php b/includes/jpgraph/src/Examples/interpolation-growth-log.php new file mode 100644 index 0000000..c9ecd00 --- /dev/null +++ b/includes/jpgraph/src/Examples/interpolation-growth-log.php @@ -0,0 +1,42 @@ +SetScale('intlog'); +$graph->SetMargin(50,50,20,30); +$graph->SetFrame(false); +$graph->SetBox(true,'black',2); +$graph->SetMarginColor('white'); +$graph->SetColor('lightyellow@0.7'); + +$graph->title->Set('Interpolation growth for size 10x10'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->xaxis->SetTitle('Interpolation factor','center'); +$graph->xaxis->SetTitleMargin(10); + +$graph->SetAxisStyle(AXSTYLE_YBOXIN); +$graph->xgrid->Show(); + +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetColor('darkred'); +$lp1->SetWeight(3); +$graph->Add($lp1); + +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/interpolation-growth.php b/includes/jpgraph/src/Examples/interpolation-growth.php new file mode 100644 index 0000000..e1fec18 --- /dev/null +++ b/includes/jpgraph/src/Examples/interpolation-growth.php @@ -0,0 +1,42 @@ +SetScale('intint'); +$graph->SetMargin(50,50,20,30); +$graph->SetFrame(false); +$graph->SetBox(true,'black',2); +$graph->SetMarginColor('white'); +$graph->SetColor('lightyellow@0.7'); + +$graph->title->Set('Interpolation growth for size 10x10'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->xaxis->SetTitle('Interpolation factor','center'); +$graph->xaxis->SetTitleMargin(10); + +$graph->SetAxisStyle(AXSTYLE_YBOXIN); +$graph->xgrid->Show(); + +$lp1 = new LinePlot($ydata,$xdata); +$lp1->SetColor('darkred'); +$lp1->SetWeight(3); +$graph->Add($lp1); + +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/inyaxisex1.php b/includes/jpgraph/src/Examples/inyaxisex1.php new file mode 100644 index 0000000..d6e3d41 --- /dev/null +++ b/includes/jpgraph/src/Examples/inyaxisex1.php @@ -0,0 +1,51 @@ +SetScale("linlin"); +$graph->img->SetMargin(50,50,60,40); +$graph->SetMarginColor('darkblue'); +$graph->SetColor('darkblue'); +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +$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(); +?> + + diff --git a/includes/jpgraph/src/Examples/inyaxisex2.php b/includes/jpgraph/src/Examples/inyaxisex2.php new file mode 100644 index 0000000..5e19d4a --- /dev/null +++ b/includes/jpgraph/src/Examples/inyaxisex2.php @@ -0,0 +1,53 @@ +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(); +?> + + diff --git a/includes/jpgraph/src/Examples/inyaxisex3.php b/includes/jpgraph/src/Examples/inyaxisex3.php new file mode 100644 index 0000000..e09567e --- /dev/null +++ b/includes/jpgraph/src/Examples/inyaxisex3.php @@ -0,0 +1,69 @@ +SetScale("linlin"); +$graph->SetY2Scale("lin"); +$graph->SetMargin(50,50,60,40); +$graph->SetMarginColor('darkblue'); +$graph->SetColor('darkblue'); + +// Setup titles +$graph->title->Set("Inverting both Y-axis"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->title->SetColor("white"); + +$graph->subtitle->Set("(Negated Y & Y2 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"); + +// Setup Y2 axis +$graph->y2axis->SetLabelFormatCallback("_cb_negate"); +$graph->y2axis->SetColor("darkred","white"); +$graph->y2scale->SetAutoMax(0); // To make sure it starts with 0 + +// Setup plot 1 +$lp1 = new LinePlot($ydata); +$lp1->SetColor("yellow"); +$lp1->SetWeight(2); +$graph->Add($lp1); + +// Setup plot 2 +$lp2 = new LinePlot($y2data); +$lp2->SetColor("darkred"); +$lp2->SetWeight(2); +$graph->AddY2($lp2); + +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/ironrod.jpg b/includes/jpgraph/src/Examples/ironrod.jpg new file mode 100644 index 0000000..0b9e8d4 Binary files /dev/null and b/includes/jpgraph/src/Examples/ironrod.jpg differ diff --git a/includes/jpgraph/src/Examples/jpglogo.jpg b/includes/jpgraph/src/Examples/jpglogo.jpg new file mode 100644 index 0000000..a7f7121 Binary files /dev/null and b/includes/jpgraph/src/Examples/jpglogo.jpg differ diff --git a/includes/jpgraph/src/Examples/jpgraph b/includes/jpgraph/src/Examples/jpgraph new file mode 120000 index 0000000..a96aa0e --- /dev/null +++ b/includes/jpgraph/src/Examples/jpgraph @@ -0,0 +1 @@ +.. \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/ledex1.php b/includes/jpgraph/src/Examples/ledex1.php new file mode 100644 index 0000000..8d61f93 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex1.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GREEN); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex10.php b/includes/jpgraph/src/Examples/ledex10.php new file mode 100644 index 0000000..3aa375f --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex10.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_KHAKI); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex11.php b/includes/jpgraph/src/Examples/ledex11.php new file mode 100644 index 0000000..857faa0 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex11.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_OLIVE); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex12.php b/includes/jpgraph/src/Examples/ledex12.php new file mode 100644 index 0000000..7756ea1 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex12.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_LIMEGREEN); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex13.php b/includes/jpgraph/src/Examples/ledex13.php new file mode 100644 index 0000000..add394d --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex13.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_FORESTGREEN); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex14.php b/includes/jpgraph/src/Examples/ledex14.php new file mode 100644 index 0000000..7a50599 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex14.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_TEAL); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex15.php b/includes/jpgraph/src/Examples/ledex15.php new file mode 100644 index 0000000..6a5bb1f --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex15.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_STEELBLUE); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex16.php b/includes/jpgraph/src/Examples/ledex16.php new file mode 100644 index 0000000..08ab731 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex16.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_NAVY); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex17.php b/includes/jpgraph/src/Examples/ledex17.php new file mode 100644 index 0000000..34f18cd --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex17.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_INVERTGRAY); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex2.php b/includes/jpgraph/src/Examples/ledex2.php new file mode 100644 index 0000000..bd196d3 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex2.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_RED); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex3.php b/includes/jpgraph/src/Examples/ledex3.php new file mode 100644 index 0000000..0d81b3d --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex3.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_YELLOW); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex4.1.php b/includes/jpgraph/src/Examples/ledex4.1.php new file mode 100644 index 0000000..81a9d1f --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex4.1.php @@ -0,0 +1,13 @@ +SetSupersampling(2); +$led->StrokeNumber('123.',LEDC_RED); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex4.2.php b/includes/jpgraph/src/Examples/ledex4.2.php new file mode 100644 index 0000000..0a25bc0 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex4.2.php @@ -0,0 +1,13 @@ +SetSupersampling(4); +$led->StrokeNumber('123.',LEDC_RED); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex4.php b/includes/jpgraph/src/Examples/ledex4.php new file mode 100644 index 0000000..d8782e2 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex4.php @@ -0,0 +1,13 @@ +SetSupersampling(1); +$led->StrokeNumber('123.',LEDC_RED); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex5.php b/includes/jpgraph/src/Examples/ledex5.php new file mode 100644 index 0000000..5526063 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex5.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_BLUE); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex6.php b/includes/jpgraph/src/Examples/ledex6.php new file mode 100644 index 0000000..eb8c03b --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex6.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GRAY); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex7.php b/includes/jpgraph/src/Examples/ledex7.php new file mode 100644 index 0000000..da6c656 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex7.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_CHOCOLATE); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex8.php b/includes/jpgraph/src/Examples/ledex8.php new file mode 100644 index 0000000..2075e26 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex8.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_PERU); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex9.php b/includes/jpgraph/src/Examples/ledex9.php new file mode 100644 index 0000000..82837d1 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex9.php @@ -0,0 +1,12 @@ +StrokeNumber('0123456789. ABCDEFGHIJKL',LEDC_GOLDENROD); + + + +?> diff --git a/includes/jpgraph/src/Examples/ledex_cyrillic.php b/includes/jpgraph/src/Examples/ledex_cyrillic.php new file mode 100644 index 0000000..b85f9d3 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex_cyrillic.php @@ -0,0 +1,27 @@ +SetSupersampling(2); +$text = 'А'. + 'Б'. + 'В'. + 'Г'. + 'Д'. + 'Е'. + 'Ё'. + 'З'. + 'И'. + 'Й'. + 'К'. + 'Л'. + 'М'. + 'Н'. + 'О'. + 'П'; +$led->StrokeNumber($text, LEDC_RED); + +?> diff --git a/includes/jpgraph/src/Examples/ledex_cyrillic2.php b/includes/jpgraph/src/Examples/ledex_cyrillic2.php new file mode 100644 index 0000000..fb00714 --- /dev/null +++ b/includes/jpgraph/src/Examples/ledex_cyrillic2.php @@ -0,0 +1,27 @@ +SetSupersampling(2); +$text = 'Р'. + 'С'. + 'Т'. + 'У'. + 'Ф'. + 'Х'. + 'Ц'. + 'Ч'. + 'Ш'. + 'Щ'. + 'Ъ'. + 'Ы'. + 'Ь'. + 'Э'. + 'Ю'. + 'Я'; +$led->StrokeNumber($text, LEDC_RED); + +?> diff --git a/includes/jpgraph/src/Examples/lightbluedarkblue400x300grad.png b/includes/jpgraph/src/Examples/lightbluedarkblue400x300grad.png new file mode 100644 index 0000000..86092ec Binary files /dev/null and b/includes/jpgraph/src/Examples/lightbluedarkblue400x300grad.png differ diff --git a/includes/jpgraph/src/Examples/linebarcentex1.php b/includes/jpgraph/src/Examples/linebarcentex1.php new file mode 100644 index 0000000..1b5e188 --- /dev/null +++ b/includes/jpgraph/src/Examples/linebarcentex1.php @@ -0,0 +1,49 @@ +GetShortMonth(); + +// Create the graph. +$graph = new Graph(400,200); +$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(); +?> diff --git a/includes/jpgraph/src/Examples/linebarex1.php b/includes/jpgraph/src/Examples/linebarex1.php new file mode 100644 index 0000000..2f4414d --- /dev/null +++ b/includes/jpgraph/src/Examples/linebarex1.php @@ -0,0 +1,75 @@ +SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); +$graph->SetShadow(); + +// Use an integer X-scale +$graph->SetScale("textlin"); + +// Set title and subtitle +$graph->title->Set("Combined bar and line plot"); +$graph->subtitle->Set("100 data points, X-Scale: 'text'"); + +// Use built in font +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Make the margin around the plot a little bit bigger +// then default +$graph->img->SetMargin(40,140,40,80); + +// Slightly adjust the legend from it's default position in the +// top right corner to middle right side +$graph->legend->Pos(0.05,0.5,"right","center"); + +// Display every 10:th datalabel +$graph->xaxis->SetTextTickInterval(6); +$graph->xaxis->SetTextLabelInterval(2); +$graph->xaxis->SetTickLabels($databarx); +$graph->xaxis->SetLabelAngle(90); + +// Create a red line plot +$p1 = new LinePlot($datay); +$p1->SetColor("red"); +$p1->SetLegend("Pressure"); + +// 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($p1); +$graph->Add($b1); + +// Finally output the image +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/linebarex2.php b/includes/jpgraph/src/Examples/linebarex2.php new file mode 100644 index 0000000..efae8e2 --- /dev/null +++ b/includes/jpgraph/src/Examples/linebarex2.php @@ -0,0 +1,59 @@ +SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); +$graph->SetShadow(); + +// Use an integer X-scale +$graph->SetScale("intlin"); + +// Set title and subtitle +$graph->title->Set("Combined bar and line plot"); +$graph->subtitle->Set("(\"left\" aligned bars)"); + +// Use built in font +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Make the margin around the plot a little bit bigger +// then default +$graph->img->SetMargin(40,120,40,40); + +// Slightly adjust the legend from it's default position in the +// top right corner to middle right side +$graph->legend->Pos(0.05,0.5,"right","center"); + +// Create a red line plot +$p1 = new LinePlot($datay,$datax); +$p1->SetColor("red"); +$p1->SetLegend("Status one"); +$graph->Add($p1); + +// Create the bar plot +$b1 = new BarPlot($databary,$databarx); +$b1->SetLegend("Status two"); +$b1->SetAlign("left"); +$b1->SetShadow(); +$graph->Add($b1); + +// Finally output the image +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/linebarex3.php b/includes/jpgraph/src/Examples/linebarex3.php new file mode 100644 index 0000000..faff220 --- /dev/null +++ b/includes/jpgraph/src/Examples/linebarex3.php @@ -0,0 +1,52 @@ +img->SetMargin(40,180,40,40); +$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); + +//$graph->img->SetAntiAliasing(); + +$graph->SetScale("intlin"); +$graph->SetShadow(); +$graph->title->Set("Combined bar and line plot"); +$graph->subtitle->Set("(\"center\" aligned bars)"); + +// 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,$datax); +$p1->SetWeight(1); +$p1->SetColor("red"); +$p1->SetLegend("Triumph Tiger -98"); +$graph->Add($p1); + +$b1 = new BarPlot($databary,$databarx); +$b1->SetAbsWidth(10); +$b1->SetAlign("center"); +$b1->SetShadow(); +$graph->Add($b1); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/linegraceex.php b/includes/jpgraph/src/Examples/linegraceex.php new file mode 100644 index 0000000..e64cdc4 --- /dev/null +++ b/includes/jpgraph/src/Examples/linegraceex.php @@ -0,0 +1,31 @@ +img->SetMargin(40,40,40,40); + +$graph->img->SetAntiAliasing(); +$graph->SetScale("textlin"); +$graph->SetShadow(); +$graph->title->Set("Example of 10% top/bottom grace"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Add 10% grace to top and bottom of plot +$graph->yscale->SetGrace(10,10); + +$p1 = new LinePlot($datay); +$p1->mark->SetType(MARK_FILLEDCIRCLE); +$p1->mark->SetFillColor("red"); +$p1->mark->SetWidth(4); +$p1->SetColor("blue"); +$p1->SetCenter(); +$graph->Add($p1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/lineiconex1.php b/includes/jpgraph/src/Examples/lineiconex1.php new file mode 100644 index 0000000..53f2b00 --- /dev/null +++ b/includes/jpgraph/src/Examples/lineiconex1.php @@ -0,0 +1,49 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/lineiconex2.php b/includes/jpgraph/src/Examples/lineiconex2.php new file mode 100644 index 0000000..d16ab8b --- /dev/null +++ b/includes/jpgraph/src/Examples/lineiconex2.php @@ -0,0 +1,32 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/lineimagefillex1.php b/includes/jpgraph/src/Examples/lineimagefillex1.php new file mode 100644 index 0000000..d2fb60a --- /dev/null +++ b/includes/jpgraph/src/Examples/lineimagefillex1.php @@ -0,0 +1,41 @@ +title->Set('Education growth'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->SetScale('intlin'); +$graph->SetMarginColor('white'); +$graph->SetBox(); +//$graph->img->SetAntialiasing(); + +$graph->SetGridDepth(DEPTH_FRONT); +$graph->ygrid->SetColor('gray@0.7'); +$graph->SetBackgroundImage('classroom.jpg',BGIMG_FILLPLOT); + +// Masking graph +$p1 = new LinePlot($datay); +$p1->SetFillColor('white'); +$p1->SetFillFromYMax(); +$p1->SetWeight(0); +$graph->Add($p1); + +// Line plot +$p2 = new LinePlot($datay); +$p2->SetColor('black@0.4'); +$p2->SetWeight(3); +$p2->mark->SetType(MARK_SQUARE); +$p2->mark->SetColor('orange@0.5'); +$p2->mark->SetFillColor('orange@0.3'); +$graph->Add($p2); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/linlogex1.php b/includes/jpgraph/src/Examples/linlogex1.php new file mode 100644 index 0000000..4c2be9d --- /dev/null +++ b/includes/jpgraph/src/Examples/linlogex1.php @@ -0,0 +1,64 @@ +SetScale("linlog"); +$graph->img->SetMargin(40,20,20,40); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->xaxis->title->Set("ab/2"); +$graph->yaxis->title->Set("rho_s"); +$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); +$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); +$graph->ygrid->Show(true,true); +$graph->xgrid->Show(true,true); + +$errorplot=new ErrorPlot($ydata, $xdata); + +$graph->Add($errorplot); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/listallflags.php b/includes/jpgraph/src/Examples/listallflags.php new file mode 100644 index 0000000..0f7a796 --- /dev/null +++ b/includes/jpgraph/src/Examples/listallflags.php @@ -0,0 +1,29 @@ +\n"; +$cols=0; +while( list($key,$val) = each($flags->iCountryNameMap) ) { + + echo '
'; + echo "$key
idx=$val\n"; + + if( ++$cols == 5 ) { + echo "\n"; + $cols=0; + } +} + +echo ""; + +?> + diff --git a/includes/jpgraph/src/Examples/listallflags_helper.php b/includes/jpgraph/src/Examples/listallflags_helper.php new file mode 100644 index 0000000..52ad9f9 --- /dev/null +++ b/includes/jpgraph/src/Examples/listallflags_helper.php @@ -0,0 +1,25 @@ +GetImgByIdx($idx); +header ("Content-type: image/png"); +ImagePng ($img); + +?> diff --git a/includes/jpgraph/src/Examples/listfontsex1.php b/includes/jpgraph/src/Examples/listfontsex1.php new file mode 100644 index 0000000..15ee50d --- /dev/null +++ b/includes/jpgraph/src/Examples/listfontsex1.php @@ -0,0 +1,154 @@ +Set(0,27,0,85); +$g->SetMargin(5,6,5,6); +$g->SetColor('white'); +$g->SetMarginColor("teal"); +$g->InitFrame(); + + +$t = new CanvasRectangleText(); +$t->SetFont(FF_ARIAL,FS_NORMAL,16); +$t->SetFillColor('lemonchiffon2'); +$t->SetFontColor('black'); +$t->Set("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTTF Fonts (11pt)",0.5,19.5,26,64.5); +$t->Stroke($g->img,$scale); + +$t->SetFillColor('lemonchiffon3'); +$t->Set("\n\n\n\nBitmap Fonts",0.5,5,26,13.5); +$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('Normal',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",FF_TIMES,FS_BOLD), + + array("Vera normal",FF_VERA,FS_NORMAL), + array("Vera italic",FF_VERA,FS_ITALIC), + array("Vera bold",FF_VERA,FS_BOLD), + + array("Vera mono normal",FF_VERAMONO,FS_NORMAL), + array("Vera mono italic",FF_VERAMONO,FS_ITALIC), + array("Vera mono bold",FF_VERAMONO,FS_BOLD), + + array("Vera serif normal",FF_VERASERIF,FS_NORMAL), + array("",FF_VERASERIF,FS_ITALIC), + array("Vera serif bold",FF_VERASERIF,FS_BOLD), + + array("DejaVu sans serif",FF_DV_SANSSERIF,FS_NORMAL), + array("DejaVu sans serif",FF_DV_SANSSERIF,FS_ITALIC), + array("DejaVu sans serif",FF_DV_SANSSERIF,FS_BOLD), + + array("DejaVu serif",FF_DV_SERIF,FS_NORMAL), + array("DejaVu serif",FF_DV_SERIF,FS_ITALIC), + array("DejaVu serif",FF_DV_SERIF,FS_BOLD), + + array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_NORMAL), + array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_ITALIC), + array("DejaVuMono sans serif",FF_DV_SANSSERIFMONO,FS_BOLD), + + array("DejaVuCond serif",FF_DV_SERIFCOND,FS_NORMAL), + array("DejaVuCond serif",FF_DV_SERIFCOND,FS_ITALIC), + array("DejaVuCond serif",FF_DV_SERIFCOND,FS_BOLD), + + array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_NORMAL), + array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_ITALIC), + array("DejaVuCond sans serif",FF_DV_SANSSERIFCOND,FS_BOLD), + + ); + + +$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],11); + $t->Stroke($g->img,$scale); + } + + $c += $w+1; + if( $c > 30-$w-2 ) { + $c = 1; + $r += 4; + } + +} + +$g->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/logbarex1.php b/includes/jpgraph/src/Examples/logbarex1.php new file mode 100644 index 0000000..a3a8a90 --- /dev/null +++ b/includes/jpgraph/src/Examples/logbarex1.php @@ -0,0 +1,48 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/loglogex1.php b/includes/jpgraph/src/Examples/loglogex1.php new file mode 100644 index 0000000..31a4a52 --- /dev/null +++ b/includes/jpgraph/src/Examples/loglogex1.php @@ -0,0 +1,59 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/manscaleex1.php b/includes/jpgraph/src/Examples/manscaleex1.php new file mode 100644 index 0000000..9a7962a --- /dev/null +++ b/includes/jpgraph/src/Examples/manscaleex1.php @@ -0,0 +1,22 @@ +SetScale("textlin",3,35); +$graph->yscale->ticks->Set(8,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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manscaleex2.php b/includes/jpgraph/src/Examples/manscaleex2.php new file mode 100644 index 0000000..d192ed8 --- /dev/null +++ b/includes/jpgraph/src/Examples/manscaleex2.php @@ -0,0 +1,21 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manscaleex3.php b/includes/jpgraph/src/Examples/manscaleex3.php new file mode 100644 index 0000000..2fdcfa2 --- /dev/null +++ b/includes/jpgraph/src/Examples/manscaleex3.php @@ -0,0 +1,23 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manscaleex4.php b/includes/jpgraph/src/Examples/manscaleex4.php new file mode 100644 index 0000000..4653ede --- /dev/null +++ b/includes/jpgraph/src/Examples/manscaleex4.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manual_textscale_ex1.php b/includes/jpgraph/src/Examples/manual_textscale_ex1.php new file mode 100644 index 0000000..a911c33 --- /dev/null +++ b/includes/jpgraph/src/Examples/manual_textscale_ex1.php @@ -0,0 +1,40 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manual_textscale_ex2.php b/includes/jpgraph/src/Examples/manual_textscale_ex2.php new file mode 100644 index 0000000..968d9dd --- /dev/null +++ b/includes/jpgraph/src/Examples/manual_textscale_ex2.php @@ -0,0 +1,40 @@ +GetShortMonth(); + +// New graph with a drop shadow +$graph = new Graph(300,200); +$graph->SetShadow(); + +// Use a "text" X-scale +$graph->SetScale('textlin'); + +// Specify X-labels +$graph->xaxis->SetTickLabels($months); +$graph->xaxis->SetTextTickInterval(2,0); + +// Set title and subtitle +$graph->title->Set('Textscale with tickinterval=2'); + +// Use built in font +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Create the bar plot +$b1 = new BarPlot($databary); +$b1->SetLegend('Temperature'); + +// The order the plots are added determines who's ontop +$graph->Add($b1); + +// Finally output the image +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manual_textscale_ex3.php b/includes/jpgraph/src/Examples/manual_textscale_ex3.php new file mode 100644 index 0000000..18d718c --- /dev/null +++ b/includes/jpgraph/src/Examples/manual_textscale_ex3.php @@ -0,0 +1,40 @@ +GetShortMonth(); + +// New graph with a drop shadow +$graph = new Graph(300,200); +$graph->SetShadow(); + +// Use a "text" X-scale +$graph->SetScale('textlin'); + +// Specify X-labels +$graph->xaxis->SetTickLabels($months); +$graph->xaxis->SetTextLabelInterval(2); + +// Set title and subtitle +$graph->title->Set('Textscale with tickinterval=2'); + +// Use built in font +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Create the bar plot +$b1 = new BarPlot($databary); +$b1->SetLegend('Temperature'); + +// The order the plots are added determines who's ontop +$graph->Add($b1); + +// Finally output the image +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manual_textscale_ex4.php b/includes/jpgraph/src/Examples/manual_textscale_ex4.php new file mode 100644 index 0000000..99146fa --- /dev/null +++ b/includes/jpgraph/src/Examples/manual_textscale_ex4.php @@ -0,0 +1,51 @@ +GetShortMonth(); +$k=0; +for($i=0; $i < 480; ++$i) { + $datay[$i] = rand(1,40); + if( $i % DATAPERMONTH === 0 ) + $months[$i] = $m[(int)($i/DATAPERMONTH)]; + else + $months[$i] = 'xx'; +} + + +// New graph with a drop shadow +$graph = new Graph(400,200); +//$graph->SetShadow(); + +// Use a "text" X-scale +$graph->SetScale('textlin'); + +// Specify X-labels +$graph->xaxis->SetTickLabels($months); +$graph->xaxis->SetTextTickInterval(DATAPERMONTH,0); +$graph->xaxis->SetTextLabelInterval(2); + +// Set title and subtitle +$graph->title->Set('Textscale with tickinterval=2'); + +// Use built in font +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->SetBox(true,'red'); + +// Create the bar plot +$lp1 = new LinePlot($datay); +$lp1->SetLegend('Temperature'); + +// The order the plots are added determines who's ontop +$graph->Add($lp1); + +// Finally output the image +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manualtickex1.php b/includes/jpgraph/src/Examples/manualtickex1.php new file mode 100644 index 0000000..47d0b8d --- /dev/null +++ b/includes/jpgraph/src/Examples/manualtickex1.php @@ -0,0 +1,73 @@ +GetTicks($datax); + +// We add some grace to the end of the X-axis scale so that the first and last +// data point isn't exactly at the very end or beginning of the scale +$grace = 400000; +$xmin = $datax[0]-$grace; +$xmax = $datax[$n-1]+$grace; + +// +// The code to setup a very basic graph +// +$graph = new Graph(400,200); + +// +// We use an integer scale on the X-axis since the positions on the X axis +// are assumed to be UNI timestamps +$graph->SetScale('intlin',0,0,$xmin,$xmax); +$graph->title->Set('Basic example with manual ticks'); +$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); + +// +// Make sure that the X-axis is always at the bottom of the scale +// (By default the X-axis is alwys positioned at Y=0 so if the scale +// doesn't happen to include 0 the axis will not be shown) +$graph->xaxis->SetPos('min'); + +// Now set the tic positions +$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); + +// The labels should be formatted at dates with "Year-month" +$graph->xaxis->SetLabelFormatString('My',true); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); + +// Add a X-grid +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($datay,$datax); +$p1->SetColor('teal'); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manualtickex1a.php b/includes/jpgraph/src/Examples/manualtickex1a.php new file mode 100644 index 0000000..47d0b8d --- /dev/null +++ b/includes/jpgraph/src/Examples/manualtickex1a.php @@ -0,0 +1,73 @@ +GetTicks($datax); + +// We add some grace to the end of the X-axis scale so that the first and last +// data point isn't exactly at the very end or beginning of the scale +$grace = 400000; +$xmin = $datax[0]-$grace; +$xmax = $datax[$n-1]+$grace; + +// +// The code to setup a very basic graph +// +$graph = new Graph(400,200); + +// +// We use an integer scale on the X-axis since the positions on the X axis +// are assumed to be UNI timestamps +$graph->SetScale('intlin',0,0,$xmin,$xmax); +$graph->title->Set('Basic example with manual ticks'); +$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); + +// +// Make sure that the X-axis is always at the bottom of the scale +// (By default the X-axis is alwys positioned at Y=0 so if the scale +// doesn't happen to include 0 the axis will not be shown) +$graph->xaxis->SetPos('min'); + +// Now set the tic positions +$graph->xaxis->SetTickPositions($tickPositions,$minTickPositions); + +// The labels should be formatted at dates with "Year-month" +$graph->xaxis->SetLabelFormatString('My',true); + +// Use Ariel font +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9); + +// Add a X-grid +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($datay,$datax); +$p1->SetColor('teal'); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manualtickex2.php b/includes/jpgraph/src/Examples/manualtickex2.php new file mode 100644 index 0000000..abd7e10 --- /dev/null +++ b/includes/jpgraph/src/Examples/manualtickex2.php @@ -0,0 +1,72 @@ +E(0,10); + +// Now get labels at 1/2 PI intervall +$tickPositions = array(); +$tickLabels = array(); +$tickPositions[0] = 0; +$tickLabels[0] = '0'; +for($i=1; $i/2*M_PI < 11 ; ++$i ) { + $tickPositions[$i] = $i/2*M_PI; + if( $i % 2 ) + $tickLabels[$i] = $i.'/2'.SymChar::Get('pi'); + else + $tickLabels[$i] = ($i/2).SymChar::Get('pi'); +} + +$n = count($datax); +$xmin = $datax[0]; +$xmax = $datax[$n-1]; + +// +// The code to setup a very basic graph +// +$graph = new Graph(400,200); + +// +// We use an integer scale on the X-axis since the positions on the X axis +// are assumed to be UNI timestamps +$graph->SetScale('linlin',0,0,$xmin,$xmax); +$graph->title->Set('Example with manual tick labels'); +$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12); + +// +// Make sure that the X-axis is always at the bottom of the scale +// (By default the X-axis is alwys positioned at Y=0 so if the scale +// doesn't happen to include 0 the axis will not be shown) +$graph->xaxis->SetPos('min'); + +// Now set the tic positions +$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); + +// Use Times font +$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,10); +$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,10); + +// Add a X-grid +$graph->xgrid->Show(); + +// Create the plot line +$p1 = new LinePlot($datay,$datax); +$p1->SetColor('teal'); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manualtickex3.php b/includes/jpgraph/src/Examples/manualtickex3.php new file mode 100644 index 0000000..0bd03ce --- /dev/null +++ b/includes/jpgraph/src/Examples/manualtickex3.php @@ -0,0 +1,91 @@ +E(0,10); + +// Now get labels at 1/2 PI intervall +$tickPositions = array(); +$tickLabels = array(); +$tickPositions[0] = 0; +$tickLabels[0] = '0'; +for($i=1; $i/2*M_PI < 11 ; ++$i ) { + $tickPositions[$i] = $i/2*M_PI; + if( $i % 2 ) + $tickLabels[$i] = $i.'/2'.SymChar::Get('pi'); + else + $tickLabels[$i] = ($i/2).SymChar::Get('pi'); +} + +$n = count($datax); +$xmin = $datax[0]; +$xmax = $datax[$n-1]; + +// +// The code to setup a very basic graph +// +$graph = new Graph(400,200); + +// We use an integer scale on the X-axis since the positions on the X axis +// are assumed to be UNI timestamps +$graph->SetScale('linlin',0,0,$xmin,$xmax); +$graph->title->Set('Example with manual tick labels'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->SetColor('white'); + +// Setup a abackground gradient +$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN); +$graph->SetPlotGradient('black','darkred:0.8', 2); + +// Make sure that the X-axis is always at the bottom of the scale +// (By default the X-axis is alwys positioned at Y=0 so if the scale +// doesn't happen to include 0 the axis will not be shown) +$graph->xaxis->SetPos('min'); + +// Now set the tic positions +$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); + +// Use Times font +$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,11); +$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,9); + +// Set colors for axis +$graph->xaxis->SetColor('lightgray'); +$graph->yaxis->SetColor('lightgray'); + +// Add a X-grid +$graph->xgrid->Show(); + +// Show ticks outwards +$graph->xaxis->SetTickSide(SIDE_DOWN); +$graph->xaxis->SetLabelMargin(8); +$graph->yaxis->SetTickSide(SIDE_LEFT); + +// Setup a filled y-grid +//$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7'); +$graph->ygrid->SetStyle('dotted'); +$graph->xgrid->SetStyle('dashed'); + +// Create the plot line +$p1 = new LinePlot($datay,$datax); +$p1->SetWeight(2); +$p1->SetColor('orange:0.9'); +$p1->SetFillColor('white@0.7'); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/manualtickex4.php b/includes/jpgraph/src/Examples/manualtickex4.php new file mode 100644 index 0000000..f4a80e6 --- /dev/null +++ b/includes/jpgraph/src/Examples/manualtickex4.php @@ -0,0 +1,92 @@ +E(0,10); + +// Now get labels at 1/2 PI intervall +$tickPositions = array(); +$tickLabels = array(); +$tickPositions[0] = 0; +$tickLabels[0] = '0'; +for($i=1; $i/2*M_PI < 11 ; ++$i ) { + $tickPositions[$i] = $i/2*M_PI; + if( $i % 2 ) + $tickLabels[$i] = $i.'/2'.SymChar::Get('pi'); + else + $tickLabels[$i] = ($i/2).SymChar::Get('pi'); +} + +$n = count($datax); +$xmin = $datax[0]; +$xmax = $datax[$n-1]; + +// +// The code to setup a very basic graph +// +$graph = new Graph(400,200); + +// We use an integer scale on the X-axis since the positions on the X axis +// are assumed to be UNI timestamps +$graph->SetScale('linlin',0,0,$xmin,$xmax); +$graph->title->Set('Example with manual tick labels'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->SetColor('white'); + +// Setup a abackground gradient +$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN); +$graph->SetPlotGradient('black','darkred:0.8', 2); + +// Make sure that the X-axis is always at the bottom of the scale +// (By default the X-axis is alwys positioned at Y=0 so if the scale +// doesn't happen to include 0 the axis will not be shown) +$graph->xaxis->SetPos('min'); + +// Now set the tic positions +$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels); + +// Use Times font +$graph->xaxis->SetFont(FF_TIMES,FS_NORMAL,11); +$graph->yaxis->SetFont(FF_TIMES,FS_NORMAL,9); + +// Set colors for axis +$graph->xaxis->SetColor('lightgray'); +$graph->yaxis->SetColor('lightgray'); + +// Add a X-grid +$graph->xgrid->Show(); + +// Show ticks outwards +$graph->xaxis->SetTickSide(SIDE_DOWN); +$graph->xaxis->SetLabelMargin(8); +$graph->yaxis->SetTickSide(SIDE_LEFT); + +// Setup a filled y-grid +//$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7'); +$graph->ygrid->SetStyle('dotted'); +$graph->xgrid->SetStyle('dashed'); + +// Create the plot line +$p1 = new LinePlot($datay,$datax); +$p1->SetWeight(2); +$p1->SetColor('orange:0.9'); +$p1->SetFillColor('white@0.7'); +$p1->SetFillFromYMin(); +$graph->Add($p1); + +// Output graph +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/markflagex1.php b/includes/jpgraph/src/Examples/markflagex1.php new file mode 100644 index 0000000..576134e --- /dev/null +++ b/includes/jpgraph/src/Examples/markflagex1.php @@ -0,0 +1,74 @@ +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,197); + +// 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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/matrix_csimex01.php b/includes/jpgraph/src/Examples/matrix_csimex01.php new file mode 100644 index 0000000..76bb0a1 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_csimex01.php @@ -0,0 +1,76 @@ +SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3'); +$graph->title->Set('CSIM with matrix'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); +$graph->title->SetColor('white'); + +// Create one matrix plot +$mp = new MatrixPlot($data,1); +$mp->SetModuleSize(13,15); +$mp->SetCenterPos(0.35,0.6); +$mp->colormap->SetNullColor('gray'); + +// Setup column lablels +$mp->collabel->Set($collabels); +$mp->collabel->SetSide('top'); +$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8); +$mp->collabel->SetFontColor('lightgray'); + +// Setup row lablels +$mp->rowlabel->Set($rowlabels); +$mp->rowlabel->SetSide('right'); +$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8); +$mp->rowlabel->SetFontColor('lightgray'); + +$mp->rowlabel->SetCSIMTargets($rowlabeltargets); +$mp->collabel->SetCSIMTargets($collabeltargets); + +// Move the legend more to the right +$mp->legend->SetMargin(90); +$mp->legend->SetColor('white'); +$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10); + +$mp->SetCSIMTargets($csimtargets); + +$graph->Add($mp); +$graph->StrokeCSIM(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_edgeex01.php b/includes/jpgraph/src/Examples/matrix_edgeex01.php new file mode 100644 index 0000000..e66fd77 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_edgeex01.php @@ -0,0 +1,53 @@ +SetMarginColor('white'); +$graph->title->Set('Adding labels on the edges'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Create one matrix plot +$mp = new MatrixPlot($data,1); +$mp->SetModuleSize(13,15); +$mp->SetCenterPos(0.35,0.45); +$mp->colormap->SetNullColor('gray'); + +// Setup column lablels +$mp->collabel->Set($xlabels); +$mp->collabel->SetSide('bottom'); +$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8); +$mp->collabel->SetFontColor('darkgray'); + +// Setup row lablels +$mp->rowlabel->Set($ylabels); +$mp->rowlabel->SetSide('right'); +$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8); +$mp->rowlabel->SetFontColor('darkgray'); + +// Move the legend more to the right +$mp->legend->SetMargin(90); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_edgeex02.php b/includes/jpgraph/src/Examples/matrix_edgeex02.php new file mode 100644 index 0000000..c07ba6a --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_edgeex02.php @@ -0,0 +1,51 @@ +title->Set('Add ine row/col labels'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$mp = new MatrixPlot($data,1); +$mp->SetSize(0.55); +$mp->SetCenterPos(0.45, 0.45); + +$rowtitles = array(); +for( $i=0; $i < $nrow; ++$i ) { + $rowtitles[$i] = sprintf('Row: %02d',$i); +} +$coltitles = array(); +for( $i=0; $i < $ncol; ++$i ) { + $coltitles[$i] = sprintf('Col: %02d',$i); +} + +$mp->rowlabel->Set($rowtitles); +$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,10); +$mp->rowlabel->SetFontColor('blue'); +$mp->rowlabel->SetSide('left'); + +$mp->collabel->Set($coltitles); +$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,10); +$mp->collabel->SetFontColor('darkred'); +$mp->collabel->SetAngle(70); // 90 is default for col titles +$mp->collabel->SetSide('bottom'); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex0.php b/includes/jpgraph/src/Examples/matrix_ex0.php new file mode 100644 index 0000000..43777cf --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex0.php @@ -0,0 +1,28 @@ +title->Set('Basic matrix example'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Create a ,atrix plot using all default values +$mp = new MatrixPlot($data); +$graph->Add($mp); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex01.php b/includes/jpgraph/src/Examples/matrix_ex01.php new file mode 100644 index 0000000..d0387dd --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex01.php @@ -0,0 +1,38 @@ +title->Set('Possible legend positions'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$mp = array(); +$n = 4; +$pos = array(0.3,0.33, 0.8,0.68, + 0.3,0.68, 0.8,0.33); +for($i=0; $i < $n; ++$i){ + $mp[$i] = new MatrixPlot($data); + $mp[$i]->colormap->SetMap($i); + $mp[$i]->SetModuleSize(4,5); + $mp[$i]->SetLegendLayout($i); + $mp[$i]->SetCenterPos($pos[$i*2],$pos[$i*2+1]); +} + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex02.php b/includes/jpgraph/src/Examples/matrix_ex02.php new file mode 100644 index 0000000..f81e59c --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex02.php @@ -0,0 +1,32 @@ +title->Set('Meshinterpolation=3'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$mp = new MatrixPlot($data,1); +$mp->colormap->SetMap(0); +$mp->SetSize(200,160); +$mp->SetCenterPos(0.5,0.55); +$mp->legend->Show(false); +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex03.php b/includes/jpgraph/src/Examples/matrix_ex03.php new file mode 100644 index 0000000..a943acd --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex03.php @@ -0,0 +1,36 @@ +title->Set('Adding an icon to the background'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$mp = new MatrixPlot($data,1); +$mp->SetSize(0.6); + +$icon = new IconPlot('icon.jpg',$width-1,$height-1,0.8,50); +$icon->SetAnchor('right','bottom'); +$graph->Add($icon); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex04.1.php b/includes/jpgraph/src/Examples/matrix_ex04.1.php new file mode 100644 index 0000000..419a437 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex04.1.php @@ -0,0 +1,40 @@ +title->Set('Adding a background image'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->subtitle->Set('Alphablending = 0.2'); + +// Add a stretched background image +$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME); +$graph->SetBackgroundImageMix(50); + +$mp = new MatrixPlot($data,1); +$mp->SetSize(0.65); +$mp->SetCenterPos(0.5,0.5); +$mp->SetLegendLayout(1); +$mp->SetAlpha(0.2); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex04.2.php b/includes/jpgraph/src/Examples/matrix_ex04.2.php new file mode 100644 index 0000000..6650444 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex04.2.php @@ -0,0 +1,40 @@ +title->Set('Adding a background image'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->subtitle->Set('Alphablending = 0.7'); + +// Add a stretched background image +$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME); +$graph->SetBackgroundImageMix(50); + +$mp = new MatrixPlot($data,1); +$mp->SetSize(0.65); +$mp->SetCenterPos(0.5,0.5); +$mp->SetLegendLayout(1); +$mp->SetAlpha(0.7); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex04.php b/includes/jpgraph/src/Examples/matrix_ex04.php new file mode 100644 index 0000000..2917f15 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex04.php @@ -0,0 +1,38 @@ +title->Set('Adding a background image'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Add a stretched background image +$graph->SetBackgroundImage('ironrod.jpg',BGIMG_FILLFRAME); +$graph->SetBackgroundImageMix(50); + +$mp = new MatrixPlot($data,1); +$mp->SetSize(0.6); +$mp->SetCenterPos(0.5,0.5); +$mp->SetLegendLayout(1); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex05.php b/includes/jpgraph/src/Examples/matrix_ex05.php new file mode 100644 index 0000000..d3f989e --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex05.php @@ -0,0 +1,31 @@ +title->Set('Using a circular module type'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$mp = new MatrixPlot($data,2); +$mp->SetSize(0.85); +$mp->SetModuleType(1); +$mp->SetBackgroundColor('teal:1.8'); +$mp->SetCenterPos(0.5,0.45); +$mp->SetLegendLayout(1); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_ex06.php b/includes/jpgraph/src/Examples/matrix_ex06.php new file mode 100644 index 0000000..7c3d472 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_ex06.php @@ -0,0 +1,75 @@ +SetBackgroundGradient('lightsteelblue:0.8','lightsteelblue:0.3'); +$graph->title->Set('Matrix with lines'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,18); +$graph->title->SetColor('white'); + +// Create two lines to add as markers +$l1 = new PlotLine(VERTICAL, 5, 'lightgray:1.5', 4); +$l2 = new PlotLine(HORIZONTAL, 3, 'lightgray:1.5', 4); + +// Create one matrix plot +$mp = new MatrixPlot($data,1); +$mp->SetModuleSize(13,15); +$mp->SetCenterPos(0.35,0.6); +$mp->colormap->SetNullColor('gray'); + +// Add lines +$mp->AddLine($l1); +$mp->AddLine($l2); +// this could also be done as +// $mp->AddLine(array($l1,$l2)); + +// Setup column lablels +$mp->collabel->Set($collabels); +$mp->collabel->SetSide('top'); +$mp->collabel->SetFont(FF_ARIAL,FS_NORMAL,8); +$mp->collabel->SetFontColor('lightgray'); + +// Setup row lablels +$mp->rowlabel->Set($rowlabels); +$mp->rowlabel->SetSide('right'); +$mp->rowlabel->SetFont(FF_ARIAL,FS_NORMAL,8); +$mp->rowlabel->SetFontColor('lightgray'); + +// Move the legend more to the right +$mp->legend->SetMargin(90); +$mp->legend->SetColor('white'); +$mp->legend->SetFont(FF_VERDANA,FS_BOLD,10); + +$graph->Add($mp); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrix_introex.php b/includes/jpgraph/src/Examples/matrix_introex.php new file mode 100644 index 0000000..fcecc40 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_introex.php @@ -0,0 +1,89 @@ +Push(); + +//-------------------------------------------------------------- +// Setup a basic matrix graph +//-------------------------------------------------------------- +$width = 740; $height = 500; +$graph = new MatrixGraph($width,$height); +$graph->SetMargin(1,2,70,1); +$graph->SetColor('white'); +$graph->SetMarginColor('#fafafa'); +$graph->title->Set('Intro matrix graph'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Setup the background image +$graph->SetBackgroundImage('fireplace.jpg',BGIMG_FILLPLOT); +$graph->SetBackgroundImageMix(50); + +// Setup the timer in the right footer +$graph->footer->SetTimer($timer); +$graph->footer->right->SetColor('white'); + +//-------------------------------------------------------------- +// Create the 2 matrix plots +//-------------------------------------------------------------- +$mp = array(); $n = 2; +for($i=0; $i < $n; ++$i){ + $mp[$i] = new MatrixPlot($data); + $mp[$i]->colormap->SetMap($i); + $mp[$i]->SetSize(300,250); + $mp[$i]->SetLegendLayout(1); + $mp[$i]->SetAlpha(0.2); + + // Make the legend slightly longer than default + $mp[$i]->legend->SetSize(20,280); +} +$mp[1]->colormap->SetMap(3); + +$hor1 = new LayoutHor(array($mp[0],$mp[1])); +$hor1->SetCenterPos(0.5,0.5); + +$graph->Add($hor1); + +//-------------------------------------------------------------- +// Add texts to the graph +//-------------------------------------------------------------- +$txts = array( + array('Temperature gradient',$width/2,80), + array('Heat color map',200,110), + array('High contrast map',560,110)); + +$n=count($txts); +$t=array(); +for($i=0; $i < $n; ++$i){ + $t[$i] = new Text($txts[$i][0],$txts[$i][1],$txts[$i][2]); + $t[$i]->SetFont(FF_ARIAL,FS_BOLD,14); + $t[$i]->SetColor('white'); + $t[$i]->SetAlign('center','top'); +} +$graph->Add($t); + +//-------------------------------------------------------------- +// Add Jpgraph logo to top left corner +//-------------------------------------------------------------- +$icon = new IconPlot('jpglogo.jpg',2,2,0.9,50); +$graph->Add($icon); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/matrix_layout_ex1.php b/includes/jpgraph/src/Examples/matrix_layout_ex1.php new file mode 100644 index 0000000..1fefb1a --- /dev/null +++ b/includes/jpgraph/src/Examples/matrix_layout_ex1.php @@ -0,0 +1,44 @@ +title->Set('Matrix layout example'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$mp = array(); +$n = 5; +for($i=0; $i < $n; ++$i){ + $mp[$i] = new MatrixPlot($data); + $mp[$i]->colormap->SetMap($i); + if( $i < 2 ) + $mp[$i]->SetSize(0.35); + else + $mp[$i]->SetSize(0.21); + // We need to make the legend a bit smaller since by + // defalt has a ~45% height + $mp[$i]->legend->SetModuleSize(15,2); +} + +$hor1 = new LayoutHor(array($mp[0],$mp[1])); +$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4])); +$vert = new LayoutVert(array($hor1,$hor2)); +$vert->SetCenterPos(0.45,0.5); + +$graph->Add($vert); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/matrixex00.php b/includes/jpgraph/src/Examples/matrixex00.php new file mode 100644 index 0000000..2ba5114 --- /dev/null +++ b/includes/jpgraph/src/Examples/matrixex00.php @@ -0,0 +1,59 @@ +title->Set('Matrix example 00'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +//$graph->SetColor('darkgreen@0.8'); + +$mp = array(); +$n = 5; +for($i=0; $i < $n; ++$i){ + $mp[$i] = new MatrixPlot($data); + $mp[$i]->colormap->SetMap($i); + if( $i < 2 ) + $mp[$i]->SetSize(0.35); + else + $mp[$i]->SetSize(0.21); +} + +$hor1 = new LayoutHor(array($mp[0],$mp[1])); +$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4])); +$vert = new LayoutVert(array($hor1,$hor2)); +$vert->SetCenterPos(0.45,0.5); + +//$mp = new MatrixPlot($data); +//$mp->colormap->SetMap(2); +//$mp->SetCenterPos(0.5, 0.45); +//$mp->SetLegendLayout(0); +//$mp->SetSize(0.6); +//$mp->legend->Show(false); +//$mp->SetModuleSize(5,5); + +//$mp->legend->SetModuleSize(20,4); +//$mp->legend->SetSize(20,0.5); + +//$t = new Text('A text string',10,10); +//$graph->Add($t); + +//$graph->Add($mp); + +$graph->Add($vert); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/mkgrad.php b/includes/jpgraph/src/Examples/mkgrad.php new file mode 100644 index 0000000..3f36b44 --- /dev/null +++ b/includes/jpgraph/src/Examples/mkgrad.php @@ -0,0 +1,171 @@ +iColors = array_keys($rgb->rgb_table); + usort($this->iColors,'_cmp'); + + $this->iGradstyles = array( + "Vertical",2, + "Horizontal",1, + "Vertical from middle",3, + "Horizontal from middle",4, + "Horizontal wider middle",6, + "Vertical wider middle",7, + "Rectangle",5 ); + } + + function Run() { + + echo '

Generate gradient background

'; + echo '
'; + echo ''; + echo "\n"; + echo ''; + echo "\n"; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
Width:
'.$this->GenHTMLInput('w',8,4,300).'
Height:
'.$this->GenHTMLInput('h',8,4,300).'
From Color:
'; + echo $this->GenHTMLSelect('fc',$this->iColors); + echo '
To Color:
'; + echo $this->GenHTMLSelect('tc',$this->iColors); + echo '
Gradient style:
'; + echo $this->GenHTMLSelectCode('s',$this->iGradstyles); + echo '
Filename: (empty to stream)
'; + echo $this->GenHTMLInput('fn',55,100); + echo '
'.$this->GenHTMLSubmit('submit').'
'; + echo '
'; + + } + + function GenHTMLSubmit($name) { + return ''; + } + + + function GenHTMLInput($name,$len,$maxlen=100,$val='') { + return ''; + } + + function GenHTMLSelect($name,$option,$selected="",$size=0) { + $txt="\n"; + } + + function GenHTMLSelectCode($name,$option,$selected="",$size=0) { + $txt="\n"; + } + +} + +// Basic application driver + +class Driver { + var $iGraph, $iGrad; + var $iWidth,$iHeight; + var $iFromColor, $iToColor; + var $iStyle; + var $iForm; + + function Driver() { + $this->iForm = new Form(); + } + + function GenGradImage() { + + $aWidth = (int)@$_POST['w']; + $aHeight = (int)@$_POST['h']; + $aFrom = @$_POST['fc']; + $aTo = @$_POST['tc']; + $aStyle = @$_POST['s']; + $aFileName = @$_POST['fn']; + + $this->iWidth = $aWidth; + $this->iHeight = $aHeight; + $this->iFromColor = $aFrom; + $this->iToColor = $aTo; + $this->iStyle = $aStyle; + + $this->graph = new CanvasGraph($aWidth,$aHeight); + $this->grad = new Gradient($this->graph->img); + $this->grad->FilledRectangle(0,0, + $this->iWidth,$this->iHeight, + $this->iFromColor, + $this->iToColor, + $this->iStyle); + + if( $aFileName != "" ) { + $this->graph->Stroke($aFileName); + echo "Image file '$aFileName' created."; + } + else + $this->graph->Stroke(); + } + + + function Run() { + + global $HTTP_POST_VARS; + + // Two modes: + // 1) If the script is called with no posted arguments + // we show the input form. + // 2) If we have posted arguments we naivly assume that + // we are called to do the image. + + if( @$_POST['ok']===' Ok ' ) { + $this->GenGradImage(); + } + else + $this->iForm->Run(); + } +} + +$driver = new Driver(); +$driver->Run(); + +?> diff --git a/includes/jpgraph/src/Examples/multconstganttex01.php b/includes/jpgraph/src/Examples/multconstganttex01.php new file mode 100644 index 0000000..fce986e --- /dev/null +++ b/includes/jpgraph/src/Examples/multconstganttex01.php @@ -0,0 +1,30 @@ +title->Set("Example with multiple constrains"); + +$bar1 = new GanttBar(0, "Label 1", "2003-06-08", "2003-06-12"); +$bar2 = new GanttBar(1, "Label 2", "2003-06-16", "2003-06-19"); +$bar3 = new GanttBar(2, "Label 3", "2003-06-15", "2003-06-21"); + +//create constraints +$bar1->SetConstrain(1, CONSTRAIN_ENDSTART); +$bar1->SetConstrain(2, CONSTRAIN_ENDSTART); + +// Setup scale +$graph->ShowHeaders(/*GANTT_HYEAR | GANTT_HMONTH |*/ GANTT_HDAY | GANTT_HWEEK); +$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR); + +// Add the specified activities +$graph->Add($bar1); +$graph->Add($bar2); +$graph->Add($bar3); + +// .. and stroke the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/mulyaxiscsimex1.php b/includes/jpgraph/src/Examples/mulyaxiscsimex1.php new file mode 100644 index 0000000..516aea3 --- /dev/null +++ b/includes/jpgraph/src/Examples/mulyaxiscsimex1.php @@ -0,0 +1,75 @@ +SetMargin(60,180,50,40); +$graph->SetMarginColor('white'); +$graph->title->Set("Multi Y-axes with Image Map"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Setup the scales for all axes +$graph->SetScale("intlin"); +$graph->SetYScale(0,'int'); +$graph->SetYScale(1,'int'); + +// Standard Y-axis plot +$lp1 = new LinePlot($datay1); +$lp1->SetLegend('2001'); +$lp1->mark->SetType(MARK_DIAMOND); +$lp1->mark->SetWidth(15); +$lp1->mark->SetFillColor('orange'); +$lp1->SetCSIMTargets($targ1,$alts1); +$graph->yaxis->title->Set('Basic Rate'); +$graph->yaxis->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->yaxis->title->SetColor('black'); +$graph->Add($lp1); + +// First multi Y-axis plot +$lp2 = new LinePlot($datay2); +$lp2->SetLegend('2002'); +$lp2->mark->SetType(MARK_DIAMOND); +$lp2->mark->SetWidth(15); +$lp2->mark->SetFillColor('darkred'); +$lp2->SetCSIMTargets($targ2,$alts2); +$graph->ynaxis[0]->SetColor('darkred'); +$graph->ynaxis[0]->title->Set('Rate A'); +$graph->ynaxis[0]->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->ynaxis[0]->title->SetColor('darkred'); +$graph->AddY(0,$lp2); + +// Second multi Y-axis plot +$lp3 = new LinePlot($datay3); +$lp3->SetLegend('2003'); +$lp3->mark->SetType(MARK_DIAMOND); +$lp3->mark->SetWidth(15); +$lp3->mark->SetFillColor('darkgreen'); +$lp3->SetCSIMTargets($targ3,$alts3); +$graph->ynaxis[1]->SetColor('darkgreen'); +$graph->ynaxis[1]->title->Set('Rate B'); +$graph->ynaxis[1]->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->ynaxis[1]->title->SetColor('darkgreen'); +$graph->AddY(1,$lp3); + +// Send back the HTML page which will call this script again +// to retrieve the image. +$graph->StrokeCSIM(); +?> diff --git a/includes/jpgraph/src/Examples/mulyaxisex1.php b/includes/jpgraph/src/Examples/mulyaxisex1.php new file mode 100644 index 0000000..57304eb --- /dev/null +++ b/includes/jpgraph/src/Examples/mulyaxisex1.php @@ -0,0 +1,48 @@ +SetMargin(40,150,40,30); +$graph->SetMarginColor('white'); + +$graph->SetScale('intlin'); +$graph->title->Set('Using multiple Y-axis'); +$graph->title->SetFont(FF_ARIAL,FS_NORMAL,14); + +$graph->SetYScale(0,'lin'); +$graph->SetYScale(1,'lin'); +$graph->SetYScale(2,'lin'); + +$p1 = new LinePlot($datay); +$graph->Add($p1); + +$p2 = new LinePlot($datay2); +$p2->SetColor('teal'); +$graph->AddY(0,$p2); +$graph->ynaxis[0]->SetColor('teal'); + +$p3 = new LinePlot($datay3); +$p3->SetColor('red'); +$graph->AddY(1,$p3); +$graph->ynaxis[1]->SetColor('red'); + +$p4 = new LinePlot($datay4); +$p4->SetColor('blue'); +$graph->AddY(2,$p4); +$graph->ynaxis[2]->SetColor('blue'); + +// Output line +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/negbarvalueex01.php b/includes/jpgraph/src/Examples/negbarvalueex01.php new file mode 100644 index 0000000..f825a59 --- /dev/null +++ b/includes/jpgraph/src/Examples/negbarvalueex01.php @@ -0,0 +1,39 @@ +img->SetMargin(60,30,40,40); +$graph->SetScale("textlin"); +$graph->SetShadow(); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor("orange"); + +// DIsplay value at top of each bar +$bplot->value->Show(); +$bplot->SetShadow(); + +$graph->Add($bplot); + +// Position the scale at the min of the other axis +$graph->xaxis->SetPos("min"); + +// Add 10% more space at top and bottom of graph +$graph->yscale->SetGrace(10,10); + +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12); +$graph->title->Set("Example of bar plot with absolute labels"); + +$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/new1.gif b/includes/jpgraph/src/Examples/new1.gif new file mode 100644 index 0000000..7c8a296 Binary files /dev/null and b/includes/jpgraph/src/Examples/new1.gif differ diff --git a/includes/jpgraph/src/Examples/new2.gif b/includes/jpgraph/src/Examples/new2.gif new file mode 100644 index 0000000..b9620d7 Binary files /dev/null and b/includes/jpgraph/src/Examples/new2.gif differ diff --git a/includes/jpgraph/src/Examples/new_bar1.php b/includes/jpgraph/src/Examples/new_bar1.php new file mode 100644 index 0000000..589b4c3 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_bar1.php @@ -0,0 +1,49 @@ +SetScale("textlin"); + +$theme_class=new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135)); +$graph->SetBox(false); + +$graph->ygrid->SetFill(false); +$graph->xaxis->SetTickLabels(array('A','B','C','D')); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); + +// Create the bar plots +$b1plot = new BarPlot($data1y); +$b2plot = new BarPlot($data2y); +$b3plot = new BarPlot($data3y); + +// Create the grouped bar plot +$gbplot = new GroupBarPlot(array($b1plot,$b2plot,$b3plot)); +// ...and add it to the graPH +$graph->Add($gbplot); + + +$b1plot->SetColor("white"); +$b1plot->SetFillColor("#cc1111"); + +$b2plot->SetColor("white"); +$b2plot->SetFillColor("#11cccc"); + +$b3plot->SetColor("white"); +$b3plot->SetFillColor("#1111cc"); + +$graph->title->Set("Bar Plots"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/new_bar3.php b/includes/jpgraph/src/Examples/new_bar3.php new file mode 100644 index 0000000..2d8b9e6 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_bar3.php @@ -0,0 +1,39 @@ +SetScale("textlin"); + +//$theme_class="DefaultTheme"; +//$graph->SetTheme(new $theme_class()); + +// set major and minor tick positions manually +$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135)); +$graph->SetBox(false); + +//$graph->ygrid->SetColor('gray'); +$graph->ygrid->SetFill(false); +$graph->xaxis->SetTickLabels(array('A','B','C','D')); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); + +// Create the bar plots +$b1plot = new BarPlot($datay); + +// ...and add it to the graPH +$graph->Add($b1plot); + + +$b1plot->SetColor("white"); +$b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION); +$b1plot->SetWidth(45); +$graph->title->Set("Bar Gradient(Left reflection)"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/new_bar4.php b/includes/jpgraph/src/Examples/new_bar4.php new file mode 100644 index 0000000..8415c09 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_bar4.php @@ -0,0 +1,43 @@ +SetScale("textlin"); + +$theme_class=new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->Set90AndMargin(50,40,40,40); +$graph->img->SetAngle(90); + +// set major and minor tick positions manually +$graph->SetBox(false); + +//$graph->ygrid->SetColor('gray'); +$graph->ygrid->Show(false); +$graph->ygrid->SetFill(false); +$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F')); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); + +// For background to be gradient, setfill is needed first. +$graph->SetBackgroundGradient('#00CED1', '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + +// Create the bar plots +$b1plot = new BarPlot($datay); + +// ...and add it to the graPH +$graph->Add($b1plot); + +$b1plot->SetWeight(0); +$b1plot->SetFillGradient("#808000","#90EE90",GRAD_HOR); +$b1plot->SetWidth(17); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/new_bar6.php b/includes/jpgraph/src/Examples/new_bar6.php new file mode 100644 index 0000000..a439ec7 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_bar6.php @@ -0,0 +1,103 @@ +SetScale("textlin"); +$graph->SetY2Scale("lin",0,90); +$graph->SetY2OrderBack(false); + +$graph->SetMargin(35,50,20,5); + +$theme_class = new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->yaxis->SetTickPositions(array(0,50,100,150,200,250,300,350), array(25,75,125,175,275,325)); +$graph->y2axis->SetTickPositions(array(30,40,50,60,70,80,90)); + +$months = $gDateLocale->GetShortMonth(); +$months = array_merge(array_slice($months,3,9), array_slice($months,0,3)); +$graph->SetBox(false); + +$graph->ygrid->SetFill(false); +$graph->xaxis->SetTickLabels(array('A','B','C','D')); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); +// Setup month as labels on the X-axis +$graph->xaxis->SetTickLabels($months); + +// Create the bar plots +$b1plot = new BarPlot($data1y); +$b2plot = new BarPlot($data2y); + +$b3plot = new BarPlot($data3y); +$b4plot = new BarPlot($data4y); +$b5plot = new BarPlot($data5y); + +$lplot = new LinePlot($data6y); + +// Create the grouped bar plot +$gbbplot = new AccBarPlot(array($b3plot,$b4plot,$b5plot)); +$gbplot = new GroupBarPlot(array($b1plot,$b2plot,$gbbplot)); + +// ...and add it to the graPH +$graph->Add($gbplot); +$graph->AddY2($lplot); + +$b1plot->SetColor("#0000CD"); +$b1plot->SetFillColor("#0000CD"); +$b1plot->SetLegend("Cliants"); + +$b2plot->SetColor("#B0C4DE"); +$b2plot->SetFillColor("#B0C4DE"); +$b2plot->SetLegend("Machines"); + +$b3plot->SetColor("#8B008B"); +$b3plot->SetFillColor("#8B008B"); +$b3plot->SetLegend("First Track"); + +$b4plot->SetColor("#DA70D6"); +$b4plot->SetFillColor("#DA70D6"); +$b4plot->SetLegend("All"); + +$b5plot->SetColor("#9370DB"); +$b5plot->SetFillColor("#9370DB"); +$b5plot->SetLegend("Single Only"); + +$lplot->SetBarCenter(); +$lplot->SetColor("yellow"); +$lplot->SetLegend("Houses"); +$lplot->mark->SetType(MARK_X,'',1.0); +$lplot->mark->SetWeight(2); +$lplot->mark->SetWidth(8); +$lplot->mark->setColor("yellow"); +$lplot->mark->setFillColor("yellow"); + +$graph->legend->SetFrameWeight(1); +$graph->legend->SetColumns(6); +$graph->legend->SetColor('#4E4E4E','#00A78A'); + +$band = new PlotBand(VERTICAL,BAND_RDIAG,11,"max",'khaki4'); +$band->ShowFrame(true); +$band->SetOrder(DEPTH_BACK); +$graph->Add($band); + +$graph->title->Set("Combineed Line and Bar plots"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/new_line1.php b/includes/jpgraph/src/Examples/new_line1.php new file mode 100644 index 0000000..7a8ae66 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_line1.php @@ -0,0 +1,57 @@ +SetScale("textlin"); + +$theme_class=new UniversalTheme; + +$graph->SetTheme($theme_class); +$graph->img->SetAntiAliasing(false); +$graph->title->Set('Filled Y-grid'); +$graph->SetBox(false); + +$graph->img->SetAntiAliasing(); + +$graph->yaxis->HideZeroLabel(); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); + +$graph->xgrid->Show(); +$graph->xgrid->SetLineStyle("solid"); +$graph->xaxis->SetTickLabels(array('A','B','C','D')); +$graph->xgrid->SetColor('#E3E3E3'); +/* $graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLPLOT); */ + +// Create the first line +$p1 = new LinePlot($datay1); +$graph->Add($p1); +$p1->SetColor("#6495ED"); +$p1->SetLegend('Line 1'); + +// Create the second line +$p2 = new LinePlot($datay2); +$graph->Add($p2); +$p2->SetColor("#B22222"); +$p2->SetLegend('Line 2'); + +// Create the third line +$p3 = new LinePlot($datay3); +$graph->Add($p3); +$p3->SetColor("#FF1493"); +$p3->SetLegend('Line 3'); + +$graph->legend->SetFrameWeight(1); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/new_line2.php b/includes/jpgraph/src/Examples/new_line2.php new file mode 100644 index 0000000..8ccd271 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_line2.php @@ -0,0 +1,57 @@ +SetScale("textlin"); + +$theme_class= new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->title->Set('Background Image'); +$graph->SetBox(false); + +$graph->yaxis->HideZeroLabel(); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); + +$graph->xaxis->SetTickLabels(array('A','B','C','D')); +$graph->ygrid->SetFill(false); +$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); + +$p1 = new LinePlot($datay1); +$graph->Add($p1); + +$p2 = new LinePlot($datay2); +$graph->Add($p2); + +$p1->SetColor("#55bbdd"); +$p1->SetLegend('Line 1'); +$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0); +$p1->mark->SetColor('#55bbdd'); +$p1->mark->SetFillColor('#55bbdd'); +$p1->SetCenter(); + +$p2->SetColor("#aaaaaa"); +$p2->SetLegend('Line 2'); +$p2->mark->SetType(MARK_UTRIANGLE,'',1.0); +$p2->mark->SetColor('#aaaaaa'); +$p2->mark->SetFillColor('#aaaaaa'); +$p2->value->SetMargin(14); +$p2->SetCenter(); + +$graph->legend->SetFrameWeight(1); +$graph->legend->SetColor('#4E4E4E','#00A78A'); +$graph->legend->SetMarkAbsSize(8); + + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/new_line3.php b/includes/jpgraph/src/Examples/new_line3.php new file mode 100644 index 0000000..cc0ab3e --- /dev/null +++ b/includes/jpgraph/src/Examples/new_line3.php @@ -0,0 +1,46 @@ +SetScale("textlin",0,50); + +//$theme_class=new DefaultTheme; +//$graph->SetTheme($theme_class); + +$graph->title->Set("Filled Area"); + +$graph->SetBox(false); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); +$graph->yaxis->HideZeroLabel(); + +$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); + +// Create the plot +$p1 = new LinePlot($datay1); +$graph->Add($p1); + +$p2 = new LinePlot($datay2); +$graph->Add($p2); + +// Use an image of favourite car as marker +$p1->mark->SetType(MARK_IMG,'rose.gif',1.0); +$p1->SetLegend('rose'); +$p1->SetColor('#CD5C5C'); + +$p2->mark->SetType(MARK_IMG,'sunflower.gif',1.0); +$p2->SetLegend('sunflower'); +$p2->SetColor('#CD5C5C'); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/new_line4.php b/includes/jpgraph/src/Examples/new_line4.php new file mode 100644 index 0000000..f50921e --- /dev/null +++ b/includes/jpgraph/src/Examples/new_line4.php @@ -0,0 +1,49 @@ +SetScale("textlin",0,50); + +$theme_class= new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->title->Set("Line Plots with Markers"); + +$graph->SetBox(false); +$graph->ygrid->SetFill(false); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); +$graph->yaxis->HideZeroLabel(); + +$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); +// Create the plot +$p1 = new LinePlot($datay1); +$graph->Add($p1); + +$p2 = new LinePlot($datay2); +$graph->Add($p2); + +// Use an image of favourite car as marker +$p1->mark->SetType(MARK_IMG,'new1.gif',0.8); +$p1->SetColor('#aadddd'); +$p1->value->SetFormat('%d'); +$p1->value->Show(); +$p1->value->SetColor('#55bbdd'); + +$p2->mark->SetType(MARK_IMG,'new2.gif',0.8); +$p2->SetColor('#ddaa99'); +$p2->value->SetFormat('%d'); +$p2->value->Show(); +$p2->value->SetColor('#55bbdd'); + + +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/new_line5.php b/includes/jpgraph/src/Examples/new_line5.php new file mode 100644 index 0000000..7a234a8 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_line5.php @@ -0,0 +1,44 @@ +SetScale("intlin",0,$aYMax=50); + +$theme_class= new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->SetMargin(40,40,50,40); + +$graph->title->Set('Inverted Y-axis'); +$graph->SetBox(false); +$graph->yaxis->HideLine(false); +$graph->yaxis->HideTicks(false,false); + +// For background to be gradient, setfill is needed first. +$graph->ygrid->SetFill(true,'#FFFFFF@0.5','#FFFFFF@0.5'); +$graph->SetBackgroundGradient('#FFFFFF', '#00FF7F', GRAD_HOR, BGRAD_PLOT); + +$graph->xaxis->SetTickLabels(array('G','F','E','D','C','B','A')); +$graph->xaxis->SetLabelMargin(20); +$graph->yaxis->SetLabelMargin(20); + +$graph->SetAxisStyle(AXSTYLE_BOXOUT); +$graph->img->SetAngle(180); + +// Create the line +$p1 = new LinePlot($datay); +$graph->Add($p1); + +$p1->SetFillGradient('#FFFFFF','#F0F8FF'); +$p1->SetColor('#aadddd'); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/new_pie1.php b/includes/jpgraph/src/Examples/new_pie1.php new file mode 100644 index 0000000..3c395e8 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_pie1.php @@ -0,0 +1,28 @@ +SetTheme(new $theme_class()); + +// Set A title for the plot +$graph->title->Set("A Simple Pie Plot"); +$graph->SetBox(true); + +// Create +$p1 = new PiePlot($data); +$graph->Add($p1); + +$p1->ShowBorder(); +$p1->SetColor('black'); +$p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/new_pie2.php b/includes/jpgraph/src/Examples/new_pie2.php new file mode 100644 index 0000000..6e94cbf --- /dev/null +++ b/includes/jpgraph/src/Examples/new_pie2.php @@ -0,0 +1,55 @@ +SetShadow(); + +$theme_class= new UniversalTheme; +//$graph->SetTheme($theme_class); + +// Set A title for the plot +$graph->title->Set("Multiple - Pie plot"); + +// Create plots +$size=0.13; +$p1 = new PiePlot($data); +$graph->Add($p1); + +$p1->SetSize($size); +$p1->SetCenter(0.25,0.32); +$p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); +$p1->title->Set("2005"); + +$p2 = new PiePlot($data); +$graph->Add($p2); + +$p2->SetSize($size); +$p2->SetCenter(0.65,0.32); +$p2->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); +$p2->title->Set("2006"); + +$p3 = new PiePlot($data); +$graph->Add($p3); + +$p3->SetSize($size); +$p3->SetCenter(0.25,0.75); +$p3->SetSliceColors(array('#6495ED','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); +$p3->title->Set("2007"); + +$p4 = new PiePlot($data); +$graph->Add($p4); + +$p4->SetSize($size); +$p4->SetCenter(0.65,0.75); +$p4->SetSliceColors(array('#6495ED','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); +$p4->title->Set("2008"); + + +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/new_pie3.php b/includes/jpgraph/src/Examples/new_pie3.php new file mode 100644 index 0000000..81bc0f2 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_pie3.php @@ -0,0 +1,28 @@ +SetTheme($theme_class); + +// Set A title for the plot +$graph->title->Set("A Simple 3D Pie Plot"); + +// Create +$p1 = new PiePlot3D($data); +$graph->Add($p1); + +$p1->ShowBorder(); +$p1->SetColor('black'); +$p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#BA55D3')); +$p1->ExplodeSlice(1); +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/new_pie4.php b/includes/jpgraph/src/Examples/new_pie4.php new file mode 100644 index 0000000..5353800 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_pie4.php @@ -0,0 +1,65 @@ +SetTheme(new $theme_class()); + +// Setup background +$graph->SetBackgroundImage('worldmap1.jpg',BGIMG_FILLFRAME); + +// Setup title +$graph->title->Set("Pie plots with background image"); +$graph->title->SetColor('white'); +$graph->SetTitleBackground('#4169E1',TITLEBKG_STYLE2,TITLEBKG_FRAME_FULL,'#4169E1',10,10,true); + +$p = array(); +// Create the plots +for( $i=0; $i < $n; ++$i ) { + $p[] = new PiePlot3D($data); +} +for( $i=0; $i < $n; ++$i ) { + $graph->Add($p[$i]); +} + +// Position the four pies and change color +for( $i=0; $i < $n; ++$i ) { + $p[$i]->SetCenter($piepos[2*$i],$piepos[2*$i+1]); + $p[$i]->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3')); +} + +// Set the titles +for( $i=0; $i < $n; ++$i ) { + $p[$i]->title->Set($titles[$i]); + $p[$i]->title->SetFont(FF_ARIAL,FS_NORMAL,8); +} + +for( $i=0; $i < $n; ++$i ) { + $p[$i]->value->Show(false); +} + +// Size of pie in fraction of the width of the graph +for( $i=0; $i < $n; ++$i ) { + $p[$i]->SetSize(0.13); +} + +for( $i=0; $i < $n; ++$i ) { + $p[$i]->SetEdge(false); + $p[$i]->ExplodeSlice(1,7); +} + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/new_step1.php b/includes/jpgraph/src/Examples/new_step1.php new file mode 100644 index 0000000..7bd0ce5 --- /dev/null +++ b/includes/jpgraph/src/Examples/new_step1.php @@ -0,0 +1,36 @@ +SetScale("intlin",0,$aYMax=50); +$theme_class=new UniversalTheme; +$graph->SetTheme($theme_class); + +$graph->SetBox(false); + +$graph->title->Set('Step Line'); +$graph->ygrid->Show(true); +$graph->xgrid->Show(false); +$graph->yaxis->HideZeroLabel(); +$graph->ygrid->SetFill(true,'#FFFFFF@0.5','#FFFFFF@0.5'); +$graph->SetBackgroundGradient('blue', '#55eeff', GRAD_HOR, BGRAD_PLOT); +$graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); + +// Create the line +$p1 = new LinePlot($datay); +$graph->Add($p1); + +$p1->SetFillGradient('yellow','red'); +$p1->SetStepStyle(); +$p1->SetColor('#808000'); + +// Output line +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/nullvalueex01.php b/includes/jpgraph/src/Examples/nullvalueex01.php new file mode 100644 index 0000000..3308811 --- /dev/null +++ b/includes/jpgraph/src/Examples/nullvalueex01.php @@ -0,0 +1,56 @@ +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_ARIAL,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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/ocean_example.php b/includes/jpgraph/src/Examples/ocean_example.php new file mode 100644 index 0000000..8a09d59 --- /dev/null +++ b/includes/jpgraph/src/Examples/ocean_example.php @@ -0,0 +1,58 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new OceanTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "OceanTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/odoex00.php b/includes/jpgraph/src/Examples/odoex00.php new file mode 100644 index 0000000..e8cef55 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex00.php @@ -0,0 +1,47 @@ +SetColor('white'); +$graph->SetMarginColor('white'); +$graph->SetFrame(false); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(40); + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex01.php b/includes/jpgraph/src/Examples/odoex01.php new file mode 100644 index 0000000..3d29aa0 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex01.php @@ -0,0 +1,69 @@ +title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(); + +//--------------------------------------------------------------------- +// Set color indication between values 80 and 100 as red +//--------------------------------------------------------------------- +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(30); + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex010.php b/includes/jpgraph/src/Examples/odoex010.php new file mode 100644 index 0000000..3c70ad2 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex010.php @@ -0,0 +1,75 @@ +AddIndication(80,100,"red"); +$odo2->AddIndication(20,30,"green"); +$odo2->AddIndication(65,100,"red"); +$odo3->AddIndication(60,90,"yellow"); +$odo3->AddIndication(90,100,"red"); + +//--------------------------------------------------------------------- +// Set display values for the odometers +//--------------------------------------------------------------------- +$odo1->needle->Set(17); +$odo2->needle->Set(47); +$odo3->needle->Set(86); + +$odo1->needle->SetFillColor("blue"); +$odo2->needle->SetFillColor("yellow:0.7"); +$odo3->needle->SetFillColor("black"); +$odo3->needle->SetColor("black"); + + +//--------------------------------------------------------------------- +// Set scale label properties +//--------------------------------------------------------------------- +$odo1->scale->label->SetColor("navy"); +$odo2->scale->label->SetColor("blue"); +$odo3->scale->label->SetColor("darkred"); + +$odo1->scale->label->SetFont(FF_FONT1); +$odo2->scale->label->SetFont(FF_FONT2,FS_BOLD); +$odo3->scale->label->SetFont(FF_ARIAL,FS_BOLD,11); + +//--------------------------------------------------------------------- +// Add the odometers to the graph using a vertical layout +//--------------------------------------------------------------------- +$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; +$graph->Add( $l1 ); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex011.php b/includes/jpgraph/src/Examples/odoex011.php new file mode 100644 index 0000000..cc74f4f --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex011.php @@ -0,0 +1,108 @@ +SetShadow(); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Result from 2002"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("O1 - W-Site"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("Fig1. Values within 85%\nconfidence intervall"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// We will display three odometers stacked vertically +// The first thing to do is to create them +//--------------------------------------------------------------------- +$odo1 = new Odometer(); +$odo2 = new Odometer(); +$odo3 = new Odometer(); + + +//--------------------------------------------------------------------- +// Set caption for each odometer +//--------------------------------------------------------------------- +$odo1->caption->Set("April"); +$odo1->caption->SetFont(FF_FONT2,FS_BOLD); +$odo2->caption->Set("May"); +$odo2->caption->SetFont(FF_FONT2,FS_BOLD); +$odo3->caption->Set("June"); +$odo3->caption->SetFont(FF_FONT2,FS_BOLD); + +//--------------------------------------------------------------------- +// Set Indicator bands for the odometers +//--------------------------------------------------------------------- +$odo1->AddIndication(80,100,"red"); +$odo2->AddIndication(20,30,"green"); +$odo2->AddIndication(65,100,"red"); +$odo3->AddIndication(60,90,"yellow"); +$odo3->AddIndication(90,100,"red"); + +//--------------------------------------------------------------------- +// Set display values for the odometers +//--------------------------------------------------------------------- +$odo1->needle->Set(17); +$odo2->needle->Set(47); +$odo3->needle->Set(86); + +$odo1->needle->SetFillColor("blue"); +$odo2->needle->SetFillColor("yellow:0.7"); +$odo3->needle->SetFillColor("black"); +$odo3->needle->SetColor("black"); + + +//--------------------------------------------------------------------- +// Set scale label properties +//--------------------------------------------------------------------- +$odo1->scale->label->SetColor("navy"); +$odo2->scale->label->SetColor("blue"); +$odo3->scale->label->SetColor("darkred"); + +$odo1->scale->label->SetFont(FF_FONT1); +$odo2->scale->label->SetFont(FF_FONT2,FS_BOLD); +$odo3->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); + +//--------------------------------------------------------------------- +// Add the odometers to the graph using a vertical layout +//--------------------------------------------------------------------- +$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; +$graph->Add( $l1 ); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex012.php b/includes/jpgraph/src/Examples/odoex012.php new file mode 100644 index 0000000..b54f773 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex012.php @@ -0,0 +1,119 @@ +SetShadow(); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Result from 2002"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("O1 - W-Site"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("Fig1. Values within 85%\nconfidence intervall"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// We will display two columns where the first column has +// three odometers (same as in example 11) and the second column +// has two odoemters +// The first thing to do is to create them +//--------------------------------------------------------------------- +$odo1 = new Odometer(); +$odo2 = new Odometer(); +$odo3 = new Odometer(); +$odo4 = new Odometer(); +$odo5 = new Odometer(); + + +//--------------------------------------------------------------------- +// Set caption for each odometer +//--------------------------------------------------------------------- +$odo1->caption->Set("April"); +$odo1->caption->SetFont(FF_ARIAL,FS_BOLD); +$odo2->caption->Set("May"); +$odo2->caption->SetFont(FF_FONT2,FS_BOLD); +$odo3->caption->Set("June"); +$odo3->caption->SetFont(FF_FONT2,FS_BOLD); +$odo4->caption->Set("Daily low average"); +$odo4->caption->SetFont(FF_FONT1,FS_BOLD); +$odo5->caption->Set("Daily high average"); +$odo5->caption->SetFont(FF_FONT1,FS_BOLD); + +//--------------------------------------------------------------------- +// Set Indicator bands for the odometers +//--------------------------------------------------------------------- +$odo1->AddIndication(80,100,"red"); +$odo2->AddIndication(20,30,"green"); +$odo2->AddIndication(65,100,"red"); +$odo3->AddIndication(60,90,"yellow"); +$odo3->AddIndication(90,100,"red"); + +//--------------------------------------------------------------------- +// Set display values for the odometers +//--------------------------------------------------------------------- +$odo1->needle->Set(17); +$odo2->needle->Set(47); +$odo3->needle->Set(86); +$odo4->needle->Set(22); +$odo5->needle->Set(77); + +$odo1->needle->SetFillColor("blue"); +$odo2->needle->SetFillColor("yellow:0.7"); +$odo3->needle->SetFillColor("black"); +$odo3->needle->SetColor("black"); + + +//--------------------------------------------------------------------- +// Set scale label properties +//--------------------------------------------------------------------- +$odo1->scale->label->SetColor("navy"); +$odo2->scale->label->SetColor("blue"); +$odo3->scale->label->SetColor("darkred"); + +$odo1->scale->label->SetFont(FF_FONT1); +$odo2->scale->label->SetFont(FF_FONT2,FS_BOLD); +$odo3->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); + +//--------------------------------------------------------------------- +// Add the odometers to the graph using a vertical layout +//--------------------------------------------------------------------- +$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; +$l2 = new LayoutVert( array($odo4,$odo5) ) ; +$l3 = new LayoutHor( array($l1,$l2) ); +$graph->Add( $l3 ); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex02.php b/includes/jpgraph/src/Examples/odoex02.php new file mode 100644 index 0000000..47ccc6b --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex02.php @@ -0,0 +1,71 @@ +title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(30); + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex03.php b/includes/jpgraph/src/Examples/odoex03.php new file mode 100644 index 0000000..91ca401 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex03.php @@ -0,0 +1,83 @@ +SetShadow(); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Adjust scale ticks to be shown at 10 steps interval and scale +// labels at every second tick +//--------------------------------------------------------------------- +$odo->scale->SetTicks(10,2); + +//--------------------------------------------------------------------- +// Use a bold font for tick labels +//--------------------------------------------------------------------- +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(30); + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex04.php b/includes/jpgraph/src/Examples/odoex04.php new file mode 100644 index 0000000..9955b7d --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex04.php @@ -0,0 +1,96 @@ +title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set the center area that will not be affected by the color bands +//--------------------------------------------------------------------- +$odo->SetCenterAreaWidth(0.4); // Fraction of radius + +//--------------------------------------------------------------------- +// Adjust scale ticks to be shown at 10 steps interval and scale +// labels at every second tick +//--------------------------------------------------------------------- +$odo->scale->SetTicks(10,2); + +//--------------------------------------------------------------------- +// Use a bold font for tick labels +//--------------------------------------------------------------------- +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(30); + +//--------------------------------------------------------------------- +// Set a new style for the needle +//--------------------------------------------------------------------- +$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); +$odo->needle->SetLength(0.7); // Length as 70% of the radius +$odo->needle->SetFillColor("orange"); + + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex05.php b/includes/jpgraph/src/Examples/odoex05.php new file mode 100644 index 0000000..379a06e --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex05.php @@ -0,0 +1,123 @@ +SetColor("lightyellow"); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set the center area that will not be affected by the color bands +//--------------------------------------------------------------------- +$odo->SetCenterAreaWidth(0.4); // Fraction of radius + +//--------------------------------------------------------------------- +// Adjust scale ticks to be shown at 10 steps interval and scale +// labels at every second tick +//--------------------------------------------------------------------- +$odo->scale->SetTicks(10,2); + +//--------------------------------------------------------------------- +// Make the tick marks 2 pixel wide +//--------------------------------------------------------------------- +$odo->scale->SetTickWeight(2); + +//--------------------------------------------------------------------- +// Use a bold font for tick labels +//--------------------------------------------------------------------- +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(78); + +//--------------------------------------------------------------------- +// Specify scale caption. Note that depending on the position of the +// indicator needle this label might be partially hidden. +//--------------------------------------------------------------------- +$odo->label->Set("% Passed"); + +//--------------------------------------------------------------------- +// Set a new style for the needle +//--------------------------------------------------------------------- +$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); +$odo->needle->SetLength(0.7); // Length as 70% of the radius +$odo->needle->SetFillColor("orange"); + +//--------------------------------------------------------------------- +// Setup the second indicator needle +//--------------------------------------------------------------------- +$odo->needle2->Set(24); +$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); +$odo->needle2->SetLength(0.55); // Length as 70% of the radius +$odo->needle2->SetFillColor("lightgray"); +$odo->needle2->Show(); + + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex06.php b/includes/jpgraph/src/Examples/odoex06.php new file mode 100644 index 0000000..305a5ee --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex06.php @@ -0,0 +1,122 @@ +SetColor("lightyellow"); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(ODO_FULL); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set the center area that will not be affected by the color bands +//--------------------------------------------------------------------- +$odo->SetCenterAreaWidth(0.4); // Fraction of radius + +//--------------------------------------------------------------------- +// Adjust scale ticks to be shown at 10 steps interval and scale +// labels at every second tick +//--------------------------------------------------------------------- +$odo->scale->SetTicks(10,2); + +//--------------------------------------------------------------------- +// Make the tick marks 2 pixel wide +//--------------------------------------------------------------------- +$odo->scale->SetTickWeight(2); + +//--------------------------------------------------------------------- +// Use a bold font for tick labels +//--------------------------------------------------------------------- +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(78); + +//--------------------------------------------------------------------- +// Specify scale caption. Note that depending on the position of the +// indicator needle this label might be partially hidden. +//--------------------------------------------------------------------- +$odo->label->Set("% Passed"); + +//--------------------------------------------------------------------- +// Set a new style for the needle +//--------------------------------------------------------------------- +$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); +$odo->needle->SetLength(0.7); // Length as 70% of the radius +$odo->needle->SetFillColor("orange"); + +//--------------------------------------------------------------------- +// Setup the second indicator needle +//--------------------------------------------------------------------- +$odo->needle2->Set(24); +$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); +$odo->needle2->SetLength(0.55); // Length as 70% of the radius +$odo->needle2->SetFillColor("lightgray"); +$odo->needle2->Show(); + + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex07.php b/includes/jpgraph/src/Examples/odoex07.php new file mode 100644 index 0000000..eb86ba3 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex07.php @@ -0,0 +1,126 @@ +SetColor("lightyellow"); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(ODO_FULL); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set the center area that will not be affected by the color bands +//--------------------------------------------------------------------- +$odo->SetCenterAreaWidth(0.4); // Fraction of radius + +//--------------------------------------------------------------------- +// Adjust scale ticks to be shown at 10 steps interval and scale +// labels at every second tick +//--------------------------------------------------------------------- +$odo->scale->SetTicks(10,2); + +//--------------------------------------------------------------------- +// Make the tick marks 2 pixel wide +//--------------------------------------------------------------------- +$odo->scale->SetTickWeight(2); + +//--------------------------------------------------------------------- +// Use a bold font for tick labels +//--------------------------------------------------------------------- +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); + +//--------------------------------------------------------------------- +// Change the start and end angle for the scale +//--------------------------------------------------------------------- +$odo->scale->SetAngle(20,340); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(64); + +//--------------------------------------------------------------------- +// Specify scale caption. Note that depending on the position of the +// indicator needle this label might be partially hidden. +//--------------------------------------------------------------------- +$odo->label->Set("% Passed"); + +//--------------------------------------------------------------------- +// Set a new style for the needle +//--------------------------------------------------------------------- +$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); +$odo->needle->SetLength(0.7); // Length as 70% of the radius +$odo->needle->SetFillColor("orange"); + +//--------------------------------------------------------------------- +// Setup the second indicator needle +//--------------------------------------------------------------------- +$odo->needle2->Set(15); +$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); +$odo->needle2->SetLength(0.55); // Length as 70% of the radius +$odo->needle2->SetFillColor("lightgray"); +$odo->needle2->Show(); + + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex08.php b/includes/jpgraph/src/Examples/odoex08.php new file mode 100644 index 0000000..39f12e7 --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex08.php @@ -0,0 +1,150 @@ +SetShadow(); + +//--------------------------------------------------------------------- +// Change the color of the odometer plotcanvas. NOT the odometer +// fill color itself. +//--------------------------------------------------------------------- +$graph->SetColor("lightyellow"); + +//--------------------------------------------------------------------- +// Change the color of the margin in the graph +//--------------------------------------------------------------------- +$graph->SetMarginColor("khaki:0.6"); + +//--------------------------------------------------------------------- +// Specify title and subtitle using default fonts +// * Note each title may be multilines by using a '\n' as a line +// divider. +//--------------------------------------------------------------------- +$graph->title->Set("Odometer title"); +$graph->title->SetColor("white"); +$graph->subtitle->Set("2002-02-13"); +$graph->subtitle->SetColor("white"); + +//--------------------------------------------------------------------- +// Specify caption. +// * (This is the text at the bottom of the graph.) The margins will +// automatically adjust to fit the height of the text. A caption +// may have multiple lines by including a '\n' character in the +// string. +//--------------------------------------------------------------------- +$graph->caption->Set("First caption row\n... second row"); +$graph->caption->SetColor("white"); + +//--------------------------------------------------------------------- +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +//--------------------------------------------------------------------- +$odo = new Odometer(ODO_FULL); + +//--------------------------------------------------------------------- +// Set fill color for odometer +//--------------------------------------------------------------------- +$odo->SetColor("lightblue"); + +//--------------------------------------------------------------------- +// Set color indication +//--------------------------------------------------------------------- +$odo->AddIndication(0,50,"green"); +$odo->AddIndication(50,80,"yellow"); +$odo->AddIndication(80,100,"red"); + +//--------------------------------------------------------------------- +// Set the center area that will not be affected by the color bands +//--------------------------------------------------------------------- +$odo->SetCenterAreaWidth(0.4); // Fraction of radius + +//--------------------------------------------------------------------- +// Adjust scale ticks to be shown at 10 steps interval and scale +// labels at every second tick +//--------------------------------------------------------------------- +$odo->scale->SetTicks(10,2); + +//--------------------------------------------------------------------- +// Make the tick marks 2 pixel wide +//--------------------------------------------------------------------- +$odo->scale->SetTickWeight(2); + +//--------------------------------------------------------------------- +// Use a bold font for tick labels +//--------------------------------------------------------------------- +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); + +//--------------------------------------------------------------------- +// Change the start and end angle for the scale +//--------------------------------------------------------------------- +$odo->scale->SetAngle(20,340); + +//--------------------------------------------------------------------- +// Set display value for the odometer +//--------------------------------------------------------------------- +$odo->needle->Set(64); + +//--------------------------------------------------------------------- +// Specify scale caption. Note that depending on the position of the +// indicator needle this label might be partially hidden. +//--------------------------------------------------------------------- +$odo->label->Set("% Passed"); + +//--------------------------------------------------------------------- +// Set a new style for the needle +//--------------------------------------------------------------------- +$odo->needle->SetStyle(NEEDLE_STYLE_MEDIUM_TRIANGLE); +$odo->needle->SetLength(0.7); // Length as 70% of the radius +$odo->needle->SetFillColor("orange"); + +//--------------------------------------------------------------------- +// Setup the second indicator needle +//--------------------------------------------------------------------- +$odo->needle2->Set(15); +$odo->needle2->SetStyle(NEEDLE_STYLE_SMALL_TRIANGLE); +$odo->needle2->SetLength(0.55); // Length as 70% of the radius +$odo->needle2->SetFillColor("lightgray"); + +// Only the first needle is shown by default +$odo->needle2->Show(); + +//--------------------------------------------------------------------- +// Add a drop shadow to the indicator needles +//--------------------------------------------------------------------- +$odo->needle->SetShadow(); +$odo->needle2->SetShadow(); + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odoex09.php b/includes/jpgraph/src/Examples/odoex09.php new file mode 100644 index 0000000..9fc9aff --- /dev/null +++ b/includes/jpgraph/src/Examples/odoex09.php @@ -0,0 +1,49 @@ +needle->Set(17); +$odo2->needle->Set(47); +$odo3->needle->Set(86); + +//--------------------------------------------------------------------- +// Add the odometers to the graph using a vertical layout +//--------------------------------------------------------------------- +$l1 = new LayoutVert( array($odo1,$odo2,$odo3) ) ; +$graph->Add( $l1 ); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex00.php b/includes/jpgraph/src/Examples/odotutex00.php new file mode 100644 index 0000000..4344292 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex00.php @@ -0,0 +1,21 @@ +needle->Set(30); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/odotutex01.php b/includes/jpgraph/src/Examples/odotutex01.php new file mode 100644 index 0000000..ec970cd --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex01.php @@ -0,0 +1,21 @@ +needle->Set(30); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/odotutex02.php b/includes/jpgraph/src/Examples/odotutex02.php new file mode 100644 index 0000000..a007c1b --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex02.php @@ -0,0 +1,30 @@ +title->Set("Result for 2002"); +$graph->title->SetColor("white"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->subtitle->Set("New York Office"); +$graph->subtitle->SetColor("white"); +$graph->caption->Set("Figure 1. Branch results."); +$graph->caption->SetColor("white"); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(); + +// Set display value for the odometer +$odo->needle->Set(30); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/odotutex03.php b/includes/jpgraph/src/Examples/odotutex03.php new file mode 100644 index 0000000..3c0e907 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex03.php @@ -0,0 +1,30 @@ +title->Set("Result for 2002"); +$graph->title->SetColor("white"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->subtitle->Set("New York Office"); +$graph->subtitle->SetColor("white"); +$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption."); +$graph->caption->SetColor("white"); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(); + +// Set display value for the odometer +$odo->needle->Set(30); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/odotutex04.php b/includes/jpgraph/src/Examples/odotutex04.php new file mode 100644 index 0000000..60c57fc --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex04.php @@ -0,0 +1,40 @@ +title->Set("Result for 2002"); +$graph->title->SetColor("white"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->subtitle->Set("New York Office"); +$graph->subtitle->SetColor("white"); +$graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption."); +$graph->caption->SetColor("white"); + +// Setup colors +// Make the border 40% darker than normal "khaki" +$graph->SetMarginColor("khaki:0.6"); +$graph->SetColor("khaki"); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(); + +// Setup colors for odometyer plot +$odo->SetColor('white'); +$odo->scale->label->SetColor("darkred"); +$odo->needle->SetFillColor("yellow"); + +// Set display value for the odometer +$odo->needle->Set(30); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/odotutex06.php b/includes/jpgraph/src/Examples/odotutex06.php new file mode 100644 index 0000000..4161e5f --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex06.php @@ -0,0 +1,43 @@ +SetColor("lightyellow"); + $odo[$i]->needle->Set(80); + $odo[$i]->needle->SetStyle($nstyle[$i]); + $odo[$i]->caption->Set($captions[$i]); + $odo[$i]->caption->SetFont(FF_FONT1); + $odo[$i]->caption->SetMargin(3); +} + +// Use the automatic layout engine to positon the plots on the graph +$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) ); +$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) ); +$col1 = new LayoutVert( array($row1,$row2) ); + +// Add the odometer to the graph +$graph->Add($col1); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex07.php b/includes/jpgraph/src/Examples/odotutex07.php new file mode 100644 index 0000000..a1ba22b --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex07.php @@ -0,0 +1,37 @@ +SetColor("lightyellow"); + $odo[$i]->needle->Set(75); + $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]); + $odo[$i]->caption->SetFont(FF_FONT1,FS_BOLD); + $odo[$i]->caption->Set('Arrow: '.$acaptions[$i]); +} + +$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) ); +$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) ); +$row3 = new LayoutHor( array($odo[6],$odo[7],$odo[8]) ); +$col1 = new LayoutVert( array($row1,$row2,$row3) ); + +// Add the odometer to the graph +$graph->Add($col1); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex08.1.php b/includes/jpgraph/src/Examples/odotutex08.1.php new file mode 100644 index 0000000..676ac4c --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex08.1.php @@ -0,0 +1,41 @@ +title->Set('An example with thick border'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,11); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Set some nonstandard colors +$color = array(205,220,205); +$graph->SetMarginColor($color); +$graph->SetColor($color); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(); +$odo->SetColor('white'); +$odo->SetBorder('darkgreen:0.8',5); + +$odo->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); +$odo->scale->label->SetColor('brown:0.6'); + +// Set display value for the odometer +$odo->needle->Set(70); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex08.php b/includes/jpgraph/src/Examples/odotutex08.php new file mode 100644 index 0000000..8132e73 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex08.php @@ -0,0 +1,36 @@ +title->Set('An example with drop shadows'); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Set some nonstandard colors +$color = array(205,220,205); +$graph->SetMarginColor($color); +$graph->SetColor($color); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(); +$odo->SetColor('white'); + +// Set display value for the odometer +$odo->needle->Set(70); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex09.php b/includes/jpgraph/src/Examples/odotutex09.php new file mode 100644 index 0000000..82a2c4b --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex09.php @@ -0,0 +1,38 @@ +SetColor("lightyellow"); + $odo[$i]->needle->Set(75); + $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]); + $odo[$i]->caption->SetFont(FF_FONT1); + $odo[$i]->caption->Set($acaptions[$i]); + $odo[$i]->SetMargin(15); +} + +$row1 = new LayoutHor( array($odo[0],$odo[1],$odo[2]) ); +$row2 = new LayoutHor( array($odo[3],$odo[4],$odo[5]) ); +$row3 = new LayoutHor( array($odo[6],$odo[7],$odo[8]) ); +$col1 = new LayoutVert( array($row1,$row2,$row3) ); + +// Add the odometer to the graph +$graph->Add($col1); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex10.php b/includes/jpgraph/src/Examples/odotutex10.php new file mode 100644 index 0000000..f44fc5e --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex10.php @@ -0,0 +1,43 @@ +title->Set('Example with scale indicators'); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(ODO_HALF); + +// Add color indications +$odo->AddIndication(0,20,"green:0.7"); +$odo->AddIndication(20,30,"green:0.9"); +$odo->AddIndication(30,60,"yellow"); +$odo->AddIndication(60,80,"orange"); +$odo->AddIndication(80,100,"red"); + +// Set display value for the odometer +$odo->needle->Set(90); + +//--------------------------------------------------------------------- +// Add drop shadow for needle +//--------------------------------------------------------------------- +$odo->needle->SetShadow(); + +//--------------------------------------------------------------------- +// Add the odometer to the graph +//--------------------------------------------------------------------- +$graph->Add($odo); + +//--------------------------------------------------------------------- +// ... and finally stroke and stream the image back to the browser +//--------------------------------------------------------------------- +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex11.php b/includes/jpgraph/src/Examples/odotutex11.php new file mode 100644 index 0000000..f1290f7 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex11.php @@ -0,0 +1,40 @@ +title->Set('Example with scale indicators'); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(ODO_HALF); + +// Add color indications +$odo->AddIndication(0,20,"green:0.7"); +$odo->AddIndication(20,30,"green:0.9"); +$odo->AddIndication(30,60,"yellow"); +$odo->AddIndication(60,80,"orange"); +$odo->AddIndication(80,100,"red"); + +// Set display value for the odometer +$odo->needle->Set(90); + +// Set the size of the non-colored base area to 40% of the radius +$odo->SetCenterAreaWidth(0.45); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex12.php b/includes/jpgraph/src/Examples/odotutex12.php new file mode 100644 index 0000000..5d030a8 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex12.php @@ -0,0 +1,47 @@ +title->Set('Example with scale indicators'); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(ODO_HALF); + +// Add color indications +$odo->AddIndication(0,20,"green:0.7"); +$odo->AddIndication(20,30,"green:0.9"); +$odo->AddIndication(30,60,"yellow"); +$odo->AddIndication(60,80,"orange"); +$odo->AddIndication(80,100,"red"); + +// Set display value for the odometer +$odo->needle->Set(90); + +// Set the size of the non-colored base area to 40% of the radius +$odo->SetCenterAreaWidth(0.45); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Setup the second needle +$odo->needle2->Set(44); +$odo->needle2->Show(); +$odo->needle2->SetLength(0.4); +$odo->needle2->SetFillColor("navy"); +$odo->needle2->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +// EOF +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex13.php b/includes/jpgraph/src/Examples/odotutex13.php new file mode 100644 index 0000000..5c49a11 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex13.php @@ -0,0 +1,41 @@ +title->Set('Example with scale indicators'); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(ODO_HALF); + +// Add color indications +$odo->AddIndication(0,20,"green:0.7"); +$odo->AddIndication(20,30,"green:0.9"); +$odo->AddIndication(30,60,"yellow"); +$odo->AddIndication(60,80,"orange"); +$odo->AddIndication(80,100,"red"); + +$odo->SetCenterAreaWidth(0.45); + +// Set display value for the odometer +$odo->needle->Set(90); + +// Add scale labels +$odo->label->Set("mBar"); +$odo->label->SetFont(FF_FONT2,FS_BOLD); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex14.php b/includes/jpgraph/src/Examples/odotutex14.php new file mode 100644 index 0000000..19e8f71 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex14.php @@ -0,0 +1,35 @@ +title->Set('Custom scale'); +$graph->title->SetColor('white'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo = new Odometer(); +$odo->SetColor('lightyellow'); + +// Setup the scale +$odo->scale->Set(100,600); +$odo->scale->SetTicks(50,2); + +// Set display value for the odometer +$odo->needle->Set(280); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex15.php b/includes/jpgraph/src/Examples/odotutex15.php new file mode 100644 index 0000000..fece535 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex15.php @@ -0,0 +1,46 @@ +title->Set('Custom formatting'); +$graph->title->SetColor('white'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +$odo = new Odometer(); +$odo->SetColor("lightgray:1.9"); + +// Setup the scale +$odo->scale->Set(100,600); +$odo->scale->SetTicks(50,2); +$odo->scale->SetTickColor('brown'); +$odo->scale->SetTickLength(0.05); +$odo->scale->SetTickWeight(2); + +$odo->scale->SetLabelPos(0.75); +$odo->scale->label->SetFont(FF_FONT1, FS_BOLD); +$odo->scale->label->SetColor('brown'); +$odo->scale->label->SetFont(FF_ARIAL,FS_NORMAL,10); + +// Setup a label with a degree mark +$odo->scale->SetLabelFormat('%dC'.SymChar::Get('degree')); + +// Set display value for the odometer +$odo->needle->Set(280); + +// Add drop shadow for needle +$odo->needle->SetShadow(); + +// Add the odometer to the graph +$graph->Add($odo); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex16.1.php b/includes/jpgraph/src/Examples/odotutex16.1.php new file mode 100644 index 0000000..c370618 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex16.1.php @@ -0,0 +1,42 @@ +SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo1 = new Odometer(); +$odo2 = new Odometer(); +$odo1->SetColor("lightgray:1.9"); +$odo2->SetColor("lightgray:1.9"); + +// Adjust start and end angle for the scale +$odo2->scale->SetAngle(110,250); + +$odo1->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); +$odo2->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); +$odo2->AddIndication(-15,0,'lightgray'); +$odo2->AddIndication(100,115,'lightgray'); + +// Set display value for the odometer +$odo1->needle->Set(70); +$odo2->needle->Set(70); + +// Add drop shadow for needle +$odo1->needle->SetShadow(); +$odo2->needle->SetShadow(); + +// Specify the layout for the two odometers +$row = new LayoutHor( array($odo1,$odo2) ); + +// Add the odometer to the graph +$graph->Add($row); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex16.php b/includes/jpgraph/src/Examples/odotutex16.php new file mode 100644 index 0000000..16619f3 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex16.php @@ -0,0 +1,40 @@ +SetShadow(); + +// Now we need to create an odometer to add to the graph. +// By default the scale will be 0 to 100 +$odo1 = new Odometer(); +$odo2 = new Odometer(); +$odo1->SetColor("lightgray:1.9"); +$odo2->SetColor("lightgray:1.9"); + +// Adjust start and end angle for the scale +$odo2->scale->SetAngle(110,250); + +$odo1->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); +$odo2->scale->label->SetFont(FF_ARIAL,FS_BOLD,10); + +// Set display value for the odometer +$odo1->needle->Set(70); +$odo2->needle->Set(70); + +// Add drop shadow for needle +$odo1->needle->SetShadow(); +$odo2->needle->SetShadow(); + +// Specify the layout for the two odometers +$row = new LayoutHor( array($odo1,$odo2) ); + +// Add the odometer to the graph +$graph->Add($row); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex17.php b/includes/jpgraph/src/Examples/odotutex17.php new file mode 100644 index 0000000..6a9abf8 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex17.php @@ -0,0 +1,46 @@ +title->Set('Manual positioning'); +$graph->title->SetColor('white'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Add drop shadow for graph +$graph->SetShadow(); + +// Now we need to create an odometer to add to the graph. +$odo1 = new Odometer(); +$odo2 = new Odometer(); +$odo1->SetColor('lightgray:1.9'); +$odo2->SetColor('lightgray:1.9'); + +// Set display value for the odometer +$odo1->needle->Set(37); +$odo2->needle->Set(73); + +// Add drop shadow for needle +$odo1->needle->SetShadow(); +$odo2->needle->SetShadow(); + +// Specify the position for the two odometers +$odo1->SetPos(180,110); +$odo1->SetSize(100); +$odo2->SetPos(110,250); +$odo2->SetSize(100); + +// Set captions for the odometers +$odo1->caption->Set("(x,y) = (180,120)\nradius=100"); +$odo2->caption->Set("(x,y) = (110,270)\nradius=100"); + +// Add the odometer to the graph +$graph->Add($odo1); +$graph->Add($odo2); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex18.php b/includes/jpgraph/src/Examples/odotutex18.php new file mode 100644 index 0000000..44bd491 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex18.php @@ -0,0 +1,37 @@ +SetColor('lightgray:1.9'); + $odo[$i]->needle->Set(10+$i*17); + $odo[$i]->needle->SetShadow(); + if( $i < 2 ) + $fsize = 10; + else + $fsize = 8; + $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize); + $odo[$i]->AddIndication(92,100,'red'); + $odo[$i]->AddIndication(80,92,'orange'); + $odo[$i]->AddIndication(60,80,'yellow'); +} + +// Create the layout +$row1 = new LayoutHor( array($odo[0],$odo[1]) ); +$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) ); +$col1 = new LayoutVert( array($row1,$row2) ); + +// Add the odometer to the graph +$graph->Add($col1); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/odotutex19.php b/includes/jpgraph/src/Examples/odotutex19.php new file mode 100644 index 0000000..02324b0 --- /dev/null +++ b/includes/jpgraph/src/Examples/odotutex19.php @@ -0,0 +1,49 @@ +SetColor('lightgray:1.9'); + $odo[$i]->needle->Set(10+$i*17); + $odo[$i]->needle->SetShadow(); + if( $i < 2 ) + $fsize = 10; + else + $fsize = 8; + $odo[$i]->scale->label->SetFont(FF_ARIAL,FS_NORMAL,$fsize); + $odo[$i]->AddIndication(92,100,'red'); + $odo[$i]->AddIndication(80,92,'orange'); + $odo[$i]->AddIndication(60,80,'yellow'); +} + +// Create the layout +$row1 = new LayoutHor( array($odo[0],$odo[1]) ); +$row2 = new LayoutHor( array($odo[2],$odo[3],$odo[4]) ); +$col1 = new LayoutVert( array($row1,$row2) ); + +// Add the odometer to the graph +$graph->Add($col1); + +// Add an icon and text +$icon = new IconPlot('jpglogo.jpg',250,10,0.85,30); +$icon->SetAnchor('center','top'); +$graph->Add($icon); + +$t = new Text('JpGraph',250,70); +$t->SetAlign('center','top'); +#$t->SetFont(FF_VERA,FS_BOLD,11); +$t->SetColor('darkgray'); +$graph->Add($t); + +// ... and finally stroke and stream the image back to the browser +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/orange_example.php b/includes/jpgraph/src/Examples/orange_example.php new file mode 100644 index 0000000..adab98d --- /dev/null +++ b/includes/jpgraph/src/Examples/orange_example.php @@ -0,0 +1,58 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new OrangeTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "OrangeTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/partiallyfilledlineex1.php b/includes/jpgraph/src/Examples/partiallyfilledlineex1.php new file mode 100644 index 0000000..7ad37ec --- /dev/null +++ b/includes/jpgraph/src/Examples/partiallyfilledlineex1.php @@ -0,0 +1,44 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/pastel_example.php b/includes/jpgraph/src/Examples/pastel_example.php new file mode 100644 index 0000000..82aeeb4 --- /dev/null +++ b/includes/jpgraph/src/Examples/pastel_example.php @@ -0,0 +1,57 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new PastelTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "PastelTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex0.php b/includes/jpgraph/src/Examples/pdf417_ex0.php new file mode 100644 index 0000000..fb197f5 --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex0.php @@ -0,0 +1,8 @@ +Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex1.php b/includes/jpgraph/src/Examples/pdf417_ex1.php new file mode 100644 index 0000000..84dd272 --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex1.php @@ -0,0 +1,13 @@ +Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex1b.php b/includes/jpgraph/src/Examples/pdf417_ex1b.php new file mode 100644 index 0000000..fad0a9e --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex1b.php @@ -0,0 +1,20 @@ +Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex1c.php b/includes/jpgraph/src/Examples/pdf417_ex1c.php new file mode 100644 index 0000000..96a7487 --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex1c.php @@ -0,0 +1,23 @@ +ShowText(true); + $backend->SetModuleWidth($modwidth); + $backend->Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex2.php b/includes/jpgraph/src/Examples/pdf417_ex2.php new file mode 100644 index 0000000..685b0c2 --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex2.php @@ -0,0 +1,24 @@ +SetModuleWidth($modwidth); + $backend->SetHeight($height); + $backend->Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex3.php b/includes/jpgraph/src/Examples/pdf417_ex3.php new file mode 100644 index 0000000..ec2c7b6 --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex3.php @@ -0,0 +1,26 @@ +SetModuleWidth($modwidth); + $backend->SetHeight($height); + $backend->NoText(!$showtext); + $backend->Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex4.php b/includes/jpgraph/src/Examples/pdf417_ex4.php new file mode 100644 index 0000000..5fb8e6e --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex4.php @@ -0,0 +1,28 @@ +SetModuleWidth($modwidth); + $backend->SetHeight($height); + $backend->NoText(!$showtext); + $backend->SetColor('black','yellow'); + $backend->Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex5.php b/includes/jpgraph/src/Examples/pdf417_ex5.php new file mode 100644 index 0000000..fc525bf --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex5.php @@ -0,0 +1,29 @@ +SetModuleWidth($modwidth); + $backend->SetHeight($height); + $backend->NoText(!$showtext); + $backend->SetColor('black','yellow'); + $output = $backend->Stroke($data); + echo nl2br(htmlspecialchars($output)); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/pdf417_ex6.php b/includes/jpgraph/src/Examples/pdf417_ex6.php new file mode 100644 index 0000000..9b2e14d --- /dev/null +++ b/includes/jpgraph/src/Examples/pdf417_ex6.php @@ -0,0 +1,35 @@ +SetModuleWidth($modwidth); + $backend->NoText(!$showtext); + $backend->Stroke($data); +} +catch(JpGraphException $e) { + echo 'PDF417 Error: '.$e->GetMessage(); +} +?> diff --git a/includes/jpgraph/src/Examples/penguin.png b/includes/jpgraph/src/Examples/penguin.png new file mode 100644 index 0000000..2ae426a Binary files /dev/null and b/includes/jpgraph/src/Examples/penguin.png differ diff --git a/includes/jpgraph/src/Examples/pie3d_csimex1.php b/includes/jpgraph/src/Examples/pie3d_csimex1.php new file mode 100644 index 0000000..564c51f --- /dev/null +++ b/includes/jpgraph/src/Examples/pie3d_csimex1.php @@ -0,0 +1,43 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pie3dex1.php b/includes/jpgraph/src/Examples/pie3dex1.php new file mode 100644 index 0000000..10e2100 --- /dev/null +++ b/includes/jpgraph/src/Examples/pie3dex1.php @@ -0,0 +1,32 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set("Example 1 3D Pie plot"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); +$graph->title->SetColor("darkblue"); +$graph->legend->Pos(0.1,0.2); + +// Create pie plot +$p1 = new PiePlot3d($data); +$p1->SetTheme("sand"); +$p1->SetCenter(0.4); +$p1->SetAngle(30); +$p1->value->SetFont(FF_ARIAL,FS_NORMAL,12); +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); + +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pie3dex2.php b/includes/jpgraph/src/Examples/pie3dex2.php new file mode 100644 index 0000000..bd2a099 --- /dev/null +++ b/includes/jpgraph/src/Examples/pie3dex2.php @@ -0,0 +1,45 @@ +SetShadow(); + + +// Set A title for the plot +$graph->title->Set("Example 2 3D Pie plot"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); +$graph->title->SetColor("darkblue"); +$graph->legend->Pos(0.1,0.2); + +// Create 3D pie plot +$p1 = new PiePlot3d($data); +$p1->SetTheme("sand"); +$p1->SetCenter(0.4); +$p1->SetSize(0.4); +$p1->SetHeight(5); + +// Adjust projection angle +$p1->SetAngle(45); + +// You can explode several slices by specifying the explode +// distance for some slices in an array +$p1->Explode(array(0,40,0,30)); + +// As a shortcut you can easily explode one numbered slice with +// $p1->ExplodeSlice(3); + +$p1->value->SetFont(FF_ARIAL,FS_NORMAL,10); +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); + +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pie3dex3.php b/includes/jpgraph/src/Examples/pie3dex3.php new file mode 100644 index 0000000..b45a2f2 --- /dev/null +++ b/includes/jpgraph/src/Examples/pie3dex3.php @@ -0,0 +1,42 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set("Example 3 3D Pie plot"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); +$graph->title->SetColor("darkblue"); +$graph->legend->Pos(0.1,0.2); + +// Create 3D pie plot +$p1 = new PiePlot3d($data); +$p1->SetTheme("sand"); +$p1->SetCenter(0.4); +$p1->SetSize(80); + +// Adjust projection angle +$p1->SetAngle(45); + +// As a shortcut you can easily explode one numbered slice with +$p1->ExplodeSlice(3); + +// Setup the slice values +$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); +$p1->value->SetColor("navy"); + +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); + +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pie3dex4.php b/includes/jpgraph/src/Examples/pie3dex4.php new file mode 100644 index 0000000..0ce86e4 --- /dev/null +++ b/includes/jpgraph/src/Examples/pie3dex4.php @@ -0,0 +1,46 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set("Example 4 3D Pie plot"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); +$graph->title->SetColor("darkblue"); +$graph->legend->Pos(0.1,0.2); + +// Create 3D pie plot +$p1 = new PiePlot3d($data); +$p1->SetTheme("sand"); +$p1->SetCenter(0.4); +$p1->SetSize(80); + +// Adjust projection angle +$p1->SetAngle(45); + +// Adjsut angle for first slice +$p1->SetStartAngle(45); + +// As a shortcut you can easily explode one numbered slice with +$p1->ExplodeSlice(3); + +// Setup slice values +$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); +$p1->value->SetColor("navy"); + + +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); + +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pie3dex5.php b/includes/jpgraph/src/Examples/pie3dex5.php new file mode 100644 index 0000000..6efe470 --- /dev/null +++ b/includes/jpgraph/src/Examples/pie3dex5.php @@ -0,0 +1,46 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set("Example 5 3D Pie plot"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); +$graph->title->SetColor("darkblue"); +$graph->legend->Pos(0.1,0.2); + +// Create 3D pie plot +$p1 = new PiePlot3d($data); +$p1->SetTheme("sand"); +$p1->SetCenter(0.4); +$p1->SetSize(80); + +// Adjust projection angle +$p1->SetAngle(45); + +// Adjsut angle for first slice +$p1->SetStartAngle(45); + +// Display the slice values +$p1->value->SetFont(FF_ARIAL,FS_BOLD,11); +$p1->value->SetColor("navy"); + +// Add colored edges to the 3D pie +// NOTE: You can't have exploded slices with edges! +$p1->SetEdge("navy"); + +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); + +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pie_csimex1.php b/includes/jpgraph/src/Examples/pie_csimex1.php new file mode 100644 index 0000000..50c3f70 --- /dev/null +++ b/includes/jpgraph/src/Examples/pie_csimex1.php @@ -0,0 +1,35 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/piebkgex1.php b/includes/jpgraph/src/Examples/piebkgex1.php new file mode 100644 index 0000000..d2371c0 --- /dev/null +++ b/includes/jpgraph/src/Examples/piebkgex1.php @@ -0,0 +1,94 @@ +SetMargin(1,1,40,1); +$graph->SetMarginColor('navy'); +$graph->SetShadow(false); + +// Setup background +$graph->SetBackgroundImage('worldmap1.jpg',BGIMG_FILLPLOT); + +// Setup title +$graph->title->Set("Pie plots with background image"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,20); +$graph->title->SetColor('white'); + +$p = array(); +// Create the plots +for( $i=0; $i < $n; ++$i ) { + $d = "data$i"; + $p[] = new PiePlot3D($data[$i]); +} + +// Position the four pies +for( $i=0; $i < $n; ++$i ) { + $p[$i]->SetCenter($piepos[2*$i],$piepos[2*$i+1]); +} + +// Set the titles +for( $i=0; $i < $n; ++$i ) { + $p[$i]->title->Set($titles[$i]); + $p[$i]->title->SetColor('white'); + $p[$i]->title->SetFont(FF_ARIAL,FS_BOLD,12); +} + +// Label font and color setup +for( $i=0; $i < $n; ++$i ) { + $p[$i]->value->SetFont(FF_ARIAL,FS_BOLD); + $p[$i]->value->SetColor('white'); +} + +// Show the percetages for each slice +for( $i=0; $i < $n; ++$i ) { + $p[$i]->value->Show(); +} + +// Label format +for( $i=0; $i < $n; ++$i ) { + $p[$i]->value->SetFormat("%01.1f%%"); +} + +// Size of pie in fraction of the width of the graph +for( $i=0; $i < $n; ++$i ) { + $p[$i]->SetSize(0.15); +} + +// Format the border around each slice + + +for( $i=0; $i < $n; ++$i ) { + $p[$i]->SetEdge(false); + $p[$i]->ExplodeSlice(1); +} + +// Use one legend for the whole graph +$p[0]->SetLegends(array("May","June","July","Aug")); +$graph->legend->Pos(0.05,0.35); +$graph->legend->SetShadow(false); + +for( $i=0; $i < $n; ++$i ) { + $graph->Add($p[$i]); +} + +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/piec_csimex1.php b/includes/jpgraph/src/Examples/piec_csimex1.php new file mode 100644 index 0000000..bffcb02 --- /dev/null +++ b/includes/jpgraph/src/Examples/piec_csimex1.php @@ -0,0 +1,87 @@ +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_ARIAL,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->SetPos(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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/piecex1.php b/includes/jpgraph/src/Examples/piecex1.php new file mode 100644 index 0000000..af1f241 --- /dev/null +++ b/includes/jpgraph/src/Examples/piecex1.php @@ -0,0 +1,46 @@ +title->Set("Pie plot with center circle"); +$graph->title->SetFont(FF_ARIAL,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_ARIAL,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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/piecex2.php b/includes/jpgraph/src/Examples/piecex2.php new file mode 100644 index 0000000..9dbe5f1 --- /dev/null +++ b/includes/jpgraph/src/Examples/piecex2.php @@ -0,0 +1,70 @@ +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_ARIAL,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_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); + +// Add plot to pie graph +$graph->Add($p1); + +// .. and send the image on it's marry way to the browser +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pieex1.php b/includes/jpgraph/src/Examples/pieex1.php new file mode 100644 index 0000000..156d6e2 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex1.php @@ -0,0 +1,32 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set("Example 1 Pie plot"); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor("brown"); + +// Create pie plot +$p1 = new PiePlot($data); +//$p1->SetSliceColors(array("red","blue","yellow","green")); +$p1->SetTheme("earth"); + +$p1->value->SetFont(FF_ARIAL,FS_NORMAL,10); +// Set how many pixels each slice should explode +$p1->Explode(array(0,15,15,25,15)); + + +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pieex2.php b/includes/jpgraph/src/Examples/pieex2.php new file mode 100644 index 0000000..195d975 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex2.php @@ -0,0 +1,24 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set("Example 2 Pie plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Create +$p1 = new PiePlot($data); +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul")); +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pieex3.php b/includes/jpgraph/src/Examples/pieex3.php new file mode 100644 index 0000000..a7795c3 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex3.php @@ -0,0 +1,53 @@ +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(); + +?> + + + diff --git a/includes/jpgraph/src/Examples/pieex4.php b/includes/jpgraph/src/Examples/pieex4.php new file mode 100644 index 0000000..5854426 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex4.php @@ -0,0 +1,25 @@ +SetShadow(); + +$graph->title->Set("Example 4 of pie plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$p1 = new PiePlot($data); +$p1->value->SetFont(FF_FONT1,FS_BOLD); +$p1->value->SetColor("darkred"); +$p1->SetSize(0.3); +$p1->SetCenter(0.4); +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May")); +$graph->Add($p1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pieex5.php b/includes/jpgraph/src/Examples/pieex5.php new file mode 100644 index 0000000..808ab3e --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex5.php @@ -0,0 +1,31 @@ +SetShadow(); + +// Setup graph title +$graph->title->Set("Example 5 of pie plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Create pie plot +$p1 = new PiePlot($data); +$p1->value->SetFont(FF_VERDANA,FS_BOLD); +$p1->value->SetColor("darkred"); +$p1->SetSize(0.3); +$p1->SetCenter(0.4); +$p1->SetLegends(array("Jan","Feb","Mar","Apr","May")); +//$p1->SetStartAngle(M_PI/8); +$p1->ExplodeSlice(3); + +$graph->Add($p1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pieex6.php b/includes/jpgraph/src/Examples/pieex6.php new file mode 100644 index 0000000..46621e7 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex6.php @@ -0,0 +1,48 @@ +SetShadow(); + +// Setup title +$graph->title->Set("Example of pie plot with absolute labels"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// The pie plot +$p1 = new PiePlot($data); + +// Move center of pie to the left to make better room +// for the legend +$p1->SetCenter(0.35,0.5); + +// No border +$p1->ShowBorder(false); + +// Label font and color setup +$p1->value->SetFont(FF_FONT1,FS_BOLD); +$p1->value->SetColor("darkred"); + +// Use absolute values (type==1) +$p1->SetLabelType(PIE_VALUE_ABS); + +// Label format +$p1->value->SetFormat("$%d"); +$p1->value->Show(); + +// Size of pie in fraction of the width of the graph +$p1->SetSize(0.3); + +// Legends +$p1->SetLegends(array("May ($%d)","June ($%d)","July ($%d)","Aug ($%d)")); +$graph->legend->Pos(0.05,0.15); + +$graph->Add($p1); +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/pieex7.php b/includes/jpgraph/src/Examples/pieex7.php new file mode 100644 index 0000000..77f4610 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex7.php @@ -0,0 +1,52 @@ +SetShadow(); + +// Setup title +$graph->title->Set("Pie plot with absolute labels"); +$graph->subtitle->Set('(With hidden 0 labels)'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// The pie plot +$p1 = new PiePlot($data); + + +// Move center of pie to the left to make better room +// for the legend +$p1->SetCenter(0.35,0.5); + +// No border +$p1->ShowBorder(false); + +// Label font and color setup +$p1->value->SetFont(FF_FONT1,FS_BOLD); +$p1->value->SetColor("darkred"); + +// Use absolute values (type==1) +$p1->SetLabelType(PIE_VALUE_ABS); + +// Label format +$p1->value->SetFormat("$%d"); +$p1->value->HideZero(); +$p1->value->Show(); + +// Size of pie in fraction of the width of the graph +$p1->SetSize(0.3); + +// Legends +$p1->SetLegends(array("May ($%d)","June ($%d)","July ($%d)","Aug ($%d)")); +$graph->legend->Pos(0.05,0.2); + +$graph->Add($p1); +$graph->Stroke(); +?> + + diff --git a/includes/jpgraph/src/Examples/pieex8.php b/includes/jpgraph/src/Examples/pieex8.php new file mode 100644 index 0000000..0ca1785 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex8.php @@ -0,0 +1,33 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/pieex9.php b/includes/jpgraph/src/Examples/pieex9.php new file mode 100644 index 0000000..2354d06 --- /dev/null +++ b/includes/jpgraph/src/Examples/pieex9.php @@ -0,0 +1,39 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/pielabelsex1.php b/includes/jpgraph/src/Examples/pielabelsex1.php new file mode 100644 index 0000000..d2cf93a --- /dev/null +++ b/includes/jpgraph/src/Examples/pielabelsex1.php @@ -0,0 +1,38 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pielabelsex2.php b/includes/jpgraph/src/Examples/pielabelsex2.php new file mode 100644 index 0000000..bb3cc2a --- /dev/null +++ b/includes/jpgraph/src/Examples/pielabelsex2.php @@ -0,0 +1,38 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pielabelsex3.php b/includes/jpgraph/src/Examples/pielabelsex3.php new file mode 100644 index 0000000..cff6d40 --- /dev/null +++ b/includes/jpgraph/src/Examples/pielabelsex3.php @@ -0,0 +1,39 @@ +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 +// and force guide lines to always beeing used +$p1->SetGuideLines(true,false,true); +$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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pielabelsex4.php b/includes/jpgraph/src/Examples/pielabelsex4.php new file mode 100644 index 0000000..5187b3c --- /dev/null +++ b/includes/jpgraph/src/Examples/pielabelsex4.php @@ -0,0 +1,38 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pielabelsex5.php b/includes/jpgraph/src/Examples/pielabelsex5.php new file mode 100644 index 0000000..22e697d --- /dev/null +++ b/includes/jpgraph/src/Examples/pielabelsex5.php @@ -0,0 +1,48 @@ +SetShadow(); + +// Set A title for the plot +$graph->title->Set('String labels with values'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('black'); + +// Create pie plot +$p1 = new PiePlot($data); +$p1->SetCenter(0.5,0.5); +$p1->SetSize(0.3); + +// Setup the labels to be displayed +$p1->SetLabels($labels); + +// This method adjust the position of the labels. This is given as fractions +// of the radius of the Pie. A value < 1 will put the center of the label +// inside the Pie and a value >= 1 will pout the center of the label outside the +// Pie. By default the label is positioned at 0.5, in the middle of each slice. +$p1->SetLabelPos(1); + +// Setup the label formats and what value we want to be shown (The absolute) +// or the percentage. +$p1->SetLabelType(PIE_VALUE_PER); +$p1->value->Show(); +$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9); +$p1->value->SetColor('darkgray'); + +// Add and stroke +$graph->Add($p1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/plotbanddensity_ex0.php b/includes/jpgraph/src/Examples/plotbanddensity_ex0.php new file mode 100644 index 0000000..3615a95 --- /dev/null +++ b/includes/jpgraph/src/Examples/plotbanddensity_ex0.php @@ -0,0 +1,38 @@ +SetScale('textlin'); +$graph->SetMargin(25,10,20,25); +$graph->SetBox(true); + +// 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"); + +$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(10); +$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=10'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/plotbanddensity_ex1.php b/includes/jpgraph/src/Examples/plotbanddensity_ex1.php new file mode 100644 index 0000000..ed07487 --- /dev/null +++ b/includes/jpgraph/src/Examples/plotbanddensity_ex1.php @@ -0,0 +1,38 @@ +SetScale('textlin'); +$graph->SetMargin(25,10,20,25); +$graph->SetBox(true); + +// 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"); + +$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(40); +$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=40'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/plotbanddensity_ex2.php b/includes/jpgraph/src/Examples/plotbanddensity_ex2.php new file mode 100644 index 0000000..908efdf --- /dev/null +++ b/includes/jpgraph/src/Examples/plotbanddensity_ex2.php @@ -0,0 +1,38 @@ +SetScale('textlin'); +$graph->SetMargin(25,10,20,25); +$graph->SetBox(true); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10); +$graph->ygrid->Show(false); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->SetFillColor("lightblue"); + + +// .. and add the plot to the graph +$graph->Add($bplot); + +// Add band +$band = new PlotBand(HORIZONTAL,BAND_3DPLANE,15,35,'khaki4'); +$band->SetDensity(80); +$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=80'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/plotlineex1.php b/includes/jpgraph/src/Examples/plotlineex1.php new file mode 100644 index 0000000..43a8016 --- /dev/null +++ b/includes/jpgraph/src/Examples/plotlineex1.php @@ -0,0 +1,36 @@ +SetScale("textlin"); +$graph->SetMargin(40,20,50,70); + +$graph->legend->SetPos(0.5,0.97,'center','bottom'); + +$graph->title->Set('Plot line legend'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL); +$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','navy'); + +// Create a bar pot +$bplot = new BarPlot($datay); +$bplot->value->Show(); +$bplot->value->SetFont(FF_VERDANA,FS_BOLD,8); +$bplot->SetValuePos('top'); +$bplot->SetLegend('Bar Legend'); +$graph->Add($bplot); + +$pline = new PlotLine(HORIZONTAL,8,'red',2); +$pline->SetLegend('Line Legend'); +$graph->legend->SetColumns(10); +$graph->Add($pline); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/polar_csimex1.php b/includes/jpgraph/src/Examples/polar_csimex1.php new file mode 100644 index 0000000..ffaac17 --- /dev/null +++ b/includes/jpgraph/src/Examples/polar_csimex1.php @@ -0,0 +1,69 @@ +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'); + +// Setup the polar plot with CSIM targets for the marks +$p = new PolarPlot($data); +$p->SetFillColor('lightblue@0.5'); +$p->mark->SetType(MARK_SQUARE); +$p->mark->SetWidth(10); +$p->SetCSIMTargets( $targets ); + +$graph->Add($p); + +$graph->StrokeCSIM(); + +?> diff --git a/includes/jpgraph/src/Examples/polarclockex1.php b/includes/jpgraph/src/Examples/polarclockex1.php new file mode 100644 index 0000000..bdf9008 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarclockex1.php @@ -0,0 +1,55 @@ +SetScale('lin',150); + +$graph->SetMarginColor('#FFE6C0'); +$graph->SetType(POLAR_360); +$graph->SetMargin(40,40,50,40); +$graph->SetClockwise(true); + +//$graph->Set90AndMargin(60,50,70,120); + +$graph->SetBox(true); +$graph->SetFrame(false); +$graph->axis->ShowGrid(true,false,true); +$graph->axis->SetGridColor('gray','gray','gray'); + +$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); +$graph->axis->SetTitle('X-Axis','center'); + +$graph->axis->SetColor('black','black','darkred'); +$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); + +$graph->title->Set('Clockwise polar plot'); +$graph->title->SetFont(FF_COMIC,FS_NORMAL,16); +$graph->title->SetColor('navy'); + + + +$p = new PolarPlot($data); +$p->SetFillColor('lightblue@0.5'); +$graph->Add($p); + +//$p2 = new PolarPlot($data2); +//$p2->SetFillColor('red@0.5'); +//$graph->Add($p2); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarclockex2.php b/includes/jpgraph/src/Examples/polarclockex2.php new file mode 100644 index 0000000..11cdeca --- /dev/null +++ b/includes/jpgraph/src/Examples/polarclockex2.php @@ -0,0 +1,53 @@ +SetScale('lin',150); + +$graph->SetMarginColor('#FFE6C0'); +$graph->SetType(POLAR_360); +$graph->SetClockwise(true); +$graph->Set90AndMargin(40,40,50,40); + +$graph->SetBox(true); +$graph->SetFrame(false); +$graph->axis->ShowGrid(true,false,true); +$graph->axis->SetGridColor('gray','gray','gray'); + +$graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8); +$graph->axis->SetTitle('X-Axis','center'); + +$graph->axis->SetColor('black','black','darkred'); +$graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8); + +$graph->title->Set('Clockwise polar plot (rotated)'); +$graph->title->SetFont(FF_COMIC,FS_NORMAL,16); +$graph->title->SetColor('navy'); + + + +$p = new PolarPlot($data); +$p->SetFillColor('lightblue@0.5'); +$graph->Add($p); + +//$p2 = new PolarPlot($data2); +//$p2->SetFillColor('red@0.5'); +//$graph->Add($p2); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex0-180.php b/includes/jpgraph/src/Examples/polarex0-180.php new file mode 100644 index 0000000..4fa344f --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex0-180.php @@ -0,0 +1,27 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex0.php b/includes/jpgraph/src/Examples/polarex0.php new file mode 100644 index 0000000..b11aa6e --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex0.php @@ -0,0 +1,26 @@ +SetScale('lin'); +$graph->SetMargin(35,35,25,25); + +$p = new PolarPlot($data); +$p->SetFillColor('lightblue@0.5'); +$graph->Add($p); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex1.php b/includes/jpgraph/src/Examples/polarex1.php new file mode 100644 index 0000000..b0c7f8a --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex1.php @@ -0,0 +1,30 @@ +SetScale('lin'); +$graph->SetType(POLAR_180); +//$graph->SetAngle(90); +//$graph->SetMargin(30-150,30-150,30+150,30+150); +$graph->Set90AndMargin(40,40,40,40); +//$graph->axis->SetLabelAlign('right','center'); + +$p = new PolarPlot($data); +$p->SetLegend("Test"); +$graph->Add($p); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex10.php b/includes/jpgraph/src/Examples/polarex10.php new file mode 100644 index 0000000..d864a23 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex10.php @@ -0,0 +1,66 @@ +SetScale('log',100); +$graph->SetType(POLAR_360); + +// 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 graph title +$graph->title->Set('Polar plot #10'); +$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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex2.php b/includes/jpgraph/src/Examples/polarex2.php new file mode 100644 index 0000000..d4a9779 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex2.php @@ -0,0 +1,34 @@ +SetScale('lin'); + +$graph->title->Set('Polar plot #2'); +$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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex3-lin.php b/includes/jpgraph/src/Examples/polarex3-lin.php new file mode 100644 index 0000000..430438c --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex3-lin.php @@ -0,0 +1,33 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex3.php b/includes/jpgraph/src/Examples/polarex3.php new file mode 100644 index 0000000..82bf18a --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex3.php @@ -0,0 +1,33 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex4.php b/includes/jpgraph/src/Examples/polarex4.php new file mode 100644 index 0000000..a4fb1d0 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex4.php @@ -0,0 +1,34 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex5.php b/includes/jpgraph/src/Examples/polarex5.php new file mode 100644 index 0000000..7da5802 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex5.php @@ -0,0 +1,37 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex6.php b/includes/jpgraph/src/Examples/polarex6.php new file mode 100644 index 0000000..21ae6a2 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex6.php @@ -0,0 +1,35 @@ +SetScale('log'); +$graph->SetType(POLAR_180); + +// Show both major and minor grid lines +$graph->axis->ShowGrid(true,true); + +$graph->title->Set('Polar plot #6'); +$graph->title->SetFont(FF_FONT2,FS_BOLD); +$graph->title->SetColor('navy'); + + +$p = new PolarPlot($data); +$p->SetFillColor('lightred@0.5'); + +$graph->Add($p); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex7-1.php b/includes/jpgraph/src/Examples/polarex7-1.php new file mode 100644 index 0000000..5b593a1 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex7-1.php @@ -0,0 +1,50 @@ +SetScale('log',100); +$graph->SetType(POLAR_180); +$graph->SetPlotSize(220,250); + +// Hide frame around graph (by setting width=0) +$graph->SetFrame(true,'white',1); + +$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_HOR,BGRAD_PLOT); + +// Set color for gradient lines +$graph->axis->SetGridColor('gray','gray','gray'); + +// Setup axis title +$graph->axis->SetTitle('Coverage (in meter)','middle'); +$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->title->Set('Polar plot #7'); +$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('lightblue@0.5'); +$p->mark->SetType(MARK_SQUARE); +$p->SetLegend("Mirophone #1\n(No amps)"); + +$graph->Add($p); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex7-2.php b/includes/jpgraph/src/Examples/polarex7-2.php new file mode 100644 index 0000000..959749d --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex7-2.php @@ -0,0 +1,53 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex7.php b/includes/jpgraph/src/Examples/polarex7.php new file mode 100644 index 0000000..d7079a0 --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex7.php @@ -0,0 +1,53 @@ +SetScale('lin',300); +$graph->SetType(POLAR_180); +$graph->SetPlotSize(220,250); + +// Hide frame around graph (by setting width=0) +$graph->SetFrame(true,'white',1); + +$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_HOR,BGRAD_PLOT); + +// Show both major and minor grid lines +$graph->axis->ShowGrid(true,true); + +// Set color for gradient lines +$graph->axis->SetGridColor('gray','gray','gray'); + +// Setup axis title +$graph->axis->SetTitle('Coverage (in meter)','middle'); +$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->title->Set('Polar plot #7'); +$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('lightblue@0.5'); +$p->mark->SetType(MARK_SQUARE); +$p->SetLegend("Mirophone #1\n(No amps)"); + +$graph->Add($p); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex8.php b/includes/jpgraph/src/Examples/polarex8.php new file mode 100644 index 0000000..8322ebc --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex8.php @@ -0,0 +1,54 @@ +SetScale('log',100); +$graph->SetType(POLAR_180); +//$graph->SetPlotSize(250,250); + +// Hide frame around graph (by setting width=0) +$graph->SetFrame(true,'white',1); + +// Set plotarea color +$graph->SetColor('lightblue'); + +// Show both major and minor grid lines +$graph->axis->ShowGrid(true,true); + +// Set color for gradient lines +$graph->axis->SetGridColor('lightblue:0.8','lightblue:0.8','lightblue:0.8'); + +// Setup axis title +$graph->axis->SetTitle('Coverage (in meter)','middle'); +$graph->axis->title->SetFont(FF_FONT1,FS_BOLD); + +$graph->title->Set('Polar plot #8'); +$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('white@0.5'); +$p->mark->SetType(MARK_SQUARE); +$p->SetLegend("Mirophone #1\n(No amps)"); + +$graph->Add($p); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/polarex9.php b/includes/jpgraph/src/Examples/polarex9.php new file mode 100644 index 0000000..ee239ec --- /dev/null +++ b/includes/jpgraph/src/Examples/polarex9.php @@ -0,0 +1,63 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/prepaccdata_example.php b/includes/jpgraph/src/Examples/prepaccdata_example.php new file mode 100644 index 0000000..1f1fca3 --- /dev/null +++ b/includes/jpgraph/src/Examples/prepaccdata_example.php @@ -0,0 +1,61 @@ +title->Set('Accumulated values with specified X-axis scale'); +$graph->SetScale('textlin'); + +// Setup margin color +$graph->SetMarginColor('green@0.95'); + +// Adjust the margin to make room for the X-labels +$graph->SetMargin(40,30,40,120); + +// Turn the tick marks out from the plot area +$graph->xaxis->SetTickSide(SIDE_BOTTOM); +$graph->yaxis->SetTickSide(SIDE_LEFT); + +$p0 =new LinePlot($ydata[0]); +$p0->SetFillColor('sandybrown'); +$p1 =new LinePlot($ydata[1]); +$p1->SetFillColor('lightblue'); +$p2 =new LinePlot($ydata[2]); +$p2->SetFillColor('red'); +$ap = new AccLinePlot(array($p0,$p1,$p2)); + +$graph->xaxis->SetTickLabels($xdata); +$graph->xaxis->SetTextLabelInterval(4); + +// Add the plot to the graph +$graph->Add($ap); + +// Set the angle for the labels to 90 degrees +$graph->xaxis->SetLabelAngle(90); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/pushpinex1.php b/includes/jpgraph/src/Examples/pushpinex1.php new file mode 100644 index 0000000..4b10098 --- /dev/null +++ b/includes/jpgraph/src/Examples/pushpinex1.php @@ -0,0 +1,62 @@ +img->SetMargin(1,1,1,1); +$graph->SetScale('linlin',0,100,0,100); + +// We don't want any axis to be shown +$graph->xaxis->Hide(); +$graph->yaxis->Hide(); + +// Use a worldmap as the background and let it fill the plot area +$graph->SetBackgroundImage(WORLDMAP,BGIMG_FILLPLOT); + +// Setup a nice title with a striped bevel background +$graph->title->Set("Pushpin graph"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); +$graph->title->SetColor('white'); +$graph->SetTitleBackground('darkgreen',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL); +$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'blue','darkgreen'); + +// Finally create the scatterplot +$sp = new ScatterPlot($datay,$datax); + +// We want the markers to be an image +$sp->mark->SetType(MARK_IMG_PUSHPIN,'blue',0.6); + +// Install the Y-X callback for the markers +$sp->mark->SetCallbackYX('markCallback'); + +// ... and add it to the graph +$graph->Add($sp); + +// .. and output to browser +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/pushpinex2.php b/includes/jpgraph/src/Examples/pushpinex2.php new file mode 100644 index 0000000..000d1cc --- /dev/null +++ b/includes/jpgraph/src/Examples/pushpinex2.php @@ -0,0 +1,63 @@ +img->SetMargin(1,1,1,1); +$graph->SetScale('linlin',0,100,0,100); + +// We don't want any axis to be shown +$graph->xaxis->Hide(); +$graph->yaxis->Hide(); + +// Use a worldmap as the background and let it fill the plot area +$graph->SetBackgroundImage(WORLDMAP,BGIMG_FILLPLOT); + +// Setup a nice title with a striped bevel background +$graph->title->Set("Pushpin graph"); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); +$graph->title->SetColor('white'); +$graph->SetTitleBackground('darkgreen',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL); +$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'blue','darkgreen'); + +// Finally create the lineplot +$lp = new LinePlot($datay,$datax); +$lp->SetColor('lightgray'); + +// We want the markers to be an image +$lp->mark->SetType(MARK_IMG_PUSHPIN,'blue',0.6); + +// Install the Y-X callback for the markers +$lp->mark->SetCallbackYX('markCallback'); + +// ... and add it to the graph +$graph->Add($lp); + +// .. and output to browser +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/qr-input.txt b/includes/jpgraph/src/Examples/qr-input.txt new file mode 100644 index 0000000..1b3c2bc --- /dev/null +++ b/includes/jpgraph/src/Examples/qr-input.txt @@ -0,0 +1 @@ +01234567890 \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/qr_template.php b/includes/jpgraph/src/Examples/qr_template.php new file mode 100644 index 0000000..e54ea78 --- /dev/null +++ b/includes/jpgraph/src/Examples/qr_template.php @@ -0,0 +1,32 @@ +SetModuleWidth($modulewidth); + +// Set Quiet zone (this should rarely need changing from the default) +$backend->SetQuietZone($quiet); + +if( $back == BACKEND_IMAGE ) { + + $backend->Stroke($data); +} +else { + $str = $backend->Stroke($data); + echo '
'.$str.'
'; +} +?> diff --git a/includes/jpgraph/src/Examples/qrexample0.php b/includes/jpgraph/src/Examples/qrexample0.php new file mode 100644 index 0000000..46126fe --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample0.php @@ -0,0 +1,23 @@ +Stroke($data); +} catch (Exception $e) { + $errstr = $e->GetMessage(); + echo 'QR Code error: '.$e->GetMessage()."\n"; + exit(1); +} + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/qrexample00.php b/includes/jpgraph/src/Examples/qrexample00.php new file mode 100644 index 0000000..f09fcd5 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample00.php @@ -0,0 +1,16 @@ +Stroke($data); +?> \ No newline at end of file diff --git a/includes/jpgraph/src/Examples/qrexample01.php b/includes/jpgraph/src/Examples/qrexample01.php new file mode 100644 index 0000000..af99dea --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample01.php @@ -0,0 +1,19 @@ +SetModuleWidth(5); + +// .. send the barcode back to the browser for the data +$backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample02.php b/includes/jpgraph/src/Examples/qrexample02.php new file mode 100644 index 0000000..890d616 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample02.php @@ -0,0 +1,23 @@ +SetModuleWidth(5); + + // .. send the barcode back to the browser for the data + $backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample03.php b/includes/jpgraph/src/Examples/qrexample03.php new file mode 100644 index 0000000..858eede --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample03.php @@ -0,0 +1,27 @@ +SetModuleWidth(5); + + // Store the barcode in the specifed file + $backend->Stroke($data,$fileName); + list($version,$errorcorrection) = $backend->GetQRInfo(); + + echo "QR Barcode, (Version: $version-$errorcorrection), image stored in file $fileName"; +?> diff --git a/includes/jpgraph/src/Examples/qrexample03.png b/includes/jpgraph/src/Examples/qrexample03.png new file mode 100644 index 0000000..091a1cc Binary files /dev/null and b/includes/jpgraph/src/Examples/qrexample03.png differ diff --git a/includes/jpgraph/src/Examples/qrexample04.php b/includes/jpgraph/src/Examples/qrexample04.php new file mode 100644 index 0000000..c86447a --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample04.php @@ -0,0 +1,24 @@ +SetModuleWidth(3); + + // Store the barcode in the specifed file + $backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample05.php b/includes/jpgraph/src/Examples/qrexample05.php new file mode 100644 index 0000000..96f5f47 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample05.php @@ -0,0 +1,29 @@ +SetModuleWidth(4); + + // Store the barcode in the specifed file + $backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample06.php b/includes/jpgraph/src/Examples/qrexample06.php new file mode 100644 index 0000000..046627f --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample06.php @@ -0,0 +1,26 @@ +SetImgFormat('jpeg',80); + + // Set the module size + $backend->SetModuleWidth(4); + + // Store the barcode in the specifed file + $backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample07.php b/includes/jpgraph/src/Examples/qrexample07.php new file mode 100644 index 0000000..68dde15 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample07.php @@ -0,0 +1,26 @@ +SetModuleWidth(4); + + // Store the barcode in the specifed file + $backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample08.php b/includes/jpgraph/src/Examples/qrexample08.php new file mode 100644 index 0000000..08eb947 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample08.php @@ -0,0 +1,22 @@ +SetModuleWidth(5); + + // .. send the barcode back to the browser for the data in the file + $backend->StrokeFromFile($readFromFilename); +?> diff --git a/includes/jpgraph/src/Examples/qrexample09.php b/includes/jpgraph/src/Examples/qrexample09.php new file mode 100644 index 0000000..faa2a5d --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample09.php @@ -0,0 +1,25 @@ +SetModuleWidth(5); + + // Use blue and white colors instead + $backend->SetColor('navy','white'); + + // .. send the barcode back to the browser for the data in the file + $backend->StrokeFromFile($readFromFilename); +?> diff --git a/includes/jpgraph/src/Examples/qrexample10.php b/includes/jpgraph/src/Examples/qrexample10.php new file mode 100644 index 0000000..1232754 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample10.php @@ -0,0 +1,26 @@ +SetModuleWidth(3); + + // Set color + $backend->SetColor('brown','white'); + + // Store the barcode in the specifed file + $backend->Stroke($data); +?> diff --git a/includes/jpgraph/src/Examples/qrexample11.php b/includes/jpgraph/src/Examples/qrexample11.php new file mode 100644 index 0000000..2f3e503 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample11.php @@ -0,0 +1,26 @@ +SetModuleWidth($modulewidth); + +// Store the barcode in the specifed file +$ps_str = $backend->Stroke($data); + +echo '
'.$ps_str.'
'; +?> diff --git a/includes/jpgraph/src/Examples/qrexample12.php b/includes/jpgraph/src/Examples/qrexample12.php new file mode 100644 index 0000000..d1e0904 --- /dev/null +++ b/includes/jpgraph/src/Examples/qrexample12.php @@ -0,0 +1,26 @@ +SetModuleWidth($modulewidth); + +// Store the barcode in the specifed file +$ps_str = $backend->Stroke($data); + +echo '
'.$ps_str.'
'; +?> diff --git a/includes/jpgraph/src/Examples/radar_csimex1.php b/includes/jpgraph/src/Examples/radar_csimex1.php new file mode 100644 index 0000000..1f0454d --- /dev/null +++ b/includes/jpgraph/src/Examples/radar_csimex1.php @@ -0,0 +1,43 @@ +title->Set('Radar with marks'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetMargin(10); + +$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(2); +$plot->SetFillColor('red@0.7'); +$plot->mark->SetType(MARK_IMG_DIAMOND,'red',0.6); +$plot->mark->SetFillColor('darkred'); +$plot->SetCSIMTargets( $targets , $alts ); + +$graph->Add($plot); +$graph->StrokeCSIM(); +?> diff --git a/includes/jpgraph/src/Examples/radarex1.php b/includes/jpgraph/src/Examples/radarex1.php new file mode 100644 index 0000000..a210375 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex1.php @@ -0,0 +1,16 @@ +Add($plot); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/radarex2.php b/includes/jpgraph/src/Examples/radarex2.php new file mode 100644 index 0000000..a1400a3 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex2.php @@ -0,0 +1,21 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/radarex3.php b/includes/jpgraph/src/Examples/radarex3.php new file mode 100644 index 0000000..18fdd90 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex3.php @@ -0,0 +1,21 @@ +GetShortMonth(); +$graph->SetTitles($titles); + +$plot = new RadarPlot($data); +$plot->SetFillColor('lightblue'); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/radarex4.php b/includes/jpgraph/src/Examples/radarex4.php new file mode 100644 index 0000000..f64f614 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex4.php @@ -0,0 +1,28 @@ +SetShadow(); + +// Create the titles for the axis +$titles = $gDateLocale->GetShortMonth(); +$graph->SetTitles($titles); + +// Add grid lines +$graph->grid->Show(); +$graph->grid->SetLineStyle('dashed'); + +$plot = new RadarPlot($data); +$plot->SetFillColor('lightblue'); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/radarex5.php b/includes/jpgraph/src/Examples/radarex5.php new file mode 100644 index 0000000..6ee42ae --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex5.php @@ -0,0 +1,26 @@ +GetShortMonth(); +$graph->SetTitles($titles); + +// Add grid lines +$graph->grid->Show(); +$graph->grid->SetColor('darkred'); +$graph->grid->SetLineStyle('dotted'); + +$plot = new RadarPlot($data); +$plot->SetFillColor('lightblue'); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/radarex6.1.php b/includes/jpgraph/src/Examples/radarex6.1.php new file mode 100644 index 0000000..e6f9a50 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex6.1.php @@ -0,0 +1,45 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/radarex6.php b/includes/jpgraph/src/Examples/radarex6.php new file mode 100644 index 0000000..d702f29 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex6.php @@ -0,0 +1,35 @@ +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.45,0.5); + +// Add grid lines +$graph->grid->Show(); +$graph->grid->SetColor('darkred'); +$graph->grid->SetLineStyle('dashed'); + +$plot = new RadarPlot($data); +$plot->SetFillColor('lightblue'); +$plot->SetLegend("QA results"); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/radarex7.php b/includes/jpgraph/src/Examples/radarex7.php new file mode 100644 index 0000000..cb44c20 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex7.php @@ -0,0 +1,48 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/radarex8.1.php b/includes/jpgraph/src/Examples/radarex8.1.php new file mode 100644 index 0000000..e1f1336 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex8.1.php @@ -0,0 +1,52 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/radarex8.php b/includes/jpgraph/src/Examples/radarex8.php new file mode 100644 index 0000000..0d6b0f8 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex8.php @@ -0,0 +1,51 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/radarex9.php b/includes/jpgraph/src/Examples/radarex9.php new file mode 100644 index 0000000..465ca26 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarex9.php @@ -0,0 +1,33 @@ +title->Set("Accumulated PPM"); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12); + +$graph->subtitle->Set("(according to direction)"); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); + + +$graph->SetTitles($titles); +$graph->SetCenter(0.5,0.55); +$graph->HideTickMarks(); +$graph->SetColor('lightyellow'); +$graph->axis->SetColor('darkgray@0.3'); +$graph->grid->SetColor('darkgray@0.3'); +$graph->grid->Show(); + +$graph->SetGridDepth(DEPTH_BACK); + +$plot = new RadarPlot($data); +$plot->SetColor('red@0.2'); +$plot->SetLineWeight(1); +$plot->SetFillColor('red@0.7'); +$graph->Add($plot); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/radarlogex1-aa.php b/includes/jpgraph/src/Examples/radarlogex1-aa.php new file mode 100644 index 0000000..8417fb7 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarlogex1-aa.php @@ -0,0 +1,60 @@ +SetScale('log'); + +$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); +$graph->title->Set('Logarithmic scale'); +$graph->title->SetMargin(10); + +// Make the radar graph fill out it's bounding box +$graph->SetPlotSize(0.8); +$graph->SetCenter(0.5,0.55); + +// Note: Enabling this results in a very noticable slow +// down of the image generation! And more load on your +// server. +$graph->img->SetAntiAliasing(); + +// Uncomment the following line if you want to supress +// minor tick marks +//$graph->yscale->ticks->SupressMinorTickMarks(); + +// We want the major tick marks to be black and minor +// slightly less noticable +$graph->yscale->ticks->SetMarkColor('black','darkgray'); + +// Set the axis title font +$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->axis->title->SetColor('darkred:0.8'); + +// Use blue axis +$graph->axis->SetColor('blue'); + +$plot = new RadarPlot($data); +$plot->SetLineWeight(1); +$plot->SetColor('forestgreen'); +$plot->SetFillColor('forestgreen@0.9'); + +$plot2 = new RadarPlot($data2); +$plot2->SetLineWeight(2); +$plot2->SetColor('red'); +$plot2->SetFillColor('red@0.9'); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Add($plot2); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/radarlogex1.php b/includes/jpgraph/src/Examples/radarlogex1.php new file mode 100644 index 0000000..2d08310 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarlogex1.php @@ -0,0 +1,55 @@ +SetScale('log'); + +$graph->title->SetFont(FF_ARIAL,FS_BOLD,16); +$graph->title->Set('Logarithmic scale'); +$graph->title->SetMargin(10); + +// Make the radar graph fill out it's bounding box +$graph->SetPlotSize(0.8); +$graph->SetCenter(0.5,0.55); + +// Uncomment the following line if you want to supress +// minor tick marks +//$graph->yscale->ticks->SupressMinorTickMarks(); + +// We want the major tick marks to be black and minor +// slightly less noticable +$graph->yscale->ticks->SetMarkColor('black','darkgray'); + +// Set the axis title font +$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->axis->title->SetColor('darkred:0.8'); + +// Use blue axis +$graph->axis->SetColor('blue'); + +$plot = new RadarPlot($data); +$plot->SetLineWeight(1); +$plot->SetColor('forestgreen'); +$plot->SetFillColor('forestgreen@0.9'); + +$plot2 = new RadarPlot($data2); +$plot2->SetLineWeight(2); +$plot2->SetColor('red'); +$plot2->SetFillColor('red@0.9'); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Add($plot2); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/radarlogex2.php b/includes/jpgraph/src/Examples/radarlogex2.php new file mode 100644 index 0000000..f347141 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarlogex2.php @@ -0,0 +1,47 @@ +img->SetAntiAliasing(); + +// Make the spider graph fill out it's bounding box +$graph->SetPlotSize(0.85); + +// Use logarithmic scale (If you don't use any SetScale() +// the spider graph will default to linear scale +$graph->SetScale("log"); + +// Uncomment the following line if you want to supress +// minor tick marks +// $graph->yscale->ticks->SupressMinorTickMarks(); + +// We want the major tick marks to be black and minor +// slightly less noticable +$graph->yscale->ticks->SetMarkColor("black","darkgray"); + +// Set the axis title font +$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// Use blue axis +$graph->axis->SetColor("blue"); + +$plot = new RadarPlot($data); +$plot->SetLineWeight(2); +$plot->SetColor('forestgreen'); + +// Add the plot and display the graph +$graph->Add($plot); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/radarmarkex1.php b/includes/jpgraph/src/Examples/radarmarkex1.php new file mode 100644 index 0000000..f5595e8 --- /dev/null +++ b/includes/jpgraph/src/Examples/radarmarkex1.php @@ -0,0 +1,35 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/rose.gif b/includes/jpgraph/src/Examples/rose.gif new file mode 100644 index 0000000..59fe631 Binary files /dev/null and b/includes/jpgraph/src/Examples/rose.gif differ diff --git a/includes/jpgraph/src/Examples/rose_example.php b/includes/jpgraph/src/Examples/rose_example.php new file mode 100644 index 0000000..7d3d7c5 --- /dev/null +++ b/includes/jpgraph/src/Examples/rose_example.php @@ -0,0 +1,57 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new RoseTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "RoseTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/rotateex1.php b/includes/jpgraph/src/Examples/rotateex1.php new file mode 100644 index 0000000..a90a600 --- /dev/null +++ b/includes/jpgraph/src/Examples/rotateex1.php @@ -0,0 +1,46 @@ +SetAngle(40); +$graph->img->SetMargin(80,80,80,80); +$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 1 rotated graph (40 degree)"); +$graph->legend->Pos(0.05,0.1,"right","top"); + +$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(); +?> diff --git a/includes/jpgraph/src/Examples/rotex0.php b/includes/jpgraph/src/Examples/rotex0.php new file mode 100644 index 0000000..83d26bb --- /dev/null +++ b/includes/jpgraph/src/Examples/rotex0.php @@ -0,0 +1,22 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/rotex1.php b/includes/jpgraph/src/Examples/rotex1.php new file mode 100644 index 0000000..f087b98 --- /dev/null +++ b/includes/jpgraph/src/Examples/rotex1.php @@ -0,0 +1,24 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/rotex2.php b/includes/jpgraph/src/Examples/rotex2.php new file mode 100644 index 0000000..bfdea5a --- /dev/null +++ b/includes/jpgraph/src/Examples/rotex2.php @@ -0,0 +1,24 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/rotex3.php b/includes/jpgraph/src/Examples/rotex3.php new file mode 100644 index 0000000..3a0a03d --- /dev/null +++ b/includes/jpgraph/src/Examples/rotex3.php @@ -0,0 +1,25 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/rotex4.php b/includes/jpgraph/src/Examples/rotex4.php new file mode 100644 index 0000000..9c01a7b --- /dev/null +++ b/includes/jpgraph/src/Examples/rotex4.php @@ -0,0 +1,25 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/rotex5.php b/includes/jpgraph/src/Examples/rotex5.php new file mode 100644 index 0000000..bdf0d93 --- /dev/null +++ b/includes/jpgraph/src/Examples/rotex5.php @@ -0,0 +1,25 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/saab_95.jpg b/includes/jpgraph/src/Examples/saab_95.jpg new file mode 100644 index 0000000..189b0d4 Binary files /dev/null and b/includes/jpgraph/src/Examples/saab_95.jpg differ diff --git a/includes/jpgraph/src/Examples/scatter_csimex1.php b/includes/jpgraph/src/Examples/scatter_csimex1.php new file mode 100644 index 0000000..2ab4306 --- /dev/null +++ b/includes/jpgraph/src/Examples/scatter_csimex1.php @@ -0,0 +1,44 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/scatterex1.php b/includes/jpgraph/src/Examples/scatterex1.php new file mode 100644 index 0000000..83d830b --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterex1.php @@ -0,0 +1,22 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/scatterex2.php b/includes/jpgraph/src/Examples/scatterex2.php new file mode 100644 index 0000000..ff2b847 --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterex2.php @@ -0,0 +1,25 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/scatterlinkex1.php b/includes/jpgraph/src/Examples/scatterlinkex1.php new file mode 100644 index 0000000..2f2d1bd --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterlinkex1.php @@ -0,0 +1,26 @@ +img->SetMargin(40,40,40,40); +$graph->img->SetAntiAliasing(); +$graph->SetScale("linlin"); +$graph->SetShadow(); +$graph->title->Set("Linked Scatter plot ex1"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +$sp1 = new ScatterPlot($datay,$datax); +$sp1->SetLinkPoints(true,"red",2); +$sp1->mark->SetType(MARK_FILLEDCIRCLE); +$sp1->mark->SetFillColor("navy"); +$sp1->mark->SetWidth(3); + +$graph->Add($sp1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/scatterlinkex2.php b/includes/jpgraph/src/Examples/scatterlinkex2.php new file mode 100644 index 0000000..f45f1ec --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterlinkex2.php @@ -0,0 +1,43 @@ +SetScale("linlin"); + +$graph->img->SetMargin(40,40,40,40); + +$graph->SetShadow(); +$graph->title->Set("Linked scatter plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// 10% top and bottom grace +$graph->yscale->SetGrace(5,5); +$graph->xscale->SetGrace(1,1); + +$sp1 = new ScatterPlot($datay,$datax); +$sp1->mark->SetType(MARK_FILLEDCIRCLE); +$sp1->mark->SetFillColor("red"); +$sp1->SetColor("blue"); + +//$sp1->SetWeight(3); +$sp1->mark->SetWidth(4); +$sp1->SetLinkPoints(); + +$graph->Add($sp1); + +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/scatterlinkex3.php b/includes/jpgraph/src/Examples/scatterlinkex3.php new file mode 100644 index 0000000..aef5150 --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterlinkex3.php @@ -0,0 +1,45 @@ +SetScale('linlin'); +$graph->SetShadow(); +$graph->SetAxisStyle(AXSTYLE_BOXOUT); + +$graph->img->SetMargin(50,50,60,40); + +$graph->title->Set('Linked scatter plot'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->subtitle->Set('(BOXOUT Axis style)'); +$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); + + +// 10% top and bottom grace +$graph->yscale->SetGrace(5,5); +$graph->xscale->SetGrace(1,1); + +$sp1 = new ScatterPlot($datay,$datax); +$sp1->mark->SetType(MARK_FILLEDCIRCLE); +$sp1->mark->SetFillColor('red'); +$sp1->SetColor('blue'); + +$sp1->mark->SetWidth(4); +$sp1->link->Show(); +$sp1->link->SetStyle('dotted'); + +$graph->Add($sp1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/scatterlinkex4.php b/includes/jpgraph/src/Examples/scatterlinkex4.php new file mode 100644 index 0000000..63659e0 --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterlinkex4.php @@ -0,0 +1,45 @@ +SetScale('linlin'); +$graph->SetShadow(); +$graph->SetAxisStyle(AXSTYLE_BOXIN); + +$graph->img->SetMargin(50,50,60,40); + +$graph->title->Set('Linked scatter plot'); +$graph->title->SetFont(FF_FONT1,FS_BOLD); +$graph->subtitle->Set('(BOXIN Axis style)'); +$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL); + +// 10% top and bottom grace +$graph->yscale->SetGrace(5,5); +$graph->xscale->SetGrace(1,1); + +$sp1 = new ScatterPlot($datay,$datax); +$sp1->mark->SetType(MARK_FILLEDCIRCLE); +$sp1->mark->SetFillColor('red'); +$sp1->SetColor('blue'); + +$sp1->mark->SetWidth(4); +$sp1->link->Show(); +$sp1->link->SetWeight(2); +$sp1->link->SetColor('red@0.7'); + + +$graph->Add($sp1); +$graph->Stroke(); + +?> + + diff --git a/includes/jpgraph/src/Examples/scatterrotex1.php b/includes/jpgraph/src/Examples/scatterrotex1.php new file mode 100644 index 0000000..6d67e5b --- /dev/null +++ b/includes/jpgraph/src/Examples/scatterrotex1.php @@ -0,0 +1,35 @@ +SetScale("linlin"); + +$graph->Set90AndMargin(40,40,40,40); +$graph->SetShadow(); + +$graph->title->Set("A 90 degrees rotated scatter plot"); +$graph->title->SetFont(FF_FONT1,FS_BOLD); + +// Adjust the label align for X-axis so they look good rotated +$graph->xaxis->SetLabelAlign('right','center','right'); + +// Adjust the label align for Y-axis so they look good rotated +$graph->yaxis->SetLabelAlign('center','bottom'); + +$graph->xaxis->SetTitle('X-Axis title','low'); +$graph->xaxis->title->SetAngle(90); +$graph->xaxis->title->SetMargin(15); + +$sp1 = new ScatterPlot($datay,$datax); +$sp1->mark->SetType(MARK_FILLEDCIRCLE); +$sp1->mark->SetFillColor("red"); +$sp1->mark->SetWidth(5); + +$graph->Add($sp1); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/show-example.php b/includes/jpgraph/src/Examples/show-example.php new file mode 100644 index 0000000..b95ac27 --- /dev/null +++ b/includes/jpgraph/src/Examples/show-example.php @@ -0,0 +1,24 @@ + + + + + Test suite for JpGraph - <?php echo $target; ?> + + + + "; + else + echo ""; + ?> + + + diff --git a/includes/jpgraph/src/Examples/show-image.php b/includes/jpgraph/src/Examples/show-image.php new file mode 100644 index 0000000..85a987c --- /dev/null +++ b/includes/jpgraph/src/Examples/show-image.php @@ -0,0 +1,10 @@ + + + + + Image <?php echo basename($target); ?> + + +<?php echo basename($target); ?> + + diff --git a/includes/jpgraph/src/Examples/show-source.php b/includes/jpgraph/src/Examples/show-source.php new file mode 100644 index 0000000..248f2de --- /dev/null +++ b/includes/jpgraph/src/Examples/show-source.php @@ -0,0 +1 @@ + diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex1.php b/includes/jpgraph/src/Examples/smallstaticbandsex1.php new file mode 100644 index 0000000..c78fc8b --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex1.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_RDIAG'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex10.php b/includes/jpgraph/src/Examples/smallstaticbandsex10.php new file mode 100644 index 0000000..88a091c --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex10.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_DIAGCROSS'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex11.php b/includes/jpgraph/src/Examples/smallstaticbandsex11.php new file mode 100644 index 0000000..88a091c --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex11.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_DIAGCROSS'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex2.php b/includes/jpgraph/src/Examples/smallstaticbandsex2.php new file mode 100644 index 0000000..d9add7a --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex2.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_LDIAG'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex3.php b/includes/jpgraph/src/Examples/smallstaticbandsex3.php new file mode 100644 index 0000000..aa2a94d --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex3.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_SOLID'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex4.php b/includes/jpgraph/src/Examples/smallstaticbandsex4.php new file mode 100644 index 0000000..e4bd999 --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex4.php @@ -0,0 +1,42 @@ +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(80); +$band->ShowFrame(true); +$graph->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_3DPLANE, Density=60'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex5.php b/includes/jpgraph/src/Examples/smallstaticbandsex5.php new file mode 100644 index 0000000..d7f9ebb --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex5.php @@ -0,0 +1,42 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_HVCROSS, In front'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex6.php b/includes/jpgraph/src/Examples/smallstaticbandsex6.php new file mode 100644 index 0000000..506e1a8 --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex6.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_VLINE'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex7.php b/includes/jpgraph/src/Examples/smallstaticbandsex7.php new file mode 100644 index 0000000..e07dc6a --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex7.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_HLINE'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex8.php b/includes/jpgraph/src/Examples/smallstaticbandsex8.php new file mode 100644 index 0000000..6fbe40f --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex8.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_3DPLANE'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/smallstaticbandsex9.php b/includes/jpgraph/src/Examples/smallstaticbandsex9.php new file mode 100644 index 0000000..b6126d8 --- /dev/null +++ b/includes/jpgraph/src/Examples/smallstaticbandsex9.php @@ -0,0 +1,41 @@ +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->Add($band); + +// Set title +$graph->title->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->title->SetColor('darkred'); +$graph->title->Set('BAND_HVCROSS'); + + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/softy_example.php b/includes/jpgraph/src/Examples/softy_example.php new file mode 100644 index 0000000..4d21fc9 --- /dev/null +++ b/includes/jpgraph/src/Examples/softy_example.php @@ -0,0 +1,58 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new SoftyTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "SoftyTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/splineex1.php b/includes/jpgraph/src/Examples/splineex1.php new file mode 100644 index 0000000..61f6032 --- /dev/null +++ b/includes/jpgraph/src/Examples/splineex1.php @@ -0,0 +1,56 @@ +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(); + +?> + diff --git a/includes/jpgraph/src/Examples/staticbandbarex1.php b/includes/jpgraph/src/Examples/staticbandbarex1.php new file mode 100644 index 0000000..5d59b26 --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex1.php @@ -0,0 +1,52 @@ +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("(Department X)"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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"); + +// 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 band +$graph->Add(new PlotBand(HORIZONTAL,BAND_HLINE,0,10)); + +//$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(); +?> diff --git a/includes/jpgraph/src/Examples/staticbandbarex2.php b/includes/jpgraph/src/Examples/staticbandbarex2.php new file mode 100644 index 0000000..24d3bbc --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex2.php @@ -0,0 +1,52 @@ +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("(Department X)"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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"); + +// 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 band +$graph->Add(new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","red",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(); +?> diff --git a/includes/jpgraph/src/Examples/staticbandbarex3.php b/includes/jpgraph/src/Examples/staticbandbarex3.php new file mode 100644 index 0000000..fa38cca --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex3.php @@ -0,0 +1,58 @@ +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("(Department X)"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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"); + +// 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 +$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green"); +$uband->ShowFrame(false); +$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red"); +$lband->ShowFrame(false); + +$graph->Add($uband); +$graph->Add($lband); + +//$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(); +?> diff --git a/includes/jpgraph/src/Examples/staticbandbarex4.php b/includes/jpgraph/src/Examples/staticbandbarex4.php new file mode 100644 index 0000000..57ca6db --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex4.php @@ -0,0 +1,60 @@ +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("(Department X)"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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"); + +// 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 +$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green"); +$uband->ShowFrame(false); +$uband->SetDensity(50); // 50% line density +$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red"); +$lband->ShowFrame(false); +$lband->SetDensity(20); // 20% line density + +$graph->Add($uband); +$graph->Add($lband); + +//$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(); +?> diff --git a/includes/jpgraph/src/Examples/staticbandbarex5.php b/includes/jpgraph/src/Examples/staticbandbarex5.php new file mode 100644 index 0000000..8d80855 --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex5.php @@ -0,0 +1,63 @@ +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("(Department X)"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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"); + +// 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_RDIAG,10,20,"green"); +$band[0]->ShowFrame(false); +$band[0]->SetDensity(30); +$band[1]=new PlotBand(HORIZONTAL,BAND_LDIAG,-20,-10,"red"); +$band[1]->ShowFrame(false); +$band[1]->SetDensity(40); +$band[2]=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",-20,"red"); +$band[2]->ShowFrame(false); +$band[2]->SetDensity(80); + +// We can also add band in an array +$graph->Add($band); + +//$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(); +?> diff --git a/includes/jpgraph/src/Examples/staticbandbarex6.php b/includes/jpgraph/src/Examples/staticbandbarex6.php new file mode 100644 index 0000000..df352ea --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex6.php @@ -0,0 +1,74 @@ +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("Shows some possible patterns for bands"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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(); + +// 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_RDIAG,10,20,"green"); +$band[0]->ShowFrame(false); +$band[1]=new PlotBand(HORIZONTAL,BAND_LDIAG,-20,-10,"red"); +$band[1]->ShowFrame(false); +$band[1]->SetDensity(20); +$band[2]=new PlotBand(HORIZONTAL,BAND_DIAGCROSS,"min",-20,"red"); +$band[2]->ShowFrame(false); +$band[2]->SetDensity(40); +$band[3]=new PlotBand(VERTICAL,BAND_HLINE,0,1,"darkgray"); +$band[3]->ShowFrame(false); +$band[3]->SetOrder(DEPTH_FRONT); +$band[4]=new PlotBand(VERTICAL,BAND_HVCROSS,5,"max","darkgray"); +$band[4]->ShowFrame(false); +$band[4]->SetOrder(DEPTH_FRONT); +$band[5]=new PlotBand(HORIZONTAL,BAND_SOLID,20,"max","lightgreen"); +$band[6]=new PlotBand(HORIZONTAL,BAND_3DPLANE,-10,0,"blue"); +$band[6]->SetDensity(70); +$graph->Add($band); + +$graph->AddLine(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(); +?> + diff --git a/includes/jpgraph/src/Examples/staticbandbarex7.php b/includes/jpgraph/src/Examples/staticbandbarex7.php new file mode 100644 index 0000000..399a172 --- /dev/null +++ b/includes/jpgraph/src/Examples/staticbandbarex7.php @@ -0,0 +1,62 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/staticlinebarex1.php b/includes/jpgraph/src/Examples/staticlinebarex1.php new file mode 100644 index 0000000..9c63442 --- /dev/null +++ b/includes/jpgraph/src/Examples/staticlinebarex1.php @@ -0,0 +1,55 @@ +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("(Department X)"); + +// Show both X and Y grid +$graph->xgrid->Show(true,false); + +// Add 10% grace ("space") at top and botton of Y-scale. +$graph->yscale->SetGrace(10,10); + +// 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(); + +// Show the actual value for each bar on top/bottom +$bplot->value->Show(); +$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 mark graph with static lines +$graph->AddLine(new PlotLine(HORIZONTAL,0,"black",2)); +$graph->AddLine(new PlotLine(VERTICAL,3,"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(); +?> diff --git a/includes/jpgraph/src/Examples/stockex1.php b/includes/jpgraph/src/Examples/stockex1.php new file mode 100644 index 0000000..d77145c --- /dev/null +++ b/includes/jpgraph/src/Examples/stockex1.php @@ -0,0 +1,33 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/stockex2.php b/includes/jpgraph/src/Examples/stockex2.php new file mode 100644 index 0000000..e038cca --- /dev/null +++ b/includes/jpgraph/src/Examples/stockex2.php @@ -0,0 +1,39 @@ +SetScale("textlin"); +$graph->SetMarginColor('white'); +$graph->SetFrame(false); +$graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); +$graph->SetBox(); + +$graph->tabtitle->Set(' Week 34 '); +$graph->tabtitle->SetFont(FF_ARIAL,FS_NORMAL,12); + +// Get week days in curent locale +$days = $gDateLocale->GetShortDay(); +array_shift($days); // Start on monday +$graph->xaxis->SetTickLabels($days); + +// Create stock plot +$p1 = new StockPlot($datay); + +// Indent plot so first and last bar isn't on the edges +$p1->SetCenter(); + +// Add and stroke +$graph->Add($p1); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/stship.jpg b/includes/jpgraph/src/Examples/stship.jpg new file mode 100644 index 0000000..7f3bae6 Binary files /dev/null and b/includes/jpgraph/src/Examples/stship.jpg differ diff --git a/includes/jpgraph/src/Examples/sunflower.gif b/includes/jpgraph/src/Examples/sunflower.gif new file mode 100644 index 0000000..b83709f Binary files /dev/null and b/includes/jpgraph/src/Examples/sunflower.gif differ diff --git a/includes/jpgraph/src/Examples/sunspotsex1.php b/includes/jpgraph/src/Examples/sunspotsex1.php new file mode 100644 index 0000000..d5edb83 --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex1.php @@ -0,0 +1,51 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// int = integer scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('intint'); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year from 1701)'); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/sunspotsex2.php b/includes/jpgraph/src/Examples/sunspotsex2.php new file mode 100644 index 0000000..817db15 --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex2.php @@ -0,0 +1,52 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// int = integer scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('intint'); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year from 1701)'); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetFillColor('orange@0.5'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/sunspotsex3.php b/includes/jpgraph/src/Examples/sunspotsex3.php new file mode 100644 index 0000000..cf54cb4 --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex3.php @@ -0,0 +1,53 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// int = integer scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('intint'); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year from 1701)'); +$graph->xaxis->SetTickLabels($year); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetFillColor('orange@0.5'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/sunspotsex4.php b/includes/jpgraph/src/Examples/sunspotsex4.php new file mode 100644 index 0000000..e0877e0 --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex4.php @@ -0,0 +1,53 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// int = integer scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('intint',0,0,0,max($year)-min($year)+1); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year from 1701)'); +$graph->xaxis->SetTickLabels($year); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetFillColor('orange@0.5'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/sunspotsex5.php b/includes/jpgraph/src/Examples/sunspotsex5.php new file mode 100644 index 0000000..3d7322a --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex5.php @@ -0,0 +1,57 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + +function year_callback($aLabel) { + return 1700+(int)$aLabel; +} + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// int = integer scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('intint'); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year from 1701)'); +$graph->xaxis->SetLabelFormatCallback('year_callback'); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the linear plot +$lineplot=new LinePlot($ydata); +$lineplot->SetFillColor('orange@0.5'); + +// Add the plot to the graph +$graph->Add($lineplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/sunspotsex6.php b/includes/jpgraph/src/Examples/sunspotsex6.php new file mode 100644 index 0000000..2efe644 --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex6.php @@ -0,0 +1,52 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// int = integer scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('intint'); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year from 1701)'); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the bar plot +$barplot=new BarPlot($ydata); + +// Add the plot to the graph +$graph->Add($barplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/sunspotsex7.php b/includes/jpgraph/src/Examples/sunspotsex7.php new file mode 100644 index 0000000..b104f9f --- /dev/null +++ b/includes/jpgraph/src/Examples/sunspotsex7.php @@ -0,0 +1,56 @@ + $datarow ) { + $split = preg_split('/[\s]+/',$datarow); + $aYears[] = substr(trim($split[0]),0,4); + $aSunspots[] = trim($split[1]); + } +} + +$year = array(); +$ydata = array(); +readsunspotdata('yearssn.txt',$year,$ydata); + +// Just keep the last 20 values in the arrays +$year = array_slice($year, -20); +$ydata = array_slice($ydata, -20); + + // Width and height of the graph +$width = 600; $height = 200; + +// Create a graph instance +$graph = new Graph($width,$height); + +// Specify what scale we want to use, +// text = txt scale for the X-axis +// int = integer scale for the Y-axis +$graph->SetScale('textint'); + +// Setup a title for the graph +$graph->title->Set('Sunspot example'); + +// Setup titles and X-axis labels +$graph->xaxis->title->Set('(year)'); +$graph->xaxis->SetTickLabels($year); + +// Setup Y-axis title +$graph->yaxis->title->Set('(# sunspots)'); + +// Create the bar plot +$barplot=new BarPlot($ydata); + +// Add the plot to the graph +$graph->Add($barplot); + +// Display the graph +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/table_flagex1.php b/includes/jpgraph/src/Examples/table_flagex1.php new file mode 100644 index 0000000..8729561 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_flagex1.php @@ -0,0 +1,70 @@ +Set($data); +$table->SetFont(FF_TIMES,FS_NORMAL,11); + +// Adjust the font for row 0 and 6 +$table->SetColFont(0,FF_ARIAL,FS_BOLD,11); +$table->SetRowFont(6,FF_TIMES,FS_BOLD,12); + +// Set the minimum heigth/width +$table->SetMinRowHeight(2,10); +$table->SetMinColWidth(70); + +// Add some padding (in pixels) +$table->SetRowPadding(2,0); +$table->SetRowGrid(6,1,'darkgray',TGRID_DOUBLE2); + +// Setup the grid +$table->SetGrid(0); +$table->SetRowGrid(6,1,'black',TGRID_DOUBLE2); + +// Merge all cells in row 0 +$table->MergeRow(0); + +// Set aligns +$table->SetAlign(3,0,6,6,'right'); +$table->SetRowAlign(1,'center'); +$table->SetRowAlign(2,'center'); + +// Set background colors +$table->SetRowFillColor(0,'lightgray@0.5'); +$table->SetColFillColor(0,'lightgray@0.5'); + +// Add the country flags in row 1 +$n = count($countries); +for($i=0; $i < $n; ++$i ) { + $table->SetCellCountryFlag(1,$i+1,$countries[$i],0.5); + $table->SetCellImageConstrain(1,$i+1,TIMG_HEIGHT,20); +} + +// Add the table to the graph +$graph->Add($table); + +// Send back the table graph to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto1.php b/includes/jpgraph/src/Examples/table_howto1.php new file mode 100644 index 0000000..bb50fa0 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto1.php @@ -0,0 +1,21 @@ +Set($data); + +// Add the table to the graph +$graph->Add($table); + +// ... and send back the table to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto2.php b/includes/jpgraph/src/Examples/table_howto2.php new file mode 100644 index 0000000..69d25e6 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto2.php @@ -0,0 +1,25 @@ +Set($data); + +// Merge all cellsn in the rectangle with +// top left corner = (0,2) and bottom right = (1,3) +$table->MergeCells(0,2,1,3); + +// Add the table to the graph +$graph->Add($table); + +// ... and send back the table to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto3.php b/includes/jpgraph/src/Examples/table_howto3.php new file mode 100644 index 0000000..26417b4 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto3.php @@ -0,0 +1,24 @@ +Set($data); + +// Merge all cells in row 0 +$table->MergeRow(0); + +// Add table to graph +$graph->Add($table); + +// ... and send back the table to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto4.php b/includes/jpgraph/src/Examples/table_howto4.php new file mode 100644 index 0000000..d093fcb --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto4.php @@ -0,0 +1,28 @@ +Set($data); + +// Merge all cells in row 0 +$table->MergeRow(0); + +// Set foreground and background color +$table->SetCellFillColor(0,0,'orange@0.7'); +$table->SetCellColor(0,0,'darkred'); + +// Add the table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto5.php b/includes/jpgraph/src/Examples/table_howto5.php new file mode 100644 index 0000000..252318a --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto5.php @@ -0,0 +1,30 @@ +Set($data); + +// Merge all cells in row 0 +$table->MergeRow(0); + +// Adjust font in cell (0,0) +$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14); + +// Set left align for all cells in rectangle (0,0) - (0,3) +$table->SetAlign(0,0,0,3,'Left'); + +// Add table to graph +$graph->Add($table); + +// ... send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto6.php b/includes/jpgraph/src/Examples/table_howto6.php new file mode 100644 index 0000000..c776494 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto6.php @@ -0,0 +1,32 @@ +Set($data); + +// Merge all cells in row 0 +$table->MergeRow(0); + +// Setup font and color +$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14); +$table->SetRowFillColor(0,'orange@0.5'); +$table->SetRowColor(0,'darkred'); + +// Setup the minimum width of all columns +$table->SetMinColWidth(35); + +// Add table to the graph +$graph->Add($table); + +// ... send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto7.1.php b/includes/jpgraph/src/Examples/table_howto7.1.php new file mode 100644 index 0000000..4dbe52d --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto7.1.php @@ -0,0 +1,34 @@ +Set($data); + +// Set default font in entire table +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Setup font and color for row = 2 +$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); +$table->SetRowFillColor(2,'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup grid on row 2 +$table->SetRowGrid(2,1,'black',TGRID_DOUBLE); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto7.2.php b/includes/jpgraph/src/Examples/table_howto7.2.php new file mode 100644 index 0000000..8a159f8 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto7.2.php @@ -0,0 +1,34 @@ +Set($data); + +// Set default font in entire table +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Setup font and color for row = 2 +$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); +$table->SetRowFillColor(2,'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup grid on row 2 +$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto7.php b/includes/jpgraph/src/Examples/table_howto7.php new file mode 100644 index 0000000..8a159f8 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto7.php @@ -0,0 +1,34 @@ +Set($data); + +// Set default font in entire table +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Setup font and color for row = 2 +$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); +$table->SetRowFillColor(2,'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup grid on row 2 +$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto8.php b/includes/jpgraph/src/Examples/table_howto8.php new file mode 100644 index 0000000..a89785b --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto8.php @@ -0,0 +1,43 @@ +Set($data); + +// Setup overall table font +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Setup font and color for row = 2 +$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); +$table->SetRowFillColor(2,'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup overall cell alignment for the table +$table->SetAlign('right'); + +// Setup overall table border +$table->SetBorder(0,'black'); + +// Setup overall table grid +$table->setGrid(0,'black'); + +// Set specific frid for row = 2 +$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); + +// Add the table to the graph +$graph->Add($table); + +// and send it back to the browser +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_howto9.php b/includes/jpgraph/src/Examples/table_howto9.php new file mode 100644 index 0000000..cf6f65f --- /dev/null +++ b/includes/jpgraph/src/Examples/table_howto9.php @@ -0,0 +1,46 @@ +Set($data); + +// Setup overall table font +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Setup font and color for row = 2 +$table->SetRowFont(2,FF_ARIAL,FS_BOLD,11); +$table->SetRowFillColor(2,'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(40); + +// Setup overall cell alignment for the table +$table->SetAlign('right'); + +// Setup overall table border +$table->SetBorder(0,'black'); + +// Setup overall table grid +$table->setGrid(0,'black'); + +// Set specific frid for row = 2 +$table->SetRowGrid(2,1,'black',TGRID_DOUBLE2); + +// Setup overall number format in all cells +$table->SetNumberFormat("%0.1f"); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the browser +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_mex0.php b/includes/jpgraph/src/Examples/table_mex0.php new file mode 100644 index 0000000..9568874 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_mex0.php @@ -0,0 +1,50 @@ +Set($data); + +// Setup fonts +$table->SetFont(FF_TIMES,FS_NORMAL,11); +$table->SetColFont(0,FF_ARIAL,FS_NORMAL,11); +$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,11); +$table->SetRowFont(4,FF_TIMES,FS_BOLD,14); + +// Turn off the grid +$table->SetGrid(0); + +// Setup color +$table->SetRowFillColor(0,'lightgray@0.5'); +$table->SetRowFillColor(4,'lightgray@0.5'); +$table->SetColFillColor(0,'lightgray@0.5'); +$table->SetFillColor(0,0,4,0,'lightgray@0.5'); + +// Set default minimum column width +$table->SetMinColWidth(45); + +// Set default table alignment +$table->SetAlign('right'); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_mex00.php b/includes/jpgraph/src/Examples/table_mex00.php new file mode 100644 index 0000000..ecd7410 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_mex00.php @@ -0,0 +1,33 @@ +Set($data); +$table->SetFont(FF_TIMES,FS_NORMAL,11); + +// Set default table alignment +$table->SetAlign('right'); + +// Add table to graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_mex1.php b/includes/jpgraph/src/Examples/table_mex1.php new file mode 100644 index 0000000..ce40d0e --- /dev/null +++ b/includes/jpgraph/src/Examples/table_mex1.php @@ -0,0 +1,56 @@ +Set($data); +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Setup default column width +$table->SetMinColWidth(40); + +// Setup defalt table alignment +$table->SetAlign('right'); + +// Turn off border +$table->SetBorder(0); + +// Turn off grid +$table->setGrid(0); + +// Setup font for row 4 and 0 +$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11); +$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); + +// Setup color +$table->SetRowFillColor(4,'orange@0.5'); +$table->SetFillColor(0,1,0,6,'teal@0.8'); + + +// Setup grids +$table->SetRowGrid(4,1,'black',TGRID_DOUBLE2); +$table->SetColGrid(1,1,'black',TGRID_SINGLE); +$table->SetRowGrid(1,1,'black',TGRID_SINGLE); + +// Add table to the graph +$graph->Add($table); + +// Send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_mex2.php b/includes/jpgraph/src/Examples/table_mex2.php new file mode 100644 index 0000000..a4acc9d --- /dev/null +++ b/includes/jpgraph/src/Examples/table_mex2.php @@ -0,0 +1,58 @@ +Set($data); +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Set default minimum color width +$table->SetMinColWidth(40); + +// Set default table alignment +$table->SetAlign('right'); + +// Set table border +$table->SetBorder(0); + +// Turn off grid +$table->setGrid(0); + +// Setup font +$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11); +$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); + +// Setup various grid lines +$table->SetRowGrid(4,2,'black',TGRID_SINGLE); +$table->SetColGrid(1,3,'black',TGRID_SINGLE); +$table->SetRowGrid(1,1,'black',TGRID_SINGLE); + +// Setup various colors +$table->SetFillColor(0,1,0,6,'black'); +$table->SetRowColor(0,'white'); +$table->SetRowFillColor(4,'lightyellow'); +$table->SetFillColor(2,0,2,6,'lightgray'); + +// Add table to the graph +$graph->Add($table); + + +// Send back to client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_mex3.php b/includes/jpgraph/src/Examples/table_mex3.php new file mode 100644 index 0000000..981181c --- /dev/null +++ b/includes/jpgraph/src/Examples/table_mex3.php @@ -0,0 +1,59 @@ +Set($data); +$table->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Set default minimum color width +$table->SetMinColWidth(40); + +// Set default table alignment +$table->SetAlign('right'); + +// Turn off grid +$table->setGrid(0); + +// Set table border +$table->SetBorder(2); + +// Setup font +$table->SetRowFont(4,FF_ARIAL,FS_BOLD,11); +$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); +$table->SetFont(1,2,1,3,FF_ARIAL,FS_BOLD,11); + +// Setup grids +$table->SetRowGrid(4,2,'black',TGRID_SINGLE); +$table->SetColGrid(1,1,'black',TGRID_SINGLE); +$table->SetRowGrid(1,1,'black',TGRID_SINGLE); + +// Setup colors +$table->SetFillColor(0,1,0,6,'black'); +$table->SetRowColor(0,'white'); +$table->SetRowFillColor(4,'lightgray@0.3'); +$table->SetFillColor(2,0,2,6,'lightgray@0.6'); +$table->SetFillColor(1,2,1,3,'lightred'); + +// Add table to graph +$graph->Add($table); + +// Send back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_vtext.php b/includes/jpgraph/src/Examples/table_vtext.php new file mode 100644 index 0000000..1b2b349 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_vtext.php @@ -0,0 +1,42 @@ +Set($data); +$table->SetAlign('right'); +$table->SetFont(FF_TIMES,FS_NORMAL,12); +$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,16); + +// Rotate the entire table 90 degrees +$table->SetTextOrientation(90); +//$table->SetCellTextOrientation(0,0,0); + +// Setup background color for header column +$table->SetColFillColor(0,'lightgray'); + +// Set the imnimum row height +$table->SetMinRowHeight(0,150); + +// Add table to graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/table_vtext_ex1.php b/includes/jpgraph/src/Examples/table_vtext_ex1.php new file mode 100644 index 0000000..9581884 --- /dev/null +++ b/includes/jpgraph/src/Examples/table_vtext_ex1.php @@ -0,0 +1,42 @@ +Set($data); +$table->SetFont(FF_TIMES,FS_NORMAL,11); + +// Default table alignment +$table->SetAlign('right'); + +// Adjust font in (0,0) +$table->SetCellFont(0,0,FF_TIMES,FS_BOLD,14); + +// Rotate all textxs in row 0 +$table->SetRowTextOrientation(0,90); + +// Adjust alignment in cell (0,0) +$table->SetCellAlign(0,0,'center','center'); + +// Add table to graph +$graph->Add($table); + +// Send back table to client +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/tablebarex1.php b/includes/jpgraph/src/Examples/tablebarex1.php new file mode 100644 index 0000000..7956716 --- /dev/null +++ b/includes/jpgraph/src/Examples/tablebarex1.php @@ -0,0 +1,70 @@ +img->SetMargin($tablexpos,$rightmargin,30,$height-$tableypos); +$graph->SetScale("textlin"); +$graph->SetMarginColor('white'); + +// Setup titles and fonts +$graph->title->Set('Bar and table'); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); +$graph->yaxis->title->Set("Flow"); +$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,12); +$graph->yaxis->title->SetMargin(10); + +// Create the bars and the accbar plot +$bplot = new BarPlot($datay[3]); +$bplot->SetFillColor("orange"); +$bplot2 = new BarPlot($datay[2]); +$bplot2->SetFillColor("red"); +$bplot3 = new BarPlot($datay[1]); +$bplot3->SetFillColor("darkgreen"); +$accbplot = new AccBarPlot(array($bplot,$bplot2,$bplot3)); +$accbplot->value->Show(); +$graph->Add($accbplot); + +//Setup the table +$table = new GTextTable(); +$table->Set($datay); +$table->SetPos($tablexpos,$tableypos+1); + +// Basic table formatting +$table->SetFont(FF_ARIAL,FS_NORMAL,10); +$table->SetAlign('right'); +$table->SetMinColWidth($cellwidth); +$table->SetNumberFormat('%0.1f'); + +// Format table header row +$table->SetRowFillColor(0,'teal@0.7'); +$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); +$table->SetRowAlign(0,'center'); + +// .. and add it to the graph +$graph->Add($table); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/tablebarex1_csim.php b/includes/jpgraph/src/Examples/tablebarex1_csim.php new file mode 100644 index 0000000..9606149 --- /dev/null +++ b/includes/jpgraph/src/Examples/tablebarex1_csim.php @@ -0,0 +1,72 @@ +img->SetMargin($tablexpos,$rightmargin,30,$height-$tableypos); +$graph->SetScale("textlin"); +$graph->SetMarginColor('white'); + +// Setup titles and fonts +$graph->title->Set('Bar and table'); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); +$graph->yaxis->title->Set("Flow"); +$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,12); +$graph->yaxis->title->SetMargin(10); + +// Create the bars and the accbar plot +$bplot = new BarPlot($datay[3]); +$bplot->SetFillColor("orange"); +$bplot2 = new BarPlot($datay[2]); +$bplot2->SetFillColor("red"); +$bplot3 = new BarPlot($datay[1]); +$bplot3->SetFillColor("darkgreen"); +$accbplot = new AccBarPlot(array($bplot,$bplot2,$bplot3)); +$accbplot->value->Show(); +$graph->Add($accbplot); + +//Setup the table +$table = new GTextTable(); +$table->Set($datay); +$table->SetPos($tablexpos,$tableypos+1); + +$table->SetCellCSIMTarget(1,1,'tableex02.php','View details'); + +// Basic table formatting +$table->SetFont(FF_ARIAL,FS_NORMAL,10); +$table->SetAlign('right'); +$table->SetMinColWidth($cellwidth); +$table->SetNumberFormat('%0.1f'); + +// Format table header row +$table->SetRowFillColor(0,'teal@0.7'); +$table->SetRowFont(0,FF_ARIAL,FS_BOLD,11); +$table->SetRowAlign(0,'center'); + +// .. and add it to the graph +$graph->Add($table); + +$graph->StrokeCSIM(); + +?> diff --git a/includes/jpgraph/src/Examples/tableex00.php b/includes/jpgraph/src/Examples/tableex00.php new file mode 100644 index 0000000..0acabae --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex00.php @@ -0,0 +1,25 @@ +Set($data); + +//Add table to the graph +$graph->Add($table); + +// Send back table to the client +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/tableex01.php b/includes/jpgraph/src/Examples/tableex01.php new file mode 100644 index 0000000..8efe9f9 --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex01.php @@ -0,0 +1,29 @@ +Init(); +$table->Set($data); + +$table->SetRowFont(0,FF_FONT1,FS_BOLD); +$table->SetRowColor(0,'navy'); +$table->SetRowFillColor(0,'lightgray'); + +$table->SetColFont(0,FF_FONT1,FS_BOLD); +$table->SetColColor(0,'navy'); +$table->SetColFillColor(0,'lightgray'); + +$graph->Add($table); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/tableex01_csim.php b/includes/jpgraph/src/Examples/tableex01_csim.php new file mode 100644 index 0000000..ff11a70 --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex01_csim.php @@ -0,0 +1,33 @@ +Set($data); + +$table->SetCellCSIMTarget(1,1,'tableex02.php','View details'); + +$table->SetRowFont(0,FF_FONT1,FS_BOLD); +$table->SetRowColor(0,'navy'); +$table->SetRowFillColor(0,'lightgray'); + +$table->SetColFont(0,FF_FONT1,FS_BOLD); +$table->SetColColor(0,'navy'); +$table->SetColFillColor(0,'lightgray'); + +$graph->Add($table); + +$graph->StrokeCSIM(); + +?> diff --git a/includes/jpgraph/src/Examples/tableex02.php b/includes/jpgraph/src/Examples/tableex02.php new file mode 100644 index 0000000..193f49f --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex02.php @@ -0,0 +1,33 @@ +Init(); +$table->Set($data); + +// Setup row and column headers +$table->SetRowFont(0,FF_TIMES,FS_BOLD,11); +$table->SetRowAlign(0,'left','bottom'); +$table->SetRowColor(0,'navy'); +$table->SetRowFillColor(0,'lightgray'); +$table->SetColFont(0,FF_ARIAL,FS_BOLD,11); +$table->SetColColor(0,'navy'); +$table->SetColFillColor(0,'lightgray'); + +// Highlight cell 2,3 +$table->SetCellFillColor(2,3,'yellow'); + +$graph->Add($table); +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/tableex03.php b/includes/jpgraph/src/Examples/tableex03.php new file mode 100644 index 0000000..5ac7215 --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex03.php @@ -0,0 +1,58 @@ +Init(); +$table->Set($data); +$table->SetBorder(2,'black'); + +// Setup top row with the year title +$table->MergeCells(0,0,0,6); +$table->SetRowFont(0,FF_ARIAL,FS_BOLD,16); +$table->SetRowColor(0,'navy'); +$table->SetRowAlign(0,'center'); + +// Setup quarter header +$table->MergeCells(1,1,1,3); +$table->MergeCells(1,4,1,6); +$table->SetRowAlign(1,'center'); +$table->SetRowFont(1,FF_ARIAL,FS_BOLD,10); +$table->SetRowColor(1,'navy'); +$table->SetRowFillColor(1,'lightgray'); +$table->SetRowGrid(2,'',0); // Turn off the gridline just under the top row + +// Setup row and column headers +$table->SetRowFont(2,FF_ARIAL,FS_NORMAL,11); +$table->SetRowColor(2,'navy'); +$table->SetRowFillColor(2,'lightgray'); + +$table->SetColFont(0,FF_ARIAL,FS_NORMAL,11); +$table->SetColColor(0,'navy'); +$table->SetColFillColor(0,'lightgray'); + +$table->SetCellFillColor(0,0,'lightgreen'); +$table->SetCellFillColor(1,0,'lightgreen'); +$table->SetCellFillColor(2,0,'lightgreen'); + +// Highlight cell 2,3 +$table->SetCellFillColor(4,3,'yellow'); + +$graph->Add($table); +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/tableex04.php b/includes/jpgraph/src/Examples/tableex04.php new file mode 100644 index 0000000..21f540d --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex04.php @@ -0,0 +1,50 @@ +Init(); +$table->Set($data); +$table->SetBorder(2,'black'); + +// Highlight summation row +$table->SetRowFillColor($r-1,'yellow'); +$table->SetCellAlign($r-1,0,'right'); + +// Setup row and column headers +$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,10); +$table->SetRowColor(0,'navy'); +$table->SetRowFillColor(0,'lightgray'); + +$table->SetColFont(0,FF_ARIAL,FS_NORMAL,10); +$table->SetColColor(0,'navy'); +$table->SetColFillColor(0,'lightgray'); + +$table->SetRowGrid($r-1,1,'black',TGRID_DOUBLE); + +$graph->Add($table); +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/tableex05.php b/includes/jpgraph/src/Examples/tableex05.php new file mode 100644 index 0000000..aad9e00 --- /dev/null +++ b/includes/jpgraph/src/Examples/tableex05.php @@ -0,0 +1,53 @@ +Init(); +$table->Set($data); +$table->SetBorder(2,'black'); + +// Highlight summation row +$table->SetRowFillColor($r-1,'yellow'); +$table->SetCellAlign($r-1,0,'right'); + +// Setup row and column headers +$table->SetRowFont(0,FF_ARIAL,FS_NORMAL,10); +$table->SetRowColor(0,'navy'); +$table->SetRowFillColor(0,'lightgray'); + +$table->SetColFont(0,FF_ARIAL,FS_NORMAL,10); +$table->SetColColor(0,'navy'); +$table->SetColFillColor(0,'lightgray'); + +$table->SetRowGrid($r-1,1,'black',TGRID_DOUBLE); + +$table->SetFont(1,4,2,6,FF_TIMES,FS_NORMAL,18); +$table->SetFillColor(1,1,2,3,'red'); + +$table->MergeCol(1); +$graph->Add($table); +$graph->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/tabtitleex1.php b/includes/jpgraph/src/Examples/tabtitleex1.php new file mode 100644 index 0000000..55d87ea --- /dev/null +++ b/includes/jpgraph/src/Examples/tabtitleex1.php @@ -0,0 +1,51 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/testsuit.php b/includes/jpgraph/src/Examples/testsuit.php new file mode 100644 index 0000000..4ffb289 --- /dev/null +++ b/includes/jpgraph/src/Examples/testsuit.php @@ -0,0 +1,107 @@ +iType = $aType; + if( $aDir == '' ) { + $aDir = getcwd(); + } + if( !chdir($aDir) ) { + die("PANIC: Can't access directory : $aDir"); + } + $this->iDir = $aDir; + } + + function GetFiles() { + $d = @dir($this->iDir); + $a = array(); + while( $entry=$d->Read() ) { + if( strstr($entry,".php") && strstr($entry,"x") && !strstr($entry,"show") && !strstr($entry,"csim") ) { + $a[] = $entry; + } + } + $d->Close(); + if( count($a) == 0 ) { + die("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: $this->iDir"); + } + sort($a); + return $a; + } + + function GetCSIMFiles() { + $d = @dir($this->iDir); + $a = array(); + while( $entry=$d->Read() ) { + if( strstr($entry,".php") && strstr($entry,"csim") ) { + $a[] = $entry; + } + } + $d->Close(); + if( count($a) == 0 ) { + die("PANIC: Apache/PHP does not have enough permission to read the CSIM scripts in directory: $this->iDir"); + } + sort($a); + return $a; + } + + + function Run() { + switch( $this->iType ) { + case 1: + $files = $this->GetFiles(); + break; + case 2: + $files = $this->GetCSIMFiles(); + break; + default: + die('Panic: Unknown type of test'); + break; + } + $n = count($files); + echo "

Visual test suit for JpGraph

"; + echo "Testtype: " . ($this->iType==1 ? ' Standard images ':' Image map tests '); + echo "
Number of tests: $n

"; + echo "

    "; + + for( $i=0; $i<$n; ++$i ) { + if( $this->iType ==1 ) { + echo '

  1. Filename: '.basename($files[$i])."\n"; + } + else { + echo '
  2. '.$files[$i]."\n"; + } + } + echo "
"; + + echo "

Done.

"; + } +} + +$type=@$_GET['type']; +if( empty($type) ) { + $type=1; +} + +$driver = new TestDriver($type); +$driver->Run(); + +?> diff --git a/includes/jpgraph/src/Examples/text-example1.php b/includes/jpgraph/src/Examples/text-example1.php new file mode 100644 index 0000000..99de8ff --- /dev/null +++ b/includes/jpgraph/src/Examples/text-example1.php @@ -0,0 +1,18 @@ +SetPos(0.05,0.5); +$t1->SetOrientation("h"); +$t1->SetFont(FF_FONT1,FS_NORMAL); +$t1->SetBox("white","black",'gray'); +$t1->SetColor("black"); +$graph->AddText($t1); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/text-example2.php b/includes/jpgraph/src/Examples/text-example2.php new file mode 100644 index 0000000..b20cfa8 --- /dev/null +++ b/includes/jpgraph/src/Examples/text-example2.php @@ -0,0 +1,18 @@ +SetPos(0.05,100); +$t1->SetFont(FF_FONT1,FS_NORMAL); +$t1->SetBox("white","black",true); +$t1->ParagraphAlign("right"); +$t1->SetColor("black"); +$graph->AddText($t1); + +$graph->Stroke(); + +?> diff --git a/includes/jpgraph/src/Examples/textalignex1.php b/includes/jpgraph/src/Examples/textalignex1.php new file mode 100644 index 0000000..a7b33c5 --- /dev/null +++ b/includes/jpgraph/src/Examples/textalignex1.php @@ -0,0 +1,91 @@ +img; + +// Get the bounding box for text +$img->SetFont(FF_ARIAL,FS_NORMAL,16); +$tw=$img->GetBBoxWidth($txt,$angle); +$th=$img->GetBBoxHeight($txt,$angle); + +$img->SetFont(FF_ARIAL,FS_NORMAL,11); +$ch=$img->GetBBoxHeight($caption); + +// Calculate needed height for the image +$h = 3*$th+2*$ym + $ch; +$g = new CanvasGraph($w,$h); +$img = $g->img; + +// Alignment for anchor points to use +$anchors = array('left','top', + 'center','top', + 'right','top', + 'left','center', + 'center','center', + 'right','center', + 'left','bottom', + 'center','bottom', + 'right','bottom'); + +$n = count($anchors)/2; + +for( $i=0,$r=0,$c=0; $i < $n; ++$i ) { + + $x = $c*($tw+$xm)+$xm/2; + $y = $r*($th+$ym)+$ym/2-10; + + $img->SetColor('blue'); + $img->SetTextAlign($anchors[$i*2],$anchors[$i*2+1]); + $img->SetFont(FF_ARIAL,FS_NORMAL,16); + $img->StrokeText($x,$y,$txt,$angle,"left",true); + + $img->SetColor('black'); + $img->SetFont(FF_FONT1,FS_BOLD); + $img->SetTextAlign('center','top'); + $align = sprintf('("%s","%s")',$anchors[$i*2],$anchors[$i*2+1]); + $img->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++; + } +} + +// Draw the caption text +$img->SetTextAlign('center','bottom'); +$img->SetFont(FF_ARIAL,FS_ITALIC,11); +$img->StrokeText($w/2,$h-10,$caption,0,'left'); + +$img->SetColor('navy'); +$img->Rectangle(0,0,$w-1,$h-1); + +// .. and send back to browser +$g->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/textpalignex1.php b/includes/jpgraph/src/Examples/textpalignex1.php new file mode 100644 index 0000000..b4dfb36 --- /dev/null +++ b/includes/jpgraph/src/Examples/textpalignex1.php @@ -0,0 +1,44 @@ +img; + +// Alignment for anchor points to use +$palign = array('left','center','right'); + +$n = count($palign); +$t = new Text($txt); + +$y = $ym; +for( $i=0; $i < $n; ++$i ) { + + $x = $xm + $i*$tw; + + $t->SetColor('black'); + $t->SetAlign('left','top'); + $t->SetFont(FF_ARIAL,FS_NORMAL,11); + $t->SetBox(); + $t->SetParagraphAlign($palign[$i]); + $t->Stroke($img, $x,$y); + + $img->SetColor('black'); + $img->SetFont(FF_FONT1,FS_BOLD); + $img->SetTextAlign('center','top'); + $img->StrokeText($x+140,$y+160,'"'.$palign[$i].'"'.' pargraph align'); + +} + +// .. and send back to browser +$g->Stroke(); + +?> + diff --git a/includes/jpgraph/src/Examples/theme_example.php b/includes/jpgraph/src/Examples/theme_example.php new file mode 100644 index 0000000..73d2da0 --- /dev/null +++ b/includes/jpgraph/src/Examples/theme_example.php @@ -0,0 +1,26 @@ +SetScale('textlin'); + +$theme_class = new AquaTheme; +$graph->SetTheme($theme_class); + +// after setting theme, you can change details as you want +$graph->SetFrame(true, 'lightgray'); // set frame visible + +$graph->xaxis->SetTickLabels(array('A','B','C','D')); // change xaxis lagels +$graph->title->Set("Theme Example"); // add title + +// add barplot +$bplot = new BarPlot($data1y); +$graph->Add($bplot); + +// you can change properties of the plot only after calling Add() +$bplot->SetWeight(0); +$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER); + +$graph->Stroke(); diff --git a/includes/jpgraph/src/Examples/tiger1.jpg b/includes/jpgraph/src/Examples/tiger1.jpg new file mode 100644 index 0000000..9959610 Binary files /dev/null and b/includes/jpgraph/src/Examples/tiger1.jpg differ diff --git a/includes/jpgraph/src/Examples/tiger_bkg.gif b/includes/jpgraph/src/Examples/tiger_bkg.gif new file mode 100644 index 0000000..3faaa17 Binary files /dev/null and b/includes/jpgraph/src/Examples/tiger_bkg.gif differ diff --git a/includes/jpgraph/src/Examples/tiger_bkg.jpg b/includes/jpgraph/src/Examples/tiger_bkg.jpg new file mode 100644 index 0000000..43d45f3 Binary files /dev/null and b/includes/jpgraph/src/Examples/tiger_bkg.jpg differ diff --git a/includes/jpgraph/src/Examples/tiger_bkg.png b/includes/jpgraph/src/Examples/tiger_bkg.png new file mode 100644 index 0000000..78d8e25 Binary files /dev/null and b/includes/jpgraph/src/Examples/tiger_bkg.png differ diff --git a/includes/jpgraph/src/Examples/timestampex01.php b/includes/jpgraph/src/Examples/timestampex01.php new file mode 100644 index 0000000..b2ee12e --- /dev/null +++ b/includes/jpgraph/src/Examples/timestampex01.php @@ -0,0 +1,59 @@ +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(); +?> diff --git a/includes/jpgraph/src/Examples/titlecsimex01.php b/includes/jpgraph/src/Examples/titlecsimex01.php new file mode 100644 index 0000000..a44290e --- /dev/null +++ b/includes/jpgraph/src/Examples/titlecsimex01.php @@ -0,0 +1,62 @@ +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(); + +?> diff --git a/includes/jpgraph/src/Examples/titleex1.php b/includes/jpgraph/src/Examples/titleex1.php new file mode 100644 index 0000000..77baa00 --- /dev/null +++ b/includes/jpgraph/src/Examples/titleex1.php @@ -0,0 +1,29 @@ +SetScale("textlin"); +$graph->SetMargin(25,10,30,30); + +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); +$graph->title->Set('The Title'); +$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); +$graph->subtitle->Set('The Subtitle'); +$graph->subsubtitle->SetFont(FF_ARIAL,FS_ITALIC,9); +$graph->subsubtitle->Set('The Subsubitle'); + +// 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(); +?> diff --git a/includes/jpgraph/src/Examples/topxaxisex1.php b/includes/jpgraph/src/Examples/topxaxisex1.php new file mode 100644 index 0000000..6143875 --- /dev/null +++ b/includes/jpgraph/src/Examples/topxaxisex1.php @@ -0,0 +1,49 @@ +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(); + +?> + + diff --git a/includes/jpgraph/src/Examples/tornado.jpg b/includes/jpgraph/src/Examples/tornado.jpg new file mode 100644 index 0000000..24c1ea1 Binary files /dev/null and b/includes/jpgraph/src/Examples/tornado.jpg differ diff --git a/includes/jpgraph/src/Examples/tr1.jpg b/includes/jpgraph/src/Examples/tr1.jpg new file mode 100644 index 0000000..f855e31 Binary files /dev/null and b/includes/jpgraph/src/Examples/tr1.jpg differ diff --git a/includes/jpgraph/src/Examples/tr2.jpg b/includes/jpgraph/src/Examples/tr2.jpg new file mode 100644 index 0000000..6a75e47 Binary files /dev/null and b/includes/jpgraph/src/Examples/tr2.jpg differ diff --git a/includes/jpgraph/src/Examples/tr3.jpg b/includes/jpgraph/src/Examples/tr3.jpg new file mode 100644 index 0000000..799e097 Binary files /dev/null and b/includes/jpgraph/src/Examples/tr3.jpg differ diff --git a/includes/jpgraph/src/Examples/tr4.jpg b/includes/jpgraph/src/Examples/tr4.jpg new file mode 100644 index 0000000..fe411c1 Binary files /dev/null and b/includes/jpgraph/src/Examples/tr4.jpg differ diff --git a/includes/jpgraph/src/Examples/tr5.jpg b/includes/jpgraph/src/Examples/tr5.jpg new file mode 100644 index 0000000..33c9748 Binary files /dev/null and b/includes/jpgraph/src/Examples/tr5.jpg differ diff --git a/includes/jpgraph/src/Examples/tr6.jpg b/includes/jpgraph/src/Examples/tr6.jpg new file mode 100644 index 0000000..81321b7 Binary files /dev/null and b/includes/jpgraph/src/Examples/tr6.jpg differ diff --git a/includes/jpgraph/src/Examples/universal_example.php b/includes/jpgraph/src/Examples/universal_example.php new file mode 100644 index 0000000..eae0c19 --- /dev/null +++ b/includes/jpgraph/src/Examples/universal_example.php @@ -0,0 +1,58 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new UniversalTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "UniversalTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/vivid_example.php b/includes/jpgraph/src/Examples/vivid_example.php new file mode 100644 index 0000000..1d22748 --- /dev/null +++ b/includes/jpgraph/src/Examples/vivid_example.php @@ -0,0 +1,57 @@ + array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ), + 1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ), + 2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ), + 3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ), + 4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ), + 5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ), + 6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ), + 7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ), + 8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ), +); + +// Create the graph. These two calls are always required +$graph = new Graph(400,300); + +$graph->SetScale("textlin"); +if ($theme) { + $graph->SetTheme(new $theme()); +} +$theme_class = new VividTheme; +$graph->SetTheme($theme_class); + +$plot = array(); +// Create the bar plots +for ($i = 0; $i < 4; $i++) { + $plot[$i] = new BarPlot($data[$i]); + $plot[$i]->SetLegend('plot'.($i+1)); +} +//$acc1 = new AccBarPlot(array($plot[0], $plot[1])); +//$acc1->value->Show(); +$gbplot = new GroupBarPlot(array($plot[2], $plot[1] )); + +for ($i = 4; $i < 8; $i++) { + $plot[$i] = new LinePlot($data[$i]); + $plot[$i]->SetLegend('plot'.$i); + $plot[$i]->value->Show(); +} + +$graph->Add($gbplot); +$graph->Add($plot[4]); + +$title = "VividTheme Example"; +$title = mb_convert_encoding($title,'UTF-8'); +$graph->title->Set($title); +$graph->xaxis->title->Set("X-title"); +$graph->yaxis->title->Set("Y-title"); + +// Display the graph +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/windrose_2plots_ex1.php b/includes/jpgraph/src/Examples/windrose_2plots_ex1.php new file mode 100644 index 0000000..7aee315 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_2plots_ex1.php @@ -0,0 +1,44 @@ + array(10,10,13,7), + 2 => array(2,8,10), + 4 => array(1,12,22), + ); + +$data2 = array( + 4 => array(12,8,2,3), + 2 => array(5,4,4,5,2), + ); + +// Create a new small windrose graph +$graph = new WindroseGraph(660,400); +$graph->SetShadow(); + +$graph->title->Set('Two windrose plots in one graph'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); +$graph->subtitle->Set('(Using Box() for each plot)'); + +$wp = new WindrosePlot($data); +$wp->SetType(WINDROSE_TYPE8); +$wp->SetSize(0.42); +$wp->SetPos(0.25,0.55); +$wp->SetBox(); + +$wp2 = new WindrosePlot($data2); +$wp2->SetType(WINDROSE_TYPE16); +$wp2->SetSize(0.42); +$wp2->SetPos(0.74,0.55); +$wp2->SetBox(); +$wp2->SetRangeColors(array('green','yellow','red','brown')); + +$graph->Add($wp); +$graph->Add($wp2); + +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_bgimg_ex1.php b/includes/jpgraph/src/Examples/windrose_bgimg_ex1.php new file mode 100644 index 0000000..e51372d --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_bgimg_ex1.php @@ -0,0 +1,50 @@ + array(12,8,2,3), + 6 => array(5,4,4,5,4), + ); + +$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV','V','VSV','SV','SSV','S','SSO','SO','OSO'); + +// Create a new small windrose graph +$graph = new WindroseGraph(400,400); +$graph->SetMargin(25,25,25,25); +$graph->SetFrame(); + +$graph->title->Set('Example with background flag'); +#$graph->title->SetFont(FF_VERA,FS_BOLD,14); + + +//$graph->SetBackgroundImage('bkgimg.jpg',BGIMG_FILLFRAME); +//$graph->SetBackgroundImageMix(90); +$graph->SetBackgroundCFlag(28,BGIMG_FILLFRAME,15); + + +$wp2 = new WindrosePlot($data2); +$wp2->SetType(WINDROSE_TYPE16); +$wp2->SetSize(0.55); +$wp2->SetPos(0.5,0.5); +$wp2->SetAntiAlias(false); + +$wp2->SetFont(FF_ARIAL,FS_BOLD,10); +$wp2->SetFontColor('black'); + +$wp2->SetCompassLabels($se_CompassLbl); +$wp2->legend->SetMargin(20,5); + +$wp2->scale->SetZFont(FF_ARIAL,FS_NORMAL,8); +$wp2->scale->SetFont(FF_ARIAL,FS_NORMAL,9); +$wp2->scale->SetLabelFillColor('white','white'); + +$wp2->SetRangeColors(array('green','yellow','red','brown')); + +$graph->Add($wp2); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex0.php b/includes/jpgraph/src/Examples/windrose_ex0.php new file mode 100644 index 0000000..897d428 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex0.php @@ -0,0 +1,25 @@ + array(5,5,5,8), + 1 => array(3,4,1,4), + 'WSW' => array(1,5,5,3), + 'N' => array(2,3,8,1,1), + 15 => array(2,3,5)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); +$graph->title->Set('A basic Windrose graph'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Add and send back to browser +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex1.php b/includes/jpgraph/src/Examples/windrose_ex1.php new file mode 100644 index 0000000..e892a21 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex1.php @@ -0,0 +1,28 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 'wsw' => array(1,5,5,3), + 'N' => array(2,7,5,4,2), + 15 => array(2,7,12)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); + +// Setup title +$graph->title->Set('Windrose basic example'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); +$wp->SetRadialGridStyle('solid'); +$graph->Add($wp); + +// Send the graph to the browser +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex1b.php b/includes/jpgraph/src/Examples/windrose_ex1b.php new file mode 100644 index 0000000..c24a98c --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex1b.php @@ -0,0 +1,33 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 'wsw' => array(1,5,5,3), + 'N' => array(2,7,5,4,2), + 15 => array(2,7,12)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); +$graph->title->Set('Windrose example 1b'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Create the windrose plot. +// The default plot will have 16 compass axis. +$wp = new WindrosePlot($data); +$wp->SetRadialGridStyle('solid'); +$graph->Add($wp); + +// Setup the range so that the values do not touch eachother +$wp->SetRanges(array(0,1,2,3,4,5,6,7,8,10)); +$wp->SetRangeStyle(RANGE_DISCRETE); // Cmp with RANGE_OVERLAPPING as default + +// Send the graph to the browser +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex2.1.php b/includes/jpgraph/src/Examples/windrose_ex2.1.php new file mode 100644 index 0000000..48781ac --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex2.1.php @@ -0,0 +1,49 @@ + array(1,1,6,4), + 1 => array(3,8,1,4), + 2 => array(2,7,4,4,3), + 3 => array(2,7,1,2)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); + +// Setup title +$graph->title->Set('Windrose example 2'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Make it have 8 compass direction +$wp->SetType(WINDROSE_TYPE4); + +// Setup the weight of the laegs for the different ranges +$weights = array_fill(0,8,10); +$wp->SetRangeWeights($weights); + +// Adjust the font and font color for scale labels +$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11); +$wp->scale->SetFontColor('navy'); + +// Set the diametr for the plot to 160 pixels +$wp->SetSize(160); + +// Set the size of the innermost center circle to 30% of the plot size +$wp->SetZCircleSize(0.2); + +// Adjust the font and font color for compass directions +$wp->SetFont(FF_ARIAL,FS_NORMAL,12); +$wp->SetFontColor('darkgreen'); + +// Add and send back to browser +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex2.php b/includes/jpgraph/src/Examples/windrose_ex2.php new file mode 100644 index 0000000..23822cc --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex2.php @@ -0,0 +1,49 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 3 => array(2,7,4,4,3), + 5 => array(2,7,1,2)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); + +// Setup title +$graph->title->Set('Windrose example 2'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Make it have 8 compass direction +$wp->SetType(WINDROSE_TYPE8); + +// Setup the weight of the laegs for the different ranges +$weights = array_fill(0,8,10); +$wp->SetRangeWeights($weights); + +// Adjust the font and font color for scale labels +$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11); +$wp->scale->SetFontColor('navy'); + +// Set the diametr for the plot to 160 pixels +$wp->SetSize(200); + +// Set the size of the innermost center circle to 30% of the plot size +$wp->SetZCircleSize(0.2); + +// Adjust the font and font color for compass directions +$wp->SetFont(FF_ARIAL,FS_NORMAL,12); +$wp->SetFontColor('darkgreen'); + +// Add and send back the graph to the client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex3.php b/includes/jpgraph/src/Examples/windrose_ex3.php new file mode 100644 index 0000000..39c12ce --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex3.php @@ -0,0 +1,73 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 3 => array(2,7,4,4,3), + 5 => array(2,7,1,2)); + +$data[1] = array( + "n" => array(1,1,2.5,4), + "ssw" => array(3,4,1,4), + "se" => array(2,7,4,4,3)); + +// Store the position and size data for each plot in an +// array to make it easier to create multiple plots. +// The format choosen for the layout data is +// (type,x-pos,y-pos,size, z-circle size) +$layout = array( + array(WINDROSE_TYPE8,0.25,0.55,0.4,0.25), + array(WINDROSE_TYPE16,0.75,0.55,0.4,0.25)); + +$legendtxt = array('(m/s) Station 7','(m/s) Station 12'); + +// First create a new windrose graph with a dropshadow +$graph = new WindroseGraph(600,350); +$graph->SetShadow('darkgray'); + +// Setup titles +$graph->title->Set('Windrose example 3'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); +$graph->subtitle->Set('(Multiple plots in the same graph)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_NORMAL,9); +$graph->subtitle->SetColor('navy'); + +// Create the two windrose plots. +for( $i=0; $i < count($data); ++$i ) { + $wp[$i] = new WindrosePlot($data[$i]); + + // Make it have 8 compass direction + $wp[$i]->SetType($layout[$i][0]); + + // Adjust the font and font color for scale labels + $wp[$i]->scale->SetFont(FF_TIMES,FS_NORMAL,10); + $wp[$i]->scale->SetFontColor('navy'); + + // Set the position of the plot + $wp[$i]->SetPos($layout[$i][1],$layout[$i][2]); + + // Set the diameter for the plot to 30% of the width of the graph pixels + $wp[$i]->SetSize($layout[$i][3]); + + // Set the size of the innermost center circle to 30% of the plot size + $wp[$i]->SetZCircleSize($layout[$i][4]); + + // Adjust the font and font color for compass directions + $wp[$i]->SetFont(FF_ARIAL,FS_NORMAL,10); + $wp[$i]->SetFontColor('darkgreen'); + + // Add legend text + $wp[$i]->legend->SetText($legendtxt[$i]); + + $graph->Add($wp[$i]); +} + +// Send the graph to the browser +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex4.php b/includes/jpgraph/src/Examples/windrose_ex4.php new file mode 100644 index 0000000..0465204 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex4.php @@ -0,0 +1,58 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 3 => array(2,7,4,4,3), + 5 => array(2,7,1,2)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); + +// Setup title +$graph->title->Set('Windrose example 4'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Adjust the font and font color for scale labels +$wp->scale->SetFont(FF_TIMES,FS_NORMAL,11); +$wp->scale->SetFontColor('navy'); + +// Set the diameter and position for plot +$wp->SetSize(190); + +// Set the size of the innermost center circle to 40% of the plot size +// Note that we can have the automatic "Zero" sum appear in our custom text +$wp->SetZCircleSize(0.38); +$wp->scale->SetZeroLabel("Station 12\n(Calm %d%%)"); + +// Adjust color and font for center circle text +$wp->scale->SetZFont(FF_ARIAL,FS_NORMAL,9); +$wp->scale->SetZFontColor('darkgreen'); + +// Adjust the font and font color for compass directions +$wp->SetFont(FF_ARIAL,FS_NORMAL,10); +$wp->SetFontColor('darkgreen'); + +// Adjust the margin to the compass directions +$wp->SetLabelMargin(50); + +// Adjust grid colors +$wp->SetGridColor('silver','blue'); + +// Add (m/s) text to legend +$wp->legend->SetText('(m/s)'); +$wp->legend->SetMargin(20,5); + +// Add and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex5.php b/includes/jpgraph/src/Examples/windrose_ex5.php new file mode 100644 index 0000000..f013c3b --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex5.php @@ -0,0 +1,94 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 3 => array(2,7,4,4,3), + 5 => array(2,7,1,2)); + +// Text to be added. +$txt=array(); +$txt[0] = "It is possible to add arbitrary,multi line, text to a graph. "; +$txt[0] .= "Such a paragraph can have it's text be left, right or center "; +$txt[0] .= "aligned."; +$txt[1] = "This is an example of a right aligned paragraph."; +$txt[2] = "Finally we can show a center aligned paragraph without box."; + +// We store the layout for each of the text boxes in an array +// to keep the code clean +$txtlayout = array( + array(0.97,0.15,25,'left','black','lightblue'), + array(0.97,0.4,20,'right','black','lightblue'), + array(0.97,0.7,20,'center','darkred',false,FF_COMIC,FS_NORMAL,12), +); + +// Range colors to be used +$rangeColors = array('silver','khaki','orange','brown','blue','navy','maroon','red'); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(570,430); +$graph->title->Set('Windrose example 5'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Setup graph background color +$graph->SetColor('darkgreen@0.7'); + +// Setup all the defined text boxes +$n = count($txt); +for( $i=0; $i < $n; ++$i ) { + $txtbox[$i] = new Text($txt[$i]); + $txtbox[$i]->SetPos($txtlayout[$i][0],$txtlayout[$i][1],'right'); + $txtbox[$i]->SetWordwrap($txtlayout[$i][2]); + $txtbox[$i]->SetParagraphAlign($txtlayout[$i][3]); + $txtbox[$i]->SetColor($txtlayout[$i][4]); + $txtbox[$i]->SetBox($txtlayout[$i][5]); + if( count($txtlayout[$i]) > 6 ) + $txtbox[$i]->SetFont($txtlayout[$i][6],$txtlayout[$i][7],$txtlayout[$i][8]); +} +$graph->Add($txtbox); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Set background color for plot area +$wp->SetColor('lightyellow'); + +// Add a box around the plot +$wp->SetBox(); + +// Setup the colors for the ranges +$wp->SetRangeColors($rangeColors); + +// Adjust the font and font color for scale labels +$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9); +$wp->scale->SetFontColor('navy'); + +// Set the diameter and position for plot +$wp->SetSize(190); +$wp->SetPos(0.35,0.53); + +$wp->SetZCircleSize(0.2); + +// Adjust the font and font color for compass directions +$wp->SetFont(FF_ARIAL,FS_NORMAL,10); +$wp->SetFontColor('darkgreen'); + +// Adjust the margin to the compass directions +$wp->SetLabelMargin(50); + +// Adjust grid colors +$wp->SetGridColor('silver','blue'); + +// Add (m/s) text to legend +$wp->legend->SetText('(m/s)'); +$wp->legend->SetMargin(20,5); + +// Add plot and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex6.1.php b/includes/jpgraph/src/Examples/windrose_ex6.1.php new file mode 100644 index 0000000..61504c8 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex6.1.php @@ -0,0 +1,89 @@ + array(1,1,2.5,4), + '32.0' => array(3,4,1,4), + '120.5' => array(2,3,4,4,3,2,1), + '223.2' => array(2,4,1,2,2), + '285.7' => array(2,2,1,2,4,2,1,1) +); + +// This file is encode din utf-8. The two Kanji characters roughly means +// 中 = Chinese +// 文 = Sentences +$ctxt = '中文'; + +// Specify text for direction labels +$labels = array( + '120.5' => $ctxt, + '232.2' => "Reference\n#13 Ver:2"); + +// Range colors to be used +$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black'); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,450); + +// Setup title +$graph->title->Set('Using chinese charecters'); +#$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); +$graph->subtitle->Set('(Free type plot)'); +#$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); +$graph->subtitle->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Setup a free plot +$wp->SetType(WINDROSE_TYPEFREE); + +// Setup labels +$wp->SetLabels($labels); +$wp->SetLabelPosition(LBLPOSITION_CENTER); +$wp->SetLabelMargin(30); + +// Setup the colors for the ranges +$wp->SetRangeColors($rangeColors); + +// Adjust the font and font color for scale labels +#$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9); + +// Set the diameter and position for plot +#$wp->SetSize(240); +$wp->SetSize(200); +$wp->SetZCircleSize(30); +$wp->SetPos(0.5,0.5); + +// Adjust the font and font color for compass directions +#$wp->SetFont(FF_CHINESE,FS_NORMAL,12); +$wp->SetFontColor('darkgreen'); + +// Adjust grid colors +$wp->SetGridColor('darkgreen@0.7','blue'); + +// Add (m/s) text to legend +$wp->legend->SetText('(m/s)'); +$wp->legend->SetTFontColor('blue'); + +// Set legend label font color +$wp->legend->SetLFontColor('orange:0.7'); +#$wp->legend->SetLFont(FF_ARIAL,FS_ITALIC,8); + +// Display legend values with no decimals +$wp->legend->SetFormat('%d'); + +// Set the circle font to use chinse character set +// Note: When FF_CHINESE is used the input charectr data are +// assumed to already be in utf-8 encoding +#$wp->legend->SetCFont(FF_CHINESE,FS_NORMAL,14); +$wp->legend->SetCircleText($ctxt); +$wp->legend->SetCFontColor('red'); + +// Add plot to graph and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex6.php b/includes/jpgraph/src/Examples/windrose_ex6.php new file mode 100644 index 0000000..557f005 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex6.php @@ -0,0 +1,72 @@ + array(1,1,2.5,4), + '32.0' => array(3,4,1,4), + '120.5' => array(2,3,4,4,3,2,1), + '223.2' => array(2,4,1,2,2), + '285.7' => array(2,2,1,2,4,2,1,1) +); + +// Specify text for direction labels +$labels = array( '120.5' => "Plant\n#1275", + '285.7' => "Reference\n#13 Ver:2"); + +// Range colors to be used +$rangeColors = array('khaki','yellow','orange','orange:0.7','brown','darkred','black'); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,450); + +// Setup titles +$graph->title->Set('Windrose example 6'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +$graph->subtitle->Set('(Free type plot)'); +$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10); +$graph->subtitle->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Setup a free plot +$wp->SetType(WINDROSE_TYPEFREE); + +// Setup labels +$wp->SetLabels($labels); +$wp->SetLabelPosition(LBLPOSITION_CENTER); +$wp->SetLabelMargin(30); + +// Setup the colors for the ranges +$wp->SetRangeColors($rangeColors); + +// Adjust the font and font color for scale labels +$wp->scale->SetFont(FF_ARIAL,FS_NORMAL,9); + +// Set the diameter and position for plot +$wp->SetSize(230); +$wp->SetZCircleSize(30); + +// Adjust the font and font color for compass directions +$wp->SetFont(FF_ARIAL,FS_NORMAL,10); +$wp->SetFontColor('darkgreen'); + +// Adjust grid colors +$wp->SetGridColor('darkgreen@0.7','blue'); + +// Add (m/s) text to legend +$wp->legend->SetText('(m/s)'); + +// Display legend values with no decimals +$wp->legend->SetFormat('%d'); + +// Add plot to graph and send back to the client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex7.1.php b/includes/jpgraph/src/Examples/windrose_ex7.1.php new file mode 100644 index 0000000..4498716 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex7.1.php @@ -0,0 +1,67 @@ + array(1,15,7.5,2), + 5 => array(1,1,1.5,2), + 7 => array(1,2,10,3,2), + 8 => array(2,3,1,3,1,2), + ); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(590,580); +$graph->title->Set('Japanese locale'); +#$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor('navy'); + +// Create the free windrose plot. +$wp = new WindrosePlot($data); +$wp->SetType(WINDROSE_TYPE8); + +// Add some "arbitrary" text to the center +$wp->scale->SetZeroLabel("SOx\n8%%"); + +// Localize the compass direction labels into Japanese +// Note: The labels for data must now also match the exact +// string for the compass directions. +// +// E   東 +// NE  北東 +// N   北 +// NW  北西 +// W   西 +// SW  南西 +// S   南 +// SE  南東 +$jp_CompassLbl = array('東','','北東','','北','','北西','', + '西','','南西','','南','','南東',''); +$wp->SetCompassLabels($jp_CompassLbl); +#$wp->SetFont(FF_MINCHO,FS_NORMAL,15); + +// Localize the "Calm" text into Swedish and make the circle +// slightly bigger than default +$jp_calmtext = '平穏'; +$wp->legend->SetCircleText($jp_calmtext); +$wp->legend->SetCircleRadius(20); +#$wp->legend->SetCFont(FF_MINCHO,FS_NORMAL,10); +$wp->legend->SetMargin(5,0); +$wp->SetPos(0.5, 0.5); + +// Adjust the displayed ranges +$ranges = array(1,3,5,8,12,19,29); +$wp->SetRanges($ranges); + +// Set the scale to always have max value of 30 +$wp->scale->Set(30,10); +#$wp->scale->SetFont(FF_VERA,FS_NORMAL,12); + +// Finally add it to the graph and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex7.php b/includes/jpgraph/src/Examples/windrose_ex7.php new file mode 100644 index 0000000..b7a9b83 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex7.php @@ -0,0 +1,51 @@ + array(1,15,7.5,2), + 5 => array(1,1,1.5,2), + 7 => array(1,2,10,3,2), + 9 => array(2,3,1,3,1,2), + ); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,450); +$graph->title->Set('Windrose example 7'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor('navy'); + +// Create the free windrose plot. +$wp = new WindrosePlot($data); +$wp->SetType(WINDROSE_TYPE16); + +// Add some "arbitrary" text to the center +$wp->scale->SetZeroLabel("SOx\n8%%"); + +// Localize the compass direction labels into Swedish +// Note: The labels for data must now also match the exact +// string for the compass directions. +$se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV', + 'V','VSV','SV','SSV','S','SSO','SO','OSO'); +$wp->SetCompassLabels($se_CompassLbl); + +// Localize the "Calm" text into Swedish and make the circle +// slightly bigger than default +$se_calmtext = 'Lugnt'; +$wp->legend->SetCircleText($se_calmtext); +$wp->legend->SetCircleRadius(20); + +// Adjust the displayed ranges +$ranges = array(1,3,5,8,12,19,29); +$wp->SetRanges($ranges); +//$wp->SetAntiAlias(true); + +// Set the scale to always have max value of 30 with a step +// size of 12. +$wp->scale->Set(30,12); + +// Finally add it to the graph and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex8.1.php b/includes/jpgraph/src/Examples/windrose_ex8.1.php new file mode 100644 index 0000000..caaff63 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex8.1.php @@ -0,0 +1,49 @@ + array(3,2,1,2,2), + 355 => array(1,1,1.5,2), + 180 => array(1,1,1.5,2), + 150 => array(1,2,1,3), + 'S' => array(2,3,5,1), + ); + +// Add some labels for afew of the directions +$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant"); + +// Define the color,weight and style of some individual radial grid lines. +$axiscolors = array(355=>"red"); +$axisweights = array(355=>8); +$axisstyles = array(355=>'solid',150=>'solid'); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,460); +$graph->title->Set('Adding label backgrounds'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor('navy'); + +// Create the free windrose plot. +$wp = new WindrosePlot($data); +$wp->SetType(WINDROSE_TYPEFREE); +$wp->scale->SetLabelFillColor('lightblue','black'); + +// Specify colors weights and style for the radial gridlines +$wp->SetRadialColors($axiscolors); +$wp->SetRadialWeights($axisweights); +$wp->SetRadialStyles($axisstyles); + +// Add a few labels +$wp->SetLabels($labels); + +// Add some "arbitrary" text to the center +$wp->scale->SetZeroLabel("SOx\n8%%"); + +// Finally add it to the graph and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex8.php b/includes/jpgraph/src/Examples/windrose_ex8.php new file mode 100644 index 0000000..b81c874 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex8.php @@ -0,0 +1,48 @@ + array(3,2,1,2,2), + 355 => array(1,1,1.5,2), + 180 => array(1,1,1.5,2), + 150 => array(1,2,1,3), + 'S' => array(2,3,5,1), + ); + +// Add some labels for afew of the directions +$labels = array(355=>"At\nHome base",180=>"Probe\n123",150=>"Power\nplant"); + +// Define the color,weight and style of some individual radial grid lines. +$axiscolors = array(355=>"red"); +$axisweights = array(355=>8); +$axisstyles = array(355=>'solid',150=>'solid'); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,500); +$graph->title->Set('Windrose example 8'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor('navy'); + +// Create the free windrose plot. +$wp = new WindrosePlot($data); +$wp->SetType(WINDROSE_TYPEFREE); + +// Specify colors weights and style for the radial gridlines +$wp->SetRadialColors($axiscolors); +$wp->SetRadialWeights($axisweights); +$wp->SetRadialStyles($axisstyles); + +// Add a few labels +$wp->SetLabels($labels); + +// Add some "arbitrary" text to the center +$wp->scale->SetZeroLabel("SOx\n8%%"); + +// Finally add it to the graph and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex9.1.php b/includes/jpgraph/src/Examples/windrose_ex9.1.php new file mode 100644 index 0000000..dbdebed --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex9.1.php @@ -0,0 +1,62 @@ + array(3,2,1,2,2), + 4 => array(1,1,1.5,2), + 6 => array(1,1,1.5,2), + 12 => array(2,3,5,1), +); + +$xpos1 = 0.26; +$xpos2 = 0.74; +$ypos1 = 0.5; +$ypos2 = 0.9; + +// First create a new windrose graph with a title +$graph = new WindroseGraph(650,350); +$graph->title->Set('Interpretation of ordinal keys'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor('navy'); + +// Create the first plot +$wp1 = new WindrosePlot($data); +$wp1->SetType(WINDROSE_TYPE16); + +// This is the default encoding +$wp1->SetDataKeyEncoding(KEYENCODING_ANTICLOCKWISE); +$wp1->legend->Hide(); +$wp1->SetPos($xpos1,$ypos1); +$wp1->SetSize(0.5); + +// Create the second plot +$wp2 = new WindrosePlot($data); +$wp2->SetType(WINDROSE_TYPE16); +$wp2->SetDataKeyEncoding(KEYENCODING_CLOCKWISE); +$wp2->legend->Hide(); +$wp2->SetPos($xpos2,$ypos1); +$wp2->SetSize(0.5); + +$txt1 = new Text('KEYENCODING_ANTICLOCKWISE'); +$txt1->SetFont(FF_COURIER,FS_BOLD,12); +$txt1->SetPos($xpos1,$ypos2); +$txt1->SetAlign('center','top'); + +$txt2 = new Text('KEYENCODING_CLOCKWISE'); +$txt2->SetFont(FF_COURIER,FS_BOLD,12); +$txt2->SetPos($xpos2,$ypos2); +$txt2->SetAlign('center','top'); + +// Finally add it to the graph and send back to the client +$graph->Add($wp1); +$graph->Add($txt1); + +$graph->Add($wp2); +$graph->Add($txt2); + +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_ex9.php b/includes/jpgraph/src/Examples/windrose_ex9.php new file mode 100644 index 0000000..53f3dda --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_ex9.php @@ -0,0 +1,46 @@ + array(3,2,1,2,2), + 'N' => array(1,1,1.5,2), + 'nw' => array(1,1,1.5,2), + 'S' => array(2,3,5,1), + ); + +// Define the color,weight and style of some individual radial +// grid lines. Axis can be specified either by their (localized) +// label or by their index. +// Note; Depending on how many axis you have in the plot the +// index will vary between 0..n where n is the number of +// compass directions. +$axiscolors = array('nw'=>'brown'); +$axisweights = array('nw'=>8); // Could also be specified as 6 => 8 +$axisstyles = array('nw'=>'solid'); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,500); +$graph->title->Set('Windrose example 9'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,14); +$graph->title->SetColor('navy'); + +// Create the free windrose plot. +$wp = new WindrosePlot($data); +$wp->SetType(WINDROSE_TYPE16); + +// Specify colors weights and style for the radial gridlines +$wp->SetRadialColors($axiscolors); +$wp->SetRadialWeights($axisweights); +$wp->SetRadialStyles($axisstyles); + +// Add some "arbitrary" text to the center +$wp->scale->SetZeroLabel("SOx\n8%%"); + +// Finally add it to the graph and send back to the client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_icon_ex1.php b/includes/jpgraph/src/Examples/windrose_icon_ex1.php new file mode 100644 index 0000000..4481174 --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_icon_ex1.php @@ -0,0 +1,33 @@ + array(1,1,2.5,4), + 1 => array(3,4,1,4), + 'wsw' => array(1,5,5,3), + 'N' => array(2,7,5,4,2), + 15 => array(2,7,12)); + +// First create a new windrose graph with a title +$graph = new WindroseGraph(400,400); + +// Creta an icon to be added to the graph +$icon = new IconPlot('tornado.jpg',10,10,1.3,50); +$icon->SetAnchor('left','top'); +$graph->Add($icon); + +// Setup title +$graph->title->Set('Windrose icon example'); +$graph->title->SetFont(FF_VERDANA,FS_BOLD,12); +$graph->title->SetColor('navy'); + +// Create the windrose plot. +$wp = new WindrosePlot($data); + +// Add to graph and send back to client +$graph->Add($wp); +$graph->Stroke(); +?> + diff --git a/includes/jpgraph/src/Examples/windrose_layout_ex0.php b/includes/jpgraph/src/Examples/windrose_layout_ex0.php new file mode 100644 index 0000000..cd6f43c --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_layout_ex0.php @@ -0,0 +1,45 @@ + array(10,10,13,7), + 2 => array(2,8,10), + 4 => array(1,12,22)), + array( + 4 => array(12,8,2,3), + 2 => array(5,4,4,5,2)), + array( + 1 => array(12,8,2,3), + 3 => array(5,4,4,5,2)), + array( + 2 => array(12,8,2,3), + 3 => array(5,4,4,5,2)), +); + +// Create a windrose graph with titles +$graph = new WindroseGraph(600,650); +$graph->SetShadow(); + +$graph->title->Set('Multiple plots with automatic layout'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Setup the individual windrose plots +$wp = array(); +for( $i=0; $i < 4; ++$i ) { + $wp[$i] = new WindrosePlot($data[$i]); + $wp[$i]->SetSize(0.22); + $wp[$i]->SetCenterSize(0.25); +} + +// Position with two rows. Two plots in top row and three plots in +// bottom row. +$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) ); +$hl2 = new LayoutHor( array( $wp[2], $wp[3] ) ); +$vl = new LayoutVert( array( $hl1, $hl2) ); + +$graph->Add($vl); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/windrose_layout_ex1.php b/includes/jpgraph/src/Examples/windrose_layout_ex1.php new file mode 100644 index 0000000..d44a61c --- /dev/null +++ b/includes/jpgraph/src/Examples/windrose_layout_ex1.php @@ -0,0 +1,58 @@ + array(10,10,13,7), + 2 => array(2,8,10), + 4 => array(1,12,22)), + array( + 4 => array(12,8,2,3), + 2 => array(5,4,4,5,2)), + array( + 1 => array(12,8,2,3), + 3 => array(5,4,4,5,2)), + array( + 2 => array(12,8,2,3), + 3 => array(5,4,4,5,2)), + array( + 4 => array(12,8,2,3), + 6 => array(5,4,4,5,2)) +); + +// Legend range colors +$rangecolors = array('green','yellow','red','brown'); + +// Create a windrose graph with titles +$graph = new WindroseGraph(750,700); + +$graph->title->Set('Multiple plots with automatic layout'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,14); + +// Setup the individual windrose plots +$wp = array(); +for( $i=0; $i < 5; ++$i ) { + $wp[$i] = new WindrosePlot($data[$i]); + $wp[$i]->SetType(WINDROSE_TYPE8); + if( $i < 2) { + $wp[$i]->SetSize(0.28); + } + else { + $wp[$i]->legend->Hide(); + $wp[$i]->SetSize(0.16); + $wp[$i]->SetCenterSize(0.25); + } + $wp[$i]->SetRangeColors($rangecolors); +} + +// Position with two rows. Two plots in top row and three plots in +// bottom row. +$hl1 = new LayoutHor( array( $wp[0], $wp[1] ) ); +$hl2 = new LayoutHor( array( $wp[2], $wp[3], $wp[4] ) ); +$vl = new LayoutVert( array( $hl1, $hl2) ); + +$graph->Add($vl); +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/worldmap1.jpg b/includes/jpgraph/src/Examples/worldmap1.jpg new file mode 100644 index 0000000..caa7c14 Binary files /dev/null and b/includes/jpgraph/src/Examples/worldmap1.jpg differ diff --git a/includes/jpgraph/src/Examples/y2synch.php b/includes/jpgraph/src/Examples/y2synch.php new file mode 100644 index 0000000..f00ad73 --- /dev/null +++ b/includes/jpgraph/src/Examples/y2synch.php @@ -0,0 +1,60 @@ +SetMargin(50,60,40,45); +$graph->SetMarginColor('white'); + + +// Setup the scales for X,Y and Y2 axis +$graph->SetScale("intlin"); // X and Y axis +$graph->SetY2Scale("lin"); // Y2 axis + +// Overall graph title +$graph->title->Set('Synchronized Y & Y2 scales'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// Title for X-axis +$graph->xaxis->title->Set('Measurement'); +$graph->xaxis->title->SetMargin(5); +$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Create Y data set +$lplot = new LinePlot($datay); +$graph->yaxis->title->Set('Celcius (C)'); +$graph->yaxis->title->SetMargin(5); +$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); +// ... and add the plot to the Y-axis +$graph->Add($lplot); + +// Create Y2 scale data set +$l2plot = new LinePlot($datay); +$l2plot->SetWeight(0); +$graph->y2axis->title->Set('Fahrenheit (F)'); +$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels +$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11); +$graph->y2axis->SetLabelFormatCallback('toFahrenheit'); +$graph->y2axis->SetColor('navy'); + +// ... and add the plot to the Y2-axis +$graph->AddY2($l2plot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/y2synch2.php b/includes/jpgraph/src/Examples/y2synch2.php new file mode 100644 index 0000000..5d6a88f --- /dev/null +++ b/includes/jpgraph/src/Examples/y2synch2.php @@ -0,0 +1,60 @@ +SetMargin(50,60,40,45); +$graph->SetMarginColor('white'); + + +// Setup the scales for X,Y and Y2 axis +$graph->SetScale("textlin"); // X and Y axis +$graph->SetY2Scale("lin"); // Y2 axis + +// Overall graph title +$graph->title->Set('Synchronized Y & Y2 scales'); +$graph->title->SetFont(FF_ARIAL,FS_BOLD,12); + +// Title for X-axis +$graph->xaxis->title->Set('Measurement'); +$graph->xaxis->title->SetMargin(5); +$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); + +// Create Y data set +$lplot = new BarPlot($datay); +$graph->yaxis->title->Set('Celcius (C)'); +$graph->yaxis->title->SetMargin(5); +$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,11); +// ... and add the plot to the Y-axis +$graph->Add($lplot); + +// Create Y2 scale data set +$l2plot = new LinePlot($datay); +$l2plot->SetWeight(0); +$graph->y2axis->title->Set('Fahrenheit (F)'); +$graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels +$graph->y2axis->title->SetFont(FF_ARIAL,FS_NORMAL,11); +$graph->y2axis->SetLabelFormatCallback('toFahrenheit'); +$graph->y2axis->SetColor('navy'); + +// ... and add the plot to the Y2-axis +$graph->AddY2($l2plot); + +$graph->Stroke(); +?> diff --git a/includes/jpgraph/src/Examples/yearssn.txt b/includes/jpgraph/src/Examples/yearssn.txt new file mode 100644 index 0000000..bafcd7b --- /dev/null +++ b/includes/jpgraph/src/Examples/yearssn.txt @@ -0,0 +1,309 @@ +1700.5 5.0 +1701.5 11.0 +1702.5 16.0 +1703.5 23.0 +1704.5 36.0 +1705.5 58.0 +1706.5 29.0 +1707.5 20.0 +1708.5 10.0 +1709.5 8.0 +1710.5 3.0 +1711.5 0.0 +1712.5 0.0 +1713.5 2.0 +1714.5 11.0 +1715.5 27.0 +1716.5 47.0 +1717.5 63.0 +1718.5 60.0 +1719.5 39.0 +1720.5 28.0 +1721.5 26.0 +1722.5 22.0 +1723.5 11.0 +1724.5 21.0 +1725.5 40.0 +1726.5 78.0 +1727.5 122.0 +1728.5 103.0 +1729.5 73.0 +1730.5 47.0 +1731.5 35.0 +1732.5 11.0 +1733.5 5.0 +1734.5 16.0 +1735.5 34.0 +1736.5 70.0 +1737.5 81.0 +1738.5 111.0 +1739.5 101.0 +1740.5 73.0 +1741.5 40.0 +1742.5 20.0 +1743.5 16.0 +1744.5 5.0 +1745.5 11.0 +1746.5 22.0 +1747.5 40.0 +1748.5 60.0 +1749.5 80.9 +1750.5 83.4 +1751.5 47.7 +1752.5 47.8 +1753.5 30.7 +1754.5 12.2 +1755.5 9.6 +1756.5 10.2 +1757.5 32.4 +1758.5 47.6 +1759.5 54.0 +1760.5 62.9 +1761.5 85.9 +1762.5 61.2 +1763.5 45.1 +1764.5 36.4 +1765.5 20.9 +1766.5 11.4 +1767.5 37.8 +1768.5 69.8 +1769.5 106.1 +1770.5 100.8 +1771.5 81.6 +1772.5 66.5 +1773.5 34.8 +1774.5 30.6 +1775.5 7.0 +1776.5 19.8 +1777.5 92.5 +1778.5 154.4 +1779.5 125.9 +1780.5 84.8 +1781.5 68.1 +1782.5 38.5 +1783.5 22.8 +1784.5 10.2 +1785.5 24.1 +1786.5 82.9 +1787.5 132.0 +1788.5 130.9 +1789.5 118.1 +1790.5 89.9 +1791.5 66.6 +1792.5 60.0 +1793.5 46.9 +1794.5 41.0 +1795.5 21.3 +1796.5 16.0 +1797.5 6.4 +1798.5 4.1 +1799.5 6.8 +1800.5 14.5 +1801.5 34.0 +1802.5 45.0 +1803.5 43.1 +1804.5 47.5 +1805.5 42.2 +1806.5 28.1 +1807.5 10.1 +1808.5 8.1 +1809.5 2.5 +1810.5 0.0 +1811.5 1.4 +1812.5 5.0 +1813.5 12.2 +1814.5 13.9 +1815.5 35.4 +1816.5 45.8 +1817.5 41.0 +1818.5 30.1 +1819.5 23.9 +1820.5 15.6 +1821.5 6.6 +1822.5 4.0 +1823.5 1.8 +1824.5 8.5 +1825.5 16.6 +1826.5 36.3 +1827.5 49.6 +1828.5 64.2 +1829.5 67.0 +1830.5 70.9 +1831.5 47.8 +1832.5 27.5 +1833.5 8.5 +1834.5 13.2 +1835.5 56.9 +1836.5 121.5 +1837.5 138.3 +1838.5 103.2 +1839.5 85.7 +1840.5 64.6 +1841.5 36.7 +1842.5 24.2 +1843.5 10.7 +1844.5 15.0 +1845.5 40.1 +1846.5 61.5 +1847.5 98.5 +1848.5 124.7 +1849.5 96.3 +1850.5 66.6 +1851.5 64.5 +1852.5 54.1 +1853.5 39.0 +1854.5 20.6 +1855.5 6.7 +1856.5 4.3 +1857.5 22.7 +1858.5 54.8 +1859.5 93.8 +1860.5 95.8 +1861.5 77.2 +1862.5 59.1 +1863.5 44.0 +1864.5 47.0 +1865.5 30.5 +1866.5 16.3 +1867.5 7.3 +1868.5 37.6 +1869.5 74.0 +1870.5 139.0 +1871.5 111.2 +1872.5 101.6 +1873.5 66.2 +1874.5 44.7 +1875.5 17.0 +1876.5 11.3 +1877.5 12.4 +1878.5 3.4 +1879.5 6.0 +1880.5 32.3 +1881.5 54.3 +1882.5 59.7 +1883.5 63.7 +1884.5 63.5 +1885.5 52.2 +1886.5 25.4 +1887.5 13.1 +1888.5 6.8 +1889.5 6.3 +1890.5 7.1 +1891.5 35.6 +1892.5 73.0 +1893.5 85.1 +1894.5 78.0 +1895.5 64.0 +1896.5 41.8 +1897.5 26.2 +1898.5 26.7 +1899.5 12.1 +1900.5 9.5 +1901.5 2.7 +1902.5 5.0 +1903.5 24.4 +1904.5 42.0 +1905.5 63.5 +1906.5 53.8 +1907.5 62.0 +1908.5 48.5 +1909.5 43.9 +1910.5 18.6 +1911.5 5.7 +1912.5 3.6 +1913.5 1.4 +1914.5 9.6 +1915.5 47.4 +1916.5 57.1 +1917.5 103.9 +1918.5 80.6 +1919.5 63.6 +1920.5 37.6 +1921.5 26.1 +1922.5 14.2 +1923.5 5.8 +1924.5 16.7 +1925.5 44.3 +1926.5 63.9 +1927.5 69.0 +1928.5 77.8 +1929.5 64.9 +1930.5 35.7 +1931.5 21.2 +1932.5 11.1 +1933.5 5.7 +1934.5 8.7 +1935.5 36.1 +1936.5 79.7 +1937.5 114.4 +1938.5 109.6 +1939.5 88.8 +1940.5 67.8 +1941.5 47.5 +1942.5 30.6 +1943.5 16.3 +1944.5 9.6 +1945.5 33.2 +1946.5 92.6 +1947.5 151.6 +1948.5 136.3 +1949.5 134.7 +1950.5 83.9 +1951.5 69.4 +1952.5 31.5 +1953.5 13.9 +1954.5 4.4 +1955.5 38.0 +1956.5 141.7 +1957.5 190.2 +1958.5 184.8 +1959.5 159.0 +1960.5 112.3 +1961.5 53.9 +1962.5 37.6 +1963.5 27.9 +1964.5 10.2 +1965.5 15.1 +1966.5 47.0 +1967.5 93.7 +1968.5 105.9 +1969.5 105.5 +1970.5 104.5 +1971.5 66.6 +1972.5 68.9 +1973.5 38.0 +1974.5 34.5 +1975.5 15.5 +1976.5 12.6 +1977.5 27.5 +1978.5 92.5 +1979.5 155.4 +1980.5 154.6 +1981.5 140.5 +1982.5 115.9 +1983.5 66.6 +1984.5 45.9 +1985.5 17.9 +1986.5 13.4 +1987.5 29.2 +1988.5 100.2 +1989.5 157.6 +1990.5 142.6 +1991.5 145.7 +1992.5 94.3 +1993.5 54.6 +1994.5 29.9 +1995.5 17.5 +1996.5 8.6 +1997.5 21.5 +1998.5 64.3 +1999.5 93.3 +2000.5 119.6 +2001.5 111.0 +2002.5 104.0 +2003.5 63.7 +2004.5 40.4 +2005.5 29.8 +2006.5 15.2 +2007.5 7.5 +2008.5 2.9 diff --git a/includes/jpgraph/src/barcode/demoapp/barcode_image.php b/includes/jpgraph/src/barcode/demoapp/barcode_image.php new file mode 100644 index 0000000..2ad88fd --- /dev/null +++ b/includes/jpgraph/src/barcode/demoapp/barcode_image.php @@ -0,0 +1,75 @@ + 5 ) { + echo "

Module width must be between 1 and 5 pixels

"; +} +elseif( $data==="" ) { + echo "

Please enter data to be encoded, select symbology and press 'Ok'.

"; + echo "Note: Data must be valid for the choosen encoding."; +} +elseif( $code==-1 ) { + echo "

No code symbology selected.

"; +} +elseif( $height < 10 || $height > 500 ) { + echo "

Height must be in range [10, 500]

"; +} +elseif( $scale < 0.1 || $scale > 15 ) { + echo "

Scale must be in range [0.1, 15]

"; +} +else { + if( $code==20 ) { + $encoder = BarcodeFactory::Create(6); + $encoder->UseExtended(); + } + else { + $encoder = BarcodeFactory::Create($code); + } + $b = $backend=='EPS' ? 'PS' : $backend; + $b = substr($backend,0,5) == 'IMAGE' ? 'IMAGE' : $b; + $e = BackendFactory::Create($b,$encoder); + if( substr($backend,0,5) == 'IMAGE' ) { + if( substr($backend,5,1) == 'J' ) + $e->SetImgFormat('JPEG'); + } + if( $e ) { + if( $backend == 'EPS' ) + $e->SetEPS(); + if( $pswidth!='' ) + $modwidth = $pswidth; + $e->SetModuleWidth($modwidth); + $e->AddChecksum($checksum); + $e->NoText($notext); + $e->SetScale($scale); + $e->SetVertical($vertical); + $e->ShowFrame($showframe); + $e->SetHeight($height); + $r = $e->Stroke($data,$file,$info,$info); + if( $r ) + echo nl2br(htmlspecialchars($r)); + if( $file != '' ) + echo "

Wrote file $file."; + } + else + echo "

Can't create choosen backend: $backend.

"; +} + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/barcode/demoapp/barcode_menu.php b/includes/jpgraph/src/barcode/demoapp/barcode_menu.php new file mode 100644 index 0000000..ea50306 --- /dev/null +++ b/includes/jpgraph/src/barcode/demoapp/barcode_menu.php @@ -0,0 +1,125 @@ +

JpGraph Barcode 1.0

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Data:
+ +
+Encoding:
+ +
+Module width:
+ +
+Add checksum:
+ +
+Hide text:
+ +
+Show frame:
+ +
+Vertical layout:
+ +
+Height:
+ +
+Scale:
+ +
+Write to file:
+ +
+Format:
+ +
+PS module width: + +
+
+(If specified will override Module width above)
+
+Debug info:
+ +
+
+ +
+
+ +

+


+ + + diff --git a/includes/jpgraph/src/barcode/demoapp/index.html b/includes/jpgraph/src/barcode/demoapp/index.html new file mode 100644 index 0000000..e65107c --- /dev/null +++ b/includes/jpgraph/src/barcode/demoapp/index.html @@ -0,0 +1,10 @@ + + + +Barcode SYSTEMTEST + + +; + + + diff --git a/includes/jpgraph/src/barcode/examples/barcode_errhandling_ex0.php b/includes/jpgraph/src/barcode/examples/barcode_errhandling_ex0.php new file mode 100644 index 0000000..4f5b539 --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_errhandling_ex0.php @@ -0,0 +1,16 @@ +Stroke('abc123'); +} catch( JpGraphException $e ) { + //echo 'Error: ' . $e->getMessage()."\n"; + JpGraphError::Raise($e->getMessage()); +} + +?> diff --git a/includes/jpgraph/src/barcode/examples/barcode_ex0.php b/includes/jpgraph/src/barcode/examples/barcode_ex0.php new file mode 100644 index 0000000..021b5c7 --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_ex0.php @@ -0,0 +1,11 @@ +Stroke('ABC123'); + +?> diff --git a/includes/jpgraph/src/barcode/examples/barcode_ex1.php b/includes/jpgraph/src/barcode/examples/barcode_ex1.php new file mode 100644 index 0000000..df7653b --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_ex1.php @@ -0,0 +1,14 @@ +SetModuleWidth(2); +$e->SetHeight(20); +echo nl2br($e->Stroke('3125134772')); + + +?> diff --git a/includes/jpgraph/src/barcode/examples/barcode_ex2.php b/includes/jpgraph/src/barcode/examples/barcode_ex2.php new file mode 100644 index 0000000..8fce58e --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_ex2.php @@ -0,0 +1,14 @@ +SetModuleWidth(2); +$e->SetHeight(70); +$ps = $e->Stroke('3125134772'); +echo nl2br(htmlspecialchars($ps)); + +?> diff --git a/includes/jpgraph/src/barcode/examples/barcode_ex3.php b/includes/jpgraph/src/barcode/examples/barcode_ex3.php new file mode 100644 index 0000000..a63f4ad --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_ex3.php @@ -0,0 +1,17 @@ +"; +$encoder = BarcodeFactory::Create(ENCODING_CODEI25); +$e = BackendFactory::Create(BACKEND_PS,$encoder); +$e->SetModuleWidth(2); +$e->SetHeight(70); +$e->SetEPS(); +$ps = $e->Stroke('3125134772'); +echo nl2br(htmlspecialchars($ps)); + + +?> diff --git a/includes/jpgraph/src/barcode/examples/barcode_ex4.php b/includes/jpgraph/src/barcode/examples/barcode_ex4.php new file mode 100644 index 0000000..721b56b --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_ex4.php @@ -0,0 +1,12 @@ +SetModuleWidth(2); +$e->Stroke('1234'); + +?> diff --git a/includes/jpgraph/src/barcode/examples/barcode_usps_example.php b/includes/jpgraph/src/barcode/examples/barcode_usps_example.php new file mode 100644 index 0000000..80469be --- /dev/null +++ b/includes/jpgraph/src/barcode/examples/barcode_usps_example.php @@ -0,0 +1,74 @@ +_USPS_chkd(substr($data,8)); + $data = '420'. $aZIP . '~191' . $aServiceType . $aDUNS . $aSeqNbr; + return $data . $cd; + } + + // Get type 2 of confirmation code (without ZIP) + function GetPIC($aServiceType,$aDUNS,$aSeqNbr) { + // Convert to USPS format with AI=91 + $data = '91' . $aServiceType . $aDUNS . $aSeqNbr; + $cd = $this->_USPS_chkd($data); + return $data . $cd; + } + +} + +$usps = new USPS_Confirmation(); +$zip = '92663'; +$service = '21'; +$DUNS = '805213907'; +$seqnr = '04508735'; +$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr); +//$data = $usps->GetPIC('01','123456789','00000001'); + +$encoder = BarcodeFactory::Create(ENCODING_EAN128); +$e = BackendFactory::Create(BACKEND_IMAGE,$encoder); +$e->SetModuleWidth(2); +$e->SetFont(FF_ARIAL,FS_NORMAL,14); +$e->Stroke($data); + +?> \ No newline at end of file diff --git a/includes/jpgraph/src/barcode/mkbarcode.php b/includes/jpgraph/src/barcode/mkbarcode.php new file mode 100644 index 0000000..ff413e7 --- /dev/null +++ b/includes/jpgraph/src/barcode/mkbarcode.php @@ -0,0 +1,281 @@ +argv = ($_SERVER['argv']); + $this->argc = ($_SERVER['argc']); + } + + function PrintUsage() { + $n = $this->argv[0]; + echo "$n -b [-r -h -c -o -m -s -y -f ] datastring \n". + "Create the specified barcode\n". + "-b What symbology to use, one of the following strings (case insensitive)\n". + " UPCA \n". + " UPCE \n". + " EAN128 \n". + " EAN13 \n". + " EAN8 \n". + " CODE11 \n". + " CODE39 \n". + " CODE128 \n". + " CODE25 \n". + " CODEI25 \n". + " CODABAR \n". + " BOOKLAND \n". + "-c Add checkdigit for symbologies where this is optional\n". + "-o Output format. 0=Image, 1=PS, 2=EPS\n". + "-m Module width\n". + "-s Scale factor\n". + "-h Show this help\n". + "-f Filename to write to\n". + "-r Rotate barcode 90 degrees\n". + "-y height Set height in pixels\n". + "-x Hide the human readable text\n". + "--silent Silent. Don't give any error mesages\n"; + exit(1); + } + + function Get() { + $barcode='code39'; + $hide=false; + $checkdigit=false; + $modulewidth=2; + $scale=1; + $output=0; + $filename=''; + $data = ''; + $rotate = false; + $silent=false; + $height = 70; + if( ($n=$this->GetNum()) > 0 ) { + $i=1; + while( $i <= $n ) { + switch( $this->argv[$i] ) { + case '-h': + $this->PrintUsage(); + exit(0); + break; + case '-b': + $barcode = $this->argv[++$i]; + break; + case '-o': + $output = (int)$this->argv[++$i]; + break; + case '-y': + $height = (int)$this->argv[++$i]; + break; + case '-x': + $hide=true; + break; + case '-r': + $rotate=true; + break; + case '-c': + $checkdigit=true; + break; + case '--silent': + $silent=true; + break; + case '-s': + $scale = (float)$this->argv[++$i]; + break; + case '-m': + $modulewidth = (float)$this->argv[++$i]; + break; + case '-f': + $filename = $this->argv[++$i]; + break; + default: + if( $data == '' ) { + $data = $this->argv[$i]; + } + else { + $this->PrintUsage(); + die("Illegal specified parameters"); + } + break; + } + ++$i; + } + + } + + if( $output < 0 || $output > 2 ) { + fwrite(STDERR,"Unkown output format ($output)\n"); + exit(1); + } + + if( $output === 0 ) { + $modulewidth = floor($modulewidth); + } + + // Sanity check + if( $modulewidth > 15 ) { + fwrite(STDERR,"Too large modulewidth\n"); + exit(1); + } + + // Sanity check + if( $height > 1000 ) { + fwrite(STDERR,"Too large height\n"); + exit(1); + } + + // Sanity check + if( $scale > 15 ) { + fwrite(STDERR,"Too large scale factor\n"); + exit(1); + } + + if( strlen($filename) > 256 ) { + fwrite(STDERR,"Too long filename\n"); + exit(1); + } + + if( trim($data) == '' ) { + fwrite(STDERR,"No input data specified\n"); + exit(1); + } + + $barcodes = array( + 'UPCA' => ENCODING_UPCA, + 'UPCE' => ENCODING_UPCE, + 'EAN128' => ENCODING_EAN128, + 'EAN13' => ENCODING_EAN13, + 'EAN8' => ENCODING_EAN8, + 'CODE11' => ENCODING_CODE11, + 'CODE39' => ENCODING_CODE39, + 'CODE128' => ENCODING_CODE128, + 'CODE25' => ENCODING_CODE25, + 'CODEI25' => ENCODING_CODEI25, + 'CODABAR' => ENCODING_CODABAR, + 'BOOKLAND' => ENCODING_BOOKLAND, + ); + $barcode = strtoupper($barcode); + if( key_exists($barcode,$barcodes) ) { + $barcode = $barcodes[$barcode]; + } + else { + fwrite(STDERR,'Specified barcode symbology ('.$barcode.") is not supported\n"); + exit(1); + } + + $ret = array( + 'barcode' => $barcode, + 'hide' => $hide, + 'modulewidth' => $modulewidth, + 'scale' => $scale, + 'output' => $output, + 'data' => $data, + 'silent' => $silent, + 'rotate' => $rotate, + 'height' => $height, + 'checkdigit' => $checkdigit, + 'filename' => $filename + ); + + return $ret; + } + + function _Dump() { + var_dump($this->argv); + } + + function GetNum() { + return $this->argc-1; + } +} + +//---------------------------------------------------------------------- +// CLASS Driver +// Main driver class to create barcodes with the parmeters specified on +// the command line. +//---------------------------------------------------------------------- +class Driver { + + private $iParams; + static public $silent=false; + + static public function ErrHandlerPS(Exception $e) { + if( !Driver::$silent ) + fwrite(STDERR,$e->getMessage()."\n"); + exit(1); + } + + static public function ErrHandlerImg(Exception $e) { + if( !Driver::$silent ) + fwrite(STDERR,$e->getMessage()."\n"); + $errobj = new JpGraphErrObjectImg(); + $errobj->Raise($e->getMessage()); + exit(1); + } + + function Run($aParams) { + + $this->iParams = $aParams; + + Driver::$silent = $aParams['silent']; + + $encoder = BarcodeFactory::Create($aParams['barcode']); + $encoder->AddChecksum($aParams['checkdigit']); + switch( $aParams['output'] ) { + case 0: + $e = BackendFactory::Create(BACKEND_IMAGE,$encoder); + set_exception_handler(array('Driver','ErrHandlerImg')); + break; + case 1: + $e = BackendFactory::Create(BACKEND_PS,$encoder); + set_exception_handler(array('Driver','ErrHandlerPS')); + break; + case 2: + $e = BackendFactory::Create(BACKEND_PS,$encoder); + $e->SetEPS(); + set_exception_handler(array('Driver','ErrHandlerPS')); + break; + } + $e->SetHeight($aParams['height']); + $e->SetVertical($aParams['rotate']); + $e->SetModuleWidth($aParams['modulewidth']); + $e->SetScale($aParams['scale']); + $e->HideText($aParams['hide']); + if( $aParams['output'] === 0 ) { + $err = $e->Stroke($aParams['data'], $aParams['filename']); + } + else { + $s = $e->Stroke($aParams['data'], $aParams['filename']); + if( $aParams['filename'] == '' ) { + // If no filename specified then return the generated postscript + echo $s; + } + } + } +} + +$pa = new ParseArgs(); +$params = $pa->Get(); +$driver = new Driver(); +$driver->Run($params); + +// Successfull termination +exit(0); + +?> diff --git a/includes/jpgraph/src/flag_mapping b/includes/jpgraph/src/flag_mapping new file mode 100644 index 0000000..7f9c3c5 --- /dev/null +++ b/includes/jpgraph/src/flag_mapping @@ -0,0 +1,237 @@ +class JpCountryFlags { + +$iCountryFlags = array( + 'Afghanistan' => 'afgh.gif', + 'Republic of Angola' => 'agla.gif', + 'Republic of Albania' => 'alba.gif', + 'Alderney' => 'alde.gif', + 'Democratic and Popular Republic of Algeria' => 'alge.gif', + 'Territory of American Samoa' => 'amsa.gif', + 'Principality of Andorra' => 'andr.gif', + 'British Overseas Territory of Anguilla' => 'angu.gif', + 'Antarctica' => 'anta.gif', + 'Argentine Republic' => 'arge.gif', + 'League of Arab States' => 'arle.gif', + 'Republic of Armenia' => 'arme.gif', + 'Aruba' => 'arub.gif', + 'Commonwealth of Australia' => 'astl.gif', + 'Republic of Austria' => 'aust.gif', + 'Azerbaijani Republic' => 'azer.gif', + 'British Antarctic Territory' => 'bant.gif', + 'Kingdom of Belgium' => 'belg.gif', + 'British Overseas Territory of Bermuda' => 'berm.gif', + 'Commonwealth of the Bahamas' => 'bhms.gif', + 'Kingdom of Bahrain' => 'bhrn.gif', + 'Republic of Belarus' => 'blru.gif', + 'Republic of Bolivia' => 'blva.gif', + 'Belize' => 'blze.gif', + 'Republic of Benin' => 'bnin.gif', + 'Republic of Botswana' => 'bots.gif', + 'Federative Republic of Brazil' => 'braz.gif', + 'Barbados' => 'brbd.gif', + 'British Indian Ocean Territory' => 'brin.gif', + 'Brunei Darussalam' => 'brun.gif', + 'Republic of Burkina' => 'bufa.gif', + 'Republic of Bulgaria' => 'bulg.gif', + 'Republic of Burundi' => 'buru.gif', + 'Overseas Territory of the British Virgin Islands' => 'bvis.gif', + 'Central African Republic' => 'cafr.gif', + 'Kingdom of Cambodia' => 'camb.gif', + 'Republic of Cameroon' => 'came.gif', + 'Dominion of Canada' => 'cana.gif', + 'Caribbean Community' => 'cari.gif', + 'Republic of Cape Verde' => 'cave.gif', + 'Republic of Chad' => 'chad.gif', + 'Republic of Chile' => 'chil.gif', + 'Territory of Christmas Island' => 'chms.gif', + 'Commonwealth of Independent States' => 'cins.gif', + 'Cook Islands' => 'ckis.gif', + 'Republic of Colombia' => 'clmb.gif', + 'Territory of Cocos Islands' => 'cois.gif', + 'Commonwealth' => 'comn.gif', + 'Union of the Comoros' => 'como.gif', + 'Republic of the Congo' => 'cong.gif', + 'Republic of Costa Rica' => 'corc.gif', + 'Republic of Croatia' => 'croa.gif', + 'Republic of Cuba' => 'cuba.gif', + 'British Overseas Territory of the Cayman Islands' => 'cyis.gif', + 'Republic of Cyprus' => 'cypr.gif', + 'The Czech Republic' => 'czec.gif', + 'Kingdom of Denmark' => 'denm.gif', + 'Republic of Djibouti' => 'djib.gif', + 'Commonwealth of Dominica' => 'domn.gif', + 'Dominican Republic' => 'dore.gif', + 'Republic of Ecuador' => 'ecua.gif', + 'Arab Republic of Egypt' => 'egyp.gif', + 'Republic of El Salvador' => 'elsa.gif', + 'England' => 'engl.gif', + 'Republic of Equatorial Guinea' => 'eqgu.gif', + 'State of Eritrea' => 'erit.gif', + 'Republic of Estonia' => 'estn.gif', + 'Ethiopia' => 'ethp.gif', + 'European Union' => 'euun.gif', + 'British Overseas Territory of the Falkland Islands' => 'fais.gif', + 'International Federation of Vexillological Associations' => 'fiav.gif', + 'Republic of Fiji' => 'fiji.gif', + 'Republic of Finland' => 'finl.gif', + 'Territory of French Polynesia' => 'fpol.gif', + 'French Republic' => 'fran.gif', + 'Overseas Department of French Guiana' => 'frgu.gif', + 'Gabonese Republic' => 'gabn.gif', + 'Republic of the Gambia' => 'gamb.gif', + 'Republic of Georgia' => 'geor.gif', + 'Federal Republic of Germany' => 'germ.gif', + 'Republic of Ghana' => 'ghan.gif', + 'Gibraltar' => 'gibr.gif', + 'Hellenic Republic' => 'grec.gif', + 'State of Grenada' => 'gren.gif', + 'Overseas Department of Guadeloupe' => 'guad.gif', + 'Territory of Guam' => 'guam.gif', + 'Republic of Guatemala' => 'guat.gif', + 'The Bailiwick of Guernsey' => 'guer.gif', + 'Republic of Guinea' => 'guin.gif', + 'Republic of Haiti' => 'hait.gif', + 'Hong Kong Special Administrative Region' => 'hokn.gif', + 'Republic of Honduras' => 'hond.gif', + 'Republic of Hungary' => 'hung.gif', + 'Republic of Iceland' => 'icel.gif', + 'International Committee of the Red Cross' => 'icrc.gif', + 'Republic of India' => 'inda.gif', + 'Republic of Indonesia' => 'indn.gif', + 'Republic of Iraq' => 'iraq.gif', + 'Republic of Ireland' => 'irel.gif', + 'Organization of the Islamic Conference' => 'isco.gif', + 'Isle of Man' => 'isma.gif', + 'State of Israel' => 'isra.gif', + 'Italian Republic' => 'ital.gif', + 'Jamaica' => 'jama.gif', + 'Japan' => 'japa.gif', + 'The Bailiwick of Jersey' => 'jers.gif', + 'Hashemite Kingdom of Jordan' => 'jord.gif', + 'Republic of Kazakhstan' => 'kazk.gif', + 'Republic of Kenya' => 'keny.gif', + 'Republic of Kiribati' => 'kirb.gif', + 'State of Kuwait' => 'kuwa.gif', + 'Kyrgyz Republic' => 'kyrg.gif', + 'Republic of Latvia' => 'latv.gif', + 'Lebanese Republic' => 'leba.gif', + 'Kingdom of Lesotho' => 'lest.gif', + 'Republic of Liberia' => 'libe.gif', + 'Principality of Liechtenstein' => 'liec.gif', + 'Republic of Lithuania' => 'lith.gif', + 'Grand Duchy of Luxembourg' => 'luxe.gif', + 'Macao Special Administrative Region' => 'maca.gif', + 'Republic of Macedonia' => 'mace.gif', + 'Republic of Madagascar' => 'mada.gif', + 'Republic of the Marshall Islands' => 'mais.gif', + 'Republic of Maldives' => 'mald.gif', + 'Republic of Mali' => 'mali.gif', + 'Federation of Malaysia' => 'mals018.gif', + 'Republic of Malta' => 'malt.gif', + 'Republic of Malawi' => 'malw.gif', + 'Overseas Department of Martinique' => 'mart.gif', + 'Islamic Republic of Mauritania' => 'maur.gif', + 'Territorial Collectivity of Mayotte' => 'mayt.gif', + 'United Mexican States' => 'mexc.gif', + 'Federated States of Micronesia' => 'micr.gif', + 'Midway Islands' => 'miis.gif', + 'Republic of Moldova' => 'mold.gif', + 'Principality of Monaco' => 'mona.gif', + 'Republic of Mongolia' => 'mong.gif', + 'British Overseas Territory of Montserrat' => 'mont.gif', + 'Kingdom of Morocco' => 'morc.gif', + 'Republic of Mozambique' => 'moza.gif', + 'Republic of Mauritius' => 'mrts.gif', + 'Union of Myanmar' => 'myan.gif', + 'Republic of Namibia' => 'namb.gif', + 'North Atlantic Treaty Organization' => 'nato.gif', + 'Republic of Nauru' => 'naur.gif', + 'Turkish Republic of Northern Cyprus' => 'ncyp.gif', + 'Netherlands Antilles' => 'nean.gif', + 'Kingdom of Nepal' => 'nepa.gif', + 'Kingdom of the Netherlands' => 'neth.gif', + 'Territory of Norfolk Island' => 'nfis.gif', + 'Federal Republic of Nigeria' => 'ngra.gif', + 'Republic of Nicaragua' => 'nica.gif', + 'Republic of Niger' => 'nigr.gif', + 'Niue' => 'niue.gif', + 'Commonwealth of the Northern Mariana Islands' => 'nmar.gif', + 'Province of Northern Ireland' => 'noir.gif', + 'Nordic Council' => 'nord.gif', + 'Kingdom of Norway' => 'norw.gif', + 'Territory of New Caledonia and Dependencies' => 'nwca.gif', + 'New Zealand' => 'nwze.gif', + 'Organization of American States' => 'oast.gif', + 'Organization of African Unity' => 'oaun.gif', + 'International Olympic Committee' => 'olym.gif', + 'Sultanate of Oman' => 'oman.gif', + 'Organization of Petroleum Exporting Countries' => 'opec.gif', + 'Islamic Republic of Pakistan' => 'paks.gif', + 'Republic of Palau' => 'pala.gif', + 'Independent State of Papua New Guinea' => 'pang.gif', + 'Republic of Paraguay' => 'para.gif', + 'Republic of the Philippines' => 'phil.gif', + 'British Overseas Territory of the Pitcairn Islands' => 'piis.gif', + 'Republic of Poland' => 'pola.gif', + 'Republic of Portugal' => 'port.gif', + 'Commonwealth of Puerto Rico' => 'purc.gif', + 'State of Qatar' => 'qata.gif', + 'Russian Federation' => 'russ.gif', + 'Republic of Rwanda' => 'rwan.gif', + 'Kingdom of Saudi Arabia' => 'saar.gif', + 'Republic of San Marino' => 'sama.gif', + 'Nordic Sami Conference' => 'sami.gif', + 'Sark' => 'sark.gif', + 'Scotland' => 'scot.gif', + 'Principality of Seborga' => 'sebo.gif', + 'Republic of Sierra Leone' => 'sile.gif', + 'Republic of Singapore' => 'sing.gif', + 'Republic of Korea' => 'skor.gif', + 'Republic of Slovenia' => 'slva.gif', + 'Somali Republic' => 'smla.gif', + 'Republic of Somaliland' => 'smld.gif', + 'Republic of South Africa' => 'soaf.gif', + 'Solomon Islands' => 'sois.gif', + 'Kingdom of Spain' => 'span.gif', + 'Secretariat of the Pacific Community' => 'spco.gif', + 'Democratic Socialist Republic of Sri Lanka' => 'srla.gif', + 'Saint Lucia' => 'stlu.gif', + 'Republic of the Sudan' => 'suda.gif', + 'Republic of Suriname' => 'surn.gif', + 'Slovak Republic' => 'svka.gif', + 'Kingdom of Sweden' => 'swdn.gif', + 'Swiss Confederation' => 'swit.gif', + 'Syrian Arab Republic' => 'syra.gif', + 'Kingdom of Swaziland' => 'szld.gif', + 'Republic of China' => 'taiw.gif', + 'Republic of Tajikistan' => 'tajk.gif', + 'United Republic of Tanzania' => 'tanz.gif', + 'Kingdom of Thailand' => 'thal.gif', + 'Autonomous Region of Tibet' => 'tibe.gif', + 'Turkmenistan' => 'tkst.gif', + 'Togolese Republic' => 'togo.gif', + 'Tokelau' => 'toke.gif', + 'Kingdom of Tonga' => 'tong.gif', + 'Tristan da Cunha' => 'trdc.gif', + 'Tromelin' => 'tris.gif', + 'Republic of Tunisia' => 'tuns.gif', + 'Republic of Turkey' => 'turk.gif', + 'Tuvalu' => 'tuva.gif', + 'United Arab Emirates' => 'uaem.gif', + 'Republic of Uganda' => 'ugan.gif', + 'Ukraine' => 'ukrn.gif', + 'United Kingdom of Great Britain' => 'unkg.gif', + 'United Nations' => 'unna.gif', + 'United States of America' => 'unst.gif', + 'Oriental Republic of Uruguay' => 'urgy.gif', + 'Virgin Islands of the United States' => 'usvs.gif', + 'Republic of Uzbekistan' => 'uzbk.gif', + 'State of the Vatican City' => 'vacy.gif', + 'Republic of Vanuatu' => 'vant.gif', + 'Bolivarian Republic of Venezuela' => 'venz.gif', + 'Republic of Yemen' => 'yemn.gif', + 'Democratic Republic of Congo' => 'zare.gif', + 'Republic of Zimbabwe' => 'zbwe.gif' +) ; + + diff --git a/includes/jpgraph/src/flags.dat b/includes/jpgraph/src/flags.dat new file mode 100644 index 0000000..1cd2e72 Binary files /dev/null and b/includes/jpgraph/src/flags.dat differ diff --git a/includes/jpgraph/src/flags_thumb100x100.dat b/includes/jpgraph/src/flags_thumb100x100.dat new file mode 100644 index 0000000..545e7ad Binary files /dev/null and b/includes/jpgraph/src/flags_thumb100x100.dat differ diff --git a/includes/jpgraph/src/flags_thumb35x35.dat b/includes/jpgraph/src/flags_thumb35x35.dat new file mode 100644 index 0000000..7335011 Binary files /dev/null and b/includes/jpgraph/src/flags_thumb35x35.dat differ diff --git a/includes/jpgraph/src/flags_thumb60x60.dat b/includes/jpgraph/src/flags_thumb60x60.dat new file mode 100644 index 0000000..6107d08 Binary files /dev/null and b/includes/jpgraph/src/flags_thumb60x60.dat differ diff --git a/includes/jpgraph/src/fonts/DejaVuSans-Bold.ttf b/includes/jpgraph/src/fonts/DejaVuSans-Bold.ttf new file mode 100644 index 0000000..ac313d2 Binary files /dev/null and b/includes/jpgraph/src/fonts/DejaVuSans-Bold.ttf differ diff --git a/includes/jpgraph/src/fonts/DejaVuSans-BoldOblique.ttf b/includes/jpgraph/src/fonts/DejaVuSans-BoldOblique.ttf new file mode 100644 index 0000000..c818ae6 Binary files /dev/null and b/includes/jpgraph/src/fonts/DejaVuSans-BoldOblique.ttf differ diff --git a/includes/jpgraph/src/fonts/DejaVuSans-Oblique.ttf b/includes/jpgraph/src/fonts/DejaVuSans-Oblique.ttf new file mode 100644 index 0000000..d5ac60d Binary files /dev/null and b/includes/jpgraph/src/fonts/DejaVuSans-Oblique.ttf differ diff --git a/includes/jpgraph/src/fonts/DejaVuSans.ttf b/includes/jpgraph/src/fonts/DejaVuSans.ttf new file mode 100644 index 0000000..a99969e Binary files /dev/null and b/includes/jpgraph/src/fonts/DejaVuSans.ttf differ diff --git a/includes/jpgraph/src/fonts/FF_FONT0-Bold.gdf b/includes/jpgraph/src/fonts/FF_FONT0-Bold.gdf new file mode 100644 index 0000000..3b371f8 Binary files /dev/null and b/includes/jpgraph/src/fonts/FF_FONT0-Bold.gdf differ diff --git a/includes/jpgraph/src/fonts/FF_FONT0.gdf b/includes/jpgraph/src/fonts/FF_FONT0.gdf new file mode 100644 index 0000000..e231b71 Binary files /dev/null and b/includes/jpgraph/src/fonts/FF_FONT0.gdf differ diff --git a/includes/jpgraph/src/fonts/FF_FONT1-Bold.gdf b/includes/jpgraph/src/fonts/FF_FONT1-Bold.gdf new file mode 100644 index 0000000..d62f0b3 Binary files /dev/null and b/includes/jpgraph/src/fonts/FF_FONT1-Bold.gdf differ diff --git a/includes/jpgraph/src/fonts/FF_FONT1.gdf b/includes/jpgraph/src/fonts/FF_FONT1.gdf new file mode 100644 index 0000000..7b5b0f6 Binary files /dev/null and b/includes/jpgraph/src/fonts/FF_FONT1.gdf differ diff --git a/includes/jpgraph/src/fonts/FF_FONT2-Bold.gdf b/includes/jpgraph/src/fonts/FF_FONT2-Bold.gdf new file mode 100644 index 0000000..6e40284 Binary files /dev/null and b/includes/jpgraph/src/fonts/FF_FONT2-Bold.gdf differ diff --git a/includes/jpgraph/src/fonts/FF_FONT2.gdf b/includes/jpgraph/src/fonts/FF_FONT2.gdf new file mode 100644 index 0000000..50bca09 Binary files /dev/null and b/includes/jpgraph/src/fonts/FF_FONT2.gdf differ diff --git a/includes/jpgraph/src/gd_image.inc.php b/includes/jpgraph/src/gd_image.inc.php new file mode 100644 index 0000000..c9b552b --- /dev/null +++ b/includes/jpgraph/src/gd_image.inc.php @@ -0,0 +1,2304 @@ +original_width = $aWidth; + $this->original_height = $aHeight; + $this->CreateImgCanvas($aWidth, $aHeight); + + if( $aSetAutoMargin ) { + $this->SetAutoMargin(); + } + + if( !$this->SetImgFormat($aFormat) ) { + JpGraphError::RaiseL(25081,$aFormat);//("JpGraph: Selected graphic format is either not supported or unknown [$aFormat]"); + } + $this->ttf = new TTF(); + $this->langconv = new LanguageConv(); + + $this->ff_font0 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT0.gdf"); + $this->ff_font1 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1.gdf"); + $this->ff_font2 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2.gdf"); + $this->ff_font1_bold = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1-Bold.gdf"); + $this->ff_font2_bold = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2-Bold.gdf"); + } + + // Enable interlacing in images + function SetInterlace($aFlg=true) { + $this->iInterlace=$aFlg; + } + + // Should we use anti-aliasing. Note: This really slows down graphics! + function SetAntiAliasing($aFlg=true) { + $this->use_anti_aliasing = $aFlg; + if( function_exists('imageantialias') ) { + imageantialias($this->img,$aFlg); + } + else { + JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.') + } + } + + function GetAntiAliasing() { + return $this->use_anti_aliasing ; + } + + function CreateRawCanvas($aWidth=0,$aHeight=0) { + + $aWidth *= SUPERSAMPLING_SCALE; + $aHeight *= SUPERSAMPLING_SCALE; + + if( $aWidth <= 1 || $aHeight <= 1 ) { + JpGraphError::RaiseL(25082,$aWidth,$aHeight);//("Illegal sizes specified for width or height when creating an image, (width=$aWidth, height=$aHeight)"); + } + + $this->img = @imagecreatetruecolor($aWidth, $aHeight); + if( $this->img < 1 ) { + JpGraphError::RaiseL(25126); + //die("Can't create truecolor image. Check that you really have GD2 library installed."); + } + $this->SetAlphaBlending(); + + if( $this->iInterlace ) { + imageinterlace($this->img,1); + } + if( $this->rgb != null ) { + $this->rgb->img = $this->img ; + } + else { + $this->rgb = new RGB($this->img); + } + } + + function CloneCanvasH() { + $oldimage = $this->img; + $this->CreateRawCanvas($this->width,$this->height); + imagecopy($this->img,$oldimage,0,0,0,0,$this->width,$this->height); + return $oldimage; + } + + function CreateImgCanvas($aWidth=0,$aHeight=0) { + + $old = array($this->img,$this->width,$this->height); + + $aWidth = round($aWidth); + $aHeight = round($aHeight); + + $this->width=$aWidth; + $this->height=$aHeight; + + + if( $aWidth==0 || $aHeight==0 ) { + // We will set the final size later. + // Note: The size must be specified before any other + // img routines that stroke anything are called. + $this->img = null; + $this->rgb = null; + return $old; + } + + $this->CreateRawCanvas($aWidth,$aHeight); + // Set canvas color (will also be the background color for a + // a pallett image + $this->SetColor($this->canvascolor); + $this->FilledRectangle(0,0,$this->width-1,$this->height-1); + + return $old ; + } + + function CopyCanvasH($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY,$aWidth,$aHeight,$aw=-1,$ah=-1) { + if( $aw === -1 ) { + $aw = $aWidth; + $ah = $aHeight; + $f = 'imagecopyresized'; + } + else { + $f = 'imagecopyresampled'; + } + $f($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY, $aWidth,$aHeight,$aw,$ah); + } + + function Copy($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1) { + $this->CopyCanvasH($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); + } + + function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) { + if( $aMix == 100 ) { + $this->CopyCanvasH($this->img,$fromImg, + $toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); + } + else { + if( ($fromWidth != -1 && ($fromWidth != $toWidth)) || ($fromHeight != -1 && ($fromHeight != $fromHeight)) ) { + // Create a new canvas that will hold the re-scaled original from image + if( $toWidth <= 1 || $toHeight <= 1 ) { + JpGraphError::RaiseL(25083);//('Illegal image size when copying image. Size for copied to image is 1 pixel or less.'); + } + + $tmpimg = @imagecreatetruecolor($toWidth, $toHeight); + + if( $tmpimg < 1 ) { + JpGraphError::RaiseL(25084);//('Failed to create temporary GD canvas. Out of memory ?'); + } + $this->CopyCanvasH($tmpimg,$fromImg,0,0,0,0, + $toWidth,$toHeight,$fromWidth,$fromHeight); + $fromImg = $tmpimg; + } + imagecopymerge($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$aMix); + } + } + + static function GetWidth($aImg=null) { + if( $aImg === null ) { + $aImg = $this->img; + } + return imagesx($aImg); + } + + static function GetHeight($aImg=null) { + if( $aImg === null ) { + $aImg = $this->img; + } + return imagesy($aImg); + } + + static function CreateFromString($aStr) { + $img = imagecreatefromstring($aStr); + if( $img === false ) { + JpGraphError::RaiseL(25085); + //('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.'); + } + return $img; + } + + function SetCanvasH($aHdl) { + $this->img = $aHdl; + $this->rgb->img = $aHdl; + } + + function SetCanvasColor($aColor) { + $this->canvascolor = $aColor ; + } + + function SetAlphaBlending($aFlg=true) { + ImageAlphaBlending($this->img,$aFlg); + } + + function SetAutoMargin() { + $min_bm=5; + $lm = min(40,$this->width/7); + $rm = min(20,$this->width/10); + $tm = max(5,$this->height/7); + $bm = max($min_bm,$this->height/6); + $this->SetMargin($lm,$rm,$tm,$bm); + } + + //--------------- + // PUBLIC METHODS + + function SetFont($family,$style=FS_NORMAL,$size=10) { + $this->font_family=$family; + $this->font_style=$style; + $this->font_size=$size*SUPERSAMPLING_SCALE; + $this->font_file=''; + if( ($this->font_family==FF_FONT1 || $this->font_family==FF_FONT2) && $this->font_style==FS_BOLD ){ + ++$this->font_family; + } + if( $this->font_family > FF_FONT2+1 ) { // A TTF font so get the font file + + // Check that this PHP has support for TTF fonts + if( !function_exists('imagettfbbox') ) { + // use internal font when php is configured without '--with-ttf' + $this->font_family = FF_FONT1; +// JpGraphError::RaiseL(25087);//('This PHP build has not been configured with TTF support. You need to recompile your PHP installation with FreeType support.'); + } else { + $this->font_file = $this->ttf->File($this->font_family,$this->font_style); + } + } + } + + // Get the specific height for a text string + function GetTextHeight($txt="",$angle=0) { + $tmp = preg_split('/\n/',$txt); + $n = count($tmp); + $m=0; + for($i=0; $i< $n; ++$i) { + $m = max($m,strlen($tmp[$i])); + } + + if( $this->font_family <= FF_FONT2+1 ) { + if( $angle==0 ) { + $h = imagefontheight($this->font_family); + if( $h === false ) { + JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); + } + + return $n*$h; + } + else { + $w = @imagefontwidth($this->font_family); + if( $w === false ) { + JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); + } + + return $m*$w; + } + } + else { + $bbox = $this->GetTTFBBox($txt,$angle); + return $bbox[1]-$bbox[5]+1; + } + } + + // Estimate font height + function GetFontHeight($angle=0) { + $txt = "XOMg"; + return $this->GetTextHeight($txt,$angle); + } + + // Approximate font width with width of letter "O" + function GetFontWidth($angle=0) { + $txt = 'O'; + return $this->GetTextWidth($txt,$angle); + } + + // Get actual width of text in absolute pixels. Note that the width is the + // texts projected with onto the x-axis. Call with angle=0 to get the true + // etxt width. + function GetTextWidth($txt,$angle=0) { + + $tmp = preg_split('/\n/',$txt); + $n = count($tmp); + if( $this->font_family <= FF_FONT2+1 ) { + + $m=0; + for($i=0; $i < $n; ++$i) { + $l=strlen($tmp[$i]); + if( $l > $m ) { + $m = $l; + } + } + + if( $angle==0 ) { + $w = @imagefontwidth($this->font_family); + if( $w === false ) { + JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); + } + return $m*$w; + } + else { + // 90 degrees internal so height becomes width + $h = @imagefontheight($this->font_family); + if( $h === false ) { + JpGraphError::RaiseL(25089);//('You have a misconfigured GD font support. The call to imagefontheight() fails.'); + } + return $n*$h; + } + } + else { + // For TTF fonts we must walk through a lines and find the + // widest one which we use as the width of the multi-line + // paragraph + $m=0; + for( $i=0; $i < $n; ++$i ) { + $bbox = $this->GetTTFBBox($tmp[$i],$angle); + $mm = $bbox[2] - $bbox[0]; + if( $mm > $m ) + $m = $mm; + } + return $m; + } + } + + + // Draw text with a box around it + function StrokeBoxedText($x,$y,$txt,$dir=0,$fcolor="white",$bcolor="black", + $shadowcolor=false,$paragraph_align="left", + $xmarg=6,$ymarg=4,$cornerradius=0,$dropwidth=3) { + + $oldx = $this->lastx; + $oldy = $this->lasty; + + if( !is_numeric($dir) ) { + if( $dir=="h" ) $dir=0; + elseif( $dir=="v" ) $dir=90; + else JpGraphError::RaiseL(25090,$dir);//(" Unknown direction specified in call to StrokeBoxedText() [$dir]"); + } + + if( $this->font_family >= FF_FONT0 && $this->font_family <= FF_FONT2+1) { + $width=$this->GetTextWidth($txt,$dir) ; + $height=$this->GetTextHeight($txt,$dir) ; + } + else { + $width=$this->GetBBoxWidth($txt,$dir) ; + $height=$this->GetBBoxHeight($txt,$dir) ; + } + + $height += 2*$ymarg; + $width += 2*$xmarg; + + if( $this->text_halign=="right" ) $x -= $width; + elseif( $this->text_halign=="center" ) $x -= $width/2; + + if( $this->text_valign=="bottom" ) $y -= $height; + elseif( $this->text_valign=="center" ) $y -= $height/2; + + $olda = $this->SetAngle(0); + + if( $shadowcolor ) { + $this->PushColor($shadowcolor); + $this->FilledRoundedRectangle($x-$xmarg+$dropwidth,$y-$ymarg+$dropwidth, + $x+$width+$dropwidth,$y+$height-$ymarg+$dropwidth, + $cornerradius); + $this->PopColor(); + $this->PushColor($fcolor); + $this->FilledRoundedRectangle($x-$xmarg,$y-$ymarg, + $x+$width,$y+$height-$ymarg, + $cornerradius); + $this->PopColor(); + $this->PushColor($bcolor); + $this->RoundedRectangle($x-$xmarg,$y-$ymarg, + $x+$width,$y+$height-$ymarg,$cornerradius); + $this->PopColor(); + } + else { + if( $fcolor ) { + $oc=$this->current_color; + $this->SetColor($fcolor); + $this->FilledRoundedRectangle($x-$xmarg,$y-$ymarg,$x+$width,$y+$height-$ymarg,$cornerradius); + $this->current_color=$oc; + } + if( $bcolor ) { + $oc=$this->current_color; + $this->SetColor($bcolor); + $this->RoundedRectangle($x-$xmarg,$y-$ymarg,$x+$width,$y+$height-$ymarg,$cornerradius); + $this->current_color=$oc; + } + } + + $h=$this->text_halign; + $v=$this->text_valign; + $this->SetTextAlign("left","top"); + + $debug=false; + $this->StrokeText($x, $y, $txt, $dir, $paragraph_align,$debug); + + $bb = array($x-$xmarg,$y+$height-$ymarg,$x+$width,$y+$height-$ymarg, + $x+$width,$y-$ymarg,$x-$xmarg,$y-$ymarg); + $this->SetTextAlign($h,$v); + + $this->SetAngle($olda); + $this->lastx = $oldx; + $this->lasty = $oldy; + + return $bb; + } + + // Draw text with a box around it. This time the box will be rotated + // with the text. The previous method will just make a larger enough non-rotated + // box to hold the text inside. + function StrokeBoxedText2($x,$y,$txt,$dir=0,$fcolor="white",$bcolor="black", + $shadowcolor=false,$paragraph_align="left", + $xmarg=6,$ymarg=4,$cornerradius=0,$dropwidth=3) { + + // This version of boxed text will stroke a rotated box round the text + // thta will follow the angle of the text. + // This has two implications: + // 1) This methos will only support TTF fonts + // 2) The only two alignment that makes sense are centered or baselined + + if( $this->font_family <= FF_FONT2+1 ) { + JpGraphError::RaiseL(25131);//StrokeBoxedText2() Only support TTF fonts and not built in bitmap fonts + } + + $oldx = $this->lastx; + $oldy = $this->lasty; + $dir = $this->NormAngle($dir); + + if( !is_numeric($dir) ) { + if( $dir=="h" ) $dir=0; + elseif( $dir=="v" ) $dir=90; + else JpGraphError::RaiseL(25090,$dir);//(" Unknown direction specified in call to StrokeBoxedText() [$dir]"); + } + + $width=$this->GetTextWidth($txt,0) + 2*$xmarg; + $height=$this->GetTextHeight($txt,0) + 2*$ymarg ; + $rect_width=$this->GetBBoxWidth($txt,$dir) ; + $rect_height=$this->GetBBoxHeight($txt,$dir) ; + + $baseline_offset = $this->bbox_cache[1]-1; + + if( $this->text_halign=="center" ) { + if( $dir >= 0 && $dir <= 90 ) { + + $x -= $rect_width/2; + $x += sin($dir*M_PI/180)*$height; + $y += $rect_height/2; + + } elseif( $dir >= 270 && $dir <= 360 ) { + + $x -= $rect_width/2; + $y -= $rect_height/2; + $y += cos($dir*M_PI/180)*$height; + + } elseif( $dir >= 90 && $dir <= 180 ) { + + $x += $rect_width/2; + $y += $rect_height/2; + $y += cos($dir*M_PI/180)*$height; + + } + else { + // $dir > 180 && $dir < 270 + $x += $rect_width/2; + $x += sin($dir*M_PI/180)*$height; + $y -= $rect_height/2; + } + } + + // Rotate the box around this point + $this->SetCenter($x,$y); + $olda = $this->SetAngle(-$dir); + + // We need to use adjusted coordinats for the box to be able + // to draw the box below the baseline. This cannot be done before since + // the rotating point must be the original x,y since that is arounbf the + // point where the text will rotate and we cannot change this since + // that is where the GD/GreeType will rotate the text + + + // For smaller <14pt font we need to do some additional + // adjustments to make it look good + if( $this->font_size < 14 ) { + $x -= 2; + $y += 2; + } + else { + // $y += $baseline_offset; + } + + if( $shadowcolor ) { + $this->PushColor($shadowcolor); + $this->FilledRectangle($x-$xmarg+$dropwidth,$y+$ymarg+$dropwidth-$height, + $x+$width+$dropwidth,$y+$ymarg+$dropwidth); + //$cornerradius); + $this->PopColor(); + $this->PushColor($fcolor); + $this->FilledRectangle($x-$xmarg, $y+$ymarg-$height, + $x+$width, $y+$ymarg); + //$cornerradius); + $this->PopColor(); + $this->PushColor($bcolor); + $this->Rectangle($x-$xmarg,$y+$ymarg-$height, + $x+$width,$y+$ymarg); + //$cornerradius); + $this->PopColor(); + } + else { + if( $fcolor ) { + $oc=$this->current_color; + $this->SetColor($fcolor); + $this->FilledRectangle($x-$xmarg,$y+$ymarg-$height,$x+$width,$y+$ymarg);//,$cornerradius); + $this->current_color=$oc; + } + if( $bcolor ) { + $oc=$this->current_color; + $this->SetColor($bcolor); + $this->Rectangle($x-$xmarg,$y+$ymarg-$height,$x+$width,$y+$ymarg);//,$cornerradius); + $this->current_color=$oc; + } + } + + if( $this->font_size < 14 ) { + $x += 2; + $y -= 2; + } + else { + + // Restore the original y before we stroke the text + // $y -= $baseline_offset; + + } + + $this->SetCenter(0,0); + $this->SetAngle($olda); + + $h=$this->text_halign; + $v=$this->text_valign; + if( $this->text_halign == 'center') { + $this->SetTextAlign('center','basepoint'); + } + else { + $this->SetTextAlign('basepoint','basepoint'); + } + + $debug=false; + $this->StrokeText($x, $y, $txt, $dir, $paragraph_align,$debug); + + $bb = array($x-$xmarg, $y+$height-$ymarg, + $x+$width, $y+$height-$ymarg, + $x+$width, $y-$ymarg, + $x-$xmarg, $y-$ymarg); + + $this->SetTextAlign($h,$v); + $this->SetAngle($olda); + + $this->lastx = $oldx; + $this->lasty = $oldy; + + return $bb; + } + + // Set text alignment + function SetTextAlign($halign,$valign="bottom") { + $this->text_halign=$halign; + $this->text_valign=$valign; + } + + function _StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$aDebug=false) { + + if( is_numeric($dir) && $dir!=90 && $dir!=0) + JpGraphError::RaiseL(25091);//(" Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead."); + + $h=$this->GetTextHeight($txt); + $fh=$this->GetFontHeight(); + $w=$this->GetTextWidth($txt); + + if( $this->text_halign=="right") { + $x -= $dir==0 ? $w : $h; + } + elseif( $this->text_halign=="center" ) { + // For center we subtract 1 pixel since this makes the middle + // be prefectly in the middle + $x -= $dir==0 ? $w/2-1 : $h/2; + } + if( $this->text_valign=="top" ) { + $y += $dir==0 ? $h : $w; + } + elseif( $this->text_valign=="center" ) { + $y += $dir==0 ? $h/2 : $w/2; + } + + $use_font = $this->font_family; + + if( $dir==90 ) { + imagestringup($this->img,$use_font,$x,$y,$txt,$this->current_color); + $aBoundingBox = array(round($x),round($y),round($x),round($y-$w),round($x+$h),round($y-$w),round($x+$h),round($y)); + if( $aDebug ) { + // Draw bounding box + $this->PushColor('green'); + $this->Polygon($aBoundingBox,true); + $this->PopColor(); + } + } + else { + if( preg_match('/\n/',$txt) ) { + $tmp = preg_split('/\n/',$txt); + for($i=0; $i < count($tmp); ++$i) { + $w1 = $this->GetTextWidth($tmp[$i]); + if( $paragraph_align=="left" ) { + imagestring($this->img,$use_font,$x,$y-$h+1+$i*$fh,$tmp[$i],$this->current_color); + } + elseif( $paragraph_align=="right" ) { + imagestring($this->img,$use_font,$x+($w-$w1),$y-$h+1+$i*$fh,$tmp[$i],$this->current_color); + } + else { + imagestring($this->img,$use_font,$x+$w/2-$w1/2,$y-$h+1+$i*$fh,$tmp[$i],$this->current_color); + } + } + } + else { + //Put the text + imagestring($this->img,$use_font,$x,$y-$h+1,$txt,$this->current_color); + } + if( $aDebug ) { + // Draw the bounding rectangle and the bounding box + $p1 = array(round($x),round($y),round($x),round($y-$h),round($x+$w),round($y-$h),round($x+$w),round($y)); + + // Draw bounding box + $this->PushColor('green'); + $this->Polygon($p1,true); + $this->PopColor(); + + } + $aBoundingBox=array(round($x),round($y),round($x),round($y-$h),round($x+$w),round($y-$h),round($x+$w),round($y)); + } + } + + function AddTxtCR($aTxt) { + // If the user has just specified a '\n' + // instead of '\n\t' we have to add '\r' since + // the width will be too muchy otherwise since when + // we print we stroke the individually lines by hand. + $e = explode("\n",$aTxt); + $n = count($e); + for($i=0; $i<$n; ++$i) { + $e[$i]=str_replace("\r","",$e[$i]); + } + return implode("\n\r",$e); + } + + function NormAngle($a) { + // Normalize angle in degrees + // Normalize angle to be between 0-360 + while( $a > 360 ) + $a -= 360; + while( $a < -360 ) + $a += 360; + if( $a < 0 ) + $a = 360 + $a; + return $a; + } + + function imagettfbbox_fixed($size, $angle, $fontfile, $text) { + + + if( ! USE_LIBRARY_IMAGETTFBBOX ) { + + $bbox = @imagettfbbox($size, $angle, $fontfile, $text); + if( $bbox === false ) { + JpGraphError::RaiseL(25092,$this->font_file); + //("There is either a configuration problem with TrueType or a problem reading font file (".$this->font_file."). Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try uppgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library."); + } + $this->bbox_cache = $bbox; + return $bbox; + } + + // The built in imagettfbbox is buggy for angles != 0 so + // we calculate this manually by getting the bounding box at + // angle = 0 and then rotate the bounding box manually + $bbox = @imagettfbbox($size, 0, $fontfile, $text); + if( $bbox === false ) { + JpGraphError::RaiseL(25092,$this->font_file); + //("There is either a configuration problem with TrueType or a problem reading font file (".$this->font_file."). Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try uppgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library."); + } + + $angle = $this->NormAngle($angle); + + $a = $angle*M_PI/180; + $ca = cos($a); + $sa = sin($a); + $ret = array(); + + // We always add 1 pixel to the left since the left edge of the bounding + // box is sometimes coinciding with the first pixel of the text + //$bbox[0] -= 1; + //$bbox[6] -= 1; + + // For roatated text we need to add extra width for rotated + // text since the kerning and stroking of the TTF is not the same as for + // text at a 0 degree angle + + if( $angle > 0.001 && abs($angle-360) > 0.001 ) { + $h = abs($bbox[7]-$bbox[1]); + $w = abs($bbox[2]-$bbox[0]); + + $bbox[0] -= 2; + $bbox[6] -= 2; + // The width is underestimated so compensate for that + $bbox[2] += round($w*0.06); + $bbox[4] += round($w*0.06); + + // and we also need to compensate with increased height + $bbox[5] -= round($h*0.1); + $bbox[7] -= round($h*0.1); + + if( $angle > 90 ) { + // For angles > 90 we also need to extend the height further down + // by the baseline since that is also one more problem + $bbox[1] += round($h*0.15); + $bbox[3] += round($h*0.15); + + // and also make it slighty less height + $bbox[7] += round($h*0.05); + $bbox[5] += round($h*0.05); + + // And we need to move the box slightly top the rright (from a tetx perspective) + $bbox[0] += round($w*0.02); + $bbox[6] += round($w*0.02); + + if( $angle > 180 ) { + // And we need to move the box slightly to the left (from a text perspective) + $bbox[0] -= round($w*0.02); + $bbox[6] -= round($w*0.02); + $bbox[2] -= round($w*0.02); + $bbox[4] -= round($w*0.02); + + } + + } + for($i = 0; $i < 7; $i += 2) { + $ret[$i] = round($bbox[$i] * $ca + $bbox[$i+1] * $sa); + $ret[$i+1] = round($bbox[$i+1] * $ca - $bbox[$i] * $sa); + } + $this->bbox_cache = $ret; + return $ret; + } + else { + $this->bbox_cache = $bbox; + return $bbox; + } + } + + // Deprecated + function GetTTFBBox($aTxt,$aAngle=0) { + $bbox = $this->imagettfbbox_fixed($this->font_size,$aAngle,$this->font_file,$aTxt); + return $bbox; + } + + function GetBBoxTTF($aTxt,$aAngle=0) { + // Normalize the bounding box to become a minimum + // enscribing rectangle + + $aTxt = $this->AddTxtCR($aTxt); + + if( !is_readable($this->font_file) ) { + JpGraphError::RaiseL(25093,$this->font_file); + //('Can not read font file ('.$this->font_file.') in call to Image::GetBBoxTTF. Please make sure that you have set a font before calling this method and that the font is installed in the TTF directory.'); + } + $bbox = $this->imagettfbbox_fixed($this->font_size,$aAngle,$this->font_file,$aTxt); + + if( $aAngle==0 ) return $bbox; + + if( $aAngle >= 0 ) { + if( $aAngle <= 90 ) { //<=0 + $bbox = array($bbox[6],$bbox[1],$bbox[2],$bbox[1], + $bbox[2],$bbox[5],$bbox[6],$bbox[5]); + } + elseif( $aAngle <= 180 ) { //<= 2 + $bbox = array($bbox[4],$bbox[7],$bbox[0],$bbox[7], + $bbox[0],$bbox[3],$bbox[4],$bbox[3]); + } + elseif( $aAngle <= 270 ) { //<= 3 + $bbox = array($bbox[2],$bbox[5],$bbox[6],$bbox[5], + $bbox[6],$bbox[1],$bbox[2],$bbox[1]); + } + else { + $bbox = array($bbox[0],$bbox[3],$bbox[4],$bbox[3], + $bbox[4],$bbox[7],$bbox[0],$bbox[7]); + } + } + elseif( $aAngle < 0 ) { + if( $aAngle <= -270 ) { // <= -3 + $bbox = array($bbox[6],$bbox[1],$bbox[2],$bbox[1], + $bbox[2],$bbox[5],$bbox[6],$bbox[5]); + } + elseif( $aAngle <= -180 ) { // <= -2 + $bbox = array($bbox[0],$bbox[3],$bbox[4],$bbox[3], + $bbox[4],$bbox[7],$bbox[0],$bbox[7]); + } + elseif( $aAngle <= -90 ) { // <= -1 + $bbox = array($bbox[2],$bbox[5],$bbox[6],$bbox[5], + $bbox[6],$bbox[1],$bbox[2],$bbox[1]); + } + else { + $bbox = array($bbox[0],$bbox[3],$bbox[4],$bbox[3], + $bbox[4],$bbox[7],$bbox[0],$bbox[7]); + } + } + return $bbox; + } + + function GetBBoxHeight($aTxt,$aAngle=0) { + $box = $this->GetBBoxTTF($aTxt,$aAngle); + return abs($box[7]-$box[1]); + } + + function GetBBoxWidth($aTxt,$aAngle=0) { + $box = $this->GetBBoxTTF($aTxt,$aAngle); + return $box[2]-$box[0]+1; + } + + + function _StrokeTTF($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$debug=false) { + + // Setup default inter line margin for paragraphs to be + // 3% of the font height. + $ConstLineSpacing = 0.03 ; + + // Remember the anchor point before adjustment + if( $debug ) { + $ox=$x; + $oy=$y; + } + + if( !preg_match('/\n/',$txt) || ($dir>0 && preg_match('/\n/',$txt)) ) { + // Format a single line + + $txt = $this->AddTxtCR($txt); + $bbox=$this->GetBBoxTTF($txt,$dir); + $width = $this->GetBBoxWidth($txt,$dir); + $height = $this->GetBBoxHeight($txt,$dir); + + // The special alignment "basepoint" is mostly used internally + // in the library. This will put the anchor position at the left + // basepoint of the tetx. This is the default anchor point for + // TTF text. + + if( $this->text_valign != 'basepoint' ) { + // Align x,y ot lower left corner of bbox + + + if( $this->text_halign=='right' ) { + $x -= $width; + $x -= $bbox[0]; + } + elseif( $this->text_halign=='center' ) { + $x -= $width/2; + $x -= $bbox[0]; + } + elseif( $this->text_halign=='baseline' ) { + // This is only support for text at 90 degree !! + // Do nothing the text is drawn at baseline by default + } + + if( $this->text_valign=='top' ) { + $y -= $bbox[1]; // Adjust to bottom of text + $y += $height; + } + elseif( $this->text_valign=='center' ) { + $y -= $bbox[1]; // Adjust to bottom of text + $y += $height/2; + } + elseif( $this->text_valign=='baseline' ) { + // This is only support for text at 0 degree !! + // Do nothing the text is drawn at baseline by default + } + } + ImageTTFText ($this->img, $this->font_size, $dir, $x, $y, + $this->current_color,$this->font_file,$txt); + + // Calculate and return the co-ordinates for the bounding box + $box = $this->imagettfbbox_fixed($this->font_size,$dir,$this->font_file,$txt); + $p1 = array(); + + for($i=0; $i < 4; ++$i) { + $p1[] = round($box[$i*2]+$x); + $p1[] = round($box[$i*2+1]+$y); + } + $aBoundingBox = $p1; + + // Debugging code to highlight the bonding box and bounding rectangle + // For text at 0 degrees the bounding box and bounding rectangle are the + // same + if( $debug ) { + // Draw the bounding rectangle and the bounding box + + $p = array(); + $p1 = array(); + + for($i=0; $i < 4; ++$i) { + $p[] = $bbox[$i*2]+$x ; + $p[] = $bbox[$i*2+1]+$y; + $p1[] = $box[$i*2]+$x ; + $p1[] = $box[$i*2+1]+$y ; + } + + // Draw bounding box + $this->PushColor('green'); + $this->Polygon($p1,true); + $this->PopColor(); + + // Draw bounding rectangle + $this->PushColor('darkgreen'); + $this->Polygon($p,true); + $this->PopColor(); + + // Draw a cross at the anchor point + $this->PushColor('red'); + $this->Line($ox-15,$oy,$ox+15,$oy); + $this->Line($ox,$oy-15,$ox,$oy+15); + $this->PopColor(); + } + } + else { + // Format a text paragraph + $fh=$this->GetFontHeight(); + + // Line margin is 25% of font height + $linemargin=round($fh*$ConstLineSpacing); + $fh += $linemargin; + $w=$this->GetTextWidth($txt); + + $y -= $linemargin/2; + $tmp = preg_split('/\n/',$txt); + $nl = count($tmp); + $h = $nl * $fh; + + if( $this->text_halign=='right') { + $x -= $dir==0 ? $w : $h; + } + elseif( $this->text_halign=='center' ) { + $x -= $dir==0 ? $w/2 : $h/2; + } + + if( $this->text_valign=='top' ) { + $y += $dir==0 ? $h : $w; + } + elseif( $this->text_valign=='center' ) { + $y += $dir==0 ? $h/2 : $w/2; + } + + // Here comes a tricky bit. + // Since we have to give the position for the string at the + // baseline this means thaht text will move slightly up + // and down depending on any of it's character descend below + // the baseline, for example a 'g'. To adjust the Y-position + // we therefore adjust the text with the baseline Y-offset + // as used for the current font and size. This will keep the + // baseline at a fixed positoned disregarding the actual + // characters in the string. + $standardbox = $this->GetTTFBBox('Gg',$dir); + $yadj = $standardbox[1]; + $xadj = $standardbox[0]; + $aBoundingBox = array(); + for($i=0; $i < $nl; ++$i) { + $wl = $this->GetTextWidth($tmp[$i]); + $bbox = $this->GetTTFBBox($tmp[$i],$dir); + if( $paragraph_align=='left' ) { + $xl = $x; + } + elseif( $paragraph_align=='right' ) { + $xl = $x + ($w-$wl); + } + else { + // Center + $xl = $x + $w/2 - $wl/2 ; + } + + // In theory we should adjust with full pre-lead to get the lines + // lined up but this doesn't look good so therfore we only adjust with + // half th pre-lead + $xl -= $bbox[0]/2; + $yl = $y - $yadj; + //$xl = $xl- $xadj; + ImageTTFText($this->img, $this->font_size, $dir, $xl, $yl-($h-$fh)+$fh*$i, + $this->current_color,$this->font_file,$tmp[$i]); + + // echo "xl=$xl,".$tmp[$i]."
"; + if( $debug ) { + // Draw the bounding rectangle around each line + $box=@ImageTTFBBox($this->font_size,$dir,$this->font_file,$tmp[$i]); + $p = array(); + for($j=0; $j < 4; ++$j) { + $p[] = $bbox[$j*2]+$xl; + $p[] = $bbox[$j*2+1]+$yl-($h-$fh)+$fh*$i; + } + + // Draw bounding rectangle + $this->PushColor('darkgreen'); + $this->Polygon($p,true); + $this->PopColor(); + } + } + + // Get the bounding box + $bbox = $this->GetBBoxTTF($txt,$dir); + for($j=0; $j < 4; ++$j) { + $bbox[$j*2]+= round($x); + $bbox[$j*2+1]+= round($y - ($h-$fh) - $yadj); + } + $aBoundingBox = $bbox; + + if( $debug ) { + // Draw a cross at the anchor point + $this->PushColor('red'); + $this->Line($ox-25,$oy,$ox+25,$oy); + $this->Line($ox,$oy-25,$ox,$oy+25); + $this->PopColor(); + } + + } + } + + function StrokeText($x,$y,$txt,$dir=0,$paragraph_align="left",$debug=false) { + + $x = round($x); + $y = round($y); + + // Do special language encoding + $txt = $this->langconv->Convert($txt,$this->font_family); + + if( !is_numeric($dir) ) { + JpGraphError::RaiseL(25094);//(" Direction for text most be given as an angle between 0 and 90."); + } + + if( $this->font_family >= FF_FONT0 && $this->font_family <= FF_FONT2+1) { + $this->_StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,$boundingbox,$debug); + } + elseif( $this->font_family >= _FIRST_FONT && $this->font_family <= _LAST_FONT) { + $this->_StrokeTTF($x,$y,$txt,$dir,$paragraph_align,$boundingbox,$debug); + } + else { + JpGraphError::RaiseL(25095);//(" Unknown font font family specification. "); + } + return $boundingbox; + } + + function SetMargin($lm,$rm,$tm,$bm) { + + $this->left_margin=$lm; + $this->right_margin=$rm; + $this->top_margin=$tm; + $this->bottom_margin=$bm; + + $this->plotwidth = $this->width - $this->left_margin - $this->right_margin; + $this->plotheight = $this->height - $this->top_margin - $this->bottom_margin; + + if( $this->width > 0 && $this->height > 0 ) { + if( $this->plotwidth < 0 || $this->plotheight < 0 ) { + JpGraphError::RaiseL(25130, $this->plotwidth, $this->plotheight); + //JpGraphError::raise("To small plot area. ($lm,$rm,$tm,$bm : $this->plotwidth x $this->plotheight). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins."); + } + } + } + + function SetTransparent($color) { + imagecolortransparent ($this->img,$this->rgb->allocate($color)); + } + + function SetColor($color,$aAlpha=0) { + $this->current_color_name = $color; + $this->current_color=$this->rgb->allocate($color,$aAlpha); + if( $this->current_color == -1 ) { + $tc=imagecolorstotal($this->img); + JpGraphError::RaiseL(25096); + //("Can't allocate any more colors. Image has already allocated maximum of $tc colors. This might happen if you have anti-aliasing turned on together with a background image or perhaps gradient fill since this requires many, many colors. Try to turn off anti-aliasing. If there is still a problem try downgrading the quality of the background image to use a smaller pallete to leave some entries for your graphs. You should try to limit the number of colors in your background image to 64. If there is still problem set the constant DEFINE(\"USE_APPROX_COLORS\",true); in jpgraph.php This will use approximative colors when the palette is full. Unfortunately there is not much JpGraph can do about this since the palette size is a limitation of current graphic format and what the underlying GD library suppports."); + } + return $this->current_color; + } + + function PushColor($color) { + if( $color != "" ) { + $this->colorstack[$this->colorstackidx]=$this->current_color_name; + $this->colorstack[$this->colorstackidx+1]=$this->current_color; + $this->colorstackidx+=2; + $this->SetColor($color); + } + else { + JpGraphError::RaiseL(25097);//("Color specified as empty string in PushColor()."); + } + } + + function PopColor() { + if( $this->colorstackidx < 1 ) { + JpGraphError::RaiseL(25098);//(" Negative Color stack index. Unmatched call to PopColor()"); + } + $this->current_color=$this->colorstack[--$this->colorstackidx]; + $this->current_color_name=$this->colorstack[--$this->colorstackidx]; + } + + + function SetLineWeight($weight) { + $old = $this->line_weight; + imagesetthickness($this->img,$weight); + $this->line_weight = $weight; + return $old; + } + + function SetStartPoint($x,$y) { + $this->lastx=round($x); + $this->lasty=round($y); + } + + function Arc($cx,$cy,$w,$h,$s,$e) { + // GD Arc doesn't like negative angles + while( $s < 0) $s += 360; + while( $e < 0) $e += 360; + imagearc($this->img,round($cx),round($cy),round($w),round($h),$s,$e,$this->current_color); + } + + function FilledArc($xc,$yc,$w,$h,$s,$e,$style='') { + $s = round($s); + $e = round($e); + while( $s < 0 ) $s += 360; + while( $e < 0 ) $e += 360; + if( $style=='' ) + $style=IMG_ARC_PIE; + if( abs($s-$e) > 0 ) { + imagefilledarc($this->img,round($xc),round($yc),round($w),round($h),$s,$e,$this->current_color,$style); +// $this->DrawImageSmoothArc($this->img,round($xc),round($yc),round($w),round($h),$s,$e,$this->current_color,$style); + } + } + + function FilledCakeSlice($cx,$cy,$w,$h,$s,$e) { + $this->CakeSlice($cx,$cy,$w,$h,$s,$e,$this->current_color_name); + } + + function CakeSlice($xc,$yc,$w,$h,$s,$e,$fillcolor="",$arccolor="") { + $s = round($s); $e = round($e); + $w = round($w); $h = round($h); + $xc = round($xc); $yc = round($yc); + if( $s == $e ) { + // A full circle. We draw this a plain circle + $this->PushColor($fillcolor); + imagefilledellipse($this->img,$xc,$yc,2*$w,2*$h,$this->current_color); + + // If antialiasing is used then we often don't have any color no the surrounding + // arc. So, we need to check for this special case so we don't send an empty + // color to the push function. In this case we use the fill color for the arc as well + if( $arccolor != '' ) { + $this->PopColor(); + $this->PushColor($arccolor); + } + imageellipse($this->img,$xc,$yc,2*$w,2*$h,$this->current_color); + $this->Line($xc,$yc,cos($s*M_PI/180)*$w+$xc,$yc+sin($s*M_PI/180)*$h); + $this->PopColor(); + } + else { + $this->PushColor($fillcolor); + $this->FilledArc($xc,$yc,2*$w,2*$h,$s,$e); + $this->PopColor(); + if( $arccolor != "" ) { + $this->PushColor($arccolor); + // We add 2 pixels to make the Arc() better aligned with + // the filled arc. + imagefilledarc($this->img,$xc,$yc,2*$w,2*$h,$s,$e,$this->current_color,IMG_ARC_NOFILL | IMG_ARC_EDGED ) ; + $this->PopColor(); + } + } + } + + function Ellipse($xc,$yc,$w,$h) { + $this->Arc($xc,$yc,$w,$h,0,360); + } + + function Circle($xc,$yc,$r) { + imageellipse($this->img,round($xc),round($yc),$r*2,$r*2,$this->current_color); +// $this->DrawImageSmoothArc($this->img,round($xc),round($yc),$r*2+1,$r*2+1,0,360,$this->current_color); +// $this->imageSmoothCircle($this->img, round($xc),round($yc), $r*2+1, $this->current_color); + } + + function FilledCircle($xc,$yc,$r) { + imagefilledellipse($this->img,round($xc),round($yc),2*$r,2*$r,$this->current_color); +// $this->DrawImageSmoothArc($this->img, round($xc), round($yc), 2*$r, 2*$r, 0, 360, $this->current_color); + } + + // Linear Color InterPolation + function lip($f,$t,$p) { + $p = round($p,1); + $r = $f[0] + ($t[0]-$f[0])*$p; + $g = $f[1] + ($t[1]-$f[1])*$p; + $b = $f[2] + ($t[2]-$f[2])*$p; + return array($r,$g,$b); + } + + // Set line style dashed, dotted etc + function SetLineStyle($s) { + if( is_numeric($s) ) { + if( $s<1 || $s>4 ) { + JpGraphError::RaiseL(25101,$s);//(" Illegal numeric argument to SetLineStyle(): ($s)"); + } + } + elseif( is_string($s) ) { + if( $s == "solid" ) $s=1; + elseif( $s == "dotted" ) $s=2; + elseif( $s == "dashed" ) $s=3; + elseif( $s == "longdashed" ) $s=4; + else { + JpGraphError::RaiseL(25102,$s);//(" Illegal string argument to SetLineStyle(): $s"); + } + } + else { + JpGraphError::RaiseL(25103,$s);//(" Illegal argument to SetLineStyle $s"); + } + $old = $this->line_style; + $this->line_style=$s; + return $old; + } + + // Same as Line but take the line_style into account + function StyleLine($x1,$y1,$x2,$y2,$aStyle='', $from_grid_class = false) { + if( $this->line_weight <= 0 ) return; + + if( $aStyle === '' ) { + $aStyle = $this->line_style; + } + + $dashed_line_method = 'DashedLine'; + if ($from_grid_class) { + $dashed_line_method = 'DashedLineForGrid'; + } + + // Add error check since dashed line will only work if anti-alias is disabled + // this is a limitation in GD + + if( $aStyle == 1 ) { + // Solid style. We can handle anti-aliasing for this + $this->Line($x1,$y1,$x2,$y2); + } + else { + // Since the GD routines doesn't handle AA for styled line + // we have no option than to turn it off to get any lines at + // all if the weight > 1 + $oldaa = $this->GetAntiAliasing(); + if( $oldaa && $this->line_weight > 1 ) { + $this->SetAntiAliasing(false); + } + + switch( $aStyle ) { + case 2: // Dotted + $this->$dashed_line_method($x1,$y1,$x2,$y2,2,6); + break; + case 3: // Dashed + $this->$dashed_line_method($x1,$y1,$x2,$y2,5,9); + break; + case 4: // Longdashes + $this->$dashed_line_method($x1,$y1,$x2,$y2,9,13); + break; + default: + JpGraphError::RaiseL(25104,$this->line_style);//(" Unknown line style: $this->line_style "); + break; + } + if( $oldaa ) { + $this->SetAntiAliasing(true); + } + } + } + + function DashedLine($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) { + + if( $this->line_weight <= 0 ) return; + + // Add error check to make sure anti-alias is not enabled. + // Dashed line does not work with anti-alias enabled. This + // is a limitation in GD. + if( $this->use_anti_aliasing ) { +// JpGraphError::RaiseL(25129); // Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines. + } + + $x1 = round($x1); + $x2 = round($x2); + $y1 = round($y1); + $y2 = round($y2); + + $dash_length *= SUPERSAMPLING_SCALE; + $dash_space *= SUPERSAMPLING_SCALE; + + $style = array_fill(0,$dash_length,$this->current_color); + $style = array_pad($style,$dash_space,IMG_COLOR_TRANSPARENT); + imagesetstyle($this->img, $style); + imageline($this->img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); + + $this->lastx = $x2; + $this->lasty = $y2; + } + + function DashedLineForGrid($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) { + + if( $this->line_weight <= 0 ) return; + + // Add error check to make sure anti-alias is not enabled. + // Dashed line does not work with anti-alias enabled. This + // is a limitation in GD. + if( $this->use_anti_aliasing ) { +// JpGraphError::RaiseL(25129); // Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines. + } + + $x1 = round($x1); + $x2 = round($x2); + $y1 = round($y1); + $y2 = round($y2); + + /* + $dash_length *= $this->scale; + $dash_space *= $this->scale; + */ + + $dash_length = 2; + $dash_length = 4; + imagesetthickness($this->img, 1); + $style = array_fill(0,$dash_length, $this->current_color); //hexdec('CCCCCC')); + $style = array_pad($style,$dash_space,IMG_COLOR_TRANSPARENT); + imagesetstyle($this->img, $style); + imageline($this->img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); + + $this->lastx = $x2; + $this->lasty = $y2; + } + + function Line($x1,$y1,$x2,$y2) { + + if( $this->line_weight <= 0 ) return; + + $x1 = round($x1); + $x2 = round($x2); + $y1 = round($y1); + $y2 = round($y2); + + imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color); +// $this->DrawLine($this->img, $x1, $y1, $x2, $y2, $this->line_weight, $this->current_color); + $this->lastx=$x2; + $this->lasty=$y2; + } + + function Polygon($p,$closed=FALSE,$fast=FALSE) { + + if( $this->line_weight <= 0 ) return; + + $n=count($p); + $oldx = $p[0]; + $oldy = $p[1]; + if( $fast ) { + for( $i=2; $i < $n; $i+=2 ) { + imageline($this->img,$oldx,$oldy,$p[$i],$p[$i+1],$this->current_color); + $oldx = $p[$i]; + $oldy = $p[$i+1]; + } + if( $closed ) { + imageline($this->img,$p[$n*2-2],$p[$n*2-1],$p[0],$p[1],$this->current_color); + } + } + else { + for( $i=2; $i < $n; $i+=2 ) { + $this->StyleLine($oldx,$oldy,$p[$i],$p[$i+1]); + $oldx = $p[$i]; + $oldy = $p[$i+1]; + } + if( $closed ) { + $this->StyleLine($oldx,$oldy,$p[0],$p[1]); + } + } + } + + function FilledPolygon($pts) { + $n=count($pts); + if( $n == 0 ) { + JpGraphError::RaiseL(25105);//('NULL data specified for a filled polygon. Check that your data is not NULL.'); + } + for($i=0; $i < $n; ++$i) { + $pts[$i] = round($pts[$i]); + } + $old = $this->line_weight; + imagesetthickness($this->img,1); + imagefilledpolygon($this->img,$pts,count($pts)/2,$this->current_color); + $this->line_weight = $old; + imagesetthickness($this->img,$old); + } + + function Rectangle($xl,$yu,$xr,$yl) { + $this->Polygon(array($xl,$yu,$xr,$yu,$xr,$yl,$xl,$yl,$xl,$yu)); + } + + function FilledRectangle($xl,$yu,$xr,$yl) { + $this->FilledPolygon(array($xl,$yu,$xr,$yu,$xr,$yl,$xl,$yl)); + } + + function FilledRectangle2($xl,$yu,$xr,$yl,$color1,$color2,$style=1) { + // Fill a rectangle with lines of two colors + if( $style===1 ) { + // Horizontal stripe + if( $yl < $yu ) { + $t = $yl; $yl=$yu; $yu=$t; + } + for( $y=$yu; $y <= $yl; ++$y) { + $this->SetColor($color1); + $this->Line($xl,$y,$xr,$y); + ++$y; + $this->SetColor($color2); + $this->Line($xl,$y,$xr,$y); + } + } + else { + if( $xl < $xl ) { + $t = $xl; $xl=$xr; $xr=$t; + } + for( $x=$xl; $x <= $xr; ++$x) { + $this->SetColor($color1); + $this->Line($x,$yu,$x,$yl); + ++$x; + $this->SetColor($color2); + $this->Line($x,$yu,$x,$yl); + } + } + } + + function ShadowRectangle($xl,$yu,$xr,$yl,$fcolor=false,$shadow_width=4,$shadow_color='darkgray',$useAlpha=true) { + // This is complicated by the fact that we must also handle the case where + // the reactangle has no fill color + $xl = floor($xl); + $yu = floor($yu); + $xr = floor($xr); + $yl = floor($yl); + $this->PushColor($shadow_color); + $shadowAlpha=0; + $this->SetLineWeight(1); + $this->SetLineStyle('solid'); + $basecolor = $this->rgb->Color($shadow_color); + $shadow_color = array($basecolor[0],$basecolor[1],$basecolor[2],); + for( $i=0; $i < $shadow_width; ++$i ) { + $this->SetColor($shadow_color,$shadowAlpha); + $this->Line($xr-$shadow_width+$i, $yu+$shadow_width, + $xr-$shadow_width+$i, $yl-$shadow_width-1+$i); + $this->Line($xl+$shadow_width, $yl-$shadow_width+$i, + $xr-$shadow_width+$i, $yl-$shadow_width+$i); + if( $useAlpha ) $shadowAlpha += 1.0/$shadow_width; + } + + $this->PopColor(); + if( $fcolor==false ) { + $this->Rectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1); + } + else { + $this->PushColor($fcolor); + $this->FilledRectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1); + $this->PopColor(); + $this->Rectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1); + } + } + + function FilledRoundedRectangle($xt,$yt,$xr,$yl,$r=5) { + if( $r==0 ) { + $this->FilledRectangle($xt,$yt,$xr,$yl); + return; + } + + // To avoid overlapping fillings (which will look strange + // when alphablending is enabled) we have no choice but + // to fill the five distinct areas one by one. + + // Center square + $this->FilledRectangle($xt+$r,$yt+$r,$xr-$r,$yl-$r); + // Top band + $this->FilledRectangle($xt+$r,$yt,$xr-$r,$yt+$r); + // Bottom band + $this->FilledRectangle($xt+$r,$yl-$r,$xr-$r,$yl); + // Left band + $this->FilledRectangle($xt,$yt+$r,$xt+$r,$yl-$r); + // Right band + $this->FilledRectangle($xr-$r,$yt+$r,$xr,$yl-$r); + + // Topleft & Topright arc + $this->FilledArc($xt+$r,$yt+$r,$r*2,$r*2,180,270); + $this->FilledArc($xr-$r,$yt+$r,$r*2,$r*2,270,360); + + // Bottomleft & Bottom right arc + $this->FilledArc($xt+$r,$yl-$r,$r*2,$r*2,90,180); + $this->FilledArc($xr-$r,$yl-$r,$r*2,$r*2,0,90); + + } + + function RoundedRectangle($xt,$yt,$xr,$yl,$r=5) { + + if( $r==0 ) { + $this->Rectangle($xt,$yt,$xr,$yl); + return; + } + + // Top & Bottom line + $this->Line($xt+$r,$yt,$xr-$r,$yt); + $this->Line($xt+$r,$yl,$xr-$r,$yl); + + // Left & Right line + $this->Line($xt,$yt+$r,$xt,$yl-$r); + $this->Line($xr,$yt+$r,$xr,$yl-$r); + + // Topleft & Topright arc + $this->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); + $this->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); + + // Bottomleft & Bottomright arc + $this->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); + $this->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); + } + + function FilledBevel($x1,$y1,$x2,$y2,$depth=2,$color1='white@0.4',$color2='darkgray@0.4') { + $this->FilledRectangle($x1,$y1,$x2,$y2); + $this->Bevel($x1,$y1,$x2,$y2,$depth,$color1,$color2); + } + + function Bevel($x1,$y1,$x2,$y2,$depth=2,$color1='white@0.4',$color2='black@0.5') { + $this->PushColor($color1); + for( $i=0; $i < $depth; ++$i ) { + $this->Line($x1+$i,$y1+$i,$x1+$i,$y2-$i); + $this->Line($x1+$i,$y1+$i,$x2-$i,$y1+$i); + } + $this->PopColor(); + + $this->PushColor($color2); + for( $i=0; $i < $depth; ++$i ) { + $this->Line($x1+$i,$y2-$i,$x2-$i,$y2-$i); + $this->Line($x2-$i,$y1+$i,$x2-$i,$y2-$i-1); + } + $this->PopColor(); + } + + function StyleLineTo($x,$y) { + $this->StyleLine($this->lastx,$this->lasty,$x,$y); + $this->lastx=$x; + $this->lasty=$y; + } + + function LineTo($x,$y) { + $this->Line($this->lastx,$this->lasty,$x,$y); + $this->lastx=$x; + $this->lasty=$y; + } + + function Point($x,$y) { + imagesetpixel($this->img,round($x),round($y),$this->current_color); + } + + function Fill($x,$y) { + imagefill($this->img,round($x),round($y),$this->current_color); + } + + function FillToBorder($x,$y,$aBordColor) { + $bc = $this->rgb->allocate($aBordColor); + if( $bc == -1 ) { + JpGraphError::RaiseL(25106);//('Image::FillToBorder : Can not allocate more colors'); + } + imagefilltoborder($this->img,round($x),round($y),$bc,$this->current_color); + } + + function SetExpired($aFlg=true) { + $this->expired = $aFlg; + } + + // Generate image header + function Headers() { + + // In case we are running from the command line with the client version of + // PHP we can't send any headers. + $sapi = php_sapi_name(); + if( $sapi == 'cli' ) return; + + // These parameters are set by headers_sent() but they might cause + // an undefined variable error unless they are initilized + $file=''; + $lineno=''; + if( headers_sent($file,$lineno) ) { + $file=basename($file); + $t = new ErrMsgText(); + $msg = $t->Get(10,$file,$lineno); + die($msg); + } + + if ($this->expired) { + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); + header("Cache-Control: no-cache, must-revalidate"); + header("Pragma: no-cache"); + } + header("Content-type: image/$this->img_format"); + } + + // Adjust image quality for formats that allow this + function SetQuality($q) { + $this->quality = $q; + } + + // Stream image to browser or to file + function Stream($aFile="") { + $this->DoSupersampling(); + + $func="image".$this->img_format; + if( $this->img_format=="jpeg" && $this->quality != null ) { + $res = @$func($this->img,$aFile,$this->quality); + } + else { + if( $aFile != "" ) { + $res = @$func($this->img,$aFile); + if( !$res ) { + JpGraphError::RaiseL(25107,$aFile);//("Can't write to file '$aFile'. Check that the process running PHP has enough permission."); + } + } + else { + $res = @$func($this->img); + if( !$res ) { + JpGraphError::RaiseL(25108);//("Can't stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP."); + } + + } + } + } + + // Do SuperSampling using $scale + function DoSupersampling() { + if (SUPERSAMPLING_SCALE <= 1) { + return $this->img; + } + + $dst_img = @imagecreatetruecolor($this->original_width, $this->original_height); + imagecopyresampled($dst_img, $this->img, 0, 0, 0, 0, $this->original_width, $this->original_height, $this->width, $this->height); + $this->Destroy(); + return $this->img = $dst_img; + } + + // Clear resources used by image (this is normally not used since all resources are/should be + // returned when the script terminates + function Destroy() { + imagedestroy($this->img); + } + + // Specify image format. Note depending on your installation + // of PHP not all formats may be supported. + function SetImgFormat($aFormat,$aQuality=75) { + $this->quality = $aQuality; + $aFormat = strtolower($aFormat); + $tst = true; + $supported = imagetypes(); + if( $aFormat=="auto" ) { + if( $supported & IMG_PNG ) $this->img_format="png"; + elseif( $supported & IMG_JPG ) $this->img_format="jpeg"; + elseif( $supported & IMG_GIF ) $this->img_format="gif"; + elseif( $supported & IMG_WBMP ) $this->img_format="wbmp"; + elseif( $supported & IMG_XPM ) $this->img_format="xpm"; + else { + JpGraphError::RaiseL(25109);//("Your PHP (and GD-lib) installation does not appear to support any known graphic formats. You need to first make sure GD is compiled as a module to PHP. If you also want to use JPEG images you must get the JPEG library. Please see the PHP docs for details."); + } + return true; + } + else { + if( $aFormat=="jpeg" || $aFormat=="png" || $aFormat=="gif" ) { + if( $aFormat=="jpeg" && !($supported & IMG_JPG) ) $tst=false; + elseif( $aFormat=="png" && !($supported & IMG_PNG) ) $tst=false; + elseif( $aFormat=="gif" && !($supported & IMG_GIF) ) $tst=false; + elseif( $aFormat=="wbmp" && !($supported & IMG_WBMP) ) $tst=false; + elseif( $aFormat=="xpm" && !($supported & IMG_XPM) ) $tst=false; + else { + $this->img_format=$aFormat; + return true; + } + } + else { + $tst=false; + } + if( !$tst ) { + JpGraphError::RaiseL(25110,$aFormat);//(" Your PHP installation does not support the chosen graphic format: $aFormat"); + } + } + } + + /** + * Draw Line + */ + function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color) { + if ($weight == 1) { + return imageline($im,$x1,$y1,$x2,$y2,$color); + } + + $angle=(atan2(($y1 - $y2), ($x2 - $x1))); + + $dist_x = $weight * (sin($angle)) / 2; + $dist_y = $weight * (cos($angle)) / 2; + + $p1x=ceil(($x1 + $dist_x)); + $p1y=ceil(($y1 + $dist_y)); + $p2x=ceil(($x2 + $dist_x)); + $p2y=ceil(($y2 + $dist_y)); + $p3x=ceil(($x2 - $dist_x)); + $p3y=ceil(($y2 - $dist_y)); + $p4x=ceil(($x1 - $dist_x)); + $p4y=ceil(($y1 - $dist_y)); + + $array=array($p1x,$p1y,$p2x,$p2y,$p3x,$p3y,$p4x,$p4y); + imagefilledpolygon ( $im, $array, (count($array)/2), $color ); + + // for antialias + imageline($im, $p1x, $p1y, $p2x, $p2y, $color); + imageline($im, $p3x, $p3y, $p4x, $p4y, $color); + return; + + + + return imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color); + $weight = 8; + if ($weight <= 1) { + return imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color); + } + + $pts = array(); + + $weight /= 2; + + if ($y2 - $y1 == 0) { + // x line + $pts = array(); + $pts[] = $x1; $pts[] = $y1 - $weight; + $pts[] = $x1; $pts[] = $y1 + $weight; + $pts[] = $x2; $pts[] = $y2 + $weight; + $pts[] = $x2; $pts[] = $y2 - $weight; + + } elseif ($x2 - $x1 == 0) { + // y line + $pts = array(); + $pts[] = $x1 - $weight; $pts[] = $y1; + $pts[] = $x1 + $weight; $pts[] = $y1; + $pts[] = $x2 + $weight; $pts[] = $y2; + $pts[] = $x2 - $weight; $pts[] = $y2; + + } else { + + var_dump($x1, $x2, $y1, $y2); + $length = sqrt(pow($x2 - $x1, 2) + pow($y2 - $y1, 2)); + var_dump($length);exit; + exit; + +/* + $lean = ($y2 - $y1) / ($x2 - $x1); + $lean2 = -1 / $lean; + $sin = $lean / ($y2 - $y1); + $cos = $lean / ($x2 - $x1); + + $pts[] = $x1 + (-$weight * $sin); $pts[] = $y1 + (-$weight * $cos); + $pts[] = $x1 + (+$weight * $sin); $pts[] = $y1 + (+$weight * $cos); + $pts[] = $x2 + (+$weight * $sin); $pts[] = $y2 + (+$weight * $cos); + $pts[] = $x2 + (-$weight * $sin); $pts[] = $y2 + (-$weight * $cos); +*/ + } + +//print_r($pts);exit; + if (count($pts)/2 < 3) { + return; + } + + imagesetthickness($im, 1); + imagefilledpolygon($im, $pts,count($pts)/2, $color); + + + $weight *= 2; + +// $this->DrawImageSmoothArc($im, $x1, $y1, $weight, $weight, 0, 360, $color); +// $this->DrawImageSmoothArc($im, $x2, $y2, $weight, $weight, 0, 360, $color); + } + + + function DrawImageSmoothArc($im, $xc, $yc, $w, $h, $s, $e, $color, $style = null) { + $tmp = $s; + $s = (360 - $e) / 180 * M_PI; + $e = (360 - $tmp) / 180 * M_PI; + return imageSmoothArc($im, round($xc), round($yc), round($w), round($h), $this->CreateColorForImageSmoothArc($color), $s, $e); + } + + function CreateColorForImageSmoothArc($color) { + $alpha = $color >> 24 & 0xFF; + $red = $color >> 16 & 0xFF; + $green = $color >> 8 & 0xFF; + $blue = $color & 0xFF; + +//var_dump($alpha, $red, $green, $blue);exit; + + return array($red, $green, $blue, $alpha); + } + + function imageSmoothCircle( &$img, $cx, $cy, $cr, $color ) { + $ir = $cr; + $ix = 0; + $iy = $ir; + $ig = 2 * $ir - 3; + $idgr = -6; + $idgd = 4 * $ir - 10; + $fill = imageColorExactAlpha( $img, $color[ 'R' ], $color[ 'G' ], $color[ 'B' ], 0 ); + imageLine( $img, $cx + $cr - 1, $cy, $cx, $cy, $fill ); + imageLine( $img, $cx - $cr + 1, $cy, $cx - 1, $cy, $fill ); + imageLine( $img, $cx, $cy + $cr - 1, $cx, $cy + 1, $fill ); + imageLine( $img, $cx, $cy - $cr + 1, $cx, $cy - 1, $fill ); + $draw = imageColorExactAlpha( $img, $color[ 'R' ], $color[ 'G' ], $color[ 'B' ], 42 ); + imageSetPixel( $img, $cx + $cr, $cy, $draw ); + imageSetPixel( $img, $cx - $cr, $cy, $draw ); + imageSetPixel( $img, $cx, $cy + $cr, $draw ); + imageSetPixel( $img, $cx, $cy - $cr, $draw ); + while ( $ix <= $iy - 2 ) { + if ( $ig < 0 ) { + $ig += $idgd; + $idgd -= 8; + $iy--; + } else { + $ig += $idgr; + $idgd -= 4; + } + $idgr -= 4; + $ix++; + imageLine( $img, $cx + $ix, $cy + $iy - 1, $cx + $ix, $cy + $ix, $fill ); + imageLine( $img, $cx + $ix, $cy - $iy + 1, $cx + $ix, $cy - $ix, $fill ); + imageLine( $img, $cx - $ix, $cy + $iy - 1, $cx - $ix, $cy + $ix, $fill ); + imageLine( $img, $cx - $ix, $cy - $iy + 1, $cx - $ix, $cy - $ix, $fill ); + imageLine( $img, $cx + $iy - 1, $cy + $ix, $cx + $ix, $cy + $ix, $fill ); + imageLine( $img, $cx + $iy - 1, $cy - $ix, $cx + $ix, $cy - $ix, $fill ); + imageLine( $img, $cx - $iy + 1, $cy + $ix, $cx - $ix, $cy + $ix, $fill ); + imageLine( $img, $cx - $iy + 1, $cy - $ix, $cx - $ix, $cy - $ix, $fill ); + $filled = 0; + for ( $xx = $ix - 0.45; $xx < $ix + 0.5; $xx += 0.2 ) { + for ( $yy = $iy - 0.45; $yy < $iy + 0.5; $yy += 0.2 ) { + if ( sqrt( pow( $xx, 2 ) + pow( $yy, 2 ) ) < $cr ) $filled += 4; + } + } + $draw = imageColorExactAlpha( $img, $color[ 'R' ], $color[ 'G' ], $color[ 'B' ], ( 100 - $filled ) ); + imageSetPixel( $img, $cx + $ix, $cy + $iy, $draw ); + imageSetPixel( $img, $cx + $ix, $cy - $iy, $draw ); + imageSetPixel( $img, $cx - $ix, $cy + $iy, $draw ); + imageSetPixel( $img, $cx - $ix, $cy - $iy, $draw ); + imageSetPixel( $img, $cx + $iy, $cy + $ix, $draw ); + imageSetPixel( $img, $cx + $iy, $cy - $ix, $draw ); + imageSetPixel( $img, $cx - $iy, $cy + $ix, $draw ); + imageSetPixel( $img, $cx - $iy, $cy - $ix, $draw ); + } + } + + function __get($name) { + + if (strpos($name, 'raw_') !== false) { + // if $name == 'raw_left_margin' , return $this->_left_margin; + $variable_name = '_' . str_replace('raw_', '', $name); + return $this->$variable_name; + } + + $variable_name = '_' . $name; + + if (isset($this->$variable_name)) { + return $this->$variable_name * SUPERSAMPLING_SCALE; + } else { + JpGraphError::RaiseL('25132', $name); + } + } + + function __set($name, $value) { + $this->{'_'.$name} = $value; + } + +} // CLASS + +//=================================================== +// CLASS RotImage +// Description: Exactly as Image but draws the image at +// a specified angle around a specified rotation point. +//=================================================== +class RotImage extends Image { + public $a=0; + public $dx=0,$dy=0,$transx=0,$transy=0; + private $m=array(); + + function __construct($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) { + parent::__construct($aWidth,$aHeight,$aFormat,$aSetAutoMargin); + $this->dx=$this->left_margin+$this->plotwidth/2; + $this->dy=$this->top_margin+$this->plotheight/2; + $this->SetAngle($a); + } + + function SetCenter($dx,$dy) { + $old_dx = $this->dx; + $old_dy = $this->dy; + $this->dx=$dx; + $this->dy=$dy; + $this->SetAngle($this->a); + return array($old_dx,$old_dy); + } + + function SetTranslation($dx,$dy) { + $old = array($this->transx,$this->transy); + $this->transx = $dx; + $this->transy = $dy; + return $old; + } + + function UpdateRotMatrice() { + $a = $this->a; + $a *= M_PI/180; + $sa=sin($a); $ca=cos($a); + // Create the rotation matrix + $this->m[0][0] = $ca; + $this->m[0][1] = -$sa; + $this->m[0][2] = $this->dx*(1-$ca) + $sa*$this->dy ; + $this->m[1][0] = $sa; + $this->m[1][1] = $ca; + $this->m[1][2] = $this->dy*(1-$ca) - $sa*$this->dx ; + } + + function SetAngle($a) { + $tmp = $this->a; + $this->a = $a; + $this->UpdateRotMatrice(); + return $tmp; + } + + function Circle($xc,$yc,$r) { + list($xc,$yc) = $this->Rotate($xc,$yc); + parent::Circle($xc,$yc,$r); + } + + function FilledCircle($xc,$yc,$r) { + list($xc,$yc) = $this->Rotate($xc,$yc); + parent::FilledCircle($xc,$yc,$r); + } + + + function Arc($xc,$yc,$w,$h,$s,$e) { + list($xc,$yc) = $this->Rotate($xc,$yc); + $s += $this->a; + $e += $this->a; + parent::Arc($xc,$yc,$w,$h,$s,$e); + } + + function FilledArc($xc,$yc,$w,$h,$s,$e,$style='') { + list($xc,$yc) = $this->Rotate($xc,$yc); + $s += $this->a; + $e += $this->a; + parent::FilledArc($xc,$yc,$w,$h,$s,$e); + } + + function SetMargin($lm,$rm,$tm,$bm) { + parent::SetMargin($lm,$rm,$tm,$bm); + $this->dx=$this->left_margin+$this->plotwidth/2; + $this->dy=$this->top_margin+$this->plotheight/2; + $this->UpdateRotMatrice(); + } + + function Rotate($x,$y) { + // Optimization. Ignore rotation if Angle==0 || Angle==360 + if( $this->a == 0 || $this->a == 360 ) { + return array($x + $this->transx, $y + $this->transy ); + } + else { + $x1=round($this->m[0][0]*$x + $this->m[0][1]*$y,1) + $this->m[0][2] + $this->transx; + $y1=round($this->m[1][0]*$x + $this->m[1][1]*$y,1) + $this->m[1][2] + $this->transy; + return array($x1,$y1); + } + } + + function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) { + list($toX,$toY) = $this->Rotate($toX,$toY); + parent::CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight,$aMix); + + } + + function ArrRotate($pnts) { + $n = count($pnts)-1; + for($i=0; $i < $n; $i+=2) { + list ($x,$y) = $this->Rotate($pnts[$i],$pnts[$i+1]); + $pnts[$i] = $x; $pnts[$i+1] = $y; + } + return $pnts; + } + + function DashedLine($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) { + list($x1,$y1) = $this->Rotate($x1,$y1); + list($x2,$y2) = $this->Rotate($x2,$y2); + parent::DashedLine($x1,$y1,$x2,$y2,$dash_length,$dash_space); + } + + function Line($x1,$y1,$x2,$y2) { + list($x1,$y1) = $this->Rotate($x1,$y1); + list($x2,$y2) = $this->Rotate($x2,$y2); + parent::Line($x1,$y1,$x2,$y2); + } + + function Rectangle($x1,$y1,$x2,$y2) { + // Rectangle uses Line() so it will be rotated through that call + parent::Rectangle($x1,$y1,$x2,$y2); + } + + function FilledRectangle($x1,$y1,$x2,$y2) { + if( $y1==$y2 || $x1==$x2 ) + $this->Line($x1,$y1,$x2,$y2); + else + $this->FilledPolygon(array($x1,$y1,$x2,$y1,$x2,$y2,$x1,$y2)); + } + + function Polygon($pnts,$closed=FALSE,$fast=FALSE) { + // Polygon uses Line() so it will be rotated through that call unless + // fast drawing routines are used in which case a rotate is needed + if( $fast ) { + parent::Polygon($this->ArrRotate($pnts)); + } + else { + parent::Polygon($pnts,$closed,$fast); + } + } + + function FilledPolygon($pnts) { + parent::FilledPolygon($this->ArrRotate($pnts)); + } + + function Point($x,$y) { + list($xp,$yp) = $this->Rotate($x,$y); + parent::Point($xp,$yp); + } + + function StrokeText($x,$y,$txt,$dir=0,$paragraph_align="left",$debug=false) { + list($xp,$yp) = $this->Rotate($x,$y); + return parent::StrokeText($xp,$yp,$txt,$dir,$paragraph_align,$debug); + } +} + +//======================================================================= +// CLASS ImgStreamCache +// Description: Handle caching of graphs to files. All image output goes +// through this class +//======================================================================= +class ImgStreamCache { + private $cache_dir, $timeout=0; // Infinite timeout + //--------------- + // CONSTRUCTOR + function __construct($aCacheDir=CACHE_DIR) { + $this->cache_dir = $aCacheDir; + } + + //--------------- + // PUBLIC METHODS + + // Specify a timeout (in minutes) for the file. If the file is older then the + // timeout value it will be overwritten with a newer version. + // If timeout is set to 0 this is the same as infinite large timeout and if + // timeout is set to -1 this is the same as infinite small timeout + function SetTimeout($aTimeout) { + $this->timeout=$aTimeout; + } + + // Output image to browser and also write it to the cache + function PutAndStream($aImage,$aCacheFileName,$aInline,$aStrokeFileName) { + + // Check if we should always stroke the image to a file + if( _FORCE_IMGTOFILE ) { + $aStrokeFileName = _FORCE_IMGDIR.GenImgName(); + } + + if( $aStrokeFileName != '' ) { + + if( $aStrokeFileName == 'auto' ) { + $aStrokeFileName = GenImgName(); + } + + if( file_exists($aStrokeFileName) ) { + + // Wait for lock (to make sure no readers are trying to access the image) + $fd = fopen($aStrokeFileName,'w'); + $lock = flock($fd, LOCK_EX); + + // Since the image write routines only accepts a filename which must not + // exist we need to delete the old file first + if( !@unlink($aStrokeFileName) ) { + $lock = flock($fd, LOCK_UN); + JpGraphError::RaiseL(25111,$aStrokeFileName); + //(" Can't delete cached image $aStrokeFileName. Permission problem?"); + } + $aImage->Stream($aStrokeFileName); + $lock = flock($fd, LOCK_UN); + fclose($fd); + + } + else { + $aImage->Stream($aStrokeFileName); + } + + return; + } + + if( $aCacheFileName != '' && USE_CACHE) { + + $aCacheFileName = $this->cache_dir . $aCacheFileName; + if( file_exists($aCacheFileName) ) { + if( !$aInline ) { + // If we are generating image off-line (just writing to the cache) + // and the file exists and is still valid (no timeout) + // then do nothing, just return. + $diff=time()-filemtime($aCacheFileName); + if( $diff < 0 ) { + JpGraphError::RaiseL(25112,$aCacheFileName); + //(" Cached imagefile ($aCacheFileName) has file date in the future!!"); + } + if( $this->timeout>0 && ($diff <= $this->timeout*60) ) return; + } + + // Wait for lock (to make sure no readers are trying to access the image) + $fd = fopen($aCacheFileName,'w'); + $lock = flock($fd, LOCK_EX); + + if( !@unlink($aCacheFileName) ) { + $lock = flock($fd, LOCK_UN); + JpGraphError::RaiseL(25113,$aStrokeFileName); + //(" Can't delete cached image $aStrokeFileName. Permission problem?"); + } + $aImage->Stream($aCacheFileName); + $lock = flock($fd, LOCK_UN); + fclose($fd); + + } + else { + $this->MakeDirs(dirname($aCacheFileName)); + if( !is_writeable(dirname($aCacheFileName)) ) { + JpGraphError::RaiseL(25114,$aCacheFileName); + //('PHP has not enough permissions to write to the cache file '.$aCacheFileName.'. Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.'); + } + $aImage->Stream($aCacheFileName); + } + + $res=true; + // Set group to specified + if( CACHE_FILE_GROUP != '' ) { + $res = @chgrp($aCacheFileName,CACHE_FILE_GROUP); + } + if( CACHE_FILE_MOD != '' ) { + $res = @chmod($aCacheFileName,CACHE_FILE_MOD); + } + if( !$res ) { + JpGraphError::RaiseL(25115,$aStrokeFileName); + //(" Can't set permission for cached image $aStrokeFileName. Permission problem?"); + } + + $aImage->Destroy(); + if( $aInline ) { + if ($fh = @fopen($aCacheFileName, "rb") ) { + $aImage->Headers(); + fpassthru($fh); + return; + } + else { + JpGraphError::RaiseL(25116,$aFile);//(" Cant open file from cache [$aFile]"); + } + } + } + elseif( $aInline ) { + $aImage->Headers(); + $aImage->Stream(); + return; + } + } + + function IsValid($aCacheFileName) { + $aCacheFileName = $this->cache_dir.$aCacheFileName; + if ( USE_CACHE && file_exists($aCacheFileName) ) { + $diff=time()-filemtime($aCacheFileName); + if( $this->timeout>0 && ($diff > $this->timeout*60) ) { + return false; + } + else { + return true; + } + } + else { + return false; + } + } + + function StreamImgFile($aImage,$aCacheFileName) { + $aCacheFileName = $this->cache_dir.$aCacheFileName; + if ( $fh = @fopen($aCacheFileName, 'rb') ) { + $lock = flock($fh, LOCK_SH); + $aImage->Headers(); + fpassthru($fh); + $lock = flock($fh, LOCK_UN); + fclose($fh); + return true; + } + else { + JpGraphError::RaiseL(25117,$aCacheFileName);//(" Can't open cached image \"$aCacheFileName\" for reading."); + } + } + + // Check if a given image is in cache and in that case + // pass it directly on to web browser. Return false if the + // image file doesn't exist or exists but is to old + function GetAndStream($aImage,$aCacheFileName) { + if( $this->Isvalid($aCacheFileName) ) { + $this->StreamImgFile($aImage,$aCacheFileName); + } + else { + return false; + } + } + + //--------------- + // PRIVATE METHODS + // Create all necessary directories in a path + function MakeDirs($aFile) { + $dirs = array(); + // In order to better work when open_basedir is enabled + // we do not create directories in the root path + while ( $aFile != '/' && !(file_exists($aFile)) ) { + $dirs[] = $aFile.'/'; + $aFile = dirname($aFile); + } + for ($i = sizeof($dirs)-1; $i>=0; $i--) { + if(! @mkdir($dirs[$i],0777) ) { + JpGraphError::RaiseL(25118,$aFile);//(" Can't create directory $aFile. Make sure PHP has write permission to this directory."); + } + // We also specify mode here after we have changed group. + // This is necessary if Apache user doesn't belong the + // default group and hence can't specify group permission + // in the previous mkdir() call + if( CACHE_FILE_GROUP != "" ) { + $res=true; + $res =@chgrp($dirs[$i],CACHE_FILE_GROUP); + $res = @chmod($dirs[$i],0777); + if( !$res ) { + JpGraphError::RaiseL(25119,$aFile);//(" Can't set permissions for $aFile. Permission problems?"); + } + } + } + return true; + } +} // CLASS Cache + +?> diff --git a/includes/jpgraph/src/imageSmoothArc.php b/includes/jpgraph/src/imageSmoothArc.php new file mode 100644 index 0000000..a1d581f --- /dev/null +++ b/includes/jpgraph/src/imageSmoothArc.php @@ -0,0 +1,344 @@ += abs($yStart)) { + $aaStartX = true; + } else { + $aaStartX = false; + } + if ($xStop >= $yStop) { + $aaStopX = true; + } else { + $aaStopX = false; + } + //$xp = +1; $yp = -1; $xa = +1; $ya = 0; + for ( $x = 0; $x < $a; $x += 1 ) { + /*$y = $b * sqrt( 1 - ($x*$x)/($a*$a) ); + + $error = $y - (int)($y); + $y = (int)($y); + + $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );*/ + + $_y1 = $dyStop*$x; + $_y2 = $dyStart*$x; + if ($xStart > $xStop) + { + $error1 = $_y1 - (int)($_y1); + $error2 = 1 - $_y2 + (int)$_y2; + $_y1 = $_y1-$error1; + $_y2 = $_y2+$error2; + } + else + { + $error1 = 1 - $_y1 + (int)$_y1; + $error2 = $_y2 - (int)($_y2); + $_y1 = $_y1+$error1; + $_y2 = $_y2-$error2; + } + /* + if ($aaStopX) + $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); + if ($aaStartX) + $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); + */ + + if ($seg == 0 || $seg == 2) + { + $i = $seg; + if (!($start > $i*M_PI/2 && $x > $xStart)) { + if ($i == 0) { + $xp = +1; $yp = -1; $xa = +1; $ya = 0; + } else { + $xp = -1; $yp = +1; $xa = 0; $ya = +1; + } + if ( $stop < ($i+1)*(M_PI/2) && $x <= $xStop ) { + $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); + $y1 = $_y1; if ($aaStopX) imageSetPixel($img, $cx+$xp*($x)+$xa, $cy+$yp*($y1+1)+$ya, $diffColor1); + + } else { + $y = $b * sqrt( 1 - ($x*$x)/($a*$a) ); + $error = $y - (int)($y); + $y = (int)($y); + $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); + $y1 = $y; if ($x < $aaAngleX ) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor); + } + if ($start > $i*M_PI/2 && $x <= $xStart) { + $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); + $y2 = $_y2; if ($aaStartX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y2-1)+$ya, $diffColor2); + } else { + $y2 = 0; + } + if ($y2 <= $y1) imageLine($img, $cx+$xp*$x+$xa, $cy+$yp*$y1+$ya , $cx+$xp*$x+$xa, $cy+$yp*$y2+$ya, $fillColor); + } + } + + if ($seg == 1 || $seg == 3) + { + $i = $seg; + if (!($stop < ($i+1)*M_PI/2 && $x > $xStop)) { + if ($i == 1) { + $xp = -1; $yp = -1; $xa = 0; $ya = 0; + } else { + $xp = +1; $yp = +1; $xa = 1; $ya = 1; + } + if ( $start > $i*M_PI/2 && $x < $xStart ) { + $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); + $y1 = $_y2; if ($aaStartX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor2); + + } else { + $y = $b * sqrt( 1 - ($x*$x)/($a*$a) ); + $error = $y - (int)($y); + $y = (int) $y; + $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); + $y1 = $y; if ($x < $aaAngleX ) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor); + } + if ($stop < ($i+1)*M_PI/2 && $x <= $xStop) { + $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); + $y2 = $_y1; if ($aaStopX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y2-1)+$ya, $diffColor1); + } else { + $y2 = 0; + } + if ($y2 <= $y1) imageLine($img, $cx+$xp*$x+$xa, $cy+$yp*$y1+$ya, $cx+$xp*$x+$xa, $cy+$yp*$y2+$ya, $fillColor); + } + } + } + + ///YYYYY + + for ( $y = 0; $y < $b; $y += 1 ) { + /*$x = $a * sqrt( 1 - ($y*$y)/($b*$b) ); + + $error = $x - (int)($x); + $x = (int)($x); + + $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); + */ + $_x1 = $dxStop*$y; + $_x2 = $dxStart*$y; + if ($yStart > $yStop) + { + $error1 = $_x1 - (int)($_x1); + $error2 = 1 - $_x2 + (int)$_x2; + $_x1 = $_x1-$error1; + $_x2 = $_x2+$error2; + } + else + { + $error1 = 1 - $_x1 + (int)$_x1; + $error2 = $_x2 - (int)($_x2); + $_x1 = $_x1+$error1; + $_x2 = $_x2-$error2; + } +/* + if (!$aaStopX) + $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); + if (!$aaStartX) + $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); +*/ + + if ($seg == 0 || $seg == 2) + { + $i = $seg; + if (!($start > $i*M_PI/2 && $y > $yStop)) { + if ($i == 0) { + $xp = +1; $yp = -1; $xa = 1; $ya = 0; + } else { + $xp = -1; $yp = +1; $xa = 0; $ya = 1; + } + if ( $stop < ($i+1)*(M_PI/2) && $y <= $yStop ) { + $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); + $x1 = $_x1; if (!$aaStopX) imageSetPixel($img, $cx+$xp*($x1-1)+$xa, $cy+$yp*($y)+$ya, $diffColor1); + } + if ($start > $i*M_PI/2 && $y < $yStart) { + $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); + $x2 = $_x2; if (!$aaStartX) imageSetPixel($img, $cx+$xp*($x2+1)+$xa, $cy+$yp*($y)+$ya, $diffColor2); + } else { + $x = $a * sqrt( 1 - ($y*$y)/($b*$b) ); + $error = $x - (int)($x); + $x = (int)($x); + $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); + $x1 = $x; if ($y < $aaAngleY && $y <= $yStop ) imageSetPixel($img, $cx+$xp*($x1+1)+$xa, $cy+$yp*$y+$ya, $diffColor); + } + } + } + + if ($seg == 1 || $seg == 3) + { + $i = $seg; + if (!($stop < ($i+1)*M_PI/2 && $y > $yStart)) { + if ($i == 1) { + $xp = -1; $yp = -1; $xa = 0; $ya = 0; + } else { + $xp = +1; $yp = +1; $xa = 1; $ya = 1; + } + if ( $start > $i*M_PI/2 && $y < $yStart ) { + $diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 ); + $x1 = $_x2; if (!$aaStartX) imageSetPixel($img, $cx+$xp*($x1-1)+$xa, $cy+$yp*$y+$ya, $diffColor2); + } + if ($stop < ($i+1)*M_PI/2 && $y <= $yStop) { + $diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 ); + $x2 = $_x1; if (!$aaStopX) imageSetPixel($img, $cx+$xp*($x2+1)+$xa, $cy+$yp*$y+$ya, $diffColor1); + } else { + $x = $a * sqrt( 1 - ($y*$y)/($b*$b) ); + $error = $x - (int)($x); + $x = (int)($x); + $diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error ); + $x1 = $x; if ($y < $aaAngleY && $y < $yStart) imageSetPixel($img,$cx+$xp*($x1+1)+$xa, $cy+$yp*$y+$ya, $diffColor); + } + } + } + } +} + + +function imageSmoothArc ( &$img, $cx, $cy, $w, $h, $color, $start, $stop) +{ + // Originally written from scratch by Ulrich Mierendorff, 06/2006 + // Rewritten and improved, 04/2007, 07/2007 + // compared to old version: + // + Support for transparency added + // + Improved quality of edges & antialiasing + + // note: This function does not represent the fastest way to draw elliptical + // arcs. It was written without reading any papers on that subject. Better + // algorithms may be twice as fast or even more. + + // what it cannot do: It does not support outlined arcs, only filled + + // Parameters: + // $cx - Center of ellipse, X-coord + // $cy - Center of ellipse, Y-coord + // $w - Width of ellipse ($w >= 2) + // $h - Height of ellipse ($h >= 2 ) + // $color - Color of ellipse as a four component array with RGBA + // $start - Starting angle of the arc, no limited range! + // $stop - Stop angle of the arc, no limited range! + // $start _can_ be greater than $stop! + // If any value is not in the given range, results are undefined! + + // This script does not use any special algorithms, everything is completely + // written from scratch; see http://de.wikipedia.org/wiki/Ellipse for formulas. + + while ($start < 0) + $start += 2*M_PI; + while ($stop < 0) + $stop += 2*M_PI; + + while ($start > 2*M_PI) + $start -= 2*M_PI; + + while ($stop > 2*M_PI) + $stop -= 2*M_PI; + + + if ($start > $stop) + { + imageSmoothArc ( $img, $cx, $cy, $w, $h, $color, $start, 2*M_PI); + imageSmoothArc ( $img, $cx, $cy, $w, $h, $color, 0, $stop); + return; + } + + $a = 1.0*round ($w/2); + $b = 1.0*round ($h/2); + $cx = 1.0*round ($cx); + $cy = 1.0*round ($cy); + + $aaAngle = atan(($b*$b)/($a*$a)*tan(0.25*M_PI)); + $aaAngleX = $a*cos($aaAngle); + $aaAngleY = $b*sin($aaAngle); + + $a -= 0.5; // looks better... + $b -= 0.5; + + for ($i=0; $i<4;$i++) + { + if ($start < ($i+1)*M_PI/2) + { + if ($start > $i*M_PI/2) + { + if ($stop > ($i+1)*M_PI/2) + { + imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY , $color, $start, ($i+1)*M_PI/2, $i); + } + else + { + imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $i); + break; + } + } + else + { + if ($stop > ($i+1)*M_PI/2) + { + imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i*M_PI/2, ($i+1)*M_PI/2, $i); + } + else + { + imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i*M_PI/2, $stop, $i); + break; + } + } + } + } +} +?> diff --git a/includes/jpgraph/src/imgdata_balls.inc.php b/includes/jpgraph/src/imgdata_balls.inc.php new file mode 100644 index 0000000..7c97c6a --- /dev/null +++ b/includes/jpgraph/src/imgdata_balls.inc.php @@ -0,0 +1,1061 @@ + 'imgdata_large', + MARK_IMG_MBALL => 'imgdata_small', + MARK_IMG_SBALL => 'imgdata_xsmall', + MARK_IMG_BALL => 'imgdata_xsmall'); + protected $colors,$index,$maxidx; + private $colors_1 = array('blue','lightblue','brown','darkgreen', + 'green','purple','red','gray','yellow','silver','gray'); + private $index_1 = array('blue'=>9,'lightblue'=>1,'brown'=>6,'darkgreen'=>7, + 'green'=>8,'purple'=>4,'red'=>0,'gray'=>5,'silver'=>3,'yellow'=>2); + private $maxidx_1 = 9 ; + + private $colors_2 = array('blue','bluegreen','brown','cyan', + 'darkgray','greengray','gray','green', + 'greenblue','lightblue','lightred', + 'purple','red','white','yellow'); + + + private $index_2 = array('blue'=>9,'bluegreen'=>13,'brown'=>8,'cyan'=>12, + 'darkgray'=>5,'greengray'=>6,'gray'=>2,'green'=>10, + 'greenblue'=>3,'lightblue'=>1,'lightred'=>14, + 'purple'=>7,'red'=>0,'white'=>11,'yellow'=>4); + + private $maxidx_2 = 14 ; + + + private $colors_3 = array('bluegreen','cyan','darkgray','greengray', + 'gray','graypurple','green','greenblue','lightblue', + 'lightred','navy','orange','purple','red','yellow'); + + private $index_3 = array('bluegreen'=>1,'cyan'=>11,'darkgray'=>14,'greengray'=>10, + 'gray'=>3,'graypurple'=>4,'green'=>9,'greenblue'=>7, + 'lightblue'=>13,'lightred'=>0,'navy'=>2,'orange'=>12, + 'purple'=>8,'red'=>5,'yellow'=>6); + private $maxidx_3 = 14 ; + + protected $imgdata_large, $imgdata_small, $imgdata_xsmall ; + + + function GetImg($aMark,$aIdx) { + switch( $aMark ) { + case MARK_IMG_SBALL: + case MARK_IMG_BALL: + $this->colors = $this->colors_3; + $this->index = $this->index_3 ; + $this->maxidx = $this->maxidx_3 ; + break; + case MARK_IMG_MBALL: + $this->colors = $this->colors_2; + $this->index = $this->index_2 ; + $this->maxidx = $this->maxidx_2 ; + break; + default: + $this->colors = $this->colors_1; + $this->index = $this->index_1 ; + $this->maxidx = $this->maxidx_1 ; + break; + } + return parent::GetImg($aMark,$aIdx); + } + + function __construct() { + + //========================================================== + // File: bl_red.png + //========================================================== + $this->imgdata_large[0][0]= 1072 ; + $this->imgdata_large[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAByF'. + 'BMVEX/////////xsb/vb3/lIz/hIT/e3v/c3P/c2v/a2v/Y2P/'. + 'UlL/Skr/SkL/Qjn/MTH/MSn/KSn/ISH/IRj/GBj/GBD/EBD/EA'. + 'j/CAj/CAD/AAD3QkL3MTH3KSn3KSH3GBj3EBD3CAj3AAD1zMzv'. + 'QkLvISHvIRjvGBjvEBDvEAjvAADnUlLnSkrnMTnnKSnnIRjnGB'. + 'DnEBDnCAjnAADec3PeSkreISHeGBjeGBDeEAjWhITWa2vWUlLW'. + 'SkrWISnWGBjWEBDWEAjWCAjWAADOnp7Oa2vOGCHOGBjOGBDOEB'. + 'DOCAjOAADJrq7Gt7fGGBjGEBDGCAjGAADEpKS/v7+9QkK9GBC9'. + 'EBC9CAi9AAC1e3u1a2u1Skq1KSm1EBC1CAi1AACtEBCtCBCtCA'. + 'itAACngYGlCAilAACghIScOTmcCAicAACYgYGUGAiUCAiUAAiU'. + 'AACMKSmMEACMAACEa2uEGAiEAAB7GBh7CAB7AABzOTlzGBBzCA'. + 'BzAABrSkprOTlrGBhrAABjOTljAABaQkJaOTlaCABaAABSKSlS'. + 'GBhSAABKKSlKGBhKAABCGBhCCABCAAA5CAA5AAAxCAAxAAApCA'. + 'ApAAAhAAAYAACc9eRyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. + 'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkRFD'. + 'UHLytKAAAB4UlEQVR4nGNgIAK4mGjrmNq6BmFIWMmISUpKSmk5'. + 'B8ZEokj4qoiLiQCBgqald3xaBpKMj6y4sLCQkJCIvIaFV0RaUR'. + 'lCSk5cWEiAn19ASN7QwisuraihHiajKyEixM/NwckjoKrvEACU'. + 'qumpg7pAUlREiJdNmZmLT9/cMzwps7Smc3I2WEpGUkxYkJuFiY'. + 'lTxszePzY1v7Shc2oX2D+K4iLCgjzsrOw8embuYUmZeTVtPVOn'. + 'gqSslYAOF+Ln4ZHWtXMPTcjMrWno7J82rRgoZWOsqaCgrqaqqm'. + 'fn5peQmlsK1DR52vRaoFSIs5GRoYG5ub27n19CYm5pdVPnxKnT'. + 'pjWDpLydnZwcHTz8QxMSEnJLgDL9U6dNnQ6Sio4PDAgICA+PTU'. + 'zNzSkph8hADIxKS46Pj0tKTc3MLSksqWrtmQySAjuDIT8rKy0r'. + 'Kz+vtLSmur6jb9JUIJgGdjxDQUVRUVFpaUVNQ1NrZ9+kKVOmTZ'. + 'k6vR0sldJUAwQNTU2dnX0TgOJTQLrSIYFY2dPW1NbW2TNxwtQp'. + 'U6ZMmjJt2rRGWNB3TO7vnzh5MsgSoB6gy7sREdY7bRrQEDAGOb'. + 'wXOQW0TJsOEpwClmxBTTbZ7UDVIPkp7dkYaYqhuLa5trYYUxwL'. + 'AADzm6uekAAcXAAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bl_bluegreen.png + //========================================================== + $this->imgdata_large[1][0]= 1368 ; + $this->imgdata_large[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMMFi8hE9b2uAAABOVJREFUeNq9lk2sJFUVx3+3qv'. + 'tW95t57zFvhiFxmCFRUJRoNCQiJARMhiFx/Igxii5goTG6ZDAu'. + '/EhcSCIrTAgLEiKsJ8ywABNZEMJXEDYCukAmjgjzBkK/j35V1d'. + '333FtV97io97pfzwxfG86qcu/N+Z3zP+fcW/Apmfk4hx57+R/6'. + 'Rqmc9ykhsWjlsUngAA1fXIQ7b73pI/186IGHnn9dH/8frC8v4I'. + 'PiG53uaerR4GmKkv31mB8cyfjd946ZTwR66qVX9OTWIi8UKUv9'. + 'BOrZXpYZvFeiBvzI0fgSUSFKwbVG+Pl1V3HH0VvNR4KeeukV/f'. + 'PmMmdHhst76aXD64AbeVQ9bjNHaiGOC2o3wLrAb2/4LL/84ffn'. + 'fCdzkOdayKpLppBemrBsU5Y1Zdmm9LJdGU6E/t4M24Q26jRDRL'. + 'j3mdc49cSTekFsMzs5XuTsyLDUNSDQ25NwKOly9YIl22MYhJr/'. + 'uoDtBBoT0CxBRGYOAhibIaOCe//2MpfM6KHnX9cXipSlbkKWmS'. + 'nk9iv38J0jixw7vJfrTMYBOvhSoQHJBS09ANELloAGDxW8tfoW'. + 'J+5/UC8CPS0LU7r3SpYarr7M8rmFjMPLXT6/33L4si7Z2GCrQC'. + '+0ctlOaNs9DReV8vSLr85ndPLpZ/WNvHW+01kAVFBOGvJx0wYg'. + 'Sp47RIQ4Emwa8FGJXlDxSCFo5YlVgAo2hwPue/hRndboTV3EW2'. + 'Wp3k6wBp8q56QiWzecW6vwQfnPRkAWhFgILnq08jQ+R2nlUzzN'. + 'uES9Q7Vd+9fba7NmWJW61db2247qACmcjxXr45psYphsFGSLBu'. + 'kIajxqtjNwHkvAjQt0sg3crhPA2+fPz0CuyNFOghsGsr19mnFg'. + 'DGwrRm8UoAtNmQPQtRXDgdC4HImCFEKcCE0oieUWUYq2LtbiGp'. + 'mBQmppfIkjw45DK0QNNkvQ0jMBtPL0UnDRM1rN+cxKwzvOo2NP'. + 'tykR9a1kfpZNDLMG6QDYJqCTBvUe1+uxs+YKyPoGrTwY2HhvC4'. + 'CDWQd5d4xNApNQEEMgjgLdUCLBQ5cprL/trwNwKG2IUmDqDFd5'. + 'sr5BWrlxuSdLDFEFlqAzXGc4zFjupqh6uqYihpxJcEgp026l2w'. + '7wFUv7Z6AvrfRo/n0OYzPwIKE3HUKAJg2otMBiElnsF7wngis9'. + '3ZDjNnLi7huCWUZfueZKTu/M0V3HvmkOFDVxVKDG04ScejSgW5'. + 'V0q5JYFEghuDLHlTmToqDeGOCKIVtrW9hsdmXufEcNLPSXuPHa'. + 'a+bvuh9df5AH/v5PDFmbWQC3Mx+TVvfGVTRB2CodNgT2JBX003'. + 'aANZAYS/BxCv32TV/l2C03G7jgmfjGiT/qmeEmibEYm7XzAO2k'. + 'A+pbgHhBgydqu54YO5eRiLCy7yDvPP6Xqf+5Z+Lu277OYuOpiw'. + 'H15oBmlNOMcmK5RbP+PrEscGU+DSAxdg4CICIkxnLP8aNz63Og'. + 'H3/rdvOb795GVhuaYo0oBc3GGrEsUPVTwO6a7LYd+X51x3Hu/t'. + 'lP5tS65FN+6okn9U+n/sqb596dTvhOF+02myXTmkQNrOw7yD3H'. + 'j14E+UDQjp24/0E9/eKrbA4HH3aMK1b2ccvXvswjv//1J/s5ud'. + 'Due/hRPfP+OmfOrk7vrn7a48ihA3zh8CH+8Iuffiw/n4r9H1ZZ'. + '0zz7G56hAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bl_yellow.png + //========================================================== + $this->imgdata_large[2][0]= 1101 ; + $this->imgdata_large[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAB2l'. + 'BMVEX//////////+///+f//9b//8b//73//7X//63//6X//5T/'. + '/4z//4T//3P//2v//1r//0r//0L//zH//yn//yH//xj//xD//w'. + 'j//wD/90L/9zn/9zH/9xj/9xD/9wj/9wD39yn37zn37zH37yH3'. + '7xD37wj37wDv70Lv50rv50Lv5znv5yHv5xjv5wjv5wDn51Ln5x'. + 'Dn3jHn3iHn3hjn3hDn3gje3oze3nPe3lLe1oze1nPe1lLe1ine'. + '1iHe1hje1hDe1gje1gDW1qXW1mvWzqXWzkLWzhjWzhDWzgjWzg'. + 'DOzrXOzq3OzpzOzgDOxkrOxinOxhjOxhDOxgjOxgDGxqXGxnvG'. + 'xmvGvRjGvRDGvQjGvQDFxbnAvr6/v7+9vaW9vZS9vQi9vQC9tR'. + 'C9tQi9tQC7u7W1tZS1tXu1tTG1tQi1rRC1rQi1rQCtrYytrSGt'. + 'rQitrQCtpYStpSGtpQitpQClpYSlpXulpQClnBClnAilnACcnG'. + 'ucnAicnACclAiclACUlFqUlCmUlAiUlACUjFKUjAiUjACMjFKM'. + 'jEqMjACMhACEhACEewB7ezF7exB7ewB7cwBzcylzcwBzaxBzaw'. + 'BraxhrawhrawBrYxBrYwBjYwBjWgBaWgBaUgCXBwRMAAAAAXRS'. + 'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. + 'LdfvwAAAAHdElNRQfTAwkRFBKiJZ4hAAAB7ElEQVR4nI3S+1vS'. + 'UBgHcB67WJmIMWAVdDHEDLBC6Go0slj3Ft0m9RRBWQEmFZFDEM'. + 'Qgt0EMFBY7p/+198hj1kM/9N1+++x73rOd6XT/kStnTx4fPzd9'. + 'uwfOjFhomj7smAhwj/6Cm2O0xUwy6g7cCL99uCW3jtBmE7lsdr'. + 'fvejgpzP7uEDFRRoqy2k8xQPnypo2BUMP6waF9Vpf3ciiSzErL'. + 'XTkPc0zDe3bsHDAcc00yoVgqL3UWN2iENpspff+2vn6D0+NnZ9'. + '6lC5K6RuSqBTZn1O/a3rd7v/MSez+WyIpVFX8GuuCA9SjD4N6B'. + 'oRNTfo5PCAVR0fBXoIuOQzab1XjwwNHx00GOj8/nKtV1DdeArk'. + '24R+0ul9PjmbrHPYl+EipyU0OoQSjg8/m83kl/MMhx0fjCkqio'. + 'SMOE7t4JMAzDsizH81AqSdW2hroLPg4/CEF4PhKNx98vlevrbY'. + 'QQXgV6kXwVfjkTiSXmhYVcSa7DIE1DOENe7GM6lUym0l+EXKks'. + 'K20VAeH2M0JvVgrZfL5Qqkiy0lRVaMBd7H7EZUmsiJJcrTdVja'. + 'wGpdbTLj3/3qwrUOjAfGgg4LnNA5tdQx14Hm00QFBm65hfNzAm'. + '+yIFhFtzuj+z2MI/MQn6Uez5pz4Ua41G7VumB/6RX4zMr1TKBr'. + 'SXAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bl_silver.png + //========================================================== + $this->imgdata_large[3][0]= 1481 ; + $this->imgdata_large[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAADAF'. + 'BMVEUAAADOzs7Gxsa9vb21tbXOxsbOzsbGzsb3///O1ta1vb2c'. + 'paVSWlpKWlpSY2ve5+97hIze7/9aY2vO5/9zhJRaa3tSY3PGzt'. + 'aMlJxrc3tja3NKUlpCSlK1vcZze4RSWmPW5/+Upb3G3v9zhJxS'. + 'Y3t7jKVaa4TO3veltc6ElK1re5Rjc4ycpbV7hJRaY3M5QlLn7/'. + '/Gzt6lrb2EjJzO3v9ja3vG1ve9zu+1xueltdacrc6UpcaMnL1C'. + 'SlqElLV7jK1zhKVre5zW3u/O1ue1vc6ttcaMlKVze4xrc4RSWm'. + 'tKUmPG1v+9zve1xu+tveeltd6crdbe5/+9xt6cpb17hJxaY3s5'. + 'QlrW3vfO1u/Gzue1vdattc6lrcaUnLWMlK2EjKVze5Rrc4xja4'. + 'RSWnNKUmtCSmO9xuecpcZ7hKVaY4TW3v/O1vfGzu+1vd6ttdal'. + 'rc69xu+UnL2MlLWEjK1ze5xrc5R7hK1ja4zO1v+1veettd6lrd'. + 'aMlL3Gzv/39//W1t7Gxs61tb29vcatrbWlpa2cnKWUlJyEhIx7'. + 'e4TW1ufGxta1tcZSUlqcnK3W1u+UlKW9vda1tc57e4ytrcalpb'. + '1ra3vOzu9jY3OUlK29vd6MjKWEhJxaWmtSUmNzc4xKSlpjY3tK'. + 'SmNCQlqUjJzOxs7///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. + 'AAAAAAAAAAAAAAAAAAAAAAAAD///9fnkWVAAAAAnRSTlP/AOW3'. + 'MEoAAAABYktHRP+lB/LFAAAACXBIWXMAAABFAAAARQBP+QatAA'. + 'AB/klEQVR42mNgxAsYqCdd3+lcb4hLmj8wMMvEu8DCMqYbU9op'. + 'UEFB2MTb26eyysomFl06XEEhUCHLpAKo2z/fujikEUVaXUFBMB'. + 'BouLePuV+VVWGRciIXknSEsImCQd3//xwmPr65llaFcSFJHkjS'. + '3iYmWUDZ//8NfCr989NjNUMSUyTg0jneSiaCINn/gmlVQM12qg'. + 'lJnp5waTMTE5NAkCyHWZW/lXWNfUlikmdYK0zax7siS4EDKJtd'. + 'mQeU1XRwLBdLkRGASucWmGVnZ4dnhZvn5lmm29iVOWpnJqcuko'. + 'JKR1Wm5eTkRKYF5eblp9sU2ZeUJiV7zbfVg0pH56UFBQXNjIqK'. + 'jgkujItX1koKTVmYajsdKu2qETVhwgSXiUDZ2Bn9xqUeoZ5e0t'. + 'LzYYZ3B092ndjtOnmKTmycW1s7SHa+l5dtB8zlccE6RlN0dGbM'. + 'mDVbd5KupNBcL6+F82XgHouLj5vRP2PWLGNdd4+ppnxe8tJec6'. + 'XnNsKkm0uVQ5RDRHQTPTym68nPlZbvkfYCexsa5rpJ2qXa5Umm'. + 'ocmec3m8vHjmSs+fgxyhC5JDQ8WSPT2lvbzm8vDIe0nbtiBLN8'. + '8BigNdu1B6Lsje+fPbUFMLi5TMfGmvHi/puUAv23q2YCTFNqH5'. + 'MvPnSwPh3HasCbm3XUpv+nS5VtrkEkwAANSTpGHdye9PAAAASn'. + 'RFWHRzaWduYXR1cmUANGJkODkyYmE4MWZhNTk4MTIyNDJjNjUx'. + 'NzZhY2UxMDAzOGFhZjdhZWIyNzliNTM2ZGFmZDlkM2RiNDU3Zm'. + 'NlNT9CliMAAAAASUVORK5CYII=' ; + + //========================================================== + // File: bl_purple.png + //========================================================== + $this->imgdata_large[4][0]= 1149 ; + $this->imgdata_large[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAACAV'. + 'BMVEX/////////7///5///1v//xv//rf//pf//lP//jP//hP//'. + 'c///a///Wv//Wvf/Uv//Sv//Qv//Qvf/Off/Mf//Kf//If//If'. + 'f/GP//GPf/EP//EPf/CP//CPf/CO//AP//APf3Oe/3Kff3Ke/3'. + 'Ie/3GO/3EO/3AO/vSu/vSufvOefvMefvIefvGOfvEOfvCOfvAO'. + 'fnUufnSufnMd7nId7nGN7nGNbnEN7nCN7nAN7ejN7ejNbec97e'. + 'c9beUtbeQtbeIdbeGNbeENbeCNbeANbWpdbWa9bWQs7WGM7WEM'. + '7WCM7WAM7Otc7Orc7OnM7OSsbOIb3OGMbOEMbOCMbOAM7OAMbG'. + 'pcbGnMbGe8bGa8bGKbXGEL3GCL3GAL3FucXBu73AvsC/v7+9pb'. + '29Ka29GLW9ELW9CLW9AL29ALW5rrm1lLW1e7W1MbW1GKW1EK21'. + 'CLW1CK21AK2tjK2thKWtMaWtIaWtGJytCK2tCKWtAK2tAKWlhK'. + 'Wle6WlEJylCJylAKWlAJyca5ycGJScEJScCJScAJycAJSUWpSU'. + 'UoyUKZSUEIyUCIyUAJSUAIyMUoyMSoyMIYSMEISMCISMAIyMAI'. + 'SECHuEAISEAHt7MXt7EHt7CHt7AHt7AHNzKXNzEGtzAHNzAGtr'. + 'GGtrEGNrCGtrAGtrAGNjCFpjAGNjAFpaAFpaAFIpZn4bAAAAAX'. + 'RSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsS'. + 'AdLdfvwAAAAHdElNRQfTAwkRFB0ymoOwAAAB9UlEQVR4nGNgIA'. + 'K42hhqGtm5+WFIWClKycvLK6gbuARGoEj4aMjLSElISUir6Tt7'. + 'x+aEIWR8leQlwEBSTc/CK7awLguuR0lGQkJMVFRUTFJVzwko1d'. + 'oFk9OQl5IQE+Dh5hVR0TV3CkkvbJgyASJjDZIR5GBl5eRX0TH1'. + 'DEqrbJ2ypBEspSgvJSXKw8bMxMavbOLoGZNf1TZlybw4oIyfLN'. + 'BxotxsLEzsQiaOHkFpBQ2905esrAZK2SpIAaUEuDm5+LTNPAKj'. + 'C+pbps1evrIDKGWnLictKSkuLKyoZQyUya9o7Z2+YMXKGUApew'. + 'M9PTVdXR0TEwf3wOjUirruafOXL18xFyjl72Kpb25qaurg4REU'. + 'EFVe2zJ5zpLlK1aCpbydnZ2dnDwDA6NTopLLeiZNXbB8BcTAyP'. + 'TQ0JDg4KCY1NS83JKmiVOBepYvX9UPlAovzEiPSU/LLyior2vq'. + 'mjZr3vLlIF01IC+XVhUWFlZW1Lc290ycOGfxohVATSsXx4Oksn'. + 'vaWlsb2tq6J0+bM2/RohVA81asbIcEYueU3t7JU6ZNnwNyGkhm'. + '+cp5CRCppJnzZ8+ZM3/JUogECBbBIixr8Yqly8FCy8F6ltUgoj'. + 'lz7sqVK2ByK+cVMSCDxoUrwWDVysXt8WhJKqG4Y8bcuTP6qrGk'. + 'QwwAABiMu7T4HMi4AAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bl_gray.png + //========================================================== + $this->imgdata_large[5][0]= 905 ; + $this->imgdata_large[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAABO1'. + 'BMVEX////////3///39/fv7+/e5+fW3t7Wzs7WxsbG1tbGzsbG'. + 'xsbDxMS/v7++wMC+v7+9zsa9xsa9vb29tbW9ra29pa24uLi1xs'. + 'a1vb21tbWxtrattbWmpqalra2cra2cpaWcnJycjIyUpaWUnJyU'. + 'lJSUjIyMnJyMnJSMlJSMlIyMjJSMjIyElJSElIyEjIyEhIR7jI'. + 'x7hIR7hHt7e3t7e3N7e2tzhIRze3tze3Nzc3Nre3trc3Nrc2tr'. + 'a2tjc3Njc2tja3Nja2tjY2NjWlpaa2taY2taY2NaY1paWlpaUl'. + 'JSY2NSY1pSWlpSWlJSUlJSUkpKWlpKWlJKUlpKUlJKUkpKSkpK'. + 'SkJCUlJCUkJCSkpCSkJCQkI5Sko5QkI5Qjk5OUI5OTkxQkIxOT'. + 'kxMTkxMTEpMTEhMTEhKSkYISEpy7AFAAAAAXRSTlMAQObYZgAA'. + 'AAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdE'. + 'lNRQfTAwkRFQfW40uLAAABx0lEQVR4nI3SbXfSMBQA4NV3nce5'. + 'TecAHUywRMHSgFuBCFsQUqwBS1OsWQh0GTj//y8wZUzdwQ/efM'. + 'tzcm/uuXdj4z9ic/PR9k4qk1qDnf0X2/uZzKt8GaRvSubg4LVp'. + 'mkWzCGAT/i3Zsm2XNQHLsm2n2937LaaNnGoJFAEo27B50qN0ay'. + 'Wg26lXsw8fP8nmzcJb2CbsnF5JmmCE8ncN404KvLfsYwd7/MdV'. + 'Pdgl/VbKMIzbuwVgVZw2JlSKJTVJ3609vWUY957lgAUd1KNcqr'. + 'yWnOcOPn8q7d5/8PywAqsOOiVDrn42NFk+HQ7dVuXNYeFdBTpN'. + 'nY5JdZl8xI5Y+HXYaTVqEDp1hAnRohZM03EUjMdhn5wghOoNnD'. + 'wSK7KiiDPqEtz+iD4ctdyAifNYzUnScBSxwPd6GLfRURW7Ay5i'. + 'pS5bmrY8348C5vvUI+TLiIVSJrVA0heK/GDkJxYMRoyfCSmk4s'. + 'uWc3yic/oBo4yF374LGQs5Xw0GyQljI8bYmEsxVUoKxa6HMpAT'. + 'vgyhU2mR8uU1pXmsa8ezqb6U4mwWF/5MeY8uLtQ0nmmQ8UWYvb'. + 'EcJaYWar7QhztrO5Wr4Q4hDbAG/4hfTAF2iCiWrCEAAAAASUVO'. + 'RK5CYII=' ; + + //========================================================== + // File: bl_brown.png + //========================================================== + $this->imgdata_large[6][0]= 1053 ; + $this->imgdata_large[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABoV'. + 'BMVEX////Gzs7GvbXGrZTGpXu9nHO1nHO1nIy9taXGxs7GtaXO'. + 'nHPGlFrGjEq9hEq1hEqte0Klczmcazmce1KtnIzGxsbGvb3OlF'. + 'LOlFq9hFKte0qcc0KUYzGEWimMc1K9ta3OnGvOnGPWnGO9jFq9'. + 'jFKlc0KUazmMYzl7UilzUjGtpZzGxr3GnGPWpWvepXO1hFJ7Wj'. + 'FrSiFjUjG1ra3GnHPvxpT/5733zpythFKUa0KEYzlzUilaOSF7'. + 'Wjm9jErvvYz/99b///f/78bnrYS1hFqle0p7UjFrSiljQiFCMR'. + 'iMhHO9lGvGjFLWnGv/3q3////erXuthEqlc0paQiFKMRhSQin/'. + '1qX/997//++cc0pjSilaQilKORhCKRiclIy9pYzGlGPntYT33q'. + '3vvZSEWjlSOSE5KRB7c2O1lHutczmthFqte1JrWkqtjGtCKRBa'. + 'SjmljGuca0KMYzGMaznOztaclISUYzmEWjFKOSF7a1qEYzFaSi'. + 'GUjISEa0pKOSm9vb2llIxaQhg5IQiEc2tzY0paORilnJy1raVS'. + 'OSljUkJjWkKTpvQWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. + 'gAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkREiei'. + 'zP2EAAAB9UlEQVR4nGWS/VfSUBjHL5QluhhBxtwyWcCus5Blpm'. + 'wDC4ONaWXCyBi7RMZmpQ2Bypm9W/byV3cHHo/W88s95/s5z/d5'. + 'uwCcCh/4L3zAf+bs0NC588On9QAYGSUuBINk6GI4cmnsBLk8Go'. + '1SFEGMkzRzZeLq5JE8FvDHouw1lqXiCZJOcnCKnx4AcP0GBqmZ'. + 'mRgRT9MMB4Wbs7cGSXNRik3dnp9fiMUzNCNKgpzN9bsaWaQo9s'. + '7dfH7pXiFTZCBU1JK27LmtBO8TDx7mV1eXHqXXyiIUFLWiVzHx'. + 'BxcJIvV4/cn6wkqmWOOwmVE3UQOAp6HxRKL5bGPj+VwhUhalFq'. + '8alm5vAt+LlySZTsebzcKrraIIW4JqZC3N3ga+1+EQTZKZta1M'. + 'pCZCSeDViqVrThsEdsLJZLJYLpZrHVGScrKBvTQNtQHY6XIM02'. + 'E6Ik7odRW1Dzy3N28n3kGuB3tQagm7UMBFXI/sATAs7L5vdbEs'. + '8Lycm923NB0j5wMe6KOsKIIyxcuqauxbrmlqyEWfPmPy5assY1'. + 'U1SvWKZWom9nK/HfQ3+v2HYZSMStayTNN0PYKqg11P1nWsWq7u'. + '4gJeY8g9PLrddNXRdW8Iryv86I3ja/9s26gvukhDdvUQnIjlKr'. + 'IdZCNH+3Xw779qbG63f//ZOzb6C4+ofdbzERrSAAAAAElFTkSu'. + 'QmCC' ; + + //========================================================== + // File: bl_darkgreen.png + //========================================================== + $this->imgdata_large[7][0]= 1113 ; + $this->imgdata_large[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAB2l'. + 'BMVEX////////3///v///n/+/e99bW/+/W99bO786/v7++vr69'. + '/96999a7wb24vbu1/9a1zqW1u7itxrWosq6l772l1qWlxrWlxq'. + '2lva2cxpSU562U3q2UxqWUvaWUpZyM77WM57WMvYyMtZyMrZyM'. + 'pZSMnJSEvZyEtYyErZSElIx7zpR7xpx7xpR7vZR7jIRz1pRzxp'. + 'RzjIRrzpRrzoxrxoxrtYRrrYxrrXtrpYRrhHNjzoxjxoxjxoRj'. + 'vYRjtYRjrXtjpXtjlGNje2tazoxazoRaxoxaxoRavYRatYRatX'. + 'tarXtapXNanHNajFpae2tSzoRSxoRSvXtStXtSrXtSrXNSpXNS'. + 'nHNSnGtSlGtSlGNSjGtSjGNKvXtKtXNKrXNKpWtKnGtKlGNKjG'. + 'NKhGNKhFJKc1pKa1JCrWtCpWtCnGtClGNCjGNCjFpChFpCe1JC'. + 'a1JCY1I5pWs5nGM5lGM5jFo5hFo5e1o5c0o5WkoxjFoxhFoxhF'. + 'Ixe1Ixc1Ixc0oxa0ophFIpe0opc0opa0opa0IpY0IpWkIpWjkp'. + 'UkIpUjkhc0oha0IhY0IhWjkhWjEhUjkhUjEhSjEhSikhQjEhQi'. + 'kYWjkYSjEYSikYQjEYQikQSikQQikQQiEQOSExf8saAAAAAXRS'. + 'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. + 'LdfvwAAAAHdElNRQfTAwkRFCaDkWqUAAAB+ElEQVR4nI3S+1vS'. + 'UBgHcGZlPV0ks/vFrmQWFimJjiwiYUJWjFBWFhClyZCy5hLrwA'. + 'x2EIwJC1w7zf2vnU0re+iHvs9++7x7zznvORbLf+TA6ct9fYMX'. + 'jrfAUYefpp+/iM1ykxf/lmuhUZ/PTwXC8dml5Wcd23o5H5Mk6b'. + '5NUU8icXbhS67rNzn9JDnguOEYGQtEEtwC+Crs3RJ76P5A/znr'. + 'vsNX7wQnEiwHCtK7TTkW8rvdZ9uJtvZTLkxpHhSrP66bNEj7/P'. + '3WNoLYeeSWQQCIpe9lQw7RNEU5rDsIYtcJ14Nocg7kRUlBNkxn'. + 'YmGKcp7cv3vPwR7XOJPmc0VYU3Sv0e9NOBAYG7Hbz/cMjTMveZ'. + 'CHkqxuTBv0PhYJB4N3XR6PJ5rMAPMnpGUxDX1IxSeMTEaZp1OZ'. + 'nGAIQiYtsalUIhFlmGTy3sO3AizJCKn6DKYryxzHsWyaneMzr6'. + 'cWxRVZVlFTe4SpE3zm+U/4+whyiwJcWVMQNr3XONirVWAklxcE'. + 'EdbqchPhjhVzGpeqhUKhWBQhLElr9fo3pDaQPrw5xOl1CGG1JE'. + 'k1uYEBIVkrb02+o6RItfq6rBhbw/tuINT96766KhuqYpY3UFPF'. + 'BbY/19yZ1XF1U0UNBa9T7rZsz80K0jWk6bpWGW55UzbvTHZ+3t'. + 'vbAv/IT+K1uCmhIrKJAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bl_green.png + //========================================================== + $this->imgdata_large[8][0]= 1484 ; + $this->imgdata_large[8][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMMFjM4kcoDJQAABVlJREFUeNq9ll2MJFUVx3/11V'. + 'Vd/TE9vU0v4zLDwJIF16jBqLAPhsRXEiDqg0QTJiQSjcSNvCzw'. + 'sBEDDxizhvAAxBgf1oR9QF9NiE9ESFZkQyZB5WtddmdnZ3qqqr'. + 'uqbt367Cofqu3ZZpWVaDzJfbkf53//55z/PVdZXV3l/2H6f7Lp'. + '5VdOV/4Nb+GmHpUeA7AdBNxc3kafNb73jRPK9Xwon8ToxVefqU'. + 'b91wibH5EkCQBCizFihTSviHUHR0hWws9xe3wvJ7/7nPKpgX5y'. + '9oFqt3eOgWniRBoAbUBGGqZUibSYaeoT2B5bnkdaSA6793Cv/S'. + 'QPPbihXBfo5VdOV+8dfgnvwAU62YH5fCZ12sDujFkwyegCqTrB'. + 'iUOKTOJKj8jr88jS8zy6cXwBTP048nuHX0I0nDlIp7RpTG7kM0'. + 'sdyAYsTVukUuWGhlWHMq0ITL92lnUp9R1Obz/GmTNnqn9bDD8/'. + '+0D1oX0O0zQZZDYCsK2j3Gl9jQqDfHiei8GfiKVLlsZkJaBAN1'. + '0i6PgwUbB0GxG5/PrtE/xLRr959Znqw9452oVNI+jiJhnr1pe4'. + 'k29zB1/nFr5Kj7tpt1YYhJ0FJ7nUYbcJQBgahN2MzeCP/OipR6'. + 'prgN6Qr6ELFQFUWoRpNVjlKwxZB8DCpE+PtfEKqV1cUzxpVudu'. + 'GTBHA5Y1g99e+dUio9O/P1Vpq+/WE5GGjDSMoAtAQjrf3C52IP'. + 'QxpY4WK2hpReka9Gfrhqgz0bACRoCWjDh56kQ1z9FeuUUQxVhK'. + 'B92sD1VahM+bAJgcoJhGjP/6Ln8rAgDiRCVRKiIzxMkkodBJ85'. + 'im1IlEHbE4k1xyNveL4YP8HarmGJIOpqyjeQmfNHmTvnqZTWBt'. + 'vIJXpPwlukJSuSTKGK3pEwtJmiX00ZlInTyNscImO6XBITvH1c'. + '8vVt2OucdKvIyeKRTNCivsEMgcpg6taYs30nfq0Gqg6hOSSFJ4'. + 'BSnJPht0IqEjWmOGocEI6F0J94F0qaL6BntTF0MtUfweKQKAPU'. + 'Wwp4OcVnQAmVb0p9DLOzjEhEKnGRmoRc7EzRGlwA6NujAKG4yP'. + '6Sjwc4aVznZ7DK0xXdkDoJf0kGmFBniFBOBGcZSCCSKd0IwN0k'. + 'IS+QZWCGVZex4BnUxya3+Zt9iugQbcRFpIAtuHvAZulPUdLhUJ'. + 'RqegI3WcqaSXddlT3idsWMSRRGkEtNwmyTifAwyBo7LP+11J0e'. + '7tM7pZOYblHkBLcqZ5LcYtw6Wbd4CM3SpE9foYZsIHoqDKCrbz'. + 'mLSQtPwmuhXgtBLs0GBdbXOhFGB7WBKO2F8GXt9/VO97Ya3atF'. + '7nUHnwGjGGQqcPxFEdFqURkEidiZszAERoYIsGju1hq21kWee3'. + 'bw15+8WpsvAy3K1+i3JkkhZyPpxxjjPOsfOYiZ+TFhLPzQnHOU'. + 'tpzGB2dgA4tscIkKIx19Cxg/fPL7vQJu47eXt1VvsDK8pwPueZ'. + 'PuZoQMOqhRoJHSs0kKLBWjvjYinmeQGw1TaX1RFdfZ3LMzYLjA'. + 'C++dkn6AaH2Nobk6cxEzdnuG0TdC8zvdJkN0hqkFkO/jwL0fxa'. + 'so8sBcuFzQ+/+MRC+BeAHnpwQzn++ee5KT9Eshuy46dcKAXm32'. + '0uzPQhS4GttkH2GQID2Wc0Y4LtAbDxhZ/x5A+e/uTG9+jGceXH'. + '9/ySnnIXnUzOxXe1038mW3ZynNmam4yYWkO+f9cv+Oljz16/lV'. + '9tDz/9nerc1hm8ZEScSRK7VvtYl1i1dklsOKyvc+zg/bzw1O8+'. + '/efkajt56kR1ydlEJBc5H46xzbrJ3dY9wrB7hGcff+6/+279L+'. + '0fHxyiE8XMLl4AAAAASUVORK5CYII=' ; + + //========================================================== + // File: bl_blue.png + //========================================================== + $this->imgdata_large[9][0]= 1169 ; + $this->imgdata_large[9][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAACEF'. + 'BMVEX/////////7//35//v1v/exv/Wvf/Wrf/Wpf/Orf+/v7+9'. + 'tc69jP+9hP+5ucW1tc6tlP+rq7Wlpdalpcalpb2cnM6cnMacc/'. + '+cWv+UlLWUjN6UjK2Uc/+Ma/+MUv+EhKWEa/+EQvd7e8Z7e7V7'. + 'e6V7c957Wv9za9Zza8ZzSv9ra5xrSv9rOf9rMe9jUudjQv9jOe'. + '9aWpRaUt5aUpRaSu9aSudSUoxSSs5SSoxSMf9KQtZKOfdKMedK'. + 'Kf9KKe9CKf9CKb1CKa1CIfdCIedCId45MXs5Kfc5If85Iec5Id'. + 'Y5GP8xMbUxMXsxKc4xKZQxIf8xGP8xGO8xGN4xGNYxGL0xGK0p'. + 'KXMpIYwpGP8pGO8pGOcpGNYpGM4pEP8pEPcpEOcpEN4pENYpEM'. + 'YpEL0hGKUhEP8hEPchEO8hEOchEN4hENYhEM4hEMYhELUhCP8h'. + 'CO8hCN4YGJwYGGsYEL0YEK0YEHMYCN4YCM4YCMYYCL0YCKUYAP'. + '8QEJQQEIwQEHsQEGsQCM4QCLUQCK0QCKUQCJwQCJQQCIwQCHMQ'. + 'CGsQAP8QAPcQAO8QAOcQAN4QANYQAM4QAMYQAL0QALUQAKUQAJ'. + 'QQAIQICGsICGMIAO8IANYIAL0IALUIAK0IAKUIAJwIAJQIAIwI'. + 'AIQIAHsIAHMIAGsIAGMAAN4AAMYAAK0AAJQAAIwAAIQAAHMAAG'. + 'sAAGMAAFrR1dDlAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkRFRPMOZ'. + '/2AAAB+klEQVR4nGNgIAIIqeqZmBqpi2JISNml5lVXV3d198Yo'. + 'oUjwm1SnxsbGRsSm5ZfNXO4tjCTjVh0ABhFx6QV9E1Y0S8JkuN'. + '3yAgLc7W3t/QPi4jPKJ8ye1yoIlTKpjvVy15eVUbN0i4zKLJ8w'. + 'ae6qcKgLqmMj3PUFWFl5NJ0CExLLJzbNW7BWCyxlXR0ba6/Axs'. + 'zELmfnkRBT0QiSKgXJCOflxUbYy3KyMHEoOrtEZ1c2TZ6/cMl6'. + 'eaCUamdsbIC7tjgPr4SBS3BMMVDTwkXr1hsDpYy6UmMj/O0tdX'. + 'QNbDxjknJLWqYsXLx0vStQynxGflpkZGCgs7Onp29SbtNkoMy6'. + 'pevCgFJWy3oyMuKjgoKCPWNCvEuqWhcsWrJ06XqQlPnMvrKyrM'. + 'TomJjkZAfHlNa2qdOWrlu63gcopbG8v7+hvLwip7g4JdSxsLZu'. + '8dKlS9ettwBKic2eNXHChIkTG5tKqgpr2uo6loLAehWQx0LnzJ'. + '49p6mpeXLLlNq6RUvqly6dvnR9Bx9ISnnlvLmT582bMr9t4aL2'. + '+vrp60GaDCGB6Ld6wfwFCxYCJZYsXQ+SmL6+FBryInVrFi1atH'. + 'jJkqVQsH6pNCzCJNvXrQW6CmQJREYFEc2CYevXrwMLAyXXl0oz'. + 'IAOt0vVQUGSIkabkDV3DwlzNVDAksAAAfUbNQRCwr88AAAAASU'. + 'VORK5CYII=' ; + + //========================================================== + // File: bs_red.png + //========================================================== + $this->imgdata_small[0][0]= 437 ; + $this->imgdata_small[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAk1'. + 'BMVEX////////GxsbGra3/xsbOhITWhIT/hIT/e3v/c3P/a2vG'. + 'UlK1SkrOUlL/Y2PWUlLGSkrnUlLeSkrnSkr/SkqEGBj/KSmlGB'. + 'jeGBjvGBj3GBj/EBD/CAj/AAD3AADvAADnAADeAADWAADOAADG'. + 'AAC9AAC1AACtAAClAACcAACUAACMAACEAAB7AABzAABrAABjAA'. + 'BuukXBAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. + 'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGDNEMgOYAAAAm0'. + 'lEQVR4nI3Q3RKCIBAFYGZMy9RKzX7MVUAUlQTe/+kS0K49d3wD'. + '7JlFaG+CvIR3FvzPXgpLatxevVVS+Jzv0BDGk/UJwOkQ1ph2g/'. + 'Ct5ACX4wNT1o/zzUoJUFUGBiGfVnDTYGJgmrWy8iKEtp0Bpd2d'. + 'jLGu56MB7f4JOOfDJAwoNwslk/jOUi+Jts6RVNrC1hkhPy50Ef'. + 'u79/ADQMQSGQ8bBywAAAAASUVORK5CYII=' ; + + + //========================================================== + // File: bs_lightblue.png + //========================================================== + $this->imgdata_small[1][0]= 657 ; + $this->imgdata_small[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABVl'. + 'BMVEX////////d///AwMC7wcS08P+y+P+xxdCwxM+uws2twMur'. + 'vsinzNynytylzuKhyN6e5v6d5P+d1fOcwNWcu8ub4f+at8iZ3v'. + '+ZvdGY2/yW2f+VscGU1vuT1fqTr72Sx+SSxeKR0fWRz/GPz/OP'. + 'rr+OyeqMy+6Myu2LyeyKxueJudSGw+SGorGDvt+Cvd6CvN2Aud'. + 'p+uNd+t9Z9tdV8tdR8tNN6sc94r813rct2q8h0qcZ0qMVzp8Rx'. + 'o8Bwor5tn7ptnrptnrlsnbhqmbRpmbNpi51ol7Flkqtkkqtkka'. + 'pjj6hijaRhjaZgi6NfiqJfiaFdh55bhJtag5pZgphYgJZYf5VX'. + 'cn9Ve5FSeI1RdopRdYlQdYlPc4dPcoZPcoVNcINLboBLbH9GZn'. + 'hGZXdFZHZEY3RDYnJCXW4/W2s/WWg+Wmo7VmU7VGM7U2E6VGM6'. + 'VGI5UV82T1wGxheQAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. + 'gAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGTok'. + '9Yp9AAAAtElEQVR4nGNgIBaw8wkpKghzwvksPAKiUsraprYiLF'. + 'ARXkE2JiZ1PXMHXzGIAIekOFBE08TGLTCOCyzCLyvDxsZqZOnk'. + 'E56kAhaRV9NQUjW2tPcMjs9wBYsY6Oobmlk7egRGpxZmgkW0zC'. + '2s7Jy9giKT8gohaiQcnVzc/UNjkrMLCyHmcHr7BYREJKTlFxbm'. + 'QOxiEIuKTUzJKgQCaZibpdOzQfwCOZibGRi4dcJyw3S4iQ4HAL'. + 'qvIlIAMH7YAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bs_gray.png + //========================================================== + $this->imgdata_small[2][0]= 550 ; + $this->imgdata_small[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAMAAADH72RtAAABI1'. + 'BMVEX///8AAAD8EAD8IAD8NAD8RAD8VAAYGBi/v7+goKCCgoJk'. + 'ZGRGRkb8yAD83AD87AD8/AD4+ADo+ADY+ADI+AC0+ACk+ACU+A'. + 'CE+AB0/ABk/ABU/ABE/AAw/AAg/AAQ/AAA/AAA+AAA6BAA2CAA'. + 'yDQAtEQApFQAlGQAhHQAdIgAZJgAVKgARLgAMMgAINwAEOwAAP'. + 'wAAPgIAPAQAOgYAOAkANgsANA0AMg8AMBEALhMALBUAKhcAKBo'. + 'AJhwAJB4AIiAAID////4+Pjy8vLs7Ozm5ubg4ODa2trT09PNzc'. + '3Hx8fBwcG7u7u1tbWurq6oqKiioqKcnJyWlpaQkJCJiYmDg4N9'. + 'fX13d3dxcXFra2tkZGReXl5YWFhSUlJMTExGRkZAQEA1BLn4AA'. + 'AAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIA'. + 'AAsSAdLdfvwAAAAHdElNRQfTAwkUGiIctEHoAAAAfElEQVR4nI'. + '2N2xKDIAwF+bZ2kAa8cNFosBD//yvKWGh9dN+yk9kjxH28R7ze'. + 'wzBOYSX6CaNB927Z9qZ66KTSNmBM7UU9Hx2c5qjmJaWCaV5j4t'. + 'o1ANr40sn5a+x4biElrqHgrXMeac/c1nEpFHG0LSFoo/jO/BeF'. + 'lJnFbT58ayUf0BpA8wAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bs_greenblue.png + //========================================================== + $this->imgdata_small[3][0]= 503 ; + $this->imgdata_small[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAxl'. + 'BMVEX///////+/v79znJQhSkJ7raU5hHtjraVKnJRCjIRClIyU'. + '9++E595avbVaxr2/v7+ctbWcvb17nJxrjIx7paUxQkK9//+Mvb'. + '17ra2Evb17tbVCY2MQGBiU5+ec9/eM5+d71tZanJxjra1rvb1j'. + 'tbVSnJxara1rzs5jxsZKlJRChIQpUlIhQkJatbVSpaU5c3MxY2'. + 'MYMTEQISFavb1Sra1KnJxCjIw5e3sxa2spWlpClJQhSkoYOTkp'. + 'Y2MhUlIQKSkIGBgQMTH+e30mAAAAAXRSTlMAQObYZgAAAAFiS0'. + 'dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfT'. + 'AwkUGTIqLgJPAAAAqklEQVR4nI2QVxOCMBCEM6Mi2OiCvSslJB'. + 'CUoqjn//9TYgCfubf9Zu9uZxFqO+rscO7b6l/LljMZX29J2pNr'. + 'YjmX4ZaIEs2NeiWO19NNacl8rHAyD4LR6jjw6PMRdTjZE0JOiU'. + 'dDv2ALTlzRvSdCCfAHGCc7yRPSrAQRQOWxKc3C/IUjBlDdUcM8'. + '97vFGwBY9QsZGBc/A4DWZNbeXIPWZEZI0c2lqSute/gCO9MXGY'. + '4/IOkAAAAASUVORK5CYII=' ; + + //========================================================== + // File: bs_yellow.png + //========================================================== + $this->imgdata_small[4][0]= 507 ; + $this->imgdata_small[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAzF'. + 'BMVEX///////+/v79zYwCMewDOxoTWzoTezkr/5wj/5wDnzgDe'. + 'xgC1pQCtnACllACcjACUhABjWgDGvVK1rUrOxlLGvUqEexilnB'. + 'jv3hj35xj/7wj/7wD35wDv3gDn1gDezgDWxgDOvQDGtQC9rQCE'. + 'ewB7cwBzawBrYwDWzlLn3lLe1krn3kre1hi9tQC1rQCtpQClnA'. + 'CclACUjACMhAD/9wC/v7///8bOzoT//4T//3v//3P//2v//2Pn'. + '50r//0r//yn39xj//xD//wBjYwDO8noaAAAAAXRSTlMAQObYZg'. + 'AAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAH'. + 'dElNRQfTAwkUGSDZl3MHAAAAqElEQVR4nI3QWRNDMBAA4My09E'. + 'IF1SME0VT1okXvM/3//6kEfbZv+81eswA0DfHxRpOV+M+zkDGG'. + 'rL63zCoJ2ef2RLZDIqNqYexyvFrY9ePkxGWdpvfzC7tEGtIRly'. + 'nqzboFKMlizAXbNnZyiFUKAy4bZ+B6W0lRaQDLmg4h/k7eFwDL'. + 'OWIky8qhXUBQ7gKGmsxpC+ah1TdriwByqG8GQNDNr6kLjf/wAx'. + 'KgEq+FpPbfAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bs_darkgray.png + //========================================================== + $this->imgdata_small[5][0]= 611 ; + $this->imgdata_small[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAABJl'. + 'BMVEX////////o8v/f6O7W4OnR3PXL1OTL0evEyLvCzePAwMC/'. + 'v7a8wsq7t7C1xum1vtS1q6GzopmyxeKsrsOqvNWoq7anvN+nsb'. + 'qhrcGgqbGfpq6cp7+bqMuVmJKRm7yPlKKMnL6FkKWFipOEkLSE'. + 'j6qEhoqAiaB+jqd8haF7hZR4iJt4g5l3hZl2gIt2cod1hJVzeY'. + 'VzboJvhp9sfJJsb41peY1pd5xpdoVod4xndI5lcHxka4BjcYVg'. + 'Z3BfboFbb4lbZnZbYntaZ4laZYVZV3JYYWpXX3JWWm5VX4RVW2'. + 'NUYX9SXHxPWn5OVFxNWWtNVXVMVWFKV3xHUGZGU3dGTldFSlxE'. + 'Sk9ESXBCRlNBS3k/SGs/RU4+R1k9R2U6RFU2PUg0PEQxNU0ECL'. + 'QWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAA'. + 'CxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGQmbJetrAAAAtklEQV'. + 'R4nGNgwAK4JZTNNOWlYDxhMT4ZDTOzQE1uMF9CiJWVU0LbxDlS'. + 'G8QVF+FnZ2KRNHAIiPUHaZGSlmZj5lH19A1KjLUA8lXU5MWllF'. + 'yjo30TYr2BfG19G11b37CEeN84H38gX1HbwTUkOjo+zjfG3hLI'. + 'l1exCvCNCwnxjfMz0gTyRdXNHXx9fUNCQu2MwU6SN3ZwD42LCH'. + 'W30IK4T8vUJSAkNMhDiwPqYiktXWN9JZj7UQAAjWEfhlG+kScA'. + 'AAAASUVORK5CYII=' ; + + + //========================================================== + // File: bs_darkgreen.png + //========================================================== + $this->imgdata_small[6][0]= 666 ; + $this->imgdata_small[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABX1'. + 'BMVEX////////l/+nAwMC86r+8wb28wby8wLy78sCzw7SywrSx'. + 'wLKwvrGuvK+syK+ryq2rx62n36ym3aumxKmk2qij0Keh16ahva'. + 'Og1aSguKKe06KeuaCetZ+d0KGdtZ+bz6Cay56ZyZ2Zwp2Zr5qZ'. + 'rpqYwJuXyZuXrJmVw5mUxZiTxJeTw5eTq5WRwJWPtJKOvZKKuI'. + '6Kt42Kn4yJt42ItIuGsomFsYmEsIiEr4eDr4eBrIR/qoN+qIJ8'. + 'poB7pH56o356on14nnt2nXl0mndzmnZzmXZymHVwlXNvlHJukn'. + 'FtiHBqjm1qjW1oi2toiWpniWplh2hlhmdkhWdig2VggGNgf2Je'. + 'fmFdfGBde19bbl1aeFxXdFpWclhVclhVcVdUcFZTb1VSbVRQal'. + 'JPaVFKY0xKYkxJYUtIYEpHX0lEWkZCWERCV0NCVkM/U0A+U0A+'. + 'UUA+UEA9Uj89UT48Tj45TDvewfrHAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. + 'RQfTAwkUGRjxlcuZAAAAtElEQVR4nGNgIBZw8osqqIpzw/msfI'. + 'IiUmr6lo6SbFARASEOJiYtQ2uXADmIAJeEGFBE18LBMySBBywi'. + 'LC/LwcFiZuvmH5WiAxZR0tRW1DC3dfYJS8zyAouYGBibWtm7+o'. + 'TEpZfkgEX0rG3snNx9Q2NSCksgaqRd3Ty8gyLiU/NKSiDmcPsF'. + 'BodHJ2UUlZTkQ+xikIlNSE7LLgECZagL2VQyc0H8YnV2uD94jS'. + 'ILIo14iQ4HALarJBNwbJVNAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bs_purple.png + //========================================================== + $this->imgdata_small[7][0]= 447 ; + $this->imgdata_small[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAnF'. + 'BMVEX///////+/v7/Gvca9rb3Grcb/xv+1hLWte629hL21e7XG'. + 'hMbWhNbOe87We9b/hP//e/97OXv/c///a///Y/+cOZz/Sv/WOd'. + 'bnOefvOe//Kf9jCGNrCGv/EP//CP/nCOf/AP/3APfvAO/nAOfe'. + 'AN7WANbOAM7GAMa9AL21ALWtAK2lAKWcAJyUAJSMAIyEAIR7AH'. + 'tzAHNrAGtjAGPP1sZnAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. + 'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGS'. + 'o5QpoZAAAAnElEQVR4nI3Q2xJDMBAG4MyQokWrZz3oSkJISJH3'. + 'f7dK0Gv/Xb7J7vyzCK0NjtPsHuH/2wlhTE7LnTNLCO/TFQjjIp'. + 'hHAA6bY06LSqppMAY47x+04HXTba2kAFlmQKr+YuVDCGUG2k6/'. + 'rNwYK8rKwKCnPxHnVS0aA3rag4UQslUGhrlk0Kpv1+sx3tLZ6w'. + 'dtYemMkOsnz8R3V9/hB87DEu2Wos5+AAAAAElFTkSuQmCC' ; + + + //========================================================== + // File: bs_brown.png + //========================================================== + $this->imgdata_small[8][0]= 677 ; + $this->imgdata_small[8][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABaF'. + 'BMVEX//////////8X/3oD/3nj/1HX/0Gr/xGP/rkv/gBf+iS/2'. + 'bAL1agDxaQDuZwDrZwLpZQDmZQLlZADjcx7gZATeYQDdZgraXw'. + 'DZXwHYXgDXiEvXZAvUjlfUXwXTjVfTbR7ShUvRbR7RWwDMWQDL'. + 'WADKooLKWADJoYLJgkvHWATGoILFn4LFgEvFVgDEZx7EVQDDt6'. + '/DVQDCt6/CnoLChlfCVADAwMC+hFe+UgC8UgC6UQC4gVe4UAC3'. + 'gVe3UAC1gFe1eUu1TwC1TgCzTgCwTQKuTACrSgCqSgCpSgCpSQ'. + 'CodEulSACkRwCiRgCdRACcRACaQwCYQgCWQgKVQQCVQACUQACS'. + 'UR6RPwCOPgCNPQCLPACKPACJOwCEOQCBOAB+NwB9NgB8NgB7NQ'. + 'B6NwJ4NAB3RR52MwB0MgBuLwBtLwBsLwBqLgBpLQBkLQJiKgBh'. + 'KgBgKwRcKABbKQJbJwBaKQRaJwBYKAJVJQDZvdIYAAAAAXRSTl'. + 'MAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLd'. + 'fvwAAAAHdElNRQfTAwkUGho0tvl2AAAAtklEQVR4nGNgIBaoSg'. + 'mLKGpowfkGMty8AqJKpi4mRlAROR5ONg4JFUv3YHOIgDo/HwsT'. + 'q6yps29EsjZYREFIkJ2ZS9/OMzA20wEsIi8uKSZtaOPmH5WSFw'. + 'YW0VRW07Vw8vCLSMguLwCL6FlaObp6B0TGZxSXQ9TouHv6+IXG'. + 'JGYWlpdDzNEKCgmPjkvLKS0vL4LYxWAen5SelV8OBNZQFxrZ5h'. + 'aC+GX2MDczMBh7pZakehkTHQ4AA0Am/jsB5gkAAAAASUVORK5C'. + 'YII=' ; + + //========================================================== + // File: bs_blue.png + //========================================================== + $this->imgdata_small[9][0]= 436 ; + $this->imgdata_small[9][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAk1'. + 'BMVEX///////+/v7+trcbGxv+EhM6EhNaEhP97e/9zc/9ra/9S'. + 'UsZKSrVSUs5jY/9SUtZKSsZSUudKSt5KSudKSv8YGIQpKf8YGK'. + 'UYGN4YGO8YGPcQEP8ICP8AAP8AAPcAAO8AAOcAAN4AANYAAM4A'. + 'AMYAAL0AALUAAK0AAKUAAJwAAJQAAIwAAIQAAHsAAHMAAGsAAG'. + 'ONFkFbAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. + 'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGhNNakHSAAAAmk'. + 'lEQVR4nI3P2xKCIBAGYGfM6SBWo1nauIqogaDA+z9dK9Lhrv47'. + 'vtl/2A2CfxNlJRRp9IETYGraJeEb7ocLNKznia8A7Db7umWDUG'. + 'sxAzhurxRHxok4KQGqCuEhlL45oU1D2w5BztY4KRhj/bCAsetM'. + '2uObjwvY8/oX50JItYDxSyZSTrO2mNhvGMbaWAevnbFIcpuTr7'. + 't+5AkyfBIKSJHdSQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bs_green.png + //========================================================== + $this->imgdata_small[10][0]= 452 ; + $this->imgdata_small[10][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAn1'. + 'BMVEX///////+/v7+/v7/G/8aUxpSMvYyUzpSMzoyM1oxarVqE'. + '/4R7/3tavVpKnEpaxlpz/3Nr/2tKtUpj/2Na51pKzkpK1kpK50'. + 'pK/0oYcxgp/ykYlBgY3hgY7xgY9xgQ/xAI/wgA/wAA9wAA7wAA'. + '5wAA3gAA1gAAzgAAxgAAvQAAtQAArQAApQAAnAAAlAAAjAAAhA'. + 'AAewAAcwAAawAAYwA0tyxUAAAAAXRSTlMAQObYZgAAAAFiS0dE'. + 'AIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAw'. + 'kUGgW5vvSDAAAAnklEQVR4nI3QSxKCMAwA0M4gqCgoiiJ+kEAL'. + 'LQUq0PufzX7ENdnlJZNkgtDS2CYZvK6bf+7EoKLA9cH5SQzv6A'. + 'YloTywsAbYr44FrlgrXCMJwHl3xxVtuuFkJAPIcw2tGB9GcFli'. + 'oqEf5GTkSUhVMw2TtD0XSlnDOw3SznE5520vNEi7CwW9+Ayjyq'. + 'U/3+yPuq5gvhkhL0xlGnqL//AFf14UIh4mkEkAAAAASUVORK5C'. + 'YII=' ; + + + //========================================================== + // File: bs_white.png + //========================================================== + $this->imgdata_small[11][0]= 480 ; + $this->imgdata_small[11][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAYAAADwMZRfAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMLFTsY/ewvBQAAAW1JREFUeJytkz2u4jAUhT/jic'. + 'gfBUKiZhE0bIKeVbCWrIKenp6eDiGlCEEEBArIxvzGU4xeZjLk'. + 'jWb05lRXuvbx+exr4bouX1Xjyw7Atz81F4uFBYjjGIDhcCjq1o'. + 'k6nN1uZwFerxfP55Msy1itVmRZBsB4PK6YveHkeW5d18XzPIIg'. + 'wPd9Wq0WnU6HMAxJkoQoiuynOIfDwUopkVIihKAoCgAcx6Hdbm'. + 'OMIU1T5vN55eBKEikljUYDIX6kFUKU9e8aDAZlmjcca+1b7TgO'. + '1+uVy+VS9nzfr8e53++VzdZaiqIgz3OMMWitOZ/PaK0JgqDeRC'. + 'mF53lIKYGfr3O73TDGoJQiTVO01nS73XqT4/FIs9kkCAIej0eZ'. + 'brPZEMcxSZKgtQZgMpmIWpN+vy+m06n1PK9yTx8Gy+WS/X5Pr9'. + 'er9GuHLYoiG4YhSilOpxPr9Zrtdlti/JriU5MPjUYjq7UuEWaz'. + '2d+P/b/qv/zi75oetJcv7QQXAAAAAElFTkSuQmCC' ; + + + //========================================================== + // File: bs_cyan.png + //========================================================== + $this->imgdata_small[12][0]= 633 ; + $this->imgdata_small[12][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABPl'. + 'BMVEX////////F///AwMCvxsaC1NSC0dGCz8+CzMyA//94//91'. + '//9q//9j//9X4uJX09NXz89Xx8dXxMRL//9L5uZL3d1L2NhLxs'. + 'ZLt7cv//8e9fUe8fEe7u4e398epqYehoYX//8L+PgK//8F9fUE'. + '/v4E5+cEb28EZ2cC//8C/v4C/f0CzMwCrq4Cjo4CdXUCaWkCZW'. + 'UB/PwA//8A/f0A+/sA8/MA7e0A7OwA6+sA5eUA5OQA4uIA4eEA'. + '3NwA2toA2NgA1dUA09MA0tIA0NAAysoAxsYAxcUAxMQAv78Avr'. + '4AvLwAtrYAtbUAs7MAsLAAra0Aq6sAqKgApaUApKQAoqIAoKAA'. + 'n58AmpoAlZUAk5MAkpIAkJAAj48AjIwAiYkAh4cAf38AfX0Ae3'. + 'sAenoAcnIAcHAAa2sAaWkAaGgAYmIUPEuTAAAAAXRSTlMAQObY'. + 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. + 'AHdElNRQfTAwkUGQDi+VPPAAAAtElEQVR4nGNgIBawikipyIiy'. + 'wfksfJpGRkamNtr8LFARPiMFHmFDcztXfwGoFi0jLiZuZRtnry'. + 'BddrCIiJEGL6eklYO7X3iCOFhE2thESdHawdUnJDZFDiyiamZh'. + 'aevk5h0UlZSpBhaRtbN3dPHwDY5MSM+EqBFzc/f0DgiLTkjLzI'. + 'SYw6bjHxgaEZeckZmpD7GLQSAqJj4xNRMIBGFuFtRLA/ENhGBu'. + 'ZmDgkJBXl5fgIDocAAKcINaFePT4AAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bs_bluegreen.png + //========================================================== + $this->imgdata_small[13][0]= 493 ; + $this->imgdata_small[13][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAvV'. + 'BMVEX///////+/v79j//855/8x3v851v9Spb1C1v8AOUqEtcZK'. + 'lK1StdYxzv8hxv8AY4QASmNSlK1KpcZKtd4YQlIYnM4YrecIvf'. + '8AtfcAre8AjL0AhLUAc5wAa5QAWnsAQloAKTkAGCFKhJxKrdYY'. + 'jL0Ypd4Atf8ArfcApecAnN4AlM4AjMYAe60Ac6UAY4wAUnNSnL'. + '0AlNYAWoQASmsAOVIAITGEtc4YWnsAUnsAMUqtvcaErcYAKUIA'. + 'GCkAECHUyVh/AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAA'. + 'AJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGxNUcXCT'. + 'AAAAqUlEQVR4nI2Q1xKCMBREM2NHLCCogAGCjd6SqLT8/2cZKT'. + '6zb3tm987OBWCsXoejp8rC35fi4+l6gXFZlD0Rz6fZ1tdDmKR9'. + 'RdOmkzmP7DDpilfX3SzvRgQ/Vr1uiZplfsCBiVf03RJd140wgj'. + 'kmNqMtuYXcxyYmNWJdRoYwzpM9qRvGujuCmSR7q7ARY00/MiWk'. + 'sCnjkobNEm1+HknDZgAqR0GKU43+wxdu2hYzbsHU6AAAAABJRU'. + '5ErkJggg==' ; + + //========================================================== + // File: bs_lightred.png + //========================================================== + $this->imgdata_small[14][0]= 532 ; + $this->imgdata_small[14][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAA3l'. + 'BMVEX///////+/v7/Gvb0hGBj/5///3v//zu//1u//xucpGCG9'. + 'nK21lKVSQkp7Wms5KTExISlaOUpjQlIhEBj/tdbOhKXnrcbGjK'. + 'Wla4TetcbGnK2EWmv/rc73pcZ7UmOcY3vOpbW1jJzenLW9e5Rz'. + 'Slq1c4xrQlJSOULGhJz/pcb3nL2chIzOnK33rcbelK3WjKWMWm'. + 'vGe5SEUmM5ISnOtb3GrbXerb3vpb2ca3v/rcaUY3POhJxCKTF7'. + 'SlrWnK21e4ytc4TvnLXnlK2la3taOUK1lJxrSlLGhJRjQkpSMT'. + 'lw+q2nAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. + 'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGjoP2Nm+AAAAr0'. + 'lEQVR4nGNgIBaYiOk62imYwPnMkiIyso76yhJSzFARMxkRNk49'. + 'a3t5OW6oFk1LVkYOfWUHKxUXiEYzLS12DnN3VXkjIRtFsIiSk5'. + '6evqGqhYGKugAfWMRa1FpD2UHeQEXQRlgALCJur+rgbCUNFOAS'. + 'hqjRkZe3MpBTcwEKCEPMMTGSs3Xz8OQHCnBBHckt6OJpIyAMBD'. + 'wwN/MYc4H4LK4wNzMwmGrzcvFqmxIdDgDiHRT6VVQkrAAAAABJ'. + 'RU5ErkJggg==' ; + + //========================================================== + // File: bxs_lightred.png + //========================================================== + $this->imgdata_xsmall[0][0]= 432 ; + $this->imgdata_xsmall[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAA3l'. + 'BMVEX///////+/v7/Gvb0hGBj/5///3v//zu//1u//xucpGCG9'. + 'nK21lKVSQkp7Wms5KTExISlaOUpjQlIhEBj/tdbOhKXnrcbGjK'. + 'Wla4TetcbGnK2EWmv/rc73pcZ7UmOcY3vOpbW1jJzenLW9e5Rz'. + 'Slq1c4xrQlJSOULGhJz/pcb3nL2chIzOnK33rcbelK3WjKWMWm'. + 'vGe5SEUmM5ISnOtb3GrbXerb3vpb2ca3v/rcaUY3POhJxCKTF7'. + 'SlrWnK21e4ytc4TvnLXnlK2la3taOUK1lJxrSlLGhJRjQkpSMT'. + 'lw+q2nAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. + 'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUKBOgGhWjAAAAS0'. + 'lEQVR4nGNgQAEmunYmEJaMCKe1vBxYzJKVQ9lKBSSupKdnaKGi'. + 'zgdkiqs6WKnYcIGYJnK2HvzCwmCNgi42wsLCECNMeXlNUY0HAL'. + 'DaB7Du8MiEAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bxs_bluegreen.png + //========================================================== + $this->imgdata_xsmall[1][0]= 397 ; + $this->imgdata_xsmall[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAvV'. + 'BMVEX///////+/v79j//855/8x3v851v9Spb1C1v8AOUqEtcZK'. + 'lK1StdYxzv8hxv8AY4QASmNSlK1KpcZKtd4YQlIYnM4YrecIvf'. + '8AtfcAre8AjL0AhLUAc5wAa5QAWnsAQloAKTkAGCFKhJxKrdYY'. + 'jL0Ypd4Atf8ArfcApecAnN4AlM4AjMYAe60Ac6UAY4wAUnNSnL'. + '0AlNYAWoQASmsAOVIAITGEtc4YWnsAUnsAMUqtvcaErcYAKUIA'. + 'GCkAECHUyVh/AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAA'. + 'AJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUKDVyF5Be'. + 'AAAASUlEQVR4nGNgQAFmYqJcEJaEOJ+UrD5YTJKFTZrfGCQuaq'. + 'glLWvMaQ5kqujo6hnbKIKYXPr68gp2dmCNJiZAlh3ECGsREWtU'. + '4wF1kwdpAHfnSwAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bxs_navy.png + //========================================================== + $this->imgdata_xsmall[2][0]= 353 ; + $this->imgdata_xsmall[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1'. + 'BMVEX///////+/v7+trcbGxv+EhM6EhNaEhP97e/9zc/9ra/9S'. + 'UsZKSrVSUs5jY/9SUtZKSsZSUudKSt5KSudKSv8YGIQpKf8YGK'. + 'UYGN4YGO8YGPcQEP8ICP8AAP8AAPcAAO8AAOcAAN4AANYAAM4A'. + 'AMYAAL0AALUAAK0AAKUAAJwAAJQAAIwAAIQAAHsAAHMAAGsAAG'. + 'ONFkFbAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. + 'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUJxXO4axZAAAAR0'. + 'lEQVR4nGNgQAGskhKsEJaslIi8ijpYTJaDU1FVAyQuKSujoKKh'. + 'LQ5kSigpqWro6oOYrOoaWroGBmCNWiCWAdQwUVFWVOMBOp4GCJ'. + 's5S60AAAAASUVORK5CYII=' ; + + //========================================================== + // File: bxs_gray.png + //========================================================== + $this->imgdata_xsmall[3][0]= 492 ; + $this->imgdata_xsmall[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABI1'. + 'BMVEX///8AAAD8EAD8IAD8NAD8RAD8VAAYGBi/v7+goKCCgoJk'. + 'ZGRGRkb8yAD83AD87AD8/AD4+ADo+ADY+ADI+AC0+ACk+ACU+A'. + 'CE+AB0/ABk/ABU/ABE/AAw/AAg/AAQ/AAA/AAA+AAA6BAA2CAA'. + 'yDQAtEQApFQAlGQAhHQAdIgAZJgAVKgARLgAMMgAINwAEOwAAP'. + 'wAAPgIAPAQAOgYAOAkANgsANA0AMg8AMBEALhMALBUAKhcAKBo'. + 'AJhwAJB4AIiAAID////4+Pjy8vLs7Ozm5ubg4ODa2trT09PNzc'. + '3Hx8fBwcG7u7u1tbWurq6oqKiioqKcnJyWlpaQkJCJiYmDg4N9'. + 'fX13d3dxcXFra2tkZGReXl5YWFhSUlJMTExGRkZAQEA1BLn4AA'. + 'AAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEA'. + 'AAsRAX9kX5EAAAAHdElNRQfTAwkUKC74clmyAAAAQklEQVR4nG'. + 'NgQAVBYVCGt5dXYEQ0mOnp5h4QFgVmeri6+4dHxYMVeHoFRUTH'. + 'gTUFBIZBWAwMkZEx8bFQM2Lj0UwHANc/DV6yq/BiAAAAAElFTk'. + 'SuQmCC' ; + + //========================================================== + // File: bxs_graypurple.png + //========================================================== + $this->imgdata_xsmall[4][0]= 542 ; + $this->imgdata_xsmall[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABSl'. + 'BMVEX////////11P/MqdvKrNfAwMC+u7+9u7+4rr24lsi3rby3'. + 'lMe1rLq1o720q7i0oL20ksSzoryyqbaykMGxlb2wkL+vnbiujb'. + '2sjLuri7qpl7GoirWoibenmK2mla6mjLKmhrSllauki7CjhrCj'. + 'hLGihLChg6+ggq2fkqadkKOcfqqai6Gag6WYe6WXeqSWeaOTd6'. + 'CTd5+Rdp6RdZ6RdZ2Qg5eOc5qMcpiLcZeJb5WIbpOHbZKGbJGE'. + 'a4+CaY2AZ4t/Z4p/Zop/Zol+Zol7ZIZ6Y4V5YoR1ZH11X391Xn'. + '9zXX1yXXtxXHtvWnluWXhsV3VqVnNpVXJoVHFnU3BmUm9jUGth'. + 'VGdgTmheTGZcS2RcSmRaSWJYR19XRl5SQllRQlhQQVdPQFZOP1'. + 'VLPlFJO09IPE5IOk5FOEtEN0lDOEpDOElDNklCNkc/M0XhbrfD'. + 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. + 'EAAAsRAX9kX5EAAAAHdElNRQfTAwkUKCgREfyHAAAATUlEQVR4'. + 'nGNgQAEcIko8EBY3M5Ougy+IxSXMwmTsFsAHZMqrSRvZB0W7A5'. + 'k6FlYugXEZICaPr394Um4uSAFDRFRCbm4uxAihsDAhVOMBHT0L'. + 'hkeRpo8AAAAASUVORK5CYII=' ; + + //========================================================== + // File: bxs_red.png + //========================================================== + $this->imgdata_xsmall[5][0]= 357 ; + $this->imgdata_xsmall[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1'. + 'BMVEX////////GxsbGra3/xsbOhITWhIT/hIT/e3v/c3P/a2vG'. + 'UlK1SkrOUlL/Y2PWUlLGSkrnUlLeSkrnSkr/SkqEGBj/KSmlGB'. + 'jeGBjvGBj3GBj/EBD/CAj/AAD3AADvAADnAADeAADWAADOAADG'. + 'AAC9AAC1AACtAAClAACcAACUAACMAACEAAB7AABzAABrAABjAA'. + 'BuukXBAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. + 'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUIyjy5SVMAAAAS0'. + 'lEQVR4nGNgQAFsUpJsEJastIi8ijpYTJaDU0FVgxXIlJKVUVDR'. + '0BYHMiUUlVQ1dPVBTDZ1dS1dAwOQAgYtbSDLAGIEq6goK6rxAD'. + 'yXBg73lwGUAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: bxs_yellow.png + //========================================================== + $this->imgdata_xsmall[6][0]= 414 ; + $this->imgdata_xsmall[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAzF'. + 'BMVEX///////+/v79zYwCMewDOxoTWzoTezkr/5wj/5wDnzgDe'. + 'xgC1pQCtnACllACcjACUhABjWgDGvVK1rUrOxlLGvUqEexilnB'. + 'jv3hj35xj/7wj/7wD35wDv3gDn1gDezgDWxgDOvQDGtQC9rQCE'. + 'ewB7cwBzawBrYwDWzlLn3lLe1krn3kre1hi9tQC1rQCtpQClnA'. + 'CclACUjACMhAD/9wC/v7///8bOzoT//4T//3v//3P//2v//2Pn'. + '50r//0r//yn39xj//xD//wBjYwDO8noaAAAAAXRSTlMAQObYZg'. + 'AAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAH'. + 'dElNRQfTAwkUIzoBXFQEAAAAS0lEQVR4nGNgQAFsDhJsEJaTo5'. + '2skj5YzMnSSk7ZwBzIlOSUklPiMxYHMnW4FXT5VNVBTDZeXiNV'. + 'QUGQAgYBYyBLEGIEq5gYK6rxAH4kBmHBaMQQAAAAAElFTkSuQm'. + 'CC' ; + + //========================================================== + // File: bxs_greenblue.png + //========================================================== + $this->imgdata_xsmall[7][0]= 410 ; + $this->imgdata_xsmall[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAxl'. + 'BMVEX///////+/v79znJQhSkJ7raU5hHtjraVKnJRCjIRClIyU'. + '9++E595avbVaxr2/v7+ctbWcvb17nJxrjIx7paUxQkK9//+Mvb'. + '17ra2Evb17tbVCY2MQGBiU5+ec9/eM5+d71tZanJxjra1rvb1j'. + 'tbVSnJxara1rzs5jxsZKlJRChIQpUlIhQkJatbVSpaU5c3MxY2'. + 'MYMTEQISFavb1Sra1KnJxCjIw5e3sxa2spWlpClJQhSkoYOTkp'. + 'Y2MhUlIQKSkIGBgQMTH+e30mAAAAAXRSTlMAQObYZgAAAAFiS0'. + 'dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfT'. + 'AwkUJy5/6kV9AAAATUlEQVR4nGNgQAGCyuyCEJaGugKHviVYzF'. + 'hO3sxCWwDIVNLTM9PXtpEGMhW12Cy0DR1ATEFLSxZ7BweQAgYd'. + 'HUMHBweIEQKiogKoxgMAo/4H5AfSehsAAAAASUVORK5CYII=' ; + + //========================================================== + // File: bxs_purple.png + //========================================================== + $this->imgdata_xsmall[8][0]= 364 ; + $this->imgdata_xsmall[8][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAnF'. + 'BMVEX///////+/v7/Gvca9rb3Grcb/xv+1hLWte629hL21e7XG'. + 'hMbWhNbOe87We9b/hP//e/97OXv/c///a///Y/+cOZz/Sv/WOd'. + 'bnOefvOe//Kf9jCGNrCGv/EP//CP/nCOf/AP/3APfvAO/nAOfe'. + 'AN7WANbOAM7GAMa9AL21ALWtAK2lAKWcAJyUAJSMAIyEAIR7AH'. + 'tzAHNrAGtjAGPP1sZnAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. + 'HUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUIj'. + 'mBTjT/AAAASUlEQVR4nGNgQAGskhKsEJaCrJiSuhZYTEFASFlD'. + 'GyQuqSCnrK6tJwpkiquoamgbGIGYrFpaugbGxmCNunpAljHECB'. + 'ZBQRZU4wFSMAZsXeM71AAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bxs_green.png + //========================================================== + $this->imgdata_xsmall[9][0]= 370 ; + $this->imgdata_xsmall[9][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAn1'. + 'BMVEX///////+/v7+/v7/G/8aUxpSMvYyUzpSMzoyM1oxarVqE'. + '/4R7/3tavVpKnEpaxlpz/3Nr/2tKtUpj/2Na51pKzkpK1kpK50'. + 'pK/0oYcxgp/ykYlBgY3hgY7xgY9xgQ/xAI/wgA/wAA9wAA7wAA'. + '5wAA3gAA1gAAzgAAxgAAvQAAtQAArQAApQAAnAAAlAAAjAAAhA'. + 'AAewAAcwAAawAAYwA0tyxUAAAAAXRSTlMAQObYZgAAAAFiS0dE'. + 'AIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAw'. + 'kUKBrZxq0HAAAATElEQVR4nGNgQAGccrIcEJaivISyhjaIxa7I'. + 'I6CiqcMKZMopKqho6OhLA5kyqmqaOobGICartraeoYkJSAGDnj'. + '6QZQIxgk1Skg3VeABlVgbItqEBUwAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bxs_darkgreen.png + //========================================================== + $this->imgdata_xsmall[10][0]= 563 ; + $this->imgdata_xsmall[10][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABX1'. + 'BMVEX////////l/+nAwMC86r+8wb28wby8wLy78sCzw7SywrSx'. + 'wLKwvrGuvK+syK+ryq2rx62n36ym3aumxKmk2qij0Keh16ahva'. + 'Og1aSguKKe06KeuaCetZ+d0KGdtZ+bz6Cay56ZyZ2Zwp2Zr5qZ'. + 'rpqYwJuXyZuXrJmVw5mUxZiTxJeTw5eTq5WRwJWPtJKOvZKKuI'. + '6Kt42Kn4yJt42ItIuGsomFsYmEsIiEr4eDr4eBrIR/qoN+qIJ8'. + 'poB7pH56o356on14nnt2nXl0mndzmnZzmXZymHVwlXNvlHJukn'. + 'FtiHBqjm1qjW1oi2toiWpniWplh2hlhmdkhWdig2VggGNgf2Je'. + 'fmFdfGBde19bbl1aeFxXdFpWclhVclhVcVdUcFZTb1VSbVRQal'. + 'JPaVFKY0xKYkxJYUtIYEpHX0lEWkZCWERCV0NCVkM/U0A+U0A+'. + 'UUA+UEA9Uj89UT48Tj45TDvewfrHAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'. + 'RQfTAwkUKCFozUQjAAAATUlEQVR4nGNgQAGcoqrcEJYQB5OhSw'. + 'CIxSXGwWThGcIDZCppK5o7hyV6AZl6NnbuoSmFICZ3YHB0RkkJ'. + 'SAFDbEJaSUkJxAjeyEheVOMBQj4MOEkWew4AAAAASUVORK5CYI'. + 'I=' ; + + //========================================================== + // File: bxs_cyan.png + //========================================================== + $this->imgdata_xsmall[11][0]= 530 ; + $this->imgdata_xsmall[11][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABPl'. + 'BMVEX////////F///AwMCvxsaC1NSC0dGCz8+CzMyA//94//91'. + '//9q//9j//9X4uJX09NXz89Xx8dXxMRL//9L5uZL3d1L2NhLxs'. + 'ZLt7cv//8e9fUe8fEe7u4e398epqYehoYX//8L+PgK//8F9fUE'. + '/v4E5+cEb28EZ2cC//8C/v4C/f0CzMwCrq4Cjo4CdXUCaWkCZW'. + 'UB/PwA//8A/f0A+/sA8/MA7e0A7OwA6+sA5eUA5OQA4uIA4eEA'. + '3NwA2toA2NgA1dUA09MA0tIA0NAAysoAxsYAxcUAxMQAv78Avr'. + '4AvLwAtrYAtbUAs7MAsLAAra0Aq6sAqKgApaUApKQAoqIAoKAA'. + 'n58AmpoAlZUAk5MAkpIAkJAAj48AjIwAiYkAh4cAf38AfX0Ae3'. + 'sAenoAcnIAcHAAa2sAaWkAaGgAYmIUPEuTAAAAAXRSTlMAQObY'. + 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAA'. + 'AHdElNRQfTAwkUKQFKuFWqAAAATUlEQVR4nGNgQAGsUjJsEJaR'. + 'grC5qz9YzIiL28YriB3IlDZRsnYNiZUDMmXtHT2CE9JBTDb/wI'. + 'jkzEyQAoaomMTMzEyIERzy8hyoxgMAN2MLVPW0f4gAAAAASUVO'. + 'RK5CYII=' ; + + //========================================================== + // File: bxs_orange.png + //========================================================== + $this->imgdata_xsmall[12][0]= 572 ; + $this->imgdata_xsmall[12][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABaF'. + 'BMVEX//////////8X/3oD/3nj/1HX/0Gr/xGP/rkv/gBf+iS/2'. + 'bAL1agDxaQDuZwDrZwLpZQDmZQLlZADjcx7gZATeYQDdZgraXw'. + 'DZXwHYXgDXiEvXZAvUjlfUXwXTjVfTbR7ShUvRbR7RWwDMWQDL'. + 'WADKooLKWADJoYLJgkvHWATGoILFn4LFgEvFVgDEZx7EVQDDt6'. + '/DVQDCt6/CnoLChlfCVADAwMC+hFe+UgC8UgC6UQC4gVe4UAC3'. + 'gVe3UAC1gFe1eUu1TwC1TgCzTgCwTQKuTACrSgCqSgCpSgCpSQ'. + 'CodEulSACkRwCiRgCdRACcRACaQwCYQgCWQgKVQQCVQACUQACS'. + 'UR6RPwCOPgCNPQCLPACKPACJOwCEOQCBOAB+NwB9NgB8NgB7NQ'. + 'B6NwJ4NAB3RR52MwB0MgBuLwBtLwBsLwBqLgBpLQBkLQJiKgBh'. + 'KgBgKwRcKABbKQJbJwBaKQRaJwBYKAJVJQDZvdIYAAAAAXRSTl'. + 'MAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9k'. + 'X5EAAAAHdElNRQfTAwkUJBSSy88MAAAATUlEQVR4nGNgQAGqwo'. + 'paEBYPJ4eKezCIpc7HwmrqG6ENZMpLihm6RaWEAZl6Vo7ekRnF'. + 'IKZWSHhcTnk5SAFDfFJWeXk5xAjj1FRjVOMBeFwNcWYSLjsAAA'. + 'AASUVORK5CYII=' ; + + //========================================================== + // File: bxs_lightblue.png + //========================================================== + $this->imgdata_xsmall[13][0]= 554 ; + $this->imgdata_xsmall[13][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABVl'. + 'BMVEX////////d///AwMC7wcS08P+y+P+xxdCwxM+uws2twMur'. + 'vsinzNynytylzuKhyN6e5v6d5P+d1fOcwNWcu8ub4f+at8iZ3v'. + '+ZvdGY2/yW2f+VscGU1vuT1fqTr72Sx+SSxeKR0fWRz/GPz/OP'. + 'rr+OyeqMy+6Myu2LyeyKxueJudSGw+SGorGDvt+Cvd6CvN2Aud'. + 'p+uNd+t9Z9tdV8tdR8tNN6sc94r813rct2q8h0qcZ0qMVzp8Rx'. + 'o8Bwor5tn7ptnrptnrlsnbhqmbRpmbNpi51ol7Flkqtkkqtkka'. + 'pjj6hijaRhjaZgi6NfiqJfiaFdh55bhJtag5pZgphYgJZYf5VX'. + 'cn9Ve5FSeI1RdopRdYlQdYlPc4dPcoZPcoVNcINLboBLbH9GZn'. + 'hGZXdFZHZEY3RDYnJCXW4/W2s/WWg+Wmo7VmU7VGM7U2E6VGM6'. + 'VGI5UV82T1wGxheQAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. + 'gAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUJziL'. + 'PvAsAAAATUlEQVR4nGNgQAHsQgqcEJYgG5Oegy+IxSHOxmTiFs'. + 'gFZMprKBnbB8e7AplaFlbOQUl5ICanX0BEWmEhSAFDVGxKYWEh'. + 'xAjusDBuVOMBJO8LrFHRAykAAAAASUVORK5CYII=' ; + + //========================================================== + // File: bxs_darkgray.png + //========================================================== + $this->imgdata_xsmall[14][0]= 574 ; + $this->imgdata_xsmall[14][1]= + 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABm'. + 'JLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsRAAALEQF/ZF+RAAAB'. + 'iElEQVR42k3QPU8TYRwA8P//ebkXrgdIColXRAOEkJqbaExMut'. + 'DBhE1GNjYHPg+DG6ODiU6QOLjVxITBcFKBYCstlAC2Bz17fe76'. + 'vLD6+wg/1FpTRFR5lpaub/u1eGBGaAT4HneD4OlXx7avtDYUjT'. + 'HQabd2Ti8e3vVSKzxrtHS32wIpFVldno22Nqvvg2Bhl0gp/aNm'. + 'vJ3qqXAtLIva+ks1H0wqlSXi4+d6+OFTfRsAfHJx2d1od24rZP'. + 'xP2HzopINr1mkesX7ccojqif0v9crxWXODZTno3+dNGA7uWLsd'. + 'mUYU4fHJCViMG9umLBmM4L6fagZGg9QKfjZ+Qfy3C3G/B3mugF'. + 'IHHNcDf64E3KJALApk2p8CSolUUqLjFkyxOGMsTtFyJ+Wz57NQ'. + '8DghS4sLB0svioeZZo7nPhFoUKZDIVFbglkTTnl5/rC8snjAkJ'. + 'Bk/XV5LxHC/v7tR8jzTFPbg8LENK9WX0Vv31T2AEmCSmlKCCoh'. + 'ROnP1U1tPFYjJBRcbtzSf+GPsFTAQBq1n4AAAABKdEVYdHNpZ2'. + '5hdHVyZQBiYzYyMDIyNjgwYThjODMyMmUxNjk0NWUzZjljOGFh'. + 'N2VmZWFhMjA4OTE2ZjkwOTdhZWE1MzYyMjk0MWRkM2I5EqaPDA'. + 'AAAABJRU5ErkJggg==' ; + } +} + +?> diff --git a/includes/jpgraph/src/imgdata_bevels.inc.php b/includes/jpgraph/src/imgdata_bevels.inc.php new file mode 100644 index 0000000..f3ae11c --- /dev/null +++ b/includes/jpgraph/src/imgdata_bevels.inc.php @@ -0,0 +1,104 @@ + 'imgdata'); + + protected $colors = array('green','purple','orange','red','yellow'); + protected $index = array('green'=>1,'purple'=>4,'orange'=>2,'red'=>0,'yellow'=>3); + protected $maxidx = 4 ; + + protected $imgdata ; + + function __construct() { + //========================================================== + // File: bullets_balls_red_013.png + //========================================================== + $this->imgdata[0][0]= 337 ; + $this->imgdata[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. + 'BMVEX////////27t/f3+LFwcmNxMuxm62DmqKth1VpZmIWg6fv'. + 'HCa7K0BwMEytCjFnIyUlEBg9vhQvAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. + 'RQfTAxcBNhk+pYJVAAAAl0lEQVR4nE2Q2xLDIAgFHUWBKJf//9'. + 'oekmbafVDZARRbK/pYTKP9WNcNv64zzUdd9BjmrgnsVXRNSzO3'. + 'CJ5ahdhy0XKQkxld1kxb45j7dp0x2lBNOyVgQpMaoadX7Hs7zr'. + 'P1yKj47DKBnKaBKiSAkNss7O6PkMx6kIgYXISQJpcZCqdY6KR+'. + 'J1PkS5Xob/h7MNz8x6D3fz5DKQjpkZOBYAAAAABJRU5ErkJggg'. + '==' ; + + //========================================================== + // File: bullets_balls_green_013.png + //========================================================== + $this->imgdata[1][0]= 344 ; + $this->imgdata[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. + 'BMVEX////////27t/e3+K3vriUub/Dm18j4xc3ob10k0ItqQlU'. + 'e5JBmwpxY1ENaKBgUh0iHgwsSre9AAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. + 'RQfTAxcBNTfJXtxZAAAAnklEQVR4nE2QWY4EMQhDUVhSIRC4/2'. + 'kbaqLp9p+f2AxAayAzDfiK9znPORuvH0x8Ss9z6I9sHp6tcxE9'. + 'nLmWmebmt5F5p2AR0+C9AWpLBjXRaZsCAT3SqklVp0YkAWaGtd'. + 'c5Z41/STYpPzW7BjyiRrwkVmQto/Cw9tNEMvsgcekyCyFPboIu'. + 'IsuXiKffYB4NK4r/h6d4g9HPPwCR7i8+GscIiiaonUAAAAAASU'. + 'VORK5CYII=' ; + + //========================================================== + // File: bullets_balls_oy_035.png + //========================================================== + $this->imgdata[2][0]= 341 ; + $this->imgdata[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. + 'BMVEX////////27t/f3+K5tbqNwcjnkjXjbxR2i5anfEoNkbis'. + 'PBxpU0sZbZejKgdqIRIlERIwYtkYAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. + 'RQfTAxcBNgK0wEu5AAAAm0lEQVR4nE3QVxIEIQgEUErAgTHA/U'. + '+7zbipf9RXgoGo0liMmX6RdSPLPtZM9F4LuuSIaZtZWffiU6Iz'. + 'Y8SOMF0NogBj30ioGRGLZgiPvce1TbIRz6oBQEbOFGK0rIoxrn'. + '5hDomMA1cfGRCaRVhjS3gkzheM+4HtnlkXcvdZhWG4qZawewe6'. + '9Jnz/TKLB/ML6HUepn//QczazuwFO/0Ivpolhi4AAAAASUVORK'. + '5CYII=' ; + + //========================================================== + // File: bullets_balls_oy_036.png + //========================================================== + $this->imgdata[3][0]= 340 ; + $this->imgdata[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. + 'BMVEX////////27t/e3+LO3hfYzz65ubiNwci6uQ12ipadgVGa'. + 'fwsNkbhnVkcaZ5dwSA8lFg7CEepmAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'. + 'RQfTAxcCBySi1nevAAAAjElEQVR4nFXPWw7EIAgFUNMoCMhj/6'. + 'staKczc/2RkwjS2glQ+w3YytgXCXCZpRo8gJdGxZadJws13CUP'. + '4SZI4MYiUxypeiGGw1XShVBTNN9kLXP2GRrZPFvKgd7z/sqGGV'. + '7C7r7r3l09alYN3iA8Yn+ImdVrNoEeSRqJPAaHfhZzLYwXstdZ'. + 'rP3n2bvdAI4INwtihiwAAAAASUVORK5CYII=' ; + + //========================================================== + // File: bullets_balls_pp_019.png + //========================================================== + $this->imgdata[4][0]= 334 ; + $this->imgdata[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'. + 'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'. + 'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. + 'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'. + 'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'. + '5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'. + '4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'. + 'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ; + + } +} + + +?> diff --git a/includes/jpgraph/src/imgdata_diamonds.inc.php b/includes/jpgraph/src/imgdata_diamonds.inc.php new file mode 100644 index 0000000..7ce4353 --- /dev/null +++ b/includes/jpgraph/src/imgdata_diamonds.inc.php @@ -0,0 +1,177 @@ +'imgdata'); + protected $colors = array('lightblue','darkblue','gray', + 'blue','pink','purple','red','yellow'); + protected $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6, + 'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3); + + protected $maxidx = 7 ; + protected $imgdata ; + + function __construct() { + //========================================================== + // File: diam_red.png + //========================================================== + $this->imgdata[0][0]= 668 ; + $this->imgdata[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'. + 'BMVEX///////+cAAD/AADOAABjAABrAADWGBjOCAj/CAj/GBj/'. + 'EBCcCAiMOTl7KSl7ISFzGBilGBjOEBBrCAjv5+eMQkK1QkKtMT'. + 'GtKSnWKSn/KSlzEBCcEBDexsb/tbXOe3ucWlqcUlKUSkr/e3vn'. + 'a2u9UlL/a2uEMTHeUlLeSkqtOTn/UlL/SkrWOTn/QkL/OTmlIS'. + 'H/MTH/ISH39/f/9/f35+fezs7/5+fvzs7WtbXOra3nvb3/zs7G'. + 'nJzvtbXGlJTepaW9jIy1hITWlJS1e3uta2ulY2P/lJTnhITne3'. + 'vGY2O9Wlr/c3PeY2O1Skr/Y2P/WlreQkLWISGlEBCglEUaAAAA'. + 'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'. + 'sSAdLdfvwAAAAHdElNRQfTAwsWEw5WI4qnAAABGUlEQVR4nHXQ'. + '1XLDMBAFUKUCM1NiO8zcpIxpp8z0//9SWY7b2LHv6EU6s1qtAN'. + 'iMBAojLPkigpJvogKC4pxDuQipjanlICXof1RQDkYEF21mKIfg'. + '/GGKtjAmOKt9oSyuCU7OhyiDCQnjowGfRnooCJIkiWJvv8NxnG'. + 'nyNAwFcekvZpPP3mu7Vrp8fOq8DYbTyjdnAvBj7Jbd7nP95urs'. + '+MC2D6unF+Cu0VJULQBAlsOQuueN3Hrp2nGUvqppemBZ0aU7Se'. + 'SXvYZFMKaLJn7MH3btJmZEMEmGSOreqy0SI/4ffo3uiUOYEACy'. + 'OFopmNWlP5uZd9uPWmUoxvK9ilO9NtBo6mS7KkZD0fOJYqgGBU'. + 'S/T7OKCAA9tfsFOicXcbxt29cAAAAASUVORK5CYII=' ; + + //========================================================== + // File: diam_pink.png + //========================================================== + $this->imgdata[1][0]= 262 ; + $this->imgdata[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. + 'BMVEX///+AgID/M5n/Zpn/zMz/mZn1xELhAAAAAXRSTlMAQObY'. + 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. + 'AHdElNRQfTAwsWEi3tX8qUAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. + 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. + '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. + 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. + '==' ; + + //========================================================== + // File: diam_blue.png + //========================================================== + $this->imgdata[2][0]= 662 ; + $this->imgdata[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA+V'. + 'BMVEX///+AgIAAAJwAAP8AAM4AAGMAAGsQEP8YGHMQEHMYGP8Q'. + 'EKUICJwICM5KSpQxMYQpKXsYGNYQEM4ICGsICP97e85aWpw5OY'. + 'xSUv85ObVCQt4xMa0pKa0hIaUpKf+9vd6EhLVra+dzc/9SUr1r'. + 'a/9aWt5SUt5CQrVaWv9KSv8hIXs5Of8xMf8pKdYhIdYYGKUhIf'. + '/Ozs739//v7/fn5+/v7//n5/fW1ufOzufOzu/W1v+trc69veel'. + 'pc6trd6UlMa9vf+MjL21tfe1tf+UlNZzc61ra6Wlpf+EhOeMjP'. + '9ra8ZSUpyEhP9CQoxKSrVCQv85Od4xMdYQENZnJhlWAAAAAXRS'. + 'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. + 'LdfvwAAAAHdElNRQfTAwsWEx3Snct5AAABFklEQVR4nHXR5XbD'. + 'IBgGYM6AuHsaqbvOfeuknev9X8xISbplSd5/8JyXwwcA/I0AKm'. + 'PFchVBdvKNKggKQx2VIoRwMZihMiQE49YUlWBCcPL0hYq4ITh+'. + 'qKECUoLDZWqoQNA766F/mJHlHXblPJJNiyURhM5eU9cNw5BlmS'. + 'IrLOLxhzfotF7vwO2j3ez2ap/TmW4AIM7DoN9+tu+vLk6Pdg9O'. + '6ufXjfXLm6pxPACSJIpRFAa+/26DhuK6qjbiON40k0N3skjOvm'. + 'NijBmchF5mi+1jhQqDmWyIzPp1hUlrv8On5l+6mMm1tigFNyrt'. + '5R97g+FKKyGKkTNKesXPJTZXOFIrUoKiypcTQVHjK4g8H2dWEQ'. + 'B8bvUDLSQXSr41rmEAAAAASUVORK5CYII=' ; + + //========================================================== + // File: diam_yellow.png + //========================================================== + $this->imgdata[3][0]= 262 ; + $this->imgdata[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. + 'BMVEX///+AgIBmMwCZZgD/zADMmQD/QLMZAAAAAXRSTlMAQObY'. + 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. + 'AHdElNRQfTAwsWEwcv/zIDAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. + 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. + '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. + 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. + '==' ; + + //========================================================== + // File: diam_lightblue.png + //========================================================== + $this->imgdata[4][0]= 671 ; + $this->imgdata[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/1'. + 'BMVEX///+AgIAAnP8A//8Azv8AY/8Aa/8I//8Y1v8Izv8Y//8Q'. + '//8InP8Qzv8Ypf85jP8he/8Yc/8Ia/8pe/8p//8p1v9Ctf8xrf'. + '8prf8QnP8Qc/9CjP+1//97//9r//9S//9K//9C//85//8x//8h'. + '//9r5/9K3v9S3v851v97zv9Svf85rf8hpf/G3v9SnP9anP9KlP'. + '8xhP/n7//v7+f3///n///O//+U//9z//9j//9a//975/9C3v8h'. + '1v+E5/+17/9j3v/O7//n9/+95/+l3v9jxv+U1v8Qpf9avf9Ktf'. + '+Uxv+11v97tf9rrf+cxv+Mvf9jpf+tzv+Etf/O3v/39/8Akkxr'. + 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. + 'IAAAsSAdLdfvwAAAAHdElNRQfTAwsWEiHk6Ya/AAABGUlEQVR4'. + 'nHXQ13KDMBAF0J2o0E01GHDvJa7p3em95/+/JQJMYjDc0Yt0Zr'. + 'VaAaxHgtxwbSGPkGQpOIeQ2ORxJiJmNWYZyAhZR0WcgQGhViU0'. + 'nEGoedDHGxgRapRPcRpXhOr7XZzCmLjaXk9IIjvkOEmSRLG62+'. + 'F5XlEElhA5sW21GvXj6mGlDBfnJ51lr9svnvEKwH1hu2QPbwd3'. + 'N9eXVzuL7/Hn29frdKaamgcgy67L3HFG9gDefV+dm5qme4YRXL'. + 'oVR374mRqUELZYosf84XAxISFRQuMh4rrH8YxGSP6HX6H97NNQ'. + 'KEAaR08qCeuSnx2a8zIPWqUowtKHSRK91rAw0elmVYQFVc8mhq'. + '7p5RD7Ps3IIwA9sfsFxFUX6eZ4Zh4AAAAASUVORK5CYII=' ; + + //========================================================== + // File: diam_purple.png + //========================================================== + $this->imgdata[5][0]= 657 ; + $this->imgdata[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'. + 'BMVEX///////8xAP/OAP+cAP9jAP9rAP+cCP85CP/OEP9SKf/O'. + 'CP9CEP9zGP9rCP+lGP/WOf/WIf9KIf9jOf+MQv+EMf97If9zEP'. + '+1Sv+lIf/ne//eUv/na//n5//Oxv/Wzv+chP9zUv97Wv9rQv9a'. + 'Mf9KGP/v5/+te/97Kf+9Y/+tOf+tKf+lEP/vtf/WMf/WKf/v7+'. + 'f39/+tnP+9rf9rSv9jQv9CGP+ljP+EY//Gtf+tlP+Ma/9zSv/e'. + 'zv+UUv+9lP+cWv+lY/+cUv+MOf+EKf+UQv/Opf/OhP/Ga/+1Qv'. + '/Oe/+9Uv/ntf/eWv/eSv/WGP/3zv/vlP/WEP//9/+pL4oHAAAA'. + 'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'. + 'sSAdLdfvwAAAAHdElNRQfTAwsWEjX+M1LCAAABDklEQVR4nHXQ'. + '1bLDIBAGYFqIEW+ksbr7cXd3ff93OUCamdOE/Mxw882yywLwPz'. + '+gNKotlRFUVnNUQlCxTMRFCKEdE+MgpJaEiIOU4DKaoSIygtb3'. + 'FBUQrm3xjPK4JvXjK0A5hFniYSBtIilQVYUm+X0KTVNiYah+2q'. + 'ulFb8nUbSovD2+TCavwXQWmnMA6ro+di+uR5cPzfPhVqPV3N1p'. + 'n3b3+rimAWAYhP3xnXd7P6oc9vadPsa1wYEs00dFQRAFehlX21'. + '25Sg9NOgwF5jeNTjVL9om0TjDc1lmeCKZ17nFPzhPtSRt6J06R'. + 'WKUoeG3MoXRa/wjLHGLodwZcotPqjsYngnWslRBZH91hWTbpD2'. + 'EdF1ECWW1SAAAAAElFTkSuQmCC' ; + + //========================================================== + // File: diam_gray.png + //========================================================== + $this->imgdata[6][0]= 262 ; + $this->imgdata[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. + 'BMVEX//////wAzMzNmZmbMzMyZmZlq4Qo5AAAAAXRSTlMAQObY'. + 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. + 'AHdElNRQfTAwsWExZFTxLxAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. + 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. + '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. + 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. + '==' ; + + //========================================================== + // File: diam_blgr.png + //========================================================== + $this->imgdata[7][0]= 262 ; + $this->imgdata[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'. + 'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'. + 'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. + 'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'. + 'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'. + '6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'. + 'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'. + '==' ; + } +} + +?> diff --git a/includes/jpgraph/src/imgdata_pushpins.inc.php b/includes/jpgraph/src/imgdata_pushpins.inc.php new file mode 100644 index 0000000..8988e11 --- /dev/null +++ b/includes/jpgraph/src/imgdata_pushpins.inc.php @@ -0,0 +1,517 @@ + 'imgdata_small', + MARK_IMG_SPUSHPIN => 'imgdata_small', + MARK_IMG_LPUSHPIN => 'imgdata_large'); + + protected $colors = array('blue','green','orange','pink','red'); + protected $index = array('red' => 0, 'orange' => 1, 'pink' => 2, 'blue' => 3, 'green' => 4 ) ; + protected $maxidx = 4 ; + protected $imgdata_large, $imgdata_small ; + + function __construct() { + + // The anchor should be where the needle "hits" the paper + // (bottom left corner) + $this->anchor_x = 0; + $this->anchor_y = 1; + + //========================================================== + // File: ppl_red.png + //========================================================== + $this->imgdata_large[0][0]= 2490 ; + $this->imgdata_large[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMKBh4Ryh89CgAACUdJREFUeJy9mNtTFFcexz+/7p'. + '4Lw1wZJKDGCAwmDAqUySamcCq1ed6k9mn3UfMP7F+1T3nYqn2J'. + 'lZdoDEjpbq0KG8EBFBFBEJye6Zmenkv32Ydu5GYiUMmeqq6uqT'. + '6Xz3zP73aOcIKmAQkIFyD3N/jrBPwlKjLQEglVlJKyUjR3u7cc'. + 'WLoP3/4dvv03LNrQ8I6x1rFbDML9kOmHvh7IRHU9JKmUSG8vpF'. + 'IoXX/TV0AiEM5A5jT0noFMFMJHXUt/d5f9TUAbhtQ3cPFruDog'. + '8klHMnmO0dGYe/myOJGINEwTz3F2higFXgy8PpAkOC+h8hoaCt'. + '4ppHFcQAWSgOQlyI/p+lUjmRxWAwNJd3xca/f34yoFi4tgmjtD'. + 'NIFkJ4xcgBCgVqEBFJ9DqcZea/gNAAVEg7AOGYnHe9XoaJd3+X'. + 'LISSSwnz6lsbKCZ9sHh4UVdBkwdA6cPwNnIfJPmC3Ctgft3wwQ'. + 'QPkvTZJJnbExzfvsM2nMzVG7e5fG48d4lnXwTwEYCjJxuHQBog'. + 'BHUfKkgAIIhiGk06hTp/Dm5qS1uYlXLvtWd4gPgIiCrAEcVckT'. + 'Ab5p7TaYJrK1hQaEenrwSiVfQdc91P0kSp7Ii89D5ksY/kAkLy'. + 'IZXFdXkQjS1YUSEbdcRu168V6+HTUNIKJDRwdE+sBIQmP9Ld59'. + 'bEBA3of4F/D+uXb7rGaaCSmXI3pPj64PDaHCYfEqFVSjgWo2D2'. + '73XlJNQTgCyQykIuBWoNKEeh1aLXBPBCggGdBOgxZVSjoajVhH'. + 'o5HWlIpq4bCQSgm9vXhK4ZZKh5SUYygp4J1EQVUD9xlU18BJQD'. + 'bUbJ5T5XJStyxN9fSI099P3baxV1dRloW2h2ivx/yakg2ot6F1'. + 'EkCa4G1D+zVEq5ArKTWM42Q6HUczQV7U66w9e0ZpdRXlOIQ5vF'. + 'VHUXILKify4jiEzkOqC3peQMoBQymFlMt4Dx6wUSxSsm2UZXEK'. + 'P30QvOUt8/2Sd78CdWwFDTA+gsw3cOlPcPUD+CQB52oQ21RKXM'. + 'eRhGXhOg7VoKrx8KuS4ygZhVg3ZI8FGIfwR9BVgAtfwxdXdP3L'. + '86nUR91dXelNXTeWWy10paQHX602YAP1ADASAL7LJvFtMpOCc0'. + 'cG3FHuGlz6Gr4YEpnoTCbzsdHRbOzy5RCRiLRMk5rjyOtAimwA'. + 'U4U3SurBN/0wnAASBCVDIKpB4kiAB5Ub0/UvO9LpPAMDGfn005'. + 'AxPCzxep3Q6iqPLUseBoufCZRsAE6g5g5kKIDfKUj3wnpAG8QB'. + '/Z1OIqANQuI65AtwNScyYXR2XlAXL2YZHzcklRKWl5GVFXFtGx'. + 'MoAiV/EQaAGH6BUQNWgQpwFngv+Ca8KUAQEBcwgTJHyMV7679R'. + 'XS8YqdSI6u/PMD5ukMtJY3GR2uQkr5aXeWVZOEALmA8WsIAxfL'. + 'd0goVLAdCOd+/YpgqeVtBv4yiA++q/RKKXixe7GB8PSyoljcVF'. + 'yg8fyubyMpulEk2lyAIfAAvAC+B+oOQFoAt/+0rAejB/EzjNri'. + 'vvqNnCd64jxcE39V8spnP+vMbAgDSePKE2NcXm06dslMuUlcID'. + 'TuFvqwXMBU8N39bGgRR+ki0Dz4L5DSAe9NGD7zq+6kcN1L6H2b'. + 'ao5WWaQHllRTafPmWrVMJUimoAQrBYJFjQwre7B6A8YAi8LCgD'. + '5DVo6/hbb/iHK1KggvFeD3hHziQKEMuiNTNDbXGRTdtmw7Iwla'. + 'KGH0oqwbscLOoG46rAY6AOzRhY74PT6QuUKEN4PegXxd/yEDTT'. + 'YMWOk+oEaLkuFdNk0zTZwjfkavDUArXWgGXgFb4dEShXhfYqlI'. + 'ow3w9rg3B6ED60IOOA5oEYQBrcpG+mj9bg0VG8GMJhVDZLyzAo'. + 'VSq8rFYxXXefcjVgG9+uisDrXUCApoKSBcUHMBmHhfcgNwhtD3'. + 'q9IG6Lr15b4OUTmPwBJt8JqGuapp05o0mhoHnptLQfPsR+8IBK'. + 'uYyNH3yr+B77LHheA3tK1Ta+IrMeTL2C6Xl48TOsNWDDgAz7s5'. + '/r+krP/eddCsbj8fDQ4GBm9MqVvvRXX2VULBayRGRzaYn1SoWa'. + 'UjgB4PIB5QK4ZgBXBKaAHxQsrED1H7CRgCUPwgHZDqACmhWwXv'. + '2aDRqGYeRyufS169cvThQKV88PDuYbW1vJ5VRK+5euqxWlPMdX'. + 'SRqgreHbZGN3ijfKBXBTAeh2Fdwi2MofshP/dvKwCmKhp4m83Y'. + 'vj8Xg4l8tlCoXC0MTExMTFkZE/1m37wvLGRvKRacoD1209E7Fc'. + 'pZwYREOQqEJ4z3HskHLsz4AoXykPIBSN0t3dTTQafROoHdumXC'. + '4fjoMiog0ODiauX7+eLxQKV3O53ETdti88nJnJ3rl505ifmWm3'. + 'arWSodR8GNbycDoNHy5C5jFold1k8d+DyvELNwg93d18/vnn9P'. + 'X1oes6nufx/Plz7t+/fxhQKSWJRCI5NjaWHxkZKdj1+sjSwkJm'. + '+uZN/dZ337VqCwullGUVdZjsgIUC5LqhrUPvCugWuApeApPAzY'. + 'PKHWyaphGNRunt7WVwcBARwfM8Ojo6sCzrMKBhGLphGFEF2Wq1'. + '2jc7M5OZ/vHH0MPbt93awkJJmeZsC6ZaMK3DCwvWdNioQUb5B6'. + 'AdBR+9SzkAz/NwHIeXL18iIui6TjgcJplMMjY2th8wHo+Hh4aG'. + 'MsPDw6fddru7+Phxx51bt/RbN260qwsLpZhlFZsw9QJ+2Pbrga'. + 'oJG2FY2oKwuTtVEz9uV34NbqdtbW0xPT1NNBoF4MyZM1y5coWu'. + 'rq5dQBHRcrlc4tq1a/l8Pj9RMs38ndu3Ez//9JNXLRZNyuXZJk'. + 'xVYKoExQpsK/+IaAuYb7no8zjC/R+A4zisrq7u+53NZjl16tQ+'. + 'QIlEIslsNpuPRCJXZ2dnh2/duNFRW1oy07a96MKd575yxRqU1B'. + '5vPMpF5HHa1tYW9+7do7Ozc/eQpZTSQ6FQt1Lq8pMnT/5w7969'. + 'nuLcXE1rNufO9fRMhlKpOyvt9qPtVmvb25fFfvvWbrepVCqHwo'. + 'xaX19vff/996ZhGC8qlkW9Wt1Onz073fXxxz+6MB+9e9dUjuO+'. + '7ebq9wLdB9hoNCrr6+s/4wf3FCJW3fPmTZhXsNWCprjuW66Dfr'. + '928KAfBhJAEgiJSLuzs7OSTqctoFkqlZRt26j/I+L/AGjPTN4d'. + 'Nqn4AAAAAElFTkSuQmCC' ; + + //========================================================== + // File: ppl_orange.png + //========================================================== + $this->imgdata_large[1][0]= 2753 ; + $this->imgdata_large[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMLFQ0VCkHCzQAACk5JREFUeJytmGtzG0d2hp8zNw'. + 'AEcRdJ6EJK9FL0CqZUm9jWbkwq3vhDstl8dmLvz8rP2H8Q75ZT'. + 'pkRfpLgqsS6WIFEKGYkiSBCDO+banQ8DUpRWEkklXQUUqlCDfv'. + 'rp857pgfAOQ4AMOJdg4R/hX96Hf06bvDc5iT07i8yeg8ksiIAI'. + '4TBi/ds9/vivD/njapNHvRBfHXMu410AM+BUoVSF05NQsi1sO4'. + '8402AXwLQTuP31OAZO2aG0MEn14iSlnI1z3LnMk8IZYJyBwjIs'. + '/TWsVIWPJkvMFS4zMfMhUp5BsoCpAAEBLYKaMFGn00jBxnvu02'. + '35+JHmSJEnBpQEcPo38MmCxd/nS9Ry71Ga/g1W9a8gn0GsHkgA'. + '6DGjxkqb5CoO+YxF3A3p+jGjQUzoK+L/V0ADzFMwtSR8eLbAr8'. + 'uXOTf9NzhTc0geSLUQcYHgYEH786RMg0zWJHV2Aitv4x/HpHVS'. + 'QA2YBqTTGIUq5qkPMWaWkVwPnPtAA/BevmZcjxaaUtHh8pJJGu'. + 'DpCB9FvT7A7YT7S3p5vFMNzmWo/O0MSx/Ms3TqI8r59zFTfUQe'. + 'I7SBODE3tnfoIxYnNHligwik0zAzDdVpyKbA8sff5YAeMEwgkV'. + 'cufQeTJzZoCsaFLKXPTnNpoUTNsSgJmNoGsuNQjIDwYD2HlnZy'. + 'k++yxTKXZfKTU8zOpjhneeQYkorSmGERtIlICBKRbLX+y98YN3'. + 'ADcNIm+bJD4U3pPnmbEaRgYVRTGBkDSSsmxKfY7ZLuDJA4hdjl'. + 'JEgyBB2SJOvQ9RzTpNKoEwNq0CNFvOXR3/HxMgYVPObaz8kPmh'. + 'hkEWMatAfRONGGvLizyOE9P8KkpwhPDAgQKJQbELUD0oOIhbbH'. + 'JeVTmowxjAgZutB5AoOngA+2DdYrcTyOyYZP9+QpBvI29vwEhb'. + 'It042BVQgDy9KTMfkwQG1A9ACCLlgBBGUwxxoc52WDh2ATyEPp'. + '1hoaPvrEBh0Dq5an9OUsl/9hylk5b5c+mowLc4E2Jtw4Eoljyf'. + 'ogA/AGEAagNRjGyUxOmEycyVA5EWDBxrmUp3ytLIv/NJP69Goh'. + '+9mFydIvS5PZYkvH1oY/RFtKymlwBFQAgQd+kAA6qSQ8pvn2mp'. + 'SkJkuVFHPHBnQMrEt5Sl+e4/Lvp51PF1PF5Xy6WMvOWZXMom8z'. + 'OZTQ8+j5sbQiMEwopsCIwRtBGIJSCdzbTGo9NimkDcgdC7Bg49'. + 'TG5n4/nfr0Si77WdYp1YzyZEkWPdteaEnB7pPqBTxuIf/VgciE'. + 'SgasCPwh+GNIkaNNag1RiPge5pEhMQVjfoLcF+eoXSvbKxedwn'. + 'LKzC3KWbOi5/sW5a44/SHFUSgVA7SCzRG0AvA9mPOgFIETgu4n'. + 'Ww0wNQWFAqRSL6D2ZQYBdDrQ7R7jXiwgRcvIL02makuTmWtpM/'. + '+BlLMl5vuWzLVEuwH6oYnR1KS8kJINGXMM2YdfRlALoQoQQKeb'. + 'bDVwoMdxQMaLCwLo96HZTF5HbrEhmOftianfZisfzueKv7ZmrX'. + 'MsjhxKXZGBjzyeEHmSE3oWiggtyVGmE8DTIXTC5NxgAxOAGUM8'. + 'fun9mnSSLQ/CxNzOTgJ3LIMgoGwkKBiiMyaVviHVkdCO4FEKNv'. + 'LQzWBYHfITPa4UBVM0LR/WB7ARJsdDDTjA6deYFIFUOimJ3d0E'. + 'sNdLavYYgBpthqKcjiiJRO8K6CK0CsJTjfQAGaJtD9vQFAxNNQ'. + '1FB0yBAfA8gdMAIagLoCVAen0M00zMOTYShNDtoHs9CAIUoI4E'. + '1IBihCdNhsMhsj6NuV7BCC2IBpBqQaaFOENCCeiEsO1BO4RQgy'. + 'I5Hm4k4oIU9MrgZSAdBeTabZz+ODxKQRRBFBJo6IUc51anYRQo'. + 'dto+24FNxYCiaWKkQsj00KkO4gxRRkAngJ868M0u3OkkM+hxQA'. + 'cQ7YD7GO5XYSsPZybh/TCkFIYY+kWniTW4Q7jXgHvHMhiRpmuW'. + 'ca08GZkkZ/nY6TZMNhCnf2CuPoDVJvxpB+q9BHA8Ag1uH+oP4c'. + 'YEPCzDwmzSLquShHW/E0YRbG/BjZtw40hAy7aNzJlzRn75E6N0'. + 'qiwTzafI7kOU3gWrhzZC2iHcbsPqLlxvJnCt4KC1RYAL3I5hzY'. + 'Xv/huePYCtITQMKEnyB4KQvMURuJvw889HGSwUCs7CwkLpo6tX'. + 'Ty/+7nel6VLGDn/8N9m+eZuo1UP8iNhLau6b3RfmOsHBGTUYw9'. + 'WBNeDrGB4+h/4qNLKwTnLbHj9CJw/6GoIh9Jpvq0HHcayFhYXi'. + 'l3/4w9LK8vLKexfma3G/mb/3n1njTivS7tNQaaU1grQDjJ868D'. + 'Axx6vmxnBrY9C9IcSbSXbavNjb/S3eN6/0m1JcKBScixcvllZW'. + 'Vi6uLC8v12q1v/M8b/HxVjP//YYr32yE4dYWvShO0ogi14xwxq'. + 'F4rbnxZ3cMjtpvEEeMvwA0TdOYn5/PffHFF7Vr166tvPeLXyx7'. + 'nrd4+/btyg/frFo//Xgncnd67qCn78earQqcmYD3fSi1wPCTSV'. + '3gzqvm9uFOMl5nUAqFQn5paal26dKla57vf7D+6FHph9VV88af'. + 'vgq79bo70e3VT2l9A3hYg4UiRALVHTCHSZvYBm4A//6quf8zoG'. + '3bpuM4acMwKr1+//SDe/dK31+/bv90/Xrcq9fduNW6rbVeC+E7'. + 'gWdD2DKg4UEpBmPcm10RuScida31ntb62HAigoigDw6Gh0axWH'. + 'QWFhZKi4uLZ+I4PrVer2e+u37dXPvqq6hbr7tOp1NXWq89h6/b'. + '8FBB34WGBesdcPrj38lkMkGlUuml0+mu53nR3t4eo9HoSLhMJk'. + 'OlUiGdTuN5Hq7rvgA0TdO4cOFC7vPPP6/VarXldqdTu7m2lrv7'. + '7beq++BBO263b/tKrfWSXlbvwJ6CuAtDgTYiaBFMw6BSqfDxxx'. + '+rarWqGo0GN2/eZGtrC6XenAkRoVKpcPXqVWZmZmg0Gty6desF'. + 'oIhIOp3Ol8vlmmVZK3fv3Lm09uc/Zwbr653ccPgoNIzvnmn99Z'. + '7W9QG46lAaM5mM2l95GIYUi0VOnz7N7OwsWmsymQzyuse5Q8Mw'. + 'DNLpNDMzM5w/f/7A6AGgUkoajYa9urpayOXzUz/fvZutr68Pim'. + 'F4/2y1+n2o9Q/ru7uPesPhXnyo4A+vfHp6mmazybNnz9jZ2UFr'. + 'TbPZJAhe+8/aS0Mphed5NBoNABqNBqPR6MWBVWstvu/nnj9/Pv'. + 'vo0aPq5uZmPBgM/qcwPf39xV/9ajU1M3Nvq9PZaw8GoT50PjdN'. + 'k6mpKa5cucL58+eJ45j19XWePHnCzs4OnudhmiaWZRGGIVH05r'. + 'yEYYjrumxubrKxsfFyDQJ6NBp1Pc+7C4jWumBaVm+kVL2l1H2l'. + '1G6otS+H6V6z8u3tbVzXpdFooJRicXGRqakptre3uXXr1ltrcT'. + 'Qa8ezZszemWAE9rfUdYBOwtVLRbrPZ+48ff+wDvuu6Sr3MB4Dr'. + 'uty6desgfa1WC3iRyrNnz4pSSmezWUzTfGtYtNYcdvC/9sMlgP'. + 'n5N4cAAAAASUVORK5CYII=' ; + + //========================================================== + // File: ppl_pink.png + //========================================================== + $this->imgdata_large[2][0]= 2779 ; + $this->imgdata_large[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMLFQolY9lkpgAACmhJREFUeJy9mOtzFNl5h5+3b9'. + 'Mz0kzPBWmEVtIiWYhIiC0HCDhB8lb8ISk7nzdZ5+/zJ/8BTmpT'. + '660CZLwG1pVFgBkgGIHECEaa+/T9nHzQCCQuRpCNz6mp6g893U'. + '8/c37ve3qEjxiC4OA4n/Lp/EUu/tsMM/+aEWduVBx7WhdkShcY'. + 'xUH2zo0Dwod/5N6vf8V//PoGdx8M8EOFPtK9jI8BdHCcMuVSmf'. + 'LxHLmSZdm2U8xIbmKETDGDZZnIy4dBbCynyGhphurEDBOlHFnn'. + 'qPcyPxTOwDCOccw7w5nlBRZWylI+ny/mZ6rL1dzUZ5/IWGZU3D'. + 'ZIOMQDDaJcHDVGWUbJBi9odVr0QoVSPzigIEaZ8vgSS/8wZU3/'. + 'k1fylipz5dLM2WlrZqHKaGCKbEbontq3KAKWQyZfZKTgYqc9Bp'. + '2I2PcJ4ogk/UEBQcwipbFZmT13vDBx8fhnE1Ofnp9yJopFyT3X'. + 'yANfks0QHSQMDaL37pOxMLIu2UyVkjVKLjyKSeuD8dAYCFkso1'. + 'gYMaeWJ40T56cl8yAi/O4FSa2P6kYczIDsgVpAqcDImZPMuAB1'. + 'dkLQtcc8a/bwox8IUHAxZVxGZMouSLVYwKuMkD5IxN+JSdsRJB'. + 'pexuTVgYYM6EoGmxkmg3/hEhNUMr/hd7dqbOzExMn/GRDAxWZc'. + 'j3I8HiXfMjF2FQowKw7pjoN6E/Llw/GBJj8qxVOMlX4ipxc/lY'. + 'kl2zBLkmrTcEzMkoNoRLVidLi/9g+Z3I+1xRHX5EcAihxnbPRv'. + 'OTU9kZSmpKPy9FTGrLimPZ1H+UiyGaF67w6n7E1DwMngFDxGvc'. + 'w70v0xZUby5IxjlIyMssUJrJwVWkXBdbXvSvwEibcSdKCAFI16'. + '4/sc0SRo9cGAGq1DwvQFzV6DVuBiV4zYnlEts6A2TSPcSiXoxo'. + 'QqJCEEFMbQ2b69o5qMiOOPqIMQkagu/aSL7waE8101WFShLjk9'. + 'yxgEvjRUiyYd+gwAjY2J9VpXfZ/JEXLhDp3OR6U4T97+hEnPwx'. + 'tv4HsRjy2tTQSFzQgDUnwSLBQRI+x1ZgcH87Vcv4SF19Kt0ezS'. + '1h9s0Ma25pgr/YJfnLnEysok0+ezjM6EBLldGqKIJYuDRhOQEJ'. + 'Oih8X9Q0xmcXNjlCofBJgn78wxVz7L2YWf8tPPz1hnfjbjzfxN'. + 'qVwutq2etZXUQSXikcXGIgUiUkJSDIQMJgYGJsaB3c7b1qQ4GZ'. + 'xSkdGZIwMeNLfK6uezMnvJK3pLxeVixfvMsyVjSNSO6IV9adPG'. + 'AArkEEz8oUkFmBjYGO80qfd6pCWIayD59wIKcsjcKqufn7JO/S'. + 'xfyi+5c24pey5rZ09mJRNkiDdT/tzbkBr3SYkpMYpgEaIJSYhI'. + 'kSOY1GhilAQk5ntDIojxCZ/kf87Pl85xbuWEnLiUy+cW3NNuJX'. + 'MmY5meKf6mT7wZS+THdOjxlG06tIlIOMZxchSxcFFEGAwAGGME'. + 'jwyZYSnWL3cXWiIUbUI6hO/vxXuFOV84ycmlBWthNeflTjuzTi'. + 'lzJmM5s46Ej0J63/ZoPmoy6PYxtYVNhmfs0mbAND1mmKVMBY1L'. + 'mxA1LN7WgXQbCApNhKJHRIM+DQbv7yQGhjnJ5NgFuXBuxpu5mD'. + 'udm3LPuY7pmZLUE6L1SIJaIPFuDAqyw9lnwDYv6NFHkWJh4ZDB'. + 'wCBFD3uMxsTAwcBAiElpE/KcPg36dIiOvpsRxDCyhmlP2YY9ZU'. + 'v8NMb/1id+FGO0DTztkSXLOONUqeITsMkW2zwnJEIDFhYGx+A1'. + 'kwK4mASkvKDPc3p0iYhRRwYUhZLUTyV6Eu0t4s1Y4kcx6W6KaM'. + 'EZThcXH59RRhGEgIAddnBwNEBKqqpUtWBIF22YDIhJsbEkJqFN'. + 'qLtERHs7GnUkwISEQAf0uj30bY39PzbiC6qrDu2cExJ69Nhhhz'. + '59UlIUipCQOnVi4sjG7ubJBy6um0C+he/0iDHQKIQERYyKFLqr'. + 'SI/W6kJCnvOcrWSLSquC1/Jw9Ks3R0FQKHr0uMc9bnCDGjX69A'. + 'H0XlcJkibN5jOe/alCZStHbjJL9lSMLkXExvCXRiDV6GZEeGeX'. + '3TvvBVQoEjfBL/v0rT75Th7VU5C8gktI6NLlMY+5yU3WWGODDf'. + 'r098tHpNFNH7/2lKdXXdz7efLzVaqJIBOCmK8AJUlI6g0aV+9y'. + '9+p7AR3bMQpTBWPy7yeN6fy0jNwewfpvC9Xe+3kFoUuXe9zj5n'. + 'BusEGHjh6GIAGawC2FWuvSvbbF1maFylZAsC1ISZADBiVNSJrP'. + 'eX73MY//skHP85z5+fnSxQsXj//4n39cmnPn7LbZlsajBmEnBL'. + '1nuEGDG9x4aa5Ldz+h0RCuBqwBv1Wo+7vs9r7n++0MmYeAM+zB'. + '+61EK1QUEnbbtN+9Bh3Hsebn54u//PdfLq9eWl2ZnZ1dSnaSwu'. + 'Pin40b9g3doKE0WoNIl65xj3v75njd3BBubQi6ExKmDWkMRKSl'. + 'tSbVKQcMao1Go5Ugb0+x53nOyZMnSysrKydXLq1cWlxa/McgCB'. + 'Yev3hU+GPrD3I5/q94k3pXYQY58q6B5Bs0HB//neaGx00gyWaz'. + 'VCoV7bquCoKAnZ0dfN/f03egLGj0m3XQNE1jdnY2/+WXXy6trq'. + '6uzP3oR5eCIFi4detW5feXL1vr679Let37zVB3/mQytjXJwmSB'. + 'wikHp9ShY0RESqObwPrr5oBERKhUKly4cIFqtUq9XufmzZtsbW'. + '2hXvuDwTTNtxZq8TyvsLy8vLS4uLgahOHphw8elL69fNlc++qr'. + 'uFOrNXPddm1cczVL5f5P+Lv5MuOJgTGxwYbZpZsCdeAq8M1Bcw'. + 'CGYeC6LtVqlRMnTjAyMkKn0yGXyx0N0LZt03Ec1zCMSrfXO37v'. + 'zp3S769csb+/ciXt1mrNdHf3ltZ6Lca8ZpJsduhtCdb2gEFJoQ'. + 'xADYHuHDS3f32lFEEQUK/XGRkZoVAocP78eZaXl9FaI/Jq25Uk'. + 'yWHAYrHozM/PlxYWFibTND32sFbLXrtyxVz76qukXas1M61WTW'. + 'm99gx+20TdN9jqtfjP7QzOwwYNp037Zd0DukDnIByA1pqdnR2+'. + '++472u02Z8+eZWJiAsMwDsEBRNGBzYJpmsaJEyfyX3zxxdLS0t'. + 'KlVqu1dP3q1cLta9ekU6u1dat1J9b6Sk9kraV1rYXegW7apDYw'. + 'kFY6fPc4MNTw88bwfZ/NzU2UUnieRxAEiAiGcXiXfcigiIjruo'. + 'VyubxkWdbK7fX1xWvffFMInjzBM82uMT5+p++6V1UUrSe7u03t'. + '+8lezlKt3gHyl0aSJDQaDa5fv876+vo+w6FzDq1BpZRsb2/bly'. + '9f9vL5/Njdu3fzG0+eMJHNxsfn532vXN5NPG/7abPZal6/Hvfe'. + 'kroPHfsm98f7AHW9Xo+//vrrlmVZm71+37QNw3JnZ9PK4uJGpV'. + 'pt4Dh+vLGhsrmcfv1iHzu01m89HjIdCon2fb8TBMHtvYeRUn50'. + '1Oj4vqp3Ok1f5LYSadfr9dQfDN642P/XeF2DA+SBAuA4jkOhUK'. + 'BQKESO43S11p3BYBDt7u4y+CtB/i/q7jp1GMiw2AAAAABJRU5E'. + 'rkJggg==' ; + + //========================================================== + // File: ppl_blue.png + //========================================================== + $this->imgdata_large[3][0]= 2284 ; + $this->imgdata_large[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMLFRAiTZAL3gAACHlJREFUeJy9mGtv29YZgJ9zKF'. + 'F3y/Q9jh05tuQkarKgbYasde0UBdZgwNou/Vqga/sD9mP2B4a1'. + 'BbZ9atFPxb5sqOtmXbI19bqsluPYiR3HN90vFEWRZx/IJI5zqa'. + 'x0OwBBSgR5Hj7v+55zSEFXTUgIJyA9C6/9RsjMjAyFIxxJCDc7'. + 'iBqKgyZACGg3G2x9+xXf/fG33P3mC9qNKsp1O+1JdkEnQTdgIO'. + 'ttCSMUi8gj072MnugllAyB9G8rBGi6RsToJTF6iuRoFi1kHKZf'. + '7fB8Iggj0/Dy23D2dakNTR3JDsXPvzstxmZGRMER1EwHhQAEgE'. + 'CLhIkPD6InY9S3djGLJVBtQP1Qb4HDAyoJYQOOZkPx49nhTH9i'. + '7MUBGT7egxkJgd70wZS/CUkoZtA/fRoE1DZ2ACiv52ibReCp4e'. + '7CIEHomxDiuVdGTqUnf/ZeOjR8fpiVXZul5ZrY3bWwbdcLr/dA'. + 'AAIpAwQjUWIjQ+g9HZvswiCgBVF9/SI6OSLGzo0i+oLi6+Utbq'. + '+bKEftgwOE/0Ohocf66M+cBjo22U2RQLIHMhmYnvaOpR9S8bSU'. + 'UqCURGpRkuMZMm9cIvPGJZLj0yBjT2LprkiSkykx9cuXIhOnUs'. + 'm+QNC2XdG02ggBTcvFabsPWwTPpBAChSCgh4kYBpoeplWp47Qs'. + '7EYDt21xINzd5GCAxLExRl89Z+nHjpbKMmjbmkgfDzI0JEW53K'. + 'Jaa6NcAOEX8v52uJzsBlAS6u0hcnTIccPRqhWPCUcLD+s1EaUp'. + 'HCEhEMCyHNpt9SjgIU12A6iw6xb123vYhaaKjB9tlgMD5X+uBp'. + 'zdkpg6azA8EaNQtKlVba+Xez4eCntnJrsDdFsW5nYFpxlFN846'. + 'DXe8utkM4mhi+EgQmjYbS2WqexZKk6BpjwJ2YlK5VjeA3pNDiH'. + 'YjRWPzPE7tmBo8EWwGhkXx+z3uXL7D3rU97LIF8RBEAl6lK/Uo'. + '6JNM1rZ2aTcr3eUgIQOGTgbdwXMGyRejenLYTvQGbAdRuetSud'. + 'OivVuFZgtCEgICghICnZoMhmlVTPR49LCAEkQUhk/B7KXe0MWf'. + 'nxj8xVR/cDheK14WZmtVMJSBnlGoN6FmQq0FLfdwJgORKPHRo/'. + 'Snzx4G0F/FjJ4KiOdmjPCrrx8bffnMybMv9MQGNG3rzlVqtR1B'. + 'sh/CYXCD4Aag1oCW7ZnUOjSp6WFi/QNEB8Y7BfTNjZyCmUvJ0I'. + 'XXT47MTp98Ybon9VZCk8cVazfqlNargsY34G7ByAlIjkHd9CCr'. + 'LbBdiHViUgiECuDKYCdz8b2cywREdiYZOj8zNnLuzOTzx6ODp+'. + 'OaGaqwVzBFqz0Idhz2loE7YEwBLaAJLQcKbW8qjAcBF5Jh0AMP'. + 'IOHe6kxgtb3UMO2OxkF//ffK28nQqxfvm3szrtnDVa799Qb/+v'. + 'NtsbNSpm3tAv8B+w7Ub0FhAyoBcMPec9oK6raXk48ziQBXQcmC'. + 'pT3YqHa0mpEBkTR6wz/Jjo2cy04+fzwxdDquNfQKO7sFUbpu0c'. + 'wp3JoAYsA42Bbkl4GCryUNDEM7Avm6Z/CgSYBWG8pNuFuDu1Wo'. + 'tjoxKIJGeHIiM/jmK9NnX5ycuJQMtUcqXPvLDTa+qIie4hAJ1U'. + 'vdrmO2HaDfB931twJgAn1A4lGT96obPHPLBbhVgUoTHHWo9aAA'. + 'JVAKpyKEmQNzWRENAsL18ycKjAFN/9gCNvzLB/390MMmE7pnDi'. + 'Bvwt0K5Jv3O+0oB22nJ1Vvjb/UMhOpcKknqN1OiMB2DNHU2G5s'. + 'sVndpGJVcZXjX1IAlvw9PmhRQcOFPhsSDkiBrQR1G7brgs0a7D'. + 'ag3FK4rguqBXarI4Nt1SJv5gls7TEWtJDRBO2GwnIs8maevFnA'. + 'Gx6awLZvzeTBu4kFbLigijC47pscpx0xyDfkvtUEnlarCDtrUC'. + 't2HGIhvPHVdVwqjTIrxRU2a5uUrYoP0QZ2gMvACl7+3V/LuKDq'. + 'sJuDy597516+CEezIHXv7vcgXQu2l+Bvn8He9Y4AE4kgk5P9DE'. + 'R6aFdq5Et5Nit3yTf3m9sBcsAN3+D98c0Fit5JawE25r1zg1Fo'. + '5B8GFD7g+nVYnu8EUEop9XTa0N/9dUbqcphP/rDJzbUClVbpgR'. + 'y2fXM3fND95qj75J8AC6BWPINfVSBieK+x+6cS5UCzCLu3oFV9'. + 'GqCMx2NGOp2Znpv7aXZudsool3T5J/179sxVlHJ4kGPrP2COBX'. + '/7DmiApWCjxIMXpYNznYuXM+6TAKWUMppOZzLvv//ery5cuDCT'. + 'SqVS336bCwr1JfAPB9r+2KAFwJS+OcETzZHz/7v3etl6ipz77X'. + 'GAMh6PG+l0OjM3NzczOzs3k0pNnFlbW43+e/GKtMqrblSsF03V'. + 'WHcJA0PjIAzvg9JTze2H67g9DjAwOTmZ+uCDD96anZ2dnZiYmF'. + '5dW41++Lvfa1fnr7qllVK9103mXNTnJgPA+YugsvB3HTaEl+Qs'. + 'AZ/yeHPPDCiTyaRx5syZbGoilV1dW00szC9oV+avusuLy0Xd0X'. + 'MgFkDM+zkYBZEHV8f7wwKu84zmngQoNU0LaZoWUa4K31y5qX/8'. + '4cfyyvwVN5/L10NOKNeg8UmDxoKF5Vfj1xXAgD0JrgAcvBDfel'. + 'a4g4AykUgY6XR6emJiIru2ttZXq9S0K19eUcuLy8WQE8o5OAsN'. + 'Ggsmpl+NpoL1g9X4UBU+C9xDgEKIwNTUVOqdd955M9mbnJ3/cj'. + '6Vu5aTheXCQXNdVeMzAwJSCGEA2XKpnF1cXIzlFnOVhJPIKdR+'. + 'c88ctq4AlVKsrKzw0UcfKcC5uXqzXnNqSzb2pwLxOHP/l7Z/BN'. + 'eB01LKt4HTrusKvGr8jB+hGn8MQAkYQMrfw4Nq/MFPtf+rdvDb'. + 'k8QL+/5Z4Uepxm7bfwHuTAVUWpWaqAAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: ppl_green.png + //========================================================== + $this->imgdata_large[4][0]= 2854 ; + $this->imgdata_large[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMLFQ4hANhluwAACrNJREFUeJytmF1zE1eagJ+3u9'. + 'XdkvUty2AbmLEtEzDBgZ0UpDBOalNTUzU3czl7tct/2n+wt3M/'. + 'NVM12SSTQQSyW2TA+QAJQogtYYFtyfrqL3WfvWj5g8AEjzfvhS'. + 'SXjk8//Zz3Pf3qCMcJAWxMKlT4kH+jwu/FknnJSUItKFHzCrKA'. + 'BggBQx5ziz/wn/yBz3hED4/oaJfSjgVoYjJJgTLTZCjohp7IGT'. + 'k5aZ4kb+bRTR30Q7djj8f/kpPMUSCFedRL6W8e8qMQNE6S4xpv'. + 'c5HrTPFubiJ3ZnlyOXV59rJYU5Z00h1c3d0brxAiUkScRijisk'. + '6XLTyiN3s8HuAJpniXa/q8/pt8Or+0kF8oXJm5YiydWcIpOrJu'. + 'rjOQwd54AQwsMpTJYhPSoYuLQ58An/DnBQSdImXO8avsTPbqpc'. + 'lLp67OXDVzMznZLGxSs2qyIRu4at8gKHQEC50kE1icxqCAdxST'. + 'xjEA44tqaJlERl8uLWvvnX5PHuQfcCdxh5qq0aX76vj4WgWyXO'. + 'QiNgBP8IAaddr08X8+wHFmJSQhBbPAZGoSZSt5wQs6qoNC7UEd'. + '4AEoLIQSCaCCy78Dv8Tiv1hjjW1CRj8XIAgEKqDtt9keboMJZa'. + 'vMjuzQVd3Xr9prTJo+GF/jKZea95R25Lxs8jg5qFGiwDnOS0mW'. + 'NE0rjNRIt3WbklUCA9mV3Zdz8OBT/JfCQLB0SKYVVjGFYSfx/E'. + '26ow4e6uDujlPFQpE0FU6P8qNTHdXJdEdda0qf0itWBVM3pa/3'. + 'ccUlIECJet0cAJoeYk5EZCeS5IwEoerSxccJBwRqFFf38QCTaO'. + 'TRVFKJm3NTbtLNSyh2IkhIXsvLCesEGNCWdmwyruSD/z9kUlRc'. + '3bqNlSxhJNJ43p5JITrOEis8Qtr0cXEpU/JT/pmO18n2vb42pU'. + '3JnDnHMBqyPlpnoAaxhr2llv1ZUBqEGlqYwDQMsskMOcMgVL3Y'. + 'ZOQTHAcQQiIGjHCwCaiovjrv4hbcpKuJJjIcDHm685RGr4GLCx'. + 'YHkAcrLoAoDSLBiAQrMkjqybHJCbxgh+7xAC1MpsgzwRwD3qHL'. + 'WyTIBdlAa6u2rHfXaew06PV78ZZjAwleNnkolECoH5i090wOcY'. + '+TgwYzFHiPi1zkOkXexeAMASnVU+LiyiA1wFUuaqggACLizeWw'. + 'ycMzyssmVYKkbpGyC5T+OUALk2mKLHKWf+ED/az+YW42d66YL+'. + 'aNrmEEzQCFEnKw368EgEvcN1m80eTIQIt0TFOjMJHkzNEBBYPp'. + 'sblf8QHzrORO5JaWZ5ZLl6cuJyyxpNPv4PZdoT+GyIxBfI5uUg'. + 'eJMCwP2/bIHO1JEudcgUUWOceKNq99mCvnzs5PzRcuTV4y5mRO'. + 'SMIjo47z5S7a94oQCNKgJsZwO7D/IDNg3/LLhRNXt4JohBb4aG'. + '82GLdXcf93mQ+Y43r2RHZp+cRy6cqJK4l8MS+tdItaqiYtc0Mm'. + 'QpfJARh98HYh9IiXVcaAo58wGb+LBAjbSPgCOcoSa0wzxXtc08'. + '/pv8mfyL+9MLVQvDJ1JVHJV6SZbFI1qtTsB+KlehRtRTGE8Afo'. + 'P4DRcAxiEudhAHjjzz+ubgX4oHowakHQOlqzICQwyVPITGVOXi'. + 'xfLF6aumzmczl5lHzMff2+fCdPaGttEkXoLQAO9B7C6EugPYby'. + 'gVPjGXc5eIbNAJPjGwiAbaAJUQv8wVG7GROkJFpyOqn/ovgLba'. + '44L0+sDaraXb6jzq7aBQWjBOyUoHcaopOgmaA3IRyNDZnA1HjO'. + 'HSBkr7eEFDAEngHrQCf+/s2A8cSiSkqcKUeeTjwFy2Jd78t3+L'. + 'TR4itIiBLwLQhzkJyB5Cx4HXDaENVQCBAQcRqFIHTRaBIvuYXg'. + 'AdsouuNxEL0ZUBHnSQp66R73zYfUtQ6OytKT8RckQAJQoLtgO5'. + 'BJgj0D/WfgdyHaAHx8THoUcbGx8ciwhUl3bDEiToURPooeI7pH'. + 'MziK9Yd9nU5a6GgKjOH41vsgI4hAcyC5AZkapF+AoYNrjjsuhx'. + 'FbtPmeB5ykyQQzTPAWAQWC8S9oAI0QRRuPb9jkmyMZNAOTklvC'. + 'GGYZaFkGmkVAh8h4DtKFMIBunG+pB5B5AIkGBDsQ+qBiL20caj'. + 'zhJknq5KlgMkLjJHJos4kYEbFJi5vc5eYbATVN02bNWe19+32t'. + 'aJWlFm3wbf8Rz5NbDFJdlOFBF/g7cBf0JkrbBb+F6j1DOduEkU'. + '8bWCOiSofPWadBnSZDWmgUkEMGhZCINut8S/0NBtPptFlZrBSu'. + 'vnt1+ndnflfIp9OJ/279Ubbbd+lP7KBKPoEBsgnqLph/BRzwdS'. + 'LnBUFvHcfdpRsGPAGqwMco6jynz+e0SPKYCHMfLX5VKHwcenR+'. + 'Igd1XTcqlUr+xn/cePv91fevzy8sLO2OtrOpWkqL7gXKSAVRdh'. + 'ZFEmEXoYkwBNqovoc/3GHH3aUR+jwC1oD/AWrANi4hGwyBzqEG'. + 'Vvb77Dgi0eT1VZzJZMxKpVJYXV1dXF1dXVm6sPSvruue3Xzcyj'. + '6/syvDzwj0lNazK6Fj5LFCRZouZpBABj6jXouu3+Np6HNvDHaf'. + 'g91t74msbMuOJicnSSaTKKUQEUQEpRSO69But1/dB0VEm5uby9'. + 'y4cWNpdXX1+sLCworrume//PuXpeqnVeOban0U1PW2kcx+O9L7'. + 'Te9sUB4lWFR9SqNtNGcHx+/RDD2+Am4D94CnQA8OjjlEhMnyJC'. + 'srK8zOzu7BiYioMAzZ2Njg9u3brwIqpSSXy2WXl5eXLly4sOo4'. + 'zoV6vV6oflrVP/7Tx8Hmw1Zb6ydqmpWp7ha8h4O3gjOhzVANmF'. + 'XPMNQWvdDnCXCXuHR+APqH4fbCtm2mp6eZn59H13WJuYXRaKSU'. + 'UiSTyVcBdV3XDcOwRaTU7/en19bWCn/79G+JL/76RbhZ22y7u+'. + '6ahl71nPDz/nO17m7wAxlabFOihy4+DvAcqAMbPzZ3OFzX5dmz'. + 'Z2iahoiosUUVhiGNRgPHcV4GzGQy5uLiYuH8+fMzo9FoslarJW'. + '9+elP75E+fBJu1zY7qqpqBUW3T/niohnVvy+1zm5aVtp+WE2XT'. + 'nrHFzbjh1tYLz3XdPjD4R3BKKba2tqhWq4dzUO3noBPn4H5PKy'. + 'LaO++8U7hx48byhQsXVne7u6tf3/v64t3P7mbq9+odt+OuaWi3'. + 'PLxbW2ytubjbQCgiMnt6VlaurWgz0zM0m02q1WrUaDSUUuqI56'. + 'ivDxE5MCgiYllWtlwuL5mmufLV/a/O/uXPf9Ff1F+80Lv6Yx29'. + '2qHzyZBh3cdvc7gaTZuZkzPh/Py8ACqVSv1/uPZDKXUAGEWRtF'. + 'qtxEcffZTL5XLF+2v39fqjeivshA/TpP83JLwzYFBzcA4370Cc'. + 'S81nTRBUs9lkOByi1GuOPI4Rh3+26JZlnSkWi781DOPXvV4v3+'. + '/2G0R8kSBxB/jew+tERK+c49m2TblcxrZtXNfl+fPneJ6HZVmU'. + 'y2VJJpNyaJ9TSinlOA5bW1u4rntkQA0oAG8D54gb9W3ianxM3A'. + 'e/cn73U3Hq1Cm5du2aPjs7a+ztcSIShmE4ajQa6tatWzQajZ+0'. + 'fbiKI+It4SvijVUj7kL2qvGfgkskEqTTaZmcnDROnTplJhIJTU'. + 'QiwPd9P/Q8T6XTaQzDIAiCfzjP/wFVfszuFqdHXgAAAABJRU5E'. + 'rkJggg==' ; + + + //========================================================== + // File: pp_red.png + //========================================================== + $this->imgdata_small[0][0]= 384 ; + $this->imgdata_small[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. + 'B3RJTUUH0wMJFhouFobZrQAAAQ1JREFUeJyV1dFtwyAQBuD/og'. + 'xQdYxa8gRY6hJ0jK6QdohMkTEuE5wUj5ERen05IoLvID7Jkn2G'. + 'j8MgTMyMXqRlUQBYq9ydmaL2h1cwqD7l30t+L1iwlbYFRegY7I'. + 'SHjkEifGg4ww3aBa/l4+9AhxWWr/dLhEunXUGHq6yGniw3QkOw'. + '3jJ7UBd82n/VVAlAtvsfp98lAj2sAJOhU4AeQ7DC1ubVBODWDJ'. + 'TtCsEWa6u5M1NeFs1NzgdtuhHGtj+9Q2IDppQUAL6Cyrlz0gDN'. + 'ohSMiJCt861672EiAhEhESG3woJ9V9OKTkwRKbdqz4cHmFLSFg'. + 's69+LvAZKdeZ/n89uLnd2g0S+gjd5g8zzjH5Y/eLLi+NPEAAAA'. + 'AElFTkSuQmCC' ; + + //========================================================== + // File: pp_orange.png + //========================================================== + $this->imgdata_small[1][0]= 403 ; + $this->imgdata_small[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. + 'B3RJTUUH0wMJFhwAnApz5AAAASBJREFUeJyN1dFthDAMBuDf7S'. + '3BCm2VCRKpS4QxbhikW6IewzcBqm6Fm6JyH7iEEByCn5AJH38g'. + 'BBIRHNUzBAWAGNfe/SrUGv92CtNt309BrfFdMGPjvt9CD8Fyml'. + 'ZZaDchRgA/59FDMD18pvNoNyHxMnUmgLmPHoJ+CqqfMaNAH22C'. + 'fgqKRwR+GRpxGjXBEiuXDBWQhTK3plxijyWWvtKVS5KNG1xM8I'. + 'OBr7geV1WupDqpmTAPKjCqLhxk/z0PImQmjKrAuI6vMXlhFroD'. + 'vfdqITXWqg2YMSJEAFcReoag6UXU2DzPG8w5t09YYsAyLWvHrL'. + 'HUy6D3XmvMAAhAay8kAJpBosX4vt0G4+4Jam6s6Rz1fgFG0ncA'. + 'f3XfOQcA+Acv5IUSdQw9hgAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: pp_pink.png + //========================================================== + $this->imgdata_small[2][0]= 419 ; + $this->imgdata_small[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. + 'B3RJTUUH0wMJFhsQzvz1RwAAATBJREFUeJyd1MFthDAQheF/oi'. + 'gF+JYWQKICkCJRA1vGtrDbxFbhGvY0HVjCLeS2BeTiHFgTB2wg'. + 'eRISstCnmcG2qCpbuXf3ADBQzWsPfZfS9y9HsEu4/Fo33Wf4Fx'. + 'gxL3a1XkI3wbTNXHLoboVeLFUYDqObYBy+Fw/Uh9DdCmtOwIjF'. + 'YvG76CZoOhNGRmpO8zz30CJoOhMAqlDxFzQLppgXj2XaNlP7FF'. + 'GLL7ccMYCBgZERgCvXLBrfi2DEclmiKZwFY4tp6sW26bVfnede'. + 'e5Hc5dC2bUgrXGKqWrwcXnNYDjmCrcCIiQgDcFYV05kQ8SXmnB'. + 'NgPiVN06wrTDGAhz5EWY/FOccTk+cTnHM/YNu2YYllgFxCWuUM'. + 'ikzGx+2Gc+4N+CoJW8n+5a2UKm2aBoBvGA6L7wfl8aoAAAAASU'. + 'VORK5CYII=' ; + + + //========================================================== + // File: pp_blue.png + //========================================================== + $this->imgdata_small[3][0]= 883 ; + $this->imgdata_small[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAACi1'. + 'BMVEX///8AAAAAADMAAGYAAJkAAMwAAP8zAAAzADMzAGYzAJkz'. + 'AMwzAP9mAABmADNmAGZmAJlmAMxmAP+ZAACZADOZAGaZAJmZAM'. + 'yZAP/MAADMADPMAGbMAJnMAMzMAP//AAD/ADP/AGb/AJn/AMz/'. + 'AP8AMwAAMzMAM2YAM5kAM8wAM/8zMwAzMzMzM2YzM5kzM8wzM/'. + '9mMwBmMzNmM2ZmM5lmM8xmM/+ZMwCZMzOZM2aZM5mZM8yZM//M'. + 'MwDMMzPMM2bMM5nMM8zMM///MwD/MzP/M2b/M5n/M8z/M/8AZg'. + 'AAZjMAZmYAZpkAZswAZv8zZgAzZjMzZmYzZpkzZswzZv9mZgBm'. + 'ZjNmZmZmZplmZsxmZv+ZZgCZZjOZZmaZZpmZZsyZZv/MZgDMZj'. + 'PMZmbMZpnMZszMZv//ZgD/ZjP/Zmb/Zpn/Zsz/Zv8AmQAAmTMA'. + 'mWYAmZkAmcwAmf8zmQAzmTMzmWYzmZkzmcwzmf9mmQBmmTNmmW'. + 'ZmmZlmmcxmmf+ZmQCZmTOZmWaZmZmZmcyZmf/MmQDMmTPMmWbM'. + 'mZnMmczMmf//mQD/mTP/mWb/mZn/mcz/mf8AzAAAzDMAzGYAzJ'. + 'kAzMwAzP8zzAAzzDMzzGYzzJkzzMwzzP9mzABmzDNmzGZmzJlm'. + 'zMxmzP+ZzACZzDOZzGaZzJmZzMyZzP/MzADMzDPMzGbMzJnMzM'. + 'zMzP//zAD/zDP/zGb/zJn/zMz/zP8A/wAA/zMA/2YA/5kA/8wA'. + '//8z/wAz/zMz/2Yz/5kz/8wz//9m/wBm/zNm/2Zm/5lm/8xm//'. + '+Z/wCZ/zOZ/2aZ/5mZ/8yZ///M/wDM/zPM/2bM/5nM/8zM////'. + '/wD//zP//2b//5n//8z///9jJVUgAAAAAXRSTlMAQObYZgAAAA'. + 'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. + 'RQfTAwkWGTNerea3AAAAYUlEQVR4nHXNwQ3AIAxDUUfyoROxRZ'. + 'icARin0EBTIP3Hp1gBRqSqYo0seqjZpnngojlWBir5+b8o06lM'. + 'ha5uFKEpDZulV8l52axhVzqaCdxQp32qVSSwC1wN3fYiw7b76w'. + 'bN4SMue4/KbwAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: pp_green.png + //========================================================== + $this->imgdata_small[4][0]= 447 ; + $this->imgdata_small[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. + 'B3RJTUUH0wMJFhkLdq9eKQAAAUxJREFUeJyN1LFVwzAQxvH/8f'. + 'IeDS0FLKABlN6eIwPYAzCHB0gWYI2jj+i1ABUTQN4TRSQ7iiWZ'. + 'qxLn9Mt9ydmiqrSq930AYFiu6YdKrf/hP1gYQn6960PxwBaYMG'. + 'E9UA3dBFtVQjdBOQmBakLennK0CapRwbZRZ3N0O/IeEsqp3HKL'. + 'Smtt5pUZgTPg4gdDud+6xoS97wM2rsxxmRSoTgoVcMZsXJkBho'. + 'SmKqCuOuEtls6nmGMFPTUmxBKx/MeyNfQGLoOOiC2ddsxb1Kzv'. + 'ZzUqu5IXbGDvBJf+hDisi77qFSuhq7Xpuu66TyJLRGbsXVUPxV'. + 'SxsgkzDMt0mKT3/RcjL8C5hHnvJToXY0xYRZ4xnVKsV/S+a8YA'. + 'AvCb3s9g13UhYj+TTo93B3fApRV1FVlEAD6H42DjN9/WvzDYuJ'. + 'dL5b1/ji+/IX8EGWP4AwRii8PdFHTqAAAAAElFTkSuQmCC' ; + } +} + +?> diff --git a/includes/jpgraph/src/imgdata_squares.inc.php b/includes/jpgraph/src/imgdata_squares.inc.php new file mode 100644 index 0000000..40d461d --- /dev/null +++ b/includes/jpgraph/src/imgdata_squares.inc.php @@ -0,0 +1,150 @@ +'imgdata'); + + protected $colors = array('bluegreen','blue','green', + 'lightblue','orange','purple','red','yellow'); + protected $index = array('bluegreen' =>2,'blue'=>5,'green'=>6, + 'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1); + protected $maxidx = 7 ; + protected $imgdata ; + + function ImgData_Squares () { + //========================================================== + //sq_lblue.png + //========================================================== + $this->imgdata[0][0]= 362 ; + $this->imgdata[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAABm'. + 'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. + 'B3RJTUUH0wMLFgojiPx/ygAAAPdJREFUeNpj/P377+kzHx89/c'. + 'VAHNBQ5VBX52HavPWWjg6nnDQbkXoUFTnnL7zD9PPXrz17HxCj'. + 'E6Jn6fL7H7/+ZWJgYCBGJ7IeBgYGJogofp1oehDa8OjE1IOiDa'. + 'tOrHoYGBhY0NwD0enirMDAwMDFxYRVD7ptyDrNTAU0NXix6sGu'. + 'jYGBgZOT9e/f/0xMjFyczFgVsGAKCfBza2kKzpl3hIuT1c9Xb/'. + 'PW58/foKchJqx6tmy98vbjj8cvPm/afMnXW1JShA2fNmQ9EBFc'. + 'Opnw6MGjkwm/Hlw6mQjqwaqTiRg9mDoZv//4M2/+UYJ64EBWgj'. + 'cm2hwA8l24oNDl+DMAAAAASUVORK5CYII=' ; + + //========================================================== + //sq_yellow.png + //========================================================== + $this->imgdata[1][0]= 338 ; + $this->imgdata[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAWl'. + 'BMVEX////+/+H+/9/9/9v8/8P8/8H8/7v8/7n6/4P5/335/3n5'. + '/3X4/1f4/1P3/031/w30/wn0/wPt+ADp9ADm8ADk7gDc5gDa5A'. + 'DL1ADFzgCwuACqsgClrABzeAC9M0MzAAAAAWJLR0QAiAUdSAAA'. + 'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEDlOgDj'. + 'EAAAB+SURBVHjaVcpbCsQgDEDRGERGKopjDa2a/W9zfLWj9/Nw'. + 'Ac21ZRBOtZlRN9ApzSYFaDUj79KIorRDbJNO9bN/GUSh2ZRJFJ'. + 'S18iorURBiyksO8buT0zkfYaUqzI91ckfhWhoGXTLzsDjI68Sz'. + 'pGMjrzPzauA/iXk1AtykmvgBC8UcWUdc9HkAAAAASUVORK5CYI'. + 'I=' ; + + //========================================================== + //sq_blgr.png + //========================================================== + $this->imgdata[2][0]= 347 ; + $this->imgdata[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAZl'. + 'BMVEX////0+vv0+vrz+fry+frv+Png7e/d7e/a6+zY6+250tSz'. + '0tSyztCtztGM0NWIz9SDzdNfsLVcrrRZrbJOp61MpqtIr7dHn6'. + 'RErrZArLQ6q7M2g4kygYcsp68npa4ctr8QZ20JnqepKsl4AAAA'. + 'AWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU'. + '1FB9MDCxYEByp8tpUAAAB7SURBVHjaVcjRFoIgDADQWZpWJpjY'. + 'MsnG//9kzIFn3McLzfArDA3MndFjrhvgfDHFBEB9pt0CVzwrY3'. + 'n2yicjhY4vTSp0nbXtN+hCV53SHDWe61dZY+/9463r2XuifHAM'. + '0SoH+6xEcovUlCfefeFSIwfTTQ3fB+pi4lV/bTIgvmaA7a0AAA'. + 'AASUVORK5CYII=' ; + + //========================================================== + //sq_red.png + //========================================================== + $this->imgdata[3][0]= 324 ; + $this->imgdata[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'. + 'BMVEX////++Pn99/j99ff99fb98/X98/T98PL55uj43+P24+bw'. + 'kKPvjaHviJ3teJHpxMnoL2Pjs73WW3rWNljVWXnUVnbUK1DTJk'. + '3SUHPOBz/KQmmxPVmuOFasNFOeIkWVka/fAAAAAWJLR0QAiAUd'. + 'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEHd'. + 'ceT+8AAABtSURBVHjaVchbAkMwEAXQq6i3VrQiQfa/zDYTw8z5'. + 'PCjGt9JVWFt1XWPh1fWNdfDy+tq6WPfRUPENNKnSnXNWPB4uv2'. + 'b54nSZ8jHrMtOxvWZZZtpD4KP6xLkO9/AhzhaCOMhJh68cOjzV'. + '/K/4Ac2cG+nBcaRuAAAAAElFTkSuQmCC' ; + + //========================================================== + //sq_pink.png + //========================================================== + $this->imgdata[4][0]= 445 ; + $this->imgdata[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAApV'. + 'BMVEX////6+Pz69/v49Pr38/r17/jr4+/l3Onj2efh1ua/L+i+'. + 'q8m+Lue9Lua8qsS8LuW8LeS7pca5LOG4LN+2Y9O2YNW1ZdO1Kt'. + 'y0atC0aNGzb82zbc6zKtuzKdqycsuwa8qtJtOISZ2GRpuFN6GE'. + 'NqCDQpmCMZ+BPpd/LJ1/K519S5B9Jpx9Jpt9JZt6RY11BJZ1BJ'. + 'V0BJV0BJRzBJNvNoRtIoJUEmdZ/XbrAAAAAWJLR0QAiAUdSAAA'. + 'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYDF3iKMD'. + 'YAAACeSURBVHjaVczbEoIgGARgCiMtrexoWpaa2FHUgvd/tH4Y'. + 'BnEvv9ldhNPradPnnGBUTtPDzMRPSIF46SaBoR25dYjz3I20Lb'. + 'ek6BgQz73Il7KKpSgCO0pTHU0886J1sCe0ZYbALjGhjFnEM2es'. + 'VhZVI4d+B1QtfnV47ywCEaKeP/p7JdLejSYt0j6NIiOq1wJZIs'. + 'QTDA0ELHwhPBCwyR/Cni9cOmzJtwAAAABJRU5ErkJggg==' ; + + //========================================================== + //sq_blue.png + //========================================================== + $this->imgdata[5][0]= 283 ; + $this->imgdata[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAQl'. + 'BMVEX////4+fz39/z19vvy8vru7/ni4+7g4fHW1ue8vteXmt6B'. + 'hdhiZ7FQVaZETcxCSJo1Oq4zNoMjKakhJHcKFaMEC2jRVYdWAA'. + 'AAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0'. + 'SU1FB9MDCxYDN0PkEP4AAABfSURBVHjaVchHAoAgDATAVcCCIF'. + 'j4/1elJEjmOFDHKVgDv4iz640gLs+LMF6ZUv/VqcXXplU7Gqpy'. + 'PFzBT5qml9NzlOX259riWHlS4kOffviHD8PQYZx2EFMPRkw+9Q'. + 'FSnRPeWEDzKAAAAABJRU5ErkJggg==' ; + + //========================================================== + //sq_green.png + //========================================================== + $this->imgdata[6][0]= 325 ; + $this->imgdata[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'. + 'BMVEX////2+vX1+vX1+fT0+fPz+PPx9/Dv9u7u9e3h7uHe697a'. + '6dnO2s3I1sa10LOvza2ay5aEwYBWlE9TqE5Tkk1RkEpMrUJMg0'. + 'hKiUNGpEFBojw8oTcsbScaYBMWlwmMT0NtAAAAAWJLR0QAiAUd'. + 'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEFd'. + 'nFx90AAABuSURBVHjaVc9HAoAgDADB2HuJWLDx/2cKBITscW4L'. + '5byzMIWtZobNDZIZtrcCGZsRQ8GwvRSRNxIiMuysODKG3alikl'. + 'ueOPlpKTLBaRmOZxQxaXlfb5ZWI9om4WntrXiDSJzp7SBkwMQa'. + 'FEy0VR/NAB2kNuj7rgAAAABJRU5ErkJggg==' ; + + //========================================================== + //sq_orange.png + //========================================================== + $this->imgdata[7][0]= 321 ; + $this->imgdata[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAUV'. + 'BMVEX/////8+n/8uf/8OP/59H/5Mv/zqH/zJ3/ypv/yJf/vYH/'. + 'u33/uXn/n0n/nUX/m0H/lzn/ljf/lDP/kS3/kCv/iR//hxv/fg'. + 'n/fAX/eQDYZgDW6ia5AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAAL'. + 'EgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEJIgbx+cAAAB2SURBVH'. + 'jaVczRCoQwDETRbLAWLZSGUA35/w/dVI0283i4DODew3YESmWW'. + 'kg5gWkoQAe6TleUQI/66Sy7i56+kLk7cht2N0+hcnJgQu0SqiC'. + '1SzSIbzWSi6gavqJ63wSduRi2f+kwyD5rEukwCdZ1kGAMGMfv9'. + 'AbWuGMOr5COSAAAAAElFTkSuQmCC' ; + } +} + +?> diff --git a/includes/jpgraph/src/imgdata_stars.inc.php b/includes/jpgraph/src/imgdata_stars.inc.php new file mode 100644 index 0000000..5a5e6fa --- /dev/null +++ b/includes/jpgraph/src/imgdata_stars.inc.php @@ -0,0 +1,144 @@ + 'imgdata'); + + protected $colors = array('bluegreen','lightblue','purple','blue','green','pink','red','yellow'); + protected $index = array('bluegreen'=>3,'lightblue'=>4,'purple'=>1, + 'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6); + protected $maxidx = 7 ; + protected $imgdata ; + + function __construct() { + //========================================================== + // File: bstar_green_001.png + //========================================================== + $this->imgdata[0][0]= 329 ; + $this->imgdata[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAAUV'. + 'BMVEX///////+/v7+83rqcyY2Q/4R7/15y/1tp/05p/0lg/zdX'. + '/zdX/zVV/zdO/zFJ9TFJvDFD4yg+8Bw+3iU68hwurhYotxYosx'. + 'YokBoTfwANgQFUp7DWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. + 'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJj'. + 'CRyxgTAAAAcUlEQVR4nH3MSw6AIAwEUBL/IKBWwXL/g0pLojUS'. + 'ZzGLl8ko9Zumhr5iy66/GH0dp49llNPB5sTotDY5PVuLG6tnM9'. + 'CVKSIe1joSgPsAKSuANNaENFQvTAGzmheSkUpMBWeJZwqBT8wo'. + 'hmysD4bnnPsC/x8ItUdGPfAAAAAASUVORK5CYII=' ; + //========================================================== + // File: bstar_blred.png + //========================================================== + $this->imgdata[1][0]= 325 ; + $this->imgdata[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v79uRJ6jWPOSUtKrb+ejWO+gWPaGTruJTr6rZvF2'. + 'RqC2ocqdVuCeV+egV/GsnLuIXL66rMSpcOyATbipY/OdWOp+VK'. + 'aTU9WhV+yJKBoLAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJwynv1'. + 'XVAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bstar_red_001.png + //========================================================== + $this->imgdata[2][0]= 325 ; + $this->imgdata[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v7+eRFHzWG3SUmHnb37vWGr2WHG7Tlm+TljxZneg'. + 'Rk3KoaXgVmXnV2nxV227nJ++XGzErK3scIS4TVzzY3fqWG2mVF'. + 'zVU2PsV2rJFw9VAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJzCI0C'. + 'lSAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bstar_blgr_001.png + //========================================================== + $this->imgdata[3][0]= 325 ; + $this->imgdata[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v79Ehp5Yx/NSq9Jvw+dYwu9YzfZOmbtOmb5myPFG'. + 'gqChvcpWteBXvedXxvGcsbtcpb6su8RwzOxNmrhjyvNYwupUjK'. + 'ZTr9VXwOyJhmWNAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJTC65k'. + 'vQAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bstar_blgr_002.png + //========================================================== + $this->imgdata[4][0]= 325 ; + $this->imgdata[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v79EnpxY8/FS0dJv5+dY7+9Y9vBOubtOur5m8fFG'. + 'nKChycpW3uBX5+ZX8e2curtcvrqswsRw7OdNuLZj8/BY6udUpK'. + 'ZT1dRX7OtNkrW5AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJgXHeN'. + 'wwAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bstar_blue_001.png + //========================================================== + $this->imgdata[5][0]= 325 ; + $this->imgdata[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v79EY55Yi/NSetJvledYiO9YkPZOb7tObr5mkvFG'. + 'X6ChrcpWgOBXhedXi/Gcpbtcf76sssRwnOxNcbhjk/NYiepUbK'. + 'ZTfdVXh+ynNEzzAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJhStyP'. + 'zCAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bstar_oy_007.png + //========================================================== + $this->imgdata[6][0]= 325 ; + $this->imgdata[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v7+ejUTz11jSvVLn02/v1lj21li7q06+r07x2mag'. + 'lUbKxKHgy1bnz1fx1Ve7t5y+qlzEwqzs03C4pE3z2WPqz1imml'. + 'TVv1Ps01dGRjeyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJjsGGc'. + 'GbAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + + //========================================================== + // File: bstar_lred.png + //========================================================== + $this->imgdata[7][0]= 325 ; + $this->imgdata[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. + 'BMVEX///+/v7+eRJPzWN3SUr7nb9TvWNj2WOS7Tqi+TqnxZtyg'. + 'Ro/KocPgVsjnV9LxV927nLa+XLTErL7scN24TarzY9/qWNemVJ'. + 'jVU8LsV9VCwcc9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. + 'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJxi9ZY'. + 'GoAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. + 'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. + 'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. + 'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; + } +} + +?> diff --git a/includes/jpgraph/src/jpg-config.inc.php b/includes/jpgraph/src/jpg-config.inc.php new file mode 100644 index 0000000..52cbd10 --- /dev/null +++ b/includes/jpgraph/src/jpg-config.inc.php @@ -0,0 +1,138 @@ + diff --git a/includes/jpgraph/src/jpgraph.php b/includes/jpgraph/src/jpgraph.php new file mode 100644 index 0000000..1694bb1 --- /dev/null +++ b/includes/jpgraph/src/jpgraph.php @@ -0,0 +1,5626 @@ +Get(11,$file,$lineno); + die($msg); + } + else { + define('CACHE_DIR', $_SERVER['TEMP'] . '/'); + } + } else { + define('CACHE_DIR','/tmp/jpgraph_cache/'); + } + } +} +elseif( !defined('CACHE_DIR') ) { + define('CACHE_DIR', ''); +} + +// +// Setup path for western/latin TTF fonts +// +if (!defined('TTF_DIR')) { + if (strstr( PHP_OS, 'WIN') ) { + $sroot = getenv('SystemRoot'); + if( empty($sroot) ) { + $t = new ErrMsgText(); + $msg = $t->Get(12,$file,$lineno); + die($msg); + } + else { + define('TTF_DIR', $sroot.'/fonts/'); + } + } else { + define('TTF_DIR','/usr/share/fonts/truetype/'); + } +} + +// +// Setup path for MultiByte TTF fonts (japanese, chinese etc.) +// +if (!defined('MBTTF_DIR')) { + if (strstr( PHP_OS, 'WIN') ) { + $sroot = getenv('SystemRoot'); + if( empty($sroot) ) { + $t = new ErrMsgText(); + $msg = $t->Get(12,$file,$lineno); + die($msg); + } + else { + define('MBTTF_DIR', $sroot.'/fonts/'); + } + } else { + define('MBTTF_DIR','/usr/share/fonts/truetype/'); + } +} + +// +// Check minimum PHP version +// +function CheckPHPVersion($aMinVersion) { + list($majorC, $minorC, $editC) = preg_split('/[\/.-]/', PHP_VERSION); + list($majorR, $minorR, $editR) = preg_split('/[\/.-]/', $aMinVersion); + + if ($majorC != $majorR) return false; + if ($majorC < $majorR) return false; + // same major - check minor + if ($minorC > $minorR) return true; + if ($minorC < $minorR) return false; + // and same minor + if ($editC >= $editR) return true; + return true; +} + +// +// Make sure PHP version is high enough +// +if( !CheckPHPVersion(MIN_PHPVERSION) ) { + JpGraphError::RaiseL(13,PHP_VERSION,MIN_PHPVERSION); + die(); +} + +// +// Make GD sanity check +// +if( !function_exists("imagetypes") || !function_exists('imagecreatefromstring') ) { + JpGraphError::RaiseL(25001); + //("This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)"); +} + +// +// Setup PHP error handler +// +function _phpErrorHandler($errno,$errmsg,$filename, $linenum, $vars) { + // Respect current error level + if( $errno & error_reporting() ) { + JpGraphError::RaiseL(25003,basename($filename),$linenum,$errmsg); + } +} + +if( INSTALL_PHP_ERR_HANDLER ) { + set_error_handler("_phpErrorHandler"); +} + +// +// Check if there were any warnings, perhaps some wrong includes by the user. In this +// case we raise it immediately since otherwise the image will not show and makes +// debugging difficult. This is controlled by the user setting CATCH_PHPERRMSG +// +if( isset($GLOBALS['php_errormsg']) && CATCH_PHPERRMSG && !preg_match('/|Deprecated|/i', $GLOBALS['php_errormsg']) ) { + JpGraphError::RaiseL(25004,$GLOBALS['php_errormsg']); +} + +// Useful mathematical function +function sign($a) {return $a >= 0 ? 1 : -1;} + +// +// Utility function to generate an image name based on the filename we +// are running from and assuming we use auto detection of graphic format +// (top level), i.e it is safe to call this function +// from a script that uses JpGraph +// +function GenImgName() { + // Determine what format we should use when we save the images + $supported = imagetypes(); + if( $supported & IMG_PNG ) $img_format="png"; + elseif( $supported & IMG_GIF ) $img_format="gif"; + elseif( $supported & IMG_JPG ) $img_format="jpeg"; + elseif( $supported & IMG_WBMP ) $img_format="wbmp"; + elseif( $supported & IMG_XPM ) $img_format="xpm"; + + + if( !isset($_SERVER['PHP_SELF']) ) { + JpGraphError::RaiseL(25005); + //(" Can't access PHP_SELF, PHP global variable. You can't run PHP from command line if you want to use the 'auto' naming of cache or image files."); + } + $fname = basename($_SERVER['PHP_SELF']); + if( !empty($_SERVER['QUERY_STRING']) ) { + $q = @$_SERVER['QUERY_STRING']; + $fname .= '_'.preg_replace("/\W/", "_", $q).'.'.$img_format; + } + else { + $fname = substr($fname,0,strlen($fname)-4).'.'.$img_format; + } + return $fname; +} + +//=================================================== +// CLASS JpgTimer +// Description: General timing utility class to handle +// time measurement of generating graphs. Multiple +// timers can be started. +//=================================================== +class JpgTimer { + private $start, $idx; + + function __construct() { + $this->idx=0; + } + + // Push a new timer start on stack + function Push() { + list($ms,$s)=explode(" ",microtime()); + $this->start[$this->idx++]=floor($ms*1000) + 1000*$s; + } + + // Pop the latest timer start and return the diff with the + // current time + function Pop() { + assert($this->idx>0); + list($ms,$s)=explode(" ",microtime()); + $etime=floor($ms*1000) + (1000*$s); + $this->idx--; + return $etime-$this->start[$this->idx]; + } +} // Class + +//=================================================== +// CLASS DateLocale +// Description: Hold localized text used in dates +//=================================================== +class DateLocale { + + public $iLocale = 'C'; // environmental locale be used by default + private $iDayAbb = null, $iShortDay = null, $iShortMonth = null, $iMonthName = null; + + function __construct() { + settype($this->iDayAbb, 'array'); + settype($this->iShortDay, 'array'); + settype($this->iShortMonth, 'array'); + settype($this->iMonthName, 'array'); + $this->Set('C'); + } + + function Set($aLocale) { + if ( in_array($aLocale, array_keys($this->iDayAbb)) ){ + $this->iLocale = $aLocale; + return TRUE; // already cached nothing else to do! + } + + $pLocale = setlocale(LC_TIME, 0); // get current locale for LC_TIME + + if (is_array($aLocale)) { + foreach ($aLocale as $loc) { + $res = @setlocale(LC_TIME, $loc); + if ( $res ) { + $aLocale = $loc; + break; + } + } + } + else { + $res = @setlocale(LC_TIME, $aLocale); + } + + if ( ! $res ) { + JpGraphError::RaiseL(25007,$aLocale); + //("You are trying to use the locale ($aLocale) which your PHP installation does not support. Hint: Use '' to indicate the default locale for this geographic region."); + return FALSE; + } + + $this->iLocale = $aLocale; + for( $i = 0, $ofs = 0 - strftime('%w'); $i < 7; $i++, $ofs++ ) { + $day = strftime('%a', strtotime("$ofs day")); + $day[0] = strtoupper($day[0]); + $this->iDayAbb[$aLocale][]= $day[0]; + $this->iShortDay[$aLocale][]= $day; + } + + for($i=1; $i<=12; ++$i) { + list($short ,$full) = explode('|', strftime("%b|%B",strtotime("2001-$i-01"))); + $this->iShortMonth[$aLocale][] = ucfirst($short); + $this->iMonthName [$aLocale][] = ucfirst($full); + } + + setlocale(LC_TIME, $pLocale); + + return TRUE; + } + + + function GetDayAbb() { + return $this->iDayAbb[$this->iLocale]; + } + + function GetShortDay() { + return $this->iShortDay[$this->iLocale]; + } + + function GetShortMonth() { + return $this->iShortMonth[$this->iLocale]; + } + + function GetShortMonthName($aNbr) { + return $this->iShortMonth[$this->iLocale][$aNbr]; + } + + function GetLongMonthName($aNbr) { + return $this->iMonthName[$this->iLocale][$aNbr]; + } + + function GetMonth() { + return $this->iMonthName[$this->iLocale]; + } +} + +// Global object handlers +$gDateLocale = new DateLocale(); +$gJpgDateLocale = new DateLocale(); + +//======================================================= +// CLASS Footer +// Description: Encapsulates the footer line in the Graph +//======================================================= +class Footer { + public $iLeftMargin = 3, $iRightMargin = 3, $iBottomMargin = 3 ; + public $left,$center,$right; + private $iTimer=null, $itimerpoststring=''; + + function __construct() { + $this->left = new Text(); + $this->left->ParagraphAlign('left'); + $this->center = new Text(); + $this->center->ParagraphAlign('center'); + $this->right = new Text(); + $this->right->ParagraphAlign('right'); + } + + function SetTimer($aTimer,$aTimerPostString='') { + $this->iTimer = $aTimer; + $this->itimerpoststring = $aTimerPostString; + } + + function SetMargin($aLeft=3,$aRight=3,$aBottom=3) { + $this->iLeftMargin = $aLeft; + $this->iRightMargin = $aRight; + $this->iBottomMargin = $aBottom; + } + + function Stroke($aImg) { + $y = $aImg->height - $this->iBottomMargin; + $x = $this->iLeftMargin; + $this->left->Align('left','bottom'); + $this->left->Stroke($aImg,$x,$y); + + $x = ($aImg->width - $this->iLeftMargin - $this->iRightMargin)/2; + $this->center->Align('center','bottom'); + $this->center->Stroke($aImg,$x,$y); + + $x = $aImg->width - $this->iRightMargin; + $this->right->Align('right','bottom'); + if( $this->iTimer != null ) { + $this->right->Set( $this->right->t . sprintf('%.3f',$this->iTimer->Pop()/1000.0) . $this->itimerpoststring ); + } + $this->right->Stroke($aImg,$x,$y); + } +} + + +//=================================================== +// CLASS Graph +// Description: Main class to handle graphs +//=================================================== +class Graph { + public $cache=null; // Cache object (singleton) + public $img=null; // Img object (singleton) + public $plots=array(); // Array of all plot object in the graph (for Y 1 axis) + public $y2plots=array(); // Array of all plot object in the graph (for Y 2 axis) + public $ynplots=array(); + public $xscale=null; // X Scale object (could be instance of LinearScale or LogScale + public $yscale=null,$y2scale=null, $ynscale=array(); + public $iIcons = array(); // Array of Icons to add to + public $cache_name; // File name to be used for the current graph in the cache directory + public $xgrid=null; // X Grid object (linear or logarithmic) + public $ygrid=null,$y2grid=null; //dito for Y + public $doframe,$frame_color, $frame_weight; // Frame around graph + public $boxed=false, $box_color='black', $box_weight=1; // Box around plot area + public $doshadow=false,$shadow_width=4,$shadow_color='gray@0.5'; // Shadow for graph + public $xaxis=null; // X-axis (instane of Axis class) + public $yaxis=null, $y2axis=null, $ynaxis=array(); // Y axis (instance of Axis class) + public $margin_color; // Margin color of graph + public $plotarea_color=array(255,255,255); // Plot area color + public $title,$subtitle,$subsubtitle; // Title and subtitle(s) text object + public $axtype="linlin"; // Type of axis + public $xtick_factor,$ytick_factor; // Factor to determine the maximum number of ticks depending on the plot width + public $texts=null, $y2texts=null; // Text object to ge shown in the graph + public $lines=null, $y2lines=null; + public $bands=null, $y2bands=null; + public $text_scale_off=0, $text_scale_abscenteroff=-1; // Text scale in fractions and for centering bars + public $background_image='',$background_image_type=-1,$background_image_format="png"; + public $background_image_bright=0,$background_image_contr=0,$background_image_sat=0; + public $background_image_xpos=0,$background_image_ypos=0; + public $image_bright=0, $image_contr=0, $image_sat=0; + public $inline; + public $showcsim=0,$csimcolor="red";//debug stuff, draw the csim boundaris on the image if <>0 + public $grid_depth=DEPTH_BACK; // Draw grid under all plots as default + public $iAxisStyle = AXSTYLE_SIMPLE; + public $iCSIMdisplay=false,$iHasStroked = false; + public $footer; + public $csimcachename = '', $csimcachetimeout = 0, $iCSIMImgAlt=''; + public $iDoClipping = false; + public $y2orderback=true; + public $tabtitle; + public $bkg_gradtype=-1,$bkg_gradstyle=BGRAD_MARGIN; + public $bkg_gradfrom='navy', $bkg_gradto='silver'; + public $plot_gradtype=-1,$plot_gradstyle=BGRAD_MARGIN; + public $plot_gradfrom='silver', $plot_gradto='navy'; + + public $titlebackground = false; + public $titlebackground_color = 'lightblue', + $titlebackground_style = 1, + $titlebackground_framecolor, + $titlebackground_framestyle, + $titlebackground_frameweight, + $titlebackground_bevelheight; + public $titlebkg_fillstyle=TITLEBKG_FILLSTYLE_SOLID; + public $titlebkg_scolor1='black',$titlebkg_scolor2='white'; + public $framebevel, $framebeveldepth; + public $framebevelborder, $framebevelbordercolor; + public $framebevelcolor1, $framebevelcolor2; + public $background_image_mix=100; + public $background_cflag = ''; + public $background_cflag_type = BGIMG_FILLPLOT; + public $background_cflag_mix = 100; + public $iImgTrans=false, + $iImgTransHorizon = 100,$iImgTransSkewDist=150, + $iImgTransDirection = 1, $iImgTransMinSize = true, + $iImgTransFillColor='white',$iImgTransHighQ=false, + $iImgTransBorder=false,$iImgTransHorizonPos=0.5; + public $legend; + public $graph_theme; + protected $iYAxisDeltaPos=50; + protected $iIconDepth=DEPTH_BACK; + protected $iAxisLblBgType = 0, + $iXAxisLblBgFillColor = 'lightgray', $iXAxisLblBgColor = 'black', + $iYAxisLblBgFillColor = 'lightgray', $iYAxisLblBgColor = 'black'; + protected $iTables=NULL; + + protected $isRunningClear = false; + protected $inputValues; + protected $isAfterSetScale = false; + + // aWIdth Width in pixels of image + // aHeight Height in pixels of image + // aCachedName Name for image file in cache directory + // aTimeOut Timeout in minutes for image in cache + // aInline If true the image is streamed back in the call to Stroke() + // If false the image is just created in the cache + function __construct($aWidth=300,$aHeight=200,$aCachedName='',$aTimeout=0,$aInline=true) { + + if( !is_numeric($aWidth) || !is_numeric($aHeight) ) { + JpGraphError::RaiseL(25008);//('Image width/height argument in Graph::Graph() must be numeric'); + } + + // Initialize frame and margin + $this->InitializeFrameAndMargin(); + + // Automatically generate the image file name based on the name of the script that + // generates the graph + if( $aCachedName == 'auto' ) { + $aCachedName=GenImgName(); + } + + // Should the image be streamed back to the browser or only to the cache? + $this->inline=$aInline; + + $this->img = new RotImage($aWidth,$aHeight); + $this->cache = new ImgStreamCache(); + + // Window doesn't like '?' in the file name so replace it with an '_' + $aCachedName = str_replace("?","_",$aCachedName); + $this->SetupCache($aCachedName, $aTimeout); + + $this->title = new Text(); + $this->title->ParagraphAlign('center'); + $this->title->SetFont(FF_DEFAULT,FS_NORMAL); //FF_FONT2, FS_BOLD + $this->title->SetMargin(5); + $this->title->SetAlign('center'); + + $this->subtitle = new Text(); + $this->subtitle->ParagraphAlign('center'); + $this->subtitle->SetMargin(3); + $this->subtitle->SetAlign('center'); + + $this->subsubtitle = new Text(); + $this->subsubtitle->ParagraphAlign('center'); + $this->subsubtitle->SetMargin(3); + $this->subsubtitle->SetAlign('center'); + + $this->legend = new Legend(); + $this->footer = new Footer(); + + // If the cached version exist just read it directly from the + // cache, stream it back to browser and exit + if( $aCachedName!='' && READ_CACHE && $aInline ) { + if( $this->cache->GetAndStream($this->img,$aCachedName) ) { + exit(); + } + } + + $this->SetTickDensity(); // Normal density + + $this->tabtitle = new GraphTabTitle(); + + if (!$this->isRunningClear) { + $this->inputValues = array(); + $this->inputValues['aWidth'] = $aWidth; + $this->inputValues['aHeight'] = $aHeight; + $this->inputValues['aCachedName'] = $aCachedName; + $this->inputValues['aTimeout'] = $aTimeout; + $this->inputValues['aInline'] = $aInline; + + $theme_class = DEFAULT_THEME_CLASS; + if (class_exists($theme_class)) { + $this->graph_theme = new $theme_class(); + } + } + } + + function InitializeFrameAndMargin() { + $this->doframe=true; + $this->frame_color='black'; + $this->frame_weight=1; + + $this->titlebackground_framecolor = 'blue'; + $this->titlebackground_framestyle = 2; + $this->titlebackground_frameweight = 1; + $this->titlebackground_bevelheight = 3; + $this->titlebkg_fillstyle=TITLEBKG_FILLSTYLE_SOLID; + $this->titlebkg_scolor1='black'; + $this->titlebkg_scolor2='white'; + $this->framebevel = false; + $this->framebeveldepth = 2; + $this->framebevelborder = false; + $this->framebevelbordercolor='black'; + $this->framebevelcolor1='white@0.4'; + $this->framebevelcolor2='black@0.4'; + + $this->margin_color = array(250,250,250); + } + + function SetupCache($aFilename,$aTimeout=60) { + $this->cache_name = $aFilename; + $this->cache->SetTimeOut($aTimeout); + } + + // Enable final image perspective transformation + function Set3DPerspective($aDir=1,$aHorizon=100,$aSkewDist=120,$aQuality=false,$aFillColor='#FFFFFF',$aBorder=false,$aMinSize=true,$aHorizonPos=0.5) { + $this->iImgTrans = true; + $this->iImgTransHorizon = $aHorizon; + $this->iImgTransSkewDist= $aSkewDist; + $this->iImgTransDirection = $aDir; + $this->iImgTransMinSize = $aMinSize; + $this->iImgTransFillColor=$aFillColor; + $this->iImgTransHighQ=$aQuality; + $this->iImgTransBorder=$aBorder; + $this->iImgTransHorizonPos=$aHorizonPos; + } + + function SetUserFont($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->img->ttf->SetUserFont($aNormal,$aBold,$aItalic,$aBoldIt); + } + + function SetUserFont1($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->img->ttf->SetUserFont1($aNormal,$aBold,$aItalic,$aBoldIt); + } + + function SetUserFont2($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->img->ttf->SetUserFont2($aNormal,$aBold,$aItalic,$aBoldIt); + } + + function SetUserFont3($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->img->ttf->SetUserFont3($aNormal,$aBold,$aItalic,$aBoldIt); + } + + // Set Image format and optional quality + function SetImgFormat($aFormat,$aQuality=75) { + $this->img->SetImgFormat($aFormat,$aQuality); + } + + // Should the grid be in front or back of the plot? + function SetGridDepth($aDepth) { + $this->grid_depth=$aDepth; + } + + function SetIconDepth($aDepth) { + $this->iIconDepth=$aDepth; + } + + // Specify graph angle 0-360 degrees. + function SetAngle($aAngle) { + $this->img->SetAngle($aAngle); + } + + function SetAlphaBlending($aFlg=true) { + $this->img->SetAlphaBlending($aFlg); + } + + // Shortcut to image margin + function SetMargin($lm,$rm,$tm,$bm) { + $this->img->SetMargin($lm,$rm,$tm,$bm); + } + + function SetY2OrderBack($aBack=true) { + $this->y2orderback = $aBack; + } + + // Rotate the graph 90 degrees and set the margin + // when we have done a 90 degree rotation + function Set90AndMargin($lm=0,$rm=0,$tm=0,$bm=0) { + $lm = $lm ==0 ? floor(0.2 * $this->img->width) : $lm ; + $rm = $rm ==0 ? floor(0.1 * $this->img->width) : $rm ; + $tm = $tm ==0 ? floor(0.2 * $this->img->height) : $tm ; + $bm = $bm ==0 ? floor(0.1 * $this->img->height) : $bm ; + + $adj = ($this->img->height - $this->img->width)/2; + $this->img->SetMargin($tm-$adj,$bm-$adj,$rm+$adj,$lm+$adj); + $this->img->SetCenter(floor($this->img->width/2),floor($this->img->height/2)); + $this->SetAngle(90); + if( empty($this->yaxis) || empty($this->xaxis) ) { + JpgraphError::RaiseL(25009);//('You must specify what scale to use with a call to Graph::SetScale()'); + } + $this->xaxis->SetLabelAlign('right','center'); + $this->yaxis->SetLabelAlign('center','bottom'); + } + + function SetClipping($aFlg=true) { + $this->iDoClipping = $aFlg ; + } + + // Add a plot object to the graph + function Add($aPlot) { + if( $aPlot == null ) { + JpGraphError::RaiseL(25010);//("Graph::Add() You tried to add a null plot to the graph."); + } + if( is_array($aPlot) && count($aPlot) > 0 ) { + $cl = $aPlot[0]; + } + else { + $cl = $aPlot; + } + + if( $cl instanceof Text ) $this->AddText($aPlot); + elseif( class_exists('PlotLine',false) && ($cl instanceof PlotLine) ) $this->AddLine($aPlot); + elseif( class_exists('PlotBand',false) && ($cl instanceof PlotBand) ) $this->AddBand($aPlot); + elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) $this->AddIcon($aPlot); + elseif( class_exists('GTextTable',false) && ($cl instanceof GTextTable) ) $this->AddTable($aPlot); + else { + if( is_array($aPlot) ) { + $this->plots = array_merge($this->plots,$aPlot); + } + else { + $this->plots[] = $aPlot; + } + } + + if ($this->graph_theme) { + $this->graph_theme->SetupPlot($aPlot); + } + } + + function AddTable($aTable) { + if( is_array($aTable) ) { + for($i=0; $i < count($aTable); ++$i ) { + $this->iTables[]=$aTable[$i]; + } + } + else { + $this->iTables[] = $aTable ; + } + } + + function AddIcon($aIcon) { + if( is_array($aIcon) ) { + for($i=0; $i < count($aIcon); ++$i ) { + $this->iIcons[]=$aIcon[$i]; + } + } + else { + $this->iIcons[] = $aIcon ; + } + } + + // Add plot to second Y-scale + function AddY2($aPlot) { + if( $aPlot == null ) { + JpGraphError::RaiseL(25011);//("Graph::AddY2() You tried to add a null plot to the graph."); + } + + if( is_array($aPlot) && count($aPlot) > 0 ) { + $cl = $aPlot[0]; + } + else { + $cl = $aPlot; + } + + if( $cl instanceof Text ) { + $this->AddText($aPlot,true); + } + elseif( class_exists('PlotLine',false) && ($cl instanceof PlotLine) ) { + $this->AddLine($aPlot,true); + } + elseif( class_exists('PlotBand',false) && ($cl instanceof PlotBand) ) { + $this->AddBand($aPlot,true); + } + else { + $this->y2plots[] = $aPlot; + } + + if ($this->graph_theme) { + $this->graph_theme->SetupPlot($aPlot); + } + } + + // Add plot to the extra Y-axises + function AddY($aN,$aPlot) { + + if( $aPlot == null ) { + JpGraphError::RaiseL(25012);//("Graph::AddYN() You tried to add a null plot to the graph."); + } + + if( is_array($aPlot) && count($aPlot) > 0 ) { + $cl = $aPlot[0]; + } + else { + $cl = $aPlot; + } + + if( ($cl instanceof Text) || + (class_exists('PlotLine',false) && ($cl instanceof PlotLine)) || + (class_exists('PlotBand',false) && ($cl instanceof PlotBand)) ) { + JpGraph::RaiseL(25013);//('You can only add standard plots to multiple Y-axis'); + } + else { + $this->ynplots[$aN][] = $aPlot; + } + + if ($this->graph_theme) { + $this->graph_theme->SetupPlot($aPlot); + } + } + + // Add text object to the graph + function AddText($aTxt,$aToY2=false) { + if( $aTxt == null ) { + JpGraphError::RaiseL(25014);//("Graph::AddText() You tried to add a null text to the graph."); + } + if( $aToY2 ) { + if( is_array($aTxt) ) { + for($i=0; $i < count($aTxt); ++$i ) { + $this->y2texts[]=$aTxt[$i]; + } + } + else { + $this->y2texts[] = $aTxt; + } + } + else { + if( is_array($aTxt) ) { + for($i=0; $i < count($aTxt); ++$i ) { + $this->texts[]=$aTxt[$i]; + } + } + else { + $this->texts[] = $aTxt; + } + } + } + + // Add a line object (class PlotLine) to the graph + function AddLine($aLine,$aToY2=false) { + if( $aLine == null ) { + JpGraphError::RaiseL(25015);//("Graph::AddLine() You tried to add a null line to the graph."); + } + + if( $aToY2 ) { + if( is_array($aLine) ) { + for($i=0; $i < count($aLine); ++$i ) { + //$this->y2lines[]=$aLine[$i]; + $this->y2plots[]=$aLine[$i]; + } + } + else { + //$this->y2lines[] = $aLine; + $this->y2plots[]=$aLine; + } + } + else { + if( is_array($aLine) ) { + for($i=0; $ilines[]=$aLine[$i]; + $this->plots[]=$aLine[$i]; + } + } + else { + //$this->lines[] = $aLine; + $this->plots[] = $aLine; + } + } + } + + // Add vertical or horizontal band + function AddBand($aBand,$aToY2=false) { + if( $aBand == null ) { + JpGraphError::RaiseL(25016);//(" Graph::AddBand() You tried to add a null band to the graph."); + } + + if( $aToY2 ) { + if( is_array($aBand) ) { + for($i=0; $i < count($aBand); ++$i ) { + $this->y2bands[] = $aBand[$i]; + } + } + else { + $this->y2bands[] = $aBand; + } + } + else { + if( is_array($aBand) ) { + for($i=0; $i < count($aBand); ++$i ) { + $this->bands[] = $aBand[$i]; + } + } + else { + $this->bands[] = $aBand; + } + } + } + + function SetPlotGradient($aFrom='navy',$aTo='silver',$aGradType=2) { + $this->plot_gradtype=$aGradType; + $this->plot_gradfrom = $aFrom; + $this->plot_gradto = $aTo; + } + + function SetBackgroundGradient($aFrom='navy',$aTo='silver',$aGradType=2,$aStyle=BGRAD_FRAME) { + $this->bkg_gradtype=$aGradType; + $this->bkg_gradstyle=$aStyle; + $this->bkg_gradfrom = $aFrom; + $this->bkg_gradto = $aTo; + } + + // Set a country flag in the background + function SetBackgroundCFlag($aName,$aBgType=BGIMG_FILLPLOT,$aMix=100) { + $this->background_cflag = $aName; + $this->background_cflag_type = $aBgType; + $this->background_cflag_mix = $aMix; + } + + // Alias for the above method + function SetBackgroundCountryFlag($aName,$aBgType=BGIMG_FILLPLOT,$aMix=100) { + $this->background_cflag = $aName; + $this->background_cflag_type = $aBgType; + $this->background_cflag_mix = $aMix; + } + + + // Specify a background image + function SetBackgroundImage($aFileName,$aBgType=BGIMG_FILLPLOT,$aImgFormat='auto') { + + // Get extension to determine image type + if( $aImgFormat == 'auto' ) { + $e = explode('.',$aFileName); + if( !$e ) { + JpGraphError::RaiseL(25018,$aFileName);//('Incorrect file name for Graph::SetBackgroundImage() : '.$aFileName.' Must have a valid image extension (jpg,gif,png) when using autodetection of image type'); + } + + $valid_formats = array('png', 'jpg', 'gif'); + $aImgFormat = strtolower($e[count($e)-1]); + if ($aImgFormat == 'jpeg') { + $aImgFormat = 'jpg'; + } + elseif (!in_array($aImgFormat, $valid_formats) ) { + JpGraphError::RaiseL(25019,$aImgFormat);//('Unknown file extension ($aImgFormat) in Graph::SetBackgroundImage() for filename: '.$aFileName); + } + } + + $this->background_image = $aFileName; + $this->background_image_type=$aBgType; + $this->background_image_format=$aImgFormat; + } + + function SetBackgroundImageMix($aMix) { + $this->background_image_mix = $aMix ; + } + + // Adjust background image position + function SetBackgroundImagePos($aXpos,$aYpos) { + $this->background_image_xpos = $aXpos ; + $this->background_image_ypos = $aYpos ; + } + + // Specify axis style (boxed or single) + function SetAxisStyle($aStyle) { + $this->iAxisStyle = $aStyle ; + } + + // Set a frame around the plot area + function SetBox($aDrawPlotFrame=true,$aPlotFrameColor=array(0,0,0),$aPlotFrameWeight=1) { + $this->boxed = $aDrawPlotFrame; + $this->box_weight = $aPlotFrameWeight; + $this->box_color = $aPlotFrameColor; + } + + // Specify color for the plotarea (not the margins) + function SetColor($aColor) { + $this->plotarea_color=$aColor; + } + + // Specify color for the margins (all areas outside the plotarea) + function SetMarginColor($aColor) { + $this->margin_color=$aColor; + } + + // Set a frame around the entire image + function SetFrame($aDrawImgFrame=true,$aImgFrameColor=array(0,0,0),$aImgFrameWeight=1) { + $this->doframe = $aDrawImgFrame; + $this->frame_color = $aImgFrameColor; + $this->frame_weight = $aImgFrameWeight; + } + + function SetFrameBevel($aDepth=3,$aBorder=false,$aBorderColor='black',$aColor1='white@0.4',$aColor2='darkgray@0.4',$aFlg=true) { + $this->framebevel = $aFlg ; + $this->framebeveldepth = $aDepth ; + $this->framebevelborder = $aBorder ; + $this->framebevelbordercolor = $aBorderColor ; + $this->framebevelcolor1 = $aColor1 ; + $this->framebevelcolor2 = $aColor2 ; + + $this->doshadow = false ; + } + + // Set the shadow around the whole image + function SetShadow($aShowShadow=true,$aShadowWidth=5,$aShadowColor='darkgray') { + $this->doshadow = $aShowShadow; + $this->shadow_color = $aShadowColor; + $this->shadow_width = $aShadowWidth; + $this->footer->iBottomMargin += $aShadowWidth; + $this->footer->iRightMargin += $aShadowWidth; + } + + // Specify x,y scale. Note that if you manually specify the scale + // you must also specify the tick distance with a call to Ticks::Set() + function SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1) { + $this->axtype = $aAxisType; + + if( $aYMax < $aYMin || $aXMax < $aXMin ) { + JpGraphError::RaiseL(25020);//('Graph::SetScale(): Specified Max value must be larger than the specified Min value.'); + } + + $yt=substr($aAxisType,-3,3); + if( $yt == 'lin' ) { + $this->yscale = new LinearScale($aYMin,$aYMax); + } + elseif( $yt == 'int' ) { + $this->yscale = new LinearScale($aYMin,$aYMax); + $this->yscale->SetIntScale(); + } + elseif( $yt == 'log' ) { + $this->yscale = new LogScale($aYMin,$aYMax); + } + else { + JpGraphError::RaiseL(25021,$aAxisType);//("Unknown scale specification for Y-scale. ($aAxisType)"); + } + + $xt=substr($aAxisType,0,3); + if( $xt == 'lin' || $xt == 'tex' ) { + $this->xscale = new LinearScale($aXMin,$aXMax,'x'); + $this->xscale->textscale = ($xt == 'tex'); + } + elseif( $xt == 'int' ) { + $this->xscale = new LinearScale($aXMin,$aXMax,'x'); + $this->xscale->SetIntScale(); + } + elseif( $xt == 'dat' ) { + $this->xscale = new DateScale($aXMin,$aXMax,'x'); + } + elseif( $xt == 'log' ) { + $this->xscale = new LogScale($aXMin,$aXMax,'x'); + } + else { + JpGraphError::RaiseL(25022,$aAxisType);//(" Unknown scale specification for X-scale. ($aAxisType)"); + } + + $this->xaxis = new Axis($this->img,$this->xscale); + $this->yaxis = new Axis($this->img,$this->yscale); + $this->xgrid = new Grid($this->xaxis); + $this->ygrid = new Grid($this->yaxis); + $this->ygrid->Show(); + + + if (!$this->isRunningClear) { + $this->inputValues['aAxisType'] = $aAxisType; + $this->inputValues['aYMin'] = $aYMin; + $this->inputValues['aYMax'] = $aYMax; + $this->inputValues['aXMin'] = $aXMin; + $this->inputValues['aXMax'] = $aXMax; + + if ($this->graph_theme) { + $this->graph_theme->ApplyGraph($this); + } + } + + $this->isAfterSetScale = true; + } + + // Specify secondary Y scale + function SetY2Scale($aAxisType='lin',$aY2Min=1,$aY2Max=1) { + if( $aAxisType == 'lin' ) { + $this->y2scale = new LinearScale($aY2Min,$aY2Max); + } + elseif( $aAxisType == 'int' ) { + $this->y2scale = new LinearScale($aY2Min,$aY2Max); + $this->y2scale->SetIntScale(); + } + elseif( $aAxisType == 'log' ) { + $this->y2scale = new LogScale($aY2Min,$aY2Max); + } + else { + JpGraphError::RaiseL(25023,$aAxisType);//("JpGraph: Unsupported Y2 axis type: $aAxisType\nMust be one of (lin,log,int)"); + } + + $this->y2axis = new Axis($this->img,$this->y2scale); + $this->y2axis->scale->ticks->SetDirection(SIDE_LEFT); + $this->y2axis->SetLabelSide(SIDE_RIGHT); + $this->y2axis->SetPos('max'); + $this->y2axis->SetTitleSide(SIDE_RIGHT); + + // Deafult position is the max x-value + $this->y2grid = new Grid($this->y2axis); + + if ($this->graph_theme) { + $this->graph_theme->ApplyGraph($this); + } + } + + // Set the delta position (in pixels) between the multiple Y-axis + function SetYDeltaDist($aDist) { + $this->iYAxisDeltaPos = $aDist; + } + + // Specify secondary Y scale + function SetYScale($aN,$aAxisType="lin",$aYMin=1,$aYMax=1) { + + if( $aAxisType == 'lin' ) { + $this->ynscale[$aN] = new LinearScale($aYMin,$aYMax); + } + elseif( $aAxisType == 'int' ) { + $this->ynscale[$aN] = new LinearScale($aYMin,$aYMax); + $this->ynscale[$aN]->SetIntScale(); + } + elseif( $aAxisType == 'log' ) { + $this->ynscale[$aN] = new LogScale($aYMin,$aYMax); + } + else { + JpGraphError::RaiseL(25024,$aAxisType);//("JpGraph: Unsupported Y axis type: $aAxisType\nMust be one of (lin,log,int)"); + } + + $this->ynaxis[$aN] = new Axis($this->img,$this->ynscale[$aN]); + $this->ynaxis[$aN]->scale->ticks->SetDirection(SIDE_LEFT); + $this->ynaxis[$aN]->SetLabelSide(SIDE_RIGHT); + + if ($this->graph_theme) { + $this->graph_theme->ApplyGraph($this); + } + } + + // Specify density of ticks when autoscaling 'normal', 'dense', 'sparse', 'verysparse' + // The dividing factor have been determined heuristically according to my aesthetic + // sense (or lack off) y.m.m.v ! + function SetTickDensity($aYDensity=TICKD_NORMAL,$aXDensity=TICKD_NORMAL) { + $this->xtick_factor=30; + $this->ytick_factor=25; + switch( $aYDensity ) { + case TICKD_DENSE: + $this->ytick_factor=12; + break; + case TICKD_NORMAL: + $this->ytick_factor=25; + break; + case TICKD_SPARSE: + $this->ytick_factor=40; + break; + case TICKD_VERYSPARSE: + $this->ytick_factor=100; + break; + default: + JpGraphError::RaiseL(25025,$densy);//("JpGraph: Unsupported Tick density: $densy"); + } + switch( $aXDensity ) { + case TICKD_DENSE: + $this->xtick_factor=15; + break; + case TICKD_NORMAL: + $this->xtick_factor=30; + break; + case TICKD_SPARSE: + $this->xtick_factor=45; + break; + case TICKD_VERYSPARSE: + $this->xtick_factor=60; + break; + default: + JpGraphError::RaiseL(25025,$densx);//("JpGraph: Unsupported Tick density: $densx"); + } + } + + + // Get a string of all image map areas + function GetCSIMareas() { + if( !$this->iHasStroked ) { + $this->Stroke(_CSIM_SPECIALFILE); + } + + $csim = $this->title->GetCSIMAreas(); + $csim .= $this->subtitle->GetCSIMAreas(); + $csim .= $this->subsubtitle->GetCSIMAreas(); + $csim .= $this->legend->GetCSIMAreas(); + + if( $this->y2axis != NULL ) { + $csim .= $this->y2axis->title->GetCSIMAreas(); + } + + if( $this->texts != null ) { + $n = count($this->texts); + for($i=0; $i < $n; ++$i ) { + $csim .= $this->texts[$i]->GetCSIMAreas(); + } + } + + if( $this->y2texts != null && $this->y2scale != null ) { + $n = count($this->y2texts); + for($i=0; $i < $n; ++$i ) { + $csim .= $this->y2texts[$i]->GetCSIMAreas(); + } + } + + if( $this->yaxis != null && $this->xaxis != null ) { + $csim .= $this->yaxis->title->GetCSIMAreas(); + $csim .= $this->xaxis->title->GetCSIMAreas(); + } + + $n = count($this->plots); + for( $i=0; $i < $n; ++$i ) { + $csim .= $this->plots[$i]->GetCSIMareas(); + } + + $n = count($this->y2plots); + for( $i=0; $i < $n; ++$i ) { + $csim .= $this->y2plots[$i]->GetCSIMareas(); + } + + $n = count($this->ynaxis); + for( $i=0; $i < $n; ++$i ) { + $m = count($this->ynplots[$i]); + for($j=0; $j < $m; ++$j ) { + $csim .= $this->ynplots[$i][$j]->GetCSIMareas(); + } + } + + $n = count($this->iTables); + for( $i=0; $i < $n; ++$i ) { + $csim .= $this->iTables[$i]->GetCSIMareas(); + } + + return $csim; + } + + // Get a complete .. tag for the final image map + function GetHTMLImageMap($aMapName) { + $im = "\n"; + $im .= $this->GetCSIMareas(); + $im .= ""; + return $im; + } + + function CheckCSIMCache($aCacheName,$aTimeOut=60) { + global $_SERVER; + + if( $aCacheName=='auto' ) { + $aCacheName=basename($_SERVER['PHP_SELF']); + } + + $urlarg = $this->GetURLArguments(); + $this->csimcachename = CSIMCACHE_DIR.$aCacheName.$urlarg; + $this->csimcachetimeout = $aTimeOut; + + // First determine if we need to check for a cached version + // This differs from the standard cache in the sense that the + // image and CSIM map HTML file is written relative to the directory + // the script executes in and not the specified cache directory. + // The reason for this is that the cache directory is not necessarily + // accessible from the HTTP server. + if( $this->csimcachename != '' ) { + $dir = dirname($this->csimcachename); + $base = basename($this->csimcachename); + $base = strtok($base,'.'); + $suffix = strtok('.'); + $basecsim = $dir.'/'.$base.'?'.$urlarg.'_csim_.html'; + $baseimg = $dir.'/'.$base.'?'.$urlarg.'.'.$this->img->img_format; + + $timedout=false; + // Does it exist at all ? + + if( file_exists($basecsim) && file_exists($baseimg) ) { + // Check that it hasn't timed out + $diff=time()-filemtime($basecsim); + if( $this->csimcachetimeout>0 && ($diff > $this->csimcachetimeout*60) ) { + $timedout=true; + @unlink($basecsim); + @unlink($baseimg); + } + else { + if ($fh = @fopen($basecsim, "r")) { + fpassthru($fh); + return true; + } + else { + JpGraphError::RaiseL(25027,$basecsim);//(" Can't open cached CSIM \"$basecsim\" for reading."); + } + } + } + } + return false; + } + + // Build the argument string to be used with the csim images + static function GetURLArguments($aAddRecursiveBlocker=false) { + + if( $aAddRecursiveBlocker ) { + // This is a JPGRAPH internal defined that prevents + // us from recursively coming here again + $urlarg = _CSIM_DISPLAY.'=1'; + } + + // Now reconstruct any user URL argument + reset($_GET); + while( list($key,$value) = each($_GET) ) { + if( is_array($value) ) { + foreach ( $value as $k => $v ) { + $urlarg .= '&'.$key.'%5B'.$k.'%5D='.urlencode($v); + } + } + else { + $urlarg .= '&'.$key.'='.urlencode($value); + } + } + + // It's not ideal to convert POST argument to GET arguments + // but there is little else we can do. One idea for the + // future might be recreate the POST header in case. + reset($_POST); + while( list($key,$value) = each($_POST) ) { + if( is_array($value) ) { + foreach ( $value as $k => $v ) { + $urlarg .= '&'.$key.'%5B'.$k.'%5D='.urlencode($v); + } + } + else { + $urlarg .= '&'.$key.'='.urlencode($value); + } + } + + return $urlarg; + } + + function SetCSIMImgAlt($aAlt) { + $this->iCSIMImgAlt = $aAlt; + } + + function StrokeCSIM($aScriptName='auto',$aCSIMName='',$aBorder=0) { + if( $aCSIMName=='' ) { + // create a random map name + srand ((double) microtime() * 1000000); + $r = rand(0,100000); + $aCSIMName='__mapname'.$r.'__'; + } + + if( $aScriptName=='auto' ) { + $aScriptName=basename($_SERVER['PHP_SELF']); + } + + $urlarg = $this->GetURLArguments(true); + + if( empty($_GET[_CSIM_DISPLAY]) ) { + // First determine if we need to check for a cached version + // This differs from the standard cache in the sense that the + // image and CSIM map HTML file is written relative to the directory + // the script executes in and not the specified cache directory. + // The reason for this is that the cache directory is not necessarily + // accessible from the HTTP server. + if( $this->csimcachename != '' ) { + $dir = dirname($this->csimcachename); + $base = basename($this->csimcachename); + $base = strtok($base,'.'); + $suffix = strtok('.'); + $basecsim = $dir.'/'.$base.'?'.$urlarg.'_csim_.html'; + $baseimg = $base.'?'.$urlarg.'.'.$this->img->img_format; + + // Check that apache can write to directory specified + + if( file_exists($dir) && !is_writeable($dir) ) { + JpgraphError::RaiseL(25028,$dir);//('Apache/PHP does not have permission to write to the CSIM cache directory ('.$dir.'). Check permissions.'); + } + + // Make sure directory exists + $this->cache->MakeDirs($dir); + + // Write the image file + $this->Stroke(CSIMCACHE_DIR.$baseimg); + + // Construct wrapper HTML and write to file and send it back to browser + + // In the src URL we must replace the '?' with its encoding to prevent the arguments + // to be converted to real arguments. + $tmp = str_replace('?','%3f',$baseimg); + $htmlwrap = $this->GetHTMLImageMap($aCSIMName)."\n". + 'img->width.'" height="'.$this->img->height."\" alt=\"".$this->iCSIMImgAlt."\" />\n"; + + if($fh = @fopen($basecsim,'w') ) { + fwrite($fh,$htmlwrap); + fclose($fh); + echo $htmlwrap; + } + else { + JpGraphError::RaiseL(25029,$basecsim);//(" Can't write CSIM \"$basecsim\" for writing. Check free space and permissions."); + } + } + else { + + if( $aScriptName=='' ) { + JpGraphError::RaiseL(25030);//('Missing script name in call to StrokeCSIM(). You must specify the name of the actual image script as the first parameter to StrokeCSIM().'); + } + echo $this->GetHTMLImageMap($aCSIMName) . $this->GetCSIMImgHTML($aCSIMName, $aScriptName, $aBorder); + } + } + else { + $this->Stroke(); + } + } + + function StrokeCSIMImage() { + if( @$_GET[_CSIM_DISPLAY] == 1 ) { + $this->Stroke(); + } + } + + function GetCSIMImgHTML($aCSIMName, $aScriptName='auto', $aBorder=0 ) { + if( $aScriptName=='auto' ) { + $aScriptName=basename($_SERVER['PHP_SELF']); + } + $urlarg = $this->GetURLArguments(true); + return "\"".$this-iCSIMImgAlt."\" />\n"; + } + + function GetTextsYMinMax($aY2=false) { + if( $aY2 ) { + $txts = $this->y2texts; + } + else { + $txts = $this->texts; + } + $n = count($txts); + $min=null; + $max=null; + for( $i=0; $i < $n; ++$i ) { + if( $txts[$i]->iScalePosY !== null && $txts[$i]->iScalePosX !== null ) { + if( $min === null ) { + $min = $max = $txts[$i]->iScalePosY ; + } + else { + $min = min($min,$txts[$i]->iScalePosY); + $max = max($max,$txts[$i]->iScalePosY); + } + } + } + if( $min !== null ) { + return array($min,$max); + } + else { + return null; + } + } + + function GetTextsXMinMax($aY2=false) { + if( $aY2 ) { + $txts = $this->y2texts; + } + else { + $txts = $this->texts; + } + $n = count($txts); + $min=null; + $max=null; + for( $i=0; $i < $n; ++$i ) { + if( $txts[$i]->iScalePosY !== null && $txts[$i]->iScalePosX !== null ) { + if( $min === null ) { + $min = $max = $txts[$i]->iScalePosX ; + } + else { + $min = min($min,$txts[$i]->iScalePosX); + $max = max($max,$txts[$i]->iScalePosX); + } + } + } + if( $min !== null ) { + return array($min,$max); + } + else { + return null; + } + } + + function GetXMinMax() { + + list($min,$ymin) = $this->plots[0]->Min(); + list($max,$ymax) = $this->plots[0]->Max(); + + $i=0; + // Some plots, e.g. PlotLine should not affect the scale + // and will return (null,null). We should ignore those + // values. + while( ($min===null || $max === null) && ($i < count($this->plots)-1) ) { + ++$i; + list($min,$ymin) = $this->plots[$i]->Min(); + list($max,$ymax) = $this->plots[$i]->Max(); + } + + foreach( $this->plots as $p ) { + list($xmin,$ymin) = $p->Min(); + list($xmax,$ymax) = $p->Max(); + + if( $xmin !== null && $xmax !== null ) { + $min = Min($xmin,$min); + $max = Max($xmax,$max); + } + } + + if( $this->y2axis != null ) { + foreach( $this->y2plots as $p ) { + list($xmin,$ymin) = $p->Min(); + list($xmax,$ymax) = $p->Max(); + $min = Min($xmin,$min); + $max = Max($xmax,$max); + } + } + + $n = count($this->ynaxis); + for( $i=0; $i < $n; ++$i ) { + if( $this->ynaxis[$i] != null) { + foreach( $this->ynplots[$i] as $p ) { + list($xmin,$ymin) = $p->Min(); + list($xmax,$ymax) = $p->Max(); + $min = Min($xmin,$min); + $max = Max($xmax,$max); + } + } + } + return array($min,$max); + } + + function AdjustMarginsForTitles() { + $totrequired = + ($this->title->t != '' + ? $this->title->GetTextHeight($this->img) + $this->title->margin + 5 * SUPERSAMPLING_SCALE + : 0 ) + + ($this->subtitle->t != '' + ? $this->subtitle->GetTextHeight($this->img) + $this->subtitle->margin + 5 * SUPERSAMPLING_SCALE + : 0 ) + + ($this->subsubtitle->t != '' + ? $this->subsubtitle->GetTextHeight($this->img) + $this->subsubtitle->margin + 5 * SUPERSAMPLING_SCALE + : 0 ) ; + + $btotrequired = 0; + if($this->xaxis != null && !$this->xaxis->hide && !$this->xaxis->hide_labels ) { + // Minimum bottom margin + if( $this->xaxis->title->t != '' ) { + if( $this->img->a == 90 ) { + $btotrequired = $this->yaxis->title->GetTextHeight($this->img) + 7 ; + } + else { + $btotrequired = $this->xaxis->title->GetTextHeight($this->img) + 7 ; + } + } + else { + $btotrequired = 0; + } + + if( $this->img->a == 90 ) { + $this->img->SetFont($this->yaxis->font_family,$this->yaxis->font_style, + $this->yaxis->font_size); + $lh = $this->img->GetTextHeight('Mg',$this->yaxis->label_angle); + } + else { + $this->img->SetFont($this->xaxis->font_family,$this->xaxis->font_style, + $this->xaxis->font_size); + $lh = $this->img->GetTextHeight('Mg',$this->xaxis->label_angle); + } + + $btotrequired += $lh + 6; + } + + if( $this->img->a == 90 ) { + // DO Nothing. It gets too messy to do this properly for 90 deg... + } + else{ + // need more top margin + if( $this->img->top_margin < $totrequired ) { + $this->SetMargin( + $this->img->raw_left_margin, + $this->img->raw_right_margin, + $totrequired / SUPERSAMPLING_SCALE, + $this->img->raw_bottom_margin + ); + } + + // need more bottom margin + if( $this->img->bottom_margin < $btotrequired ) { + $this->SetMargin( + $this->img->raw_left_margin, + $this->img->raw_right_margin, + $this->img->raw_top_margin, + $btotrequired / SUPERSAMPLING_SCALE + ); + } + } + } + + function StrokeStore($aStrokeFileName) { + // Get the handler to prevent the library from sending the + // image to the browser + $ih = $this->Stroke(_IMG_HANDLER); + + // Stroke it to a file + $this->img->Stream($aStrokeFileName); + + // Send it back to browser + $this->img->Headers(); + $this->img->Stream(); + } + + function doAutoscaleXAxis() { + //Check if we should autoscale x-axis + if( !$this->xscale->IsSpecified() ) { + if( substr($this->axtype,0,4) == "text" ) { + $max=0; + $n = count($this->plots); + for($i=0; $i < $n; ++$i ) { + $p = $this->plots[$i]; + // We need some unfortunate sub class knowledge here in order + // to increase number of data points in case it is a line plot + // which has the barcenter set. If not it could mean that the + // last point of the data is outside the scale since the barcenter + // settings means that we will shift the entire plot half a tick step + // to the right in oder to align with the center of the bars. + if( class_exists('BarPlot',false) ) { + $cl = strtolower(get_class($p)); + if( (class_exists('BarPlot',false) && ($p instanceof BarPlot)) || empty($p->barcenter) ) { + $max=max($max,$p->numpoints-1); + } + else { + $max=max($max,$p->numpoints); + } + } + else { + if( empty($p->barcenter) ) { + $max=max($max,$p->numpoints-1); + } + else { + $max=max($max,$p->numpoints); + } + } + } + $min=0; + if( $this->y2axis != null ) { + foreach( $this->y2plots as $p ) { + $max=max($max,$p->numpoints-1); + } + } + $n = count($this->ynaxis); + for( $i=0; $i < $n; ++$i ) { + if( $this->ynaxis[$i] != null) { + foreach( $this->ynplots[$i] as $p ) { + $max=max($max,$p->numpoints-1); + } + } + } + + $this->xscale->Update($this->img,$min,$max); + $this->xscale->ticks->Set($this->xaxis->tick_step,1); + $this->xscale->ticks->SupressMinorTickMarks(); + } + else { + list($min,$max) = $this->GetXMinMax(); + + $lres = $this->GetLinesXMinMax($this->lines); + if( $lres ) { + list($linmin,$linmax) = $lres ; + $min = min($min,$linmin); + $max = max($max,$linmax); + } + + $lres = $this->GetLinesXMinMax($this->y2lines); + if( $lres ) { + list($linmin,$linmax) = $lres ; + $min = min($min,$linmin); + $max = max($max,$linmax); + } + + $tres = $this->GetTextsXMinMax(); + if( $tres ) { + list($tmin,$tmax) = $tres ; + $min = min($min,$tmin); + $max = max($max,$tmax); + } + + $tres = $this->GetTextsXMinMax(true); + if( $tres ) { + list($tmin,$tmax) = $tres ; + $min = min($min,$tmin); + $max = max($max,$tmax); + } + + $this->xscale->AutoScale($this->img,$min,$max,round($this->img->plotwidth/$this->xtick_factor)); + } + + //Adjust position of y-axis and y2-axis to minimum/maximum of x-scale + if( !is_numeric($this->yaxis->pos) && !is_string($this->yaxis->pos) ) { + $this->yaxis->SetPos($this->xscale->GetMinVal()); + } + } + elseif( $this->xscale->IsSpecified() && + ( $this->xscale->auto_ticks || !$this->xscale->ticks->IsSpecified()) ) { + // The tick calculation will use the user suplied min/max values to determine + // the ticks. If auto_ticks is false the exact user specifed min and max + // values will be used for the scale. + // If auto_ticks is true then the scale might be slightly adjusted + // so that the min and max values falls on an even major step. + $min = $this->xscale->scale[0]; + $max = $this->xscale->scale[1]; + $this->xscale->AutoScale($this->img,$min,$max,round($this->img->plotwidth/$this->xtick_factor),false); + + // Now make sure we show enough precision to accurate display the + // labels. If this is not done then the user might end up with + // a scale that might actually start with, say 13.5, butdue to rounding + // the scale label will ony show 14. + if( abs(floor($min)-$min) > 0 ) { + + // If the user has set a format then we bail out + if( $this->xscale->ticks->label_formatstr == '' && $this->xscale->ticks->label_dateformatstr == '' ) { + $this->xscale->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; + } + } + } + + // Position the optional Y2 and Yn axis to the rightmost position of the x-axis + if( $this->y2axis != null ) { + if( !is_numeric($this->y2axis->pos) && !is_string($this->y2axis->pos) ) { + $this->y2axis->SetPos($this->xscale->GetMaxVal()); + } + $this->y2axis->SetTitleSide(SIDE_RIGHT); + } + + $n = count($this->ynaxis); + $nY2adj = $this->y2axis != null ? $this->iYAxisDeltaPos : 0; + for( $i=0; $i < $n; ++$i ) { + if( $this->ynaxis[$i] != null ) { + if( !is_numeric($this->ynaxis[$i]->pos) && !is_string($this->ynaxis[$i]->pos) ) { + $this->ynaxis[$i]->SetPos($this->xscale->GetMaxVal()); + $this->ynaxis[$i]->SetPosAbsDelta($i*$this->iYAxisDeltaPos + $nY2adj); + } + $this->ynaxis[$i]->SetTitleSide(SIDE_RIGHT); + } + } + } + + + function doAutoScaleYnAxis() { + + if( $this->y2scale != null) { + if( !$this->y2scale->IsSpecified() && count($this->y2plots)>0 ) { + list($min,$max) = $this->GetPlotsYMinMax($this->y2plots); + + $lres = $this->GetLinesYMinMax($this->y2lines); + if( is_array($lres) ) { + list($linmin,$linmax) = $lres ; + $min = min($min,$linmin); + $max = max($max,$linmax); + } + $tres = $this->GetTextsYMinMax(true); + if( is_array($tres) ) { + list($tmin,$tmax) = $tres ; + $min = min($min,$tmin); + $max = max($max,$tmax); + } + $this->y2scale->AutoScale($this->img,$min,$max,$this->img->plotheight/$this->ytick_factor); + } + elseif( $this->y2scale->IsSpecified() && ( $this->y2scale->auto_ticks || !$this->y2scale->ticks->IsSpecified()) ) { + // The tick calculation will use the user suplied min/max values to determine + // the ticks. If auto_ticks is false the exact user specifed min and max + // values will be used for the scale. + // If auto_ticks is true then the scale might be slightly adjusted + // so that the min and max values falls on an even major step. + $min = $this->y2scale->scale[0]; + $max = $this->y2scale->scale[1]; + $this->y2scale->AutoScale($this->img,$min,$max, + $this->img->plotheight/$this->ytick_factor, + $this->y2scale->auto_ticks); + + // Now make sure we show enough precision to accurate display the + // labels. If this is not done then the user might end up with + // a scale that might actually start with, say 13.5, butdue to rounding + // the scale label will ony show 14. + if( abs(floor($min)-$min) > 0 ) { + // If the user has set a format then we bail out + if( $this->y2scale->ticks->label_formatstr == '' && $this->y2scale->ticks->label_dateformatstr == '' ) { + $this->y2scale->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; + } + } + + } + } + + + // + // Autoscale the extra Y-axises + // + $n = count($this->ynaxis); + for( $i=0; $i < $n; ++$i ) { + if( $this->ynscale[$i] != null) { + if( !$this->ynscale[$i]->IsSpecified() && count($this->ynplots[$i])>0 ) { + list($min,$max) = $this->GetPlotsYMinMax($this->ynplots[$i]); + $this->ynscale[$i]->AutoScale($this->img,$min,$max,$this->img->plotheight/$this->ytick_factor); + } + elseif( $this->ynscale[$i]->IsSpecified() && ( $this->ynscale[$i]->auto_ticks || !$this->ynscale[$i]->ticks->IsSpecified()) ) { + // The tick calculation will use the user suplied min/max values to determine + // the ticks. If auto_ticks is false the exact user specifed min and max + // values will be used for the scale. + // If auto_ticks is true then the scale might be slightly adjusted + // so that the min and max values falls on an even major step. + $min = $this->ynscale[$i]->scale[0]; + $max = $this->ynscale[$i]->scale[1]; + $this->ynscale[$i]->AutoScale($this->img,$min,$max, + $this->img->plotheight/$this->ytick_factor, + $this->ynscale[$i]->auto_ticks); + + // Now make sure we show enough precision to accurate display the + // labels. If this is not done then the user might end up with + // a scale that might actually start with, say 13.5, butdue to rounding + // the scale label will ony show 14. + if( abs(floor($min)-$min) > 0 ) { + // If the user has set a format then we bail out + if( $this->ynscale[$i]->ticks->label_formatstr == '' && $this->ynscale[$i]->ticks->label_dateformatstr == '' ) { + $this->ynscale[$i]->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; + } + } + } + } + } + } + + function doAutoScaleYAxis() { + + //Check if we should autoscale y-axis + if( !$this->yscale->IsSpecified() && count($this->plots)>0 ) { + list($min,$max) = $this->GetPlotsYMinMax($this->plots); + $lres = $this->GetLinesYMinMax($this->lines); + if( is_array($lres) ) { + list($linmin,$linmax) = $lres ; + $min = min($min,$linmin); + $max = max($max,$linmax); + } + $tres = $this->GetTextsYMinMax(); + if( is_array($tres) ) { + list($tmin,$tmax) = $tres ; + $min = min($min,$tmin); + $max = max($max,$tmax); + } + $this->yscale->AutoScale($this->img,$min,$max, + $this->img->plotheight/$this->ytick_factor); + } + elseif( $this->yscale->IsSpecified() && ( $this->yscale->auto_ticks || !$this->yscale->ticks->IsSpecified()) ) { + // The tick calculation will use the user suplied min/max values to determine + // the ticks. If auto_ticks is false the exact user specifed min and max + // values will be used for the scale. + // If auto_ticks is true then the scale might be slightly adjusted + // so that the min and max values falls on an even major step. + $min = $this->yscale->scale[0]; + $max = $this->yscale->scale[1]; + $this->yscale->AutoScale($this->img,$min,$max, + $this->img->plotheight/$this->ytick_factor, + $this->yscale->auto_ticks); + + // Now make sure we show enough precision to accurate display the + // labels. If this is not done then the user might end up with + // a scale that might actually start with, say 13.5, butdue to rounding + // the scale label will ony show 14. + if( abs(floor($min)-$min) > 0 ) { + + // If the user has set a format then we bail out + if( $this->yscale->ticks->label_formatstr == '' && $this->yscale->ticks->label_dateformatstr == '' ) { + $this->yscale->ticks->precision = abs( floor(log10( abs(floor($min)-$min))) )+1; + } + } + } + + } + + function InitScaleConstants() { + // Setup scale constants + if( $this->yscale ) $this->yscale->InitConstants($this->img); + if( $this->xscale ) $this->xscale->InitConstants($this->img); + if( $this->y2scale ) $this->y2scale->InitConstants($this->img); + + $n=count($this->ynscale); + for($i=0; $i < $n; ++$i) { + if( $this->ynscale[$i] ) { + $this->ynscale[$i]->InitConstants($this->img); + } + } + } + + function doPrestrokeAdjustments() { + + // Do any pre-stroke adjustment that is needed by the different plot types + // (i.e bar plots want's to add an offset to the x-labels etc) + for($i=0; $i < count($this->plots) ; ++$i ) { + $this->plots[$i]->PreStrokeAdjust($this); + $this->plots[$i]->DoLegend($this); + } + + // Any plots on the second Y scale? + if( $this->y2scale != null ) { + for($i=0; $iy2plots) ; ++$i ) { + $this->y2plots[$i]->PreStrokeAdjust($this); + $this->y2plots[$i]->DoLegend($this); + } + } + + // Any plots on the extra Y axises? + $n = count($this->ynaxis); + for($i=0; $i<$n ; ++$i ) { + if( $this->ynplots == null || $this->ynplots[$i] == null) { + JpGraphError::RaiseL(25032,$i);//("No plots for Y-axis nbr:$i"); + } + $m = count($this->ynplots[$i]); + for($j=0; $j < $m; ++$j ) { + $this->ynplots[$i][$j]->PreStrokeAdjust($this); + $this->ynplots[$i][$j]->DoLegend($this); + } + } + } + + function StrokeBands($aDepth,$aCSIM) { + // Stroke bands + if( $this->bands != null && !$aCSIM) { + for($i=0; $i < count($this->bands); ++$i) { + // Stroke all bands that asks to be in the background + if( $this->bands[$i]->depth == $aDepth ) { + $this->bands[$i]->Stroke($this->img,$this->xscale,$this->yscale); + } + } + } + + if( $this->y2bands != null && $this->y2scale != null && !$aCSIM ) { + for($i=0; $i < count($this->y2bands); ++$i) { + // Stroke all bands that asks to be in the foreground + if( $this->y2bands[$i]->depth == $aDepth ) { + $this->y2bands[$i]->Stroke($this->img,$this->xscale,$this->y2scale); + } + } + } + } + + + // Stroke the graph + // $aStrokeFileName If != "" the image will be written to this file and NOT + // streamed back to the browser + function Stroke($aStrokeFileName='') { + // Fist make a sanity check that user has specified a scale + if( empty($this->yscale) ) { + JpGraphError::RaiseL(25031);//('You must specify what scale to use with a call to Graph::SetScale().'); + } + + // Start by adjusting the margin so that potential titles will fit. + $this->AdjustMarginsForTitles(); + + // Give the plot a chance to do any scale adjuments the individual plots + // wants to do. Right now this is only used by the contour plot to set scale + // limits + for($i=0; $i < count($this->plots) ; ++$i ) { + $this->plots[$i]->PreScaleSetup($this); + } + + // Init scale constants that are used to calculate the transformation from + // world to pixel coordinates + $this->InitScaleConstants(); + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // a best we can. Therefor you will see a lot of tests !$_csim in the + // code below. + $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); + + // If we are called the second time (perhaps the user has called GetHTMLImageMap() + // himself then the legends have alsready been populated once in order to get the + // CSIM coordinats. Since we do not want the legends to be populated a second time + // we clear the legends + $this->legend->Clear(); + + // We need to know if we have stroked the plot in the + // GetCSIMareas. Otherwise the CSIM hasn't been generated + // and in the case of GetCSIM called before stroke to generate + // CSIM without storing an image to disk GetCSIM must call Stroke. + $this->iHasStroked = true; + + // Setup pre-stroked adjustments and Legends + $this->doPrestrokeAdjustments(); + + if ($this->graph_theme) { + $this->graph_theme->PreStrokeApply($this); + } + + // Bail out if any of the Y-axis not been specified and + // has no plots. (This means it is impossible to do autoscaling and + // no other scale was given so we can't possible draw anything). If you use manual + // scaling you also have to supply the tick steps as well. + if( (!$this->yscale->IsSpecified() && count($this->plots)==0) || + ($this->y2scale!=null && !$this->y2scale->IsSpecified() && count($this->y2plots)==0) ) { + //$e = "n=".count($this->y2plots)."\n"; + // $e = "Can't draw unspecified Y-scale.
\nYou have either:
\n"; + // $e .= "1. Specified an Y axis for autoscaling but have not supplied any plots
\n"; + // $e .= "2. Specified a scale manually but have forgot to specify the tick steps"; + JpGraphError::RaiseL(25026); + } + + // Bail out if no plots and no specified X-scale + if( (!$this->xscale->IsSpecified() && count($this->plots)==0 && count($this->y2plots)==0) ) { + JpGraphError::RaiseL(25034);//("JpGraph: Can't draw unspecified X-scale.
No plots.
"); + } + + // Autoscale the normal Y-axis + $this->doAutoScaleYAxis(); + + // Autoscale all additiopnal y-axis + $this->doAutoScaleYnAxis(); + + // Autoscale the regular x-axis and position the y-axis properly + $this->doAutoScaleXAxis(); + + // If we have a negative values and x-axis position is at 0 + // we need to supress the first and possible the last tick since + // they will be drawn on top of the y-axis (and possible y2 axis) + // The test below might seem strange the reasone being that if + // the user hasn't specified a value for position this will not + // be set until we do the stroke for the axis so as of now it + // is undefined. + // For X-text scale we ignore all this since the tick are usually + // much further in and not close to the Y-axis. Hence the test + // for 'text' + if( ($this->yaxis->pos==$this->xscale->GetMinVal() || (is_string($this->yaxis->pos) && $this->yaxis->pos=='min')) && + !is_numeric($this->xaxis->pos) && $this->yscale->GetMinVal() < 0 && + substr($this->axtype,0,4) != 'text' && $this->xaxis->pos != 'min' ) { + + //$this->yscale->ticks->SupressZeroLabel(false); + $this->xscale->ticks->SupressFirst(); + if( $this->y2axis != null ) { + $this->xscale->ticks->SupressLast(); + } + } + elseif( !is_numeric($this->yaxis->pos) && $this->yaxis->pos=='max' ) { + $this->xscale->ticks->SupressLast(); + } + + if( !$_csim ) { + $this->StrokePlotArea(); + if( $this->iIconDepth == DEPTH_BACK ) { + $this->StrokeIcons(); + } + } + $this->StrokeAxis(false); + + // Stroke colored bands + $this->StrokeBands(DEPTH_BACK,$_csim); + + if( $this->grid_depth == DEPTH_BACK && !$_csim) { + $this->ygrid->Stroke(); + $this->xgrid->Stroke(); + } + + // Stroke Y2-axis + if( $this->y2axis != null && !$_csim) { + $this->y2axis->Stroke($this->xscale); + $this->y2grid->Stroke(); + } + + // Stroke yn-axis + $n = count($this->ynaxis); + for( $i=0; $i < $n; ++$i ) { + $this->ynaxis[$i]->Stroke($this->xscale); + } + + $oldoff=$this->xscale->off; + if( substr($this->axtype,0,4) == 'text' ) { + if( $this->text_scale_abscenteroff > -1 ) { + // For a text scale the scale factor is the number of pixel per step. + // Hence we can use the scale factor as a substitute for number of pixels + // per major scale step and use that in order to adjust the offset so that + // an object of width "abscenteroff" becomes centered. + $this->xscale->off += round($this->xscale->scale_factor/2)-round($this->text_scale_abscenteroff/2); + } + else { + $this->xscale->off += ceil($this->xscale->scale_factor*$this->text_scale_off*$this->xscale->ticks->minor_step); + } + } + + if( $this->iDoClipping ) { + $oldimage = $this->img->CloneCanvasH(); + } + + if( ! $this->y2orderback ) { + // Stroke all plots for Y1 axis + for($i=0; $i < count($this->plots); ++$i) { + $this->plots[$i]->Stroke($this->img,$this->xscale,$this->yscale); + $this->plots[$i]->StrokeMargin($this->img); + } + } + + // Stroke all plots for Y2 axis + if( $this->y2scale != null ) { + for($i=0; $i< count($this->y2plots); ++$i ) { + $this->y2plots[$i]->Stroke($this->img,$this->xscale,$this->y2scale); + } + } + + if( $this->y2orderback ) { + // Stroke all plots for Y1 axis + for($i=0; $i < count($this->plots); ++$i) { + $this->plots[$i]->Stroke($this->img,$this->xscale,$this->yscale); + $this->plots[$i]->StrokeMargin($this->img); + } + } + + $n = count($this->ynaxis); + for( $i=0; $i < $n; ++$i ) { + $m = count($this->ynplots[$i]); + for( $j=0; $j < $m; ++$j ) { + $this->ynplots[$i][$j]->Stroke($this->img,$this->xscale,$this->ynscale[$i]); + $this->ynplots[$i][$j]->StrokeMargin($this->img); + } + } + + if( $this->iIconDepth == DEPTH_FRONT) { + $this->StrokeIcons(); + } + + if( $this->iDoClipping ) { + // Clipping only supports graphs at 0 and 90 degrees + if( $this->img->a == 0 ) { + $this->img->CopyCanvasH($oldimage,$this->img->img, + $this->img->left_margin,$this->img->top_margin, + $this->img->left_margin,$this->img->top_margin, + $this->img->plotwidth+1,$this->img->plotheight); + } + elseif( $this->img->a == 90 ) { + $adj = ($this->img->height - $this->img->width)/2; + $this->img->CopyCanvasH($oldimage,$this->img->img, + $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, + $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, + $this->img->plotheight+1,$this->img->plotwidth); + } + else { + JpGraphError::RaiseL(25035,$this->img->a);//('You have enabled clipping. Cliping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (='.$this->img->a.' degrees) or disable clipping.'); + } + $this->img->Destroy(); + $this->img->SetCanvasH($oldimage); + } + + $this->xscale->off=$oldoff; + + if( $this->grid_depth == DEPTH_FRONT && !$_csim ) { + $this->ygrid->Stroke(); + $this->xgrid->Stroke(); + } + + // Stroke colored bands + $this->StrokeBands(DEPTH_FRONT,$_csim); + + // Finally draw the axis again since some plots may have nagged + // the axis in the edges. + if( !$_csim ) { + $this->StrokeAxis(); + } + + if( $this->y2scale != null && !$_csim ) { + $this->y2axis->Stroke($this->xscale,false); + } + + if( !$_csim ) { + $this->StrokePlotBox(); + } + + // The titles and legends never gets rotated so make sure + // that the angle is 0 before stroking them + $aa = $this->img->SetAngle(0); + $this->StrokeTitles(); + $this->footer->Stroke($this->img); + $this->legend->Stroke($this->img); + $this->img->SetAngle($aa); + $this->StrokeTexts(); + $this->StrokeTables(); + + if( !$_csim ) { + + $this->img->SetAngle($aa); + + // Draw an outline around the image map + if(_JPG_DEBUG) { + $this->DisplayClientSideaImageMapAreas(); + } + + // Should we do any final image transformation + if( $this->iImgTrans ) { + if( !class_exists('ImgTrans',false) ) { + require_once('jpgraph_imgtrans.php'); + //JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.'); + } + + $tform = new ImgTrans($this->img->img); + $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, + $this->iImgTransDirection,$this->iImgTransHighQ, + $this->iImgTransMinSize,$this->iImgTransFillColor, + $this->iImgTransBorder); + } + + // If the filename is given as the special "__handle" + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); + } + } + } + + function SetAxisLabelBackground($aType,$aXFColor='lightgray',$aXColor='black',$aYFColor='lightgray',$aYColor='black') { + $this->iAxisLblBgType = $aType; + $this->iXAxisLblBgFillColor = $aXFColor; + $this->iXAxisLblBgColor = $aXColor; + $this->iYAxisLblBgFillColor = $aYFColor; + $this->iYAxisLblBgColor = $aYColor; + } + + function StrokeAxisLabelBackground() { + // Types + // 0 = No background + // 1 = Only X-labels, length of axis + // 2 = Only Y-labels, length of axis + // 3 = As 1 but extends to width of graph + // 4 = As 2 but extends to height of graph + // 5 = Combination of 3 & 4 + // 6 = Combination of 1 & 2 + + $t = $this->iAxisLblBgType ; + if( $t < 1 ) return; + + // Stroke optional X-axis label background color + if( $t == 1 || $t == 3 || $t == 5 || $t == 6 ) { + $this->img->PushColor($this->iXAxisLblBgFillColor); + if( $t == 1 || $t == 6 ) { + $xl = $this->img->left_margin; + $yu = $this->img->height - $this->img->bottom_margin + 1; + $xr = $this->img->width - $this->img->right_margin ; + $yl = $this->img->height-1-$this->frame_weight; + } + else { // t==3 || t==5 + $xl = $this->frame_weight; + $yu = $this->img->height - $this->img->bottom_margin + 1; + $xr = $this->img->width - 1 - $this->frame_weight; + $yl = $this->img->height-1-$this->frame_weight; + } + + $this->img->FilledRectangle($xl,$yu,$xr,$yl); + $this->img->PopColor(); + + // Check if we should add the vertical lines at left and right edge + if( $this->iXAxisLblBgColor !== '' ) { + // Hardcode to one pixel wide + $this->img->SetLineWeight(1); + $this->img->PushColor($this->iXAxisLblBgColor); + if( $t == 1 || $t == 6 ) { + $this->img->Line($xl,$yu,$xl,$yl); + $this->img->Line($xr,$yu,$xr,$yl); + } + else { + $xl = $this->img->width - $this->img->right_margin ; + $this->img->Line($xl,$yu-1,$xr,$yu-1); + } + $this->img->PopColor(); + } + } + + if( $t == 2 || $t == 4 || $t == 5 || $t == 6 ) { + $this->img->PushColor($this->iYAxisLblBgFillColor); + if( $t == 2 || $t == 6 ) { + $xl = $this->frame_weight; + $yu = $this->frame_weight+$this->img->top_margin; + $xr = $this->img->left_margin - 1; + $yl = $this->img->height - $this->img->bottom_margin + 1; + } + else { + $xl = $this->frame_weight; + $yu = $this->frame_weight; + $xr = $this->img->left_margin - 1; + $yl = $this->img->height-1-$this->frame_weight; + } + + $this->img->FilledRectangle($xl,$yu,$xr,$yl); + $this->img->PopColor(); + + // Check if we should add the vertical lines at left and right edge + if( $this->iXAxisLblBgColor !== '' ) { + $this->img->PushColor($this->iXAxisLblBgColor); + if( $t == 2 || $t == 6 ) { + $this->img->Line($xl,$yu-1,$xr,$yu-1); + $this->img->Line($xl,$yl-1,$xr,$yl-1); + } + else { + $this->img->Line($xr+1,$yu,$xr+1,$this->img->top_margin); + } + $this->img->PopColor(); + } + + } + } + + function StrokeAxis($aStrokeLabels=true) { + + if( $aStrokeLabels ) { + $this->StrokeAxisLabelBackground(); + } + + // Stroke axis + if( $this->iAxisStyle != AXSTYLE_SIMPLE ) { + switch( $this->iAxisStyle ) { + case AXSTYLE_BOXIN : + $toppos = SIDE_DOWN; + $bottompos = SIDE_UP; + $leftpos = SIDE_RIGHT; + $rightpos = SIDE_LEFT; + break; + case AXSTYLE_BOXOUT : + $toppos = SIDE_UP; + $bottompos = SIDE_DOWN; + $leftpos = SIDE_LEFT; + $rightpos = SIDE_RIGHT; + break; + case AXSTYLE_YBOXIN: + $toppos = FALSE; + $bottompos = SIDE_UP; + $leftpos = SIDE_RIGHT; + $rightpos = SIDE_LEFT; + break; + case AXSTYLE_YBOXOUT: + $toppos = FALSE; + $bottompos = SIDE_DOWN; + $leftpos = SIDE_LEFT; + $rightpos = SIDE_RIGHT; + break; + default: + JpGRaphError::RaiseL(25036,$this->iAxisStyle); //('Unknown AxisStyle() : '.$this->iAxisStyle); + break; + } + + // By default we hide the first label so it doesn't cross the + // Y-axis in case the positon hasn't been set by the user. + // However, if we use a box we always want the first value + // displayed so we make sure it will be displayed. + $this->xscale->ticks->SupressFirst(false); + + // Now draw the bottom X-axis + $this->xaxis->SetPos('min'); + $this->xaxis->SetLabelSide(SIDE_DOWN); + $this->xaxis->scale->ticks->SetSide($bottompos); + $this->xaxis->Stroke($this->yscale,$aStrokeLabels); + + if( $toppos !== FALSE ) { + // We also want a top X-axis + $this->xaxis = $this->xaxis; + $this->xaxis->SetPos('max'); + $this->xaxis->SetLabelSide(SIDE_UP); + // No title for the top X-axis + if( $aStrokeLabels ) { + $this->xaxis->title->Set(''); + } + $this->xaxis->scale->ticks->SetSide($toppos); + $this->xaxis->Stroke($this->yscale,$aStrokeLabels); + } + + // Stroke the left Y-axis + $this->yaxis->SetPos('min'); + $this->yaxis->SetLabelSide(SIDE_LEFT); + $this->yaxis->scale->ticks->SetSide($leftpos); + $this->yaxis->Stroke($this->xscale,$aStrokeLabels); + + // Stroke the right Y-axis + $this->yaxis->SetPos('max'); + // No title for the right side + if( $aStrokeLabels ) { + $this->yaxis->title->Set(''); + } + $this->yaxis->SetLabelSide(SIDE_RIGHT); + $this->yaxis->scale->ticks->SetSide($rightpos); + $this->yaxis->Stroke($this->xscale,$aStrokeLabels); + } + else { + $this->xaxis->Stroke($this->yscale,$aStrokeLabels); + $this->yaxis->Stroke($this->xscale,$aStrokeLabels); + } + } + + + // Private helper function for backgound image + static function LoadBkgImage($aImgFormat='',$aFile='',$aImgStr='') { + if( $aImgStr != '' ) { + return Image::CreateFromString($aImgStr); + } + + // Remove case sensitivity and setup appropriate function to create image + // Get file extension. This should be the LAST '.' separated part of the filename + $e = explode('.',$aFile); + $ext = strtolower($e[count($e)-1]); + if ($ext == "jpeg") { + $ext = "jpg"; + } + + if( trim($ext) == '' ) { + $ext = 'png'; // Assume PNG if no extension specified + } + + if( $aImgFormat == '' ) { + $imgtag = $ext; + } + else { + $imgtag = $aImgFormat; + } + + $supported = imagetypes(); + if( ( $ext == 'jpg' && !($supported & IMG_JPG) ) || + ( $ext == 'gif' && !($supported & IMG_GIF) ) || + ( $ext == 'png' && !($supported & IMG_PNG) ) || + ( $ext == 'bmp' && !($supported & IMG_WBMP) ) || + ( $ext == 'xpm' && !($supported & IMG_XPM) ) ) { + + JpGraphError::RaiseL(25037,$aFile);//('The image format of your background image ('.$aFile.') is not supported in your system configuration. '); + } + + + if( $imgtag == "jpg" || $imgtag == "jpeg") { + $f = "imagecreatefromjpeg"; + $imgtag = "jpg"; + } + else { + $f = "imagecreatefrom".$imgtag; + } + + // Compare specified image type and file extension + if( $imgtag != $ext ) { + //$t = "Background image seems to be of different type (has different file extension) than specified imagetype. Specified: '".$aImgFormat."'File: '".$aFile."'"; + JpGraphError::RaiseL(25038, $aImgFormat, $aFile); + } + + $img = @$f($aFile); + if( !$img ) { + JpGraphError::RaiseL(25039,$aFile);//(" Can't read background image: '".$aFile."'"); + } + return $img; + } + + function StrokePlotGrad() { + if( $this->plot_gradtype < 0 ) + return; + + $grad = new Gradient($this->img); + $xl = $this->img->left_margin; + $yt = $this->img->top_margin; + $xr = $xl + $this->img->plotwidth+1 ; + $yb = $yt + $this->img->plotheight ; + $grad->FilledRectangle($xl,$yt,$xr,$yb,$this->plot_gradfrom,$this->plot_gradto,$this->plot_gradtype); + + } + + function StrokeBackgroundGrad() { + if( $this->bkg_gradtype < 0 ) + return; + + $grad = new Gradient($this->img); + if( $this->bkg_gradstyle == BGRAD_PLOT ) { + $xl = $this->img->left_margin; + $yt = $this->img->top_margin; + $xr = $xl + $this->img->plotwidth+1 ; + $yb = $yt + $this->img->plotheight ; + $grad->FilledRectangle($xl,$yt,$xr,$yb,$this->bkg_gradfrom,$this->bkg_gradto,$this->bkg_gradtype); + } + else { + $xl = 0; + $yt = 0; + $xr = $xl + $this->img->width - 1; + $yb = $yt + $this->img->height - 1 ; + if( $this->doshadow ) { + $xr -= $this->shadow_width; + $yb -= $this->shadow_width; + } + if( $this->doframe ) { + $yt += $this->frame_weight; + $yb -= $this->frame_weight; + $xl += $this->frame_weight; + $xr -= $this->frame_weight; + } + $aa = $this->img->SetAngle(0); + $grad->FilledRectangle($xl,$yt,$xr,$yb,$this->bkg_gradfrom,$this->bkg_gradto,$this->bkg_gradtype); + $aa = $this->img->SetAngle($aa); + } + } + + function StrokeFrameBackground() { + if( $this->background_image != '' && $this->background_cflag != '' ) { + JpGraphError::RaiseL(25040);//('It is not possible to specify both a background image and a background country flag.'); + } + if( $this->background_image != '' ) { + $bkgimg = $this->LoadBkgImage($this->background_image_format,$this->background_image); + } + elseif( $this->background_cflag != '' ) { + if( ! class_exists('FlagImages',false) ) { + JpGraphError::RaiseL(25041);//('In order to use Country flags as backgrounds you must include the "jpgraph_flags.php" file.'); + } + $fobj = new FlagImages(FLAGSIZE4); + $dummy=''; + $bkgimg = $fobj->GetImgByName($this->background_cflag,$dummy); + $this->background_image_mix = $this->background_cflag_mix; + $this->background_image_type = $this->background_cflag_type; + } + else { + return ; + } + + $bw = ImageSX($bkgimg); + $bh = ImageSY($bkgimg); + + // No matter what the angle is we always stroke the image and frame + // assuming it is 0 degree + $aa = $this->img->SetAngle(0); + + switch( $this->background_image_type ) { + case BGIMG_FILLPLOT: // Resize to just fill the plotarea + $this->FillMarginArea(); + $this->StrokeFrame(); + // Special case to hande 90 degree rotated graph corectly + if( $aa == 90 ) { + $this->img->SetAngle(90); + $this->FillPlotArea(); + $aa = $this->img->SetAngle(0); + $adj = ($this->img->height - $this->img->width)/2; + $this->img->CopyMerge($bkgimg, + $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, + 0,0, + $this->img->plotheight+1,$this->img->plotwidth, + $bw,$bh,$this->background_image_mix); + } + else { + $this->FillPlotArea(); + $this->img->CopyMerge($bkgimg, + $this->img->left_margin,$this->img->top_margin+1, + 0,0,$this->img->plotwidth+1,$this->img->plotheight, + $bw,$bh,$this->background_image_mix); + } + break; + case BGIMG_FILLFRAME: // Fill the whole area from upper left corner, resize to just fit + $hadj=0; $vadj=0; + if( $this->doshadow ) { + $hadj = $this->shadow_width; + $vadj = $this->shadow_width; + } + $this->FillMarginArea(); + $this->FillPlotArea(); + $this->img->CopyMerge($bkgimg,0,0,0,0,$this->img->width-$hadj,$this->img->height-$vadj, + $bw,$bh,$this->background_image_mix); + $this->StrokeFrame(); + break; + case BGIMG_COPY: // Just copy the image from left corner, no resizing + $this->FillMarginArea(); + $this->FillPlotArea(); + $this->img->CopyMerge($bkgimg,0,0,0,0,$bw,$bh, + $bw,$bh,$this->background_image_mix); + $this->StrokeFrame(); + break; + case BGIMG_CENTER: // Center original image in the plot area + $this->FillMarginArea(); + $this->FillPlotArea(); + $centerx = round($this->img->plotwidth/2+$this->img->left_margin-$bw/2); + $centery = round($this->img->plotheight/2+$this->img->top_margin-$bh/2); + $this->img->CopyMerge($bkgimg,$centerx,$centery,0,0,$bw,$bh, + $bw,$bh,$this->background_image_mix); + $this->StrokeFrame(); + break; + case BGIMG_FREE: // Just copy the image to the specified location + $this->img->CopyMerge($bkgimg, + $this->background_image_xpos,$this->background_image_ypos, + 0,0,$bw,$bh,$bw,$bh,$this->background_image_mix); + $this->StrokeFrame(); // New + break; + default: + JpGraphError::RaiseL(25042);//(" Unknown background image layout"); + } + $this->img->SetAngle($aa); + } + + // Private + // Draw a frame around the image + function StrokeFrame() { + if( !$this->doframe ) return; + + if( $this->background_image_type <= 1 && ($this->bkg_gradtype < 0 || ($this->bkg_gradtype > 0 && $this->bkg_gradstyle==BGRAD_PLOT)) ) { + $c = $this->margin_color; + } + else { + $c = false; + } + + if( $this->doshadow ) { + $this->img->SetColor($this->frame_color); + $this->img->ShadowRectangle(0,0,$this->img->width,$this->img->height, + $c,$this->shadow_width,$this->shadow_color); + } + elseif( $this->framebevel ) { + if( $c ) { + $this->img->SetColor($this->margin_color); + $this->img->FilledRectangle(0,0,$this->img->width-1,$this->img->height-1); + } + $this->img->Bevel(1,1,$this->img->width-2,$this->img->height-2, + $this->framebeveldepth, + $this->framebevelcolor1,$this->framebevelcolor2); + if( $this->framebevelborder ) { + $this->img->SetColor($this->framebevelbordercolor); + $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); + } + } + else { + $this->img->SetLineWeight($this->frame_weight); + if( $c ) { + $this->img->SetColor($this->margin_color); + $this->img->FilledRectangle(0,0,$this->img->width-1,$this->img->height-1); + } + $this->img->SetColor($this->frame_color); + $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); + } + } + + function FillMarginArea() { + $hadj=0; $vadj=0; + if( $this->doshadow ) { + $hadj = $this->shadow_width; + $vadj = $this->shadow_width; + } + + $this->img->SetColor($this->margin_color); + $this->img->FilledRectangle(0,0,$this->img->width-1-$hadj,$this->img->height-1-$vadj); + + $this->img->FilledRectangle(0,0,$this->img->width-1-$hadj,$this->img->top_margin); + $this->img->FilledRectangle(0,$this->img->top_margin,$this->img->left_margin,$this->img->height-1-$hadj); + $this->img->FilledRectangle($this->img->left_margin+1, + $this->img->height-$this->img->bottom_margin, + $this->img->width-1-$hadj, + $this->img->height-1-$hadj); + $this->img->FilledRectangle($this->img->width-$this->img->right_margin, + $this->img->top_margin+1, + $this->img->width-1-$hadj, + $this->img->height-$this->img->bottom_margin-1); + } + + function FillPlotArea() { + $this->img->PushColor($this->plotarea_color); + $this->img->FilledRectangle($this->img->left_margin, + $this->img->top_margin, + $this->img->width-$this->img->right_margin, + $this->img->height-$this->img->bottom_margin); + $this->img->PopColor(); + } + + // Stroke the plot area with either a solid color or a background image + function StrokePlotArea() { + // Note: To be consistent we really should take a possible shadow + // into account. However, that causes some problem for the LinearScale class + // since in the current design it does not have any links to class Graph which + // means it has no way of compensating for the adjusted plotarea in case of a + // shadow. So, until I redesign LinearScale we can't compensate for this. + // So just set the two adjustment parameters to zero for now. + $boxadj = 0; //$this->doframe ? $this->frame_weight : 0 ; + $adj = 0; //$this->doshadow ? $this->shadow_width : 0 ; + + if( $this->background_image != '' || $this->background_cflag != '' ) { + $this->StrokeFrameBackground(); + } + else { + $aa = $this->img->SetAngle(0); + $this->StrokeFrame(); + $aa = $this->img->SetAngle($aa); + $this->StrokeBackgroundGrad(); + if( $this->bkg_gradtype < 0 || ($this->bkg_gradtype > 0 && $this->bkg_gradstyle==BGRAD_MARGIN) ) { + $this->FillPlotArea(); + } + $this->StrokePlotGrad(); + } + } + + function StrokeIcons() { + $n = count($this->iIcons); + for( $i=0; $i < $n; ++$i ) { + $this->iIcons[$i]->StrokeWithScale($this->img,$this->xscale,$this->yscale); + } + } + + function StrokePlotBox() { + // Should we draw a box around the plot area? + if( $this->boxed ) { + $this->img->SetLineWeight(1); + $this->img->SetLineStyle('solid'); + $this->img->SetColor($this->box_color); + for($i=0; $i < $this->box_weight; ++$i ) { + $this->img->Rectangle( + $this->img->left_margin-$i,$this->img->top_margin-$i, + $this->img->width-$this->img->right_margin+$i, + $this->img->height-$this->img->bottom_margin+$i); + } + } + } + + function SetTitleBackgroundFillStyle($aStyle,$aColor1='black',$aColor2='white') { + $this->titlebkg_fillstyle = $aStyle; + $this->titlebkg_scolor1 = $aColor1; + $this->titlebkg_scolor2 = $aColor2; + } + + function SetTitleBackground($aBackColor='gray', $aStyle=TITLEBKG_STYLE1, $aFrameStyle=TITLEBKG_FRAME_NONE, $aFrameColor='black', $aFrameWeight=1, $aBevelHeight=3, $aEnable=true) { + $this->titlebackground = $aEnable; + $this->titlebackground_color = $aBackColor; + $this->titlebackground_style = $aStyle; + $this->titlebackground_framecolor = $aFrameColor; + $this->titlebackground_framestyle = $aFrameStyle; + $this->titlebackground_frameweight = $aFrameWeight; + $this->titlebackground_bevelheight = $aBevelHeight ; + } + + + function StrokeTitles() { + + $margin=3; + + if( $this->titlebackground ) { + // Find out height + $this->title->margin += 2 ; + $h = $this->title->GetTextHeight($this->img)+$this->title->margin+$margin; + if( $this->subtitle->t != '' && !$this->subtitle->hide ) { + $h += $this->subtitle->GetTextHeight($this->img)+$margin+ + $this->subtitle->margin; + $h += 2; + } + if( $this->subsubtitle->t != '' && !$this->subsubtitle->hide ) { + $h += $this->subsubtitle->GetTextHeight($this->img)+$margin+ + $this->subsubtitle->margin; + $h += 2; + } + $this->img->PushColor($this->titlebackground_color); + if( $this->titlebackground_style === TITLEBKG_STYLE1 ) { + // Inside the frame + if( $this->framebevel ) { + $x1 = $y1 = $this->framebeveldepth + 1 ; + $x2 = $this->img->width - $this->framebeveldepth - 2 ; + $this->title->margin += $this->framebeveldepth + 1 ; + $h += $y1 ; + $h += 2; + } + else { + $x1 = $y1 = $this->frame_weight; + $x2 = $this->img->width - $this->frame_weight-1; + } + } + elseif( $this->titlebackground_style === TITLEBKG_STYLE2 ) { + // Cover the frame as well + $x1 = $y1 = 0; + $x2 = $this->img->width - 1 ; + } + elseif( $this->titlebackground_style === TITLEBKG_STYLE3 ) { + // Cover the frame as well (the difference is that + // for style==3 a bevel frame border is on top + // of the title background) + $x1 = $y1 = 0; + $x2 = $this->img->width - 1 ; + $h += $this->framebeveldepth ; + $this->title->margin += $this->framebeveldepth ; + } + else { + JpGraphError::RaiseL(25043);//('Unknown title background style.'); + } + + if( $this->titlebackground_framestyle === 3 ) { + $h += $this->titlebackground_bevelheight*2 + 1 ; + $this->title->margin += $this->titlebackground_bevelheight ; + } + + if( $this->doshadow ) { + $x2 -= $this->shadow_width ; + } + + $indent=0; + if( $this->titlebackground_framestyle == TITLEBKG_FRAME_BEVEL ) { + $indent = $this->titlebackground_bevelheight; + } + + if( $this->titlebkg_fillstyle==TITLEBKG_FILLSTYLE_HSTRIPED ) { + $this->img->FilledRectangle2($x1+$indent,$y1+$indent,$x2-$indent,$h-$indent, + $this->titlebkg_scolor1, + $this->titlebkg_scolor2); + } + elseif( $this->titlebkg_fillstyle==TITLEBKG_FILLSTYLE_VSTRIPED ) { + $this->img->FilledRectangle2($x1+$indent,$y1+$indent,$x2-$indent,$h-$indent, + $this->titlebkg_scolor1, + $this->titlebkg_scolor2,2); + } + else { + // Solid fill + $this->img->FilledRectangle($x1,$y1,$x2,$h); + } + $this->img->PopColor(); + + $this->img->PushColor($this->titlebackground_framecolor); + $this->img->SetLineWeight($this->titlebackground_frameweight); + if( $this->titlebackground_framestyle == TITLEBKG_FRAME_FULL ) { + // Frame background + $this->img->Rectangle($x1,$y1,$x2,$h); + } + elseif( $this->titlebackground_framestyle == TITLEBKG_FRAME_BOTTOM ) { + // Bottom line only + $this->img->Line($x1,$h,$x2,$h); + } + elseif( $this->titlebackground_framestyle == TITLEBKG_FRAME_BEVEL ) { + $this->img->Bevel($x1,$y1,$x2,$h,$this->titlebackground_bevelheight); + } + $this->img->PopColor(); + + // This is clumsy. But we neeed to stroke the whole graph frame if it is + // set to bevel to get the bevel shading on top of the text background + if( $this->framebevel && $this->doframe && $this->titlebackground_style === 3 ) { + $this->img->Bevel(1,1,$this->img->width-2,$this->img->height-2, + $this->framebeveldepth, + $this->framebevelcolor1,$this->framebevelcolor2); + if( $this->framebevelborder ) { + $this->img->SetColor($this->framebevelbordercolor); + $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); + } + } + } + + // Stroke title + $y = $this->title->margin; + if( $this->title->halign == 'center' ) { + $this->title->Center(0,$this->img->width,$y); + } + elseif( $this->title->halign == 'left' ) { + $this->title->SetPos($this->title->margin+2,$y); + } + elseif( $this->title->halign == 'right' ) { + $indent = 0; + if( $this->doshadow ) { + $indent = $this->shadow_width+2; + } + $this->title->SetPos($this->img->width-$this->title->margin-$indent,$y,'right'); + } + $this->title->Stroke($this->img); + + // ... and subtitle + $y += $this->title->GetTextHeight($this->img) + $margin + $this->subtitle->margin; + if( $this->subtitle->halign == 'center' ) { + $this->subtitle->Center(0,$this->img->width,$y); + } + elseif( $this->subtitle->halign == 'left' ) { + $this->subtitle->SetPos($this->subtitle->margin+2,$y); + } + elseif( $this->subtitle->halign == 'right' ) { + $indent = 0; + if( $this->doshadow ) + $indent = $this->shadow_width+2; + $this->subtitle->SetPos($this->img->width-$this->subtitle->margin-$indent,$y,'right'); + } + $this->subtitle->Stroke($this->img); + + // ... and subsubtitle + $y += $this->subtitle->GetTextHeight($this->img) + $margin + $this->subsubtitle->margin; + if( $this->subsubtitle->halign == 'center' ) { + $this->subsubtitle->Center(0,$this->img->width,$y); + } + elseif( $this->subsubtitle->halign == 'left' ) { + $this->subsubtitle->SetPos($this->subsubtitle->margin+2,$y); + } + elseif( $this->subsubtitle->halign == 'right' ) { + $indent = 0; + if( $this->doshadow ) + $indent = $this->shadow_width+2; + $this->subsubtitle->SetPos($this->img->width-$this->subsubtitle->margin-$indent,$y,'right'); + } + $this->subsubtitle->Stroke($this->img); + + // ... and fancy title + $this->tabtitle->Stroke($this->img); + + } + + function StrokeTexts() { + // Stroke any user added text objects + if( $this->texts != null ) { + for($i=0; $i < count($this->texts); ++$i) { + $this->texts[$i]->StrokeWithScale($this->img,$this->xscale,$this->yscale); + } + } + + if( $this->y2texts != null && $this->y2scale != null ) { + for($i=0; $i < count($this->y2texts); ++$i) { + $this->y2texts[$i]->StrokeWithScale($this->img,$this->xscale,$this->y2scale); + } + } + + } + + function StrokeTables() { + if( $this->iTables != null ) { + $n = count($this->iTables); + for( $i=0; $i < $n; ++$i ) { + $this->iTables[$i]->StrokeWithScale($this->img,$this->xscale,$this->yscale); + } + } + } + + function DisplayClientSideaImageMapAreas() { + // Debug stuff - display the outline of the image map areas + $csim=''; + foreach ($this->plots as $p) { + $csim.= $p->GetCSIMareas(); + } + $csim .= $this->legend->GetCSIMareas(); + if (preg_match_all("/area shape=\"(\w+)\" coords=\"([0-9\, ]+)\"/", $csim, $coords)) { + $this->img->SetColor($this->csimcolor); + $n = count($coords[0]); + for ($i=0; $i < $n; $i++) { + if ( $coords[1][$i] == 'poly' ) { + preg_match_all('/\s*([0-9]+)\s*,\s*([0-9]+)\s*,*/',$coords[2][$i],$pts); + $this->img->SetStartPoint($pts[1][count($pts[0])-1],$pts[2][count($pts[0])-1]); + $m = count($pts[0]); + for ($j=0; $j < $m; $j++) { + $this->img->LineTo($pts[1][$j],$pts[2][$j]); + } + } elseif ( $coords[1][$i] == 'rect' ) { + $pts = preg_split('/,/', $coords[2][$i]); + $this->img->SetStartPoint($pts[0],$pts[1]); + $this->img->LineTo($pts[2],$pts[1]); + $this->img->LineTo($pts[2],$pts[3]); + $this->img->LineTo($pts[0],$pts[3]); + $this->img->LineTo($pts[0],$pts[1]); + } + } + } + } + + // Text scale offset in world coordinates + function SetTextScaleOff($aOff) { + $this->text_scale_off = $aOff; + $this->xscale->text_scale_off = $aOff; + } + + // Text width of bar to be centered in absolute pixels + function SetTextScaleAbsCenterOff($aOff) { + $this->text_scale_abscenteroff = $aOff; + } + + // Get Y min and max values for added lines + function GetLinesYMinMax( $aLines ) { + $n = count($aLines); + if( $n == 0 ) return false; + $min = $aLines[0]->scaleposition ; + $max = $min ; + $flg = false; + for( $i=0; $i < $n; ++$i ) { + if( $aLines[$i]->direction == HORIZONTAL ) { + $flg = true ; + $v = $aLines[$i]->scaleposition ; + if( $min > $v ) $min = $v ; + if( $max < $v ) $max = $v ; + } + } + return $flg ? array($min,$max) : false ; + } + + // Get X min and max values for added lines + function GetLinesXMinMax( $aLines ) { + $n = count($aLines); + if( $n == 0 ) return false ; + $min = $aLines[0]->scaleposition ; + $max = $min ; + $flg = false; + for( $i=0; $i < $n; ++$i ) { + if( $aLines[$i]->direction == VERTICAL ) { + $flg = true ; + $v = $aLines[$i]->scaleposition ; + if( $min > $v ) $min = $v ; + if( $max < $v ) $max = $v ; + } + } + return $flg ? array($min,$max) : false ; + } + + // Get min and max values for all included plots + function GetPlotsYMinMax($aPlots) { + $n = count($aPlots); + $i=0; + do { + list($xmax,$max) = $aPlots[$i]->Max(); + } while( ++$i < $n && !is_numeric($max) ); + + $i=0; + do { + list($xmin,$min) = $aPlots[$i]->Min(); + } while( ++$i < $n && !is_numeric($min) ); + + if( !is_numeric($min) || !is_numeric($max) ) { + JpGraphError::RaiseL(25044);//('Cannot use autoscaling since it is impossible to determine a valid min/max value of the Y-axis (only null values).'); + } + + for($i=0; $i < $n; ++$i ) { + list($xmax,$ymax)=$aPlots[$i]->Max(); + list($xmin,$ymin)=$aPlots[$i]->Min(); + if (is_numeric($ymax)) $max=max($max,$ymax); + if (is_numeric($ymin)) $min=min($min,$ymin); + } + if( $min == '' ) $min = 0; + if( $max == '' ) $max = 0; + if( $min == 0 && $max == 0 ) { + // Special case if all values are 0 + $min=0;$max=1; + } + return array($min,$max); + } + + function hasLinePlotAndBarPlot() { + $has_line = false; + $has_bar = false; + + foreach ($this->plots as $plot) { + if ($plot instanceof LinePlot) { + $has_line = true; + } + if ($plot instanceof BarPlot) { + $has_bar = true; + } + } + + if ($has_line && $has_bar) { + return true; + } + + return false; + } + + function SetTheme($graph_theme) { + + if (!($this instanceof PieGraph)) { + if (!$this->isAfterSetScale) { + JpGraphError::RaiseL(25133);//('Use Graph::SetTheme() after Graph::SetScale().'); + } + } + + if ($this->graph_theme) { + $this->ClearTheme(); + } + $this->graph_theme = $graph_theme; + $this->graph_theme->ApplyGraph($this); + } + + function ClearTheme() { + $this->graph_theme = null; + + $this->isRunningClear = true; + + $this->__construct( + $this->inputValues['aWidth'], + $this->inputValues['aHeight'], + $this->inputValues['aCachedName'], + $this->inputValues['aTimeout'], + $this->inputValues['aInline'] + ); + + if (!($this instanceof PieGraph)) { + if ($this->isAfterSetScale) { + $this->SetScale( + $this->inputValues['aAxisType'], + $this->inputValues['aYMin'], + $this->inputValues['aYMax'], + $this->inputValues['aXMin'], + $this->inputValues['aXMax'] + ); + } + } + + $this->isRunningClear = false; + } + + function SetSupersampling($do = false, $scale = 2) { + if ($do) { + define('SUPERSAMPLING_SCALE', $scale); + // $this->img->scale = $scale; + } else { + define('SUPERSAMPLING_SCALE', 1); + //$this->img->scale = 0; + } + } + +} // Class + +//=================================================== +// CLASS LineProperty +// Description: Holds properties for a line +//=================================================== +class LineProperty { + public $iWeight=1, $iColor='black', $iStyle='solid', $iShow=false; + + function __construct($aWeight=1,$aColor='black',$aStyle='solid') { + $this->iWeight = $aWeight; + $this->iColor = $aColor; + $this->iStyle = $aStyle; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function SetWeight($aWeight) { + $this->iWeight = $aWeight; + } + + function SetStyle($aStyle) { + $this->iStyle = $aStyle; + } + + function Show($aShow=true) { + $this->iShow=$aShow; + } + + function Stroke($aImg,$aX1,$aY1,$aX2,$aY2) { + if( $this->iShow ) { + $aImg->PushColor($this->iColor); + $oldls = $aImg->line_style; + $oldlw = $aImg->line_weight; + $aImg->SetLineWeight($this->iWeight); + $aImg->SetLineStyle($this->iStyle); + $aImg->StyleLine($aX1,$aY1,$aX2,$aY2); + $aImg->PopColor($this->iColor); + $aImg->line_style = $oldls; + $aImg->line_weight = $oldlw; + + } + } +} + +//=================================================== +// CLASS GraphTabTitle +// Description: Draw "tab" titles on top of graphs +//=================================================== +class GraphTabTitle extends Text{ + private $corner = 6 , $posx = 7, $posy = 4; + private $fillcolor='lightyellow',$bordercolor='black'; + private $align = 'left', $width=TABTITLE_WIDTHFIT; + function __construct() { + $this->t = ''; + $this->font_style = FS_BOLD; + $this->hide = true; + $this->color = 'darkred'; + } + + function SetColor($aTxtColor,$aFillColor='lightyellow',$aBorderColor='black') { + $this->color = $aTxtColor; + $this->fillcolor = $aFillColor; + $this->bordercolor = $aBorderColor; + } + + function SetFillColor($aFillColor) { + $this->fillcolor = $aFillColor; + } + + function SetTabAlign($aAlign) { + $this->align = $aAlign; + } + + function SetWidth($aWidth) { + $this->width = $aWidth ; + } + + function Set($t) { + $this->t = $t; + $this->hide = false; + } + + function SetCorner($aD) { + $this->corner = $aD ; + } + + function Stroke($aImg,$aDummy1=null,$aDummy2=null) { + if( $this->hide ) + return; + $this->boxed = false; + $w = $this->GetWidth($aImg) + 2*$this->posx; + $h = $this->GetTextHeight($aImg) + 2*$this->posy; + + $x = $aImg->left_margin; + $y = $aImg->top_margin; + + if( $this->width === TABTITLE_WIDTHFIT ) { + if( $this->align == 'left' ) { + $p = array($x, $y, + $x, $y-$h+$this->corner, + $x + $this->corner,$y-$h, + $x + $w - $this->corner, $y-$h, + $x + $w, $y-$h+$this->corner, + $x + $w, $y); + } + elseif( $this->align == 'center' ) { + $x += round($aImg->plotwidth/2) - round($w/2); + $p = array($x, $y, + $x, $y-$h+$this->corner, + $x + $this->corner, $y-$h, + $x + $w - $this->corner, $y-$h, + $x + $w, $y-$h+$this->corner, + $x + $w, $y); + } + else { + $x += $aImg->plotwidth -$w; + $p = array($x, $y, + $x, $y-$h+$this->corner, + $x + $this->corner,$y-$h, + $x + $w - $this->corner, $y-$h, + $x + $w, $y-$h+$this->corner, + $x + $w, $y); + } + } + else { + if( $this->width === TABTITLE_WIDTHFULL ) { + $w = $aImg->plotwidth ; + } + else { + $w = $this->width ; + } + + // Make the tab fit the width of the plot area + $p = array($x, $y, + $x, $y-$h+$this->corner, + $x + $this->corner,$y-$h, + $x + $w - $this->corner, $y-$h, + $x + $w, $y-$h+$this->corner, + $x + $w, $y); + + } + if( $this->halign == 'left' ) { + $aImg->SetTextAlign('left','bottom'); + $x += $this->posx; + $y -= $this->posy; + } + elseif( $this->halign == 'center' ) { + $aImg->SetTextAlign('center','bottom'); + $x += $w/2; + $y -= $this->posy; + } + else { + $aImg->SetTextAlign('right','bottom'); + $x += $w - $this->posx; + $y -= $this->posy; + } + + $aImg->SetColor($this->fillcolor); + $aImg->FilledPolygon($p); + + $aImg->SetColor($this->bordercolor); + $aImg->Polygon($p,true); + + $aImg->SetColor($this->color); + $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); + $aImg->StrokeText($x,$y,$this->t,0,'center'); + } + +} + +//=================================================== +// CLASS SuperScriptText +// Description: Format a superscript text +//=================================================== +class SuperScriptText extends Text { + private $iSuper=''; + private $sfont_family='',$sfont_style='',$sfont_size=8; + private $iSuperMargin=2,$iVertOverlap=4,$iSuperScale=0.65; + private $iSDir=0; + private $iSimple=false; + + function __construct($aTxt='',$aSuper='',$aXAbsPos=0,$aYAbsPos=0) { + parent::__construct($aTxt,$aXAbsPos,$aYAbsPos); + $this->iSuper = $aSuper; + } + + function FromReal($aVal,$aPrecision=2) { + // Convert a floating point number to scientific notation + $neg=1.0; + if( $aVal < 0 ) { + $neg = -1.0; + $aVal = -$aVal; + } + + $l = floor(log10($aVal)); + $a = sprintf("%0.".$aPrecision."f",round($aVal / pow(10,$l),$aPrecision)); + $a *= $neg; + if( $this->iSimple && ($a == 1 || $a==-1) ) $a = ''; + + if( $a != '' ) { + $this->t = $a.' * 10'; + } + else { + if( $neg == 1 ) { + $this->t = '10'; + } + else { + $this->t = '-10'; + } + } + $this->iSuper = $l; + } + + function Set($aTxt,$aSuper='') { + $this->t = $aTxt; + $this->iSuper = $aSuper; + } + + function SetSuperFont($aFontFam,$aFontStyle=FS_NORMAL,$aFontSize=8) { + $this->sfont_family = $aFontFam; + $this->sfont_style = $aFontStyle; + $this->sfont_size = $aFontSize; + } + + // Total width of text + function GetWidth($aImg) { + $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); + $w = $aImg->GetTextWidth($this->t); + $aImg->SetFont($this->sfont_family,$this->sfont_style,$this->sfont_size); + $w += $aImg->GetTextWidth($this->iSuper); + $w += $this->iSuperMargin; + return $w; + } + + // Hight of font (approximate the height of the text) + function GetFontHeight($aImg) { + $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); + $h = $aImg->GetFontHeight(); + $aImg->SetFont($this->sfont_family,$this->sfont_style,$this->sfont_size); + $h += $aImg->GetFontHeight(); + return $h; + } + + // Hight of text + function GetTextHeight($aImg) { + $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); + $h = $aImg->GetTextHeight($this->t); + $aImg->SetFont($this->sfont_family,$this->sfont_style,$this->sfont_size); + $h += $aImg->GetTextHeight($this->iSuper); + return $h; + } + + function Stroke($aImg,$ax=-1,$ay=-1) { + + // To position the super script correctly we need different + // cases to handle the alignmewnt specified since that will + // determine how we can interpret the x,y coordinates + + $w = parent::GetWidth($aImg); + $h = parent::GetTextHeight($aImg); + switch( $this->valign ) { + case 'top': + $sy = $this->y; + break; + case 'center': + $sy = $this->y - $h/2; + break; + case 'bottom': + $sy = $this->y - $h; + break; + default: + JpGraphError::RaiseL(25052);//('PANIC: Internal error in SuperScript::Stroke(). Unknown vertical alignment for text'); + break; + } + + switch( $this->halign ) { + case 'left': + $sx = $this->x + $w; + break; + case 'center': + $sx = $this->x + $w/2; + break; + case 'right': + $sx = $this->x; + break; + default: + JpGraphError::RaiseL(25053);//('PANIC: Internal error in SuperScript::Stroke(). Unknown horizontal alignment for text'); + break; + } + + $sx += $this->iSuperMargin; + $sy += $this->iVertOverlap; + + // Should we automatically determine the font or + // has the user specified it explicetly? + if( $this->sfont_family == '' ) { + if( $this->font_family <= FF_FONT2 ) { + if( $this->font_family == FF_FONT0 ) { + $sff = FF_FONT0; + } + elseif( $this->font_family == FF_FONT1 ) { + if( $this->font_style == FS_NORMAL ) { + $sff = FF_FONT0; + } + else { + $sff = FF_FONT1; + } + } + else { + $sff = FF_FONT1; + } + $sfs = $this->font_style; + $sfz = $this->font_size; + } + else { + // TTF fonts + $sff = $this->font_family; + $sfs = $this->font_style; + $sfz = floor($this->font_size*$this->iSuperScale); + if( $sfz < 8 ) $sfz = 8; + } + $this->sfont_family = $sff; + $this->sfont_style = $sfs; + $this->sfont_size = $sfz; + } + else { + $sff = $this->sfont_family; + $sfs = $this->sfont_style; + $sfz = $this->sfont_size; + } + + parent::Stroke($aImg,$ax,$ay); + + // For the builtin fonts we need to reduce the margins + // since the bounding bx reported for the builtin fonts + // are much larger than for the TTF fonts. + if( $sff <= FF_FONT2 ) { + $sx -= 2; + $sy += 3; + } + + $aImg->SetTextAlign('left','bottom'); + $aImg->SetFont($sff,$sfs,$sfz); + $aImg->PushColor($this->color); + $aImg->StrokeText($sx,$sy,$this->iSuper,$this->iSDir,'left'); + $aImg->PopColor(); + } +} + + +//=================================================== +// CLASS Grid +// Description: responsible for drawing grid lines in graph +//=================================================== +class Grid { + protected $img; + protected $scale; + protected $majorcolor='#CCCCCC',$minorcolor='#DDDDDD'; + protected $majortype='solid',$minortype='solid'; + protected $show=false, $showMinor=false,$majorweight=1,$minorweight=1; + protected $fill=false,$fillcolor=array('#EFEFEF','#BBCCFF'); + + function __construct($aAxis) { + $this->scale = $aAxis->scale; + $this->img = $aAxis->img; + } + + function SetColor($aMajColor,$aMinColor=false) { + $this->majorcolor=$aMajColor; + if( $aMinColor === false ) { + $aMinColor = $aMajColor ; + } + $this->minorcolor = $aMinColor; + } + + function SetWeight($aMajorWeight,$aMinorWeight=1) { + $this->majorweight=$aMajorWeight; + $this->minorweight=$aMinorWeight; + } + + // Specify if grid should be dashed, dotted or solid + function SetLineStyle($aMajorType,$aMinorType='solid') { + $this->majortype = $aMajorType; + $this->minortype = $aMinorType; + } + + function SetStyle($aMajorType,$aMinorType='solid') { + $this->SetLineStyle($aMajorType,$aMinorType); + } + + // Decide if both major and minor grid should be displayed + function Show($aShowMajor=true,$aShowMinor=false) { + $this->show=$aShowMajor; + $this->showMinor=$aShowMinor; + } + + function SetFill($aFlg=true,$aColor1='lightgray',$aColor2='lightblue') { + $this->fill = $aFlg; + $this->fillcolor = array( $aColor1, $aColor2 ); + } + + // Display the grid + function Stroke() { + if( $this->showMinor && !$this->scale->textscale ) { + $this->DoStroke($this->scale->ticks->ticks_pos,$this->minortype,$this->minorcolor,$this->minorweight); + $this->DoStroke($this->scale->ticks->maj_ticks_pos,$this->majortype,$this->majorcolor,$this->majorweight); + } + else { + $this->DoStroke($this->scale->ticks->maj_ticks_pos,$this->majortype,$this->majorcolor,$this->majorweight); + } + } + + //-------------- + // Private methods + // Draw the grid + function DoStroke($aTicksPos,$aType,$aColor,$aWeight) { + if( !$this->show ) return; + $nbrgrids = count($aTicksPos); + + if( $this->scale->type == 'y' ) { + $xl=$this->img->left_margin; + $xr=$this->img->width-$this->img->right_margin; + + if( $this->fill ) { + // Draw filled areas + $y2 = $aTicksPos[0]; + $i=1; + while( $i < $nbrgrids ) { + $y1 = $y2; + $y2 = $aTicksPos[$i++]; + $this->img->SetColor($this->fillcolor[$i & 1]); + $this->img->FilledRectangle($xl,$y1,$xr,$y2); + } + } + + $this->img->SetColor($aColor); + $this->img->SetLineWeight($aWeight); + + // Draw grid lines + switch( $aType ) { + case 'solid': $style = LINESTYLE_SOLID; break; + case 'dotted': $style = LINESTYLE_DOTTED; break; + case 'dashed': $style = LINESTYLE_DASHED; break; + case 'longdashed': $style = LINESTYLE_LONGDASH; break; + default: + $style = LINESTYLE_SOLID; break; + } + + for($i=0; $i < $nbrgrids; ++$i) { + $y=$aTicksPos[$i]; + $this->img->StyleLine($xl,$y,$xr,$y,$style,true); + } + } + elseif( $this->scale->type == 'x' ) { + $yu=$this->img->top_margin; + $yl=$this->img->height-$this->img->bottom_margin; + $limit=$this->img->width-$this->img->right_margin; + + if( $this->fill ) { + // Draw filled areas + $x2 = $aTicksPos[0]; + $i=1; + while( $i < $nbrgrids ) { + $x1 = $x2; + $x2 = min($aTicksPos[$i++],$limit) ; + $this->img->SetColor($this->fillcolor[$i & 1]); + $this->img->FilledRectangle($x1,$yu,$x2,$yl); + } + } + + $this->img->SetColor($aColor); + $this->img->SetLineWeight($aWeight); + + // We must also test for limit since we might have + // an offset and the number of ticks is calculated with + // assumption offset==0 so we might end up drawing one + // to many gridlines + $i=0; + $x=$aTicksPos[$i]; + while( $iimg->Line($x,$yl,$x,$yu); + elseif( $aType == 'dotted' ) $this->img->DashedLineForGrid($x,$yl,$x,$yu,1,6); + elseif( $aType == 'dashed' ) $this->img->DashedLineForGrid($x,$yl,$x,$yu,2,4); + elseif( $aType == 'longdashed' ) $this->img->DashedLineForGrid($x,$yl,$x,$yu,8,6); + ++$i; + } + } + else { + JpGraphError::RaiseL(25054,$this->scale->type);//('Internal error: Unknown grid axis ['.$this->scale->type.']'); + } + return true; + } +} // Class + +//=================================================== +// CLASS Axis +// Description: Defines X and Y axis. Notes that at the +// moment the code is not really good since the axis on +// several occasion must know wheter it's an X or Y axis. +// This was a design decision to make the code easier to +// follow. +//=================================================== +class AxisPrototype { + public $scale=null; + public $img=null; + public $hide=false,$hide_labels=false; + public $title=null; + public $font_family=FF_DEFAULT,$font_style=FS_NORMAL,$font_size=8,$label_angle=0; + public $tick_step=1; + public $pos = false; + public $ticks_label = array(); + + protected $weight=1; + protected $color=array(0,0,0),$label_color=array(0,0,0); + protected $ticks_label_colors=null; + protected $show_first_label=true,$show_last_label=true; + protected $label_step=1; // Used by a text axis to specify what multiple of major steps + // should be labeled. + protected $labelPos=0; // Which side of the axis should the labels be? + protected $title_adjust,$title_margin,$title_side=SIDE_LEFT; + protected $tick_label_margin=5; + protected $label_halign = '',$label_valign = '', $label_para_align='left'; + protected $hide_line=false; + protected $iDeltaAbsPos=0; + + function __construct($img,$aScale,$color = array(0,0,0)) { + $this->img = $img; + $this->scale = $aScale; + $this->color = $color; + $this->title=new Text(''); + + if( $aScale->type == 'y' ) { + $this->title_margin = 25; + $this->title_adjust = 'middle'; + $this->title->SetOrientation(90); + $this->tick_label_margin=7; + $this->labelPos=SIDE_LEFT; + } + else { + $this->title_margin = 5; + $this->title_adjust = 'high'; + $this->title->SetOrientation(0); + $this->tick_label_margin=5; + $this->labelPos=SIDE_DOWN; + $this->title_side=SIDE_DOWN; + } + } + + function SetLabelFormat($aFormStr) { + $this->scale->ticks->SetLabelFormat($aFormStr); + } + + function SetLabelFormatString($aFormStr,$aDate=false) { + $this->scale->ticks->SetLabelFormat($aFormStr,$aDate); + } + + function SetLabelFormatCallback($aFuncName) { + $this->scale->ticks->SetFormatCallback($aFuncName); + } + + function SetLabelAlign($aHAlign,$aVAlign='top',$aParagraphAlign='left') { + $this->label_halign = $aHAlign; + $this->label_valign = $aVAlign; + $this->label_para_align = $aParagraphAlign; + } + + // Don't display the first label + function HideFirstTickLabel($aShow=false) { + $this->show_first_label=$aShow; + } + + function HideLastTickLabel($aShow=false) { + $this->show_last_label=$aShow; + } + + // Manually specify the major and (optional) minor tick position and labels + function SetTickPositions($aMajPos,$aMinPos=NULL,$aLabels=NULL) { + $this->scale->ticks->SetTickPositions($aMajPos,$aMinPos,$aLabels); + } + + // Manually specify major tick positions and optional labels + function SetMajTickPositions($aMajPos,$aLabels=NULL) { + $this->scale->ticks->SetTickPositions($aMajPos,NULL,$aLabels); + } + + // Hide minor or major tick marks + function HideTicks($aHideMinor=true,$aHideMajor=true) { + $this->scale->ticks->SupressMinorTickMarks($aHideMinor); + $this->scale->ticks->SupressTickMarks($aHideMajor); + } + + // Hide zero label + function HideZeroLabel($aFlag=true) { + $this->scale->ticks->SupressZeroLabel(); + } + + function HideFirstLastLabel() { + // The two first calls to ticks method will supress + // automatically generated scale values. However, that + // will not affect manually specified value, e.g text-scales. + // therefor we also make a kludge here to supress manually + // specified scale labels. + $this->scale->ticks->SupressLast(); + $this->scale->ticks->SupressFirst(); + $this->show_first_label = false; + $this->show_last_label = false; + } + + // Hide the axis + function Hide($aHide=true) { + $this->hide=$aHide; + } + + // Hide the actual axis-line, but still print the labels + function HideLine($aHide=true) { + $this->hide_line = $aHide; + } + + function HideLabels($aHide=true) { + $this->hide_labels = $aHide; + } + + // Weight of axis + function SetWeight($aWeight) { + $this->weight = $aWeight; + } + + // Axis color + function SetColor($aColor,$aLabelColor=false) { + $this->color = $aColor; + if( !$aLabelColor ) $this->label_color = $aColor; + else $this->label_color = $aLabelColor; + } + + // Title on axis + function SetTitle($aTitle,$aAdjustAlign='high') { + $this->title->Set($aTitle); + $this->title_adjust=$aAdjustAlign; + } + + // Specify distance from the axis + function SetTitleMargin($aMargin) { + $this->title_margin=$aMargin; + } + + // Which side of the axis should the axis title be? + function SetTitleSide($aSideOfAxis) { + $this->title_side = $aSideOfAxis; + } + + function SetTickSide($aDir) { + $this->scale->ticks->SetSide($aDir); + } + + function SetTickSize($aMajSize,$aMinSize=3) { + $this->scale->ticks->SetSize($aMajSize,$aMinSize=3); + } + + // Specify text labels for the ticks. One label for each data point + function SetTickLabels($aLabelArray,$aLabelColorArray=null) { + $this->ticks_label = $aLabelArray; + $this->ticks_label_colors = $aLabelColorArray; + } + + function SetLabelMargin($aMargin) { + $this->tick_label_margin=$aMargin; + } + + // Specify that every $step of the ticks should be displayed starting + // at $start + function SetTextTickInterval($aStep,$aStart=0) { + $this->scale->ticks->SetTextLabelStart($aStart); + $this->tick_step=$aStep; + } + + // Specify that every $step tick mark should have a label + // should be displayed starting + function SetTextLabelInterval($aStep) { + if( $aStep < 1 ) { + JpGraphError::RaiseL(25058);//(" Text label interval must be specified >= 1."); + } + $this->label_step=$aStep; + } + + function SetLabelSide($aSidePos) { + $this->labelPos=$aSidePos; + } + + // Set the font + function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { + $this->font_family = $aFamily; + $this->font_style = $aStyle; + $this->font_size = $aSize; + } + + // Position for axis line on the "other" scale + function SetPos($aPosOnOtherScale) { + $this->pos=$aPosOnOtherScale; + } + + // Set the position of the axis to be X-pixels delta to the right + // of the max X-position (used to position the multiple Y-axis) + function SetPosAbsDelta($aDelta) { + $this->iDeltaAbsPos=$aDelta; + } + + // Specify the angle for the tick labels + function SetLabelAngle($aAngle) { + $this->label_angle = $aAngle; + } + +} // Class + + +//=================================================== +// CLASS Axis +// Description: Defines X and Y axis. Notes that at the +// moment the code is not really good since the axis on +// several occasion must know wheter it's an X or Y axis. +// This was a design decision to make the code easier to +// follow. +//=================================================== +class Axis extends AxisPrototype { + + function __construct($img,$aScale,$color='black') { + parent::__construct($img,$aScale,$color); + } + + // Stroke the axis. + function Stroke($aOtherAxisScale,$aStrokeLabels=true) { + if( $this->hide ) + return; + if( is_numeric($this->pos) ) { + $pos=$aOtherAxisScale->Translate($this->pos); + } + else { // Default to minimum of other scale if pos not set + if( ($aOtherAxisScale->GetMinVal() >= 0 && $this->pos==false) || $this->pos == 'min' ) { + $pos = $aOtherAxisScale->scale_abs[0]; + } + elseif($this->pos == "max") { + $pos = $aOtherAxisScale->scale_abs[1]; + } + else { // If negative set x-axis at 0 + $this->pos=0; + $pos=$aOtherAxisScale->Translate(0); + } + } + + $pos += $this->iDeltaAbsPos; + $this->img->SetLineWeight($this->weight); + $this->img->SetColor($this->color); + $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); + + if( $this->scale->type == "x" ) { + if( !$this->hide_line ) { + // Stroke X-axis + $this->img->FilledRectangle( + $this->img->left_margin, + $pos, + $this->img->width - $this->img->right_margin, + $pos + $this->weight-1 + ); + } + if( $this->title_side == SIDE_DOWN ) { + $y = $pos + $this->img->GetFontHeight() + $this->title_margin + $this->title->margin; + $yalign = 'top'; + } + else { + $y = $pos - $this->img->GetFontHeight() - $this->title_margin - $this->title->margin; + $yalign = 'bottom'; + } + + if( $this->title_adjust=='high' ) { + $this->title->SetPos($this->img->width-$this->img->right_margin,$y,'right',$yalign); + } + elseif( $this->title_adjust=='middle' || $this->title_adjust=='center' ) { + $this->title->SetPos(($this->img->width-$this->img->left_margin-$this->img->right_margin)/2+$this->img->left_margin,$y,'center',$yalign); + } + elseif($this->title_adjust=='low') { + $this->title->SetPos($this->img->left_margin,$y,'left',$yalign); + } + else { + JpGraphError::RaiseL(25060,$this->title_adjust);//('Unknown alignment specified for X-axis title. ('.$this->title_adjust.')'); + } + } + elseif( $this->scale->type == "y" ) { + // Add line weight to the height of the axis since + // the x-axis could have a width>1 and we want the axis to fit nicely together. + if( !$this->hide_line ) { + // Stroke Y-axis + $this->img->FilledRectangle( + $pos - $this->weight + 1, + $this->img->top_margin, + $pos, + $this->img->height - $this->img->bottom_margin + $this->weight - 1 + ); + } + + $x=$pos ; + if( $this->title_side == SIDE_LEFT ) { + $x -= $this->title_margin; + $x -= $this->title->margin; + $halign = 'right'; + } + else { + $x += $this->title_margin; + $x += $this->title->margin; + $halign = 'left'; + } + // If the user has manually specified an hor. align + // then we override the automatic settings with this + // specifed setting. Since default is 'left' we compare + // with that. (This means a manually set 'left' align + // will have no effect.) + if( $this->title->halign != 'left' ) { + $halign = $this->title->halign; + } + if( $this->title_adjust == 'high' ) { + $this->title->SetPos($x,$this->img->top_margin,$halign,'top'); + } + elseif($this->title_adjust=='middle' || $this->title_adjust=='center') { + $this->title->SetPos($x,($this->img->height-$this->img->top_margin-$this->img->bottom_margin)/2+$this->img->top_margin,$halign,"center"); + } + elseif($this->title_adjust=='low') { + $this->title->SetPos($x,$this->img->height-$this->img->bottom_margin,$halign,'bottom'); + } + else { + JpGraphError::RaiseL(25061,$this->title_adjust);//('Unknown alignment specified for Y-axis title. ('.$this->title_adjust.')'); + } + } + $this->scale->ticks->Stroke($this->img,$this->scale,$pos); + if( $aStrokeLabels ) { + if( !$this->hide_labels ) { + $this->StrokeLabels($pos); + } + $this->title->Stroke($this->img); + } + } + + //--------------- + // PRIVATE METHODS + // Draw all the tick labels on major tick marks + function StrokeLabels($aPos,$aMinor=false,$aAbsLabel=false) { + + if( is_array($this->label_color) && count($this->label_color) > 3 ) { + $this->ticks_label_colors = $this->label_color; + $this->img->SetColor($this->label_color[0]); + } + else { + $this->img->SetColor($this->label_color); + } + $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); + $yoff=$this->img->GetFontHeight()/2; + + // Only draw labels at major tick marks + $nbr = count($this->scale->ticks->maj_ticks_label); + + // We have the option to not-display the very first mark + // (Usefull when the first label might interfere with another + // axis.) + $i = $this->show_first_label ? 0 : 1 ; + if( !$this->show_last_label ) { + --$nbr; + } + // Now run through all labels making sure we don't overshoot the end + // of the scale. + $ncolor=0; + if( isset($this->ticks_label_colors) ) { + $ncolor=count($this->ticks_label_colors); + } + while( $i < $nbr ) { + // $tpos holds the absolute text position for the label + $tpos=$this->scale->ticks->maj_ticklabels_pos[$i]; + + // Note. the $limit is only used for the x axis since we + // might otherwise overshoot if the scale has been centered + // This is due to us "loosing" the last tick mark if we center. + if( $this->scale->type == 'x' && $tpos > $this->img->width-$this->img->right_margin+1 ) { + return; + } + // we only draw every $label_step label + if( ($i % $this->label_step)==0 ) { + + // Set specific label color if specified + if( $ncolor > 0 ) { + $this->img->SetColor($this->ticks_label_colors[$i % $ncolor]); + } + + // If the label has been specified use that and in other case + // just label the mark with the actual scale value + $m=$this->scale->ticks->GetMajor(); + + // ticks_label has an entry for each data point and is the array + // that holds the labels set by the user. If the user hasn't + // specified any values we use whats in the automatically asigned + // labels in the maj_ticks_label + if( isset($this->ticks_label[$i*$m]) ) { + $label=$this->ticks_label[$i*$m]; + } + else { + if( $aAbsLabel ) { + $label=abs($this->scale->ticks->maj_ticks_label[$i]); + } + else { + $label=$this->scale->ticks->maj_ticks_label[$i]; + } + + // We number the scale from 1 and not from 0 so increase by one + if( $this->scale->textscale && + $this->scale->ticks->label_formfunc == '' && + ! $this->scale->ticks->HaveManualLabels() ) { + + ++$label; + + } + } + + if( $this->scale->type == "x" ) { + if( $this->labelPos == SIDE_DOWN ) { + if( $this->label_angle==0 || $this->label_angle==90 ) { + if( $this->label_halign=='' && $this->label_valign=='') { + $this->img->SetTextAlign('center','top'); + } + else { + $this->img->SetTextAlign($this->label_halign,$this->label_valign); + } + + } + else { + if( $this->label_halign=='' && $this->label_valign=='') { + $this->img->SetTextAlign("right","top"); + } + else { + $this->img->SetTextAlign($this->label_halign,$this->label_valign); + } + } + $this->img->StrokeText($tpos,$aPos+$this->tick_label_margin,$label, + $this->label_angle,$this->label_para_align); + } + else { + if( $this->label_angle==0 || $this->label_angle==90 ) { + if( $this->label_halign=='' && $this->label_valign=='') { + $this->img->SetTextAlign("center","bottom"); + } + else { + $this->img->SetTextAlign($this->label_halign,$this->label_valign); + } + } + else { + if( $this->label_halign=='' && $this->label_valign=='') { + $this->img->SetTextAlign("right","bottom"); + } + else { + $this->img->SetTextAlign($this->label_halign,$this->label_valign); + } + } + $this->img->StrokeText($tpos,$aPos-$this->tick_label_margin-1,$label, + $this->label_angle,$this->label_para_align); + } + } + else { + // scale->type == "y" + //if( $this->label_angle!=0 ) + //JpGraphError::Raise(" Labels at an angle are not supported on Y-axis"); + if( $this->labelPos == SIDE_LEFT ) { // To the left of y-axis + if( $this->label_halign=='' && $this->label_valign=='') { + $this->img->SetTextAlign("right","center"); + } + else { + $this->img->SetTextAlign($this->label_halign,$this->label_valign); + } + $this->img->StrokeText($aPos-$this->tick_label_margin,$tpos,$label,$this->label_angle,$this->label_para_align); + } + else { // To the right of the y-axis + if( $this->label_halign=='' && $this->label_valign=='') { + $this->img->SetTextAlign("left","center"); + } + else { + $this->img->SetTextAlign($this->label_halign,$this->label_valign); + } + $this->img->StrokeText($aPos+$this->tick_label_margin,$tpos,$label,$this->label_angle,$this->label_para_align); + } + } + } + ++$i; + } + } + +} + + +//=================================================== +// CLASS Ticks +// Description: Abstract base class for drawing linear and logarithmic +// tick marks on axis +//=================================================== +class Ticks { + public $label_formatstr=''; // C-style format string to use for labels + public $label_formfunc=''; + public $label_dateformatstr=''; + public $direction=1; // Should ticks be in(=1) the plot area or outside (=-1) + public $supress_last=false,$supress_tickmarks=false,$supress_minor_tickmarks=false; + public $maj_ticks_pos = array(), $maj_ticklabels_pos = array(), + $ticks_pos = array(), $maj_ticks_label = array(); + public $precision; + + protected $minor_abs_size=3, $major_abs_size=5; + protected $scale; + protected $is_set=false; + protected $supress_zerolabel=false,$supress_first=false; + protected $mincolor='',$majcolor=''; + protected $weight=1; + protected $label_usedateformat=FALSE; + + function __construct($aScale) { + $this->scale=$aScale; + $this->precision = -1; + } + + // Set format string for automatic labels + function SetLabelFormat($aFormatString,$aDate=FALSE) { + $this->label_formatstr=$aFormatString; + $this->label_usedateformat=$aDate; + } + + function SetLabelDateFormat($aFormatString) { + $this->label_dateformatstr=$aFormatString; + } + + function SetFormatCallback($aCallbackFuncName) { + $this->label_formfunc = $aCallbackFuncName; + } + + // Don't display the first zero label + function SupressZeroLabel($aFlag=true) { + $this->supress_zerolabel=$aFlag; + } + + // Don't display minor tick marks + function SupressMinorTickMarks($aHide=true) { + $this->supress_minor_tickmarks=$aHide; + } + + // Don't display major tick marks + function SupressTickMarks($aHide=true) { + $this->supress_tickmarks=$aHide; + } + + // Hide the first tick mark + function SupressFirst($aHide=true) { + $this->supress_first=$aHide; + } + + // Hide the last tick mark + function SupressLast($aHide=true) { + $this->supress_last=$aHide; + } + + // Size (in pixels) of minor tick marks + function GetMinTickAbsSize() { + return $this->minor_abs_size; + } + + // Size (in pixels) of major tick marks + function GetMajTickAbsSize() { + return $this->major_abs_size; + } + + function SetSize($aMajSize,$aMinSize=3) { + $this->major_abs_size = $aMajSize; + $this->minor_abs_size = $aMinSize; + } + + // Have the ticks been specified + function IsSpecified() { + return $this->is_set; + } + + function SetSide($aSide) { + $this->direction=$aSide; + } + + // Which side of the axis should the ticks be on + function SetDirection($aSide=SIDE_RIGHT) { + $this->direction=$aSide; + } + + // Set colors for major and minor tick marks + function SetMarkColor($aMajorColor,$aMinorColor='') { + $this->SetColor($aMajorColor,$aMinorColor); + } + + function SetColor($aMajorColor,$aMinorColor='') { + $this->majcolor=$aMajorColor; + + // If not specified use same as major + if( $aMinorColor == '' ) { + $this->mincolor=$aMajorColor; + } + else { + $this->mincolor=$aMinorColor; + } + } + + function SetWeight($aWeight) { + $this->weight=$aWeight; + } + +} // Class + +//=================================================== +// CLASS LinearTicks +// Description: Draw linear ticks on axis +//=================================================== +class LinearTicks extends Ticks { + public $minor_step=1, $major_step=2; + public $xlabel_offset=0,$xtick_offset=0; + private $label_offset=0; // What offset should the displayed label have + // i.e should we display 0,1,2 or 1,2,3,4 or 2,3,4 etc + private $text_label_start=0; + private $iManualTickPos = NULL, $iManualMinTickPos = NULL, $iManualTickLabels = NULL; + private $iAdjustForDST = false; // If a date falls within the DST period add one hour to the diaplyed time + + function __construct() { + $this->precision = -1; + } + + // Return major step size in world coordinates + function GetMajor() { + return $this->major_step; + } + + // Return minor step size in world coordinates + function GetMinor() { + return $this->minor_step; + } + + // Set Minor and Major ticks (in world coordinates) + function Set($aMajStep,$aMinStep=false) { + if( $aMinStep==false ) { + $aMinStep=$aMajStep; + } + + if( $aMajStep <= 0 || $aMinStep <= 0 ) { + JpGraphError::RaiseL(25064); + //(" Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem."); + } + + $this->major_step=$aMajStep; + $this->minor_step=$aMinStep; + $this->is_set = true; + } + + function SetMajTickPositions($aMajPos,$aLabels=NULL) { + $this->SetTickPositions($aMajPos,NULL,$aLabels); + } + + function SetTickPositions($aMajPos,$aMinPos=NULL,$aLabels=NULL) { + if( !is_array($aMajPos) || ($aMinPos!==NULL && !is_array($aMinPos)) ) { + JpGraphError::RaiseL(25065);//('Tick positions must be specifued as an array()'); + return; + } + $n=count($aMajPos); + if( is_array($aLabels) && (count($aLabels) != $n) ) { + JpGraphError::RaiseL(25066);//('When manually specifying tick positions and labels the number of labels must be the same as the number of specified ticks.'); + } + $this->iManualTickPos = $aMajPos; + $this->iManualMinTickPos = $aMinPos; + $this->iManualTickLabels = $aLabels; + } + + function HaveManualLabels() { + return count($this->iManualTickLabels) > 0; + } + + // Specify all the tick positions manually and possible also the exact labels + function _doManualTickPos($aScale) { + $n=count($this->iManualTickPos); + $m=count($this->iManualMinTickPos); + $doLbl=count($this->iManualTickLabels) > 0; + + $this->maj_ticks_pos = array(); + $this->maj_ticklabels_pos = array(); + $this->ticks_pos = array(); + + // Now loop through the supplied positions and translate them to screen coordinates + // and store them in the maj_label_positions + $minScale = $aScale->scale[0]; + $maxScale = $aScale->scale[1]; + $j=0; + for($i=0; $i < $n ; ++$i ) { + // First make sure that the first tick is not lower than the lower scale value + if( !isset($this->iManualTickPos[$i]) || $this->iManualTickPos[$i] < $minScale || $this->iManualTickPos[$i] > $maxScale) { + continue; + } + + $this->maj_ticks_pos[$j] = $aScale->Translate($this->iManualTickPos[$i]); + $this->maj_ticklabels_pos[$j] = $this->maj_ticks_pos[$j]; + + // Set the minor tick marks the same as major if not specified + if( $m <= 0 ) { + $this->ticks_pos[$j] = $this->maj_ticks_pos[$j]; + } + if( $doLbl ) { + $this->maj_ticks_label[$j] = $this->iManualTickLabels[$i]; + } + else { + $this->maj_ticks_label[$j]=$this->_doLabelFormat($this->iManualTickPos[$i],$i,$n); + } + ++$j; + } + + // Some sanity check + if( count($this->maj_ticks_pos) < 2 ) { + JpGraphError::RaiseL(25067);//('Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tickl marks.'); + } + + // Setup the minor tick marks + $j=0; + for($i=0; $i < $m; ++$i ) { + if( empty($this->iManualMinTickPos[$i]) || $this->iManualMinTickPos[$i] < $minScale || $this->iManualMinTickPos[$i] > $maxScale) { + continue; + } + $this->ticks_pos[$j] = $aScale->Translate($this->iManualMinTickPos[$i]); + ++$j; + } + } + + function _doAutoTickPos($aScale) { + $maj_step_abs = $aScale->scale_factor*$this->major_step; + $min_step_abs = $aScale->scale_factor*$this->minor_step; + + if( $min_step_abs==0 || $maj_step_abs==0 ) { + JpGraphError::RaiseL(25068);//("A plot has an illegal scale. This could for example be that you are trying to use text autoscaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only '-' or 'x')"); + } + // We need to make this an int since comparing it below + // with the result from round() can give wrong result, such that + // (40 < 40) == TRUE !!! + $limit = (int)$aScale->scale_abs[1]; + + if( $aScale->textscale ) { + // This can only be true for a X-scale (horizontal) + // Define ticks for a text scale. This is slightly different from a + // normal linear type of scale since the position might be adjusted + // and the labels start at on + $label = (float)$aScale->GetMinVal()+$this->text_label_start+$this->label_offset; + $start_abs=$aScale->scale_factor*$this->text_label_start; + $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; + + $x = $aScale->scale_abs[0]+$start_abs+$this->xlabel_offset*$min_step_abs; + for( $i=0; $label <= $aScale->GetMaxVal()+$this->label_offset; ++$i ) { + // Apply format to label + $this->maj_ticks_label[$i]=$this->_doLabelFormat($label,$i,$nbrmajticks); + $label+=$this->major_step; + + // The x-position of the tick marks can be different from the labels. + // Note that we record the tick position (not the label) so that the grid + // happen upon tick marks and not labels. + $xtick=$aScale->scale_abs[0]+$start_abs+$this->xtick_offset*$min_step_abs+$i*$maj_step_abs; + $this->maj_ticks_pos[$i]=$xtick; + $this->maj_ticklabels_pos[$i] = round($x); + $x += $maj_step_abs; + } + } + else { + $label = $aScale->GetMinVal(); + $abs_pos = $aScale->scale_abs[0]; + $j=0; $i=0; + $step = round($maj_step_abs/$min_step_abs); + if( $aScale->type == "x" ) { + // For a normal linear type of scale the major ticks will always be multiples + // of the minor ticks. In order to avoid any rounding issues the major ticks are + // defined as every "step" minor ticks and not calculated separately + $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; + while( round($abs_pos) <= $limit ) { + $this->ticks_pos[] = round($abs_pos); + $this->ticks_label[] = $label; + if( $step== 0 || $i % $step == 0 && $j < $nbrmajticks ) { + $this->maj_ticks_pos[$j] = round($abs_pos); + $this->maj_ticklabels_pos[$j] = round($abs_pos); + $this->maj_ticks_label[$j]=$this->_doLabelFormat($label,$j,$nbrmajticks); + ++$j; + } + ++$i; + $abs_pos += $min_step_abs; + $label+=$this->minor_step; + } + } + elseif( $aScale->type == "y" ) { + //@todo s=2:20,12 s=1:50,6 $this->major_step:$nbr + // abs_point,limit s=1:270,80 s=2:540,160 + // $this->major_step = 50; + $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal())/$this->major_step)+1; +// $step = 5; + while( round($abs_pos) >= $limit ) { + $this->ticks_pos[$i] = round($abs_pos); + $this->ticks_label[$i]=$label; + if( $step== 0 || $i % $step == 0 && $j < $nbrmajticks) { + $this->maj_ticks_pos[$j] = round($abs_pos); + $this->maj_ticklabels_pos[$j] = round($abs_pos); + $this->maj_ticks_label[$j]=$this->_doLabelFormat($label,$j,$nbrmajticks); + ++$j; + } + ++$i; + $abs_pos += $min_step_abs; + $label += $this->minor_step; + } + } + } + } + + function AdjustForDST($aFlg=true) { + $this->iAdjustForDST = $aFlg; + } + + + function _doLabelFormat($aVal,$aIdx,$aNbrTicks) { + + // If precision hasn't been specified set it to a sensible value + if( $this->precision==-1 ) { + $t = log10($this->minor_step); + if( $t > 0 ) { + $precision = 0; + } + else { + $precision = -floor($t); + } + } + else { + $precision = $this->precision; + } + + if( $this->label_formfunc != '' ) { + $f=$this->label_formfunc; + if( $this->label_formatstr == '' ) { + $l = call_user_func($f,$aVal); + } + else { + $l = sprintf($this->label_formatstr, call_user_func($f,$aVal)); + } + } + elseif( $this->label_formatstr != '' || $this->label_dateformatstr != '' ) { + if( $this->label_usedateformat ) { + // Adjust the value to take daylight savings into account + if (date("I",$aVal)==1 && $this->iAdjustForDST ) { + // DST + $aVal+=3600; + } + + $l = date($this->label_formatstr,$aVal); + if( $this->label_formatstr == 'W' ) { + // If we use week formatting then add a single 'w' in front of the + // week number to differentiate it from dates + $l = 'w'.$l; + } + } + else { + if( $this->label_dateformatstr !== '' ) { + // Adjust the value to take daylight savings into account + if (date("I",$aVal)==1 && $this->iAdjustForDST ) { + // DST + $aVal+=3600; + } + + $l = date($this->label_dateformatstr,$aVal); + if( $this->label_formatstr == 'W' ) { + // If we use week formatting then add a single 'w' in front of the + // week number to differentiate it from dates + $l = 'w'.$l; + } + } + else { + $l = sprintf($this->label_formatstr,$aVal); + } + } + } + else { + $l = sprintf('%01.'.$precision.'f',round($aVal,$precision)); + } + + if( ($this->supress_zerolabel && $l==0) || ($this->supress_first && $aIdx==0) || ($this->supress_last && $aIdx==$aNbrTicks-1) ) { + $l=''; + } + return $l; + } + + // Stroke ticks on either X or Y axis + function _StrokeTicks($aImg,$aScale,$aPos) { + $hor = $aScale->type == 'x'; + $aImg->SetLineWeight($this->weight); + + // We need to make this an int since comparing it below + // with the result from round() can give wrong result, such that + // (40 < 40) == TRUE !!! + $limit = (int)$aScale->scale_abs[1]; + + // A text scale doesn't have any minor ticks + if( !$aScale->textscale ) { + // Stroke minor ticks + $yu = $aPos - $this->direction*$this->GetMinTickAbsSize(); + $xr = $aPos + $this->direction*$this->GetMinTickAbsSize(); + $n = count($this->ticks_pos); + for($i=0; $i < $n; ++$i ) { + if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { + if( $this->mincolor != '') { + $aImg->PushColor($this->mincolor); + } + if( $hor ) { + //if( $this->ticks_pos[$i] <= $limit ) + $aImg->Line($this->ticks_pos[$i],$aPos,$this->ticks_pos[$i],$yu); + } + else { + //if( $this->ticks_pos[$i] >= $limit ) + $aImg->Line($aPos,$this->ticks_pos[$i],$xr,$this->ticks_pos[$i]); + } + if( $this->mincolor != '' ) { + $aImg->PopColor(); + } + } + } + } + + // Stroke major ticks + $yu = $aPos - $this->direction*$this->GetMajTickAbsSize(); + $xr = $aPos + $this->direction*$this->GetMajTickAbsSize(); + $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; + $n = count($this->maj_ticks_pos); + for($i=0; $i < $n ; ++$i ) { + if(!($this->xtick_offset > 0 && $i==$nbrmajticks-1) && !$this->supress_tickmarks) { + if( $this->majcolor != '') { + $aImg->PushColor($this->majcolor); + } + if( $hor ) { + //if( $this->maj_ticks_pos[$i] <= $limit ) + $aImg->Line($this->maj_ticks_pos[$i],$aPos,$this->maj_ticks_pos[$i],$yu); + } + else { + //if( $this->maj_ticks_pos[$i] >= $limit ) + $aImg->Line($aPos,$this->maj_ticks_pos[$i],$xr,$this->maj_ticks_pos[$i]); + } + if( $this->majcolor != '') { + $aImg->PopColor(); + } + } + } + + } + + // Draw linear ticks + function Stroke($aImg,$aScale,$aPos) { + if( $this->iManualTickPos != NULL ) { + $this->_doManualTickPos($aScale); + } + else { + $this->_doAutoTickPos($aScale); + } + $this->_StrokeTicks($aImg,$aScale,$aPos, $aScale->type == 'x' ); + } + + //--------------- + // PRIVATE METHODS + // Spoecify the offset of the displayed tick mark with the tick "space" + // Legal values for $o is [0,1] used to adjust where the tick marks and label + // should be positioned within the major tick-size + // $lo specifies the label offset and $to specifies the tick offset + // this comes in handy for example in bar graphs where we wont no offset for the + // tick but have the labels displayed halfway under the bars. + function SetXLabelOffset($aLabelOff,$aTickOff=-1) { + $this->xlabel_offset=$aLabelOff; + if( $aTickOff==-1 ) { + // Same as label offset + $this->xtick_offset=$aLabelOff; + } + else { + $this->xtick_offset=$aTickOff; + } + if( $aLabelOff>0 ) { + $this->SupressLast(); // The last tick wont fit + } + } + + // Which tick label should we start with? + function SetTextLabelStart($aTextLabelOff) { + $this->text_label_start=$aTextLabelOff; + } + +} // Class + +//=================================================== +// CLASS LinearScale +// Description: Handle linear scaling between screen and world +//=================================================== +class LinearScale { + public $textscale=false; // Just a flag to let the Plot class find out if + // we are a textscale or not. This is a cludge since + // this information is available in Graph::axtype but + // we don't have access to the graph object in the Plots + // stroke method. So we let graph store the status here + // when the linear scale is created. A real cludge... + public $type; // is this x or y scale ? + public $ticks=null; // Store ticks + public $text_scale_off = 0; + public $scale_abs=array(0,0); + public $scale_factor; // Scale factor between world and screen + public $off; // Offset between image edge and plot area + public $scale=array(0,0); + public $name = 'lin'; + public $auto_ticks=false; // When using manual scale should the ticks be automatically set? + public $world_abs_size; // Plot area size in pixels (Needed public in jpgraph_radar.php) + public $intscale=false; // Restrict autoscale to integers + protected $autoscale_min=false; // Forced minimum value, auto determine max + protected $autoscale_max=false; // Forced maximum value, auto determine min + private $gracetop=0,$gracebottom=0; + + private $_world_size; // Plot area size in world coordinates + + function __construct($aMin=0,$aMax=0,$aType='y') { + assert($aType=='x' || $aType=='y' ); + assert($aMin<=$aMax); + + $this->type=$aType; + $this->scale=array($aMin,$aMax); + $this->world_size=$aMax-$aMin; + $this->ticks = new LinearTicks(); + } + + // Check if scale is set or if we should autoscale + // We should do this is either scale or ticks has not been set + function IsSpecified() { + if( $this->GetMinVal()==$this->GetMaxVal() ) { // Scale not set + return false; + } + return true; + } + + // Set the minimum data value when the autoscaling is used. + // Usefull if you want a fix minimum (like 0) but have an + // automatic maximum + function SetAutoMin($aMin) { + $this->autoscale_min=$aMin; + } + + // Set the minimum data value when the autoscaling is used. + // Usefull if you want a fix minimum (like 0) but have an + // automatic maximum + function SetAutoMax($aMax) { + $this->autoscale_max=$aMax; + } + + // If the user manually specifies a scale should the ticks + // still be set automatically? + function SetAutoTicks($aFlag=true) { + $this->auto_ticks = $aFlag; + } + + // Specify scale "grace" value (top and bottom) + function SetGrace($aGraceTop,$aGraceBottom=0) { + if( $aGraceTop<0 || $aGraceBottom < 0 ) { + JpGraphError::RaiseL(25069);//(" Grace must be larger then 0"); + } + $this->gracetop=$aGraceTop; + $this->gracebottom=$aGraceBottom; + } + + // Get the minimum value in the scale + function GetMinVal() { + return $this->scale[0]; + } + + // get maximum value for scale + function GetMaxVal() { + return $this->scale[1]; + } + + // Specify a new min/max value for sclae + function Update($aImg,$aMin,$aMax) { + $this->scale=array($aMin,$aMax); + $this->world_size=$aMax-$aMin; + $this->InitConstants($aImg); + } + + // Translate between world and screen + function Translate($aCoord) { + if( !is_numeric($aCoord) ) { + if( $aCoord != '' && $aCoord != '-' && $aCoord != 'x' ) { + JpGraphError::RaiseL(25070);//('Your data contains non-numeric values.'); + } + return 0; + } + else { + return round($this->off+($aCoord - $this->scale[0]) * $this->scale_factor); + } + } + + // Relative translate (don't include offset) usefull when we just want + // to know the relative position (in pixels) on the axis + function RelTranslate($aCoord) { + if( !is_numeric($aCoord) ) { + if( $aCoord != '' && $aCoord != '-' && $aCoord != 'x' ) { + JpGraphError::RaiseL(25070);//('Your data contains non-numeric values.'); + } + return 0; + } + else { + return ($aCoord - $this->scale[0]) * $this->scale_factor; + } + } + + // Restrict autoscaling to only use integers + function SetIntScale($aIntScale=true) { + $this->intscale=$aIntScale; + } + + // Calculate an integer autoscale + function IntAutoScale($img,$min,$max,$maxsteps,$majend=true) { + // Make sure limits are integers + $min=floor($min); + $max=ceil($max); + if( abs($min-$max)==0 ) { + --$min; ++$max; + } + $maxsteps = floor($maxsteps); + + $gracetop=round(($this->gracetop/100.0)*abs($max-$min)); + $gracebottom=round(($this->gracebottom/100.0)*abs($max-$min)); + if( is_numeric($this->autoscale_min) ) { + $min = ceil($this->autoscale_min); + if( $min >= $max ) { + JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); + } + } + + if( is_numeric($this->autoscale_max) ) { + $max = ceil($this->autoscale_max); + if( $min >= $max ) { + JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); + } + } + + if( abs($min-$max ) == 0 ) { + ++$max; + --$min; + } + + $min -= $gracebottom; + $max += $gracetop; + + // First get tickmarks as multiples of 1, 10, ... + if( $majend ) { + list($num1steps,$adj1min,$adj1max,$maj1step) = $this->IntCalcTicks($maxsteps,$min,$max,1); + } + else { + $adj1min = $min; + $adj1max = $max; + list($num1steps,$maj1step) = $this->IntCalcTicksFreeze($maxsteps,$min,$max,1); + } + + if( abs($min-$max) > 2 ) { + // Then get tick marks as 2:s 2, 20, ... + if( $majend ) { + list($num2steps,$adj2min,$adj2max,$maj2step) = $this->IntCalcTicks($maxsteps,$min,$max,5); + } + else { + $adj2min = $min; + $adj2max = $max; + list($num2steps,$maj2step) = $this->IntCalcTicksFreeze($maxsteps,$min,$max,5); + } + } + else { + $num2steps = 10000; // Dummy high value so we don't choose this + } + + if( abs($min-$max) > 5 ) { + // Then get tickmarks as 5:s 5, 50, 500, ... + if( $majend ) { + list($num5steps,$adj5min,$adj5max,$maj5step) = $this->IntCalcTicks($maxsteps,$min,$max,2); + } + else { + $adj5min = $min; + $adj5max = $max; + list($num5steps,$maj5step) = $this->IntCalcTicksFreeze($maxsteps,$min,$max,2); + } + } + else { + $num5steps = 10000; // Dummy high value so we don't choose this + } + + // Check to see whichof 1:s, 2:s or 5:s fit better with + // the requested number of major ticks + $match1=abs($num1steps-$maxsteps); + $match2=abs($num2steps-$maxsteps); + if( !empty($maj5step) && $maj5step > 1 ) { + $match5=abs($num5steps-$maxsteps); + } + else { + $match5=10000; // Dummy high value + } + + // Compare these three values and see which is the closest match + // We use a 0.6 weight to gravitate towards multiple of 5:s + if( $match1 < $match2 ) { + if( $match1 < $match5 ) $r=1; + else $r=3; + } + else { + if( $match2 < $match5 ) $r=2; + else $r=3; + } + // Minsteps are always the same as maxsteps for integer scale + switch( $r ) { + case 1: + $this->ticks->Set($maj1step,$maj1step); + $this->Update($img,$adj1min,$adj1max); + break; + case 2: + $this->ticks->Set($maj2step,$maj2step); + $this->Update($img,$adj2min,$adj2max); + break; + case 3: + $this->ticks->Set($maj5step,$maj5step); + $this->Update($img,$adj5min,$adj5max); + break; + default: + JpGraphError::RaiseL(25073,$r);//('Internal error. Integer scale algorithm comparison out of bound (r=$r)'); + } + } + + + // Calculate autoscale. Used if user hasn't given a scale and ticks + // $maxsteps is the maximum number of major tickmarks allowed. + function AutoScale($img,$min,$max,$maxsteps,$majend=true) { + + if( !is_numeric($min) || !is_numeric($max) ) { + JpGraphError::Raise(25044); + } + + if( $this->intscale ) { + $this->IntAutoScale($img,$min,$max,$maxsteps,$majend); + return; + } + if( abs($min-$max) < 0.00001 ) { + // We need some difference to be able to autoscale + // make it 5% above and 5% below value + if( $min==0 && $max==0 ) { // Special case + $min=-1; $max=1; + } + else { + $delta = (abs($max)+abs($min))*0.005; + $min -= $delta; + $max += $delta; + } + } + + $gracetop=($this->gracetop/100.0)*abs($max-$min); + $gracebottom=($this->gracebottom/100.0)*abs($max-$min); + if( is_numeric($this->autoscale_min) ) { + $min = $this->autoscale_min; + if( $min >= $max ) { + JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); + } + if( abs($min-$max ) < 0.001 ) { + $max *= 1.2; + } + } + + if( is_numeric($this->autoscale_max) ) { + $max = $this->autoscale_max; + if( $min >= $max ) { + JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); + } + if( abs($min-$max ) < 0.001 ) { + $min *= 0.8; + } + } + + $min -= $gracebottom; + $max += $gracetop; + + // First get tickmarks as multiples of 0.1, 1, 10, ... + if( $majend ) { + list($num1steps,$adj1min,$adj1max,$min1step,$maj1step) = $this->CalcTicks($maxsteps,$min,$max,1,2); + } + else { + $adj1min=$min; + $adj1max=$max; + list($num1steps,$min1step,$maj1step) = $this->CalcTicksFreeze($maxsteps,$min,$max,1,2,false); + } + + // Then get tick marks as 2:s 0.2, 2, 20, ... + if( $majend ) { + list($num2steps,$adj2min,$adj2max,$min2step,$maj2step) = $this->CalcTicks($maxsteps,$min,$max,5,2); + } + else { + $adj2min=$min; + $adj2max=$max; + list($num2steps,$min2step,$maj2step) = $this->CalcTicksFreeze($maxsteps,$min,$max,5,2,false); + } + + // Then get tickmarks as 5:s 0.05, 0.5, 5, 50, ... + if( $majend ) { + list($num5steps,$adj5min,$adj5max,$min5step,$maj5step) = $this->CalcTicks($maxsteps,$min,$max,2,5); + } + else { + $adj5min=$min; + $adj5max=$max; + list($num5steps,$min5step,$maj5step) = $this->CalcTicksFreeze($maxsteps,$min,$max,2,5,false); + } + + // Check to see whichof 1:s, 2:s or 5:s fit better with + // the requested number of major ticks + $match1=abs($num1steps-$maxsteps); + $match2=abs($num2steps-$maxsteps); + $match5=abs($num5steps-$maxsteps); + + // Compare these three values and see which is the closest match + // We use a 0.8 weight to gravitate towards multiple of 5:s + $r=$this->MatchMin3($match1,$match2,$match5,0.8); + switch( $r ) { + case 1: + $this->Update($img,$adj1min,$adj1max); + $this->ticks->Set($maj1step,$min1step); + break; + case 2: + $this->Update($img,$adj2min,$adj2max); + $this->ticks->Set($maj2step,$min2step); + break; + case 3: + $this->Update($img,$adj5min,$adj5max); + $this->ticks->Set($maj5step,$min5step); + break; + } + } + + //--------------- + // PRIVATE METHODS + + // This method recalculates all constants that are depending on the + // margins in the image. If the margins in the image are changed + // this method should be called for every scale that is registred with + // that image. Should really be installed as an observer of that image. + function InitConstants($img) { + if( $this->type=='x' ) { + $this->world_abs_size=$img->width - $img->left_margin - $img->right_margin; + $this->off=$img->left_margin; + $this->scale_factor = 0; + if( $this->world_size > 0 ) { + $this->scale_factor=$this->world_abs_size/($this->world_size*1.0); + } + } + else { // y scale + $this->world_abs_size=$img->height - $img->top_margin - $img->bottom_margin; + $this->off=$img->top_margin+$this->world_abs_size; + $this->scale_factor = 0; + if( $this->world_size > 0 ) { + $this->scale_factor=-$this->world_abs_size/($this->world_size*1.0); + } + } + $size = $this->world_size * $this->scale_factor; + $this->scale_abs=array($this->off,$this->off + $size); + } + + // Initialize the conversion constants for this scale + // This tries to pre-calculate as much as possible to speed up the + // actual conversion (with Translate()) later on + // $start =scale start in absolute pixels (for x-scale this is an y-position + // and for an y-scale this is an x-position + // $len =absolute length in pixels of scale + function SetConstants($aStart,$aLen) { + $this->world_abs_size=$aLen; + $this->off=$aStart; + + if( $this->world_size<=0 ) { + // This should never ever happen !! + JpGraphError::RaiseL(25074); + //("You have unfortunately stumbled upon a bug in JpGraph. It seems like the scale range is ".$this->world_size." [for ".$this->type." scale]
Please report Bug #01 to info@jpgraph.net and include the script that gave this error. This problem could potentially be caused by trying to use \"illegal\" values in the input data arrays (like trying to send in strings or only NULL values) which causes the autoscaling to fail."); + } + + // scale_factor = number of pixels per world unit + $this->scale_factor=$this->world_abs_size/($this->world_size*1.0); + + // scale_abs = start and end points of scale in absolute pixels + $this->scale_abs=array($this->off,$this->off+$this->world_size*$this->scale_factor); + } + + + // Calculate number of ticks steps with a specific division + // $a is the divisor of 10**x to generate the first maj tick intervall + // $a=1, $b=2 give major ticks with multiple of 10, ...,0.1,1,10,... + // $a=5, $b=2 give major ticks with multiple of 2:s ...,0.2,2,20,... + // $a=2, $b=5 give major ticks with multiple of 5:s ...,0.5,5,50,... + // We return a vector of + // [$numsteps,$adjmin,$adjmax,$minstep,$majstep] + // If $majend==true then the first and last marks on the axis will be major + // labeled tick marks otherwise it will be adjusted to the closest min tick mark + function CalcTicks($maxsteps,$min,$max,$a,$b,$majend=true) { + $diff=$max-$min; + if( $diff==0 ) { + $ld=0; + } + else { + $ld=floor(log10($diff)); + } + + // Gravitate min towards zero if we are close + if( $min>0 && $min < pow(10,$ld) ) $min=0; + + //$majstep=pow(10,$ld-1)/$a; + $majstep=pow(10,$ld)/$a; + $minstep=$majstep/$b; + + $adjmax=ceil($max/$minstep)*$minstep; + $adjmin=floor($min/$minstep)*$minstep; + $adjdiff = $adjmax-$adjmin; + $numsteps=$adjdiff/$majstep; + + while( $numsteps>$maxsteps ) { + $majstep=pow(10,$ld)/$a; + $numsteps=$adjdiff/$majstep; + ++$ld; + } + + $minstep=$majstep/$b; + $adjmin=floor($min/$minstep)*$minstep; + $adjdiff = $adjmax-$adjmin; + if( $majend ) { + $adjmin = floor($min/$majstep)*$majstep; + $adjdiff = $adjmax-$adjmin; + $adjmax = ceil($adjdiff/$majstep)*$majstep+$adjmin; + } + else { + $adjmax=ceil($max/$minstep)*$minstep; + } + + return array($numsteps,$adjmin,$adjmax,$minstep,$majstep); + } + + function CalcTicksFreeze($maxsteps,$min,$max,$a,$b) { + // Same as CalcTicks but don't adjust min/max values + $diff=$max-$min; + if( $diff==0 ) { + $ld=0; + } + else { + $ld=floor(log10($diff)); + } + + //$majstep=pow(10,$ld-1)/$a; + $majstep=pow(10,$ld)/$a; + $minstep=$majstep/$b; + $numsteps=floor($diff/$majstep); + + while( $numsteps > $maxsteps ) { + $majstep=pow(10,$ld)/$a; + $numsteps=floor($diff/$majstep); + ++$ld; + } + $minstep=$majstep/$b; + return array($numsteps,$minstep,$majstep); + } + + + function IntCalcTicks($maxsteps,$min,$max,$a,$majend=true) { + $diff=$max-$min; + if( $diff==0 ) { + JpGraphError::RaiseL(25075);//('Can\'t automatically determine ticks since min==max.'); + } + else { + $ld=floor(log10($diff)); + } + + // Gravitate min towards zero if we are close + if( $min>0 && $min < pow(10,$ld) ) { + $min=0; + } + if( $ld == 0 ) { + $ld=1; + } + if( $a == 1 ) { + $majstep = 1; + } + else { + $majstep=pow(10,$ld)/$a; + } + $adjmax=ceil($max/$majstep)*$majstep; + + $adjmin=floor($min/$majstep)*$majstep; + $adjdiff = $adjmax-$adjmin; + $numsteps=$adjdiff/$majstep; + while( $numsteps>$maxsteps ) { + $majstep=pow(10,$ld)/$a; + $numsteps=$adjdiff/$majstep; + ++$ld; + } + + $adjmin=floor($min/$majstep)*$majstep; + $adjdiff = $adjmax-$adjmin; + if( $majend ) { + $adjmin = floor($min/$majstep)*$majstep; + $adjdiff = $adjmax-$adjmin; + $adjmax = ceil($adjdiff/$majstep)*$majstep+$adjmin; + } + else { + $adjmax=ceil($max/$majstep)*$majstep; + } + + return array($numsteps,$adjmin,$adjmax,$majstep); + } + + + function IntCalcTicksFreeze($maxsteps,$min,$max,$a) { + // Same as IntCalcTick but don't change min/max values + $diff=$max-$min; + if( $diff==0 ) { + JpGraphError::RaiseL(25075);//('Can\'t automatically determine ticks since min==max.'); + } + else { + $ld=floor(log10($diff)); + } + if( $ld == 0 ) { + $ld=1; + } + if( $a == 1 ) { + $majstep = 1; + } + else { + $majstep=pow(10,$ld)/$a; + } + + $numsteps=floor($diff/$majstep); + while( $numsteps > $maxsteps ) { + $majstep=pow(10,$ld)/$a; + $numsteps=floor($diff/$majstep); + ++$ld; + } + + return array($numsteps,$majstep); + } + + // Determine the minimum of three values witha weight for last value + function MatchMin3($a,$b,$c,$weight) { + if( $a < $b ) { + if( $a < ($c*$weight) ) { + return 1; // $a smallest + } + else { + return 3; // $c smallest + } + } + elseif( $b < ($c*$weight) ) { + return 2; // $b smallest + } + return 3; // $c smallest + } + + function __get($name) { + $variable_name = '_' . $name; + + if (isset($this->$variable_name)) { + return $this->$variable_name * SUPERSAMPLING_SCALE; + } else { + JpGraphError::RaiseL('25132', $name); + } + } + + function __set($name, $value) { + $this->{'_'.$name} = $value; + } +} // Class + + +//=================================================== +// CLASS DisplayValue +// Description: Used to print data values at data points +//=================================================== +class DisplayValue { + public $margin=5; + public $show=false; + public $valign='',$halign='center'; + public $format='%.1f',$negformat=''; + private $ff=FF_DEFAULT,$fs=FS_NORMAL,$fsize=8; + private $iFormCallback=''; + private $angle=0; + private $color='navy',$negcolor=''; + private $iHideZero=false; + public $txt=null; + + function __construct() { + $this->txt = new Text(); + } + + function Show($aFlag=true) { + $this->show=$aFlag; + } + + function SetColor($aColor,$aNegcolor='') { + $this->color = $aColor; + $this->negcolor = $aNegcolor; + } + + function SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=8) { + $this->ff=$aFontFamily; + $this->fs=$aFontStyle; + $this->fsize=$aFontSize; + } + + function ApplyFont($aImg) { + $aImg->SetFont($this->ff,$this->fs,$this->fsize); + } + + function SetMargin($aMargin) { + $this->margin = $aMargin; + } + + function SetAngle($aAngle) { + $this->angle = $aAngle; + } + + function SetAlign($aHAlign,$aVAlign='') { + $this->halign = $aHAlign; + $this->valign = $aVAlign; + } + + function SetFormat($aFormat,$aNegFormat='') { + $this->format= $aFormat; + $this->negformat= $aNegFormat; + } + + function SetFormatCallback($aFunc) { + $this->iFormCallback = $aFunc; + } + + function HideZero($aFlag=true) { + $this->iHideZero=$aFlag; + } + + function Stroke($img,$aVal,$x,$y) { + + if( $this->show ) + { + if( $this->negformat=='' ) { + $this->negformat=$this->format; + } + if( $this->negcolor=='' ) { + $this->negcolor=$this->color; + } + + if( $aVal===NULL || (is_string($aVal) && ($aVal=='' || $aVal=='-' || $aVal=='x' ) ) ) { + return; + } + + if( is_numeric($aVal) && $aVal==0 && $this->iHideZero ) { + return; + } + + // Since the value is used in different cirumstances we need to check what + // kind of formatting we shall use. For example, to display values in a line + // graph we simply display the formatted value, but in the case where the user + // has already specified a text string we don't fo anything. + if( $this->iFormCallback != '' ) { + $f = $this->iFormCallback; + $sval = call_user_func($f,$aVal); + } + elseif( is_numeric($aVal) ) { + if( $aVal >= 0 ) { + $sval=sprintf($this->format,$aVal); + } + else { + $sval=sprintf($this->negformat,$aVal); + } + } + else { + $sval=$aVal; + } + + $y = $y-sign($aVal)*$this->margin; + + $this->txt->Set($sval); + $this->txt->SetPos($x,$y); + $this->txt->SetFont($this->ff,$this->fs,$this->fsize); + if( $this->valign == '' ) { + if( $aVal >= 0 ) { + $valign = "bottom"; + } + else { + $valign = "top"; + } + } + else { + $valign = $this->valign; + } + $this->txt->Align($this->halign,$valign); + + $this->txt->SetOrientation($this->angle); + if( $aVal > 0 ) { + $this->txt->SetColor($this->color); + } + else { + $this->txt->SetColor($this->negcolor); + } + $this->txt->Stroke($img); + } + } +} + +//=================================================== +// CLASS Plot +// Description: Abstract base class for all concrete plot classes +//=================================================== +class Plot { + public $numpoints=0; + public $value; + public $legend=''; + public $coords=array(); + public $color='black'; + public $hidelegend=false; + public $line_weight=1; + public $csimtargets=array(),$csimwintargets=array(); // Array of targets for CSIM + public $csimareas=''; // Resultant CSIM area tags + public $csimalts=null; // ALT:s for corresponding target + public $legendcsimtarget='',$legendcsimwintarget=''; + public $legendcsimalt=''; + protected $weight=1; + protected $center=false; + + protected $inputValues; + protected $isRunningClear = false; + + function __construct($aDatay,$aDatax=false) { + $this->numpoints = count($aDatay); + if( $this->numpoints==0 ) { + JpGraphError::RaiseL(25121);//("Empty input data array specified for plot. Must have at least one data point."); + } + + if (!$this->isRunningClear) { + $this->inputValues = array(); + $this->inputValues['aDatay'] = $aDatay; + $this->inputValues['aDatax'] = $aDatax; + } + + $this->coords[0]=$aDatay; + if( is_array($aDatax) ) { + $this->coords[1]=$aDatax; + $n = count($aDatax); + for( $i=0; $i < $n; ++$i ) { + if( !is_numeric($aDatax[$i]) ) { + JpGraphError::RaiseL(25070); + } + } + } + $this->value = new DisplayValue(); + } + + // Stroke the plot + // "virtual" function which must be implemented by + // the subclasses + function Stroke($aImg,$aXScale,$aYScale) { + JpGraphError::RaiseL(25122);//("JpGraph: Stroke() must be implemented by concrete subclass to class Plot"); + } + + function HideLegend($f=true) { + $this->hidelegend = $f; + } + + function DoLegend($graph) { + if( !$this->hidelegend ) + $this->Legend($graph); + } + + function StrokeDataValue($img,$aVal,$x,$y) { + $this->value->Stroke($img,$aVal,$x,$y); + } + + // Set href targets for CSIM + function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { + $this->csimtargets=$aTargets; + $this->csimwintargets=$aWinTargets; + $this->csimalts=$aAlts; + } + + // Get all created areas + function GetCSIMareas() { + return $this->csimareas; + } + + // "Virtual" function which gets called before any scale + // or axis are stroked used to do any plot specific adjustment + function PreStrokeAdjust($aGraph) { + if( substr($aGraph->axtype,0,4) == "text" && (isset($this->coords[1])) ) { + JpGraphError::RaiseL(25123);//("JpGraph: You can't use a text X-scale with specified X-coords. Use a \"int\" or \"lin\" scale instead."); + } + return true; + } + + // Virtual function to the the concrete plot class to make any changes to the graph + // and scale before the stroke process begins + function PreScaleSetup($aGraph) { + // Empty + } + + // Get minimum values in plot + function Min() { + if( isset($this->coords[1]) ) { + $x=$this->coords[1]; + } + else { + $x=''; + } + if( $x != '' && count($x) > 0 ) { + $xm=min($x); + } + else { + $xm=0; + } + $y=$this->coords[0]; + $cnt = count($y); + if( $cnt > 0 ) { + $i=0; + while( $i<$cnt && !is_numeric($ym=$y[$i]) ) { + $i++; + } + while( $i < $cnt) { + if( is_numeric($y[$i]) ) { + $ym=min($ym,$y[$i]); + } + ++$i; + } + } + else { + $ym=''; + } + return array($xm,$ym); + } + + // Get maximum value in plot + function Max() { + if( isset($this->coords[1]) ) { + $x=$this->coords[1]; + } + else { + $x=''; + } + + if( $x!='' && count($x) > 0 ) { + $xm=max($x); + } + else { + $xm = $this->numpoints-1; + } + $y=$this->coords[0]; + if( count($y) > 0 ) { + $cnt = count($y); + $i=0; + while( $i<$cnt && !is_numeric($ym=$y[$i]) ) { + $i++; + } + while( $i < $cnt ) { + if( is_numeric($y[$i]) ) { + $ym=max($ym,$y[$i]); + } + ++$i; + } + } + else { + $ym=''; + } + return array($xm,$ym); + } + + function SetColor($aColor) { + $this->color=$aColor; + } + + function SetLegend($aLegend,$aCSIM='',$aCSIMAlt='',$aCSIMWinTarget='') { + $this->legend = $aLegend; + $this->legendcsimtarget = $aCSIM; + $this->legendcsimwintarget = $aCSIMWinTarget; + $this->legendcsimalt = $aCSIMAlt; + } + + function SetWeight($aWeight) { + $this->weight=$aWeight; + } + + function SetLineWeight($aWeight=1) { + $this->line_weight=$aWeight; + } + + function SetCenter($aCenter=true) { + $this->center = $aCenter; + } + + // This method gets called by Graph class to plot anything that should go + // into the margin after the margin color has been set. + function StrokeMargin($aImg) { + return true; + } + + // Framework function the chance for each plot class to set a legend + function Legend($aGraph) { + if( $this->legend != '' ) { + $aGraph->legend->Add($this->legend,$this->color,'',0,$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + } + + function Clear() { + $this->isRunningClear = true; + $this->__construct($this->inputValues['aDatay'], $this->inputValues['aDatax']); + $this->isRunningClear = false; + } + +} // Class + + +// Provide a deterministic list of new colors whenever the getColor() method +// is called. Used to automatically set colors of plots. +class ColorFactory { + + static private $iIdx = 0; + static private $iColorList = array( + 'black', + 'blue', + 'orange', + 'darkgreen', + 'red', + 'AntiqueWhite3', + 'aquamarine3', + 'azure4', + 'brown', + 'cadetblue3', + 'chartreuse4', + 'chocolate', + 'darkblue', + 'darkgoldenrod3', + 'darkorchid3', + 'darksalmon', + 'darkseagreen4', + 'deepskyblue2', + 'dodgerblue4', + 'gold3', + 'hotpink', + 'lawngreen', + 'lightcoral', + 'lightpink3', + 'lightseagreen', + 'lightslateblue', + 'mediumpurple', + 'olivedrab', + 'orangered1', + 'peru', + 'slategray', + 'yellow4', + 'springgreen2'); + static private $iNum = 33; + + static function getColor() { + if( ColorFactory::$iIdx >= ColorFactory::$iNum ) + ColorFactory::$iIdx = 0; + return ColorFactory::$iColorList[ColorFactory::$iIdx++]; + } + +} + +// +?> diff --git a/includes/jpgraph/src/jpgraph_antispam-digits.php b/includes/jpgraph/src/jpgraph_antispam-digits.php new file mode 100644 index 0000000..7643fc3 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_antispam-digits.php @@ -0,0 +1,205 @@ +digits['6'][0]= 645 ; + $this->digits['6'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'. + 'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'. + 'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'. + 'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'. + 'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'. + 'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'. + 'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ; + + //========================================================== + // d2-small.jpg + //========================================================== + $this->digits['2'][0]= 606 ; + $this->digits['2'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'. + 'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'. + 'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'. + 'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'. + 'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'. + '7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'. + 'DLZ6f//Z' ; + + //========================================================== + // d9-small.jpg + //========================================================== + $this->digits['9'][0]= 680 ; + $this->digits['9'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'. + 'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'. + 'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'. + 'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'. + 'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'. + 'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'. + 'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'. + '1V1//9k=' ; + + //========================================================== + // d5-small.jpg + //========================================================== + $this->digits['5'][0]= 632 ; + $this->digits['5'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'. + 'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'. + 'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'. + 'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'. + 'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'. + 'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'. + '8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ; + + //========================================================== + // d1-small.jpg + //========================================================== + $this->digits['1'][0]= 646 ; + $this->digits['1'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'. + 'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'. + 'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'. + 'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'. + 'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'. + 'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'. + 'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ; + + //========================================================== + // d8-small.jpg + //========================================================== + $this->digits['8'][0]= 694 ; + $this->digits['8'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'. + 'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'. + 'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'. + 'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'. + '44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'. + 'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'. + 'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'. + 'EylmLHQltptPZKQOBo1FzH//2Q==' ; + + //========================================================== + // d4-small.jpg + //========================================================== + $this->digits['4'][0]= 643 ; + $this->digits['4'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'. + 'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'. + 'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'. + 'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'. + 'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'. + '27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'. + 'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ; + + //========================================================== + // d7-small.jpg + //========================================================== + $this->digits['7'][0]= 658 ; + $this->digits['7'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'. + 'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'. + 'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'. + '19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'. + 'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'. + '8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'. + 'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ; + + //========================================================== + // d3-small.jpg + //========================================================== + $this->digits['3'][0]= 662 ; + $this->digits['3'][1]= + '/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. + 'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. + 'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'. + 'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'. + 'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'. + 'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'. + 'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'. + 'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'. + 'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ; + } +} + +class AntiSpam { + + private $iNumber=''; + + function __construct($aNumber='') { + $this->iNumber = $aNumber; + } + + function Rand($aLen) { + $d=''; + for($i=0; $i < $aLen; ++$i) { + $d .= rand(1,9); + } + $this->iNumber = $d; + return $d; + } + + function Stroke() { + + $n=strlen($this->iNumber); + for($i=0; $i < $n; ++$i ) { + if( !is_numeric($this->iNumber[$i]) || $this->iNumber[$i]==0 ) { + return false; + } + } + + $dd = new HandDigits(); + $n = strlen($this->iNumber); + $img = @imagecreatetruecolor($n*$dd->iWidth, $dd->iHeight); + if( $img < 1 ) { + return false; + } + $start=0; + for($i=0; $i < $n; ++$i ) { + $size = $dd->digits[$this->iNumber[$i]][0]; + $dimg = imagecreatefromstring(base64_decode($dd->digits[$this->iNumber[$i]][1])); + imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $dd->iHeight); + $start += imagesx($dimg); + } + $resimg = @imagecreatetruecolor($start+4, $dd->iHeight+4); + if( $resimg < 1 ) { + return false; + } + imagecopy($resimg,$img,2,2,0,0,$start, $dd->iHeight); + header("Content-type: image/jpeg"); + imagejpeg($resimg); + return true; + } +} + +?> diff --git a/includes/jpgraph/src/jpgraph_antispam.php b/includes/jpgraph/src/jpgraph_antispam.php new file mode 100644 index 0000000..d7a40f3 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_antispam.php @@ -0,0 +1,615 @@ +chars['j'][0]= 658 ; + $this->chars['j'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUGBAf/xAAsEAACAQMDAwMBCQAAAAAAAAAB'. +'AgMEBREAEjEGIUEUUXGBBxMVIiNSYWKC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEC/8QAGhEAAwADAQAAAAAAAAAAAAAAAAECERIh'. +'Mv/aAAwDAQACEQMRAD8A6veK2st8zRWSyV1dUBfvHaGVI4hknsS7AFv4AyM57ayWbqeS+11xtT2etttwo4YqhEqnQs5bcAfyk4AZ'. +'SOeD441TKRTyingUBG4/ah8j684+dSFzh/BvtaslejMUu9DPQTDnLx4lQ/ONw1TGBm0jdRWqguEMghEisWilgDmNs4Ze+MEEEH40'. +'aUVFTa7JeLjRXu4GjhmnNbSfqFQVlA3rkckOjH/Q99Glmkl0C/Q06pvsvT9vttXHDF6T1KrWbs5gRgQJM+FDlQxPhjpF1XcVq+qe'. +'jEoKiOecXBqh2TDDYIXLKuP6549xk8auI6aJqV45oknWdNswkAIkGMYIxjGO2NR1F0LZY5qkWqkS1xrM0M8lMSJpY+TGrnJiQ577'. +'cEgeNHhi7D3qC3UN69M8tIakRhgrh9o748+eNGtcCiKjjpkQKlMTEg3ZwoxtHHtgfTRpYXArvp//2Q==' ; + + //========================================================== + // lf-small.jpg + //========================================================== + $this->chars['f'][0]= 633 ; + $this->chars['f'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQFBgcC/8QAKxAAAgEDAwMCBQUAAAAAAAAA'. +'AQIDBBEhAAUGEjFBEyIHFFFhoRUzYnGS/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQP/xAAaEQACAwEBAAAAAAAAAAAAAAAAAQIRMRIh'. +'/9oADAMBAAIRAxEAPwDcnmLoIkiSYsouC3tA++O2lU9WkqVjJ+YdhZLsQI/4/YfQm50kZP0vbmaCSU0SRNIH6sghb9INs3t38dvp'. +'akUuz8x5DwdN5peS1jV1dSipSiVUigIcdQjQ26lIB/c6r3F86SZpE/zCFJaqsihQNhRgdj3Jyfxo0jDSbXHt9Oph9RAoV3qJGltY'. +'HDOxyb/nRpV0D3RXle21m48XraOk3IUSemUaV4g4Zc9ShcDtgff+tQfwvjq34Dtku7buamFqeJKemCCMxKFsEJU+/FrX8d76sEHG'. +'aNItzr4usVNdG3S0rmRYAVwEUmyjyQLZ11x7aF4zs9DQOyzml29I2cLa/pixIHi99DFCtU9dFuLIaijo9qiYPmR2mZmB9thgAHOD'. +'4+mjUrURyrUNMZFEkkIOFuFAbsP9d/OjVIQ6Vh4tP//Z' ; + + //========================================================== + // lb-small.jpg + //========================================================== + $this->chars['b'][0]= 645 ; + $this->chars['b'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYCAwUH/8QAKxAAAQMDAwMDAwUAAAAAAAAA'. +'AQIDBAAFEQYSIRMxUSJBYQcVI2JxgqHw/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/xAAYEQEBAQEBAAAAAAAAAAAAAAAAATERYf/a'. +'AAwDAQACEQMRAD8A6H95mxNYwLXcX+pCuilSLXJ6YSplaUELjqxwe4IJ5PIPamJ2V0bPcS7+NxCX1cHggAnIP+xSd9RyzHh2m7FQ'. +'Q1CvMNQWTjCt+HFD+PB/Y1fI1PL1HFFt0zaGblFdJQ9cJjpZiqPJUlBAKnPcEpGB5NNRKdrOl1NlgiQol4R2w4Sc5VtGf7opZteo'. +'LhdorjUSM5FnQnlR50NeHQysYxtVxlJHIPgjtRRD3xkaghs6juumdHz4+Y7RVPnt59K2mk7W+fcKWsZ7djTXMkW+xMP3GRJjwIEN'. +'HTG/CWx5wPY8AADx2NYk3SL9wukvUjGobnBkORksIbjdMANozgEqSo8qJPGO/wAVO36IsjUmBIfZfuM7epZk3F9UhSSk5O0K9Kcq'. +'8AcU3UzFuhUSBFud6nRXoz96mqmJZWg7m2dqUNhWBwdqQSP1UU5c/FFCn//Z' ; + + //========================================================== + // d6-small.jpg + //========================================================== + $this->chars['6'][0]= 645 ; + $this->chars['6'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'. +'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'. +'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'. +'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'. +'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'. +'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'. +'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ; + + //========================================================== + // lx-small.jpg + //========================================================== + $this->chars['x'][0]= 650 ; + $this->chars['x'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABMDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUHBgj/xAApEAABAwMDAwQCAwAAAAAAAAAB'. +'AgMEBQYRACFBBxIxFCJRgRNxkcHw/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAWEQEBAQAAAAAAAAAAAAAAAAAAEQH/2gAMAwEA'. +'AhEDEQA/AH9t3pKvO14UykVARa/HfAlxlDKXR24V2p3z7RlPwdtMep91uWdRGHWELjuTFFtLvcC4SNznnH+21O7ttiodOq1BvC0E'. +'p9I0lSX2kgqCSklK+5PKCMAng6zV2XRO6u3lSIURtbDRShltlZHa0tW7q/0MeTwnjxq1Jiw2xc9xTLbhSVU5iaXUFfqFFILgJOCd'. +'9Gt3SXabR6REpkL8yo0RpLCFNx1qBCRjOQMHxo0pEr6o3um2LVYpMEpTVqg25lHn08dfcB9kEgfZ1LIFDuawqZRb7aQlLTzqglsg'. +'9wQdveOEqBIB425xqhQuk8qo9UKlPrlRblw2ZBeCSVKW6CcoSrI2AGOT41SKzT4dYtmdS5bIXDZhNoWgbZJ94x8AYT/GkM03oNUc'. +'uKgwqtTZDTMOU0FttqRkoHggnPkEEHRrkJ6t1SlSHYUOc6zHaWrsbQrATk5/vRqK/9k=' ; + + //========================================================== + // d2-small.jpg + //========================================================== + $this->chars['2'][0]= 606 ; + $this->chars['2'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'. +'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'. +'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'. +'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'. +'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'. +'7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'. +'DLZ6f//Z' ; + + //========================================================== + // lm-small.jpg + //========================================================== + $this->chars['m'][0]= 649 ; + $this->chars['m'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAcDBAUCBv/EAC0QAAICAQMCBAMJAAAAAAAA'. +'AAECAwQRAAUSBiETMVFhB2KhFSIyQVJxgZHB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgED/8QAGREBAQEAAwAAAAAAAAAAAAAAAQAR'. +'EiEx/9oADAMBAAIRAxEAPwB0MI2lIdgI0Cly3kFXLEn2zx1FDdp7rbpbjUtRWKio3hyxOGQllJzkegX66rQ2qW87Zuk9S5FNVmru'. +'iywyBhjDKTkeXfSr+GRfYtq2KAO32b1BGxAZu0dyJ2DKPTxY1wPddVszycUq2Golq8jRWbcnJWwCVGMjz+VQP50atxMtm2ZUOY4l'. +'4qfUnBP0x/Z0amy4jJm10Tt2yddWasFmfaRfdrlG3UcgArnxKzJ+Fu4DqCMkcgNem2DoWav8PLfTm+FPEkuSNTnqueS5bnHIv6CG'. +'LNjJwM99bm67NB1Ht89KSxNXnr2hNDbiUc47K4KyD2GQMfmMjUnS+7vuIktTqPCaaWCqAMMojPFyw8hyYMQBnAwNJHYGXPTsW9VN'. +'jg2zf50W9zk524GAEihuz+xbIOD82jW5TkjtRPZkTkJ+4VgDhQfuj/f3OjUxl1f/2Q==' ; + + //========================================================== + // lt-small.jpg + //========================================================== + $this->chars['t'][0]= 648 ; + $this->chars['t'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAJxAAAQMDAgYDAQEAAAAAAAAA'. +'AQIDBAUGEQASEyExQVFhIjJxFSP/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAP/xAAZEQADAQEBAAAAAAAAAAAAAAAAAREhMUH/2gAM'. +'AwEAAhEDEQA/AO4BLEiEy7uG4IGxxs5IOOx76wd2XYidSp1HoD70240gcNNPbDyI6wQQpaz8E9MczkdhqtbsKYLieDk6WLKmZmmL'. +'Hk7AHVkbkLI+RQc7uRxgkfr1tx2rGu6VbToLVKkhU+kbugGf9WfaknCk5ycaX0zmaa+3JkqvW/CmzojsB9xoF6OoFK0r6HOcEDI0'. +'aefTuKX5ScMdC14HYq8n12zo1DEUcKTGg1Z+hyBwoPBVIiA/VQyOIgedhUCB4WMfXSV3UufVLcTUIqVf26K6mXDbPVRRzKT54iMg'. +'+zjtq6mtsyJjclxpKlUhSXEbkgkqWnBx4+J5e/zU0pZemPvJJQzEPDfQOrwwFY9AZ5eeYPLV6FwhoFYZuigxpkJeIjqAeIoAk9wA'. +'D46EnuD+6Nc1smDNrTlRkxqtMo1vzKhIdYgU9YDqVpISrLhHxSSd21I0aYyqP//Z' ; + + //========================================================== + // li-small.jpg + //========================================================== + $this->chars['i'][0]= 639 ; + $this->chars['i'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABwAGBP/EACcQAAEEAQMEAgIDAAAAAAAAAAEC'. +'AwQRBQAGEiExQVEHExSBFWFx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgMB/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAECMRH/2gAMAwEA'. +'AhEDEQA/AE7c+5M9BeRG29t1WUfKFFYW+GvrI7WD3B9g140YD5T36rcErDjbUR6dCBdejsKUpxITXI2FUrooCh70yvxzHyIlMvuK'. +'eVSH7IKEpJoKqu/ahddLryR/aMiO187bsmrWShhp1AZS2XHHrWhNJrzdf7f7GiVcHk3sptmHkJcJ2DIftS2FrKlJPXudWuLGYeQp'. +'t2fmEIckqIZaaKuSGG0lQ4gduRoFRHQ9AOgs2lOJbk9aSUlpjGvAWeSVH2VKq/2dFPw3IjyJe8s281ct3I9UoHJXGiQkD2STrSZ7'. +'Yf8AOl7JTdw5eOCz0jw3+LbYCfA9nz71msb8KMxoTGTw+5srjsipAdDqFBQBIuiOl6KrdYyJMyTCshlw2G3Fr/HiNqNNAqJJUoGl'. +'KND+h47km1bZwsvCbYYjycxIyK1qDv2yEi0hQviK8atKDcy9j//Z' ; + + + //========================================================== + // lp-small.jpg + //========================================================== + $this->chars['p'][0]= 700 ; + $this->chars['p'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAECBAUGB//EAC8QAAEDAwMCBAMJAAAAAAAA'. +'AAECAwQFESEABhIiMRMVUWEHFEEWIzIzcYGRocH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAgH/xAAcEQACAgIDAAAAAAAAAAAAAAAA'. +'AQIxAxESIUH/2gAMAwEAAhEDEQA/AOh703xG21DMeOyqoVNDjSzERiwU6Ep5qtZNycA97HTF13d33KWtmlt9xwkLl1NkXVxIuQgK'. +'wLj+hqBvel0qmbR8GnR22nJNZiLeeKr8nDIT1OLJucX+uPbWom7iocRpafOac5MX1ALltp/Cbi+cJH++utdh+WVNL3PNdNYpdWgx'. +'Y0qmLZSrwJJcQoOJ5XKlJFu4HbJOjVbt+V5nu7eopNRivqcdhK+bFnWwA1Y2AOcgjvj9dGlxy0g5y0xd+hNXoG24C4obizq3HZUh'. +'YHqtRHD06bG/8a0MbbG1mqekxaBSGmgkrcdcitlLfrckZIz7DUatbeFak0tyRLUwzT5vmiGm0cufEkFBJItfkD+59tKmiO12atFa'. +'eQukO3ejUxgENqTcfnE5WbkHiOnJ76N2IqI1DibabptS+zkZhtp90F2Y0S026EkAFK/qL46cXv65NVZDfxHmVCK4DE2/RX/lRFbA'. +'C5LwAyq2EtpHZI7mxPYDRqoctdESimz/2Q==' ; + + //========================================================== + // le-small.jpg + //========================================================== + $this->chars['e'][0]= 700 ; + $this->chars['e'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABgDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYEBQcB/8QAKhAAAQMCBAUEAwEAAAAAAAAA'. +'AgEDBAURAAYSIQciMTJBE0JRYRQVFoH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAgED/8QAGREAAwEBAQAAAAAAAAAAAAAAAAERAjFB'. +'/9oADAMBAAIRAxEAPwDTszvhEYCoS80BTm2bCjQRwdAzVe2yopkpJtpRUVfjEIc4V2oMerByg5Ji30oMyS3GeMunK0upfnu09MdJ'. +'p2scTmWnnGfx6HThktgLfKj7xEOqyr7QBbL41LhBzpxbcOru0LKDLdSnOHoaltNqSC4qWL0x9xbJYum69caczSaHmGmTmpDUYn4l'. +'UiqjkynzAVtwV23Ud+X4Ibpa2DCPkjhfUaRO/p8yzpb+YHhUmhbev6ZEll1lvqK3jt2XrbBgp6HVwsK3THpfEubGSoOUyFMpbJmL'. +'Deh6SgOGKti57EuY6l62JMWdJy7k3hg1LkOozEbVm7suQSkTiKtkEfP1pH664Za/QItccgI4bseTHdNxiXHLQ8yVl7V32XyioqL5'. +'TGc1ng6eYs0idczXUZscBBABWgEhEtfKNuUezwPnBhEuj8X2M21z9BR6NUX211Kk/UKKAjuhkPhL7XVf8vtgw7UPJlEyrDWFSYLb'. +'LBNF6qrzG6t0spEu6+fpL7YMXhUndp//2Q==' ; + + //========================================================== + // la-small.jpg + //========================================================== + $this->chars['a'][0]= 730 ; + $this->chars['a'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABoDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwIFAQcCBwAAAAAAAAAB'. +'AgMEBREAEiExQQYHFBUiUXGBE2EyQkNSgpHh/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAMBAv/EABkRAAMBAQEAAAAAAAAAAAAAAAAB'. +'IQIRMf/aAAwDAQACEQMRAD8AfdQ1pxjqZMSn0mRUZRYDaklJCE3OawO2ttTxY4hl07qFMVs1Ku02kpPnRGhsAqz8W9T9wDjozq6o'. +'Q1lDrcZLGVcmUoZg0obpufxK3Ftt9ccqB1GgBcmLSqtVEqOZcr6ARm/kbXHt7DEtc7WTJKTJqEWvRKfLqL9QplSjuPtGVYOJKBrm'. +'t+U+n94WGStZzNypmRWqckUKTbixy6jAfxPxHtCgKqFNlU5huK6pLMndSlegG4J45N8aKmTMKQRBsCNMzwB+RbHWHGEAZlPZX2hx'. +'qZIC34ygZoYUbB50JSkFXFhZR9BrpheR4fIbQ6gvurJ7q02bIQTuAOAN8x40HAxRr3TrNRpBmSHVt1KMlTyJTCsqkKAPlSf28W+c'. +'UGaD1c9HSR1HFUh9tJU45EBcAtcC9+P9wqbg8IAto9o81yputrVGpiUkgHKkqUTZI32+cKm1z1tIUgPBBAKQ4UBQH3uL3xmXSXep'. +'HVDtXStE5K5jlPU7PF3Q41+okJFkjgC+3OuNSYiSzHaLtRcW4UDMpLYSCbakDW3thhum5p//2Q==' ; + + //========================================================== + // d9-small.jpg + //========================================================== + $this->chars['9'][0]= 680 ; + $this->chars['9'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'. +'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'. +'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'. +'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'. +'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'. +'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'. +'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'. +'1V1//9k=' ; + + //========================================================== + // d5-small.jpg + //========================================================== + $this->chars['5'][0]= 632 ; + $this->chars['5'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'. +'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'. +'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'. +'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'. +'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'. +'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'. +'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ; + + //========================================================== + // d1-small.jpg + //========================================================== + $this->chars['1'][0]= 646 ; + $this->chars['1'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'. +'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'. +'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'. +'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'. +'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'. +'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'. +'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ; + + //========================================================== + // ll-small.jpg + //========================================================== + $this->chars['l'][0]= 626 ; + $this->chars['l'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAArEAACAQIFAwIGAwAAAAAAAAAB'. +'AgMEEQAFBhIhFEFREzEHFSIyYcFxgZH/xAAXAQEAAwAAAAAAAAAAAAAAAAACAAED/8QAGhEAAwEAAwAAAAAAAAAAAAAAAAECMREh'. +'Qf/aAAwDAQACEQMRAD8A15Zfm1VURj1Fp5AqLKv3OARcL4W5Nzx+MLWjdRz5hqXU6TSb6OCr6WghiQbrJ91gOTy1yT5xZ55myZFk'. +'Gb5ozX6Ondm28XYqpQDwu7jEH4c5S2UaDy4xxrLmlUDWzk8XaQ3O49hbj+RiB85HNg8Ee3aqwIqhDuux7G/HHbvzgxEqaWOvy09R'. +'O0o3hjdQoUji20g+fY3wYSM6pJ4Ylr7V+Zz5PSaezHTlTRNWzxySSxt6q1MSkH6AOT2Fu3Aw7RfF/T9DEkLUeawuF2mKSgdWQj2/'. +'q3+fnDZDlqRZzQGaOGcpTOaeR1u8R+ncN3gj94so2jNWHeMNNKzorEX2qp9v3imNPoRE1zpjUtZ09HJmYq5lury0benZeTww23t3'. +'Ivgw+T0yRRyyxIqNfkLcA8jt7YMKcBWn/9k=' ; + + + //========================================================== + // ls-small.jpg + //========================================================== + $this->chars['s'][0]= 701 ; + $this->chars['s'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAMCBAUGB//EACwQAAEEAQIFAgUFAAAAAAAA'. +'AAECAwQFEQAGEhMUITEiYQcjQVFxFRZCUoH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAgH/xAAZEQADAQEBAAAAAAAAAAAAAAAAAQIR'. +'EiH/2gAMAwEAAhEDEQA/APWZMhmFXSJU+SGmWFiQtAWMJQAnJUr8Z+w/OuQk71uZnMsqnbjy9s8st9UMCQ6kZJdZaIHEkZ/JHceN'. +'N3HtizuY1JLrG48yLBSC9UTFKQiY4nACir+wAOOMEe2rm2bTbzlqtE1MyBuZAPybpw85KSfDRJ4Cg+Pl/wC61hJeGjV31VuuKqwr'. +'LGU+whZZK+Rw+oYJAyj3GjS4dZFpZVkqPLktdfMXNcaU2kBC1BIITkdx6c599GlnvPAa3TL2vNvU76n0063acr3YSLCEjpUpUQtW'. +'Dhf14SMEnOc57aZ8Tegm7dbrEQGZt1PeTDgc1PEW3FeXAvyAkZVkeMDOm2G3f3O7Cl/qEuqkQg4lp6CRxraWfUlRUD24kZA741Ko'. +'2k1HvlT3ri2sLOCgtsyJz6XEtBwZPAgJAGQMHUNPWKqWItsqh0UCFVyLeKhyLHQ2TMdHNVj+RKlAnJyfto1FW2ahgjrq6LYTFjjf'. +'lymUOLdWfJyoHA+gA7AAAaNPE3ysJdLT/9k=' ; + + //========================================================== + // lh-small.jpg + //========================================================== + $this->chars['h'][0]= 677 ; + $this->chars['h'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAIDBAUGB//EACwQAAIBAwMCBQIHAAAAAAAA'. +'AAECAwQFEQAGEiExExQiQVEVggcyU2GRocH/xAAXAQADAQAAAAAAAAAAAAAAAAAAAwQB/8QAGhEBAQEAAwEAAAAAAAAAAAAAAQAC'. +'AyEyMf/aAAwDAQACEQMRAD8A6DZb95q9bmpK6ieOCzNHJTxmE+NMhQ5fr1fLq3Ejvkak2e7ipiFsqb3R0m4qkPPJRiRXenU9VjKE'. +'5JVcA9R7nWc3/BUbfoKTdO3VRXhpjbZ2D8Rwk6RyZH6chB+46m7i2hDYtgA2ePlV2VkuKysoLzzRnlIScZJZeeevvjtrX7LK2rp7'. +'tTwwJ9WjhILDrTKnIdMEDl2+P80aVdJZb1QW+vgqENLPH4sBCDLIwUgnOf4GjVvDnLgUk79T81voqjb8NnuUx8pVRCiEaYUSuynl'. +'jHU9mOfnOoOx6hqz8PrbNdfEkMUXg1LSM3rKOUywJ7YAJ1ZTWmSpvdvlaVTDSUzJAhH5ZJBgv0x2RSAPlz21WXqoet3ba9nuW8n4'. +'Jr6qTPqnUNxSM/f6mPvxA9zqJnExTbR+h0nkhVu1uE8j0UBRQ9PGxBKFjnkAScdsDp10a0lc7z0tI7Y5YYN+5GAf7GjVXF4Icj3f'. +'/9k=' ; + + + //========================================================== + // ld-small.jpg + //========================================================== + $this->chars['d'][0]= 681 ; + $this->chars['d'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFBgH/xAAsEAABAwMEAAQFBQAAAAAAAAAB'. +'AgMEBQYRABIhMQcTI0EUMlFhkRgicaGx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgEA/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAECETH/'. +'2gAMAwEAAhEDEQA/ALUhp6h3W/X63UlypbhCY0WMjLqGzwDtPCfv/WtealNpVInuVBBqCogcdbU36YUkAkJWVHG8YPXBxxzxqPcN'. +'YtWyWnIlUeW05VEOAvrCnnSkftK1H5lKJPHsMDoDUWq+KdrSbIqsalVsImiEtLUZ2MU71bcYJWkhZ/36ayLHhi/IXZVOmzKqp5uU'. +'688hTyjuGVEFJKvoQesD86NL2jGZp1EoLDSmk+ZAQ8d7oPzp3YGesFWMfxo1YGvSzLsT9QExVX8phTlMaFOExAJIBGQjJwCcL+/e'. +'rd+W7GuO0Kw05CQ6+ww69Gfdb2kFIKk7DgEkjgnr86rXRa9HuyP8LV4SH0sIBbWFFDiFEgDaocgdkjo8ccay0qw7ut5nyrcviQqC'. +'slsRKo0HwlODkBRzxj2AGoXTtpzIdQ8MbffUChz4NCPRaClAo9Mn6c7T3o13wytmo0K05VIqkiPJbizFiMWs4CTgnIIHOST796NL'. +'Ia1JX//Z' ; + + //========================================================== + // d8-small.jpg + //========================================================== + $this->chars['8'][0]= 694 ; + $this->chars['8'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'. +'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'. +'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'. +'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'. +'44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'. +'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'. +'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'. +'EylmLHQltptPZKQOBo1FzH//2Q==' ; + + //========================================================== + // lz-small.jpg + //========================================================== + $this->chars['z'][0]= 690 ; + $this->chars['z'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABgAHA//EACsQAAEDAwQBAwIHAAAAAAAAAAEC'. +'AwQFESEABhIxBxMiQVFxCCM0UmGRof/EABYBAQEBAAAAAAAAAAAAAAAAAAECAP/EABgRAAMBAQAAAAAAAAAAAAAAAAABEVEC/9oA'. +'DAMBAAIRAxEAPwBTWfLu1KXXZDbM4uewNvLajlwhaCbBAwDe5uehYd3xm6t6bi3jvulwqc7KgxXZZeYQLNLeF73WRg4HEdgfzrSa'. +'P45pNEkznITDc9ypLShtyWhJDJyXC2qxJHZvjoZOjyVv1v8AESt6FFS4ijxvTLbawEApSccrYHJf0+OtJMQ2rNXk7GZMufJgJjTH'. +'Un9M4qzxT7hyCiThIyRnPXWrRvyLElVBUF6vlhl0lwRYCFKcQhAtyWpVhyWTx+w++rUvp4EWjOvbniUOnVatcS43BYDbJSPZyIBw'. +'ejclIx+3Wa+J63T6DQanuGszI0eZVJJV60p0Jum5GEi6le7l0PjvSjyRsaTvJqI1BqhhR46ksuMrQVJcUSEoUbHNr/7o7C8L7eiz'. +'4lLlyJk2cEqW+6V+m0AE9ISLnsj5+O9UhsFK92bZZqb9SRu9p2c4A0OCEqDbYAJSlJwAVZv3fBvbFrg/462btlhuS1RG5nL8pYkq'. +'KrnsKH06I/rVrQKkf//Z' ; + + //========================================================== + // d4-small.jpg + //========================================================== + $this->chars['4'][0]= 643 ; + $this->chars['4'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'. +'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'. +'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'. +'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'. +'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'. +'27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'. +'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ; + + //========================================================== + // lv-small.jpg + //========================================================== + $this->chars['v'][0]= 648 ; + $this->chars['v'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAKBAAAQQBAwMEAgMAAAAAAAAA'. +'AQIDBBEFAAYhEzFBEhQiYQdRFTKB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAAAAAAAAERIf/aAAwD'. +'AQACEQMRAD8A6Ngt1SZ4yrYgrecgTFsFJA9aGwAUrUaF2D2Avjzq6CIjiBPkB9bwQVIkIYIDae/wq+P9N+dY4SGMf+Txlev7KBmY'. +'PoadKRy4zxSgRxaTwO/x09u7KPYnasmHjlsyFZZXt4K23ezjvBpNGgLUrvXfVZyLLbWambiwEbKvvxYAkeotNlIJW2FEJWb7WBda'. +'NSQI0fHYyJjkrjKRDZQwnpQ1vgBIr+w8+a+9GocZr8iKkuY1eXhsKH8U8iZE9BHz6ZHUc48UfSPqzqH3kfeO9kTTDQYGGietpTaO'. +'shyW6AocpHNIrv8AvWzk9BUSdPdYS4BcRlomkhIV6KP0VE39V+tU2wdlRMHtZUB8NuTQ+51X27+Kr46ZPIAFV540D8zeLsJ5LMHa'. +'ubmMBCVJdjx0pRyLoWR4I8aNIQ8BvZMNtMTeUcsptKfc4tC1gAkCyFC+K0aJtf/Z' ; + + //========================================================== + // lk-small.jpg + //========================================================== + $this->chars['k'][0]= 680 ; + $this->chars['k'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBAMH/8QALhAAAQMDAwIEBAcAAAAAAAAA'. +'AQIDBAUREgAGITFBEyIyYQcVUYEUIzNicZHx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEE/8QAGxEAAwACAwAAAAAAAAAAAAAAAAEC'. +'AxESMeH/2gAMAwEAAhEDEQA/APVK/V36dU6NSJDTT8esPLiqfK8S2cCoeTkKvZQ6jm2ldSqKqbu+OgMOvSX3m4UBrLnDlbqiefKl'. +'Nzz2x1m+IwNP27CkJQ7JkR6rCkMJbP5jp8S2CPfkgD6H+dJ6Ca0nerr+64rTNSqMYrg+C9mmOwhVpDfsuxSbi97DmybaoZeQ5jTl'. +'PEp18JTIfeW3kq3ly4H26aNZqvTWZsjFcZTsVtSg0G8Rio+vr2vb7g6NLPRnuXy8F+8kl+obUh4KXJdqSJJQnohlkZqJPYBXh3P+'. +'a4b5Hyp6k1bO7sOotPyXkj9NlwFl0ewstJA9ifrqkVSmET4csoS7UTHXFQ+6SQlskKUMb/tH9ddLVUmS7DqdBqD7U6OsqfS46jzl'. +'hQ5bXb1K9Scuybdxo2OTu92dwSZkWn0Sb8viQWyn8Qq5D6ifSLd0BIv7q0arTBRSKPToMZbi2GWylsvLK148Wue/XRrRjxOpT2R2'. +'k9aP/9k=' ; + + //========================================================== + // lr-small.jpg + //========================================================== + $this->chars['r'][0]= 681 ; + $this->chars['r'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAGgAAAgIDAAAAAAAAAAAAAAAAAAYCBQMEB//EAC4QAAICAQIFAgMJAQAAAAAA'. +'AAECAwQRBQYAEiExQQdRFGFxEyIyM0JSYoGC8P/EABYBAQEBAAAAAAAAAAAAAAAAAAEAAv/EABcRAQEBAQAAAAAAAAAAAAAAAAAB'. +'EUH/2gAMAwEAAhEDEQA/AOs0ZdETU54Gt1INSmlPJEsyo7J+jlXPUYBPY9c+eE/dO9tY0a7ren6BVrW7VJTZtW5kZkjXkBSIKveQ'. +'gHp0AAJ4w+q2hVdT2Md0h46+saS4mr3EUK0gWTAB+vQj2PboeL/ZVOqmhaZVjkFmxdC6tctt3tM2G5/7bAx4C4+qxiWwd3prWzKe'. +'r3IBAth5OYxozKsgc8y4GTgnJB9uncdTi6tXq2140rRVM13JMEMAVAg7sMdBjJB/18uDgRO9R2Oo6FX2vShkFzURFUq1whIj+8DI'. +'7EdAFjXv7MeNb0kuStsFEmIaajZaos2fy2Q4VGH7SGxn+Rzw9yMLOm/FzRhZazmOTkP4grYyD3B8j2PTyeFfZ+z7G3BeSS8lmprl'. +'2K2qcnK0Z5S8gPjrgAY8cNEWmq7u23pEos6/Zji+Kd0rLLGWwseA3joeZj/w4OET1g0vlmrWV+ydFnkUxSgsvM4V+YYIwfHz6cHB'. +'ZeKZ1//Z' ; + + //========================================================== + // lg-small.jpg + //========================================================== + $this->chars['g'][0]= 655 ; + $this->chars['g'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQCBQYH/8QAJxAAAQQBAwQCAgMAAAAAAAAA'. +'AQIDBBEFAAYhBxIxQRNhcYEiQlH/xAAYAQACAwAAAAAAAAAAAAAAAAACAwABBP/EABkRAAMBAQEAAAAAAAAAAAAAAAABAhEhIv/a'. +'AAwDAQACEQMRAD8AayO4t6bq3hmMHtxyLi4OKeKH5jyASiiQCCQeTRNAeB61FrBb+jTGpLO+BMW24EFMhkhpQru8m7B/H70x09Yi'. +'q3nv/vLfwpnJ7UNkqSRbngf2ofWkpXV7brymC2malLfagurjW0aHk89xPJ9cX9aprURHWbYEaMHHEBfwpv8AnXPk+/8AdGqGJOxO'. +'4YbOSxK4y4boIStUWysgkEmxY54r60aOI8oTV9MHtjJwunPUbO46WWo0HLlD8KY4goboFVoquOVEVwLT963WdnxYfT6ZJyz0JvHm'. +'KvtaSkW4tYNVSqKiTwB+fw5n9sY/cuOXCzDDcluyW3Ckd7V+0n0eNZTH9DdouFalHIOJBUhtDki0pNV3UALo81ehG6IdKjPZ6d47'. +'4ywltanVJvuJI+RQs/sHRqy2r003JhsImEc/CUyhxRZBjKV2oJ8eRXNmufPnRo1WIz3DdNn/2Q==' ; + + //========================================================== + // lc-small.jpg + //========================================================== + $this->chars['c'][0]= 629 ; + $this->chars['c'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBwID/8QALRAAAgICAQIEBAYDAAAAAAAA'. +'AQIDBAURACExBhIiQRMVUWEHMkJScYFykaH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAgP/xAAXEQEBAQEAAAAAAAAAAAAAAAAAATER'. +'/9oADAMBAAIRAxEAPwDcoGkmiT4Q8kWvzuPU38D2/v8A1zwrCFayq1qTaFk2H7aJHt05MeMvENzC4upDWkjW9kJXiricAJCigvJN'. +'IB1IVQT5frrv24twPgunk6a288crbklUSJNNdnSTZ2STHHqOP/Eb17njdZtAoqwEvrEiGVyG117/AG6HhyV8H1sljMldoxXTksGC'. +'zV7M0oaWGQOVeGQ92I6EMR22D11w4LmEPjaOL51iL8ssc9Z69zHtZkYCGGeQK0ez2UEoU39wCeX1S/LLiEt+mPSbMLxsGVv2kEjR'. +'305xkaEV/GTULMUT1LD/AAGh8gIZS2jv+vpybb8NMIb0dVLWYWgiiU0vmMphOj6V0TvQI3rfsON1E6dYjGtisa0F1mAWR2NhG0WZ'. +'3Ls3TqNs5Hc9h23w49NWL9K+Q/VD5T/zhwPH/9k=' ; + + //========================================================== + // d7-small.jpg + //========================================================== + $this->chars['7'][0]= 658 ; + $this->chars['7'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'. +'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'. +'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'. +'19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'. +'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'. +'8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'. +'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ; + + //========================================================== + // ly-small.jpg + //========================================================== + $this->chars['y'][0]= 672 ; + $this->chars['y'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQGBQf/xAArEAABAwMEAQIFBQAAAAAAAAAB'. +'AgMEBREhAAYSEzEHIhQkQVGxQmFxgaH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAQL/xAAeEQEAAgEEAwAAAAAAAAAAAAABABECAxIh'. +'MUGR8P/aAAwDAQACEQMRAD8Ar3tys07dVHohemz5dWQ7fk91MsA3IIRY8rkKFySceTqw3JVV0KhyKw+0C1CQp9aUOFSiAk4AIAvn'. +'76xtz0ioVvbcJ6msx2JtOfZmw1PKI5LQcJNh7UqBKcn6+NRfqPu6s1fYc6GxSJsRfWDUVSGA22ygEckJWSexRNgOP0udXzDKOJ0I'. +'yo62mHm25Sy80l1Z4lSgpQvZRGLgWwPGjTjbchyLH+Ejx22EtJSgO8kki3kADA/nOjWjGzv73CyQZjUWNVp7bNSrj7qJDqflqUlQ'. +'DMds24l3HvcNr3Pi9gME6T9WWVsemdYWswwC2lPta4m5WMA3OdUExCmozUJD6g84ntMjrHIFBTdQz5yLDx/WDNytpwW6nAkViqVe'. +'uvmXdlme6n4dCwlRBKEgA2tj99QG7Ilncp5QqpU31PMsJ6x7A32f6SPxo0hPVCD45oVyKf0MtgeT97/nRrO7UOCFla3tn//Z' ; + + //========================================================== + // d3-small.jpg + //========================================================== + $this->chars['3'][0]= 662 ; + $this->chars['3'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. +'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'. +'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'. +'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'. +'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'. +'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'. +'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'. +'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ; + + //========================================================== + // ln-small.jpg + //========================================================== + $this->chars['n'][0]= 643 ; + $this->chars['n'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGwAAAgEFAAAAAAAAAAAAAAAAAAYCAQMEBQf/xAAtEAACAQMCBAUCBwAAAAAA'. +'AAABAgMEBREAIQYSE0EHIjFRcWGRIzIzQoGCwf/EABYBAQEBAAAAAAAAAAAAAAAAAAMEAP/EABkRAQEBAQEBAAAAAAAAAAAAAAEA'. +'AhEhUf/aAAwDAQACEQMRAD8A6FR3p7v4oV9rlkMQsjL00RyOss0KkFxnDcrc2PbI1NOJKyTjW+W5OmKeA0UEJx5meRZS2/8AUfbS'. +'LVGS1+K16vCzfiR3GmoqqXGyxz06hWPsFlVMfOmq1iNvE69KjBYo3oJMZ3GKeYYPxg/fW+xzZX1FLQyxwSTcpWNceu4G3+aNSmpY'. +'qmQzzwh2k8yhv2r2H23/AJ0aoy+EWh7I1ntacR3PxDtEzhjWy0wkkIwYmanU5GO6sNh7rrU8AVdTceNbhDXxNHUQvS0tZ3DzwxVA'. +'fB7hj59/XJ08cPWaKj4gvlwSQiG7dCboqvLy9NOmQT9SM7ayJrBa6K5V91hjlWorp4JGUOAglRSiMMDb82/vgaBGTpVvtNUVtyJg'. +'5+WNAh5ZCu/r2+dGrgq0pi0DhmlRsSSAfqMd+b6ZyNu3po1Rk1yNBe3/2Q==' ; + + //========================================================== + // lu-small.jpg + //========================================================== + $this->chars['u'][0]= 671 ; + $this->chars['u'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYDBAUH/8QAJRAAAQQBAwQDAQEAAAAAAAAA'. +'AQIDBBEFAAYhBxMxYRJBURSB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAQAD/8QAGhEBAQEAAwEAAAAAAAAAAAAAAQARITFBAv/aAAwD'. +'AQACEQMRAD8A6dLkQmJzu3WVtHIqjf0duKFNuBr5UTQ45F1R8/XI1PMmsYoJyjhS9iI7BKHeKjkXZVXqhyLHP+rrHeR1pZlx1W1M'. +'wTiW0ukkrS28nn5fV2SPPFfurHUKQhzYG7pLYKEfyBhaSOS7dG/YCki/uvWn3LPDOJrwa4kyEzOYeakqkpC3Hk0bNePQHgDRpchY'. +'leIZwzUWauKtuPctTSUlCAUmrBHIKuAPV/ujQsmHdm7hya43UbbD3ZVElOQJsdTS6IQaQUqBHCk8E2Pocgam6oYwObHy0Zm0oi45'. +'T1KBPdpV2f0pom/1Ws7cmPazu98Ltvcq3VzRHfehz8a4pirFEKRZo8eQT+eCdWYfS/b+WYnxpbuVcDRMdHcyTqg2fiAfiLoi+Rf+'. +'jT7Xc74HtOYnHyUOh8yWUvKeHhy0CiPVUAPoDRrm+OeznTva6lzsyMjCYbbaiNJjJSWElagD5tRpNUSALFeNGoOCH7Bv/9k=' ; + + //========================================================== + // lw-small.jpg + //========================================================== + $this->chars['w'][0]= 673 ; + $this->chars['w'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYDBAX/xAAtEAACAQMDAgMHBQAAAAAAAAAB'. +'AgMEBREABhIhMRMUQRUiIzJRYZEWNIGx0f/EABYBAQEBAAAAAAAAAAAAAAAAAAABA//EABoRAAICAwAAAAAAAAAAAAAAAAABERIh'. +'MVH/2gAMAwEAAhEDEQA/AHXbV13ZLu6t2/uaa1JijWopVp4XUTKSAXRyc+6ehBGeoPbTSlwpql0K3GneqpZViqUhI5JzGMEZJGeh'. +'GlXfaFILDf7FQzXC426rDLTojs8sLqVkXBGcfKf40twWbdWzZY75R0s90ul3jPtKjVMJDNn4DDp8iEhW+wJ1WZG2KWt3Lv26U1tv'. +'92o7PaYkgYUbqVepYlmUBlIwqnB++O2jTDt/bBtth9jcpvEWNGqalZQryTlmeR8jPct6+mNGmRC4a1U13htzVFItB5nA/cyOUVfp'. +'7oz/ALqitJulYJKuqvFsppHALLFb3cp9FBaXr+O51bq0q6i38KK5PDVAAxSzU6SIpz3Kjjn8jUFoS7uFmut1gq17xLFQ+DxOccj8'. +'Rsn+tVpiyJnqv09YfOXu5AycgZZQEhBZjgDBOOgwO/po0sttWHdNzqLruioa4UwmdaC3kYp4IwSvJlBHKQ4OSe3po0qxM6P/2Q==' ; + + //========================================================== + // lq-small.jpg + //========================================================== + $this->chars['q'][0]= 671 ; + $this->chars['q'][1]= +'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. +'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. +'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAcDBAUG/8QAKRAAAQQBBAICAQQDAAAAAAAA'. +'AQIDBBEFAAYSIQcxIlETCBQVgSNBYf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oADAMB'. +'AAIRAxEAPwDT3H5Qz+O3LN2vtrF/y86NYLzzVlAABJITQPv2a/17vXMboz3lDEYWPuafNx7CFrS03+2jpK2bs0CUkUa7pRvrUu63'. +'sr438yv7pLEo4XIK5Kcji0uJUkckm+uQUOVH6GsnyJv7A5vaJwuFdkONLmolgONFH4vioKRXYqyCADXvRMh0yspmZ4jyIEtDTK47'. +'aiA0lQUopBJBI/7X9aNT7amRo228e3a31iO3yUzCcdSPiKAIFdCho0TIswZ7GQlO/hlRxBooih1YXzAoKUkX0LPEBX110dJ7zbuv'. +'AORpO04cIpmxH23FSEIRwKuNnsdk0o31702XhFMKbuRUZJWP8LTQ6HBCuIB+iVWSR2BXuqK93/hDlvGzEphmG3Ml5JpDi1I7TzNA'. +'BYFlPafY+/7LBiv1CYDH4iFDOGySlMR22lFP4wCUpANfL11o1r4bxXlWMNEaE/bqlIbCFl/ANPK5Do/M0VDr2Rf3o0TX/9k=' ; + + + + } +} + +class AntiSpam { + + private $iData=''; + private $iDD=null; + + function __construct($aData='') { + $this->iData = $aData; + $this->iDD = new HandDigits(); + } + + function Set($aData) { + $this->iData = $aData; + } + + function Rand($aLen) { + $d=''; + for($i=0; $i < $aLen; ++$i) { + if( rand(0,9) < 6 ) { + // Digits + $d .= chr( ord('1') + rand(0,8) ); + } + else { + // Letters + do { + $offset = rand(0,25); + } while ( $offset==14 ); + $d .= chr( ord('a') + $offset ); + } + } + $this->iData = $d; + return $d; + } + + function Stroke() { + + $n=strlen($this->iData); + if( $n==0 ) { + return false; + } + + for($i=0; $i < $n; ++$i ) { + if( $this->iData[$i]==='0' || strtolower($this->iData[$i])==='o') { + return false; + } + } + + $img = @imagecreatetruecolor($n*$this->iDD->iWidth, $this->iDD->iHeight); + if( $img < 1 ) { + return false; + } + + $start=0; + for($i=0; $i < $n; ++$i ) { + $dimg = imagecreatefromstring(base64_decode($this->iDD->chars[strtolower($this->iData[$i])][1])); + imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $this->iDD->iHeight); + $start += imagesx($dimg); + } + $resimg = @imagecreatetruecolor($start+4, $this->iDD->iHeight+4); + if( $resimg < 1 ) { + return false; + } + + imagecopy($resimg,$img,2,2,0,0,$start, $this->iDD->iHeight); + header("Content-type: image/jpeg"); + imagejpeg($resimg); + return true; + } +} + +?> diff --git a/includes/jpgraph/src/jpgraph_bar.php b/includes/jpgraph/src/jpgraph_bar.php new file mode 100644 index 0000000..94bd187 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_bar.php @@ -0,0 +1,1190 @@ +numpoints; + } + + //--------------- + // PUBLIC METHODS + + // Set a drop shadow for the bar (or rather an "up-right" shadow) + function SetShadow($aColor="black",$aHSize=3,$aVSize=3,$aShow=true) { + $this->bar_shadow=$aShow; + $this->bar_shadow_color=$aColor; + $this->bar_shadow_vsize=$aVSize; + $this->bar_shadow_hsize=$aHSize; + + // Adjust the value margin to compensate for shadow + $this->value->margin += $aVSize; + } + + function Set3D($aHSize=3,$aVSize=3,$aShow=true) { + $this->bar_3d=$aShow; + $this->bar_3d_vsize=$aVSize; + $this->bar_3d_hsize=$aHSize; + + $this->value->margin += $aVSize; + } + + // DEPRECATED use SetYBase instead + function SetYMin($aYStartValue) { + //die("JpGraph Error: Deprecated function SetYMin. Use SetYBase() instead."); + $this->ybase=$aYStartValue; + } + + // Specify the base value for the bars + function SetYBase($aYStartValue) { + $this->ybase=$aYStartValue; + } + + // The method will take the specified pattern anre + // return a pattern index that corresponds to the original + // patterm being rotated 90 degreees. This is needed when plottin + // Horizontal bars + function RotatePattern($aPat,$aRotate=true) { + $rotate = array(1 => 2, 2 => 1, 3 => 3, 4 => 5, 5 => 4, 6 => 6, 7 => 7, 8 => 8); + if( $aRotate ) { + return $rotate[$aPat]; + } + else { + return $aPat; + } + } + + function Legend($graph) { + if( $this->grad && $this->legend!="" && !$this->fill ) { + $color=array($this->grad_fromcolor,$this->grad_tocolor); + // In order to differentiate between gradients and cooors specified as an RGB triple + $graph->legend->Add($this->legend,$color,"",-$this->grad_style, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + elseif( $this->legend!="" && ($this->iPattern > -1 || is_array($this->iPattern)) ) { + if( is_array($this->iPattern) ) { + $p1 = $this->RotatePattern( $this->iPattern[0], $graph->img->a == 90 ); + $p2 = $this->iPatternColor[0]; + $p3 = $this->iPatternDensity[0]; + } + else { + $p1 = $this->RotatePattern( $this->iPattern, $graph->img->a == 90 ); + $p2 = $this->iPatternColor; + $p3 = $this->iPatternDensity; + } + if( $p3 < 90 ) $p3 += 5; + $color = array($p1,$p2,$p3,$this->fill_color); + // A kludge: Too mark that we add a pattern we use a type value of < 100 + $graph->legend->Add($this->legend,$color,"",-101, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + elseif( $this->fill_color && $this->legend!="" ) { + if( is_array($this->fill_color) ) { + $graph->legend->Add($this->legend,$this->fill_color[0],"",0, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + else { + $graph->legend->Add($this->legend,$this->fill_color,"",0, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + } + } + + // Gets called before any axis are stroked + function PreStrokeAdjust($graph) { + parent::PreStrokeAdjust($graph); + + // If we are using a log Y-scale we want the base to be at the + // minimum Y-value unless the user have specifically set some other + // value than the default. + if( substr($graph->axtype,-3,3)=="log" && $this->ybase==0 ) + $this->ybase = $graph->yaxis->scale->GetMinVal(); + + // For a "text" X-axis scale we will adjust the + // display of the bars a little bit. + if( substr($graph->axtype,0,3)=="tex" ) { + // Position the ticks between the bars + $graph->xaxis->scale->ticks->SetXLabelOffset(0.5,0); + + // Center the bars + if( $this->abswidth > -1 ) { + $graph->SetTextScaleAbsCenterOff($this->abswidth); + } + else { + if( $this->align == "center" ) + $graph->SetTextScaleOff(0.5-$this->width/2); + elseif( $this->align == "right" ) + $graph->SetTextScaleOff(1-$this->width); + } + } + elseif( ($this instanceof AccBarPlot) || ($this instanceof GroupBarPlot) ) { + // We only set an absolute width for linear and int scale + // for text scale the width will be set to a fraction of + // the majstep width. + if( $this->abswidth == -1 ) { + // Not set + // set width to a visuable sensible default + $this->abswidth = $graph->img->plotwidth/(2*$this->numpoints); + } + } + } + + function Min() { + $m = parent::Min(); + if( $m[1] >= $this->ybase ) $m[1] = $this->ybase; + return $m; + } + + function Max() { + $m = parent::Max(); + if( $m[1] <= $this->ybase ) $m[1] = $this->ybase; + return $m; + } + + // Specify width as fractions of the major stepo size + function SetWidth($aWidth) { + if( $aWidth > 1 ) { + // Interpret this as absolute width + $this->abswidth=$aWidth; + } + else { + $this->width=$aWidth; + } + } + + // Specify width in absolute pixels. If specified this + // overrides SetWidth() + function SetAbsWidth($aWidth) { + $this->abswidth=$aWidth; + } + + function SetAlign($aAlign) { + $this->align=$aAlign; + } + + function SetNoFill() { + $this->grad = false; + $this->fill_color=false; + $this->fill=false; + } + + function SetFillColor($aColor) { + // Do an extra error check if the color is specified as an RGB array triple + // In that case convert it to a hex string since it will otherwise be + // interpretated as an array of colors for each individual bar. + + $aColor = RGB::tryHexConversion($aColor); + $this->fill = true ; + $this->fill_color=$aColor; + + } + + function SetFillGradient($aFromColor,$aToColor=null,$aStyle=null) { + $this->grad = true; + $this->grad_fromcolor = $aFromColor; + $this->grad_tocolor = $aToColor; + $this->grad_style = $aStyle; + } + + function SetValuePos($aPos) { + $this->valuepos = $aPos; + } + + function SetPattern($aPattern, $aColor='black'){ + if( is_array($aPattern) ) { + $n = count($aPattern); + $this->iPattern = array(); + $this->iPatternDensity = array(); + if( is_array($aColor) ) { + $this->iPatternColor = array(); + if( count($aColor) != $n ) { + JpGraphError::RaiseL(2001);//('NUmber of colors is not the same as the number of patterns in BarPlot::SetPattern()'); + } + } + else { + $this->iPatternColor = $aColor; + } + for( $i=0; $i < $n; ++$i ) { + $this->_SetPatternHelper($aPattern[$i], $this->iPattern[$i], $this->iPatternDensity[$i]); + if( is_array($aColor) ) { + $this->iPatternColor[$i] = $aColor[$i]; + } + } + } + else { + $this->_SetPatternHelper($aPattern, $this->iPattern, $this->iPatternDensity); + $this->iPatternColor = $aColor; + } + } + + function _SetPatternHelper($aPattern, &$aPatternValue, &$aDensity){ + switch( $aPattern ) { + case PATTERN_DIAG1: + $aPatternValue= 1; + $aDensity = 92; + break; + case PATTERN_DIAG2: + $aPatternValue= 1; + $aDensity = 78; + break; + case PATTERN_DIAG3: + $aPatternValue= 2; + $aDensity = 92; + break; + case PATTERN_DIAG4: + $aPatternValue= 2; + $aDensity = 78; + break; + case PATTERN_CROSS1: + $aPatternValue= 8; + $aDensity = 90; + break; + case PATTERN_CROSS2: + $aPatternValue= 8; + $aDensity = 78; + break; + case PATTERN_CROSS3: + $aPatternValue= 8; + $aDensity = 65; + break; + case PATTERN_CROSS4: + $aPatternValue= 7; + $aDensity = 90; + break; + case PATTERN_STRIPE1: + $aPatternValue= 5; + $aDensity = 94; + break; + case PATTERN_STRIPE2: + $aPatternValue= 5; + $aDensity = 85; + break; + default: + JpGraphError::RaiseL(2002); + //('Unknown pattern specified in call to BarPlot::SetPattern()'); + } + } + + function Stroke($img,$xscale,$yscale) { + + $numpoints = count($this->coords[0]); + if( isset($this->coords[1]) ) { + if( count($this->coords[1])!=$numpoints ) { + JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); + //"Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])."Number of Y-points:$numpoints"); + } + else { + $exist_x = true; + } + } + else { + $exist_x = false; + } + + + $numbars=count($this->coords[0]); + + // Use GetMinVal() instead of scale[0] directly since in the case + // of log scale we get a correct value. Log scales will have negative + // values for values < 1 while still not representing negative numbers. + if( $yscale->GetMinVal() >= 0 ) + $zp=$yscale->scale_abs[0]; + else { + $zp=$yscale->Translate(0); + } + + if( $this->abswidth > -1 ) { + $abswidth=$this->abswidth; + } + else { + $abswidth=round($this->width*$xscale->scale_factor,0); + } + + // Count pontetial pattern array to avoid doing the count for each iteration + if( is_array($this->iPattern) ) { + $np = count($this->iPattern); + } + + $grad = null; + for($i=0; $i < $numbars; ++$i) { + + // If value is NULL, or 0 then don't draw a bar at all + if ($this->coords[0][$i] === null || $this->coords[0][$i] === '' ) + continue; + + if( $exist_x ) { + $x=$this->coords[1][$i]; + } + else { + $x=$i; + } + + $x=$xscale->Translate($x); + + // Comment Note: This confuses the positioning when using acc together with + // grouped bars. Workaround for fixing #191 + /* + if( !$xscale->textscale ) { + if($this->align=="center") + $x -= $abswidth/2; + elseif($this->align=="right") + $x -= $abswidth; + } + */ + // Stroke fill color and fill gradient + $pts=array( + $x,$zp, + $x,$yscale->Translate($this->coords[0][$i]), + $x+$abswidth,$yscale->Translate($this->coords[0][$i]), + $x+$abswidth,$zp); + if( $this->grad ) { + if( $grad === null ) { + $grad = new Gradient($img); + } + if( is_array($this->grad_fromcolor) ) { + // The first argument (grad_fromcolor) can be either an array or a single color. If it is an array + // then we have two choices. It can either a) be a single color specified as an RGB triple or it can be + // an array to specify both (from, to style) for each individual bar. The way to know the difference is + // to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB + // triple. + $ng = count($this->grad_fromcolor); + if( $ng === 3 ) { + if( is_numeric($this->grad_fromcolor[0]) && $this->grad_fromcolor[0] > 0 && $this->grad_fromcolor[0] < 256 ) { + // RGB Triple + $fromcolor = $this->grad_fromcolor; + $tocolor = $this->grad_tocolor; + $style = $this->grad_style; + } + else { + $fromcolor = $this->grad_fromcolor[$i % $ng][0]; + $tocolor = $this->grad_fromcolor[$i % $ng][1]; + $style = $this->grad_fromcolor[$i % $ng][2]; + } + } + else { + $fromcolor = $this->grad_fromcolor[$i % $ng][0]; + $tocolor = $this->grad_fromcolor[$i % $ng][1]; + $style = $this->grad_fromcolor[$i % $ng][2]; + } + $grad->FilledRectangle($pts[2],$pts[3], + $pts[6],$pts[7], + $fromcolor,$tocolor,$style); + } + else { + $grad->FilledRectangle($pts[2],$pts[3], + $pts[6],$pts[7], + $this->grad_fromcolor,$this->grad_tocolor,$this->grad_style); + } + } + elseif( !empty($this->fill_color) ) { + if(is_array($this->fill_color)) { + $img->PushColor($this->fill_color[$i % count($this->fill_color)]); + } else { + $img->PushColor($this->fill_color); + } + $img->FilledPolygon($pts); + $img->PopColor(); + } + +/////////////////////////kokorahen rectangle polygon////////////////////// + + // Remember value of this bar + $val=$this->coords[0][$i]; + + if( !empty($val) && !is_numeric($val) ) { + JpGraphError::RaiseL(2004,$i,$val); + //'All values for a barplot must be numeric. You have specified value['.$i.'] == \''.$val.'\''); + } + + // Determine the shadow + if( $this->bar_shadow && $val != 0) { + + $ssh = $this->bar_shadow_hsize; + $ssv = $this->bar_shadow_vsize; + // Create points to create a "upper-right" shadow + if( $val > 0 ) { + $sp[0]=$pts[6]; $sp[1]=$pts[7]; + $sp[2]=$pts[4]; $sp[3]=$pts[5]; + $sp[4]=$pts[2]; $sp[5]=$pts[3]; + $sp[6]=$pts[2]+$ssh; $sp[7]=$pts[3]-$ssv; + $sp[8]=$pts[4]+$ssh; $sp[9]=$pts[5]-$ssv; + $sp[10]=$pts[6]+$ssh; $sp[11]=$pts[7]-$ssv; + } + elseif( $val < 0 ) { + $sp[0]=$pts[4]; $sp[1]=$pts[5]; + $sp[2]=$pts[6]; $sp[3]=$pts[7]; + $sp[4]=$pts[0]; $sp[5]=$pts[1]; + $sp[6]=$pts[0]+$ssh; $sp[7]=$pts[1]-$ssv; + $sp[8]=$pts[6]+$ssh; $sp[9]=$pts[7]-$ssv; + $sp[10]=$pts[4]+$ssh; $sp[11]=$pts[5]-$ssv; + } + if( is_array($this->bar_shadow_color) ) { + $numcolors = count($this->bar_shadow_color); + if( $numcolors == 0 ) { + JpGraphError::RaiseL(2005);//('You have specified an empty array for shadow colors in the bar plot.'); + } + $img->PushColor($this->bar_shadow_color[$i % $numcolors]); + } + else { + $img->PushColor($this->bar_shadow_color); + } + $img->FilledPolygon($sp); + $img->PopColor(); + + } elseif( $this->bar_3d && $val != 0) { + // Determine the 3D + + $ssh = $this->bar_3d_hsize; + $ssv = $this->bar_3d_vsize; + + // Create points to create a "upper-right" shadow + if( $val > 0 ) { + $sp1[0]=$pts[6]; $sp1[1]=$pts[7]; + $sp1[2]=$pts[4]; $sp1[3]=$pts[5]; + $sp1[4]=$pts[4]+$ssh; $sp1[5]=$pts[5]-$ssv; + $sp1[6]=$pts[6]+$ssh; $sp1[7]=$pts[7]-$ssv; + + $sp2[0]=$pts[4]; $sp2[1]=$pts[5]; + $sp2[2]=$pts[2]; $sp2[3]=$pts[3]; + $sp2[4]=$pts[2]+$ssh; $sp2[5]=$pts[3]-$ssv; + $sp2[6]=$pts[4]+$ssh; $sp2[7]=$pts[5]-$ssv; + + } + elseif( $val < 0 ) { + $sp1[0]=$pts[4]; $sp1[1]=$pts[5]; + $sp1[2]=$pts[6]; $sp1[3]=$pts[7]; + $sp1[4]=$pts[6]+$ssh; $sp1[5]=$pts[7]-$ssv; + $sp1[6]=$pts[4]+$ssh; $sp1[7]=$pts[5]-$ssv; + + $sp2[0]=$pts[6]; $sp2[1]=$pts[7]; + $sp2[2]=$pts[0]; $sp2[3]=$pts[1]; + $sp2[4]=$pts[0]+$ssh; $sp2[5]=$pts[1]-$ssv; + $sp2[6]=$pts[6]+$ssh; $sp2[7]=$pts[7]-$ssv; + } + + $base_color = $this->fill_color; + + $img->PushColor($base_color . ':0.7'); + $img->FilledPolygon($sp1); + $img->PopColor(); + + $img->PushColor($base_color . ':1.1'); + $img->FilledPolygon($sp2); + $img->PopColor(); + } + + // Stroke the pattern + if( is_array($this->iPattern) ) { + $f = new RectPatternFactory(); + if( is_array($this->iPatternColor) ) { + $pcolor = $this->iPatternColor[$i % $np]; + } + else { + $pcolor = $this->iPatternColor; + } + $prect = $f->Create($this->iPattern[$i % $np],$pcolor,1); + $prect->SetDensity($this->iPatternDensity[$i % $np]); + + if( $val < 0 ) { + $rx = $pts[0]; + $ry = $pts[1]; + } + else { + $rx = $pts[2]; + $ry = $pts[3]; + } + $width = abs($pts[4]-$pts[0])+1; + $height = abs($pts[1]-$pts[3])+1; + $prect->SetPos(new Rectangle($rx,$ry,$width,$height)); + $prect->Stroke($img); + } + else { + if( $this->iPattern > -1 ) { + $f = new RectPatternFactory(); + $prect = $f->Create($this->iPattern,$this->iPatternColor,1); + $prect->SetDensity($this->iPatternDensity); + if( $val < 0 ) { + $rx = $pts[0]; + $ry = $pts[1]; + } + else { + $rx = $pts[2]; + $ry = $pts[3]; + } + $width = abs($pts[4]-$pts[0])+1; + $height = abs($pts[1]-$pts[3])+1; + $prect->SetPos(new Rectangle($rx,$ry,$width,$height)); + $prect->Stroke($img); + } + } + + // Stroke the outline of the bar + if( is_array($this->color) ) { + $img->SetColor($this->color[$i % count($this->color)]); + } + else { + $img->SetColor($this->color); + } + + $pts[] = $pts[0]; + $pts[] = $pts[1]; + + if( $this->weight > 0 ) { + $img->SetLineWeight($this->weight); + $img->Polygon($pts); + } + + // Determine how to best position the values of the individual bars + $x=$pts[2]+($pts[4]-$pts[2])/2; + $this->value->SetMargin(5); + + if( $this->valuepos=='top' ) { + $y=$pts[3]; + if( $img->a === 90 ) { + if( $val < 0 ) { + $this->value->SetAlign('right','center'); + } + else { + $this->value->SetAlign('left','center'); + } + + } + else { + if( $val < 0 ) { + $this->value->SetMargin(-5); + $y=$pts[1]; + $this->value->SetAlign('center','bottom'); + } + else { + $this->value->SetAlign('center','bottom'); + } + + } + $this->value->Stroke($img,$val,$x,$y); + } + elseif( $this->valuepos=='max' ) { + $y=$pts[3]; + if( $img->a === 90 ) { + if( $val < 0 ) + $this->value->SetAlign('left','center'); + else + $this->value->SetAlign('right','center'); + } + else { + if( $val < 0 ) { + $this->value->SetAlign('center','bottom'); + } + else { + $this->value->SetAlign('center','top'); + } + } + $this->value->SetMargin(-5); + $this->value->Stroke($img,$val,$x,$y); + } + elseif( $this->valuepos=='center' ) { + $y = ($pts[3] + $pts[1])/2; + $this->value->SetAlign('center','center'); + $this->value->SetMargin(0); + $this->value->Stroke($img,$val,$x,$y); + } + elseif( $this->valuepos=='bottom' || $this->valuepos=='min' ) { + $y=$pts[1]; + if( $img->a === 90 ) { + if( $val < 0 ) + $this->value->SetAlign('right','center'); + else + $this->value->SetAlign('left','center'); + } + $this->value->SetMargin(3); + $this->value->Stroke($img,$val,$x,$y); + } + else { + JpGraphError::RaiseL(2006,$this->valuepos); + //'Unknown position for values on bars :'.$this->valuepos); + } + // Create the client side image map + $rpts = $img->ArrRotate($pts); + $csimcoord=round($rpts[0]).", ".round($rpts[1]); + for( $j=1; $j < 4; ++$j){ + $csimcoord .= ", ".round($rpts[2*$j]).", ".round($rpts[2*$j+1]); + } + if( !empty($this->csimtargets[$i]) ) { + $this->csimareas .= 'csimareas .= " href=\"".htmlentities($this->csimtargets[$i])."\""; + + if( !empty($this->csimwintargets[$i]) ) { + $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; + } + + $sval=''; + if( !empty($this->csimalts[$i]) ) { + $sval=sprintf($this->csimalts[$i],$this->coords[0][$i]); + $this->csimareas .= " title=\"$sval\" alt=\"$sval\" "; + } + $this->csimareas .= " />\n"; + } + } + return true; + } +} // Class + +//=================================================== +// CLASS GroupBarPlot +// Description: Produce grouped bar plots +//=================================================== +class GroupBarPlot extends BarPlot { + public $plots; + private $nbrplots=0; + //--------------- + // CONSTRUCTOR + function GroupBarPlot($plots) { + $this->width=0.7; + $this->plots = $plots; + $this->nbrplots = count($plots); + if( $this->nbrplots < 1 ) { + JpGraphError::RaiseL(2007);//('Cannot create GroupBarPlot from empty plot array.'); + } + for($i=0; $i < $this->nbrplots; ++$i ) { + if( empty($this->plots[$i]) || !isset($this->plots[$i]) ) { + JpGraphError::RaiseL(2008,$i);//("Group bar plot element nbr $i is undefined or empty."); + } + } + $this->numpoints = $plots[0]->numpoints; + $this->width=0.7; + } + + //--------------- + // PUBLIC METHODS + function Legend($graph) { + $n = count($this->plots); + for($i=0; $i < $n; ++$i) { + $c = get_class($this->plots[$i]); + if( !($this->plots[$i] instanceof BarPlot) ) { + JpGraphError::RaiseL(2009,$c); + //('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the Group Bar plot from an array of BarPlot or AccBarPlot objects. (Class = '.$c.')'); + } + $this->plots[$i]->DoLegend($graph); + } + } + + function Min() { + list($xmin,$ymin) = $this->plots[0]->Min(); + $n = count($this->plots); + for($i=0; $i < $n; ++$i) { + list($xm,$ym) = $this->plots[$i]->Min(); + $xmin = max($xmin,$xm); + $ymin = min($ymin,$ym); + } + return array($xmin,$ymin); + } + + function Max() { + list($xmax,$ymax) = $this->plots[0]->Max(); + $n = count($this->plots); + for($i=0; $i < $n; ++$i) { + list($xm,$ym) = $this->plots[$i]->Max(); + $xmax = max($xmax,$xm); + $ymax = max($ymax,$ym); + } + return array($xmax,$ymax); + } + + function GetCSIMareas() { + $n = count($this->plots); + $csimareas=''; + for($i=0; $i < $n; ++$i) { + $csimareas .= $this->plots[$i]->csimareas; + } + return $csimareas; + } + + // Stroke all the bars next to each other + function Stroke($img,$xscale,$yscale) { + $tmp=$xscale->off; + $n = count($this->plots); + $subwidth = $this->width/$this->nbrplots ; + + for( $i=0; $i < $n; ++$i ) { + $this->plots[$i]->ymin=$this->ybase; + $this->plots[$i]->SetWidth($subwidth); + + // If the client have used SetTextTickInterval() then + // major_step will be > 1 and the positioning will fail. + // If we assume it is always one the positioning will work + // fine with a text scale but this will not work with + // arbitrary linear scale + $xscale->off = $tmp+$i*round($xscale->scale_factor* $subwidth); + $this->plots[$i]->Stroke($img,$xscale,$yscale); + } + $xscale->off=$tmp; + } +} // Class + +//=================================================== +// CLASS AccBarPlot +// Description: Produce accumulated bar plots +//=================================================== +class AccBarPlot extends BarPlot { + public $plots=null; + private $nbrplots=0; + //--------------- + // CONSTRUCTOR + function __construct($plots) { + $this->plots = $plots; + $this->nbrplots = count($plots); + if( $this->nbrplots < 1 ) { + JpGraphError::RaiseL(2010);//('Cannot create AccBarPlot from empty plot array.'); + } + for($i=0; $i < $this->nbrplots; ++$i ) { + if( empty($this->plots[$i]) || !isset($this->plots[$i]) ) { + JpGraphError::RaiseL(2011,$i);//("Acc bar plot element nbr $i is undefined or empty."); + } + } + + // We can only allow individual plost which do not have specified X-positions + for($i=0; $i < $this->nbrplots; ++$i ) { + if( !empty($this->plots[$i]->coords[1]) ) { + JpGraphError::RaiseL(2015); + //'Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-positions.'); + } + } + + // Use 0 weight by default which means that the individual bar + // weights will be used per part n the accumulated bar + $this->SetWeight(0); + + $this->numpoints = $plots[0]->numpoints; + $this->value = new DisplayValue(); + } + + //--------------- + // PUBLIC METHODS + function Legend($graph) { + $n = count($this->plots); + for( $i=$n-1; $i >= 0; --$i ) { + $c = get_class($this->plots[$i]); + if( !($this->plots[$i] instanceof BarPlot) ) { + JpGraphError::RaiseL(2012,$c); + //('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects.(Class='.$c.')'); + } + $this->plots[$i]->DoLegend($graph); + } + } + + function Max() { + list($xmax) = $this->plots[0]->Max(); + $nmax=0; + for($i=0; $i < count($this->plots); ++$i) { + $n = count($this->plots[$i]->coords[0]); + $nmax = max($nmax,$n); + list($x) = $this->plots[$i]->Max(); + $xmax = max($xmax,$x); + } + for( $i = 0; $i < $nmax; $i++ ) { + // Get y-value for bar $i by adding the + // individual bars from all the plots added. + // It would be wrong to just add the + // individual plots max y-value since that + // would in most cases give to large y-value. + $y=0; + if( !isset($this->plots[0]->coords[0][$i]) ) { + JpGraphError::RaiseL(2014); + } + if( $this->plots[0]->coords[0][$i] > 0 ) + $y=$this->plots[0]->coords[0][$i]; + for( $j = 1; $j < $this->nbrplots; $j++ ) { + if( !isset($this->plots[$j]->coords[0][$i]) ) { + JpGraphError::RaiseL(2014); + } + if( $this->plots[$j]->coords[0][$i] > 0 ) + $y += $this->plots[$j]->coords[0][$i]; + } + $ymax[$i] = $y; + } + $ymax = max($ymax); + + // Bar always start at baseline + if( $ymax <= $this->ybase ) + $ymax = $this->ybase; + return array($xmax,$ymax); + } + + function Min() { + $nmax=0; + list($xmin,$ysetmin) = $this->plots[0]->Min(); + for($i=0; $i < count($this->plots); ++$i) { + $n = count($this->plots[$i]->coords[0]); + $nmax = max($nmax,$n); + list($x,$y) = $this->plots[$i]->Min(); + $xmin = Min($xmin,$x); + $ysetmin = Min($y,$ysetmin); + } + for( $i = 0; $i < $nmax; $i++ ) { + // Get y-value for bar $i by adding the + // individual bars from all the plots added. + // It would be wrong to just add the + // individual plots max y-value since that + // would in most cases give to large y-value. + $y=0; + if( $this->plots[0]->coords[0][$i] < 0 ) + $y=$this->plots[0]->coords[0][$i]; + for( $j = 1; $j < $this->nbrplots; $j++ ) { + if( $this->plots[$j]->coords[0][$i] < 0 ) + $y += $this->plots[ $j ]->coords[0][$i]; + } + $ymin[$i] = $y; + } + $ymin = Min($ysetmin,Min($ymin)); + // Bar always start at baseline + if( $ymin >= $this->ybase ) + $ymin = $this->ybase; + return array($xmin,$ymin); + } + + // Stroke acc bar plot + function Stroke($img,$xscale,$yscale) { + $pattern=NULL; + $img->SetLineWeight($this->weight); + $grad=null; + for($i=0; $i < $this->numpoints-1; $i++) { + $accy = 0; + $accy_neg = 0; + for($j=0; $j < $this->nbrplots; ++$j ) { + $img->SetColor($this->plots[$j]->color); + + if ( $this->plots[$j]->coords[0][$i] >= 0) { + $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy); + $accyt=$yscale->Translate($accy); + $accy+=$this->plots[$j]->coords[0][$i]; + } + else { + //if ( $this->plots[$j]->coords[0][$i] < 0 || $accy_neg < 0 ) { + $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy_neg); + $accyt=$yscale->Translate($accy_neg); + $accy_neg+=$this->plots[$j]->coords[0][$i]; + } + + $xt=$xscale->Translate($i); + + if( $this->abswidth > -1 ) { + $abswidth=$this->abswidth; + } + else { + $abswidth=round($this->width*$xscale->scale_factor,0); + } + + $pts=array($xt,$accyt,$xt,$yt,$xt+$abswidth,$yt,$xt+$abswidth,$accyt); + + if( $this->bar_shadow ) { + $ssh = $this->bar_shadow_hsize; + $ssv = $this->bar_shadow_vsize; + + // We must also differ if we are a positive or negative bar. + if( $j === 0 ) { + // This gets extra complicated since we have to + // see all plots to see if we are negative. It could + // for example be that all plots are 0 until the very + // last one. We therefore need to save the initial setup + // for both the negative and positive case + + // In case the final bar is positive + $sp[0]=$pts[6]+1; $sp[1]=$pts[7]; + $sp[2]=$pts[6]+$ssh; $sp[3]=$pts[7]-$ssv; + + // In case the final bar is negative + $nsp[0]=$pts[0]; $nsp[1]=$pts[1]; + $nsp[2]=$pts[0]+$ssh; $nsp[3]=$pts[1]-$ssv; + $nsp[4]=$pts[6]+$ssh; $nsp[5]=$pts[7]-$ssv; + $nsp[10]=$pts[6]+1; $nsp[11]=$pts[7]; + } + + if( $j === $this->nbrplots-1 ) { + // If this is the last plot of the bar and + // the total value is larger than 0 then we + // add the shadow. + if( is_array($this->bar_shadow_color) ) { + $numcolors = count($this->bar_shadow_color); + if( $numcolors == 0 ) { + JpGraphError::RaiseL(2013);//('You have specified an empty array for shadow colors in the bar plot.'); + } + $img->PushColor($this->bar_shadow_color[$i % $numcolors]); + } + else { + $img->PushColor($this->bar_shadow_color); + } + + if( $accy > 0 ) { + $sp[4]=$pts[4]+$ssh; $sp[5]=$pts[5]-$ssv; + $sp[6]=$pts[2]+$ssh; $sp[7]=$pts[3]-$ssv; + $sp[8]=$pts[2]; $sp[9]=$pts[3]-1; + $sp[10]=$pts[4]+1; $sp[11]=$pts[5]; + $img->FilledPolygon($sp,4); + } + elseif( $accy_neg < 0 ) { + $nsp[6]=$pts[4]+$ssh; $nsp[7]=$pts[5]-$ssv; + $nsp[8]=$pts[4]+1; $nsp[9]=$pts[5]; + $img->FilledPolygon($nsp,4); + } + $img->PopColor(); + } + } + + + // If value is NULL or 0, then don't draw a bar at all + if ($this->plots[$j]->coords[0][$i] == 0 ) continue; + + if( $this->plots[$j]->grad ) { + if( $grad === null ) { + $grad = new Gradient($img); + } + if( is_array($this->plots[$j]->grad_fromcolor) ) { + // The first argument (grad_fromcolor) can be either an array or a single color. If it is an array + // then we have two choices. It can either a) be a single color specified as an RGB triple or it can be + // an array to specify both (from, to style) for each individual bar. The way to know the difference is + // to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB + // triple. + $ng = count($this->plots[$j]->grad_fromcolor); + if( $ng === 3 ) { + if( is_numeric($this->plots[$j]->grad_fromcolor[0]) && $this->plots[$j]->grad_fromcolor[0] > 0 && + $this->plots[$j]->grad_fromcolor[0] < 256 ) { + // RGB Triple + $fromcolor = $this->plots[$j]->grad_fromcolor; + $tocolor = $this->plots[$j]->grad_tocolor; + $style = $this->plots[$j]->grad_style; + } + else { + $fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0]; + $tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1]; + $style = $this->plots[$j]->grad_fromcolor[$i % $ng][2]; + } + } + else { + $fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0]; + $tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1]; + $style = $this->plots[$j]->grad_fromcolor[$i % $ng][2]; + } + $grad->FilledRectangle($pts[2],$pts[3], + $pts[6],$pts[7], + $fromcolor,$tocolor,$style); + } + else { + $grad->FilledRectangle($pts[2],$pts[3], + $pts[6],$pts[7], + $this->plots[$j]->grad_fromcolor, + $this->plots[$j]->grad_tocolor, + $this->plots[$j]->grad_style); + } + } else { + if (is_array($this->plots[$j]->fill_color) ) { + $numcolors = count($this->plots[$j]->fill_color); + $fillcolor = $this->plots[$j]->fill_color[$i % $numcolors]; + // If the bar is specified to be non filled then the fill color is false + if( $fillcolor !== false ) { + $img->SetColor($this->plots[$j]->fill_color[$i % $numcolors]); + } + } + else { + $fillcolor = $this->plots[$j]->fill_color; + if( $fillcolor !== false ) { + $img->SetColor($this->plots[$j]->fill_color); + } + } + if( $fillcolor !== false ) { + $img->FilledPolygon($pts); + } + } + + $img->SetColor($this->plots[$j]->color); + + // Stroke the pattern + if( $this->plots[$j]->iPattern > -1 ) { + if( $pattern===NULL ) { + $pattern = new RectPatternFactory(); + } + + $prect = $pattern->Create($this->plots[$j]->iPattern,$this->plots[$j]->iPatternColor,1); + $prect->SetDensity($this->plots[$j]->iPatternDensity); + if( $this->plots[$j]->coords[0][$i] < 0 ) { + $rx = $pts[0]; + $ry = $pts[1]; + } + else { + $rx = $pts[2]; + $ry = $pts[3]; + } + $width = abs($pts[4]-$pts[0])+1; + $height = abs($pts[1]-$pts[3])+1; + $prect->SetPos(new Rectangle($rx,$ry,$width,$height)); + $prect->Stroke($img); + } + + + // CSIM array + + if( $i < count($this->plots[$j]->csimtargets) ) { + // Create the client side image map + $rpts = $img->ArrRotate($pts); + $csimcoord=round($rpts[0]).", ".round($rpts[1]); + for( $k=1; $k < 4; ++$k){ + $csimcoord .= ", ".round($rpts[2*$k]).", ".round($rpts[2*$k+1]); + } + if( ! empty($this->plots[$j]->csimtargets[$i]) ) { + $this->csimareas.= 'csimareas.= " href=\"".$this->plots[$j]->csimtargets[$i]."\" "; + + if( ! empty($this->plots[$j]->csimwintargets[$i]) ) { + $this->csimareas.= " target=\"".$this->plots[$j]->csimwintargets[$i]."\" "; + } + + $sval=''; + if( !empty($this->plots[$j]->csimalts[$i]) ) { + $sval=sprintf($this->plots[$j]->csimalts[$i],$this->plots[$j]->coords[0][$i]); + $this->csimareas .= " title=\"$sval\" "; + } + $this->csimareas .= " alt=\"$sval\" />\n"; + } + } + + $pts[] = $pts[0]; + $pts[] = $pts[1]; + $img->SetLineWeight($this->plots[$j]->weight); + $img->Polygon($pts); + $img->SetLineWeight(1); + } + + // Daw potential bar around the entire accbar bar + if( $this->weight > 0 ) { + $y=$yscale->Translate(0); + $img->SetColor($this->color); + $img->SetLineWeight($this->weight); + $img->Rectangle($pts[0],$y,$pts[6],$pts[5]); + } + + // Draw labels for each acc.bar + + $x=$pts[2]+($pts[4]-$pts[2])/2; + if($this->bar_shadow) $x += $ssh; + + // First stroke the accumulated value for the entire bar + // This value is always placed at the top/bottom of the bars + if( $accy_neg < 0 ) { + $y=$yscale->Translate($accy_neg); + $this->value->Stroke($img,$accy_neg,$x,$y); + } + else { + $y=$yscale->Translate($accy); + $this->value->Stroke($img,$accy,$x,$y); + } + + $accy = 0; + $accy_neg = 0; + for($j=0; $j < $this->nbrplots; ++$j ) { + + // We don't print 0 values in an accumulated bar plot + if( $this->plots[$j]->coords[0][$i] == 0 ) continue; + + if ($this->plots[$j]->coords[0][$i] > 0) { + $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy); + $accyt=$yscale->Translate($accy); + if( $this->plots[$j]->valuepos=='center' ) { + $y = $accyt-($accyt-$yt)/2; + } + elseif( $this->plots[$j]->valuepos=='bottom' ) { + $y = $accyt; + } + else { // top or max + $y = $accyt-($accyt-$yt); + } + $accy+=$this->plots[$j]->coords[0][$i]; + if( $this->plots[$j]->valuepos=='center' ) { + $this->plots[$j]->value->SetAlign("center","center"); + $this->plots[$j]->value->SetMargin(0); + } + elseif( $this->plots[$j]->valuepos=='bottom' ) { + $this->plots[$j]->value->SetAlign('center','bottom'); + $this->plots[$j]->value->SetMargin(2); + } + else { + $this->plots[$j]->value->SetAlign('center','top'); + $this->plots[$j]->value->SetMargin(1); + } + } else { + $yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy_neg); + $accyt=$yscale->Translate($accy_neg); + $accy_neg+=$this->plots[$j]->coords[0][$i]; + if( $this->plots[$j]->valuepos=='center' ) { + $y = $accyt-($accyt-$yt)/2; + } + elseif( $this->plots[$j]->valuepos=='bottom' ) { + $y = $accyt; + } + else { + $y = $accyt-($accyt-$yt); + } + if( $this->plots[$j]->valuepos=='center' ) { + $this->plots[$j]->value->SetAlign("center","center"); + $this->plots[$j]->value->SetMargin(0); + } + elseif( $this->plots[$j]->valuepos=='bottom' ) { + $this->plots[$j]->value->SetAlign('center',$j==0 ? 'bottom':'top'); + $this->plots[$j]->value->SetMargin(-2); + } + else { + $this->plots[$j]->value->SetAlign('center','bottom'); + $this->plots[$j]->value->SetMargin(-1); + } + } + $this->plots[$j]->value->Stroke($img,$this->plots[$j]->coords[0][$i],$x,$y); + } + + } + return true; + } +} // Class + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_canvas.php b/includes/jpgraph/src/jpgraph_canvas.php new file mode 100644 index 0000000..eda1a74 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_canvas.php @@ -0,0 +1,95 @@ +StrokePlotArea(); + } + + // Method description + function Stroke($aStrokeFileName="") { + if( $this->texts != null ) { + for($i=0; $i < count($this->texts); ++$i) { + $this->texts[$i]->Stroke($this->img); + } + } + if( $this->iTables !== null ) { + for($i=0; $i < count($this->iTables); ++$i) { + $this->iTables[$i]->Stroke($this->img); + } + } + $this->StrokeTitles(); + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // a best we can. Therefor you will see a lot of tests !$_csim in the + // code below. + $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); + + // We need to know if we have stroked the plot in the + // GetCSIMareas. Otherwise the CSIM hasn't been generated + // and in the case of GetCSIM called before stroke to generate + // CSIM without storing an image to disk GetCSIM must call Stroke. + $this->iHasStroked = true; + + if( !$_csim ) { + + // Should we do any final image transformation + if( $this->iImgTrans ) { + if( !class_exists('ImgTrans',false) ) { + require_once('jpgraph_imgtrans.php'); + } + + $tform = new ImgTrans($this->img->img); + $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, + $this->iImgTransDirection,$this->iImgTransHighQ, + $this->iImgTransMinSize,$this->iImgTransFillColor, + $this->iImgTransBorder); + } + + + // If the filename is given as the special _IMG_HANDLER + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); + return true; + } + } + } +} // Class + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_canvtools.php b/includes/jpgraph/src/jpgraph_canvtools.php new file mode 100644 index 0000000..b11086d --- /dev/null +++ b/includes/jpgraph/src/jpgraph_canvtools.php @@ -0,0 +1,523 @@ +g = $graph; + $this->w = $graph->img->width; + $this->h = $graph->img->height; + $this->ixmin = $xmin; + $this->ixmax = $xmax; + $this->iymin = $ymin; + $this->iymax = $ymax; + } + + function Set($xmin=0,$xmax=10,$ymin=0,$ymax=10) { + $this->ixmin = $xmin; + $this->ixmax = $xmax; + $this->iymin = $ymin; + $this->iymax = $ymax; + } + + function Get() { + return array($this->ixmin,$this->ixmax,$this->iymin,$this->iymax); + } + + function Translate($x,$y) { + $xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w); + $yp = round(($y-$this->iymin)/($this->iymax - $this->iymin) * $this->h); + return array($xp,$yp); + } + + function TranslateX($x) { + $xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w); + return $xp; + } + + function TranslateY($y) { + $yp = round(($y-$this->iymin)/($this->iymax - $this->iymin) * $this->h); + return $yp; + } + +} + + +//=================================================== +// CLASS Shape +// Description: Methods to draw shapes on canvas +//=================================================== +class Shape { + private $img,$scale; + + function __construct($aGraph,$scale) { + $this->img = $aGraph->img; + $this->img->SetColor('black'); + $this->scale = $scale; + } + + function SetColor($aColor) { + $this->img->SetColor($aColor); + } + + function Line($x1,$y1,$x2,$y2) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + list($x2,$y2) = $this->scale->Translate($x2,$y2); + $this->img->Line($x1,$y1,$x2,$y2); + } + + function SetLineWeight($aWeight) { + $this->img->SetLineWeight($aWeight); + } + + function Polygon($p,$aClosed=false) { + $n=count($p); + for($i=0; $i < $n; $i+=2 ) { + $p[$i] = $this->scale->TranslateX($p[$i]); + $p[$i+1] = $this->scale->TranslateY($p[$i+1]); + } + $this->img->Polygon($p,$aClosed); + } + + function FilledPolygon($p) { + $n=count($p); + for($i=0; $i < $n; $i+=2 ) { + $p[$i] = $this->scale->TranslateX($p[$i]); + $p[$i+1] = $this->scale->TranslateY($p[$i+1]); + } + $this->img->FilledPolygon($p); + } + + + // Draw a bezier curve with defining points in the $aPnts array + // using $aSteps steps. + // 0=x0, 1=y0 + // 2=x1, 3=y1 + // 4=x2, 5=y2 + // 6=x3, 7=y3 + function Bezier($p,$aSteps=40) { + $x0 = $p[0]; + $y0 = $p[1]; + // Calculate coefficients + $cx = 3*($p[2]-$p[0]); + $bx = 3*($p[4]-$p[2])-$cx; + $ax = $p[6]-$p[0]-$cx-$bx; + $cy = 3*($p[3]-$p[1]); + $by = 3*($p[5]-$p[3])-$cy; + $ay = $p[7]-$p[1]-$cy-$by; + + // Step size + $delta = 1.0/$aSteps; + + $x_old = $x0; + $y_old = $y0; + for($t=$delta; $t<=1.0; $t+=$delta) { + $tt = $t*$t; $ttt=$tt*$t; + $x = $ax*$ttt + $bx*$tt + $cx*$t + $x0; + $y = $ay*$ttt + $by*$tt + $cy*$t + $y0; + $this->Line($x_old,$y_old,$x,$y); + $x_old = $x; + $y_old = $y; + } + $this->Line($x_old,$y_old,$p[6],$p[7]); + } + + function Rectangle($x1,$y1,$x2,$y2) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + list($x2,$y2) = $this->scale->Translate($x2,$y2); + $this->img->Rectangle($x1,$y1,$x2,$y2); + } + + function FilledRectangle($x1,$y1,$x2,$y2) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + list($x2,$y2) = $this->scale->Translate($x2,$y2); + $this->img->FilledRectangle($x1,$y1,$x2,$y2); + } + + function Circle($x1,$y1,$r) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + if( $r >= 0 ) + $r = $this->scale->TranslateX($r); + else + $r = -$r; + $this->img->Circle($x1,$y1,$r); + } + + function FilledCircle($x1,$y1,$r) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + if( $r >= 0 ) + $r = $this->scale->TranslateX($r); + else + $r = -$r; + $this->img->FilledCircle($x1,$y1,$r); + } + + function RoundedRectangle($x1,$y1,$x2,$y2,$r=null) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + list($x2,$y2) = $this->scale->Translate($x2,$y2); + + if( $r == null ) + $r = 5; + elseif( $r >= 0 ) + $r = $this->scale->TranslateX($r); + else + $r = -$r; + $this->img->RoundedRectangle($x1,$y1,$x2,$y2,$r); + } + + function FilledRoundedRectangle($x1,$y1,$x2,$y2,$r=null) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + list($x2,$y2) = $this->scale->Translate($x2,$y2); + + if( $r == null ) + $r = 5; + elseif( $r > 0 ) + $r = $this->scale->TranslateX($r); + else + $r = -$r; + $this->img->FilledRoundedRectangle($x1,$y1,$x2,$y2,$r); + } + + function ShadowRectangle($x1,$y1,$x2,$y2,$fcolor=false,$shadow_width=null,$shadow_color=array(102,102,102)) { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + list($x2,$y2) = $this->scale->Translate($x2,$y2); + if( $shadow_width == null ) + $shadow_width=4; + else + $shadow_width=$this->scale->TranslateX($shadow_width); + $this->img->ShadowRectangle($x1,$y1,$x2,$y2,$fcolor,$shadow_width,$shadow_color); + } + + function SetTextAlign($halign,$valign="bottom") { + $this->img->SetTextAlign($halign,$valign="bottom"); + } + + function StrokeText($x1,$y1,$txt,$dir=0,$paragraph_align="left") { + list($x1,$y1) = $this->scale->Translate($x1,$y1); + $this->img->StrokeText($x1,$y1,$txt,$dir,$paragraph_align); + } + + // A rounded rectangle where one of the corner has been moved "into" the + // rectangle 'iw' width and 'ih' height. Corners: + // 0=Top left, 1=top right, 2=bottom right, 3=bottom left + function IndentedRectangle($xt,$yt,$w,$h,$iw=0,$ih=0,$aCorner=3,$aFillColor="",$r=4) { + + list($xt,$yt) = $this->scale->Translate($xt,$yt); + list($w,$h) = $this->scale->Translate($w,$h); + list($iw,$ih) = $this->scale->Translate($iw,$ih); + + $xr = $xt + $w - 0; + $yl = $yt + $h - 0; + + switch( $aCorner ) { + case 0: // Upper left + + // Bottom line, left & right arc + $this->img->Line($xt+$r,$yl,$xr-$r,$yl); + $this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); + $this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); + + // Right line, Top right arc + $this->img->Line($xr,$yt+$r,$xr,$yl-$r); + $this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); + + // Top line, Top left arc + $this->img->Line($xt+$iw+$r,$yt,$xr-$r,$yt); + $this->img->Arc($xt+$iw+$r,$yt+$r,$r*2,$r*2,180,270); + + // Left line + $this->img->Line($xt,$yt+$ih+$r,$xt,$yl-$r); + + // Indent horizontal, Lower left arc + $this->img->Line($xt+$r,$yt+$ih,$xt+$iw-$r,$yt+$ih); + $this->img->Arc($xt+$r,$yt+$ih+$r,$r*2,$r*2,180,270); + + // Indent vertical, Indent arc + $this->img->Line($xt+$iw,$yt+$r,$xt+$iw,$yt+$ih-$r); + $this->img->Arc($xt+$iw-$r,$yt+$ih-$r,$r*2,$r*2,0,90); + + if( $aFillColor != '' ) { + $bc = $this->img->current_color_name; + $this->img->PushColor($aFillColor); + $this->img->FillToBorder($xr-$r,$yl-$r,$bc); + $this->img->PopColor(); + } + + break; + + case 1: // Upper right + + // Bottom line, left & right arc + $this->img->Line($xt+$r,$yl,$xr-$r,$yl); + $this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); + $this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); + + // Left line, Top left arc + $this->img->Line($xt,$yt+$r,$xt,$yl-$r); + $this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); + + // Top line, Top right arc + $this->img->Line($xt+$r,$yt,$xr-$iw-$r,$yt); + $this->img->Arc($xr-$iw-$r,$yt+$r,$r*2,$r*2,270,360); + + // Right line + $this->img->Line($xr,$yt+$ih+$r,$xr,$yl-$r); + + // Indent horizontal, Lower right arc + $this->img->Line($xr-$iw+$r,$yt+$ih,$xr-$r,$yt+$ih); + $this->img->Arc($xr-$r,$yt+$ih+$r,$r*2,$r*2,270,360); + + // Indent vertical, Indent arc + $this->img->Line($xr-$iw,$yt+$r,$xr-$iw,$yt+$ih-$r); + $this->img->Arc($xr-$iw+$r,$yt+$ih-$r,$r*2,$r*2,90,180); + + if( $aFillColor != '' ) { + $bc = $this->img->current_color_name; + $this->img->PushColor($aFillColor); + $this->img->FillToBorder($xt+$r,$yl-$r,$bc); + $this->img->PopColor(); + } + + break; + + case 2: // Lower right + // Top line, Top left & Top right arc + $this->img->Line($xt+$r,$yt,$xr-$r,$yt); + $this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); + $this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); + + // Left line, Bottom left arc + $this->img->Line($xt,$yt+$r,$xt,$yl-$r); + $this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); + + // Bottom line, Bottom right arc + $this->img->Line($xt+$r,$yl,$xr-$iw-$r,$yl); + $this->img->Arc($xr-$iw-$r,$yl-$r,$r*2,$r*2,0,90); + + // Right line + $this->img->Line($xr,$yt+$r,$xr,$yl-$ih-$r); + + // Indent horizontal, Lower right arc + $this->img->Line($xr-$r,$yl-$ih,$xr-$iw+$r,$yl-$ih); + $this->img->Arc($xr-$r,$yl-$ih-$r,$r*2,$r*2,0,90); + + // Indent vertical, Indent arc + $this->img->Line($xr-$iw,$yl-$r,$xr-$iw,$yl-$ih+$r); + $this->img->Arc($xr-$iw+$r,$yl-$ih+$r,$r*2,$r*2,180,270); + + if( $aFillColor != '' ) { + $bc = $this->img->current_color_name; + $this->img->PushColor($aFillColor); + $this->img->FillToBorder($xt+$r,$yt+$r,$bc); + $this->img->PopColor(); + } + + break; + + case 3: // Lower left + // Top line, Top left & Top right arc + $this->img->Line($xt+$r,$yt,$xr-$r,$yt); + $this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); + $this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); + + // Right line, Bottom right arc + $this->img->Line($xr,$yt+$r,$xr,$yl-$r); + $this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); + + // Bottom line, Bottom left arc + $this->img->Line($xt+$iw+$r,$yl,$xr-$r,$yl); + $this->img->Arc($xt+$iw+$r,$yl-$r,$r*2,$r*2,90,180); + + // Left line + $this->img->Line($xt,$yt+$r,$xt,$yl-$ih-$r); + + // Indent horizontal, Lower left arc + $this->img->Line($xt+$r,$yl-$ih,$xt+$iw-$r,$yl-$ih); + $this->img->Arc($xt+$r,$yl-$ih-$r,$r*2,$r*2,90,180); + + // Indent vertical, Indent arc + $this->img->Line($xt+$iw,$yl-$ih+$r,$xt+$iw,$yl-$r); + $this->img->Arc($xt+$iw-$r,$yl-$ih+$r,$r*2,$r*2,270,360); + + if( $aFillColor != '' ) { + $bc = $this->img->current_color_name; + $this->img->PushColor($aFillColor); + $this->img->FillToBorder($xr-$r,$yt+$r,$bc); + $this->img->PopColor(); + } + + break; + } + } +} + + +//=================================================== +// CLASS RectangleText +// Description: Draws a text paragraph inside a +// rounded, possible filled, rectangle. +//=================================================== +class CanvasRectangleText { + private $ix,$iy,$iw,$ih,$ir=4; + private $iTxt,$iColor='black',$iFillColor='',$iFontColor='black'; + private $iParaAlign='center'; + private $iAutoBoxMargin=5; + private $iShadowWidth=3,$iShadowColor=''; + + function __construct($aTxt='',$xl=0,$yt=0,$w=0,$h=0) { + $this->iTxt = new Text($aTxt); + $this->ix = $xl; + $this->iy = $yt; + $this->iw = $w; + $this->ih = $h; + } + + function SetShadow($aColor='gray',$aWidth=3) { + $this->iShadowColor = $aColor; + $this->iShadowWidth = $aWidth; + } + + function SetFont($FontFam,$aFontStyle,$aFontSize=12) { + $this->iTxt->SetFont($FontFam,$aFontStyle,$aFontSize); + } + + function SetTxt($aTxt) { + $this->iTxt->Set($aTxt); + } + + function ParagraphAlign($aParaAlign) { + $this->iParaAlign = $aParaAlign; + } + + function SetFillColor($aFillColor) { + $this->iFillColor = $aFillColor; + } + + function SetAutoMargin($aMargin) { + $this->iAutoBoxMargin=$aMargin; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function SetFontColor($aColor) { + $this->iFontColor = $aColor; + } + + function SetPos($xl=0,$yt=0,$w=0,$h=0) { + $this->ix = $xl; + $this->iy = $yt; + $this->iw = $w; + $this->ih = $h; + } + + function Pos($xl=0,$yt=0,$w=0,$h=0) { + $this->ix = $xl; + $this->iy = $yt; + $this->iw = $w; + $this->ih = $h; + } + + function Set($aTxt,$xl,$yt,$w=0,$h=0) { + $this->iTxt->Set($aTxt); + $this->ix = $xl; + $this->iy = $yt; + $this->iw = $w; + $this->ih = $h; + } + + function SetCornerRadius($aRad=5) { + $this->ir = $aRad; + } + + function Stroke($aImg,$scale) { + + // If coordinates are specifed as negative this means we should + // treat them as abolsute (pixels) coordinates + if( $this->ix > 0 ) { + $this->ix = $scale->TranslateX($this->ix) ; + } + else { + $this->ix = -$this->ix; + } + + if( $this->iy > 0 ) { + $this->iy = $scale->TranslateY($this->iy) ; + } + else { + $this->iy = -$this->iy; + } + + list($this->iw,$this->ih) = $scale->Translate($this->iw,$this->ih) ; + + if( $this->iw == 0 ) + $this->iw = round($this->iTxt->GetWidth($aImg) + $this->iAutoBoxMargin); + if( $this->ih == 0 ) { + $this->ih = round($this->iTxt->GetTextHeight($aImg) + $this->iAutoBoxMargin); + } + + if( $this->iShadowColor != '' ) { + $aImg->PushColor($this->iShadowColor); + $aImg->FilledRoundedRectangle($this->ix+$this->iShadowWidth, + $this->iy+$this->iShadowWidth, + $this->ix+$this->iw-1+$this->iShadowWidth, + $this->iy+$this->ih-1+$this->iShadowWidth, + $this->ir); + $aImg->PopColor(); + } + + if( $this->iFillColor != '' ) { + $aImg->PushColor($this->iFillColor); + $aImg->FilledRoundedRectangle($this->ix,$this->iy, + $this->ix+$this->iw-1, + $this->iy+$this->ih-1, + $this->ir); + $aImg->PopColor(); + } + + if( $this->iColor != '' ) { + $aImg->PushColor($this->iColor); + $aImg->RoundedRectangle($this->ix,$this->iy, + $this->ix+$this->iw-1, + $this->iy+$this->ih-1, + $this->ir); + $aImg->PopColor(); + } + + $this->iTxt->Align('center','center'); + $this->iTxt->ParagraphAlign($this->iParaAlign); + $this->iTxt->SetColor($this->iFontColor); + $this->iTxt->Stroke($aImg, $this->ix+$this->iw/2, $this->iy+$this->ih/2); + + return array($this->iw, $this->ih); + + } + +} + + +?> diff --git a/includes/jpgraph/src/jpgraph_contour.php b/includes/jpgraph/src/jpgraph_contour.php new file mode 100644 index 0000000..02e9030 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_contour.php @@ -0,0 +1,587 @@ +nbrRows = count($aMatrix); + $this->nbrCols = count($aMatrix[0]); + $this->dataPoints = $aMatrix; + + if( is_array($aIsobars) ) { + // use the isobar values supplied + $this->nbrIsobars = count($aIsobars); + $this->isobarValues = $aIsobars; + } + else { + // Determine the isobar values automatically + $this->nbrIsobars = $aIsobars; + list($min,$max) = $this->getMinMaxVal(); + $stepSize = ($max-$min) / $aIsobars ; + $isobar = $min+$stepSize/2; + for ($i = 0; $i < $aIsobars; $i++) { + $this->isobarValues[$i] = $isobar; + $isobar += $stepSize; + } + } + + if( $aColors !== null && count($aColors) > 0 ) { + + if( !is_array($aColors) ) { + JpGraphError::RaiseL(28001); + //'Third argument to Contour must be an array of colors.' + } + + if( count($aColors) != count($this->isobarValues) ) { + JpGraphError::RaiseL(28002); + //'Number of colors must equal the number of isobar lines specified'; + } + + $this->isobarColors = $aColors; + } + } + + /** + * Flip the plot around the Y-coordinate. This has the same affect as flipping the input + * data matrice + * + * @param $aFlg If true the the vertice in input data matrice position (0,0) corresponds to the top left + * corner of teh plot otherwise it will correspond to the bottom left corner (a horizontal flip) + */ + function SetInvert($aFlg=true) { + $this->invert = $aFlg; + } + + /** + * Find the min and max values in the data matrice + * + * @return array(min_value,max_value) + */ + function getMinMaxVal() { + $min = $this->dataPoints[0][0]; + $max = $this->dataPoints[0][0]; + for ($i = 0; $i < $this->nbrRows; $i++) { + if( ($mi=min($this->dataPoints[$i])) < $min ) $min = $mi; + if( ($ma=max($this->dataPoints[$i])) > $max ) $max = $ma; + } + return array($min,$max); + } + + /** + * Reset the two matrices that keeps track on where the isobars crosses the + * horizontal and vertical edges + */ + function resetEdgeMatrices() { + for ($k = 0; $k < 2; $k++) { + for ($i = 0; $i <= $this->nbrRows; $i++) { + for ($j = 0; $j <= $this->nbrCols; $j++) { + $this->edges[$k][$i][$j] = false; + } + } + } + } + + /** + * Determine if the specified isobar crosses the horizontal edge specified by its row and column + * + * @param $aRow Row index of edge to be checked + * @param $aCol Col index of edge to be checked + * @param $aIsobar Isobar value + * @return true if the isobar is crossing this edge + */ + function isobarHCrossing($aRow,$aCol,$aIsobar) { + + if( $aCol >= $this->nbrCols-1 ) { + JpGraphError::RaiseL(28003,$aCol); + //'ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)' + } + if( $aRow >= $this->nbrRows ) { + JpGraphError::RaiseL(28004,$aRow); + //'ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)' + } + + $v1 = $this->dataPoints[$aRow][$aCol]; + $v2 = $this->dataPoints[$aRow][$aCol+1]; + + return ($aIsobar-$v1)*($aIsobar-$v2) < 0 ; + + } + + /** + * Determine if the specified isobar crosses the vertical edge specified by its row and column + * + * @param $aRow Row index of edge to be checked + * @param $aCol Col index of edge to be checked + * @param $aIsobar Isobar value + * @return true if the isobar is crossing this edge + */ + function isobarVCrossing($aRow,$aCol,$aIsobar) { + + if( $aRow >= $this->nbrRows-1) { + JpGraphError::RaiseL(28005,$aRow); + //'isobarVCrossing: Row index too large + } + if( $aCol >= $this->nbrCols ) { + JpGraphError::RaiseL(28006,$aCol); + //'isobarVCrossing: Col index too large + } + + $v1 = $this->dataPoints[$aRow][$aCol]; + $v2 = $this->dataPoints[$aRow+1][$aCol]; + + return ($aIsobar-$v1)*($aIsobar-$v2) < 0 ; + + } + + /** + * Determine all edges, horizontal and vertical that the specified isobar crosses. The crossings + * are recorded in the two edge matrices. + * + * @param $aIsobar The value of the isobar to be checked + */ + function determineIsobarEdgeCrossings($aIsobar) { + + $ib = $this->isobarValues[$aIsobar]; + + for ($i = 0; $i < $this->nbrRows-1; $i++) { + for ($j = 0; $j < $this->nbrCols-1; $j++) { + $this->edges[HORIZ_EDGE][$i][$j] = $this->isobarHCrossing($i,$j,$ib); + $this->edges[VERT_EDGE][$i][$j] = $this->isobarVCrossing($i,$j,$ib); + } + } + + // We now have the bottom and rightmost edges unsearched + for ($i = 0; $i < $this->nbrRows-1; $i++) { + $this->edges[VERT_EDGE][$i][$j] = $this->isobarVCrossing($i,$this->nbrCols-1,$ib); + } + for ($j = 0; $j < $this->nbrCols-1; $j++) { + $this->edges[HORIZ_EDGE][$i][$j] = $this->isobarHCrossing($this->nbrRows-1,$j,$ib); + } + + } + + /** + * Return the normalized coordinates for the crossing of the specified edge with the specified + * isobar- The crossing is simpy detrmined with a linear interpolation between the two vertices + * on each side of the edge and the value of the isobar + * + * @param $aRow Row of edge + * @param $aCol Column of edge + * @param $aEdgeDir Determine if this is a horizontal or vertical edge + * @param $ib The isobar value + * @return unknown_type + */ + function getCrossingCoord($aRow,$aCol,$aEdgeDir,$aIsobarVal) { + + // In order to avoid numerical problem when two vertices are very close + // we have to check and avoid dividing by close to zero denumerator. + if( $aEdgeDir == HORIZ_EDGE ) { + $d = abs($this->dataPoints[$aRow][$aCol] - $this->dataPoints[$aRow][$aCol+1]); + if( $d > 0.001 ) { + $xcoord = $aCol + abs($aIsobarVal - $this->dataPoints[$aRow][$aCol]) / $d; + } + else { + $xcoord = $aCol; + } + $ycoord = $aRow; + } + else { + $d = abs($this->dataPoints[$aRow][$aCol] - $this->dataPoints[$aRow+1][$aCol]); + if( $d > 0.001 ) { + $ycoord = $aRow + abs($aIsobarVal - $this->dataPoints[$aRow][$aCol]) / $d; + } + else { + $ycoord = $aRow; + } + $xcoord = $aCol; + } + if( $this->invert ) { + $ycoord = $this->nbrRows-1 - $ycoord; + } + return array($xcoord,$ycoord); + + } + + /** + * In order to avoid all kinds of unpleasent extra checks and complex boundary + * controls for the degenerated case where the contour levels exactly crosses + * one of the vertices we add a very small delta (0.1%) to the data point value. + * This has no visible affect but it makes the code sooooo much cleaner. + * + */ + function adjustDataPointValues() { + + $ni = count($this->isobarValues); + for ($k = 0; $k < $ni; $k++) { + $ib = $this->isobarValues[$k]; + for ($row = 0 ; $row < $this->nbrRows-1; ++$row) { + for ($col = 0 ; $col < $this->nbrCols-1; ++$col ) { + if( abs($this->dataPoints[$row][$col] - $ib) < 0.0001 ) { + $this->dataPoints[$row][$col] += $this->dataPoints[$row][$col]*0.001; + } + } + } + } + + } + + /** + * @param $aFlg + * @param $aBW + * @return unknown_type + */ + function UseHighContrastColor($aFlg=true,$aBW=false) { + $this->highcontrast = $aFlg; + $this->highcontrastbw = $aBW; + } + + /** + * Calculate suitable colors for each defined isobar + * + */ + function CalculateColors() { + if ( $this->highcontrast ) { + if ( $this->highcontrastbw ) { + for ($ib = 0; $ib < $this->nbrIsobars; $ib++) { + $this->isobarColors[$ib] = 'black'; + } + } + else { + // Use only blue/red scale + $step = round(255/($this->nbrIsobars-1)); + for ($ib = 0; $ib < $this->nbrIsobars; $ib++) { + $this->isobarColors[$ib] = array($ib*$step, 50, 255-$ib*$step); + } + } + } + else { + $n = $this->nbrIsobars; + $v = 0; $step = 1 / ($this->nbrIsobars-1); + for ($ib = 0; $ib < $this->nbrIsobars; $ib++) { + $this->isobarColors[$ib] = RGB::GetSpectrum($v); + $v += $step; + } + } + } + + /** + * This is where the main work is done. For each isobar the crossing of the edges are determined + * and then each cell is analyzed to find the 0, 2 or 4 crossings. Then the normalized coordinate + * for the crossings are determined and pushed on to the isobar stack. When the method is finished + * the $isobarCoord will hold one arrayfor each isobar where all the line segments that makes + * up the contour plot are stored. + * + * @return array( $isobarCoord, $isobarValues, $isobarColors ) + */ + function getIsobars() { + + $this->adjustDataPointValues(); + + for ($isobar = 0; $isobar < $this->nbrIsobars; $isobar++) { + + $ib = $this->isobarValues[$isobar]; + $this->resetEdgeMatrices(); + $this->determineIsobarEdgeCrossings($isobar); + $this->isobarCoord[$isobar] = array(); + + $ncoord = 0; + + for ($row = 0 ; $row < $this->nbrRows-1; ++$row) { + for ($col = 0 ; $col < $this->nbrCols-1; ++$col ) { + + // Find out how many crossings around the edges + $n = 0; + if ( $this->edges[HORIZ_EDGE][$row][$col] ) $neigh[$n++] = array($row, $col, HORIZ_EDGE); + if ( $this->edges[HORIZ_EDGE][$row+1][$col] ) $neigh[$n++] = array($row+1,$col, HORIZ_EDGE); + if ( $this->edges[VERT_EDGE][$row][$col] ) $neigh[$n++] = array($row, $col, VERT_EDGE); + if ( $this->edges[VERT_EDGE][$row][$col+1] ) $neigh[$n++] = array($row, $col+1,VERT_EDGE); + + if ( $n == 2 ) { + $n1=0; $n2=1; + $this->isobarCoord[$isobar][$ncoord++] = array( + $this->getCrossingCoord($neigh[$n1][0],$neigh[$n1][1],$neigh[$n1][2],$ib), + $this->getCrossingCoord($neigh[$n2][0],$neigh[$n2][1],$neigh[$n2][2],$ib) ); + } + elseif ( $n == 4 ) { + // We must determine how to connect the edges either northwest->southeast or + // northeast->southwest. We do that by calculating the imaginary middle value of + // the cell by averaging the for corners. This will compared with the value of the + // top left corner will help determine the orientation of the ridge/creek + $midval = ($this->dataPoints[$row][$col]+$this->dataPoints[$row][$col+1]+$this->dataPoints[$row+1][$col]+$this->dataPoints[$row+1][$col+1])/4; + $v = $this->dataPoints[$row][$col]; + if( $midval == $ib ) { + // Orientation "+" + $n1=0; $n2=1; $n3=2; $n4=3; + } elseif ( ($midval > $ib && $v > $ib) || ($midval < $ib && $v < $ib) ) { + // Orientation of ridge/valley = "\" + $n1=0; $n2=3; $n3=2; $n4=1; + } elseif ( ($midval > $ib && $v < $ib) || ($midval < $ib && $v > $ib) ) { + // Orientation of ridge/valley = "/" + $n1=0; $n2=2; $n3=3; $n4=1; + } + + $this->isobarCoord[$isobar][$ncoord++] = array( + $this->getCrossingCoord($neigh[$n1][0],$neigh[$n1][1],$neigh[$n1][2],$ib), + $this->getCrossingCoord($neigh[$n2][0],$neigh[$n2][1],$neigh[$n2][2],$ib) ); + + $this->isobarCoord[$isobar][$ncoord++] = array( + $this->getCrossingCoord($neigh[$n3][0],$neigh[$n3][1],$neigh[$n3][2],$ib), + $this->getCrossingCoord($neigh[$n4][0],$neigh[$n4][1],$neigh[$n4][2],$ib) ); + + } + } + } + } + + if( count($this->isobarColors) == 0 ) { + // No manually specified colors. Calculate them automatically. + $this->CalculateColors(); + } + return array( $this->isobarCoord, $this->isobarValues, $this->isobarColors ); + } +} + + +/** + * This class represent a plotting of a contour outline of data given as a X-Y matrice + * + */ +class ContourPlot extends Plot { + + private $contour, $contourCoord, $contourVal, $contourColor; + private $nbrCountours = 0 ; + private $dataMatrix = array(); + private $invertLegend = false; + private $interpFactor = 1; + private $flipData = false; + private $isobar = 10; + private $showLegend = false; + private $highcontrast = false, $highcontrastbw = false; + private $manualIsobarColors = array(); + + /** + * Construct a contour plotting algorithm. The end result of the algorithm is a sequence of + * line segments for each isobar given as two vertices. + * + * @param $aDataMatrix The Z-data to be used + * @param $aIsobar A mixed variable, if it is an integer then this specified the number of isobars to use. + * The values of the isobars are automatically detrmined to be equ-spaced between the min/max value of the + * data. If it is an array then it explicetely gives the isobar values + * @param $aInvert By default the matrice with row index 0 corresponds to Y-value 0, i.e. in the bottom of + * the plot. If this argument is true then the row with the highest index in the matrice corresponds to + * Y-value 0. In affect flipping the matrice around an imaginary horizontal axis. + * @param $aHighContrast Use high contrast colors (blue/red:ish) + * @param $aHighContrastBW Use only black colors for contours + * @return an instance of the contour plot algorithm + */ + function __construct($aDataMatrix, $aIsobar=10, $aFactor=1, $aInvert=false, $aIsobarColors=array()) { + + $this->dataMatrix = $aDataMatrix; + $this->flipData = $aInvert; + $this->isobar = $aIsobar; + $this->interpFactor = $aFactor; + + if ( $this->interpFactor > 1 ) { + + if( $this->interpFactor > 5 ) { + JpGraphError::RaiseL(28007);// ContourPlot interpolation factor is too large (>5) + } + + $ip = new MeshInterpolate(); + $this->dataMatrix = $ip->Linear($this->dataMatrix, $this->interpFactor); + } + + $this->contour = new Contour($this->dataMatrix,$this->isobar,$aIsobarColors); + + if( is_array($aIsobar) ) + $this->nbrContours = count($aIsobar); + else + $this->nbrContours = $aIsobar; + } + + + /** + * Flipe the data around the center + * + * @param $aFlg + * + */ + function SetInvert($aFlg=true) { + $this->flipData = $aFlg; + } + + /** + * Set the colors for the isobar lines + * + * @param $aColorArray + * + */ + function SetIsobarColors($aColorArray) { + $this->manualIsobarColors = $aColorArray; + } + + /** + * Show the legend + * + * @param $aFlg true if the legend should be shown + * + */ + function ShowLegend($aFlg=true) { + $this->showLegend = $aFlg; + } + + + /** + * @param $aFlg true if the legend should start with the lowest isobar on top + * @return unknown_type + */ + function Invertlegend($aFlg=true) { + $this->invertLegend = $aFlg; + } + + /* Internal method. Give the min value to be used for the scaling + * + */ + function Min() { + return array(0,0); + } + + /* Internal method. Give the max value to be used for the scaling + * + */ + function Max() { + return array(count($this->dataMatrix[0])-1,count($this->dataMatrix)-1); + } + + /** + * Internal ramewrok method to setup the legend to be used for this plot. + * @param $aGraph The parent graph class + */ + function Legend($aGraph) { + + if( ! $this->showLegend ) + return; + + if( $this->invertLegend ) { + for ($i = 0; $i < $this->nbrContours; $i++) { + $aGraph->legend->Add(sprintf('%.1f',$this->contourVal[$i]), $this->contourColor[$i]); + } + } + else { + for ($i = $this->nbrContours-1; $i >= 0 ; $i--) { + $aGraph->legend->Add(sprintf('%.1f',$this->contourVal[$i]), $this->contourColor[$i]); + } + } + } + + + /** + * Framework function which gets called before the Stroke() method is called + * + * @see Plot#PreScaleSetup($aGraph) + * + */ + function PreScaleSetup($aGraph) { + $xn = count($this->dataMatrix[0])-1; + $yn = count($this->dataMatrix)-1; + + $aGraph->xaxis->scale->Update($aGraph->img,0,$xn); + $aGraph->yaxis->scale->Update($aGraph->img,0,$yn); + + $this->contour->SetInvert($this->flipData); + list($this->contourCoord,$this->contourVal,$this->contourColor) = $this->contour->getIsobars(); + } + + /** + * Use high contrast color schema + * + * @param $aFlg True, to use high contrast color + * @param $aBW True, Use only black and white color schema + */ + function UseHighContrastColor($aFlg=true,$aBW=false) { + $this->highcontrast = $aFlg; + $this->highcontrastbw = $aBW; + $this->contour->UseHighContrastColor($this->highcontrast,$this->highcontrastbw); + } + + /** + * Internal method. Stroke the contour plot to the graph + * + * @param $img Image handler + * @param $xscale Instance of the xscale to use + * @param $yscale Instance of the yscale to use + */ + function Stroke($img,$xscale,$yscale) { + + if( count($this->manualIsobarColors) > 0 ) { + $this->contourColor = $this->manualIsobarColors; + if( count($this->manualIsobarColors) != $this->nbrContours ) { + JpGraphError::RaiseL(28002); + } + } + + $img->SetLineWeight($this->line_weight); + + for ($c = 0; $c < $this->nbrContours; $c++) { + + $img->SetColor( $this->contourColor[$c] ); + + $n = count($this->contourCoord[$c]); + $i = 0; + while ( $i < $n ) { + list($x1,$y1) = $this->contourCoord[$c][$i][0]; + $x1t = $xscale->Translate($x1); + $y1t = $yscale->Translate($y1); + + list($x2,$y2) = $this->contourCoord[$c][$i++][1]; + $x2t = $xscale->Translate($x2); + $y2t = $yscale->Translate($y2); + + $img->Line($x1t,$y1t,$x2t,$y2t); + } + + } + } + +} + +// EOF +?> diff --git a/includes/jpgraph/src/jpgraph_date.php b/includes/jpgraph/src/jpgraph_date.php new file mode 100644 index 0000000..4d6cd79 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_date.php @@ -0,0 +1,499 @@ +type=$aType; + $this->scale=array($aMin,$aMax); + $this->world_size=$aMax-$aMin; + $this->ticks = new LinearTicks(); + $this->intscale=true; + } + + + //------------------------------------------------------------------------------------------ + // Utility Function AdjDate() + // Description: Will round a given time stamp to an even year, month or day + // argument. + //------------------------------------------------------------------------------------------ + + function AdjDate($aTime,$aRound=0,$aYearType=false,$aMonthType=false,$aDayType=false) { + $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); + $h=0;$i=0;$s=0; + if( $aYearType !== false ) { + $yearAdj = array(0=>1, 1=>2, 2=>5); + if( $aRound == 0 ) { + $y = floor($y/$yearAdj[$aYearType])*$yearAdj[$aYearType]; + } + else { + ++$y; + $y = ceil($y/$yearAdj[$aYearType])*$yearAdj[$aYearType]; + } + $m=1;$d=1; + } + elseif( $aMonthType !== false ) { + $monthAdj = array(0=>1, 1=>6); + if( $aRound == 0 ) { + $m = floor($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType]; + $d=1; + } + else { + ++$m; + $m = ceil($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType]; + $d=1; + } + } + elseif( $aDayType !== false ) { + if( $aDayType == 0 ) { + if( $aRound == 1 ) { + //++$d; + $h=23;$i=59;$s=59; + } + } + else { + // Adjust to an even week boundary. + $w = (int)date('w',$aTime); // Day of week 0=Sun, 6=Sat + if( true ) { // Adjust to start on Mon + if( $w==0 ) $w=6; + else --$w; + } + if( $aRound == 0 ) { + $d -= $w; + } + else { + $d += (7-$w); + $h=23;$i=59;$s=59; + } + } + } + return mktime($h,$i,$s,$m,$d,$y); + + } + + //------------------------------------------------------------------------------------------ + // Wrapper for AdjDate that will round a timestamp to an even date rounding + // it downwards. + //------------------------------------------------------------------------------------------ + function AdjStartDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) { + return $this->AdjDate($aTime,0,$aYearType,$aMonthType,$aDayType); + } + + //------------------------------------------------------------------------------------------ + // Wrapper for AdjDate that will round a timestamp to an even date rounding + // it upwards + //------------------------------------------------------------------------------------------ + function AdjEndDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) { + return $this->AdjDate($aTime,1,$aYearType,$aMonthType,$aDayType); + } + + //------------------------------------------------------------------------------------------ + // Utility Function AdjTime() + // Description: Will round a given time stamp to an even time according to + // argument. + //------------------------------------------------------------------------------------------ + + function AdjTime($aTime,$aRound=0,$aHourType=false,$aMinType=false,$aSecType=false) { + $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); + $h = (int)date('H',$aTime); $i = (int)date('i',$aTime); $s = (int)date('s',$aTime); + if( $aHourType !== false ) { + $aHourType %= 6; + $hourAdj = array(0=>1, 1=>2, 2=>3, 3=>4, 4=>6, 5=>12); + if( $aRound == 0 ) + $h = floor($h/$hourAdj[$aHourType])*$hourAdj[$aHourType]; + else { + if( ($h % $hourAdj[$aHourType]==0) && ($i > 0 || $s > 0) ) { + $h++; + } + $h = ceil($h/$hourAdj[$aHourType])*$hourAdj[$aHourType]; + if( $h >= 24 ) { + $aTime += 86400; + $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); + $h -= 24; + } + } + $i=0;$s=0; + } + elseif( $aMinType !== false ) { + $aMinType %= 5; + $minAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30); + if( $aRound == 0 ) { + $i = floor($i/$minAdj[$aMinType])*$minAdj[$aMinType]; + } + else { + if( ($i % $minAdj[$aMinType]==0) && $s > 0 ) { + $i++; + } + $i = ceil($i/$minAdj[$aMinType])*$minAdj[$aMinType]; + if( $i >= 60) { + $aTime += 3600; + $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); + $h = (int)date('H',$aTime); $i = 0; + } + } + $s=0; + } + elseif( $aSecType !== false ) { + $aSecType %= 5; + $secAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30); + if( $aRound == 0 ) { + $s = floor($s/$secAdj[$aSecType])*$secAdj[$aSecType]; + } + else { + $s = ceil($s/$secAdj[$aSecType]*1.0)*$secAdj[$aSecType]; + if( $s >= 60) { + $s=0; + $aTime += 60; + $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); + $h = (int)date('H',$aTime); $i = (int)date('i',$aTime); + } + } + } + return mktime($h,$i,$s,$m,$d,$y); + } + + //------------------------------------------------------------------------------------------ + // Wrapper for AdjTime that will round a timestamp to an even time rounding + // it downwards. + // Example: AdjStartTime(mktime(18,27,13,2,22,2005),false,2) => 18:20 + //------------------------------------------------------------------------------------------ + function AdjStartTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) { + return $this->AdjTime($aTime,0,$aHourType,$aMinType,$aSecType); + } + + //------------------------------------------------------------------------------------------ + // Wrapper for AdjTime that will round a timestamp to an even time rounding + // it upwards + // Example: AdjEndTime(mktime(18,27,13,2,22,2005),false,2) => 18:30 + //------------------------------------------------------------------------------------------ + function AdjEndTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) { + return $this->AdjTime($aTime,1,$aHourType,$aMinType,$aSecType); + } + + //------------------------------------------------------------------------------------------ + // DateAutoScale + // Autoscale a date axis given start and end time + // Returns an array ($start,$end,$major,$minor,$format) + //------------------------------------------------------------------------------------------ + function DoDateAutoScale($aStartTime,$aEndTime,$aDensity=0,$aAdjust=true) { + // Format of array + // array ( Decision point, array( array( Major-scale-step-array ), + // array( Minor-scale-step-array ), + // array( 0=date-adjust, 1=time-adjust, adjustment-alignment) ) + // + $scalePoints = + array( + /* Intervall larger than 10 years */ + SECPERYEAR*10,array(array(SECPERYEAR*5,SECPERYEAR*2), + array(SECPERYEAR), + array(0,YEARADJ_1, 0,YEARADJ_1) ), + + /* Intervall larger than 2 years */ + SECPERYEAR*2,array(array(SECPERYEAR),array(SECPERYEAR), + array(0,YEARADJ_1) ), + + /* Intervall larger than 90 days (approx 3 month) */ + SECPERDAY*90,array(array(SECPERDAY*30,SECPERDAY*14,SECPERDAY*7,SECPERDAY), + array(SECPERDAY*5,SECPERDAY*7,SECPERDAY,SECPERDAY), + array(0,MONTHADJ_1, 0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1)), + + /* Intervall larger than 30 days (approx 1 month) */ + SECPERDAY*30,array(array(SECPERDAY*14,SECPERDAY*7,SECPERDAY*2, SECPERDAY), + array(SECPERDAY,SECPERDAY,SECPERDAY,SECPERDAY), + array(0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1, 0,DAYADJ_1)), + + /* Intervall larger than 7 days */ + SECPERDAY*7,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2), + array(SECPERHOUR*6,SECPERHOUR*3,SECPERHOUR,SECPERHOUR), + array(0,DAYADJ_1, 1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1)), + + /* Intervall larger than 1 day */ + SECPERDAY,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR), + array(SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR,SECPERHOUR,SECPERHOUR), + array(1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1, 1,HOURADJ_1)), + + /* Intervall larger than 12 hours */ + SECPERHOUR*12,array(array(SECPERHOUR*2,SECPERHOUR,SECPERMIN*30,900,600), + array(1800,1800,900,300,300), + array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), + + /* Intervall larger than 2 hours */ + SECPERHOUR*2,array(array(SECPERHOUR,SECPERMIN*30,900,600,300), + array(1800,900,300,120,60), + array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), + + /* Intervall larger than 1 hours */ + SECPERHOUR,array(array(SECPERMIN*30,900,600,300),array(900,300,120,60), + array(1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), + + /* Intervall larger than 30 min */ + SECPERMIN*30,array(array(SECPERMIN*15,SECPERMIN*10,SECPERMIN*5,SECPERMIN), + array(300,300,60,10), + array(1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5, 1,MINADJ_1)), + + /* Intervall larger than 1 min */ + SECPERMIN,array(array(SECPERMIN,15,10,5), + array(15,5,2,1), + array(1,MINADJ_1, 1,SECADJ_15, 1,SECADJ_10, 1,SECADJ_5)), + + /* Intervall larger than 10 sec */ + 10,array(array(5,2), + array(1,1), + array(1,SECADJ_5, 1,SECADJ_1)), + + /* Intervall larger than 1 sec */ + 1,array(array(1), + array(1), + array(1,SECADJ_1)), + ); + + $ns = count($scalePoints); + // Establish major and minor scale units for the date scale + $diff = $aEndTime - $aStartTime; + if( $diff < 1 ) return false; + $done=false; + $i=0; + while( ! $done ) { + if( $diff > $scalePoints[2*$i] ) { + // Get major and minor scale for this intervall + $scaleSteps = $scalePoints[2*$i+1]; + $major = $scaleSteps[0][min($aDensity,count($scaleSteps[0])-1)]; + // Try to find out which minor step looks best + $minor = $scaleSteps[1][min($aDensity,count($scaleSteps[1])-1)]; + if( $aAdjust ) { + // Find out how we should align the start and end timestamps + $idx = 2*min($aDensity,floor(count($scaleSteps[2])/2)-1); + if( $scaleSteps[2][$idx] === 0 ) { + // Use date adjustment + $adj = $scaleSteps[2][$idx+1]; + if( $adj >= 30 ) { + $start = $this->AdjStartDate($aStartTime,$adj-30); + $end = $this->AdjEndDate($aEndTime,$adj-30); + } + elseif( $adj >= 20 ) { + $start = $this->AdjStartDate($aStartTime,false,$adj-20); + $end = $this->AdjEndDate($aEndTime,false,$adj-20); + } + else { + $start = $this->AdjStartDate($aStartTime,false,false,$adj); + $end = $this->AdjEndDate($aEndTime,false,false,$adj); + // We add 1 second for date adjustment to make sure we end on 00:00 the following day + // This makes the final major tick be srawn when we step day-by-day instead of ending + // on xx:59:59 which would not draw the final major tick + $end++; + } + } + else { + // Use time adjustment + $adj = $scaleSteps[2][$idx+1]; + if( $adj >= 30 ) { + $start = $this->AdjStartTime($aStartTime,$adj-30); + $end = $this->AdjEndTime($aEndTime,$adj-30); + } + elseif( $adj >= 20 ) { + $start = $this->AdjStartTime($aStartTime,false,$adj-20); + $end = $this->AdjEndTime($aEndTime,false,$adj-20); + } + else { + $start = $this->AdjStartTime($aStartTime,false,false,$adj); + $end = $this->AdjEndTime($aEndTime,false,false,$adj); + } + } + } + // If the overall date span is larger than 1 day ten we show date + $format = ''; + if( ($end-$start) > SECPERDAY ) { + $format = 'Y-m-d '; + } + // If the major step is less than 1 day we need to whow hours + min + if( $major < SECPERDAY ) { + $format .= 'H:i'; + } + // If the major step is less than 1 min we need to show sec + if( $major < 60 ) { + $format .= ':s'; + } + $done=true; + } + ++$i; + } + return array($start,$end,$major,$minor,$format); + } + + // Overrides the automatic determined date format. Must be a valid date() format string + function SetDateFormat($aFormat) { + $this->date_format = $aFormat; + $this->ticks->SetLabelDateFormat($this->date_format); + } + + function AdjustForDST($aFlg=true) { + $this->ticks->AdjustForDST($aFlg); + } + + + function SetDateAlign($aStartAlign,$aEndAlign=false) { + if( $aEndAlign === false ) { + $aEndAlign=$aStartAlign; + } + $this->iStartAlign = $aStartAlign; + $this->iEndAlign = $aEndAlign; + } + + function SetTimeAlign($aStartAlign,$aEndAlign=false) { + if( $aEndAlign === false ) { + $aEndAlign=$aStartAlign; + } + $this->iStartTimeAlign = $aStartAlign; + $this->iEndTimeAlign = $aEndAlign; + } + + + function AutoScale($img,$aStartTime,$aEndTime,$aNumSteps,$_adummy=false) { + // We need to have one dummy argument to make the signature of AutoScale() + // identical to LinearScale::AutoScale + if( $aStartTime == $aEndTime ) { + // Special case when we only have one data point. + // Create a small artifical intervall to do the autoscaling + $aStartTime -= 10; + $aEndTime += 10; + } + $done=false; + $i=0; + while( ! $done && $i < 5) { + list($adjstart,$adjend,$maj,$min,$format) = $this->DoDateAutoScale($aStartTime,$aEndTime,$i); + $n = floor(($adjend-$adjstart)/$maj); + if( $n * 1.7 > $aNumSteps ) { + $done=true; + } + $i++; + } + + /* + if( 0 ) { // DEBUG + echo " Start =".date("Y-m-d H:i:s",$aStartTime)."
"; + echo " End =".date("Y-m-d H:i:s",$aEndTime)."
"; + echo "Adj Start =".date("Y-m-d H:i:s",$adjstart)."
"; + echo "Adj End =".date("Y-m-d H:i:s",$adjend)."

"; + echo "Major = $maj s, ".floor($maj/60)."min, ".floor($maj/3600)."h, ".floor($maj/86400)."day
"; + echo "Min = $min s, ".floor($min/60)."min, ".floor($min/3600)."h, ".floor($min/86400)."day
"; + echo "Format=$format

"; + } + */ + + if( $this->iStartTimeAlign !== false && $this->iStartAlign !== false ) { + JpGraphError::RaiseL(3001); + //('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both'); + } + + if( $this->iStartTimeAlign !== false ) { + if( $this->iStartTimeAlign >= 30 ) { + $adjstart = $this->AdjStartTime($aStartTime,$this->iStartTimeAlign-30); + } + elseif( $this->iStartTimeAlign >= 20 ) { + $adjstart = $this->AdjStartTime($aStartTime,false,$this->iStartTimeAlign-20); + } + else { + $adjstart = $this->AdjStartTime($aStartTime,false,false,$this->iStartTimeAlign); + } + } + if( $this->iEndTimeAlign !== false ) { + if( $this->iEndTimeAlign >= 30 ) { + $adjend = $this->AdjEndTime($aEndTime,$this->iEndTimeAlign-30); + } + elseif( $this->iEndTimeAlign >= 20 ) { + $adjend = $this->AdjEndTime($aEndTime,false,$this->iEndTimeAlign-20); + } + else { + $adjend = $this->AdjEndTime($aEndTime,false,false,$this->iEndTimeAlign); + } + } + + + + if( $this->iStartAlign !== false ) { + if( $this->iStartAlign >= 30 ) { + $adjstart = $this->AdjStartDate($aStartTime,$this->iStartAlign-30); + } + elseif( $this->iStartAlign >= 20 ) { + $adjstart = $this->AdjStartDate($aStartTime,false,$this->iStartAlign-20); + } + else { + $adjstart = $this->AdjStartDate($aStartTime,false,false,$this->iStartAlign); + } + } + if( $this->iEndAlign !== false ) { + if( $this->iEndAlign >= 30 ) { + $adjend = $this->AdjEndDate($aEndTime,$this->iEndAlign-30); + } + elseif( $this->iEndAlign >= 20 ) { + $adjend = $this->AdjEndDate($aEndTime,false,$this->iEndAlign-20); + } + else { + $adjend = $this->AdjEndDate($aEndTime,false,false,$this->iEndAlign); + } + } + $this->Update($img,$adjstart,$adjend); + if( ! $this->ticks->IsSpecified() ) + $this->ticks->Set($maj,$min); + if( $this->date_format == '' ) + $this->ticks->SetLabelDateFormat($format); + else + $this->ticks->SetLabelDateFormat($this->date_format); + } +} + + +?> diff --git a/includes/jpgraph/src/jpgraph_errhandler.inc.php b/includes/jpgraph/src/jpgraph_errhandler.inc.php new file mode 100644 index 0000000..c15361e --- /dev/null +++ b/includes/jpgraph/src/jpgraph_errhandler.inc.php @@ -0,0 +1,369 @@ +lt = $_jpg_messages; + } + + function Get($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { + GLOBAL $__jpg_err_locale; + if( !isset($this->lt[$errnbr]) ) { + return 'Internal error: The specified error message ('.$errnbr.') does not exist in the chosen locale ('.$__jpg_err_locale.')'; + } + $ea = $this->lt[$errnbr]; + $j=0; + if( $a1 !== null ) { + $argv[$j++] = $a1; + if( $a2 !== null ) { + $argv[$j++] = $a2; + if( $a3 !== null ) { + $argv[$j++] = $a3; + if( $a4 !== null ) { + $argv[$j++] = $a4; + if( $a5 !== null ) { + $argv[$j++] = $a5; + } + } + } + } + } + $numargs = $j; + if( $ea[1] != $numargs ) { + // Error message argument count do not match. + // Just return the error message without arguments. + return $ea[0]; + } + switch( $numargs ) { + case 1: + $msg = sprintf($ea[0],$argv[0]); + break; + case 2: + $msg = sprintf($ea[0],$argv[0],$argv[1]); + break; + case 3: + $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2]); + break; + case 4: + $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3]); + break; + case 5: + $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3],$argv[4]); + break; + case 0: + default: + $msg = sprintf($ea[0]); + break; + } + return $msg; + } +} + +// +// A wrapper class that is used to access the specified error object +// (to hide the global error parameter and avoid having a GLOBAL directive +// in all methods. +// +class JpGraphError { + private static $__iImgFlg = true; + private static $__iLogFile = ''; + private static $__iTitle = 'JpGraph Error: '; + public static function Raise($aMsg,$aHalt=true){ + throw new JpGraphException($aMsg); + } + public static function SetErrLocale($aLoc) { + GLOBAL $__jpg_err_locale ; + $__jpg_err_locale = $aLoc; + } + public static function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { + throw new JpGraphExceptionL($errnbr,$a1,$a2,$a3,$a4,$a5); + } + public static function SetImageFlag($aFlg=true) { + self::$__iImgFlg = $aFlg; + } + public static function GetImageFlag() { + return self::$__iImgFlg; + } + public static function SetLogFile($aFile) { + self::$__iLogFile = $aFile; + } + public static function GetLogFile() { + return self::$__iLogFile; + } + public static function SetTitle($aTitle) { + self::$__iTitle = $aTitle; + } + public static function GetTitle() { + return self::$__iTitle; + } +} + +class JpGraphException extends Exception { + // Redefine the exception so message isn't optional + public function __construct($message, $code = 0) { + // make sure everything is assigned properly + parent::__construct($message, $code); + } + // custom string representation of object + public function _toString() { + return __CLASS__ . ": [{$this->code}]: {$this->message} at " . basename($this->getFile()) . ":" . $this->getLine() . "\n" . $this->getTraceAsString() . "\n"; + } + // custom representation of error as an image + public function Stroke() { + if( JpGraphError::GetImageFlag() ) { + $errobj = new JpGraphErrObjectImg(); + $errobj->SetTitle(JpGraphError::GetTitle()); + } + else { + $errobj = new JpGraphErrObject(); + $errobj->SetTitle(JpGraphError::GetTitle()); + $errobj->SetStrokeDest(JpGraphError::GetLogFile()); + } + $errobj->Raise($this->getMessage()); + } + static public function defaultHandler(Exception $exception) { + global $__jpg_OldHandler; + if( $exception instanceof JpGraphException ) { + $exception->Stroke(); + } + else { + // Restore old handler + if( $__jpg_OldHandler !== NULL ) { + set_exception_handler($__jpg_OldHandler); + } + throw $exception; + } + } +} + +class JpGraphExceptionL extends JpGraphException { + // Redefine the exception so message isn't optional + public function __construct($errcode,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { + // make sure everything is assigned properly + $errtxt = new ErrMsgText(); + JpGraphError::SetTitle('JpGraph Error: '.$errcode); + parent::__construct($errtxt->Get($errcode,$a1,$a2,$a3,$a4,$a5), 0); + } +} + +// Setup the default handler +global $__jpg_OldHandler; +$__jpg_OldHandler = set_exception_handler(array('JpGraphException','defaultHandler')); + +// +// First of all set up a default error handler +// + +//============================================================= +// The default trivial text error handler. +//============================================================= +class JpGraphErrObject { + + protected $iTitle = "JpGraph error: "; + protected $iDest = false; + + + function __construct() { + // Empty. Reserved for future use + } + + function SetTitle($aTitle) { + $this->iTitle = $aTitle; + } + + function SetStrokeDest($aDest) { + $this->iDest = $aDest; + } + + // If aHalt is true then execution can't continue. Typical used for fatal errors + function Raise($aMsg,$aHalt=false) { + if( $this->iDest != '' ) { + if( $this->iDest == 'syslog' ) { + error_log($this->iTitle.$aMsg); + } + else { + $str = '['.date('r').'] '.$this->iTitle.$aMsg."\n"; + $f = @fopen($this->iDest,'a'); + if( $f ) { + @fwrite($f,$str); + @fclose($f); + } + } + } + else { + $aMsg = $this->iTitle.$aMsg; + // Check SAPI and if we are called from the command line + // send the error to STDERR instead + if( PHP_SAPI == 'cli' ) { + fwrite(STDERR,$aMsg); + } + else { + echo $aMsg; + } + } + if( $aHalt ) + exit(1); + } +} + +//============================================================== +// An image based error handler +//============================================================== +class JpGraphErrObjectImg extends JpGraphErrObject { + + function __construct() { + parent::__construct(); + // Empty. Reserved for future use + } + + function Raise($aMsg,$aHalt=true) { + $img_iconerror = + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV'. + 'BMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'. + 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpY'. + 'iYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'. + 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. + 'IAAAsSAdLdfvwAAAAHdElNRQfTBgISOCqusfs5AAABLUlEQVR4'. + '2tWV3XKCMBBGWfkranCIVClKLd/7P2Q3QsgCxjDTq+6FE2cPH+'. + 'xJ0Ogn2lQbsT+Wrs+buAZAV4W5T6Bs0YXBBwpKgEuIu+JERAX6'. + 'wM2rHjmDdEITmsQEEmWADgZm6rAjhXsoMGY9B/NZBwJzBvn+e3'. + 'wHntCAJdGu9SviwIwoZVDxPB9+Rc0TSEbQr0j3SA1gwdSn6Db0'. + '6Tm1KfV6yzWGQO7zdpvyKLKBDmRFjzeB3LYgK7r6A/noDAfjtS'. + 'IXaIzbJSv6WgUebTMV4EoRB8a2mQiQjgtF91HdKDKZ1gtFtQjk'. + 'YcWaR5OKOhkYt+ZsTFdJRfPAApOpQYJTNHvCRSJR6SJngQadfc'. + 'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx'. + 'qL72fwAAAABJRU5ErkJggg==' ; + + + if( function_exists("imagetypes") ) { + $supported = imagetypes(); + } else { + $supported = 0; + } + + if( !function_exists('imagecreatefromstring') ) { + $supported = 0; + } + + if( ob_get_length() || headers_sent() || !($supported & IMG_PNG) ) { + // Special case for headers already sent or that the installation doesn't support + // the PNG format (which the error icon is encoded in). + // Dont return an image since it can't be displayed + die($this->iTitle.' '.$aMsg); + } + + $aMsg = wordwrap($aMsg,55); + $lines = substr_count($aMsg,"\n"); + + // Create the error icon GD + $erricon = Image::CreateFromString(base64_decode($img_iconerror)); + + // Create an image that contains the error text. + $w=400; + $h=100 + 15*max(0,$lines-3); + + $img = new Image($w,$h); + + + // Drop shadow + $img->SetColor("gray"); + $img->FilledRectangle(5,5,$w-1,$h-1,10); + $img->SetColor("gray:0.7"); + $img->FilledRectangle(5,5,$w-3,$h-3,10); + + // Window background + $img->SetColor("lightblue"); + $img->FilledRectangle(1,1,$w-5,$h-5); + $img->CopyCanvasH($img->img,$erricon,5,30,0,0,40,40); + + // Window border + $img->SetColor("black"); + $img->Rectangle(1,1,$w-5,$h-5); + $img->Rectangle(0,0,$w-4,$h-4); + + // Window top row + $img->SetColor("darkred"); + for($y=3; $y < 18; $y += 2 ) + $img->Line(1,$y,$w-6,$y); + + // "White shadow" + $img->SetColor("white"); + + // Left window edge + $img->Line(2,2,2,$h-5); + $img->Line(2,2,$w-6,2); + + // "Gray button shadow" + $img->SetColor("darkgray"); + + // Gray window shadow + $img->Line(2,$h-6,$w-5,$h-6); + $img->Line(3,$h-7,$w-5,$h-7); + + // Window title + $m = floor($w/2-5); + $l = 110; + $img->SetColor("lightgray:1.3"); + $img->FilledRectangle($m-$l,2,$m+$l,16); + + // Stroke text + $img->SetColor("darkred"); + $img->SetFont(FF_FONT2,FS_BOLD); + $img->StrokeText($m-90,15,$this->iTitle); + $img->SetColor("black"); + $img->SetFont(FF_FONT1,FS_NORMAL); + $txt = new Text($aMsg,52,25); + $txt->SetFont(FF_FONT1); + $txt->Align("left","top"); + $txt->Stroke($img); + if ($this->iDest) { + $img->Stream($this->iDest); + } else { + $img->Headers(); + $img->Stream(); + } + if( $aHalt ) + die(); + } +} + + + +if( ! USE_IMAGE_ERROR_HANDLER ) { + JpGraphError::SetImageFlag(false); +} +?> diff --git a/includes/jpgraph/src/jpgraph_error.php b/includes/jpgraph/src/jpgraph_error.php new file mode 100644 index 0000000..255a52f --- /dev/null +++ b/includes/jpgraph/src/jpgraph_error.php @@ -0,0 +1,157 @@ +numpoints /= 2; + } + //--------------- + // PUBLIC METHODS + + // Gets called before any axis are stroked + function PreStrokeAdjust($graph) { + if( $this->center ) { + $a=0.5; $b=0.5; + ++$this->numpoints; + } else { + $a=0; $b=0; + } + $graph->xaxis->scale->ticks->SetXLabelOffset($a); + $graph->SetTextScaleOff($b); + //$graph->xaxis->scale->ticks->SupressMinorTickMarks(); + } + + // Method description + function Stroke($img,$xscale,$yscale) { + $numpoints=count($this->coords[0])/2; + $img->SetColor($this->color); + $img->SetLineWeight($this->weight); + + if( isset($this->coords[1]) ) { + if( count($this->coords[1])!=$numpoints ) + JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); + //("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); + else + $exist_x = true; + } + else + $exist_x = false; + + for( $i=0; $i<$numpoints; ++$i) { + if( $exist_x ) + $x=$this->coords[1][$i]; + else + $x=$i; + + if( !is_numeric($x) || + !is_numeric($this->coords[0][$i*2]) || !is_numeric($this->coords[0][$i*2+1]) ) { + continue; + } + + $xt = $xscale->Translate($x); + $yt1 = $yscale->Translate($this->coords[0][$i*2]); + $yt2 = $yscale->Translate($this->coords[0][$i*2+1]); + $img->Line($xt,$yt1,$xt,$yt2); + $img->Line($xt-$this->errwidth,$yt1,$xt+$this->errwidth,$yt1); + $img->Line($xt-$this->errwidth,$yt2,$xt+$this->errwidth,$yt2); + } + return true; + } +} // Class + + +//=================================================== +// CLASS ErrorLinePlot +// Description: Combine a line and error plot +// THIS IS A DEPRECATED PLOT TYPE JUST KEPT FOR +// BACKWARD COMPATIBILITY +//=================================================== +class ErrorLinePlot extends ErrorPlot { + public $line=null; + //--------------- + // CONSTRUCTOR + function __construct($datay,$datax=false) { + parent::__construct($datay,$datax); + // Calculate line coordinates as the average of the error limits + $n = count($datay); + for($i=0; $i < $n; $i+=2 ) { + $ly[]=($datay[$i]+$datay[$i+1])/2; + } + $this->line=new LinePlot($ly,$datax); + } + + //--------------- + // PUBLIC METHODS + function Legend($graph) { + if( $this->legend != "" ) + $graph->legend->Add($this->legend,$this->color); + $this->line->Legend($graph); + } + + function Stroke($img,$xscale,$yscale) { + parent::Stroke($img,$xscale,$yscale); + $this->line->Stroke($img,$xscale,$yscale); + } +} // Class + + +//=================================================== +// CLASS LineErrorPlot +// Description: Combine a line and error plot +//=================================================== +class LineErrorPlot extends ErrorPlot { + public $line=null; + //--------------- + // CONSTRUCTOR + // Data is (val, errdeltamin, errdeltamax) + function __construct($datay,$datax=false) { + $ly=array(); $ey=array(); + $n = count($datay); + if( $n % 3 != 0 ) { + JpGraphError::RaiseL(4002); + //('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3'); + } + for($i=0; $i < $n; $i+=3 ) { + $ly[]=$datay[$i]; + $ey[]=$datay[$i]+$datay[$i+1]; + $ey[]=$datay[$i]+$datay[$i+2]; + } + parent::__construct($ey,$datax); + $this->line=new LinePlot($ly,$datax); + } + + //--------------- + // PUBLIC METHODS + function Legend($graph) { + if( $this->legend != "" ) + $graph->legend->Add($this->legend,$this->color); + $this->line->Legend($graph); + } + + function Stroke($img,$xscale,$yscale) { + parent::Stroke($img,$xscale,$yscale); + $this->line->Stroke($img,$xscale,$yscale); + } +} // Class + + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_flags.php b/includes/jpgraph/src/jpgraph_flags.php new file mode 100644 index 0000000..9ef0713 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_flags.php @@ -0,0 +1,376 @@ + 'afgh', + 'Republic of Angola' => 'agla', + 'Republic of Albania' => 'alba', + 'Alderney' => 'alde', + 'Democratic and Popular Republic of Algeria' => 'alge', + 'Territory of American Samoa' => 'amsa', + 'Principality of Andorra' => 'andr', + 'British Overseas Territory of Anguilla' => 'angu', + 'Antarctica' => 'anta', + 'Argentine Republic' => 'arge', + 'League of Arab States' => 'arle', + 'Republic of Armenia' => 'arme', + 'Aruba' => 'arub', + 'Commonwealth of Australia' => 'astl', + 'Republic of Austria' => 'aust', + 'Azerbaijani Republic' => 'azer', + 'Bangladesh' => 'bngl', + 'British Antarctic Territory' => 'bant', + 'Kingdom of Belgium' => 'belg', + 'British Overseas Territory of Bermuda' => 'berm', + 'Commonwealth of the Bahamas' => 'bhms', + 'Kingdom of Bahrain' => 'bhrn', + 'Republic of Belarus' => 'blru', + 'Republic of Bolivia' => 'blva', + 'Belize' => 'blze', + 'Republic of Benin' => 'bnin', + 'Republic of Botswana' => 'bots', + 'Federative Republic of Brazil' => 'braz', + 'Barbados' => 'brbd', + 'British Indian Ocean Territory' => 'brin', + 'Brunei Darussalam' => 'brun', + 'Republic of Burkina' => 'bufa', + 'Republic of Bulgaria' => 'bulg', + 'Republic of Burundi' => 'buru', + 'Overseas Territory of the British Virgin Islands' => 'bvis', + 'Central African Republic' => 'cafr', + 'Kingdom of Cambodia' => 'camb', + 'Republic of Cameroon' => 'came', + 'Dominion of Canada' => 'cana', + 'Caribbean Community' => 'cari', + 'Republic of Cape Verde' => 'cave', + 'Republic of Chad' => 'chad', + 'Republic of Chile' => 'chil', + 'Peoples Republic of China' => 'chin', + 'Territory of Christmas Island' => 'chms', + 'Commonwealth of Independent States' => 'cins', + 'Cook Islands' => 'ckis', + 'Republic of Colombia' => 'clmb', + 'Territory of Cocos Islands' => 'cois', + 'Commonwealth' => 'comn', + 'Union of the Comoros' => 'como', + 'Republic of the Congo' => 'cong', + 'Republic of Costa Rica' => 'corc', + 'Republic of Croatia' => 'croa', + 'Republic of Cuba' => 'cuba', + 'British Overseas Territory of the Cayman Islands' => 'cyis', + 'Republic of Cyprus' => 'cypr', + 'The Czech Republic' => 'czec', + 'Kingdom of Denmark' => 'denm', + 'Republic of Djibouti' => 'djib', + 'Commonwealth of Dominica' => 'domn', + 'Dominican Republic' => 'dore', + 'Republic of Ecuador' => 'ecua', + 'Arab Republic of Egypt' => 'egyp', + 'Republic of El Salvador' => 'elsa', + 'England' => 'engl', + 'Republic of Equatorial Guinea' => 'eqgu', + 'State of Eritrea' => 'erit', + 'Republic of Estonia' => 'estn', + 'Ethiopia' => 'ethp', + 'European Union' => 'euun', + 'British Overseas Territory of the Falkland Islands' => 'fais', + 'International Federation of Vexillological Associations' => 'fiav', + 'Republic of Fiji' => 'fiji', + 'Republic of Finland' => 'finl', + 'Territory of French Polynesia' => 'fpol', + 'French Republic' => 'fran', + 'Overseas Department of French Guiana' => 'frgu', + 'Gabonese Republic' => 'gabn', + 'Republic of the Gambia' => 'gamb', + 'Republic of Georgia' => 'geor', + 'Federal Republic of Germany' => 'germ', + 'Republic of Ghana' => 'ghan', + 'Gibraltar' => 'gibr', + 'Hellenic Republic' => 'grec', + 'State of Grenada' => 'gren', + 'Overseas Department of Guadeloupe' => 'guad', + 'Territory of Guam' => 'guam', + 'Republic of Guatemala' => 'guat', + 'The Bailiwick of Guernsey' => 'guer', + 'Republic of Guinea' => 'guin', + 'Republic of Haiti' => 'hait', + 'Hong Kong Special Administrative Region' => 'hokn', + 'Republic of Honduras' => 'hond', + 'Republic of Hungary' => 'hung', + 'Republic of Iceland' => 'icel', + 'International Committee of the Red Cross' => 'icrc', + 'Republic of India' => 'inda', + 'Republic of Indonesia' => 'indn', + 'Republic of Iraq' => 'iraq', + 'Republic of Ireland' => 'irel', + 'Organization of the Islamic Conference' => 'isco', + 'Isle of Man' => 'isma', + 'State of Israel' => 'isra', + 'Italian Republic' => 'ital', + 'Jamaica' => 'jama', + 'Japan' => 'japa', + 'The Bailiwick of Jersey' => 'jers', + 'Hashemite Kingdom of Jordan' => 'jord', + 'Republic of Kazakhstan' => 'kazk', + 'Republic of Kenya' => 'keny', + 'Republic of Kiribati' => 'kirb', + 'State of Kuwait' => 'kuwa', + 'Kyrgyz Republic' => 'kyrg', + 'Republic of Latvia' => 'latv', + 'Lebanese Republic' => 'leba', + 'Kingdom of Lesotho' => 'lest', + 'Republic of Liberia' => 'libe', + 'Principality of Liechtenstein' => 'liec', + 'Republic of Lithuania' => 'lith', + 'Grand Duchy of Luxembourg' => 'luxe', + 'Macao Special Administrative Region' => 'maca', + 'Republic of Macedonia' => 'mace', + 'Republic of Madagascar' => 'mada', + 'Republic of the Marshall Islands' => 'mais', + 'Republic of Mali' => 'mali', + 'Federation of Malaysia' => 'mals', + 'Republic of Malta' => 'malt', + 'Republic of Malawi' => 'malw', + 'Overseas Department of Martinique' => 'mart', + 'Islamic Republic of Mauritania' => 'maur', + 'Territorial Collectivity of Mayotte' => 'mayt', + 'United Mexican States' => 'mexc', + 'Federated States of Micronesia' => 'micr', + 'Midway Islands' => 'miis', + 'Republic of Moldova' => 'mold', + 'Principality of Monaco' => 'mona', + 'Republic of Mongolia' => 'mong', + 'British Overseas Territory of Montserrat' => 'mont', + 'Kingdom of Morocco' => 'morc', + 'Republic of Mozambique' => 'moza', + 'Republic of Mauritius' => 'mrts', + 'Union of Myanmar' => 'myan', + 'Republic of Namibia' => 'namb', + 'North Atlantic Treaty Organization' => 'nato', + 'Republic of Nauru' => 'naur', + 'Turkish Republic of Northern Cyprus' => 'ncyp', + 'Netherlands Antilles' => 'nean', + 'Kingdom of Nepal' => 'nepa', + 'Kingdom of the Netherlands' => 'neth', + 'Territory of Norfolk Island' => 'nfis', + 'Federal Republic of Nigeria' => 'ngra', + 'Republic of Nicaragua' => 'nica', + 'Republic of Niger' => 'nigr', + 'Niue' => 'niue', + 'Commonwealth of the Northern Mariana Islands' => 'nmar', + 'Province of Northern Ireland' => 'noir', + 'Nordic Council' => 'nord', + 'Kingdom of Norway' => 'norw', + 'Territory of New Caledonia and Dependencies' => 'nwca', + 'New Zealand' => 'nwze', + 'Organization of American States' => 'oast', + 'Organization of African Unity' => 'oaun', + 'International Olympic Committee' => 'olym', + 'Sultanate of Oman' => 'oman', + 'Islamic Republic of Pakistan' => 'paks', + 'Republic of Palau' => 'pala', + 'Independent State of Papua New Guinea' => 'pang', + 'Republic of Paraguay' => 'para', + 'Republic of Peru' => 'peru', + 'Republic of the Philippines' => 'phil', + 'British Overseas Territory of the Pitcairn Islands' => 'piis', + 'Republic of Poland' => 'pola', + 'Republic of Portugal' => 'port', + 'Commonwealth of Puerto Rico' => 'purc', + 'State of Qatar' => 'qata', + 'Russian Federation' => 'russ', + 'Romania' => 'rmna', + 'Republic of Rwanda' => 'rwan', + 'Kingdom of Saudi Arabia' => 'saar', + 'Republic of San Marino' => 'sama', + 'Nordic Sami Conference' => 'sami', + 'Sark' => 'sark', + 'Scotland' => 'scot', + 'Principality of Seborga' => 'sebo', + 'Republic of Serbia' => 'serb', + 'Republic of Sierra Leone' => 'sile', + 'Republic of Singapore' => 'sing', + 'Republic of Korea' => 'skor', + 'Republic of Slovenia' => 'slva', + 'Somali Republic' => 'smla', + 'Republic of Somaliland' => 'smld', + 'Republic of South Africa' => 'soaf', + 'Solomon Islands' => 'sois', + 'Kingdom of Spain' => 'span', + 'Secretariat of the Pacific Community' => 'spco', + 'Democratic Socialist Republic of Sri Lanka' => 'srla', + 'Saint Lucia' => 'stlu', + 'Republic of the Sudan' => 'suda', + 'Republic of Suriname' => 'surn', + 'Slovak Republic' => 'svka', + 'Kingdom of Sweden' => 'swdn', + 'Swiss Confederation' => 'swit', + 'Syrian Arab Republic' => 'syra', + 'Kingdom of Swaziland' => 'szld', + 'Republic of China' => 'taiw', + 'Taiwan' => 'taiw', + 'Republic of Tajikistan' => 'tajk', + 'United Republic of Tanzania' => 'tanz', + 'Kingdom of Thailand' => 'thal', + 'Autonomous Region of Tibet' => 'tibe', + 'Turkmenistan' => 'tkst', + 'Togolese Republic' => 'togo', + 'Tokelau' => 'toke', + 'Kingdom of Tonga' => 'tong', + 'Tristan da Cunha' => 'trdc', + 'Tromelin' => 'tris', + 'Republic of Tunisia' => 'tuns', + 'Republic of Turkey' => 'turk', + 'Tuvalu' => 'tuva', + 'United Arab Emirates' => 'uaem', + 'Republic of Uganda' => 'ugan', + 'Ukraine' => 'ukrn', + 'United Kingdom of Great Britain' => 'unkg', + 'United Nations' => 'unna', + 'United States of America' => 'unst', + 'Oriental Republic of Uruguay' => 'urgy', + 'Virgin Islands of the United States' => 'usvs', + 'Republic of Uzbekistan' => 'uzbk', + 'State of the Vatican City' => 'vacy', + 'Republic of Vanuatu' => 'vant', + 'Bolivarian Republic of Venezuela' => 'venz', + 'Republic of Yemen' => 'yemn', + 'Democratic Republic of Congo' => 'zare', + 'Republic of Zimbabwe' => 'zbwe' ) ; + + + private $iFlagCount = -1; + private $iFlagSetMap = array( + FLAGSIZE1 => 'flags_thumb35x35', + FLAGSIZE2 => 'flags_thumb60x60', + FLAGSIZE3 => 'flags_thumb100x100', + FLAGSIZE4 => 'flags' + ); + + private $iFlagData ; + private $iOrdIdx=array(); + + function FlagImages($aSize=FLAGSIZE1) { + switch($aSize) { + case FLAGSIZE1 : + case FLAGSIZE2 : + case FLAGSIZE3 : + case FLAGSIZE4 : + $file = dirname(__FILE__).'/'.$this->iFlagSetMap[$aSize].'.dat'; + $fp = fopen($file,'rb'); + $rawdata = fread($fp,filesize($file)); + $this->iFlagData = unserialize($rawdata); + break; + default: + JpGraphError::RaiseL(5001,$aSize); + //('Unknown flag size. ('.$aSize.')'); + } + $this->iFlagCount = count($this->iCountryNameMap); + } + + function GetNum() { + return $this->iFlagCount; + } + + function GetImgByName($aName,&$outFullName) { + $idx = $this->GetIdxByName($aName,$outFullName); + return $this->GetImgByIdx($idx); + } + + function GetImgByIdx($aIdx) { + if( array_key_exists($aIdx,$this->iFlagData) ) { + $d = $this->iFlagData[$aIdx][1]; + return Image::CreateFromString($d); + } + else { + JpGraphError::RaiseL(5002,$aIdx); + //("Flag index \"�$aIdx\" does not exist."); + } + } + + function GetIdxByOrdinal($aOrd,&$outFullName) { + $aOrd--; + $n = count($this->iOrdIdx); + if( $n == 0 ) { + reset($this->iCountryNameMap); + $this->iOrdIdx=array(); + $i=0; + while( list($key,$val) = each($this->iCountryNameMap) ) { + $this->iOrdIdx[$i++] = array($val,$key); + } + $tmp=$this->iOrdIdx[$aOrd]; + $outFullName = $tmp[1]; + return $tmp[0]; + + } + elseif( $aOrd >= 0 && $aOrd < $n ) { + $tmp=$this->iOrdIdx[$aOrd]; + $outFullName = $tmp[1]; + return $tmp[0]; + } + else { + JpGraphError::RaiseL(5003,$aOrd); + //('Invalid ordinal number specified for flag index.'); + } + } + + function GetIdxByName($aName,&$outFullName) { + + if( is_integer($aName) ) { + $idx = $this->GetIdxByOrdinal($aName,$outFullName); + return $idx; + } + + $found=false; + $aName = strtolower($aName); + $nlen = strlen($aName); + reset($this->iCountryNameMap); + // Start by trying to match exact index name + while( list($key,$val) = each($this->iCountryNameMap) ) { + if( $nlen == strlen($val) && $val == $aName ) { + $found=true; + break; + } + } + if( !$found ) { + reset($this->iCountryNameMap); + // If the exact index doesn't work try a (partial) full name + while( list($key,$val) = each($this->iCountryNameMap) ) { + if( strpos(strtolower($key), $aName) !== false ) { + $found=true; + break; + } + } + } + if( $found ) { + $outFullName = $key; + return $val; + } + else { + JpGraphError::RaiseL(5004,$aName); + //("The (partial) country name \"$aName\" does not have a cooresponding flag image. The flag may still exist but under another name, e.g. insted of \"usa\" try \"united states\"."); + } + } +} + + + + +?> diff --git a/includes/jpgraph/src/jpgraph_gantt.php b/includes/jpgraph/src/jpgraph_gantt.php new file mode 100644 index 0000000..cc3b2cc --- /dev/null +++ b/includes/jpgraph/src/jpgraph_gantt.php @@ -0,0 +1,3955 @@ +vgrid = new LineProperty(); + } + + function Hide($aF=true) { + $this->iShow=!$aF; + } + + function Show($aF=true) { + $this->iShow=$aF; + } + + // Specify font + function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) { + $this->iFFamily = $aFFamily; + $this->iFStyle = $aFStyle; + $this->iFSize = $aFSize; + } + + function SetStyle($aStyle) { + $this->iStyle = $aStyle; + } + + function SetColumnMargin($aLeft,$aRight) { + $this->iLeftColMargin = $aLeft; + $this->iRightColMargin = $aRight; + } + + function SetFontColor($aFontColor) { + $this->iFontColor = $aFontColor; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function SetBackgroundColor($aColor) { + $this->iBackgroundColor = $aColor; + } + + function SetColTitles($aTitles,$aWidth=null) { + $this->iTitles = $aTitles; + $this->iWidth = $aWidth; + } + + function SetMinColWidth($aWidths) { + $n = min(count($this->iTitles),count($aWidths)); + for($i=0; $i < $n; ++$i ) { + if( !empty($aWidths[$i]) ) { + if( empty($this->iWidth[$i]) ) { + $this->iWidth[$i] = $aWidths[$i]; + } + else { + $this->iWidth[$i] = max($this->iWidth[$i],$aWidths[$i]); + } + } + } + } + + function GetWidth($aImg) { + $txt = new TextProperty(); + $txt->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + $n = count($this->iTitles) ; + $rm=$this->iRightColMargin; + $w = 0; + for($h=0, $i=0; $i < $n; ++$i ) { + $w += $this->iLeftColMargin; + $txt->Set($this->iTitles[$i]); + if( !empty($this->iWidth[$i]) ) { + $w1 = max($txt->GetWidth($aImg)+$rm,$this->iWidth[$i]); + } + else { + $w1 = $txt->GetWidth($aImg)+$rm; + } + $this->iWidth[$i] = $w1; + $w += $w1; + $h = max($h,$txt->GetHeight($aImg)); + } + $this->iHeight = $h+$this->iTopHeaderMargin; + $txt=''; + return $w; + } + + function GetColStart($aImg,&$aStart,$aAddLeftMargin=false) { + $n = count($this->iTitles) ; + $adj = $aAddLeftMargin ? $this->iLeftColMargin : 0; + $aStart=array($aImg->left_margin+$adj); + for( $i=1; $i < $n; ++$i ) { + $aStart[$i] = $aStart[$i-1]+$this->iLeftColMargin+$this->iWidth[$i-1]; + } + } + + // Adjust headers left, right or centered + function SetHeaderAlign($aAlign) { + $this->iHeaderAlign=$aAlign; + } + + function Stroke($aImg,$aXLeft,$aYTop,$aXRight,$aYBottom,$aUseTextHeight=false) { + + if( !$this->iShow ) return; + + $txt = new TextProperty(); + $txt->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + $txt->SetColor($this->iFontColor); + $txt->SetAlign($this->iHeaderAlign,'top'); + $n=count($this->iTitles); + + if( $n == 0 ) + return; + + $x = $aXLeft; + $h = $this->iHeight; + $yTop = $aUseTextHeight ? $aYBottom-$h-$this->iTopColMargin-$this->iBottomColMargin : $aYTop ; + + if( $h < 0 ) { + JpGraphError::RaiseL(6001); + //('Internal error. Height for ActivityTitles is < 0'); + } + + $aImg->SetLineWeight(1); + // Set background color + $aImg->SetColor($this->iBackgroundColor); + $aImg->FilledRectangle($aXLeft,$yTop,$aXRight,$aYBottom-1); + + if( $this->iStyle == 1 ) { + // Make a 3D effect + $aImg->SetColor('white'); + $aImg->Line($aXLeft,$yTop+1,$aXRight,$yTop+1); + } + + for($i=0; $i < $n; ++$i ) { + if( $this->iStyle == 1 ) { + // Make a 3D effect + $aImg->SetColor('white'); + $aImg->Line($x+1,$yTop,$x+1,$aYBottom); + } + $x += $this->iLeftColMargin; + $txt->Set($this->iTitles[$i]); + + // Adjust the text anchor position according to the choosen alignment + $xp = $x; + if( $this->iHeaderAlign == 'center' ) { + $xp = (($x-$this->iLeftColMargin)+($x+$this->iWidth[$i]))/2; + } + elseif( $this->iHeaderAlign == 'right' ) { + $xp = $x +$this->iWidth[$i]-$this->iRightColMargin; + } + + $txt->Stroke($aImg,$xp,$yTop+$this->iTopHeaderMargin); + $x += $this->iWidth[$i]; + if( $i < $n-1 ) { + $aImg->SetColor($this->iColor); + $aImg->Line($x,$yTop,$x,$aYBottom); + } + } + + $aImg->SetColor($this->iColor); + $aImg->Line($aXLeft,$yTop, $aXRight,$yTop); + + // Stroke vertical column dividers + $cols=array(); + $this->GetColStart($aImg,$cols); + $n=count($cols); + for( $i=1; $i < $n; ++$i ) { + $this->vgrid->Stroke($aImg,$cols[$i],$aYBottom,$cols[$i], + $aImg->height - $aImg->bottom_margin); + } + } +} + + +//=================================================== +// CLASS GanttGraph +// Description: Main class to handle gantt graphs +//=================================================== +class GanttGraph extends Graph { + public $scale; // Public accessible + public $hgrid=null; + private $iObj=array(); // Gantt objects + private $iLabelHMarginFactor=0.2; // 10% margin on each side of the labels + private $iLabelVMarginFactor=0.4; // 40% margin on top and bottom of label + private $iLayout=GANTT_FROMTOP; // Could also be GANTT_EVEN + private $iSimpleFont = FF_FONT1,$iSimpleFontSize=11; + private $iSimpleStyle=GANTT_RDIAG,$iSimpleColor='yellow',$iSimpleBkgColor='red'; + private $iSimpleProgressBkgColor='gray',$iSimpleProgressColor='darkgreen'; + private $iSimpleProgressStyle=GANTT_SOLID; + private $iZoomFactor = 1.0; + //--------------- + // CONSTRUCTOR + // Create a new gantt graph + function __construct($aWidth=0,$aHeight=0,$aCachedName="",$aTimeOut=0,$aInline=true) { + + // Backward compatibility + if( $aWidth == -1 ) $aWidth=0; + if( $aHeight == -1 ) $aHeight=0; + + if( $aWidth< 0 || $aHeight < 0 ) { + JpgraphError::RaiseL(6002); + //("You can't specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension."); + } + parent::__construct($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline); + $this->scale = new GanttScale($this->img); + + // Default margins + $this->img->SetMargin(15,17,25,15); + + $this->hgrid = new HorizontalGridLine(); + + $this->scale->ShowHeaders(GANTT_HWEEK|GANTT_HDAY); + $this->SetBox(); + } + + //--------------- + // PUBLIC METHODS + + // + + function SetSimpleFont($aFont,$aSize) { + $this->iSimpleFont = $aFont; + $this->iSimpleFontSize = $aSize; + } + + function SetSimpleStyle($aBand,$aColor,$aBkgColor) { + $this->iSimpleStyle = $aBand; + $this->iSimpleColor = $aColor; + $this->iSimpleBkgColor = $aBkgColor; + } + + // A utility function to help create basic Gantt charts + function CreateSimple($data,$constrains=array(),$progress=array()) { + $num = count($data); + for( $i=0; $i < $num; ++$i) { + switch( $data[$i][1] ) { + case ACTYPE_GROUP: + // Create a slightly smaller height bar since the + // "wings" at the end will make it look taller + $a = new GanttBar($data[$i][0],$data[$i][2],$data[$i][3],$data[$i][4],'',8); + $a->title->SetFont($this->iSimpleFont,FS_BOLD,$this->iSimpleFontSize); + $a->rightMark->Show(); + $a->rightMark->SetType(MARK_RIGHTTRIANGLE); + $a->rightMark->SetWidth(8); + $a->rightMark->SetColor('black'); + $a->rightMark->SetFillColor('black'); + + $a->leftMark->Show(); + $a->leftMark->SetType(MARK_LEFTTRIANGLE); + $a->leftMark->SetWidth(8); + $a->leftMark->SetColor('black'); + $a->leftMark->SetFillColor('black'); + + $a->SetPattern(BAND_SOLID,'black'); + $csimpos = 6; + break; + + case ACTYPE_NORMAL: + $a = new GanttBar($data[$i][0],$data[$i][2],$data[$i][3],$data[$i][4],'',10); + $a->title->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize); + $a->SetPattern($this->iSimpleStyle,$this->iSimpleColor); + $a->SetFillColor($this->iSimpleBkgColor); + // Check if this activity should have a constrain line + $n = count($constrains); + for( $j=0; $j < $n; ++$j ) { + if( empty($constrains[$j]) || (count($constrains[$j]) != 3) ) { + JpGraphError::RaiseL(6003,$j); + //("Invalid format for Constrain parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)"); + } + if( $constrains[$j][0]==$data[$i][0] ) { + $a->SetConstrain($constrains[$j][1],$constrains[$j][2],'black',ARROW_S2,ARROWT_SOLID); + } + } + + // Check if this activity have a progress bar + $n = count($progress); + for( $j=0; $j < $n; ++$j ) { + + if( empty($progress[$j]) || (count($progress[$j]) != 2) ) { + JpGraphError::RaiseL(6004,$j); + //("Invalid format for Progress parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)"); + } + if( $progress[$j][0]==$data[$i][0] ) { + $a->progress->Set($progress[$j][1]); + $a->progress->SetPattern($this->iSimpleProgressStyle, + $this->iSimpleProgressColor); + $a->progress->SetFillColor($this->iSimpleProgressBkgColor); + //$a->progress->SetPattern($progress[$j][2],$progress[$j][3]); + break; + } + } + $csimpos = 6; + break; + + case ACTYPE_MILESTONE: + $a = new MileStone($data[$i][0],$data[$i][2],$data[$i][3]); + $a->title->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize); + $a->caption->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize); + $csimpos = 5; + break; + default: + die('Unknown activity type'); + break; + } + + // Setup caption + $a->caption->Set($data[$i][$csimpos-1]); + + // Check if this activity should have a CSIM target�? + if( !empty($data[$i][$csimpos]) ) { + $a->SetCSIMTarget($data[$i][$csimpos]); + $a->SetCSIMAlt($data[$i][$csimpos+1]); + } + if( !empty($data[$i][$csimpos+2]) ) { + $a->title->SetCSIMTarget($data[$i][$csimpos+2]); + $a->title->SetCSIMAlt($data[$i][$csimpos+3]); + } + + $this->Add($a); + } + } + + // Set user specified scale zoom factor when auto sizing is used + function SetZoomFactor($aZoom) { + $this->iZoomFactor = $aZoom; + } + + + // Set what headers should be shown + function ShowHeaders($aFlg) { + $this->scale->ShowHeaders($aFlg); + } + + // Specify the fraction of the font height that should be added + // as vertical margin + function SetLabelVMarginFactor($aVal) { + $this->iLabelVMarginFactor = $aVal; + } + + // Synonym to the method above + function SetVMarginFactor($aVal) { + $this->iLabelVMarginFactor = $aVal; + } + + + // Add a new Gantt object + function Add($aObject) { + if( is_array($aObject) && count($aObject) > 0 ) { + $cl = $aObject[0]; + if( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) { + $this->AddIcon($aObject); + } + elseif( class_exists('Text',false) && ($cl instanceof Text) ) { + $this->AddText($aObject); + } + else { + $n = count($aObject); + for($i=0; $i < $n; ++$i) + $this->iObj[] = $aObject[$i]; + } + } + else { + if( class_exists('IconPlot',false) && ($aObject instanceof IconPlot) ) { + $this->AddIcon($aObject); + } + elseif( class_exists('Text',false) && ($aObject instanceof Text) ) { + $this->AddText($aObject); + } + else { + $this->iObj[] = $aObject; + } + } + } + + function StrokeTexts() { + // Stroke any user added text objects + if( $this->texts != null ) { + $n = count($this->texts); + for($i=0; $i < $n; ++$i) { + if( $this->texts[$i]->iScalePosX !== null && $this->texts[$i]->iScalePosY !== null ) { + $x = $this->scale->TranslateDate($this->texts[$i]->iScalePosX); + $y = $this->scale->TranslateVertPos($this->texts[$i]->iScalePosY); + $y -= $this->scale->GetVertSpacing()/2; + } + else { + $x = $y = null; + } + $this->texts[$i]->Stroke($this->img,$x,$y); + } + } + } + + // Override inherit method from Graph and give a warning message + function SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1) { + JpGraphError::RaiseL(6005); + //("SetScale() is not meaningfull with Gantt charts."); + } + + // Specify the date range for Gantt graphs (if this is not set it will be + // automtically determined from the input data) + function SetDateRange($aStart,$aEnd) { + // Adjust the start and end so that the indicate the + // begining and end of respective start and end days + if( strpos($aStart,':') === false ) + $aStart = date('Y-m-d 00:00',strtotime($aStart)); + if( strpos($aEnd,':') === false ) + $aEnd = date('Y-m-d 23:59',strtotime($aEnd)); + $this->scale->SetRange($aStart,$aEnd); + } + + // Get the maximum width of the activity titles columns for the bars + // The name is lightly misleading since we from now on can have + // multiple columns in the label section. When this was first written + // it only supported a single label, hence the name. + function GetMaxLabelWidth() { + $m=10; + if( $this->iObj != null ) { + $marg = $this->scale->actinfo->iLeftColMargin+$this->scale->actinfo->iRightColMargin; + $n = count($this->iObj); + for($i=0; $i < $n; ++$i) { + if( !empty($this->iObj[$i]->title) ) { + if( $this->iObj[$i]->title->HasTabs() ) { + list($tot,$w) = $this->iObj[$i]->title->GetWidth($this->img,true); + $m=max($m,$tot); + } + else + $m=max($m,$this->iObj[$i]->title->GetWidth($this->img)); + } + } + } + return $m; + } + + // Get the maximum height of the titles for the bars + function GetMaxLabelHeight() { + $m=10; + if( $this->iObj != null ) { + $n = count($this->iObj); + // We can not include the title of GnttVLine since that title is stroked at the bottom + // of the Gantt bar and not in the activity title columns + for($i=0; $i < $n; ++$i) { + if( !empty($this->iObj[$i]->title) && !($this->iObj[$i] instanceof GanttVLine) ) { + $m=max($m,$this->iObj[$i]->title->GetHeight($this->img)); + } + } + } + return $m; + } + + function GetMaxBarAbsHeight() { + $m=0; + if( $this->iObj != null ) { + $m = $this->iObj[0]->GetAbsHeight($this->img); + $n = count($this->iObj); + for($i=1; $i < $n; ++$i) { + $m=max($m,$this->iObj[$i]->GetAbsHeight($this->img)); + } + } + return $m; + } + + // Get the maximum used line number (vertical position) for bars + function GetBarMaxLineNumber() { + $m=1; + if( $this->iObj != null ) { + $m = $this->iObj[0]->GetLineNbr(); + $n = count($this->iObj); + for($i=1; $i < $n; ++$i) { + $m=max($m,$this->iObj[$i]->GetLineNbr()); + } + } + return $m; + } + + // Get the minumum and maximum used dates for all bars + function GetBarMinMax() { + $start = 0 ; + $n = count($this->iObj); + while( $start < $n && $this->iObj[$start]->GetMaxDate() === false ) + ++$start; + if( $start >= $n ) { + JpgraphError::RaiseL(6006); + //('Cannot autoscale Gantt chart. No dated activities exist. [GetBarMinMax() start >= n]'); + } + + $max=$this->scale->NormalizeDate($this->iObj[$start]->GetMaxDate()); + $min=$this->scale->NormalizeDate($this->iObj[$start]->GetMinDate()); + + for($i=$start+1; $i < $n; ++$i) { + $rmax = $this->scale->NormalizeDate($this->iObj[$i]->GetMaxDate()); + if( $rmax != false ) + $max=Max($max,$rmax); + $rmin = $this->scale->NormalizeDate($this->iObj[$i]->GetMinDate()); + if( $rmin != false ) + $min=Min($min,$rmin); + } + $minDate = date("Y-m-d",$min); + $min = strtotime($minDate); + $maxDate = date("Y-m-d 23:59",$max); + $max = strtotime($maxDate); + return array($min,$max); + } + + // Create a new auto sized canvas if the user hasn't specified a size + // The size is determined by what scale the user has choosen and hence + // the minimum width needed to display the headers. Some margins are + // also added to make it better looking. + function AutoSize() { + + if( $this->img->img == null ) { + // The predefined left, right, top, bottom margins. + // Note that the top margin might incease depending on + // the title. + $hadj = $vadj = 0; + if( $this->doshadow ) { + $hadj = $this->shadow_width; + $vadj = $this->shadow_width+5; + } + + $lm = $this->img->left_margin; + $rm = $this->img->right_margin +$hadj; + $rm += 2 ; + $tm = $this->img->top_margin; + $bm = $this->img->bottom_margin + $vadj; + $bm += 2; + + // If there are any added GanttVLine we must make sure that the + // bottom margin is wide enough to hold a title. + $n = count($this->iObj); + for($i=0; $i < $n; ++$i) { + if( $this->iObj[$i] instanceof GanttVLine ) { + $bm = max($bm,$this->iObj[$i]->title->GetHeight($this->img)+10); + } + } + + // First find out the height + $n=$this->GetBarMaxLineNumber()+1; + $m=max($this->GetMaxLabelHeight(),$this->GetMaxBarAbsHeight()); + $height=$n*((1+$this->iLabelVMarginFactor)*$m); + + // Add the height of the scale titles + $h=$this->scale->GetHeaderHeight(); + $height += $h; + + // Calculate the top margin needed for title and subtitle + if( $this->title->t != "" ) { + $tm += $this->title->GetFontHeight($this->img); + } + if( $this->subtitle->t != "" ) { + $tm += $this->subtitle->GetFontHeight($this->img); + } + + // ...and then take the bottom and top plot margins into account + $height += $tm + $bm + $this->scale->iTopPlotMargin + $this->scale->iBottomPlotMargin; + // Now find the minimum width for the chart required + + // If day scale or smaller is shown then we use the day font width + // as the base size unit. + // If only weeks or above is displayed we use a modified unit to + // get a smaller image. + if( $this->scale->IsDisplayHour() || $this->scale->IsDisplayMinute() ) { + // Add 2 pixel margin on each side + $fw=$this->scale->day->GetFontWidth($this->img)+4; + } + elseif( $this->scale->IsDisplayWeek() ) { + $fw = 8; + } + elseif( $this->scale->IsDisplayMonth() ) { + $fw = 4; + } + else { + $fw = 2; + } + + $nd=$this->scale->GetNumberOfDays(); + + if( $this->scale->IsDisplayDay() ) { + // If the days are displayed we also need to figure out + // how much space each day's title will require. + switch( $this->scale->day->iStyle ) { + case DAYSTYLE_LONG : + $txt = "Monday"; + break; + case DAYSTYLE_LONGDAYDATE1 : + $txt = "Monday 23 Jun"; + break; + case DAYSTYLE_LONGDAYDATE2 : + $txt = "Monday 23 Jun 2003"; + break; + case DAYSTYLE_SHORT : + $txt = "Mon"; + break; + case DAYSTYLE_SHORTDAYDATE1 : + $txt = "Mon 23/6"; + break; + case DAYSTYLE_SHORTDAYDATE2 : + $txt = "Mon 23 Jun"; + break; + case DAYSTYLE_SHORTDAYDATE3 : + $txt = "Mon 23"; + break; + case DAYSTYLE_SHORTDATE1 : + $txt = "23/6"; + break; + case DAYSTYLE_SHORTDATE2 : + $txt = "23 Jun"; + break; + case DAYSTYLE_SHORTDATE3 : + $txt = "Mon 23"; + break; + case DAYSTYLE_SHORTDATE4 : + $txt = "88"; + break; + case DAYSTYLE_CUSTOM : + $txt = date($this->scale->day->iLabelFormStr,strtotime('2003-12-20 18:00')); + break; + case DAYSTYLE_ONELETTER : + default: + $txt = "M"; + break; + } + $fw = $this->scale->day->GetStrWidth($this->img,$txt)+6; + } + + // If we have hours enabled we must make sure that each day has enough + // space to fit the number of hours to be displayed. + if( $this->scale->IsDisplayHour() ) { + // Depending on what format the user has choose we need different amount + // of space. We therefore create a typical string for the choosen format + // and determine the length of that string. + switch( $this->scale->hour->iStyle ) { + case HOURSTYLE_HMAMPM: + $txt = '12:00pm'; + break; + case HOURSTYLE_H24: + // 13 + $txt = '24'; + break; + case HOURSTYLE_HAMPM: + $txt = '12pm'; + break; + case HOURSTYLE_CUSTOM: + $txt = date($this->scale->hour->iLabelFormStr,strtotime('2003-12-20 18:00')); + break; + case HOURSTYLE_HM24: + default: + $txt = '24:00'; + break; + } + + $hfw = $this->scale->hour->GetStrWidth($this->img,$txt)+6; + $mw = $hfw; + if( $this->scale->IsDisplayMinute() ) { + // Depending on what format the user has choose we need different amount + // of space. We therefore create a typical string for the choosen format + // and determine the length of that string. + switch( $this->scale->minute->iStyle ) { + case HOURSTYLE_CUSTOM: + $txt2 = date($this->scale->minute->iLabelFormStr,strtotime('2005-05-15 18:55')); + break; + case MINUTESTYLE_MM: + default: + $txt2 = '15'; + break; + } + + $mfw = $this->scale->minute->GetStrWidth($this->img,$txt2)+6; + $n2 = ceil(60 / $this->scale->minute->GetIntervall() ); + $mw = $n2 * $mfw; + } + $hfw = $hfw < $mw ? $mw : $hfw ; + $n = ceil(24*60 / $this->scale->TimeToMinutes($this->scale->hour->GetIntervall()) ); + $hw = $n * $hfw; + $fw = $fw < $hw ? $hw : $fw ; + } + + // We need to repeat this code block here as well. + // THIS iS NOT A MISTAKE ! + // We really need it since we need to adjust for minutes both in the case + // where hour scale is shown and when it is not shown. + + if( $this->scale->IsDisplayMinute() ) { + // Depending on what format the user has choose we need different amount + // of space. We therefore create a typical string for the choosen format + // and determine the length of that string. + switch( $this->scale->minute->iStyle ) { + case HOURSTYLE_CUSTOM: + $txt = date($this->scale->minute->iLabelFormStr,strtotime('2005-05-15 18:55')); + break; + case MINUTESTYLE_MM: + default: + $txt = '15'; + break; + } + + $mfw = $this->scale->minute->GetStrWidth($this->img,$txt)+6; + $n = ceil(60 / $this->scale->TimeToMinutes($this->scale->minute->GetIntervall()) ); + $mw = $n * $mfw; + $fw = $fw < $mw ? $mw : $fw ; + } + + // If we display week we must make sure that 7*$fw is enough + // to fit up to 10 characters of the week font (if the week is enabled) + if( $this->scale->IsDisplayWeek() ) { + // Depending on what format the user has choose we need different amount + // of space + $fsw = strlen($this->scale->week->iLabelFormStr); + if( $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { + $fsw += 8; + } + elseif( $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR ) { + $fsw += 7; + } + else { + $fsw += 4; + } + + $ww = $fsw*$this->scale->week->GetFontWidth($this->img); + if( 7*$fw < $ww ) { + $fw = ceil($ww/7); + } + } + + if( !$this->scale->IsDisplayDay() && !$this->scale->IsDisplayHour() && + !( ($this->scale->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR || + $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR) && $this->scale->IsDisplayWeek() ) ) { + // If we don't display the individual days we can shrink the + // scale a little bit. This is a little bit pragmatic at the + // moment and should be re-written to take into account + // a) What scales exactly are shown and + // b) what format do they use so we know how wide we need to + // make each scale text space at minimum. + $fw /= 2; + if( !$this->scale->IsDisplayWeek() ) { + $fw /= 1.8; + } + } + + $cw = $this->GetMaxActInfoColWidth() ; + $this->scale->actinfo->SetMinColWidth($cw); + if( $this->img->width <= 0 ) { + // Now determine the width for the activity titles column + + // Firdst find out the maximum width of each object column + $titlewidth = max(max($this->GetMaxLabelWidth(), + $this->scale->tableTitle->GetWidth($this->img)), + $this->scale->actinfo->GetWidth($this->img)); + + // Add the width of the vertivcal divider line + $titlewidth += $this->scale->divider->iWeight*2; + + // Adjust the width by the user specified zoom factor + $fw *= $this->iZoomFactor; + + // Now get the total width taking + // titlewidth, left and rigt margin, dayfont size + // into account + $width = $titlewidth + $nd*$fw + $lm+$rm; + } + else { + $width = $this->img->width; + } + + $width = round($width); + $height = round($height); + // Make a sanity check on image size + if( $width > MAX_GANTTIMG_SIZE_W || $height > MAX_GANTTIMG_SIZE_H ) { + JpgraphError::RaiseL(6007,$width,$height); + //("Sanity check for automatic Gantt chart size failed. Either the width (=$width) or height (=$height) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities."); + } + $this->img->CreateImgCanvas($width,$height); + $this->img->SetMargin($lm,$rm,$tm,$bm); + } + } + + // Return an array width the maximum width for each activity + // column. This is used when we autosize the columns where we need + // to find out the maximum width of each column. In order to do that we + // must walk through all the objects, sigh... + function GetMaxActInfoColWidth() { + $n = count($this->iObj); + if( $n == 0 ) return; + $w = array(); + $m = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin; + + for( $i=0; $i < $n; ++$i ) { + $tmp = $this->iObj[$i]->title->GetColWidth($this->img,$m); + $nn = count($tmp); + for( $j=0; $j < $nn; ++$j ) { + if( empty($w[$j]) ) + $w[$j] = $tmp[$j]; + else + $w[$j] = max($w[$j],$tmp[$j]); + } + } + return $w; + } + + // Stroke the gantt chart + function Stroke($aStrokeFileName="") { + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // a best we can. Therefor you will see a lot of tests !$_csim in the + // code below. + $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); + + // Should we autoscale dates? + + if( !$this->scale->IsRangeSet() ) { + list($min,$max) = $this->GetBarMinMax(); + $this->scale->SetRange($min,$max); + } + + $this->scale->AdjustStartEndDay(); + + // Check if we should autoscale the image + $this->AutoSize(); + + // Should we start from the top or just spread the bars out even over the + // available height + $this->scale->SetVertLayout($this->iLayout); + if( $this->iLayout == GANTT_FROMTOP ) { + $maxheight=max($this->GetMaxLabelHeight(),$this->GetMaxBarAbsHeight()); + $this->scale->SetVertSpacing($maxheight*(1+$this->iLabelVMarginFactor)); + } + // If it hasn't been set find out the maximum line number + if( $this->scale->iVertLines == -1 ) + $this->scale->iVertLines = $this->GetBarMaxLineNumber()+1; + + $maxwidth=max($this->scale->actinfo->GetWidth($this->img), + max($this->GetMaxLabelWidth(), + $this->scale->tableTitle->GetWidth($this->img))); + + $this->scale->SetLabelWidth($maxwidth+$this->scale->divider->iWeight);//*(1+$this->iLabelHMarginFactor)); + + if( !$_csim ) { + $this->StrokePlotArea(); + if( $this->iIconDepth == DEPTH_BACK ) { + $this->StrokeIcons(); + } + } + + $this->scale->Stroke(); + + if( !$_csim ) { + // Due to a minor off by 1 bug we need to temporarily adjust the margin + $this->img->right_margin--; + $this->StrokePlotBox(); + $this->img->right_margin++; + } + + // Stroke Grid line + $this->hgrid->Stroke($this->img,$this->scale); + + $n = count($this->iObj); + for($i=0; $i < $n; ++$i) { + //$this->iObj[$i]->SetLabelLeftMargin(round($maxwidth*$this->iLabelHMarginFactor/2)); + $this->iObj[$i]->Stroke($this->img,$this->scale); + } + + $this->StrokeTitles(); + + if( !$_csim ) { + $this->StrokeConstrains(); + $this->footer->Stroke($this->img); + + + if( $this->iIconDepth == DEPTH_FRONT) { + $this->StrokeIcons(); + } + + // Stroke all added user texts + $this->StrokeTexts(); + + // Should we do any final image transformation + if( $this->iImgTrans ) { + if( !class_exists('ImgTrans',false) ) { + require_once('jpgraph_imgtrans.php'); + } + + $tform = new ImgTrans($this->img->img); + $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, + $this->iImgTransDirection,$this->iImgTransHighQ, + $this->iImgTransMinSize,$this->iImgTransFillColor, + $this->iImgTransBorder); + } + + + // If the filename is given as the special "__handle" + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, + $aStrokeFileName); + } + } + } + + function StrokeConstrains() { + $n = count($this->iObj); + + // Stroke all constrains + for($i=0; $i < $n; ++$i) { + + // Some gantt objects may not have constraints associated with them + // for example we can add IconPlots which doesn't have this property. + if( empty($this->iObj[$i]->constraints) ) continue; + + $numConstrains = count($this->iObj[$i]->constraints); + + for( $k = 0; $k < $numConstrains; $k++ ) { + $vpos = $this->iObj[$i]->constraints[$k]->iConstrainRow; + if( $vpos >= 0 ) { + $c1 = $this->iObj[$i]->iConstrainPos; + + // Find out which object is on the target row + $targetobj = -1; + for( $j=0; $j < $n && $targetobj == -1; ++$j ) { + if( $this->iObj[$j]->iVPos == $vpos ) { + $targetobj = $j; + } + } + if( $targetobj == -1 ) { + JpGraphError::RaiseL(6008,$this->iObj[$i]->iVPos,$vpos); + //('You have specifed a constrain from row='.$this->iObj[$i]->iVPos.' to row='.$vpos.' which does not have any activity.'); + } + $c2 = $this->iObj[$targetobj]->iConstrainPos; + if( count($c1) == 4 && count($c2 ) == 4) { + switch( $this->iObj[$i]->constraints[$k]->iConstrainType ) { + case CONSTRAIN_ENDSTART: + if( $c1[1] < $c2[1] ) { + $link = new GanttLink($c1[2],$c1[3],$c2[0],$c2[1]); + } + else { + $link = new GanttLink($c1[2],$c1[1],$c2[0],$c2[3]); + } + $link->SetPath(3); + break; + case CONSTRAIN_STARTEND: + if( $c1[1] < $c2[1] ) { + $link = new GanttLink($c1[0],$c1[3],$c2[2],$c2[1]); + } + else { + $link = new GanttLink($c1[0],$c1[1],$c2[2],$c2[3]); + } + $link->SetPath(0); + break; + case CONSTRAIN_ENDEND: + if( $c1[1] < $c2[1] ) { + $link = new GanttLink($c1[2],$c1[3],$c2[2],$c2[1]); + } + else { + $link = new GanttLink($c1[2],$c1[1],$c2[2],$c2[3]); + } + $link->SetPath(1); + break; + case CONSTRAIN_STARTSTART: + if( $c1[1] < $c2[1] ) { + $link = new GanttLink($c1[0],$c1[3],$c2[0],$c2[1]); + } + else { + $link = new GanttLink($c1[0],$c1[1],$c2[0],$c2[3]); + } + $link->SetPath(3); + break; + default: + JpGraphError::RaiseL(6009,$this->iObj[$i]->iVPos,$vpos); + //('Unknown constrain type specified from row='.$this->iObj[$i]->iVPos.' to row='.$vpos); + break; + } + + $link->SetColor($this->iObj[$i]->constraints[$k]->iConstrainColor); + $link->SetArrow($this->iObj[$i]->constraints[$k]->iConstrainArrowSize, + $this->iObj[$i]->constraints[$k]->iConstrainArrowType); + + $link->Stroke($this->img); + } + } + } + } + } + + function GetCSIMAreas() { + if( !$this->iHasStroked ) + $this->Stroke(_CSIM_SPECIALFILE); + + $csim = $this->title->GetCSIMAreas(); + $csim .= $this->subtitle->GetCSIMAreas(); + $csim .= $this->subsubtitle->GetCSIMAreas(); + + $n = count($this->iObj); + for( $i=$n-1; $i >= 0; --$i ) + $csim .= $this->iObj[$i]->GetCSIMArea(); + return $csim; + } +} + +//=================================================== +// CLASS PredefIcons +// Description: Predefined icons for use with Gantt charts +//=================================================== +define('GICON_WARNINGRED',0); +define('GICON_TEXT',1); +define('GICON_ENDCONS',2); +define('GICON_MAIL',3); +define('GICON_STARTCONS',4); +define('GICON_CALC',5); +define('GICON_MAGNIFIER',6); +define('GICON_LOCK',7); +define('GICON_STOP',8); +define('GICON_WARNINGYELLOW',9); +define('GICON_FOLDEROPEN',10); +define('GICON_FOLDER',11); +define('GICON_TEXTIMPORTANT',12); + +class PredefIcons { + private $iBuiltinIcon = null, $iLen = -1 ; + + function GetLen() { + return $this->iLen ; + } + + function GetImg($aIdx) { + if( $aIdx < 0 || $aIdx >= $this->iLen ) { + JpGraphError::RaiseL(6010,$aIdx); + //('Illegal icon index for Gantt builtin icon ['.$aIdx.']'); + } + return Image::CreateFromString(base64_decode($this->iBuiltinIcon[$aIdx][1])); + } + + function __construct() { + //========================================================== + // warning.png + //========================================================== + $this->iBuiltinIcon[0][0]= 1043 ; + $this->iBuiltinIcon[0][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. + 'B3RJTUUH0wgKFSgilWPhUQAAA6BJREFUeNrtl91rHFUYh5/3zMx+Z5JNUoOamCZNaqTZ6IWIkqRiQWmi1IDetHfeiCiltgXBP8AL'. + '0SIUxf/AvfRSBS9EKILFFqyIH9CEmFZtPqrBJLs7c+b1YneT3WTTbNsUFPLCcAbmzPt73o9zzgzs2Z793231UOdv3w9k9Z2uzOdA'. + '5+2+79yNeL7Hl7hw7oeixRMZ6PJM26W18DNAm/Vh7lR8fqh97NmMF11es1iFpMATqdirwMNA/J4DpIzkr5YsAF1PO6gIMYHRdPwl'. + 'oO2elmB+qH3sm7XozbkgYvy8SzYnZPtcblyM6I+5z3jQ+0vJfgpEu56BfI9vUkbyi2HZd1QJoeWRiAjBd4SDCW8SSAOy6wBHMzF7'. + 'YdV2A+ROuvRPLfHoiSU0EMY/cDAIhxJeGngKaN1VgHyPL7NBxI1K9P4QxBzw3K1zJ/zkG8B9uwaQ7/HNsRZv9kohBGD0o7JqMYS/'. + '/ynPidQw/LrBiPBcS/yFCT95DvB2BWAy4575PaQbQKW+tPd3GCItu2odKI++YxiKu0d26oWmAD7paZU/rLz37VqIijD2YbnzNBBE'. + 'IBHf8K8qjL7vYhCGErEU8CTg3xXAeMp96GrJEqkyXkm9Bhui1xfsunjdGhcYLq+IzjsGmBt5YH/cmJkFq6gIqlon3u4LxdKGuCIo'. + 'Qu41g0E41po+2R33Xt5uz9kRIB2UTle7PnfKrROP1HD4sRjZlq0lzhwoZ6rDNeTi3nEg1si/7FT7kYQbXS6E5E65tA5uRF9tutq0'. + 'K/VwAF+/FbIYWt6+tjQM/AqUms7A4Wy6d7YSfSNxgMmzi0ycWWworio4QJvj4LpuL5BqugTnXzzqJsJwurrlNhJXFaavW67NRw3F'. + 'q+aJcCQVe9fzvJGmAY7/dPH0gi0f64OveGxa+usCuQMeZ0+kt8BVrX+qPO9Bzx0MgqBvs+a2PfDdYIf+WAjXU1ub4tqNaPPzRs8A'. + 'blrli+WVn79cXn0cWKl+tGx7HLc7pu3CSmnfitL+l1UihAhwjFkPQev4K/fSABjBM8JCaFuurJU+rgW41SroA8aNMVNAFtgHJCsn'. + 'XGy/58QVxAC9MccJtZ5kIzNlW440WrJ2ea4YPA9cAooA7i0A/gS+iqLoOpB1HOegqrYB3UBmJrAtQAJwpwPr1Ry92wVlgZsiYlW1'. + 'uX1gU36dymgqYxJIJJNJT1W9QqHgNwFQBGYqo94OwHZQUuPD7ACglSvc+5n5T9m/wfJJX4U9qzEAAAAASUVORK5CYII=' ; + + //========================================================== + // edit.png + //========================================================== + $this->iBuiltinIcon[1][0]= 959 ; + $this->iBuiltinIcon[1][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAFgAWABY9j+ZuwAAAAlwSFlz'. + 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AKDAwbIEXOA6AAAAM8SURBVHicpdRPaBxlHMbx76ZvsmOTmm1dsEqQSIIsEmGVBAQjivEQ'. + 'PAUJngpWsAWlBw8egpQepKwplN4ULEG9CjkEyUFKlSJrWTG0IU51pCsdYW2ncUPjdtp9Z+f3vuNhu8nKbmhaf5cZeGc+PO8zf1Lc'. + 'm0KhkACICCKCMeaBjiLC0tLSnjNvPmuOHRpH0TZTU1M8zBi9wakzn7OFTs5sw8YYACYmJrre7HkeuVyu69qPF77hlT1XmZ0eQ03O'. + 'wOLJTvhBx1rLz18VmJ0eY+jVd2FxDkKXnvYLHgb97OgLzE4ON9Hzc1B1QaQzsed5O0Lta3Ec89OnR5h5McfQ+Mw2qgQUnfBOPbZ3'. + 'bK3l+xOvMT0+3ERLp5FNF6UEjcL32+DdVmGt5WLhDYYPZrbRqreFumXwql0S3w9tnDvLWD5PZigPpdOwuYpSCo3C8wU3UHxQdHbf'. + 'cZIkNM6dxcnlUM4k1eUFMlUPpUADbpkttFarHe6oYqeOr6yt4RzMQHYUcUsQVtGicHDwKprViuLDkkOtVnsHCHZVRVy/zcj1i5Af'. + 'h8AjdIts+hUcGcYPK3iBtKM3gD/uAzf/AdY2mmmVgy6X8YNNKmGIvyloPcB8SUin07RQ4EZHFdsdG0wkJEnEaHAJxvKEpSLeaokV'. + 'r4zWmhUZYLlY4b1D03y5eIEWCtS7vsciAgiIxkQRabWOrlQor66y4pUphoJb1jiO4uO5o0S3q6RSqVbiOmC7VCEgAhLSaDQ48dH7'. + 'vD46REY0iysegSjKQciRt99ib7qXwX0O+pG4teM6YKHLB9JMq4mTmF9/+AKA4wvLZByH7OgYL7+UY2qvw/7Bfg5kHiXjJFyv3CGO'. + 'Y1rof+BW4t/XLiPG0DCGr79d4XzRxRnIMn98huXSTYyJ6et1UNYQhRvcinpJq86H3wGPPPM0iBDd+QffD1g4eZjLvuG7S1Wef26E'. + 'J7L7eSx7gAHVg7V3MSbi6m/r93baBd6qQjerAJg/9Ql/XrvG0ON1+vv7GH3qSfY5fahUnSTpwZgIEQesaVXRPbHRG/xyJSAxMYlp'. + 'EOm71HUINiY7mGb95l/8jZCyQmJjMDGJjUmsdCROtZ0n/P/Z8v4Fs2MTUUf7vYoAAAAASUVORK5CYII=' ; + + //========================================================== + // endconstrain.png + //========================================================== + $this->iBuiltinIcon[2][0]= 666 ; + $this->iBuiltinIcon[2][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. + 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9ALEREILkh0+eQAAAIXSURBVHictZU9aFNRFMd/N81HX77aptJUWmp1LHRpIcWhg5sIDlUQ'. + 'LAXB4t7RRUpwEhy7iQ46CCIoSHcl0CFaoVARU2MFMYktadLXJNok7x2HtCExvuYFmnO4w/3gx+Gc/z1HKRTdMEdXqHbB/sgc/sic'. + 'nDoYAI8XwDa8o1RMLT+2hAsigtTvbIGVqhX46szUifBGswUeCPgAGB7QeLk0X4Ork+HOxo1VgSqGASjMqkn8W4r4vVtEgI/RRQEL'. + 'vaoGD85cl5V3nySR/S1mxWxab7f35PnntNyMJeRr9kCMqiHTy09EoeToLwggx6ymiMOD/VwcD7Oa/MHkcIiQx026WGYto5P/U+ZZ'. + '7gD0QwDuT5z9N3LrVPi0Xs543eQPKkRzaS54eviJIp4tMFQFMllAWN2qcRZHBnixNM8NYD162xq8u7ePSQ+GX2Pjwxc2dB2cLtB8'. + '7GgamCb0anBYBeChMtl8855CarclxU1gvViiUK4w2OMkNDnGeJ8bt9fH90yOnOkCwLFTwhzykhvtYzOWoBBbY//R3dbaNTYhf2RO'. + 'QpeuUMzv188MlwuHy0H13HnE48UzMcL0WAtUHX8OxZHoG1URiFw7rnLLCswuSPD1ulze/iWjT2PSf+dBXRFtVVGIvzqph0pQL7VE'. + 'avXYaXXxPwsnt0imdttCocMmZBdK7YU9D8wuNOW0nXc6QWzPsSa5naZ1beb9BbGB6dxGtMnXAAAAAElFTkSuQmCC' ; + + //========================================================== + // mail.png + //========================================================== + $this->iBuiltinIcon[3][0]= 1122 ; + $this->iBuiltinIcon[3][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. + 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AJHAMfFvL9OU8AAAPfSURBVHictZRdaBRXFMd/987H7tbNx8aYtGCrEexDsOBDaKHFxirb'. + 'h0qhsiY0ykppKq1osI99C4H2WSiFFMHWUhXBrjRi0uCmtSEUGgP1QWqhWjGkoW7M1kTX3WRn5p4+TJJNGolQ6IXDnDtz+N0z/3PP'. + 'UWBIpdpYa23b9g09PZ2kUrOrvmUyGVKp1Ao/mUyi56YnVgWfO/P1CihAd/dJMpmaNROIRq8BkM1m0bH6TasC3j6QXgFdXI+DR6PR'. + 'JX/Pno8B+KLnMKqlpUU8z8MYs2RBEDzWf9J+0RcRbMdxGBsbw/fmCXwPMUEYID4iAVp8wIRmDIHMo4yHSIBSASKC+CWE0C/PF9jU'. + '3B6Cp+4M07C5FUtKGNvGwQJctPgIsgD2wRhEIqAMGB+UQYkHJgYYZD7P1HwVlmWhHcfhyk83KeRGUW4t6CgoG5SNUS4KBWgQDUov'. + '7AGlwYASBVqH0Bk49dXpCviVV3dw/tI1Bvr7kMIIlh0NYUpjlF0BAYvcxSXmEVLKceHSCJm+PnbueBHbtkNwTXUNBzo6aGpq4sSZ'. + 'GwT5H7BsF6Wdf1GWHQAoM0upeI9PT1yioS7B7tdaSdSuw7KsUGMAy7HYsmUztTW1nMwM0txssX1rlHjjS5jy/Uq2YkK/eJuLl6/z'. + 'x+1xkslW6mrixGIODx8EFSlEBC0+tmXT0NhA2763iEUjnLv4C8XpUbSbAB1mKkGJ3J83Od77HW5EszvZSqK2iljMIeJaRGNuJePF'. + '6mspY7BJ1DXwQnCd2fxGRq5OUCz8xt72dyhMZcn++Cu3xu9SKhdp2b4ZHWnAtTSxmIWlhcIjlksR3lNBYzlxZsb7+f7ne+xtSzOd'. + 'u83szH1OnThOPp/n+a0beeP1l4mvq+PU2Qyd+5PY1RuwlAqLYFaBfbTbyPSdfgaH77A//QF4f1O/vpr6RJyq+C5Kc/M8FbFxXItY'. + 'xOHDrvfo/fxLDnbsJBp5BowBReVWYAzabeTh5ABDw7cWoNNL3YYYNtSv57lnn6Z+Qx01VeuIuBa2DV1HD3H63BAPZu4u1WGpeLHq'. + 'Rh7+NcjA0O+0p4+CNwXigwnbWlQQdpuEpli+n+PIkcOc//YKuckJJFh2K2anrjFw+QZt6S6kPImIF/b+cqAJD1LihWAxC61twBTo'. + 'fPcQF/oGsVW5ovHQlavs2/8+uYnRVSOUgHAmmAClBIOBwKC0gPjhIRgEIX2wg7NnwpZW3d3d4vs+vu8TBMGK51rvPM9b8hdteZxd'. + 'LBbVR8feJDs0Rlv6GFKeXJ21rNRXESxMPR+CBUl0nN7PjtO+dye7Up/8v1I88bf/ixT/AO1/hZsqW+C6AAAAAElFTkSuQmCC' ; + + //========================================================== + // startconstrain.png + //========================================================== + $this->iBuiltinIcon[4][0]= 725 ; + $this->iBuiltinIcon[4][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. + 'AAALDgAACw4BQL7hQQAAAAd0SU1FB9ALEREICJp5fBkAAAJSSURBVHic3dS9a1NRGMfx77kxtS+xqS9FG6p1ER3qVJpBQUUc3CRU'. + 'BwURVLB1EAuKIP0THJQiiNRJBK3iJl18AyeltRZa0bbaJMbUNmlNSm5e7s25j0NqpSSmyag/OMM9POdzDuflwn8djz8gClVRrVEV'. + 'ur4Bl1FTNSzLrSS6vbml0jUUwSXj8Qfk3PkLtLW2AeBIybmrgz3+gFzpucjlE4f4btuFTuWuCF5XDr3a3UPf6cM8GQvxzbsRAJdh'. + 'ScfxSywml5j7mVypN0eGEJ0tebIre+zxB6Tv7jPReS2hREpOvpmUXU+H5eC913JnNCSRVE60pUVbWoZjprR39Yq70bdqj4pW7PEH'. + '5FpvL9e79jOTTHM7ssDL6CJZ08LbvAGnrpZg2mI2Z/MlZfN8IkxuSwu4V9+WIrj7zFlOHfXzKrLIi2SGh5ECKjnNVNxkQEc55vOw'. + 'rb6O8JLFdHyJ+ayFElUeHvjwkfteL/V7fKTSkFvIQE4DoLI2Mz/muTkTApcBKIwaN8pwIUrKw+ajWwDknAO0d/r4zFaMuRS63sWm'. + 'RoOdm+vRIriUYjKexrQV+t1o0YEVwfZSVJmD/dIABJuO0LG3lRFx0GOfiAELE9OgCrfU0XnIp5FwGLEy5WEAOxlR5uN+ARhP7GN3'. + '5w7Gv4bQI2+xpt4jjv2nWBmIlcExE2vDAHYioszBZXw6CPE4ADoWVHmd/tuwlZR9eXYyoszBfpiNQqaAOU5+TXRN+DeeenADPT9b'. + 'EVgKVsutKPl0TGWGhwofoquaoKK4apsq/tH/e/kFwBMXLgAEKK4AAAAASUVORK5CYII=' ; + + //========================================================== + // calc.png + //========================================================== + $this->iBuiltinIcon[5][0]= 589 ; + $this->iBuiltinIcon[5][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAA4AIwBbgMF12wAAAAlwSFlz'. + 'AAALEQAACxEBf2RfkQAAAAd0SU1FB9AHBxQeFsqn0wQAAAHKSURBVHicnZWff+RAGIef3U/gcOEgUAgUCgcLhYXCwsHBQeGgUDgs'. + 'FgMHB4VA/4Bg4XChWFgIFIqBwkJhsRAYeOGF+TQHmWSTTbKd9pU37/x45jvfTDITXEynAbdWKVQB0NazcVm0alcL4rJaRVzm+w/e'. + '3iwAkzbYRcnnYgI04GCvsxxSPabYaEdt2Ra6D0atcvvvDmyrMWBX1zPq2ircP/Tk98DiJtjV/fim6ziOCL6dDHZNhxQ3arIMsox4'. + 'vejleL2Ay9+jaw6A+4OSICG2cacGKhsGxg+CxeqAQS0Y7BYJvowq7iGMOhXHEfzpvpQkA9bLKgOgWKt+4Lo1mM9hs9m17QNsJ70P'. + 'Fjc/O52joogoX8MZKiBiAFxd9Z1vcj9wfSpUlDRNMcYQxzFpmnJ0FPH8nDe1MQaWSz9woQpWSZKEojDkeaWoKAyr1tlu+s48wfVx'. + 'u7n5i7jthmGIiEGcT+36PP+gFeJrxWLhb0UA/lb4ggGs1T0rZs0zwM/ZjNfilcIY5tutPxgOW3F6dUX464LrKILLiw+A7WErrl+2'. + 'rABG1EL/BilZP8DjU2uR4U+2E49P1Z8QJmNXUzl24A9GBT0IruCfi86d9x+D12RGzt+pNAAAAABJRU5ErkJggg==' ; + + //========================================================== + // mag.png + //========================================================== + $this->iBuiltinIcon[6][0]= 1415 ; + $this->iBuiltinIcon[6][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'. + 'AAALDAAACwwBP0AiyAAAAAd0SU1FB9ALDxEWDY6Ul+UAAAUESURBVHicdZVrbFRFGIafsyyF0nalV1R6WiggaAptlzsr1OgEogmC'. + '0IgoBAsBgkIrBAPEhBj/AP6xRTCUFEwRI4jcgsitXMrFCJptJWvBNpXYbbXtbtttt6e7e86ec/yxadlCfZPJZDIz73zzzjfvR2VL'. + 'F7U+hf0HD2JduIzTFy6SlJRkPtkcDgdCCE65OxFC8NPV6wghyM7OptankJ2dzbSC5QghEEIgCSHog9PpNAF27dlN6miZuPgElB4/'. + 'nmY3O7ZtByA1NVUCkGWZweD1eklJScESTbqxuIjrd+/x6uIl5M19hSy7nfGOeUxf+g7VjU1sKi7C4/GYsiyz7tAJAD4/cRaA1tZW'. + 'AHIPnECUVGD1+/3U19ebG4uLeHf1akamjsIwoVnVCOvQEdLoVILYYmMo3PIxSBJflpSaDX5FAmju1QAYv/8k/s8+wLVxOU0jR2LZ'. + '8sMFAApWrCApbRRDrRZirBYSLBKaoRPQw3SFernf2sav7T0Ubt4KwL4FMwF4Vu8FoHBCKgCzDhwHwLIhZ7y5a89u4m2JhA0wTdDC'. + 'OrphEjJMNElCHxKDEjaobmvlfo/Krj27CQQCJsCGJW8C0KXqAMxMiosQA8hZWcTFx9OsaniDKh1qmG7VoFsL0x0K06kbeAMhWpRe'. + '/KpG+gwHAKUnz7Dz3BUMw6DK18nuw99wt0Nh6VdHI8RJicmETQgFg7SFwjSrGv+oKp6ghldV6dZ0ugJBlF6FmCESQ2w2AIqXLsan'. + 'BrFYLJTnTCBrdBqveeopWZiPFaBHUegJhegMqGgxEkHDwB/UaQ9rdIV06v0+TD2EEQjQFtAY0dsNgNvt5sialQAIIXh7wQKuVf6J'. + 'gTsSccPDWlQstClBGjr9eHpVWvUQncEwdYEedF8noQ4vmYmpZMTH0nTvDn25vLbrNmu7bvfnsYEbAMnhcPDgwQPzUo2LJusw/mhp'. + 'QwlHNO0KBAnoIfxtrcQMT2De1Mm891wyUzNlUlJSpIyMDBobGzlzr5rFM/Koq6vrP8ASGxsLwPmKcvIShjPGZiPOakE3VFB8hHwd'. + 'vJAxhrk5L7Ly+RQuH/sWgPdXrwFg/6HDFBUsIj09nehfbAWwPWOT9n5RYhqGwarNWxkRM5TRCfF4U1PQsDDJFk9uYhwXvzvKjm3b'. + 'KSsro3DJInNW5RXp7u2bAKSlpeH1esnPz6eqqgqLpmmcr3Fht9ulfaV7mZk1Bs+lM6T1djM9fhg5egDPpTNMy5TZsW07kydPYdWM'. + 'aXx96ixOp9O8cfUa80srmDpjOgAulytiQqZpMnvObLbt/JTtHxXj9/tRVdU0DGOAufRpevPDTeac0hJyc3NxOOawfv161lVWS6eX'. + 'z+9/UOCxu1VWVvaTRGv16NFfjB2bNeAQp9NpTpmSM4DcbrdL0WsGDKLRR+52uwe1yP8jb2lpYfikyY9t80n03UCWZeaXVjw1f+zs'. + 'Oen+/d+pqanhzp2fKSsrw+l0mi6XiyPl5ZGITdN8fAVJwjRNJEmi1qfw1kw7siyTnJxMe3s71dXV3GpoZO64DG41NPJylvxU5D/e'. + 'qJKsfWQD9IkaZ2RmUvr9aV4aGYcQgjfO3aWoYBF5eXm4ewIsu/CbdPz1aWb0/p1bNoOrQxlUiuiaFo3c3FyEEOx9+C9CCD6paaTW'. + 'p/TXyYkTJ0Xe59jf7QOyAKDWp/QXxcFQ61P4pT3ShBBcvnUHIQTjxmX19/8BCeVg+/GPpskAAAAASUVORK5CYII=' ; + + //========================================================== + // lock.png + //========================================================== + $this->iBuiltinIcon[7][0]= 963 ; + $this->iBuiltinIcon[7][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. + 'AAALCwAACwsBbQSEtwAAAAd0SU1FB9AKAw0XDmwMOwIAAANASURBVHic7ZXfS1t3GMY/3+PprI7aisvo2YU6h6ATA8JW4rrlsF4U'. + 'qiAsF9mhl0N2cYTRy9G/wptAYWPD9iJtRy5asDe7cYFmyjaXOLaMImOrmkRrjL9yTmIS3120JybWQgfb3R74wuc8Lzw858vLOUpE'. + 'OK6pqSm2trbY39+nu7tbPHYch7m5OcLhMIA67kWj0aMQEWk6tm17rNm2LSIie3t7ksvlJJ1OSyqVkls3Z8SyLMnlcqTTaVKpFLdu'. + 'zmBZVj1HeY2VUti2TSQSQSml2bZdi0QirK2tMT09zerqKtlslqGhISYnJ4nHv2N+foFsNquOe9FotLlxOBwmk8lgWRbhcFgymYxY'. + 'liUi0mqaJoAuIi2macrdO7fFsizx3to0Te7euV1vrXtXEgqFmJmZYWVlhXK5LB4/U9kwDL784kYV0A3DYHd3m4sXRymXywKoRi8U'. + 'Ch01DgQCJBIJLMsiEAhIIpHw2uLz+eqtYrEYIqKZpimxWEyCwaCMjY01zYPBIJpXqVQqsby8TLVabWKA/v5+RkZGMAyDrq4ulFKH'. + 'HsfjcWZnZ+ns7KTRqwcnk0mKxSKFQqGJlVKtruuSTCYB6O3trW9UI/v9/iZPB/j8s2HOnX0FgHfeXpeffnzK+fWf+fijvhLs0PtG'. + 'D/n1OJ9+MsrlSwb3733DwMCAt1EyPj6uACYmJp56168NU6nUqFSE9nZdPE7+WqC/r4NKTagcCJVqDaUUB5VDAA4Pa9x7sMLlSwan'. + 'WjRmv13D7/erpaWlo604qOp88OF7LC48rPNosMq5Th+Dgxd4/XyA1rbzADi7j8jnf2P++wdcvSr8MJ/i8eomAKlUqn41OsDAQDeD'. + 'g++yuPCwzm/2vU8+n2a7sMFfj79mp7BBuVzioFSiXHJx3SKuW2Rzy0Up9dxnQVvODALQerqNRn4ZKe0Mvtc6TpzpmqbxalcY9Ato'. + '2v06t515C73YQftZB9GLnDrt4LoujuPgOA4Ui+C6yOpXJwZrJ7r/gv4P/u+D9W7fLxTz+1ScQxrZ3atRLaVxdjbY2d184R6/sLHe'. + 'opHP7/Do90Ua+WWUyezzZHObP/7cfX54/dowE1d66s8TV3oE+Mfn+L/zb4XmHPjRG9YjAAAAAElFTkSuQmCC' ; + + //========================================================== + // stop.png + //========================================================== + $this->iBuiltinIcon[8][0]= 889 ; + $this->iBuiltinIcon[8][1]= + 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. + 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9AJDwEvNyD6M/0AAAL2SURBVHic1ZTLaxVnGIefb2bO5OScHJN4oWrFNqcUJYoUEgU3/Qf6'. + 'F7gwCkIrvdBLUtqqiLhSg9bgBduFSHZdiG5ctkJ3xRDbUFwUmghNzBDanPGMkzOX79LFJGPMOSd204U/+Bbzvd/78F4H/ieJdoad'. + 'pZKxRFszAI/DcP0HazXY22v+HB01kee1PA/v3zfnjx4xgGnHcNZe7OvuNj+cOEF1ZATv5nUA4jhBSgmADCVWo8Ge2Of9wb18P/G7'. + 'oUXmYi30zqlTVEdGWLh1g2D6MYlKkXGE0Vl8aa2GEB149+4xXSzyoOIw/mimiZV/DPb25pFOj13A9gOMEChhUEqhVYqWKUk9QAUp'. + 'sT/P4s8PmKlUmNhQaIJbkDVqBbpw6wZ2zUc4Nm+ePku5p4eOrgpueQOFUoVCVxcD4+N07dpF9+5tVJeWGPBjhvr7WF1zC8ASgtcP'. + 'H8a7eZ1odh4sh50nzwCw9ZNh3M4Stutiu0X2nB/LyjZ6lcIbVTpdQU/jWVPzLADM8+ZGBRdtC7wrF/O7bR99iu26VL86iU4SAH4b'. + 'Po5d6AQhstMSvGyI4wS5FJBKSRwnzF8byx/u+PjzzMF1mfryQ1K/jnCahqp1xEopjFLoNEFJSRJHzF799gWHqa+/QKcSUXBI609f'. + 'Al5W4teQSiHDOipNUKnMI13RvnOXAIEKQixvGWya98SC560MFwPiqEG86JM8q79Q06lvhnOndy5/B6GPCUOMUu3BQgg8z0M3GmBZ'. + 'iGJn3v2VmsqnfzNx7FDueODuj8ROCFpjtG5TCmOYv32bJ09msP0ISydMfnAUgF8/O45RAA6WTPjlvXcB+Gn7FuRf/zAnNX6x3ARe'. + 'PSdmqL+P/YHkwMGDOGWDZTlQcNBRhPEComgB/YeHfq2InF1kLlXUOkpMbio1bd7aATRD/X0M1lPeSlM2vt2X1XBZjZnpLG2tmZO6'. + 'LbQVOIcP+HG2UauH3xgwBqOz9Cc3l1tC24Fz+MvUDroeGNb5if9H/1dM/wLPCYMw9fryKgAAAABJRU5ErkJggg==' ; + + //========================================================== + // error.png + //========================================================== + $this->iBuiltinIcon[9][0]= 541 ; + $this->iBuiltinIcon[9][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaVBMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'. + 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpYiYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'. + 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTCAkUMSj9wWSOAAABLUlEQVR4'. + '2s2U3ZKCMAxGjfzJanFAXFkUle/9H9JUKA1gKTN7Yy6YMjl+kNPK5rlZVSuxf1ZRnlZxFYAm93NnIKvR+MEHUgqBXx93wZGIUrSe'. + 'h+ctEgbpiMo3iQ4kioHCGxir/ZYUbr7AgPXs9bX0BCYM8vN/cPe8oQYzom3tVsSBMVHEoOJ5dm5F1RsIe9CtqGgRacCAkUvRtevT'. + 'e2pd6vOWF+gCuc/brcuhyARakBU9FgK5bUBWdHEH8tHpDsZnRTZQGzdLVvQ3CzyYZiTAmSIODEwzFCAdJopuvbpeZDisJ4pKEcjD'. + 'ijWPJhU1MjCo9dkYfiUVjQNTDKY6CVbR6A0niUSZjRwFanR0l9i/TyvGnFdqwStq5axMfDbyBksld/FUumvxS/Bd9VyJvQDWiiMx'. + 'iOsCHgAAAABJRU5ErkJggg==' ; + + //========================================================== + // openfolder.png + //========================================================== + $this->iBuiltinIcon[10][0]= 2040 ; + $this->iBuiltinIcon[10][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEANAAtwClFht71AAAAAlwSFlz'. + 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AKDQ4RIXMeaLcAAAd1SURBVHicxZd7jBXVHcc/58zcvTNzH8vusqw8FsTsKiCUUh5WBZXG'. + 'GkOptmqwNWsWLKXFGlEpzZI0AWNKSy0WhDS22gJKtWlTsSRqzYIuLGB2WVvDIwQMZQMsy2OFfdzde+/OnHP6x907vJaFpjb9JZM5'. + 'c85Mfp/f9/s7Jxn4P4e41gtSyp78WGvtfdEAcqDFYUOH9HS0NhGk9tPb/ilSyp789UUB2AMuqhQy3Uzm7HGkE6W3dTNZMRI3EcWO'. + 'jf9ClLmWBT3dzW8jUsevWHCG3UpWl+IkHSxnbDh/Mcz12NevBcuWXTmf6TjnXvJ88gDmVB3pw3+nt3UzHa1NqMzBS2zqPLGFjtMN'. + 'ZNr3XdW+qyqwZcFk76HX/tHWfuQvyO4W7qhaHwL8efkMRlRUpPv7rqD0RrJ+FgAjLy1a20OIxZJEEuNCRfIApj+om4bGM3u2/sYU'. + '9J41d8973f3Dhg1pISTV1dXXBRNJxPGFCzhou+DCQrScZOkktNaeDZjamgeZ9MgiYmVDccvHhjAzJw0NTh8/alyZMaVJicp0iTHj'. + 'JpgNv38tjWUhhGROdbUL9W5/MH5XCkjlcibi+KIop5LVHLKEu8A/f4r286doa9pGrGwYAAsfqbbH3b8MgO/Nqgy6WvdbbXHMkEFJ'. + '4xUOMVEvaTZu3BgmvF4Yk4hz9rO/Ulr5cE9owae/rcGxohSOuiWkC2IjcIqKyPZm+OmCH7GhoZEF077EEzVVweAbJ+riEeO0Ey8y'. + 'UubqOHn0AOgMwvf59txnBrSp9dgxKmf/+kIP1NY8SFk0jh5ajmNHAWg5b2E5EexojGHjbiVRMoRMNs0LC+Yz46vTuH3enN7BI8fr'. + 'qFdo0BoVZNC9aVSQ4fNjBzEmQJiARxb+/AqYPMAVB5FsPU5v37g9OxgLhe14ZM5/ju052E6MNZvf5pmHHuLmmWOkEysxUtpGAtme'. + 'dtHTflJkezqQto3jFRnLssyf1jydxiiM7zNnye/c3ZsqLu2BN5fcMfzrv/hby1tPzmRUoihcTJ87CwQI2yLtDcIqsIjYUf51qBlf'. + 'OnScOSrdQUOMURkiXsLUzJnvbGhoBGDHH5cGyZLhOpYoNl5hqYnYEXOu5fDl9eYAHntx98n8hFHZcPHUuTSxSASAeK/CGIOxJJ0f'. + 'bOGNPU280dgkq6Y2yu8vfjCIlwwzr+/ZQ/PHO0gOLuO5qsftDQ2NbN+4OCgqG6WTxWVaq6zpF+DiSHWnicdylp3r6aZTWthIOrNp'. + 'ktHcvBu0sHX1Sm6ozB3B42d90zZA9bQp7PvgPSzXZfnqX/HS4DKKK2+x69Y/HURs26iBAN5ccsfw7774UcumF37C6f07KSt2OHji'. + 'DEUJD0tISjyPrrSPlAKvN0JP/U4O1NfjuhG2rvklN1SOpfXwftpbTqAyKRrff5fb7rs9V1R7m4wlz2ihA3HpmXflUWyOH2umpLiY'. + 'ui3v8M+6bWzfsRNbSgqkxaCkiy0simMuEWEhpcRzIhQWOIAh6tiAwS4owInFiTou5dOnMnl2NR++ujBwXEc9terD6M43nrj6LgAB'. + 'QnDPA9/irtkP8JRS7Hr/3T6YekDQ1pEiEXOwpUVJzCVlZZFS4mZtkpEo9ChAkDp/jtLMBACy6S4RiQghLyv5cgBRPnKUOX6smUGF'. + 'hSil0MYw9d77mPy1e5mnFE3batm3czvb6nYgEJztSFGU9LCRlMRdUjIH0+lnEMIwPNXD3NumoVJnrMCJaiciMUZfvQnz4QcBSvV1'. + 'vjE5GK358t0zmXDnDB79saLpo20c+aSRD+t25JTp7GZQwsEWFiVxl6hlUf/WO9z32CxmL1rOe6u/I2KuwGhzLQCB7/sYY9Bah3el'. + 'FKbvrrVm4vS7GH/7ncx+chEHGz7myCeNbPtoO0JI2jq78WIRLGkzsqs7V5SfFV5EovXACoiqqsfNpk2vo5VCWtYFBfoU0VoTBAFa'. + 'a7TRaK2p+MoURk+cxMzq+Rzbv49DDbuo27UTW9h0dedssPxuK+kIfN8XxhgDYPVXf2Fh4XKtFIl4AiklAlBKAYRKKK36wHIweTCt'. + 'NfHiEkaOn8j0+7/BmDFjaT30GbHywSxcuZkpFfFg+m1jjZ/NmnVvNfRvwd69e8WBA/uNFAIh4JVXXmHsmDHE4vEQQgjQ2lxQIm9N'. + 'nz35q3BEOZOHzaG2thaA4mRU+L29It+IV21CpbRQfeMFC35gRB/M2rVrubnyZmLxWJhECBEmz/eHyo/7lMlH3LFFujsthNFCCGOu'. + '+WNyeUgpjSVzMKtWraKyshLPdcPEeYWCIEBdpIxSivr6eta8vI7d6+cGnhdV06pe1QP+F/QXWmuRL+jZZ58LlVmxYgUVFRV4rhtu'. + '4TzMxXAA6XRaRAtsYUkx8I/JtSJQOlSwpmZpCLN8+fPcdNNoHMfB9/0QJgRoP295TlR7UVv8xxZcHMuWIZ9/Hn35vG3JEGZpzVJG'. + 'jx5N1IlitKahsZE1L69j69qHgx+urFX/lQL9JYdLlfnZihUhzOLFi8N3Ml1dthOxVH/f/8/CtqSJ2JaJ2JZ59J7RPsC/AViJsQS/'. + 'dBntAAAAAElFTkSuQmCC' ; + + //========================================================== + // folder.png + //========================================================== + $this->iBuiltinIcon[11][0]= 1824 ; + $this->iBuiltinIcon[11][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. + 'AAALEAAACxABrSO9dQAAAAd0SU1FB9ECAQgFFyd9cRUAAAadSURBVHiczdhvbBP3Hcfx9/2xfefEOA5JoCNNnIT8AdtZmYBETJsI'. + '6+jQOlQihT1AYgytqzZpD1atfyYqlT1h0lRpT7aRJ4NQpRvZGELVuo5Ua9jEJDIETQsNQyPBsUJMWGPnj//e+e72wNg4xElMR6ed'. + 'ZNln3933dZ/f93f6yfB/sgmrHdDV1WXlPg8NDZUDScD8LFFFEZZlWYZhWMFg0Orq6sq/gDJAfFy1iiZy9OjrVnj4JzQ1rMWqfxm/'. + '309jYyNtbW0kEgnu3bvH4cOH88c/jqSKQl4/XGkd+eVtAN46up1LH92ktqYS++ZX8Pv9NDQ0sGnTJlKpFOFwmO7u7vy5IyMjeVRd'. + 'XV1+WEOh0IrY4pDnq6wXX/sTiCJaMkFZdRNqxefoe7VtCSqXVDqdZnZ2ltraWkzTpKqqijt3JpFlG7dvj7NzZ1f++qFQyA3EClHL'. + 'Ql743nFkhxPDtJAd5eTaYSVUfX09lZWVlJWVIUnSg7sVQMBCUcu4ceMGe/bsIRQK1QAzOcyykIM9P0KyudAyCWyqG8nhwqa4SkLt'. + '3r0bVVVxu924XC40TUOWZUQxe97CwgIdHR2LMHIxSCaVInVvFElxE0vMY1Pd2NUKJMWNTXHlUfF//4vETJCelwbpFm3MjP2dt37x'. + 'AlN+PzU1NViWRSwW4+7du3g8HjweD4qi5EFAJzAExIpCANbooxhplfB0FJvTg6xWIqsVRVF6MopkU3FXPcnkJxGU0VEAdF2noqKC'. + 'W3/8DpnqLjzep2lubsblcjE8PExHR8fboVDID9xYFpLBDpJF0jDQIncQpWlkm31FlFLtp9PfyuW/vYQj1kPSuRW/38+lj27S2Q7v'. + '/aWXUBVUffVNtm3blivVCEwsC5Eyc5iiApEpDEAXMqQdldhSiWVQHjJagud+8Fuexck/zv+K82dfoSbSCsDe75/km+4GVPd6+l5t'. + '4zJHcqVUYN2yEEtZQDCSJCueRAYsPY49HsFIZVG6p25JUumFafT4DKJN4amtT7Nz38sk5+5A70HMtEYyMkFiZhxzjQ/poXrLQrRU'. + 'DFGEeFpAlkQkm4pRiCpIKodKzk0T/2QMh+piPjxKZPwiSkUtu/b9mNnJEWS7E8nhAmvpM60oJDkXJxqNozxRRUxPIesispBBlsXV'. + 'UaKEFo8gzoaJhz8s2lOmrpUG+WBhJ9/60g+Z+fDXTAXfxllRjl1VkO0OFATsYhYliiK21ZKKhhHnFveUqSdKgwAEOp7F2v51vvw8'. + 'XH7/N1wd/BlTweuUV65BdtgfoLTSkipsdD3tRi0VYpommUwGwzDwdT5HYEc3giAwcvH3jLz3BlPB67jWeZBEKYsSBWwpHZtNKo4q'. + 'aHTDsJeeiGEYWJaFZVmYpommaRiGQdPnv0bb1m8gSRL/vPIOV979aR4lmAJ2p4qCgCxksNuKJ6VNpx4NYhgGpmkuQhmGQTqdxjAM'. + 'qr2d7HtxEEEQuH1tkKvvvkF44tqDnrIcKJKAPf1g+LAUElq8dIiu60sApmnm93Pfzc7OYhgGrie+wFe++ztcLhcT1wf54PzPCU9c'. + 'w7XWjWS3IdsdOAUBWZAxrRJnTQ6SG5bce2FCpmkughmGQSqVYm5uDtnj44sH38TtdhP6+Dwf//V4ttHXrkGURZJaic8RgHQ6jWma'. + 'SJKUL5RLKNfIOczDKF3XSSaTRCIRhLJWntp3nGfWrSMxc5OLf3iNP4+68T9Ub9nF76lTpxgfHycajZJKpdA0LZ9GbjYV7hcDWZaF'. + 'pmnMz88Ti8UYunSLmu1HFi2aVkxkaGjINTY2ttDb24vX6+XQoUNs3ryZ8vJyIDu1BUFYkkxhgxeiWlpaOHPmDE1NTdTX1xe98eWG'. + 'JnF/9dQZCoXUYDA4AOD1ejlw4ACtra2Ul5fniwmCkEcUJiUIAoFAgL6+Pnw+H21tbfT39z8SxCS7hHsfWH9/8dL4MKqnp4eWlhac'. + 'TmcekEvMNE2am5s5ceIEgUCA9vZ2Tp48ic/nY3j4UsmQHCYOjJHtpeBKqL1799Lc3IzT6UTXdRobGxkYGKC9vZ3W1tZ8Ko86NJ8a'. + 'tXHjRo4dO8bp06fZsmULGzZsoL+/n0AggNfr5ezZs/8VpGTU5OSkc//+/acBfD4f1dXV7Nq1i4aGBs6dO4fP5+Pq1SuPBbIiyjTN'. + 'RUnV1dUNXLhwAa/Xy44dO4jFYgBEo9FFF1r134BPuYlk16LrAYXsAlmtq6sbKDwoFAp9m+ykuP5ZQVZF3f8tCdwCov8LyHIoAANI'. + 'AXf/A1TI0XCDh7OWAAAAAElFTkSuQmCC' ; + + //========================================================== + // file_important.png + //========================================================== + $this->iBuiltinIcon[12][0]= 1785 ; + $this->iBuiltinIcon[12][1]= + 'iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'. + 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9ECDAcjDeD3lKsAAAZ2SURBVHicrZhPaFzHHcc/897s7lutJCsr2VHsOHWMk0MPbsBUrcnF'. + 'OFRdSo6FNhdB6SGHlpDmYtJCDyoxyKe6EBxKQkt7KKL0T6ABo0NbciqigtC6PhWKI2NFqqxdSd7V2/dmftPDvPd212t55dCBYfbN'. + 'zpvfZ77z+/1mdhUjytWrV93Hf/24eD5z9gwiMlDjOKbb7dLtdhER2u02u7u73Lp1CxEZBw4AeZwdNQqkMd9wbziFGINJUt6rRbz5'. + '1ptUq1XK5TJBEAAUMHt7e+zu7gKwvLzMysoKwAng/uNg9CgQgFKlgg1DUJ67Vqtx6tQpZmdniaIIpRTOOZRSdDoddnZ2aLfbLC8v'. + 's7S0xJUrV7ZGwQSj1PhhfRodVdDlMrpc5vup5Z2fvMPdu3fZ29vDWjvwztjYGPV6nVqtRqVS4dKlSywtLQFsAdOH2XwsCEApg3jl'. + 'w98Rak2gvYjNZpNms0mSJDjnHgkDMDc3dySYQ0Ea8w139YUX0OUKulzyg7UmCEO+l1huvHuDra0t9vf3h1TJYSqVypFhHquIrlQI'. + 'S5qv/uIDAC7/4bcEQYAKvK+0Wq1DVQGIoog7d+4cCeaRII35hrt+8SsEOkRlUaEyR0UpFIrXHxyMVKVUKnHv3r0jwRwaNelBjBjL'. + 'Sz/7KYuLiwAsLi7y4z/9kY9e+TpkCuSqjI+Po7XuAWeKXLt2DWNMUZMkwRjDhQsXWFtbK6JpCCT3jfQgxomPtPX19YHWicM5x3c2'. + '73Pj3Ru8/aO3mZqaolKpoHVvyuvXr/Ppnf/Q7uzz380NPtu4y/qnG+ztd1hfX2dtbQ3gIvDnRyqSxl1UoPjyz98D4PTp0wPtq39Z'. + '4fdzLxegrVaLVqvF5OQkYRgWqpRKJZ77wvNsbW1RG5tgfKLOTH2G7Z1twqBQrgrMDvhInjfSOCY5iIv+hYWFgRZArEWsZWF941Bf'. + 'SdMUgMnJCWpjVU4cn+HUyePM1Gc4+fRUPkzBI5w1jbukcczLv/5l0XfmzJmBFuCba38r/CRXpT+CrDUoZ0jjB4RYonJAOYRobJKT'. + 'z5zgqfqxAbsFSH6mpHFM2qdGXh4VnoViD6mSJF2cTQeqDqBaKVHWmonJCWpZjhkC6anR5WsffTgwaHV1FaUUq6urA/2v3f5k4LnV'. + 'arG9tUn3oI2YBCcWHYAxMVYs1qZEZY2SFB2aYZDGfMN9d7uJiWPSeFiNo5Rclc3NTXZbO6RpF7EJVixYA9agwwDnUiqlEPdQ3imi'. + 'Jo27BGHIt/7x9yEjc3Nzh27Na7c/4TdffKl4bja3ae5MUIu0T/HOEIaOpJt4gwoSsVTK4SBIY77hFtY3ABBjBiZ90rKwvsH77/+K'. + 't37wOhO1iPpTk4SBw1mLsz6CnKQ4l3qV+kE+t9XHlNZOk+bUJLVIE1VCcIJWQmJ6qjj30NbcXLkZMt8YPig+Z3n1G5fZ39/j/vY2'. + '9ckqZT2Ochbn0p4qNkU/dDfUADdXbh4HXgRO4zNdEU0XL1784PLly5w9e7Z4SazFOfGrEotDcOKrcoJPmrYIXf/Zop3QNd1skuGt'. + 'cUAb2MgAxvHZTgFUq1Wmp6eZnZ0F8JlTjDduDThBnDeECEoJtbGIp6enqEblzCcEZ1PECU4yVRiOGgd0gc+AB0CZvkv1sWPHOHfu'. + 'HOfPn8da41cpkkltEBEPJhYnBkTQJcdYVKGkgRxCfBsq5xXNgAa2Bn+hjTOgHEKBP8pzRUxykIH4ifLJRTJAl+UMBJzPHQ6bfe/f'. + 'cWIzPxlUpD+zugzIZtVk1d8znBAqRxgoQuVQgSJQ3h9C5QhDRYgjUILCAzlnEdsHYTKfMTEBcP7F54YUGVmc2GLlIn6ve6v0ahSt'. + '8X25TzjJ+rIx1grKpQPWR4LkGVVsMgghvS0qjPdvm5OeceOTWA5Evo2mFzkjQfL7hZPUy5yvvF/uPFQL3+nbDmsLCEmT3sTmCTNr'. + 'rogT6yFsOix3ftw7OwQhkvSU6CuinhCk0+kAkFoBazEEICHaHHiPVmU0gnUp4EAc1mYrF0EBVpwPi34VrBkwPxKk3W5ju/e5/c+d'. + 'bGUHIAIuydTIE5zfc5Wr4lJcahHnHTP3CVGm78DrgY38N+DEibp7dmYKdAQmBh1hjEFjis+9CTWYGK21H6PxPyOI0DobYwzZF/z7'. + '7jadTvJtYG0kCD7lfwl49ijgT1gc0AH+dZSJA/xB+Mz/GSIvFoj/B7H1mAd8CO/zAAAAAElFTkSuQmCC' ; + + $this->iLen = count($this->iBuiltinIcon); + } +} + +//=================================================== +// Global cache for builtin images +//=================================================== +$_gPredefIcons = new PredefIcons(); + +//=================================================== +// CLASS IconImage +// Description: Holds properties for an icon image +//=================================================== +class IconImage { + private $iGDImage=null; + private $iWidth,$iHeight; + private $ixalign='left',$iyalign='center'; + private $iScale=1.0; + + function __construct($aIcon,$aScale=1) { + GLOBAL $_gPredefIcons ; + if( is_string($aIcon) ) { + $this->iGDImage = Graph::LoadBkgImage('',$aIcon); + } + elseif( is_integer($aIcon) ) { + // Builtin image + $this->iGDImage = $_gPredefIcons->GetImg($aIcon); + } + else { + JpGraphError::RaiseL(6011); + //('Argument to IconImage must be string or integer'); + } + $this->iScale = $aScale; + $this->iWidth = Image::GetWidth($this->iGDImage); + $this->iHeight = Image::GetHeight($this->iGDImage); + } + + function GetWidth() { + return round($this->iScale*$this->iWidth); + } + + function GetHeight() { + return round($this->iScale*$this->iHeight); + } + + function SetAlign($aX='left',$aY='center') { + $this->ixalign = $aX; + $this->iyalign = $aY; + } + + function Stroke($aImg,$x,$y) { + + if( $this->ixalign == 'right' ) { + $x -= $this->iWidth; + } + elseif( $this->ixalign == 'center' ) { + $x -= round($this->iWidth/2*$this->iScale); + } + + if( $this->iyalign == 'bottom' ) { + $y -= $this->iHeight; + } + elseif( $this->iyalign == 'center' ) { + $y -= round($this->iHeight/2*$this->iScale); + } + + $aImg->Copy($this->iGDImage, + $x,$y,0,0, + round($this->iWidth*$this->iScale),round($this->iHeight*$this->iScale), + $this->iWidth,$this->iHeight); + } +} + + +//=================================================== +// CLASS TextProperty +// Description: Holds properties for a text +//=================================================== +class TextProperty { + public $iShow=true; + public $csimtarget='',$csimwintarget='',$csimalt=''; + private $iFFamily=FF_FONT1,$iFStyle=FS_NORMAL,$iFSize=10; + private $iFontArray=array(); + private $iColor="black"; + private $iText=""; + private $iHAlign="left",$iVAlign="bottom"; + + //--------------- + // CONSTRUCTOR + function __construct($aTxt='') { + $this->iText = $aTxt; + } + + //--------------- + // PUBLIC METHODS + function Set($aTxt) { + $this->iText = $aTxt; + } + + function SetCSIMTarget($aTarget,$aAltText='',$aWinTarget='') { + if( is_string($aTarget) ) + $aTarget = array($aTarget); + $this->csimtarget=$aTarget; + + if( is_string($aWinTarget) ) + $aWinTarget = array($aWinTarget); + $this->csimwintarget=$aWinTarget; + + if( is_string($aAltText) ) + $aAltText = array($aAltText); + $this->csimalt=$aAltText; + + } + + function SetCSIMAlt($aAltText) { + if( is_string($aAltText) ) + $aAltText = array($aAltText); + $this->csimalt=$aAltText; + } + + // Set text color + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function HasTabs() { + if( is_string($this->iText) ) { + return substr_count($this->iText,"\t") > 0; + } + elseif( is_array($this->iText) ) { + return false; + } + } + + // Get number of tabs in string + function GetNbrTabs() { + if( is_string($this->iText) ) { + return substr_count($this->iText,"\t") ; + } + else{ + return 0; + } + } + + // Set alignment + function Align($aHAlign,$aVAlign="bottom") { + $this->iHAlign=$aHAlign; + $this->iVAlign=$aVAlign; + } + + // Synonym + function SetAlign($aHAlign,$aVAlign="bottom") { + $this->iHAlign=$aHAlign; + $this->iVAlign=$aVAlign; + } + + // Specify font + function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) { + $this->iFFamily = $aFFamily; + $this->iFStyle = $aFStyle; + $this->iFSize = $aFSize; + } + + function SetColumnFonts($aFontArray) { + if( !is_array($aFontArray) || count($aFontArray[0]) != 3 ) { + JpGraphError::RaiseL(6033); + // 'Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)' + } + $this->iFontArray = $aFontArray; + } + + + function IsColumns() { + return is_array($this->iText) ; + } + + // Get width of text. If text contains several columns separated by + // tabs then return both the total width as well as an array with a + // width for each column. + function GetWidth($aImg,$aUseTabs=false,$aTabExtraMargin=1.1) { + $extra_margin=4; + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + if( is_string($this->iText) ) { + if( strlen($this->iText) == 0 ) return 0; + $tmp = preg_split('/\t/',$this->iText); + if( count($tmp) <= 1 || !$aUseTabs ) { + $w = $aImg->GetTextWidth($this->iText); + return $w + 2*$extra_margin; + } + else { + $tot=0; + $n = count($tmp); + for($i=0; $i < $n; ++$i) { + $res[$i] = $aImg->GetTextWidth($tmp[$i]); + $tot += $res[$i]*$aTabExtraMargin; + } + return array(round($tot),$res); + } + } + elseif( is_object($this->iText) ) { + // A single icon + return $this->iText->GetWidth()+2*$extra_margin; + } + elseif( is_array($this->iText) ) { + // Must be an array of texts. In this case we return the sum of the + // length + a fixed margin of 4 pixels on each text string + $n = count($this->iText); + $nf = count($this->iFontArray); + for( $i=0, $w=0; $i < $n; ++$i ) { + if( $i < $nf ) { + $aImg->SetFont($this->iFontArray[$i][0],$this->iFontArray[$i][1],$this->iFontArray[$i][2]); + } + else { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + } + $tmp = $this->iText[$i]; + if( is_string($tmp) ) { + $w += $aImg->GetTextWidth($tmp)+$extra_margin; + } + else { + if( is_object($tmp) === false ) { + JpGraphError::RaiseL(6012); + } + $w += $tmp->GetWidth()+$extra_margin; + } + } + return $w; + } + else { + JpGraphError::RaiseL(6012); + } + } + + // for the case where we have multiple columns this function returns the width of each + // column individually. If there is no columns just return the width of the single + // column as an array of one + function GetColWidth($aImg,$aMargin=0) { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + if( is_array($this->iText) ) { + $n = count($this->iText); + $nf = count($this->iFontArray); + for( $i=0, $w=array(); $i < $n; ++$i ) { + $tmp = $this->iText[$i]; + if( is_string($tmp) ) { + if( $i < $nf ) { + $aImg->SetFont($this->iFontArray[$i][0],$this->iFontArray[$i][1],$this->iFontArray[$i][2]); + } + else { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + } + $w[$i] = $aImg->GetTextWidth($tmp)+$aMargin; + } + else { + if( is_object($tmp) === false ) { + JpGraphError::RaiseL(6012); + } + $w[$i] = $tmp->GetWidth()+$aMargin; + } + } + return $w; + } + else { + return array($this->GetWidth($aImg)); + } + } + + // Get total height of text + function GetHeight($aImg) { + $nf = count($this->iFontArray); + $maxheight = -1; + + if( $nf > 0 ) { + // We have to find out the largest font and take that one as the + // height of the row + for($i=0; $i < $nf; ++$i ) { + $aImg->SetFont($this->iFontArray[$i][0],$this->iFontArray[$i][1],$this->iFontArray[$i][2]); + $height = $aImg->GetFontHeight(); + $maxheight = max($height,$maxheight); + } + } + + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + $height = $aImg->GetFontHeight(); + $maxheight = max($height,$maxheight); + return $maxheight; + } + + // Unhide/hide the text + function Show($aShow=true) { + $this->iShow=$aShow; + } + + // Stroke text at (x,y) coordinates. If the text contains tabs then the + // x parameter should be an array of positions to be used for each successive + // tab mark. If no array is supplied then the tabs will be ignored. + function Stroke($aImg,$aX,$aY) { + if( $this->iShow ) { + $aImg->SetColor($this->iColor); + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + $aImg->SetTextAlign($this->iHAlign,$this->iVAlign); + if( $this->GetNbrTabs() < 1 ) { + if( is_string($this->iText) ) { + if( is_array($aX) ) $aX=$aX[0]; + if( is_array($aY) ) $aY=$aY[0]; + $aImg->StrokeText($aX,$aY,$this->iText); + } + elseif( is_array($this->iText) && ($n = count($this->iText)) > 0 ) { + $ax = is_array($aX) ; + $ay = is_array($aY) ; + if( $ax && $ay ) { + // Nothing; both are already arrays + } + elseif( $ax ) { + $aY = array_fill(0,$n,$aY); + } + elseif( $ay ) { + $aX = array_fill(0,$n,$aX); + } + else { + $aX = array_fill(0,$n,$aX); + $aY = array_fill(0,$n,$aY); + } + $n = min($n, count($aX) ) ; + $n = min($n, count($aY) ) ; + for($i=0; $i < $n; ++$i ) { + $tmp = $this->iText[$i]; + if( is_object($tmp) ) { + $tmp->Stroke($aImg,$aX[$i],$aY[$i]); + } + else { + if( $i < count($this->iFontArray) ) { + $font = $this->iFontArray[$i]; + $aImg->SetFont($font[0],$font[1],$font[2]); + } + else { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + } + $aImg->StrokeText($aX[$i],$aY[$i],str_replace("\t"," ",$tmp)); + } + } + } + } + else { + $tmp = preg_split('/\t/',$this->iText); + $n = min(count($tmp),count($aX)); + for($i=0; $i < $n; ++$i) { + if( $i < count($this->iFontArray) ) { + $font = $this->iFontArray[$i]; + $aImg->SetFont($font[0],$font[1],$font[2]); + } + else { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + } + $aImg->StrokeText($aX[$i],$aY,$tmp[$i]); + } + } + } + } +} + +//=================================================== +// CLASS HeaderProperty +// Description: Data encapsulating class to hold property +// for each type of the scale headers +//=================================================== +class HeaderProperty { + public $grid; + public $iShowLabels=true,$iShowGrid=true; + public $iTitleVertMargin=3,$iFFamily=FF_FONT0,$iFStyle=FS_NORMAL,$iFSize=8; + public $iStyle=0; + public $iFrameColor="black",$iFrameWeight=1; + public $iBackgroundColor="white"; + public $iWeekendBackgroundColor="lightgray",$iSundayTextColor="red"; // these are only used with day scale + public $iTextColor="black"; + public $iLabelFormStr="%d"; + public $iIntervall = 1; + + //--------------- + // CONSTRUCTOR + function __construct() { + $this->grid = new LineProperty(); + } + + //--------------- + // PUBLIC METHODS + function Show($aShow=true) { + $this->iShowLabels = $aShow; + } + + function SetIntervall($aInt) { + $this->iIntervall = $aInt; + } + + function SetInterval($aInt) { + $this->iIntervall = $aInt; + } + + function GetIntervall() { + return $this->iIntervall ; + } + + function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) { + $this->iFFamily = $aFFamily; + $this->iFStyle = $aFStyle; + $this->iFSize = $aFSize; + } + + function SetFontColor($aColor) { + $this->iTextColor = $aColor; + } + + function GetFontHeight($aImg) { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + return $aImg->GetFontHeight(); + } + + function GetFontWidth($aImg) { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + return $aImg->GetFontWidth(); + } + + function GetStrWidth($aImg,$aStr) { + $aImg->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize); + return $aImg->GetTextWidth($aStr); + } + + function SetStyle($aStyle) { + $this->iStyle = $aStyle; + } + + function SetBackgroundColor($aColor) { + $this->iBackgroundColor=$aColor; + } + + function SetFrameWeight($aWeight) { + $this->iFrameWeight=$aWeight; + } + + function SetFrameColor($aColor) { + $this->iFrameColor=$aColor; + } + + // Only used by day scale + function SetWeekendColor($aColor) { + $this->iWeekendBackgroundColor=$aColor; + } + + // Only used by day scale + function SetSundayFontColor($aColor) { + $this->iSundayTextColor=$aColor; + } + + function SetTitleVertMargin($aMargin) { + $this->iTitleVertMargin=$aMargin; + } + + function SetLabelFormatString($aStr) { + $this->iLabelFormStr=$aStr; + } + + function SetFormatString($aStr) { + $this->SetLabelFormatString($aStr); + } + + +} + +//=================================================== +// CLASS GanttScale +// Description: Responsible for calculating and showing +// the scale in a gantt chart. This includes providing methods for +// converting dates to position in the chart as well as stroking the +// date headers (days, week, etc). +//=================================================== +class GanttScale { + public $minute,$hour,$day,$week,$month,$year; + public $divider,$dividerh,$tableTitle; + public $iStartDate=-1,$iEndDate=-1; + // Number of gantt bar position (n.b not necessariliy the same as the number of bars) + // we could have on bar in position 1, and one bar in position 5 then there are two + // bars but the number of bar positions is 5 + public $actinfo; + public $iTopPlotMargin=10,$iBottomPlotMargin=15; + public $iVertLines=-1; + public $iVertHeaderSize=-1; + // The width of the labels (defaults to the widest of all labels) + private $iLabelWidth; + // Out image to stroke the scale to + private $iImg; + private $iTableHeaderBackgroundColor="white",$iTableHeaderFrameColor="black"; + private $iTableHeaderFrameWeight=1; + private $iAvailableHeight=-1,$iVertSpacing=-1; + private $iDateLocale; + private $iVertLayout=GANTT_EVEN; + private $iUsePlotWeekendBackground=true; + private $iWeekStart = 1; // Default to have weekends start on Monday + + //--------------- + // CONSTRUCTOR + function __construct($aImg) { + $this->iImg = $aImg; + $this->iDateLocale = new DateLocale(); + + $this->minute = new HeaderProperty(); + $this->minute->SetIntervall(15); + $this->minute->SetLabelFormatString('i'); + $this->minute->SetFont(FF_FONT0); + $this->minute->grid->SetColor("gray"); + + $this->hour = new HeaderProperty(); + $this->hour->SetFont(FF_FONT0); + $this->hour->SetIntervall(6); + $this->hour->SetStyle(HOURSTYLE_HM24); + $this->hour->SetLabelFormatString('H:i'); + $this->hour->grid->SetColor("gray"); + + $this->day = new HeaderProperty(); + $this->day->grid->SetColor("gray"); + $this->day->SetLabelFormatString('l'); + + $this->week = new HeaderProperty(); + $this->week->SetLabelFormatString("w%d"); + $this->week->SetFont(FF_FONT1); + + $this->month = new HeaderProperty(); + $this->month->SetFont(FF_FONT1,FS_BOLD); + + $this->year = new HeaderProperty(); + $this->year->SetFont(FF_FONT1,FS_BOLD); + + $this->divider=new LineProperty(); + $this->dividerh=new LineProperty(); + $this->dividerh->SetWeight(2); + $this->divider->SetWeight(6); + $this->divider->SetColor('gray'); + $this->divider->SetStyle('fancy'); + + $this->tableTitle=new TextProperty(); + $this->tableTitle->Show(false); + $this->actinfo = new GanttActivityInfo(); + } + + //--------------- + // PUBLIC METHODS + // Specify what headers should be visible + function ShowHeaders($aFlg) { + $this->day->Show($aFlg & GANTT_HDAY); + $this->week->Show($aFlg & GANTT_HWEEK); + $this->month->Show($aFlg & GANTT_HMONTH); + $this->year->Show($aFlg & GANTT_HYEAR); + $this->hour->Show($aFlg & GANTT_HHOUR); + $this->minute->Show($aFlg & GANTT_HMIN); + + // Make some default settings of gridlines whihc makes sense + if( $aFlg & GANTT_HWEEK ) { + $this->month->grid->Show(false); + $this->year->grid->Show(false); + } + if( $aFlg & GANTT_HHOUR ) { + $this->day->grid->SetColor("black"); + } + } + + // Should the weekend background stretch all the way down in the plotarea + function UseWeekendBackground($aShow) { + $this->iUsePlotWeekendBackground = $aShow; + } + + // Have a range been specified? + function IsRangeSet() { + return $this->iStartDate!=-1 && $this->iEndDate!=-1; + } + + // Should the layout be from top or even? + function SetVertLayout($aLayout) { + $this->iVertLayout = $aLayout; + } + + // Which locale should be used? + function SetDateLocale($aLocale) { + $this->iDateLocale->Set($aLocale); + } + + // Number of days we are showing + function GetNumberOfDays() { + return round(($this->iEndDate-$this->iStartDate)/SECPERDAY); + } + + // The width of the actual plot area + function GetPlotWidth() { + $img=$this->iImg; + return $img->width - $img->left_margin - $img->right_margin; + } + + // Specify the width of the titles(labels) for the activities + // (This is by default set to the minimum width enought for the + // widest title) + function SetLabelWidth($aLabelWidth) { + $this->iLabelWidth=$aLabelWidth; + } + + // Which day should the week start? + // 0==Sun, 1==Monday, 2==Tuesday etc + function SetWeekStart($aStartDay) { + $this->iWeekStart = $aStartDay % 7; + + //Recalculate the startday since this will change the week start + $this->SetRange($this->iStartDate,$this->iEndDate); + } + + // Do we show min scale? + function IsDisplayMinute() { + return $this->minute->iShowLabels; + } + + // Do we show day scale? + function IsDisplayHour() { + return $this->hour->iShowLabels; + } + + + // Do we show day scale? + function IsDisplayDay() { + return $this->day->iShowLabels; + } + + // Do we show week scale? + function IsDisplayWeek() { + return $this->week->iShowLabels; + } + + // Do we show month scale? + function IsDisplayMonth() { + return $this->month->iShowLabels; + } + + // Do we show year scale? + function IsDisplayYear() { + return $this->year->iShowLabels; + } + + // Specify spacing (in percent of bar height) between activity bars + function SetVertSpacing($aSpacing) { + $this->iVertSpacing = $aSpacing; + } + + // Specify scale min and max date either as timestamp or as date strings + // Always round to the nearest week boundary + function SetRange($aMin,$aMax) { + $this->iStartDate = $this->NormalizeDate($aMin); + $this->iEndDate = $this->NormalizeDate($aMax); + } + + + // Adjust the start and end date so they fit to beginning/ending + // of the week taking the specified week start day into account. + function AdjustStartEndDay() { + + if( !($this->IsDisplayYear() ||$this->IsDisplayMonth() || $this->IsDisplayWeek()) ) { + // Don't adjust + return; + } + + // Get day in week for start and ending date (Sun==0) + $ds=strftime("%w",$this->iStartDate); + $de=strftime("%w",$this->iEndDate); + + // We want to start on iWeekStart day. But first we subtract a week + // if the startdate is "behind" the day the week start at. + // This way we ensure that the given start date is always included + // in the range. If we don't do this the nearest correct weekday in the week + // to start at might be later than the start date. + if( $ds < $this->iWeekStart ) + $d = strtotime('-7 day',$this->iStartDate); + else + $d = $this->iStartDate; + $adjdate = strtotime(($this->iWeekStart-$ds).' day',$d /*$this->iStartDate*/ ); + $this->iStartDate = $adjdate; + + // We want to end on the last day of the week + $preferredEndDay = ($this->iWeekStart+6)%7; + if( $preferredEndDay != $de ) { + // Solve equivalence eq: $de + x ~ $preferredDay (mod 7) + $adj = (7+($preferredEndDay - $de)) % 7; + $adjdate = strtotime("+$adj day",$this->iEndDate); + $this->iEndDate = $adjdate; + } + } + + // Specify background for the table title area (upper left corner of the table) + function SetTableTitleBackground($aColor) { + $this->iTableHeaderBackgroundColor = $aColor; + } + + /////////////////////////////////////// + // PRIVATE Methods + + // Determine the height of all the scale headers combined + function GetHeaderHeight() { + $img=$this->iImg; + $height=1; + if( $this->minute->iShowLabels ) { + $height += $this->minute->GetFontHeight($img); + $height += $this->minute->iTitleVertMargin; + } + if( $this->hour->iShowLabels ) { + $height += $this->hour->GetFontHeight($img); + $height += $this->hour->iTitleVertMargin; + } + if( $this->day->iShowLabels ) { + $height += $this->day->GetFontHeight($img); + $height += $this->day->iTitleVertMargin; + } + if( $this->week->iShowLabels ) { + $height += $this->week->GetFontHeight($img); + $height += $this->week->iTitleVertMargin; + } + if( $this->month->iShowLabels ) { + $height += $this->month->GetFontHeight($img); + $height += $this->month->iTitleVertMargin; + } + if( $this->year->iShowLabels ) { + $height += $this->year->GetFontHeight($img); + $height += $this->year->iTitleVertMargin; + } + return $height; + } + + // Get width (in pixels) for a single day + function GetDayWidth() { + return ($this->GetPlotWidth()-$this->iLabelWidth+1)/$this->GetNumberOfDays(); + } + + // Get width (in pixels) for a single hour + function GetHourWidth() { + return $this->GetDayWidth() / 24 ; + } + + function GetMinuteWidth() { + return $this->GetHourWidth() / 60 ; + } + + // Nuber of days in a year + function GetNumDaysInYear($aYear) { + if( $this->IsLeap($aYear) ) + return 366; + else + return 365; + } + + // Get week number + function GetWeekNbr($aDate,$aSunStart=true) { + // We can't use the internal strftime() since it gets the weeknumber + // wrong since it doesn't follow ISO on all systems since this is + // system linrary dependent. + // Even worse is that this works differently if we are on a Windows + // or UNIX box (it even differs between UNIX boxes how strftime() + // is natively implemented) + // + // Credit to Nicolas Hoizey for this elegant + // version of Week Nbr calculation. + + $day = $this->NormalizeDate($aDate); + if( $aSunStart ) + $day += 60*60*24; + + /*------------------------------------------------------------------------- + According to ISO-8601 : + "Week 01 of a year is per definition the first week that has the Thursday in this year, + which is equivalent to the week that contains the fourth day of January. + In other words, the first week of a new year is the week that has the majority of its + days in the new year." + + Be carefull, with PHP, -3 % 7 = -3, instead of 4 !!! + + day of year = date("z", $day) + 1 + offset to thursday = 3 - (date("w", $day) + 6) % 7 + first thursday of year = 1 + (11 - date("w", mktime(0, 0, 0, 1, 1, date("Y", $day)))) % 7 + week number = (thursday's day of year - first thursday's day of year) / 7 + 1 + ---------------------------------------------------------------------------*/ + + $thursday = $day + 60 * 60 * 24 * (3 - (date("w", $day) + 6) % 7); // take week's thursday + $week = 1 + (date("z", $thursday) - (11 - date("w", mktime(0, 0, 0, 1, 1, date("Y", $thursday)))) % 7) / 7; + + return $week; + } + + // Is year a leap year? + function IsLeap($aYear) { + // Is the year a leap year? + //$year = 0+date("Y",$aDate); + if( $aYear % 4 == 0) + if( !($aYear % 100 == 0) || ($aYear % 400 == 0) ) + return true; + return false; + } + + // Get current year + function GetYear($aDate) { + return 0+Date("Y",$aDate); + } + + // Return number of days in a year + function GetNumDaysInMonth($aMonth,$aYear) { + $days=array(31,28,31,30,31,30,31,31,30,31,30,31); + $daysl=array(31,29,31,30,31,30,31,31,30,31,30,31); + if( $this->IsLeap($aYear)) + return $daysl[$aMonth]; + else + return $days[$aMonth]; + } + + // Get day in month + function GetMonthDayNbr($aDate) { + return 0+strftime("%d",$aDate); + } + + // Get day in year + function GetYearDayNbr($aDate) { + return 0+strftime("%j",$aDate); + } + + // Get month number + function GetMonthNbr($aDate) { + return 0+strftime("%m",$aDate); + } + + // Translate a date to screen coordinates (horizontal scale) + function TranslateDate($aDate) { + // + // In order to handle the problem with Daylight savings time + // the scale written with equal number of seconds per day beginning + // with the start date. This means that we "cement" the state of + // DST as it is in the start date. If later the scale includes the + // switchover date (depends on the locale) we need to adjust back + // if the date we try to translate has a different DST status since + // we would otherwise be off by one hour. + $aDate = $this->NormalizeDate($aDate); + $tmp = localtime($aDate); + $cloc = $tmp[8]; + $tmp = localtime($this->iStartDate); + $sloc = $tmp[8]; + $offset = 0; + if( $sloc != $cloc) { + if( $sloc ) + $offset = 3600; + else + $offset = -3600; + } + $img=$this->iImg; + return ($aDate-$this->iStartDate-$offset)/SECPERDAY*$this->GetDayWidth()+$img->left_margin+$this->iLabelWidth;; + } + + // Get screen coordinatesz for the vertical position for a bar + function TranslateVertPos($aPos,$atTop=false) { + $img=$this->iImg; + if( $aPos > $this->iVertLines ) + JpGraphError::RaiseL(6015,$aPos); + // 'Illegal vertical position %d' + if( $this->iVertLayout == GANTT_EVEN ) { + // Position the top bar at 1 vert spacing from the scale + $pos = round($img->top_margin + $this->iVertHeaderSize + ($aPos+1)*$this->iVertSpacing); + } + else { + // position the top bar at 1/2 a vert spacing from the scale + $pos = round($img->top_margin + $this->iVertHeaderSize + $this->iTopPlotMargin + ($aPos+1)*$this->iVertSpacing); + } + + if( $atTop ) + $pos -= $this->iVertSpacing; + + return $pos; + } + + // What is the vertical spacing? + function GetVertSpacing() { + return $this->iVertSpacing; + } + + // Convert a date to timestamp + function NormalizeDate($aDate) { + if( $aDate === false ) return false; + if( is_string($aDate) ) { + $t = strtotime($aDate); + if( $t === FALSE || $t === -1 ) { + JpGraphError::RaiseL(6016,$aDate); + //("Date string ($aDate) specified for Gantt activity can not be interpretated. Please make sure it is a valid time string, e.g. 2005-04-23 13:30"); + } + return $t; + } + elseif( is_int($aDate) || is_float($aDate) ) + return $aDate; + else + JpGraphError::RaiseL(6017,$aDate); + //Unknown date format in GanttScale ($aDate)."); + } + + + // Convert a time string to minutes + + function TimeToMinutes($aTimeString) { + // Split in hours and minutes + $pos=strpos($aTimeString,':'); + $minint=60; + if( $pos === false ) { + $hourint = $aTimeString; + $minint = 0; + } + else { + $hourint = floor(substr($aTimeString,0,$pos)); + $minint = floor(substr($aTimeString,$pos+1)); + } + $minint += 60 * $hourint; + return $minint; + } + + // Stroke the day scale (including gridlines) + function StrokeMinutes($aYCoord,$getHeight=false) { + $img=$this->iImg; + $xt=$img->left_margin+$this->iLabelWidth; + $yt=$aYCoord+$img->top_margin; + if( $this->minute->iShowLabels ) { + $img->SetFont($this->minute->iFFamily,$this->minute->iFStyle,$this->minute->iFSize); + $yb = $yt + $img->GetFontHeight() + + $this->minute->iTitleVertMargin + $this->minute->iFrameWeight; + if( $getHeight ) { + return $yb - $img->top_margin; + } + $xb = $img->width-$img->right_margin+1; + $img->SetColor($this->minute->iBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + + $x = $xt; + $img->SetTextAlign("center"); + $day = date('w',$this->iStartDate); + $minint = $this->minute->GetIntervall() ; + + if( 60 % $minint !== 0 ) { + JpGraphError::RaiseL(6018,$minint); + //'Intervall for minutes must divide the hour evenly, e.g. 1,5,10,12,15,20,30 etc You have specified an intervall of '.$minint.' minutes.'); + } + + + $n = 60 / $minint; + $datestamp = $this->iStartDate; + $width = $this->GetHourWidth() / $n ; + if( $width < 8 ) { + // TO small width to draw minute scale + JpGraphError::RaiseL(6019,$width); + //('The available width ('.$width.') for minutes are to small for this scale to be displayed. Please use auto-sizing or increase the width of the graph.'); + } + + $nh = ceil(24*60 / $this->TimeToMinutes($this->hour->GetIntervall()) ); + $nd = $this->GetNumberOfDays(); + // Convert to intervall to seconds + $minint *= 60; + for($j=0; $j < $nd; ++$j, $day += 1, $day %= 7) { + for( $k=0; $k < $nh; ++$k ) { + for($i=0; $i < $n ;++$i, $x+=$width, $datestamp += $minint ) { + if( $day==6 || $day==0 ) { + + $img->PushColor($this->day->iWeekendBackgroundColor); + if( $this->iUsePlotWeekendBackground ) + $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$img->height-$img->bottom_margin); + else + $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$yb-$this->day->iFrameWeight); + $img->PopColor(); + + } + + if( $day==0 ) + $img->SetColor($this->day->iSundayTextColor); + else + $img->SetColor($this->day->iTextColor); + + switch( $this->minute->iStyle ) { + case MINUTESTYLE_CUSTOM: + $txt = date($this->minute->iLabelFormStr,$datestamp); + break; + case MINUTESTYLE_MM: + default: + // 15 + $txt = date('i',$datestamp); + break; + } + $img->StrokeText(round($x+$width/2),round($yb-$this->minute->iTitleVertMargin),$txt); + + // Fix a rounding problem the wrong way .. + // If we also have hour scale then don't draw the firsta or last + // gridline since that will be overwritten by the hour scale gridline if such exists. + // However, due to the propagation of rounding of the 'x+=width' term in the loop + // this might sometimes be one pixel of so we fix this by not drawing it. + // The proper way to fix it would be to re-calculate the scale for each step and + // not using the additive term. + if( !(($i == $n || $i==0) && $this->hour->iShowLabels && $this->hour->grid->iShow) ) { + $img->SetColor($this->minute->grid->iColor); + $img->SetLineWeight($this->minute->grid->iWeight); + $img->Line($x,$yt,$x,$yb); + $this->minute->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); + } + } + } + } + $img->SetColor($this->minute->iFrameColor); + $img->SetLineWeight($this->minute->iFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + return $yb - $img->top_margin; + } + return $aYCoord; + } + + // Stroke the day scale (including gridlines) + function StrokeHours($aYCoord,$getHeight=false) { + $img=$this->iImg; + $xt=$img->left_margin+$this->iLabelWidth; + $yt=$aYCoord+$img->top_margin; + if( $this->hour->iShowLabels ) { + $img->SetFont($this->hour->iFFamily,$this->hour->iFStyle,$this->hour->iFSize); + $yb = $yt + $img->GetFontHeight() + + $this->hour->iTitleVertMargin + $this->hour->iFrameWeight; + if( $getHeight ) { + return $yb - $img->top_margin; + } + $xb = $img->width-$img->right_margin+1; + $img->SetColor($this->hour->iBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + + $x = $xt; + $img->SetTextAlign("center"); + $tmp = $this->hour->GetIntervall() ; + $minint = $this->TimeToMinutes($tmp); + if( 1440 % $minint !== 0 ) { + JpGraphError::RaiseL(6020,$tmp); + //('Intervall for hours must divide the day evenly, e.g. 0:30, 1:00, 1:30, 4:00 etc. You have specified an intervall of '.$tmp); + } + + $n = ceil(24*60 / $minint ); + $datestamp = $this->iStartDate; + $day = date('w',$this->iStartDate); + $doback = !$this->minute->iShowLabels; + $width = $this->GetDayWidth() / $n ; + for($j=0; $j < $this->GetNumberOfDays(); ++$j, $day += 1,$day %= 7) { + for($i=0; $i < $n ;++$i, $x+=$width) { + if( $day==6 || $day==0 ) { + + $img->PushColor($this->day->iWeekendBackgroundColor); + if( $this->iUsePlotWeekendBackground && $doback ) + $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$img->height-$img->bottom_margin); + else + $img->FilledRectangle($x,$yt+$this->day->iFrameWeight,$x+$width,$yb-$this->day->iFrameWeight); + $img->PopColor(); + + } + + if( $day==0 ) + $img->SetColor($this->day->iSundayTextColor); + else + $img->SetColor($this->day->iTextColor); + + switch( $this->hour->iStyle ) { + case HOURSTYLE_HMAMPM: + // 1:35pm + $txt = date('g:ia',$datestamp); + break; + case HOURSTYLE_H24: + // 13 + $txt = date('H',$datestamp); + break; + case HOURSTYLE_HAMPM: + $txt = date('ga',$datestamp); + break; + case HOURSTYLE_CUSTOM: + $txt = date($this->hour->iLabelFormStr,$datestamp); + break; + case HOURSTYLE_HM24: + default: + $txt = date('H:i',$datestamp); + break; + } + $img->StrokeText(round($x+$width/2),round($yb-$this->hour->iTitleVertMargin),$txt); + $img->SetColor($this->hour->grid->iColor); + $img->SetLineWeight($this->hour->grid->iWeight); + $img->Line($x,$yt,$x,$yb); + $this->hour->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); + //$datestamp += $minint*60 + $datestamp = mktime(date('H',$datestamp),date('i',$datestamp)+$minint,0, + date("m",$datestamp),date("d",$datestamp)+1,date("Y",$datestamp)); + + } + } + $img->SetColor($this->hour->iFrameColor); + $img->SetLineWeight($this->hour->iFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + return $yb - $img->top_margin; + } + return $aYCoord; + } + + + // Stroke the day scale (including gridlines) + function StrokeDays($aYCoord,$getHeight=false) { + $img=$this->iImg; + $daywidth=$this->GetDayWidth(); + $xt=$img->left_margin+$this->iLabelWidth; + $yt=$aYCoord+$img->top_margin; + if( $this->day->iShowLabels ) { + $img->SetFont($this->day->iFFamily,$this->day->iFStyle,$this->day->iFSize); + $yb=$yt + $img->GetFontHeight() + $this->day->iTitleVertMargin + $this->day->iFrameWeight; + if( $getHeight ) { + return $yb - $img->top_margin; + } + $xb=$img->width-$img->right_margin+1; + $img->SetColor($this->day->iBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + + $x = $xt; + $img->SetTextAlign("center"); + $day = date('w',$this->iStartDate); + $datestamp = $this->iStartDate; + + $doback = !($this->hour->iShowLabels || $this->minute->iShowLabels); + + setlocale(LC_TIME,$this->iDateLocale->iLocale); + + for($i=0; $i < $this->GetNumberOfDays(); ++$i, $x+=$daywidth, $day += 1,$day %= 7) { + if( $day==6 || $day==0 ) { + $img->SetColor($this->day->iWeekendBackgroundColor); + if( $this->iUsePlotWeekendBackground && $doback) + $img->FilledRectangle($x,$yt+$this->day->iFrameWeight, + $x+$daywidth,$img->height-$img->bottom_margin); + else + $img->FilledRectangle($x,$yt+$this->day->iFrameWeight, + $x+$daywidth,$yb-$this->day->iFrameWeight); + } + + $mn = strftime('%m',$datestamp); + if( $mn[0]=='0' ) + $mn = $mn[1]; + + switch( $this->day->iStyle ) { + case DAYSTYLE_LONG: + // "Monday" + $txt = strftime('%A',$datestamp); + break; + case DAYSTYLE_SHORT: + // "Mon" + $txt = strftime('%a',$datestamp); + break; + case DAYSTYLE_SHORTDAYDATE1: + // "Mon 23/6" + $txt = strftime('%a %d/'.$mn,$datestamp); + break; + case DAYSTYLE_SHORTDAYDATE2: + // "Mon 23 Jun" + $txt = strftime('%a %d %b',$datestamp); + break; + case DAYSTYLE_SHORTDAYDATE3: + // "Mon 23 Jun 2003" + $txt = strftime('%a %d %b %Y',$datestamp); + break; + case DAYSTYLE_LONGDAYDATE1: + // "Monday 23 Jun" + $txt = strftime('%A %d %b',$datestamp); + break; + case DAYSTYLE_LONGDAYDATE2: + // "Monday 23 Jun 2003" + $txt = strftime('%A %d %b %Y',$datestamp); + break; + case DAYSTYLE_SHORTDATE1: + // "23/6" + $txt = strftime('%d/'.$mn,$datestamp); + break; + case DAYSTYLE_SHORTDATE2: + // "23 Jun" + $txt = strftime('%d %b',$datestamp); + break; + case DAYSTYLE_SHORTDATE3: + // "Mon 23" + $txt = strftime('%a %d',$datestamp); + break; + case DAYSTYLE_SHORTDATE4: + // "23" + $txt = strftime('%d',$datestamp); + break; + case DAYSTYLE_CUSTOM: + // Custom format + $txt = strftime($this->day->iLabelFormStr,$datestamp); + break; + case DAYSTYLE_ONELETTER: + default: + // "M" + $txt = strftime('%A',$datestamp); + $txt = strtoupper($txt[0]); + break; + } + + if( $day==0 ) + $img->SetColor($this->day->iSundayTextColor); + else + $img->SetColor($this->day->iTextColor); + $img->StrokeText(round($x+$daywidth/2+1), + round($yb-$this->day->iTitleVertMargin),$txt); + $img->SetColor($this->day->grid->iColor); + $img->SetLineWeight($this->day->grid->iWeight); + $img->Line($x,$yt,$x,$yb); + $this->day->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); + $datestamp = mktime(0,0,0,date("m",$datestamp),date("d",$datestamp)+1,date("Y",$datestamp)); + //$datestamp += SECPERDAY; + + } + $img->SetColor($this->day->iFrameColor); + $img->SetLineWeight($this->day->iFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + return $yb - $img->top_margin; + } + return $aYCoord; + } + + // Stroke week header and grid + function StrokeWeeks($aYCoord,$getHeight=false) { + if( $this->week->iShowLabels ) { + $img=$this->iImg; + $yt=$aYCoord+$img->top_margin; + $img->SetFont($this->week->iFFamily,$this->week->iFStyle,$this->week->iFSize); + $yb=$yt + $img->GetFontHeight() + $this->week->iTitleVertMargin + $this->week->iFrameWeight; + + if( $getHeight ) { + return $yb - $img->top_margin; + } + + $xt=$img->left_margin+$this->iLabelWidth; + $weekwidth=$this->GetDayWidth()*7; + $wdays=$this->iDateLocale->GetDayAbb(); + $xb=$img->width-$img->right_margin+1; + $week = $this->iStartDate; + $weeknbr=$this->GetWeekNbr($week); + $img->SetColor($this->week->iBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + $img->SetColor($this->week->grid->iColor); + $x = $xt; + if( $this->week->iStyle==WEEKSTYLE_WNBR ) { + $img->SetTextAlign("center"); + $txtOffset = $weekwidth/2+1; + } + elseif( $this->week->iStyle==WEEKSTYLE_FIRSTDAY || + $this->week->iStyle==WEEKSTYLE_FIRSTDAY2 || + $this->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR || + $this->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { + $img->SetTextAlign("left"); + $txtOffset = 3; + } + else { + JpGraphError::RaiseL(6021); + //("Unknown formatting style for week."); + } + + for($i=0; $i<$this->GetNumberOfDays()/7; ++$i, $x+=$weekwidth) { + $img->PushColor($this->week->iTextColor); + + if( $this->week->iStyle==WEEKSTYLE_WNBR ) + $txt = sprintf($this->week->iLabelFormStr,$weeknbr); + elseif( $this->week->iStyle==WEEKSTYLE_FIRSTDAY || + $this->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR ) + $txt = date("j/n",$week); + elseif( $this->week->iStyle==WEEKSTYLE_FIRSTDAY2 || + $this->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { + $monthnbr = date("n",$week)-1; + $shortmonth = $this->iDateLocale->GetShortMonthName($monthnbr); + $txt = Date("j",$week)." ".$shortmonth; + } + + if( $this->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR || + $this->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) { + $w = sprintf($this->week->iLabelFormStr,$weeknbr); + $txt .= ' '.$w; + } + + $img->StrokeText(round($x+$txtOffset), + round($yb-$this->week->iTitleVertMargin),$txt); + + $week = strtotime('+7 day',$week); + $weeknbr = $this->GetWeekNbr($week); + $img->PopColor(); + $img->SetLineWeight($this->week->grid->iWeight); + $img->Line($x,$yt,$x,$yb); + $this->week->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); + } + $img->SetColor($this->week->iFrameColor); + $img->SetLineWeight($this->week->iFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + return $yb-$img->top_margin; + } + return $aYCoord; + } + + // Format the mont scale header string + function GetMonthLabel($aMonthNbr,$year) { + $sn = $this->iDateLocale->GetShortMonthName($aMonthNbr); + $ln = $this->iDateLocale->GetLongMonthName($aMonthNbr); + switch($this->month->iStyle) { + case MONTHSTYLE_SHORTNAME: + $m=$sn; + break; + case MONTHSTYLE_LONGNAME: + $m=$ln; + break; + case MONTHSTYLE_SHORTNAMEYEAR2: + $m=$sn." '".substr("".$year,2); + break; + case MONTHSTYLE_SHORTNAMEYEAR4: + $m=$sn." ".$year; + break; + case MONTHSTYLE_LONGNAMEYEAR2: + $m=$ln." '".substr("".$year,2); + break; + case MONTHSTYLE_LONGNAMEYEAR4: + $m=$ln." ".$year; + break; + case MONTHSTYLE_FIRSTLETTER: + $m=$sn[0]; + break; + } + return $m; + } + + // Stroke month scale and gridlines + function StrokeMonths($aYCoord,$getHeight=false) { + if( $this->month->iShowLabels ) { + $img=$this->iImg; + $img->SetFont($this->month->iFFamily,$this->month->iFStyle,$this->month->iFSize); + $yt=$aYCoord+$img->top_margin; + $yb=$yt + $img->GetFontHeight() + $this->month->iTitleVertMargin + $this->month->iFrameWeight; + if( $getHeight ) { + return $yb - $img->top_margin; + } + $monthnbr = $this->GetMonthNbr($this->iStartDate)-1; + $xt=$img->left_margin+$this->iLabelWidth; + $xb=$img->width-$img->right_margin+1; + + $img->SetColor($this->month->iBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + + $img->SetLineWeight($this->month->grid->iWeight); + $img->SetColor($this->month->iTextColor); + $year = 0+strftime("%Y",$this->iStartDate); + $img->SetTextAlign("center"); + if( $this->GetMonthNbr($this->iStartDate) == $this->GetMonthNbr($this->iEndDate) + && $this->GetYear($this->iStartDate)==$this->GetYear($this->iEndDate) ) { + $monthwidth=$this->GetDayWidth()*($this->GetMonthDayNbr($this->iEndDate) - $this->GetMonthDayNbr($this->iStartDate) + 1); + } + else { + $monthwidth=$this->GetDayWidth()*($this->GetNumDaysInMonth($monthnbr,$year)-$this->GetMonthDayNbr($this->iStartDate)+1); + } + // Is it enough space to stroke the first month? + $monthName = $this->GetMonthLabel($monthnbr,$year); + if( $monthwidth >= 1.2*$img->GetTextWidth($monthName) ) { + $img->SetColor($this->month->iTextColor); + $img->StrokeText(round($xt+$monthwidth/2+1), + round($yb-$this->month->iTitleVertMargin), + $monthName); + } + $x = $xt + $monthwidth; + while( $x < $xb ) { + $img->SetColor($this->month->grid->iColor); + $img->Line($x,$yt,$x,$yb); + $this->month->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); + $monthnbr++; + if( $monthnbr==12 ) { + $monthnbr=0; + $year++; + } + $monthName = $this->GetMonthLabel($monthnbr,$year); + $monthwidth=$this->GetDayWidth()*$this->GetNumDaysInMonth($monthnbr,$year); + if( $x + $monthwidth < $xb ) + $w = $monthwidth; + else + $w = $xb-$x; + if( $w >= 1.2*$img->GetTextWidth($monthName) ) { + $img->SetColor($this->month->iTextColor); + $img->StrokeText(round($x+$w/2+1), + round($yb-$this->month->iTitleVertMargin),$monthName); + } + $x += $monthwidth; + } + $img->SetColor($this->month->iFrameColor); + $img->SetLineWeight($this->month->iFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + return $yb-$img->top_margin; + } + return $aYCoord; + } + + // Stroke year scale and gridlines + function StrokeYears($aYCoord,$getHeight=false) { + if( $this->year->iShowLabels ) { + $img=$this->iImg; + $yt=$aYCoord+$img->top_margin; + $img->SetFont($this->year->iFFamily,$this->year->iFStyle,$this->year->iFSize); + $yb=$yt + $img->GetFontHeight() + $this->year->iTitleVertMargin + $this->year->iFrameWeight; + + if( $getHeight ) { + return $yb - $img->top_margin; + } + + $xb=$img->width-$img->right_margin+1; + $xt=$img->left_margin+$this->iLabelWidth; + $year = $this->GetYear($this->iStartDate); + $img->SetColor($this->year->iBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + $img->SetLineWeight($this->year->grid->iWeight); + $img->SetTextAlign("center"); + if( $year == $this->GetYear($this->iEndDate) ) + $yearwidth=$this->GetDayWidth()*($this->GetYearDayNbr($this->iEndDate)-$this->GetYearDayNbr($this->iStartDate)+1); + else + $yearwidth=$this->GetDayWidth()*($this->GetNumDaysInYear($year)-$this->GetYearDayNbr($this->iStartDate)+1); + + // The space for a year must be at least 20% bigger than the actual text + // so we allow 10% margin on each side + if( $yearwidth >= 1.20*$img->GetTextWidth("".$year) ) { + $img->SetColor($this->year->iTextColor); + $img->StrokeText(round($xt+$yearwidth/2+1), + round($yb-$this->year->iTitleVertMargin), + $year); + } + $x = $xt + $yearwidth; + while( $x < $xb ) { + $img->SetColor($this->year->grid->iColor); + $img->Line($x,$yt,$x,$yb); + $this->year->grid->Stroke($img,$x,$yb,$x,$img->height-$img->bottom_margin); + $year += 1; + $yearwidth=$this->GetDayWidth()*$this->GetNumDaysInYear($year); + if( $x + $yearwidth < $xb ) + $w = $yearwidth; + else + $w = $xb-$x; + if( $w >= 1.2*$img->GetTextWidth("".$year) ) { + $img->SetColor($this->year->iTextColor); + $img->StrokeText(round($x+$w/2+1), + round($yb-$this->year->iTitleVertMargin), + $year); + } + $x += $yearwidth; + } + $img->SetColor($this->year->iFrameColor); + $img->SetLineWeight($this->year->iFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + return $yb-$img->top_margin; + } + return $aYCoord; + } + + // Stroke table title (upper left corner) + function StrokeTableHeaders($aYBottom) { + $img=$this->iImg; + $xt=$img->left_margin; + $yt=$img->top_margin; + $xb=$xt+$this->iLabelWidth; + $yb=$aYBottom+$img->top_margin; + + if( $this->tableTitle->iShow ) { + $img->SetColor($this->iTableHeaderBackgroundColor); + $img->FilledRectangle($xt,$yt,$xb,$yb); + $this->tableTitle->Align("center","top"); + $this->tableTitle->Stroke($img,$xt+($xb-$xt)/2+1,$yt+2); + $img->SetColor($this->iTableHeaderFrameColor); + $img->SetLineWeight($this->iTableHeaderFrameWeight); + $img->Rectangle($xt,$yt,$xb,$yb); + } + + $this->actinfo->Stroke($img,$xt,$yt,$xb,$yb,$this->tableTitle->iShow); + + + // Draw the horizontal dividing line + $this->dividerh->Stroke($img,$xt,$yb,$img->width-$img->right_margin,$yb); + + // Draw the vertical dividing line + // We do the width "manually" since we want the line only to grow + // to the left + $fancy = $this->divider->iStyle == 'fancy' ; + if( $fancy ) { + $this->divider->iStyle = 'solid'; + } + + $tmp = $this->divider->iWeight; + $this->divider->iWeight=1; + $y = $img->height-$img->bottom_margin; + for($i=0; $i < $tmp; ++$i ) { + $this->divider->Stroke($img,$xb-$i,$yt,$xb-$i,$y); + } + + // Should we draw "fancy" divider + if( $fancy ) { + $img->SetLineWeight(1); + $img->SetColor($this->iTableHeaderFrameColor); + $img->Line($xb,$yt,$xb,$y); + $img->Line($xb-$tmp+1,$yt,$xb-$tmp+1,$y); + $img->SetColor('white'); + $img->Line($xb-$tmp+2,$yt,$xb-$tmp+2,$y); + } + } + + // Main entry point to stroke scale + function Stroke() { + if( !$this->IsRangeSet() ) { + JpGraphError::RaiseL(6022); + //("Gantt scale has not been specified."); + } + $img=$this->iImg; + + // If minutes are displayed then hour interval must be 1 + if( $this->IsDisplayMinute() && $this->hour->GetIntervall() > 1 ) { + JpGraphError::RaiseL(6023); + //('If you display both hour and minutes the hour intervall must be 1 (Otherwise it doesn\' make sense to display minutes).'); + } + + // Stroke all headers. As argument we supply the offset from the + // top which depends on any previous headers + + // First find out the height of each header + $offy=$this->StrokeYears(0,true); + $offm=$this->StrokeMonths($offy,true); + $offw=$this->StrokeWeeks($offm,true); + $offd=$this->StrokeDays($offw,true); + $offh=$this->StrokeHours($offd,true); + $offmin=$this->StrokeMinutes($offh,true); + + + // ... then we can stroke them in the "backwards order to ensure that + // the larger scale gridlines is stroked over the smaller scale gridline + $this->StrokeMinutes($offh); + $this->StrokeHours($offd); + $this->StrokeDays($offw); + $this->StrokeWeeks($offm); + $this->StrokeMonths($offy); + $this->StrokeYears(0); + + // Now when we now the oaverall size of the scale headers + // we can stroke the overall table headers + $this->StrokeTableHeaders($offmin); + + // Now we can calculate the correct scaling factor for each vertical position + $this->iAvailableHeight = $img->height - $img->top_margin - $img->bottom_margin - $offd; + + $this->iVertHeaderSize = $offmin; + if( $this->iVertSpacing == -1 ) + $this->iVertSpacing = $this->iAvailableHeight / $this->iVertLines; + } +} + + +//=================================================== +// CLASS GanttConstraint +// Just a structure to store all the values for a constraint +//=================================================== +class GanttConstraint { + public $iConstrainRow; + public $iConstrainType; + public $iConstrainColor; + public $iConstrainArrowSize; + public $iConstrainArrowType; + + //--------------- + // CONSTRUCTOR + function __construct($aRow,$aType,$aColor,$aArrowSize,$aArrowType){ + $this->iConstrainType = $aType; + $this->iConstrainRow = $aRow; + $this->iConstrainColor=$aColor; + $this->iConstrainArrowSize=$aArrowSize; + $this->iConstrainArrowType=$aArrowType; + } +} + + +//=================================================== +// CLASS GanttPlotObject +// The common signature for a Gantt object +//=================================================== +class GanttPlotObject { + public $title,$caption; + public $csimarea='',$csimtarget='',$csimwintarget='',$csimalt=''; + public $constraints = array(); + public $iCaptionMargin=5; + public $iConstrainPos=array(); + protected $iStart=""; // Start date + public $iVPos=0; // Vertical position + protected $iLabelLeftMargin=2; // Title margin + + function __construct() { + $this->title = new TextProperty(); + $this->title->Align('left','center'); + $this->caption = new TextProperty(); + } + + function GetCSIMArea() { + return $this->csimarea; + } + + function SetCSIMTarget($aTarget,$aAlt='',$aWinTarget='') { + if( !is_string($aTarget) ) { + $tv = substr(var_export($aTarget,true),0,40); + JpGraphError::RaiseL(6024,$tv); + //('CSIM Target must be specified as a string.'."\nStart of target is:\n$tv"); + } + if( !is_string($aAlt) ) { + $tv = substr(var_export($aAlt,true),0,40); + JpGraphError::RaiseL(6025,$tv); + //('CSIM Alt text must be specified as a string.'."\nStart of alt text is:\n$tv"); + } + + $this->csimtarget=$aTarget; + $this->csimwintarget=$aWinTarget; + $this->csimalt=$aAlt; + } + + function SetCSIMAlt($aAlt) { + if( !is_string($aAlt) ) { + $tv = substr(var_export($aAlt,true),0,40); + JpGraphError::RaiseL(6025,$tv); + //('CSIM Alt text must be specified as a string.'."\nStart of alt text is:\n$tv"); + } + $this->csimalt=$aAlt; + } + + function SetConstrain($aRow,$aType,$aColor='black',$aArrowSize=ARROW_S2,$aArrowType=ARROWT_SOLID) { + $this->constraints[] = new GanttConstraint($aRow, $aType, $aColor, $aArrowSize, $aArrowType); + } + + function SetConstrainPos($xt,$yt,$xb,$yb) { + $this->iConstrainPos = array($xt,$yt,$xb,$yb); + } + + function GetMinDate() { + return $this->iStart; + } + + function GetMaxDate() { + return $this->iStart; + } + + function SetCaptionMargin($aMarg) { + $this->iCaptionMargin=$aMarg; + } + + function GetAbsHeight($aImg) { + return 0; + } + + function GetLineNbr() { + return $this->iVPos; + } + + function SetLabelLeftMargin($aOff) { + $this->iLabelLeftMargin=$aOff; + } + + function StrokeActInfo($aImg,$aScale,$aYPos) { + $cols=array(); + $aScale->actinfo->GetColStart($aImg,$cols,true); + $this->title->Stroke($aImg,$cols,$aYPos); + } +} + +//=================================================== +// CLASS Progress +// Holds parameters for the progress indicator +// displyed within a bar +//=================================================== +class Progress { + public $iProgress=-1; + public $iPattern=GANTT_SOLID; + public $iColor="black", $iFillColor='black'; + public $iDensity=98, $iHeight=0.65; + + function Set($aProg) { + if( $aProg < 0.0 || $aProg > 1.0 ) { + JpGraphError::RaiseL(6027); + //("Progress value must in range [0, 1]"); + } + $this->iProgress = $aProg; + } + + function SetPattern($aPattern,$aColor="blue",$aDensity=98) { + $this->iPattern = $aPattern; + $this->iColor = $aColor; + $this->iDensity = $aDensity; + } + + function SetFillColor($aColor) { + $this->iFillColor = $aColor; + } + + function SetHeight($aHeight) { + $this->iHeight = $aHeight; + } +} + +define('GANTT_HGRID1',0); +define('GANTT_HGRID2',1); + +//=================================================== +// CLASS HorizontalGridLine +// Responsible for drawinf horizontal gridlines and filled alternatibg rows +//=================================================== +class HorizontalGridLine { + private $iGraph=NULL; + private $iRowColor1 = '', $iRowColor2 = ''; + private $iShow=false; + private $line=null; + private $iStart=0; // 0=from left margin, 1=just along header + + function __construct() { + $this->line = new LineProperty(); + $this->line->SetColor('gray@0.4'); + $this->line->SetStyle('dashed'); + } + + function Show($aShow=true) { + $this->iShow = $aShow; + } + + function SetRowFillColor($aColor1,$aColor2='') { + $this->iRowColor1 = $aColor1; + $this->iRowColor2 = $aColor2; + } + + function SetStart($aStart) { + $this->iStart = $aStart; + } + + function Stroke($aImg,$aScale) { + + if( ! $this->iShow ) return; + + // Get horizontal width of line + /* + $limst = $aScale->iStartDate; + $limen = $aScale->iEndDate; + $xt = round($aScale->TranslateDate($aScale->iStartDate)); + $xb = round($aScale->TranslateDate($limen)); + */ + + if( $this->iStart === 0 ) { + $xt = $aImg->left_margin-1; + } + else { + $xt = round($aScale->TranslateDate($aScale->iStartDate))+1; + } + + $xb = $aImg->width-$aImg->right_margin; + + $yt = round($aScale->TranslateVertPos(0)); + $yb = round($aScale->TranslateVertPos(1)); + $height = $yb - $yt; + + // Loop around for all lines in the chart + for($i=0; $i < $aScale->iVertLines; ++$i ) { + $yb = $yt - $height; + $this->line->Stroke($aImg,$xt,$yb,$xb,$yb); + if( $this->iRowColor1 !== '' ) { + if( $i % 2 == 0 ) { + $aImg->PushColor($this->iRowColor1); + $aImg->FilledRectangle($xt,$yt,$xb,$yb); + $aImg->PopColor(); + } + elseif( $this->iRowColor2 !== '' ) { + $aImg->PushColor($this->iRowColor2); + $aImg->FilledRectangle($xt,$yt,$xb,$yb); + $aImg->PopColor(); + } + } + $yt = round($aScale->TranslateVertPos($i+1)); + } + $yb = $yt - $height; + $this->line->Stroke($aImg,$xt,$yb,$xb,$yb); + } +} + + +//=================================================== +// CLASS GanttBar +// Responsible for formatting individual gantt bars +//=================================================== +class GanttBar extends GanttPlotObject { + public $progress; + public $leftMark,$rightMark; + private $iEnd; + private $iHeightFactor=0.5; + private $iFillColor="white",$iFrameColor="black"; + private $iShadow=false,$iShadowColor="darkgray",$iShadowWidth=1,$iShadowFrame="black"; + private $iPattern=GANTT_RDIAG,$iPatternColor="blue",$iPatternDensity=95; + private $iBreakStyle=false, $iBreakLineStyle='dotted',$iBreakLineWeight=1; + //--------------- + // CONSTRUCTOR + function __construct($aPos,$aLabel,$aStart,$aEnd,$aCaption="",$aHeightFactor=0.6) { + parent::__construct(); + $this->iStart = $aStart; + // Is the end date given as a date or as number of days added to start date? + if( is_string($aEnd) ) { + // If end date has been specified without a time we will asssume + // end date is at the end of that date + if( strpos($aEnd,':') === false ) { + $this->iEnd = strtotime($aEnd)+SECPERDAY-1; + } + else { + $this->iEnd = $aEnd; + } + } + elseif(is_int($aEnd) || is_float($aEnd) ) { + $this->iEnd = strtotime($aStart)+round($aEnd*SECPERDAY); + } + $this->iVPos = $aPos; + $this->iHeightFactor = $aHeightFactor; + $this->title->Set($aLabel); + $this->caption = new TextProperty($aCaption); + $this->caption->Align("left","center"); + $this->leftMark =new PlotMark(); + $this->leftMark->Hide(); + $this->rightMark=new PlotMark(); + $this->rightMark->Hide(); + $this->progress = new Progress(); + } + + //--------------- + // PUBLIC METHODS + function SetShadow($aShadow=true,$aColor="gray") { + $this->iShadow=$aShadow; + $this->iShadowColor=$aColor; + } + + function SetBreakStyle($aFlg=true,$aLineStyle='dotted',$aLineWeight=1) { + $this->iBreakStyle = $aFlg; + $this->iBreakLineStyle = $aLineStyle; + $this->iBreakLineWeight = $aLineWeight; + } + + function GetMaxDate() { + return $this->iEnd; + } + + function SetHeight($aHeight) { + $this->iHeightFactor = $aHeight; + } + + function SetColor($aColor) { + $this->iFrameColor = $aColor; + } + + function SetFillColor($aColor) { + $this->iFillColor = $aColor; + } + + function GetAbsHeight($aImg) { + if( is_int($this->iHeightFactor) || $this->leftMark->show || $this->rightMark->show ) { + $m=-1; + if( is_int($this->iHeightFactor) ) + $m = $this->iHeightFactor; + if( $this->leftMark->show ) + $m = max($m,$this->leftMark->width*2); + if( $this->rightMark->show ) + $m = max($m,$this->rightMark->width*2); + return $m; + } + else + return -1; + } + + function SetPattern($aPattern,$aColor="blue",$aDensity=95) { + $this->iPattern = $aPattern; + $this->iPatternColor = $aColor; + $this->iPatternDensity = $aDensity; + } + + function Stroke($aImg,$aScale) { + $factory = new RectPatternFactory(); + $prect = $factory->Create($this->iPattern,$this->iPatternColor); + $prect->SetDensity($this->iPatternDensity); + + // If height factor is specified as a float between 0,1 then we take it as meaning + // percetage of the scale width between horizontal line. + // If it is an integer > 1 we take it to mean the absolute height in pixels + if( $this->iHeightFactor > -0.0 && $this->iHeightFactor <= 1.1) + $vs = $aScale->GetVertSpacing()*$this->iHeightFactor; + elseif(is_int($this->iHeightFactor) && $this->iHeightFactor>2 && $this->iHeightFactor < 200 ) + $vs = $this->iHeightFactor; + else { + JpGraphError::RaiseL(6028,$this->iHeightFactor); + // ("Specified height (".$this->iHeightFactor.") for gantt bar is out of range."); + } + + // Clip date to min max dates to show + $st = $aScale->NormalizeDate($this->iStart); + $en = $aScale->NormalizeDate($this->iEnd); + + $limst = max($st,$aScale->iStartDate); + $limen = min($en,$aScale->iEndDate); + + $xt = round($aScale->TranslateDate($limst)); + $xb = round($aScale->TranslateDate($limen)); + $yt = round($aScale->TranslateVertPos($this->iVPos)-$vs-($aScale->GetVertSpacing()/2-$vs/2)); + $yb = round($aScale->TranslateVertPos($this->iVPos)-($aScale->GetVertSpacing()/2-$vs/2)); + $middle = round($yt+($yb-$yt)/2); + $this->StrokeActInfo($aImg,$aScale,$middle); + + // CSIM for title + if( ! empty($this->title->csimtarget) ) { + $colwidth = $this->title->GetColWidth($aImg); + $colstarts=array(); + $aScale->actinfo->GetColStart($aImg,$colstarts,true); + $n = min(count($colwidth),count($this->title->csimtarget)); + for( $i=0; $i < $n; ++$i ) { + $title_xt = $colstarts[$i]; + $title_xb = $title_xt + $colwidth[$i]; + $coords = "$title_xt,$yt,$title_xb,$yt,$title_xb,$yb,$title_xt,$yb"; + + if( ! empty($this->title->csimtarget[$i]) ) { + $this->csimarea .= "title->csimtarget[$i]."\""; + + if( ! empty($this->title->csimwintarget[$i]) ) { + $this->csimarea .= "target=\"".$this->title->csimwintarget[$i]."\" "; + } + + if( ! empty($this->title->csimalt[$i]) ) { + $tmp = $this->title->csimalt[$i]; + $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimarea .= " />\n"; + } + } + } + + // Check if the bar is totally outside the current scale range + if( $en < $aScale->iStartDate || $st > $aScale->iEndDate ) + return; + + + // Remember the positions for the bar + $this->SetConstrainPos($xt,$yt,$xb,$yb); + + + + $prect->ShowFrame(false); + $prect->SetBackground($this->iFillColor); + if( $this->iBreakStyle ) { + $aImg->SetColor($this->iFrameColor); + $olds = $aImg->SetLineStyle($this->iBreakLineStyle); + $oldw = $aImg->SetLineWeight($this->iBreakLineWeight); + $aImg->StyleLine($xt,$yt,$xb,$yt); + $aImg->StyleLine($xt,$yb,$xb,$yb); + $aImg->SetLineStyle($olds); + $aImg->SetLineWeight($oldw); + } + else { + if( $this->iShadow ) { + $aImg->SetColor($this->iFrameColor); + $aImg->ShadowRectangle($xt,$yt,$xb,$yb,$this->iFillColor,$this->iShadowWidth,$this->iShadowColor); + $prect->SetPos(new Rectangle($xt+1,$yt+1,$xb-$xt-$this->iShadowWidth-2,$yb-$yt-$this->iShadowWidth-2)); + $prect->Stroke($aImg); + } + else { + $prect->SetPos(new Rectangle($xt,$yt,$xb-$xt+1,$yb-$yt+1)); + $prect->Stroke($aImg); + $aImg->SetColor($this->iFrameColor); + $aImg->Rectangle($xt,$yt,$xb,$yb); + } + } + // CSIM for bar + if( ! empty($this->csimtarget) ) { + + $coords = "$xt,$yt,$xb,$yt,$xb,$yb,$xt,$yb"; + $this->csimarea .= "csimtarget."\""; + + if( !empty($this->csimwintarget) ) { + $this->csimarea .= " target=\"".$this->csimwintarget."\" "; + } + + if( $this->csimalt != '' ) { + $tmp = $this->csimalt; + $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimarea .= " />\n"; + } + + // Draw progress bar inside activity bar + if( $this->progress->iProgress > 0 ) { + + $xtp = $aScale->TranslateDate($st); + $xbp = $aScale->TranslateDate($en); + $len = ($xbp-$xtp)*$this->progress->iProgress; + + $endpos = $xtp+$len; + if( $endpos > $xt ) { + + // Take away the length of the progress that is not visible (before the start date) + $len -= ($xt-$xtp); + + // Is the the progress bar visible after the start date? + if( $xtp < $xt ) + $xtp = $xt; + + // Make sure that the progess bar doesn't extend over the end date + if( $xtp+$len-1 > $xb ) + $len = $xb - $xtp ; + + $prog = $factory->Create($this->progress->iPattern,$this->progress->iColor); + $prog->SetDensity($this->progress->iDensity); + $prog->SetBackground($this->progress->iFillColor); + $barheight = ($yb-$yt+1); + if( $this->iShadow ) + $barheight -= $this->iShadowWidth; + $progressheight = floor($barheight*$this->progress->iHeight); + $marg = ceil(($barheight-$progressheight)/2); + $pos = new Rectangle($xtp,$yt + $marg, $len,$barheight-2*$marg); + $prog->SetPos($pos); + $prog->Stroke($aImg); + } + } + + // We don't plot the end mark if the bar has been capped + if( $limst == $st ) { + $y = $middle; + // We treat the RIGHT and LEFT triangle mark a little bi + // special so that these marks are placed right under the + // bar. + if( $this->leftMark->GetType() == MARK_LEFTTRIANGLE ) { + $y = $yb ; + } + $this->leftMark->Stroke($aImg,$xt,$y); + } + if( $limen == $en ) { + $y = $middle; + // We treat the RIGHT and LEFT triangle mark a little bi + // special so that these marks are placed right under the + // bar. + if( $this->rightMark->GetType() == MARK_RIGHTTRIANGLE ) { + $y = $yb ; + } + $this->rightMark->Stroke($aImg,$xb,$y); + + $margin = $this->iCaptionMargin; + if( $this->rightMark->show ) + $margin += $this->rightMark->GetWidth(); + $this->caption->Stroke($aImg,$xb+$margin,$middle); + } + } +} + +//=================================================== +// CLASS MileStone +// Responsible for formatting individual milestones +//=================================================== +class MileStone extends GanttPlotObject { + public $mark; + + //--------------- + // CONSTRUCTOR + function __construct($aVPos,$aLabel,$aDate,$aCaption="") { + GanttPlotObject::__construct(); + $this->caption->Set($aCaption); + $this->caption->Align("left","center"); + $this->caption->SetFont(FF_FONT1,FS_BOLD); + $this->title->Set($aLabel); + $this->title->SetColor("darkred"); + $this->mark = new PlotMark(); + $this->mark->SetWidth(10); + $this->mark->SetType(MARK_DIAMOND); + $this->mark->SetColor("darkred"); + $this->mark->SetFillColor("darkred"); + $this->iVPos = $aVPos; + $this->iStart = $aDate; + } + + //--------------- + // PUBLIC METHODS + + function GetAbsHeight($aImg) { + return max($this->title->GetHeight($aImg),$this->mark->GetWidth()); + } + + function Stroke($aImg,$aScale) { + // Put the mark in the middle at the middle of the day + $d = $aScale->NormalizeDate($this->iStart)+SECPERDAY/2; + $x = $aScale->TranslateDate($d); + $y = $aScale->TranslateVertPos($this->iVPos)-($aScale->GetVertSpacing()/2); + + $this->StrokeActInfo($aImg,$aScale,$y); + + // CSIM for title + if( ! empty($this->title->csimtarget) ) { + + $yt = round($y - $this->title->GetHeight($aImg)/2); + $yb = round($y + $this->title->GetHeight($aImg)/2); + + $colwidth = $this->title->GetColWidth($aImg); + $colstarts=array(); + $aScale->actinfo->GetColStart($aImg,$colstarts,true); + $n = min(count($colwidth),count($this->title->csimtarget)); + for( $i=0; $i < $n; ++$i ) { + $title_xt = $colstarts[$i]; + $title_xb = $title_xt + $colwidth[$i]; + $coords = "$title_xt,$yt,$title_xb,$yt,$title_xb,$yb,$title_xt,$yb"; + + if( !empty($this->title->csimtarget[$i]) ) { + + $this->csimarea .= "title->csimtarget[$i]."\""; + + if( !empty($this->title->csimwintarget[$i]) ) { + $this->csimarea .= "target=\"".$this->title->csimwintarget[$i]."\""; + } + + if( ! empty($this->title->csimalt[$i]) ) { + $tmp = $this->title->csimalt[$i]; + $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimarea .= " />\n"; + } + } + } + + if( $d < $aScale->iStartDate || $d > $aScale->iEndDate ) + return; + + // Remember the coordinates for any constrains linking to + // this milestone + $w = $this->mark->GetWidth()/2; + $this->SetConstrainPos($x,round($y-$w),$x,round($y+$w)); + + // Setup CSIM + if( $this->csimtarget != '' ) { + $this->mark->SetCSIMTarget( $this->csimtarget ); + $this->mark->SetCSIMAlt( $this->csimalt ); + } + + $this->mark->Stroke($aImg,$x,$y); + $this->caption->Stroke($aImg,$x+$this->mark->width/2+$this->iCaptionMargin,$y); + + $this->csimarea .= $this->mark->GetCSIMAreas(); + } +} + + +//=================================================== +// CLASS GanttVLine +// Responsible for formatting individual milestones +//=================================================== + +class TextPropertyBelow extends TextProperty { + function __construct($aTxt='') { + parent::__construct($aTxt); + } + + function GetColWidth($aImg,$aMargin=0) { + // Since we are not stroking the title in the columns + // but rather under the graph we want this to return 0. + return array(0); + } +} + +class GanttVLine extends GanttPlotObject { + + private $iLine,$title_margin=3, $iDayOffset=0.5; + private $iStartRow = -1, $iEndRow = -1; + + //--------------- + // CONSTRUCTOR + function __construct($aDate,$aTitle="",$aColor="darkred",$aWeight=2,$aStyle="solid") { + GanttPlotObject::__construct(); + $this->iLine = new LineProperty(); + $this->iLine->SetColor($aColor); + $this->iLine->SetWeight($aWeight); + $this->iLine->SetStyle($aStyle); + $this->iStart = $aDate; + $this->title = new TextPropertyBelow(); + $this->title->Set($aTitle); + } + + //--------------- + // PUBLIC METHODS + + // Set start and end rows for the VLine. By default the entire heigh of the + // Gantt chart is used + function SetRowSpan($aStart, $aEnd=-1) { + $this->iStartRow = $aStart; + $this->iEndRow = $aEnd; + } + + function SetDayOffset($aOff=0.5) { + if( $aOff < 0.0 || $aOff > 1.0 ) { + JpGraphError::RaiseL(6029); + //("Offset for vertical line must be in range [0,1]"); + } + $this->iDayOffset = $aOff; + } + + function SetTitleMargin($aMarg) { + $this->title_margin = $aMarg; + } + + function SetWeight($aWeight) { + $this->iLine->SetWeight($aWeight); + } + + function Stroke($aImg,$aScale) { + $d = $aScale->NormalizeDate($this->iStart); + if( $d < $aScale->iStartDate || $d > $aScale->iEndDate ) + return; + if($this->iDayOffset != 0.0) + $d += 24*60*60*$this->iDayOffset; + $x = $aScale->TranslateDate($d);//d=1006858800, + + if( $this->iStartRow > -1 ) { + $y1 = $aScale->TranslateVertPos($this->iStartRow,true) ; + } + else { + $y1 = $aScale->iVertHeaderSize+$aImg->top_margin; + } + + if( $this->iEndRow > -1 ) { + $y2 = $aScale->TranslateVertPos($this->iEndRow); + } + else { + $y2 = $aImg->height - $aImg->bottom_margin; + } + + $this->iLine->Stroke($aImg,$x,$y1,$x,$y2); + $this->title->Align("center","top"); + $this->title->Stroke($aImg,$x,$y2+$this->title_margin); + } +} + +//=================================================== +// CLASS LinkArrow +// Handles the drawing of a an arrow +//=================================================== +class LinkArrow { + private $ix,$iy; + private $isizespec = array( + array(2,3),array(3,5),array(3,8),array(6,15),array(8,22)); + private $iDirection=ARROW_DOWN,$iType=ARROWT_SOLID,$iSize=ARROW_S2; + private $iColor='black'; + + function __construct($x,$y,$aDirection,$aType=ARROWT_SOLID,$aSize=ARROW_S2) { + $this->iDirection = $aDirection; + $this->iType = $aType; + $this->iSize = $aSize; + $this->ix = $x; + $this->iy = $y; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function SetSize($aSize) { + $this->iSize = $aSize; + } + + function SetType($aType) { + $this->iType = $aType; + } + + function Stroke($aImg) { + list($dx,$dy) = $this->isizespec[$this->iSize]; + $x = $this->ix; + $y = $this->iy; + switch ( $this->iDirection ) { + case ARROW_DOWN: + $c = array($x,$y,$x-$dx,$y-$dy,$x+$dx,$y-$dy,$x,$y); + break; + case ARROW_UP: + $c = array($x,$y,$x-$dx,$y+$dy,$x+$dx,$y+$dy,$x,$y); + break; + case ARROW_LEFT: + $c = array($x,$y,$x+$dy,$y-$dx,$x+$dy,$y+$dx,$x,$y); + break; + case ARROW_RIGHT: + $c = array($x,$y,$x-$dy,$y-$dx,$x-$dy,$y+$dx,$x,$y); + break; + default: + JpGraphError::RaiseL(6030); + //('Unknown arrow direction for link.'); + die(); + break; + } + $aImg->SetColor($this->iColor); + switch( $this->iType ) { + case ARROWT_SOLID: + $aImg->FilledPolygon($c); + break; + case ARROWT_OPEN: + $aImg->Polygon($c); + break; + default: + JpGraphError::RaiseL(6031); + //('Unknown arrow type for link.'); + die(); + break; + } + } +} + +//=================================================== +// CLASS GanttLink +// Handles the drawing of a link line between 2 points +//=================================================== + +class GanttLink { + private $ix1,$ix2,$iy1,$iy2; + private $iPathType=2,$iPathExtend=15; + private $iColor='black',$iWeight=1; + private $iArrowSize=ARROW_S2,$iArrowType=ARROWT_SOLID; + + function __construct($x1=0,$y1=0,$x2=0,$y2=0) { + $this->ix1 = $x1; + $this->ix2 = $x2; + $this->iy1 = $y1; + $this->iy2 = $y2; + } + + function SetPos($x1,$y1,$x2,$y2) { + $this->ix1 = $x1; + $this->ix2 = $x2; + $this->iy1 = $y1; + $this->iy2 = $y2; + } + + function SetPath($aPath) { + $this->iPathType = $aPath; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function SetArrow($aSize,$aType=ARROWT_SOLID) { + $this->iArrowSize = $aSize; + $this->iArrowType = $aType; + } + + function SetWeight($aWeight) { + $this->iWeight = $aWeight; + } + + function Stroke($aImg) { + // The way the path for the arrow is constructed is partly based + // on some heuristics. This is not an exact science but draws the + // path in a way that, for me, makes esthetic sence. For example + // if the start and end activities are very close we make a small + // detour to endter the target horixontally. If there are more + // space between axctivities then no suh detour is made and the + // target is "hit" directly vertical. I have tried to keep this + // simple. no doubt this could become almost infinitive complex + // and have some real AI. Feel free to modify this. + // This will no-doubt be tweaked as times go by. One design aim + // is to avoid having the user choose what types of arrow + // he wants. + + // The arrow is drawn between (x1,y1) to (x2,y2) + $x1 = $this->ix1 ; + $x2 = $this->ix2 ; + $y1 = $this->iy1 ; + $y2 = $this->iy2 ; + + // Depending on if the target is below or above we have to + // handle thi different. + if( $y2 > $y1 ) { + $arrowtype = ARROW_DOWN; + $midy = round(($y2-$y1)/2+$y1); + if( $x2 > $x1 ) { + switch ( $this->iPathType ) { + case 0: + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + break; + case 1: + case 2: + case 3: + $c = array($x1,$y1,$x2,$y1,$x2,$y2); + break; + default: + JpGraphError::RaiseL(6032,$this->iPathType); + //('Internal error: Unknown path type (='.$this->iPathType .') specified for link.'); + exit(1); + break; + } + } + else { + switch ( $this->iPathType ) { + case 0: + case 1: + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + break; + case 2: + // Always extend out horizontally a bit from the first point + // If we draw a link back in time (end to start) and the bars + // are very close we also change the path so it comes in from + // the left on the activity + $c = array($x1,$y1,$x1+$this->iPathExtend,$y1, + $x1+$this->iPathExtend,$midy, + $x2,$midy,$x2,$y2); + break; + case 3: + if( $y2-$midy < 6 ) { + $c = array($x1,$y1,$x1,$midy, + $x2-$this->iPathExtend,$midy, + $x2-$this->iPathExtend,$y2, + $x2,$y2); + $arrowtype = ARROW_RIGHT; + } + else { + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + } + break; + default: + JpGraphError::RaiseL(6032,$this->iPathType); + //('Internal error: Unknown path type specified for link.'); + exit(1); + break; + } + } + $arrow = new LinkArrow($x2,$y2,$arrowtype); + } + else { + // Y2 < Y1 + $arrowtype = ARROW_UP; + $midy = round(($y1-$y2)/2+$y2); + if( $x2 > $x1 ) { + switch ( $this->iPathType ) { + case 0: + case 1: + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + break; + case 3: + if( $midy-$y2 < 8 ) { + $arrowtype = ARROW_RIGHT; + $c = array($x1,$y1,$x1,$y2,$x2,$y2); + } + else { + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + } + break; + default: + JpGraphError::RaiseL(6032,$this->iPathType); + //('Internal error: Unknown path type specified for link.'); + break; + } + } + else { + switch ( $this->iPathType ) { + case 0: + case 1: + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + break; + case 2: + // Always extend out horizontally a bit from the first point + $c = array($x1,$y1,$x1+$this->iPathExtend,$y1, + $x1+$this->iPathExtend,$midy, + $x2,$midy,$x2,$y2); + break; + case 3: + if( $midy-$y2 < 16 ) { + $arrowtype = ARROW_RIGHT; + $c = array($x1,$y1,$x1,$midy,$x2-$this->iPathExtend,$midy, + $x2-$this->iPathExtend,$y2, + $x2,$y2); + } + else { + $c = array($x1,$y1,$x1,$midy,$x2,$midy,$x2,$y2); + } + break; + default: + JpGraphError::RaiseL(6032,$this->iPathType); + //('Internal error: Unknown path type specified for link.'); + break; + } + } + $arrow = new LinkArrow($x2,$y2,$arrowtype); + } + $aImg->SetColor($this->iColor); + $aImg->SetLineWeight($this->iWeight); + $aImg->Polygon($c); + $aImg->SetLineWeight(1); + $arrow->SetColor($this->iColor); + $arrow->SetSize($this->iArrowSize); + $arrow->SetType($this->iArrowType); + $arrow->Stroke($aImg); + } +} + +// +?> diff --git a/includes/jpgraph/src/jpgraph_gb2312.php b/includes/jpgraph/src/jpgraph_gb2312.php new file mode 100644 index 0000000..8fd9e02 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_gb2312.php @@ -0,0 +1,1552 @@ + 12288, 8482 => 12289, 8483 => 12290, 8484 => 12539, 8485 => 713, + 8486 => 711, 8487 => 168, 8488 => 12291, 8489 => 12293, 8490 => 8213, + 8491 => 65374, 8492 => 8214, 8493 => 8230, 8494 => 8216, 8495 => 8217, + 8496 => 8220, 8497 => 8221, 8498 => 12308, 8499 => 12309, 8500 => 12296, + 8501 => 12297, 8502 => 12298, 8503 => 12299, 8504 => 12300, 8505 => 12301, + 8506 => 12302, 8507 => 12303, 8508 => 12310, 8509 => 12311, 8510 => 12304, + 8511 => 12305, 8512 => 177, 8513 => 215, 8514 => 247, 8515 => 8758, + 8516 => 8743, 8517 => 8744, 8518 => 8721, 8519 => 8719, 8520 => 8746, + 8521 => 8745, 8522 => 8712, 8523 => 8759, 8524 => 8730, 8525 => 8869, + 8526 => 8741, 8527 => 8736, 8528 => 8978, 8529 => 8857, 8530 => 8747, + 8531 => 8750, 8532 => 8801, 8533 => 8780, 8534 => 8776, 8535 => 8765, + 8536 => 8733, 8537 => 8800, 8538 => 8814, 8539 => 8815, 8540 => 8804, + 8541 => 8805, 8542 => 8734, 8543 => 8757, 8544 => 8756, 8545 => 9794, + 8546 => 9792, 8547 => 176, 8548 => 8242, 8549 => 8243, 8550 => 8451, + 8551 => 65284, 8552 => 164, 8553 => 65504, 8554 => 65505, 8555 => 8240, + 8556 => 167, 8557 => 8470, 8558 => 9734, 8559 => 9733, 8560 => 9675, + 8561 => 9679, 8562 => 9678, 8563 => 9671, 8564 => 9670, 8565 => 9633, + 8566 => 9632, 8567 => 9651, 8568 => 9650, 8569 => 8251, 8570 => 8594, + 8571 => 8592, 8572 => 8593, 8573 => 8595, 8574 => 12307, 8753 => 9352, + 8754 => 9353, 8755 => 9354, 8756 => 9355, 8757 => 9356, 8758 => 9357, + 8759 => 9358, 8760 => 9359, 8761 => 9360, 8762 => 9361, 8763 => 9362, + 8764 => 9363, 8765 => 9364, 8766 => 9365, 8767 => 9366, 8768 => 9367, + 8769 => 9368, 8770 => 9369, 8771 => 9370, 8772 => 9371, 8773 => 9332, + 8774 => 9333, 8775 => 9334, 8776 => 9335, 8777 => 9336, 8778 => 9337, + 8779 => 9338, 8780 => 9339, 8781 => 9340, 8782 => 9341, 8783 => 9342, + 8784 => 9343, 8785 => 9344, 8786 => 9345, 8787 => 9346, 8788 => 9347, + 8789 => 9348, 8790 => 9349, 8791 => 9350, 8792 => 9351, 8793 => 9312, + 8794 => 9313, 8795 => 9314, 8796 => 9315, 8797 => 9316, 8798 => 9317, + 8799 => 9318, 8800 => 9319, 8801 => 9320, 8802 => 9321, 8805 => 12832, + 8806 => 12833, 8807 => 12834, 8808 => 12835, 8809 => 12836, 8810 => 12837, + 8811 => 12838, 8812 => 12839, 8813 => 12840, 8814 => 12841, 8817 => 8544, + 8818 => 8545, 8819 => 8546, 8820 => 8547, 8821 => 8548, 8822 => 8549, + 8823 => 8550, 8824 => 8551, 8825 => 8552, 8826 => 8553, 8827 => 8554, + 8828 => 8555, 8993 => 65281, 8994 => 65282, 8995 => 65283, 8996 => 65509, + 8997 => 65285, 8998 => 65286, 8999 => 65287, 9000 => 65288, 9001 => 65289, + 9002 => 65290, 9003 => 65291, 9004 => 65292, 9005 => 65293, 9006 => 65294, + 9007 => 65295, 9008 => 65296, 9009 => 65297, 9010 => 65298, 9011 => 65299, + 9012 => 65300, 9013 => 65301, 9014 => 65302, 9015 => 65303, 9016 => 65304, + 9017 => 65305, 9018 => 65306, 9019 => 65307, 9020 => 65308, 9021 => 65309, + 9022 => 65310, 9023 => 65311, 9024 => 65312, 9025 => 65313, 9026 => 65314, + 9027 => 65315, 9028 => 65316, 9029 => 65317, 9030 => 65318, 9031 => 65319, + 9032 => 65320, 9033 => 65321, 9034 => 65322, 9035 => 65323, 9036 => 65324, + 9037 => 65325, 9038 => 65326, 9039 => 65327, 9040 => 65328, 9041 => 65329, + 9042 => 65330, 9043 => 65331, 9044 => 65332, 9045 => 65333, 9046 => 65334, + 9047 => 65335, 9048 => 65336, 9049 => 65337, 9050 => 65338, 9051 => 65339, + 9052 => 65340, 9053 => 65341, 9054 => 65342, 9055 => 65343, 9056 => 65344, + 9057 => 65345, 9058 => 65346, 9059 => 65347, 9060 => 65348, 9061 => 65349, + 9062 => 65350, 9063 => 65351, 9064 => 65352, 9065 => 65353, 9066 => 65354, + 9067 => 65355, 9068 => 65356, 9069 => 65357, 9070 => 65358, 9071 => 65359, + 9072 => 65360, 9073 => 65361, 9074 => 65362, 9075 => 65363, 9076 => 65364, + 9077 => 65365, 9078 => 65366, 9079 => 65367, 9080 => 65368, 9081 => 65369, + 9082 => 65370, 9083 => 65371, 9084 => 65372, 9085 => 65373, 9086 => 65507, + 9249 => 12353, 9250 => 12354, 9251 => 12355, 9252 => 12356, 9253 => 12357, + 9254 => 12358, 9255 => 12359, 9256 => 12360, 9257 => 12361, 9258 => 12362, + 9259 => 12363, 9260 => 12364, 9261 => 12365, 9262 => 12366, 9263 => 12367, + 9264 => 12368, 9265 => 12369, 9266 => 12370, 9267 => 12371, 9268 => 12372, + 9269 => 12373, 9270 => 12374, 9271 => 12375, 9272 => 12376, 9273 => 12377, + 9274 => 12378, 9275 => 12379, 9276 => 12380, 9277 => 12381, 9278 => 12382, + 9279 => 12383, 9280 => 12384, 9281 => 12385, 9282 => 12386, 9283 => 12387, + 9284 => 12388, 9285 => 12389, 9286 => 12390, 9287 => 12391, 9288 => 12392, + 9289 => 12393, 9290 => 12394, 9291 => 12395, 9292 => 12396, 9293 => 12397, + 9294 => 12398, 9295 => 12399, 9296 => 12400, 9297 => 12401, 9298 => 12402, + 9299 => 12403, 9300 => 12404, 9301 => 12405, 9302 => 12406, 9303 => 12407, + 9304 => 12408, 9305 => 12409, 9306 => 12410, 9307 => 12411, 9308 => 12412, + 9309 => 12413, 9310 => 12414, 9311 => 12415, 9312 => 12416, 9313 => 12417, + 9314 => 12418, 9315 => 12419, 9316 => 12420, 9317 => 12421, 9318 => 12422, + 9319 => 12423, 9320 => 12424, 9321 => 12425, 9322 => 12426, 9323 => 12427, + 9324 => 12428, 9325 => 12429, 9326 => 12430, 9327 => 12431, 9328 => 12432, + 9329 => 12433, 9330 => 12434, 9331 => 12435, 9505 => 12449, 9506 => 12450, + 9507 => 12451, 9508 => 12452, 9509 => 12453, 9510 => 12454, 9511 => 12455, + 9512 => 12456, 9513 => 12457, 9514 => 12458, 9515 => 12459, 9516 => 12460, + 9517 => 12461, 9518 => 12462, 9519 => 12463, 9520 => 12464, 9521 => 12465, + 9522 => 12466, 9523 => 12467, 9524 => 12468, 9525 => 12469, 9526 => 12470, + 9527 => 12471, 9528 => 12472, 9529 => 12473, 9530 => 12474, 9531 => 12475, + 9532 => 12476, 9533 => 12477, 9534 => 12478, 9535 => 12479, 9536 => 12480, + 9537 => 12481, 9538 => 12482, 9539 => 12483, 9540 => 12484, 9541 => 12485, + 9542 => 12486, 9543 => 12487, 9544 => 12488, 9545 => 12489, 9546 => 12490, + 9547 => 12491, 9548 => 12492, 9549 => 12493, 9550 => 12494, 9551 => 12495, + 9552 => 12496, 9553 => 12497, 9554 => 12498, 9555 => 12499, 9556 => 12500, + 9557 => 12501, 9558 => 12502, 9559 => 12503, 9560 => 12504, 9561 => 12505, + 9562 => 12506, 9563 => 12507, 9564 => 12508, 9565 => 12509, 9566 => 12510, + 9567 => 12511, 9568 => 12512, 9569 => 12513, 9570 => 12514, 9571 => 12515, + 9572 => 12516, 9573 => 12517, 9574 => 12518, 9575 => 12519, 9576 => 12520, + 9577 => 12521, 9578 => 12522, 9579 => 12523, 9580 => 12524, 9581 => 12525, + 9582 => 12526, 9583 => 12527, 9584 => 12528, 9585 => 12529, 9586 => 12530, + 9587 => 12531, 9588 => 12532, 9589 => 12533, 9590 => 12534, 9761 => 913, + 9762 => 914, 9763 => 915, 9764 => 916, 9765 => 917, 9766 => 918, + 9767 => 919, 9768 => 920, 9769 => 921, 9770 => 922, 9771 => 923, + 9772 => 924, 9773 => 925, 9774 => 926, 9775 => 927, 9776 => 928, + 9777 => 929, 9778 => 931, 9779 => 932, 9780 => 933, 9781 => 934, + 9782 => 935, 9783 => 936, 9784 => 937, 9793 => 945, 9794 => 946, + 9795 => 947, 9796 => 948, 9797 => 949, 9798 => 950, 9799 => 951, + 9800 => 952, 9801 => 953, 9802 => 954, 9803 => 955, 9804 => 956, + 9805 => 957, 9806 => 958, 9807 => 959, 9808 => 960, 9809 => 961, + 9810 => 963, 9811 => 964, 9812 => 965, 9813 => 966, 9814 => 967, + 9815 => 968, 9816 => 969, 10017 => 1040, 10018 => 1041, 10019 => 1042, + 10020 => 1043, 10021 => 1044, 10022 => 1045, 10023 => 1025, 10024 => 1046, + 10025 => 1047, 10026 => 1048, 10027 => 1049, 10028 => 1050, 10029 => 1051, + 10030 => 1052, 10031 => 1053, 10032 => 1054, 10033 => 1055, 10034 => 1056, + 10035 => 1057, 10036 => 1058, 10037 => 1059, 10038 => 1060, 10039 => 1061, + 10040 => 1062, 10041 => 1063, 10042 => 1064, 10043 => 1065, 10044 => 1066, + 10045 => 1067, 10046 => 1068, 10047 => 1069, 10048 => 1070, 10049 => 1071, + 10065 => 1072, 10066 => 1073, 10067 => 1074, 10068 => 1075, 10069 => 1076, + 10070 => 1077, 10071 => 1105, 10072 => 1078, 10073 => 1079, 10074 => 1080, + 10075 => 1081, 10076 => 1082, 10077 => 1083, 10078 => 1084, 10079 => 1085, + 10080 => 1086, 10081 => 1087, 10082 => 1088, 10083 => 1089, 10084 => 1090, + 10085 => 1091, 10086 => 1092, 10087 => 1093, 10088 => 1094, 10089 => 1095, + 10090 => 1096, 10091 => 1097, 10092 => 1098, 10093 => 1099, 10094 => 1100, + 10095 => 1101, 10096 => 1102, 10097 => 1103, 10273 => 257, 10274 => 225, + 10275 => 462, 10276 => 224, 10277 => 275, 10278 => 233, 10279 => 283, + 10280 => 232, 10281 => 299, 10282 => 237, 10283 => 464, 10284 => 236, + 10285 => 333, 10286 => 243, 10287 => 466, 10288 => 242, 10289 => 363, + 10290 => 250, 10291 => 468, 10292 => 249, 10293 => 470, 10294 => 472, + 10295 => 474, 10296 => 476, 10297 => 252, 10298 => 234, 10309 => 12549, + 10310 => 12550, 10311 => 12551, 10312 => 12552, 10313 => 12553, 10314 => 12554, + 10315 => 12555, 10316 => 12556, 10317 => 12557, 10318 => 12558, 10319 => 12559, + 10320 => 12560, 10321 => 12561, 10322 => 12562, 10323 => 12563, 10324 => 12564, + 10325 => 12565, 10326 => 12566, 10327 => 12567, 10328 => 12568, 10329 => 12569, + 10330 => 12570, 10331 => 12571, 10332 => 12572, 10333 => 12573, 10334 => 12574, + 10335 => 12575, 10336 => 12576, 10337 => 12577, 10338 => 12578, 10339 => 12579, + 10340 => 12580, 10341 => 12581, 10342 => 12582, 10343 => 12583, 10344 => 12584, + 10345 => 12585, 10532 => 9472, 10533 => 9473, 10534 => 9474, 10535 => 9475, + 10536 => 9476, 10537 => 9477, 10538 => 9478, 10539 => 9479, 10540 => 9480, + 10541 => 9481, 10542 => 9482, 10543 => 9483, 10544 => 9484, 10545 => 9485, + 10546 => 9486, 10547 => 9487, 10548 => 9488, 10549 => 9489, 10550 => 9490, + 10551 => 9491, 10552 => 9492, 10553 => 9493, 10554 => 9494, 10555 => 9495, + 10556 => 9496, 10557 => 9497, 10558 => 9498, 10559 => 9499, 10560 => 9500, + 10561 => 9501, 10562 => 9502, 10563 => 9503, 10564 => 9504, 10565 => 9505, + 10566 => 9506, 10567 => 9507, 10568 => 9508, 10569 => 9509, 10570 => 9510, + 10571 => 9511, 10572 => 9512, 10573 => 9513, 10574 => 9514, 10575 => 9515, + 10576 => 9516, 10577 => 9517, 10578 => 9518, 10579 => 9519, 10580 => 9520, + 10581 => 9521, 10582 => 9522, 10583 => 9523, 10584 => 9524, 10585 => 9525, + 10586 => 9526, 10587 => 9527, 10588 => 9528, 10589 => 9529, 10590 => 9530, + 10591 => 9531, 10592 => 9532, 10593 => 9533, 10594 => 9534, 10595 => 9535, + 10596 => 9536, 10597 => 9537, 10598 => 9538, 10599 => 9539, 10600 => 9540, + 10601 => 9541, 10602 => 9542, 10603 => 9543, 10604 => 9544, 10605 => 9545, + 10606 => 9546, 10607 => 9547, 12321 => 21834, 12322 => 38463, 12323 => 22467, + 12324 => 25384, 12325 => 21710, 12326 => 21769, 12327 => 21696, 12328 => 30353, + 12329 => 30284, 12330 => 34108, 12331 => 30702, 12332 => 33406, 12333 => 30861, + 12334 => 29233, 12335 => 38552, 12336 => 38797, 12337 => 27688, 12338 => 23433, + 12339 => 20474, 12340 => 25353, 12341 => 26263, 12342 => 23736, 12343 => 33018, + 12344 => 26696, 12345 => 32942, 12346 => 26114, 12347 => 30414, 12348 => 20985, + 12349 => 25942, 12350 => 29100, 12351 => 32753, 12352 => 34948, 12353 => 20658, + 12354 => 22885, 12355 => 25034, 12356 => 28595, 12357 => 33453, 12358 => 25420, + 12359 => 25170, 12360 => 21485, 12361 => 21543, 12362 => 31494, 12363 => 20843, + 12364 => 30116, 12365 => 24052, 12366 => 25300, 12367 => 36299, 12368 => 38774, + 12369 => 25226, 12370 => 32793, 12371 => 22365, 12372 => 38712, 12373 => 32610, + 12374 => 29240, 12375 => 30333, 12376 => 26575, 12377 => 30334, 12378 => 25670, + 12379 => 20336, 12380 => 36133, 12381 => 25308, 12382 => 31255, 12383 => 26001, + 12384 => 29677, 12385 => 25644, 12386 => 25203, 12387 => 33324, 12388 => 39041, + 12389 => 26495, 12390 => 29256, 12391 => 25198, 12392 => 25292, 12393 => 20276, + 12394 => 29923, 12395 => 21322, 12396 => 21150, 12397 => 32458, 12398 => 37030, + 12399 => 24110, 12400 => 26758, 12401 => 27036, 12402 => 33152, 12403 => 32465, + 12404 => 26834, 12405 => 30917, 12406 => 34444, 12407 => 38225, 12408 => 20621, + 12409 => 35876, 12410 => 33502, 12411 => 32990, 12412 => 21253, 12413 => 35090, + 12414 => 21093, 12577 => 34180, 12578 => 38649, 12579 => 20445, 12580 => 22561, + 12581 => 39281, 12582 => 23453, 12583 => 25265, 12584 => 25253, 12585 => 26292, + 12586 => 35961, 12587 => 40077, 12588 => 29190, 12589 => 26479, 12590 => 30865, + 12591 => 24754, 12592 => 21329, 12593 => 21271, 12594 => 36744, 12595 => 32972, + 12596 => 36125, 12597 => 38049, 12598 => 20493, 12599 => 29384, 12600 => 22791, + 12601 => 24811, 12602 => 28953, 12603 => 34987, 12604 => 22868, 12605 => 33519, + 12606 => 26412, 12607 => 31528, 12608 => 23849, 12609 => 32503, 12610 => 29997, + 12611 => 27893, 12612 => 36454, 12613 => 36856, 12614 => 36924, 12615 => 40763, + 12616 => 27604, 12617 => 37145, 12618 => 31508, 12619 => 24444, 12620 => 30887, + 12621 => 34006, 12622 => 34109, 12623 => 27605, 12624 => 27609, 12625 => 27606, + 12626 => 24065, 12627 => 24199, 12628 => 30201, 12629 => 38381, 12630 => 25949, + 12631 => 24330, 12632 => 24517, 12633 => 36767, 12634 => 22721, 12635 => 33218, + 12636 => 36991, 12637 => 38491, 12638 => 38829, 12639 => 36793, 12640 => 32534, + 12641 => 36140, 12642 => 25153, 12643 => 20415, 12644 => 21464, 12645 => 21342, + 12646 => 36776, 12647 => 36777, 12648 => 36779, 12649 => 36941, 12650 => 26631, + 12651 => 24426, 12652 => 33176, 12653 => 34920, 12654 => 40150, 12655 => 24971, + 12656 => 21035, 12657 => 30250, 12658 => 24428, 12659 => 25996, 12660 => 28626, + 12661 => 28392, 12662 => 23486, 12663 => 25672, 12664 => 20853, 12665 => 20912, + 12666 => 26564, 12667 => 19993, 12668 => 31177, 12669 => 39292, 12670 => 28851, + 12833 => 30149, 12834 => 24182, 12835 => 29627, 12836 => 33760, 12837 => 25773, + 12838 => 25320, 12839 => 38069, 12840 => 27874, 12841 => 21338, 12842 => 21187, + 12843 => 25615, 12844 => 38082, 12845 => 31636, 12846 => 20271, 12847 => 24091, + 12848 => 33334, 12849 => 33046, 12850 => 33162, 12851 => 28196, 12852 => 27850, + 12853 => 39539, 12854 => 25429, 12855 => 21340, 12856 => 21754, 12857 => 34917, + 12858 => 22496, 12859 => 19981, 12860 => 24067, 12861 => 27493, 12862 => 31807, + 12863 => 37096, 12864 => 24598, 12865 => 25830, 12866 => 29468, 12867 => 35009, + 12868 => 26448, 12869 => 25165, 12870 => 36130, 12871 => 30572, 12872 => 36393, + 12873 => 37319, 12874 => 24425, 12875 => 33756, 12876 => 34081, 12877 => 39184, + 12878 => 21442, 12879 => 34453, 12880 => 27531, 12881 => 24813, 12882 => 24808, + 12883 => 28799, 12884 => 33485, 12885 => 33329, 12886 => 20179, 12887 => 27815, + 12888 => 34255, 12889 => 25805, 12890 => 31961, 12891 => 27133, 12892 => 26361, + 12893 => 33609, 12894 => 21397, 12895 => 31574, 12896 => 20391, 12897 => 20876, + 12898 => 27979, 12899 => 23618, 12900 => 36461, 12901 => 25554, 12902 => 21449, + 12903 => 33580, 12904 => 33590, 12905 => 26597, 12906 => 30900, 12907 => 25661, + 12908 => 23519, 12909 => 23700, 12910 => 24046, 12911 => 35815, 12912 => 25286, + 12913 => 26612, 12914 => 35962, 12915 => 25600, 12916 => 25530, 12917 => 34633, + 12918 => 39307, 12919 => 35863, 12920 => 32544, 12921 => 38130, 12922 => 20135, + 12923 => 38416, 12924 => 39076, 12925 => 26124, 12926 => 29462, 13089 => 22330, + 13090 => 23581, 13091 => 24120, 13092 => 38271, 13093 => 20607, 13094 => 32928, + 13095 => 21378, 13096 => 25950, 13097 => 30021, 13098 => 21809, 13099 => 20513, + 13100 => 36229, 13101 => 25220, 13102 => 38046, 13103 => 26397, 13104 => 22066, + 13105 => 28526, 13106 => 24034, 13107 => 21557, 13108 => 28818, 13109 => 36710, + 13110 => 25199, 13111 => 25764, 13112 => 25507, 13113 => 24443, 13114 => 28552, + 13115 => 37108, 13116 => 33251, 13117 => 36784, 13118 => 23576, 13119 => 26216, + 13120 => 24561, 13121 => 27785, 13122 => 38472, 13123 => 36225, 13124 => 34924, + 13125 => 25745, 13126 => 31216, 13127 => 22478, 13128 => 27225, 13129 => 25104, + 13130 => 21576, 13131 => 20056, 13132 => 31243, 13133 => 24809, 13134 => 28548, + 13135 => 35802, 13136 => 25215, 13137 => 36894, 13138 => 39563, 13139 => 31204, + 13140 => 21507, 13141 => 30196, 13142 => 25345, 13143 => 21273, 13144 => 27744, + 13145 => 36831, 13146 => 24347, 13147 => 39536, 13148 => 32827, 13149 => 40831, + 13150 => 20360, 13151 => 23610, 13152 => 36196, 13153 => 32709, 13154 => 26021, + 13155 => 28861, 13156 => 20805, 13157 => 20914, 13158 => 34411, 13159 => 23815, + 13160 => 23456, 13161 => 25277, 13162 => 37228, 13163 => 30068, 13164 => 36364, + 13165 => 31264, 13166 => 24833, 13167 => 31609, 13168 => 20167, 13169 => 32504, + 13170 => 30597, 13171 => 19985, 13172 => 33261, 13173 => 21021, 13174 => 20986, + 13175 => 27249, 13176 => 21416, 13177 => 36487, 13178 => 38148, 13179 => 38607, + 13180 => 28353, 13181 => 38500, 13182 => 26970, 13345 => 30784, 13346 => 20648, + 13347 => 30679, 13348 => 25616, 13349 => 35302, 13350 => 22788, 13351 => 25571, + 13352 => 24029, 13353 => 31359, 13354 => 26941, 13355 => 20256, 13356 => 33337, + 13357 => 21912, 13358 => 20018, 13359 => 30126, 13360 => 31383, 13361 => 24162, + 13362 => 24202, 13363 => 38383, 13364 => 21019, 13365 => 21561, 13366 => 28810, + 13367 => 25462, 13368 => 38180, 13369 => 22402, 13370 => 26149, 13371 => 26943, + 13372 => 37255, 13373 => 21767, 13374 => 28147, 13375 => 32431, 13376 => 34850, + 13377 => 25139, 13378 => 32496, 13379 => 30133, 13380 => 33576, 13381 => 30913, + 13382 => 38604, 13383 => 36766, 13384 => 24904, 13385 => 29943, 13386 => 35789, + 13387 => 27492, 13388 => 21050, 13389 => 36176, 13390 => 27425, 13391 => 32874, + 13392 => 33905, 13393 => 22257, 13394 => 21254, 13395 => 20174, 13396 => 19995, + 13397 => 20945, 13398 => 31895, 13399 => 37259, 13400 => 31751, 13401 => 20419, + 13402 => 36479, 13403 => 31713, 13404 => 31388, 13405 => 25703, 13406 => 23828, + 13407 => 20652, 13408 => 33030, 13409 => 30209, 13410 => 31929, 13411 => 28140, + 13412 => 32736, 13413 => 26449, 13414 => 23384, 13415 => 23544, 13416 => 30923, + 13417 => 25774, 13418 => 25619, 13419 => 25514, 13420 => 25387, 13421 => 38169, + 13422 => 25645, 13423 => 36798, 13424 => 31572, 13425 => 30249, 13426 => 25171, + 13427 => 22823, 13428 => 21574, 13429 => 27513, 13430 => 20643, 13431 => 25140, + 13432 => 24102, 13433 => 27526, 13434 => 20195, 13435 => 36151, 13436 => 34955, + 13437 => 24453, 13438 => 36910, 13601 => 24608, 13602 => 32829, 13603 => 25285, + 13604 => 20025, 13605 => 21333, 13606 => 37112, 13607 => 25528, 13608 => 32966, + 13609 => 26086, 13610 => 27694, 13611 => 20294, 13612 => 24814, 13613 => 28129, + 13614 => 35806, 13615 => 24377, 13616 => 34507, 13617 => 24403, 13618 => 25377, + 13619 => 20826, 13620 => 33633, 13621 => 26723, 13622 => 20992, 13623 => 25443, + 13624 => 36424, 13625 => 20498, 13626 => 23707, 13627 => 31095, 13628 => 23548, + 13629 => 21040, 13630 => 31291, 13631 => 24764, 13632 => 36947, 13633 => 30423, + 13634 => 24503, 13635 => 24471, 13636 => 30340, 13637 => 36460, 13638 => 28783, + 13639 => 30331, 13640 => 31561, 13641 => 30634, 13642 => 20979, 13643 => 37011, + 13644 => 22564, 13645 => 20302, 13646 => 28404, 13647 => 36842, 13648 => 25932, + 13649 => 31515, 13650 => 29380, 13651 => 28068, 13652 => 32735, 13653 => 23265, + 13654 => 25269, 13655 => 24213, 13656 => 22320, 13657 => 33922, 13658 => 31532, + 13659 => 24093, 13660 => 24351, 13661 => 36882, 13662 => 32532, 13663 => 39072, + 13664 => 25474, 13665 => 28359, 13666 => 30872, 13667 => 28857, 13668 => 20856, + 13669 => 38747, 13670 => 22443, 13671 => 30005, 13672 => 20291, 13673 => 30008, + 13674 => 24215, 13675 => 24806, 13676 => 22880, 13677 => 28096, 13678 => 27583, + 13679 => 30857, 13680 => 21500, 13681 => 38613, 13682 => 20939, 13683 => 20993, + 13684 => 25481, 13685 => 21514, 13686 => 38035, 13687 => 35843, 13688 => 36300, + 13689 => 29241, 13690 => 30879, 13691 => 34678, 13692 => 36845, 13693 => 35853, + 13694 => 21472, 13857 => 19969, 13858 => 30447, 13859 => 21486, 13860 => 38025, + 13861 => 39030, 13862 => 40718, 13863 => 38189, 13864 => 23450, 13865 => 35746, + 13866 => 20002, 13867 => 19996, 13868 => 20908, 13869 => 33891, 13870 => 25026, + 13871 => 21160, 13872 => 26635, 13873 => 20375, 13874 => 24683, 13875 => 20923, + 13876 => 27934, 13877 => 20828, 13878 => 25238, 13879 => 26007, 13880 => 38497, + 13881 => 35910, 13882 => 36887, 13883 => 30168, 13884 => 37117, 13885 => 30563, + 13886 => 27602, 13887 => 29322, 13888 => 29420, 13889 => 35835, 13890 => 22581, + 13891 => 30585, 13892 => 36172, 13893 => 26460, 13894 => 38208, 13895 => 32922, + 13896 => 24230, 13897 => 28193, 13898 => 22930, 13899 => 31471, 13900 => 30701, + 13901 => 38203, 13902 => 27573, 13903 => 26029, 13904 => 32526, 13905 => 22534, + 13906 => 20817, 13907 => 38431, 13908 => 23545, 13909 => 22697, 13910 => 21544, + 13911 => 36466, 13912 => 25958, 13913 => 39039, 13914 => 22244, 13915 => 38045, + 13916 => 30462, 13917 => 36929, 13918 => 25479, 13919 => 21702, 13920 => 22810, + 13921 => 22842, 13922 => 22427, 13923 => 36530, 13924 => 26421, 13925 => 36346, + 13926 => 33333, 13927 => 21057, 13928 => 24816, 13929 => 22549, 13930 => 34558, + 13931 => 23784, 13932 => 40517, 13933 => 20420, 13934 => 39069, 13935 => 35769, + 13936 => 23077, 13937 => 24694, 13938 => 21380, 13939 => 25212, 13940 => 36943, + 13941 => 37122, 13942 => 39295, 13943 => 24681, 13944 => 32780, 13945 => 20799, + 13946 => 32819, 13947 => 23572, 13948 => 39285, 13949 => 27953, 13950 => 20108, + 14113 => 36144, 14114 => 21457, 14115 => 32602, 14116 => 31567, 14117 => 20240, + 14118 => 20047, 14119 => 38400, 14120 => 27861, 14121 => 29648, 14122 => 34281, + 14123 => 24070, 14124 => 30058, 14125 => 32763, 14126 => 27146, 14127 => 30718, + 14128 => 38034, 14129 => 32321, 14130 => 20961, 14131 => 28902, 14132 => 21453, + 14133 => 36820, 14134 => 33539, 14135 => 36137, 14136 => 29359, 14137 => 39277, + 14138 => 27867, 14139 => 22346, 14140 => 33459, 14141 => 26041, 14142 => 32938, + 14143 => 25151, 14144 => 38450, 14145 => 22952, 14146 => 20223, 14147 => 35775, + 14148 => 32442, 14149 => 25918, 14150 => 33778, 14151 => 38750, 14152 => 21857, + 14153 => 39134, 14154 => 32933, 14155 => 21290, 14156 => 35837, 14157 => 21536, + 14158 => 32954, 14159 => 24223, 14160 => 27832, 14161 => 36153, 14162 => 33452, + 14163 => 37210, 14164 => 21545, 14165 => 27675, 14166 => 20998, 14167 => 32439, + 14168 => 22367, 14169 => 28954, 14170 => 27774, 14171 => 31881, 14172 => 22859, + 14173 => 20221, 14174 => 24575, 14175 => 24868, 14176 => 31914, 14177 => 20016, + 14178 => 23553, 14179 => 26539, 14180 => 34562, 14181 => 23792, 14182 => 38155, + 14183 => 39118, 14184 => 30127, 14185 => 28925, 14186 => 36898, 14187 => 20911, + 14188 => 32541, 14189 => 35773, 14190 => 22857, 14191 => 20964, 14192 => 20315, + 14193 => 21542, 14194 => 22827, 14195 => 25975, 14196 => 32932, 14197 => 23413, + 14198 => 25206, 14199 => 25282, 14200 => 36752, 14201 => 24133, 14202 => 27679, + 14203 => 31526, 14204 => 20239, 14205 => 20440, 14206 => 26381, 14369 => 28014, + 14370 => 28074, 14371 => 31119, 14372 => 34993, 14373 => 24343, 14374 => 29995, + 14375 => 25242, 14376 => 36741, 14377 => 20463, 14378 => 37340, 14379 => 26023, + 14380 => 33071, 14381 => 33105, 14382 => 24220, 14383 => 33104, 14384 => 36212, + 14385 => 21103, 14386 => 35206, 14387 => 36171, 14388 => 22797, 14389 => 20613, + 14390 => 20184, 14391 => 38428, 14392 => 29238, 14393 => 33145, 14394 => 36127, + 14395 => 23500, 14396 => 35747, 14397 => 38468, 14398 => 22919, 14399 => 32538, + 14400 => 21648, 14401 => 22134, 14402 => 22030, 14403 => 35813, 14404 => 25913, + 14405 => 27010, 14406 => 38041, 14407 => 30422, 14408 => 28297, 14409 => 24178, + 14410 => 29976, 14411 => 26438, 14412 => 26577, 14413 => 31487, 14414 => 32925, + 14415 => 36214, 14416 => 24863, 14417 => 31174, 14418 => 25954, 14419 => 36195, + 14420 => 20872, 14421 => 21018, 14422 => 38050, 14423 => 32568, 14424 => 32923, + 14425 => 32434, 14426 => 23703, 14427 => 28207, 14428 => 26464, 14429 => 31705, + 14430 => 30347, 14431 => 39640, 14432 => 33167, 14433 => 32660, 14434 => 31957, + 14435 => 25630, 14436 => 38224, 14437 => 31295, 14438 => 21578, 14439 => 21733, + 14440 => 27468, 14441 => 25601, 14442 => 25096, 14443 => 40509, 14444 => 33011, + 14445 => 30105, 14446 => 21106, 14447 => 38761, 14448 => 33883, 14449 => 26684, + 14450 => 34532, 14451 => 38401, 14452 => 38548, 14453 => 38124, 14454 => 20010, + 14455 => 21508, 14456 => 32473, 14457 => 26681, 14458 => 36319, 14459 => 32789, + 14460 => 26356, 14461 => 24218, 14462 => 32697, 14625 => 22466, 14626 => 32831, + 14627 => 26775, 14628 => 24037, 14629 => 25915, 14630 => 21151, 14631 => 24685, + 14632 => 40858, 14633 => 20379, 14634 => 36524, 14635 => 20844, 14636 => 23467, + 14637 => 24339, 14638 => 24041, 14639 => 27742, 14640 => 25329, 14641 => 36129, + 14642 => 20849, 14643 => 38057, 14644 => 21246, 14645 => 27807, 14646 => 33503, + 14647 => 29399, 14648 => 22434, 14649 => 26500, 14650 => 36141, 14651 => 22815, + 14652 => 36764, 14653 => 33735, 14654 => 21653, 14655 => 31629, 14656 => 20272, + 14657 => 27837, 14658 => 23396, 14659 => 22993, 14660 => 40723, 14661 => 21476, + 14662 => 34506, 14663 => 39592, 14664 => 35895, 14665 => 32929, 14666 => 25925, + 14667 => 39038, 14668 => 22266, 14669 => 38599, 14670 => 21038, 14671 => 29916, + 14672 => 21072, 14673 => 23521, 14674 => 25346, 14675 => 35074, 14676 => 20054, + 14677 => 25296, 14678 => 24618, 14679 => 26874, 14680 => 20851, 14681 => 23448, + 14682 => 20896, 14683 => 35266, 14684 => 31649, 14685 => 39302, 14686 => 32592, + 14687 => 24815, 14688 => 28748, 14689 => 36143, 14690 => 20809, 14691 => 24191, + 14692 => 36891, 14693 => 29808, 14694 => 35268, 14695 => 22317, 14696 => 30789, + 14697 => 24402, 14698 => 40863, 14699 => 38394, 14700 => 36712, 14701 => 39740, + 14702 => 35809, 14703 => 30328, 14704 => 26690, 14705 => 26588, 14706 => 36330, + 14707 => 36149, 14708 => 21053, 14709 => 36746, 14710 => 28378, 14711 => 26829, + 14712 => 38149, 14713 => 37101, 14714 => 22269, 14715 => 26524, 14716 => 35065, + 14717 => 36807, 14718 => 21704, 14881 => 39608, 14882 => 23401, 14883 => 28023, + 14884 => 27686, 14885 => 20133, 14886 => 23475, 14887 => 39559, 14888 => 37219, + 14889 => 25000, 14890 => 37039, 14891 => 38889, 14892 => 21547, 14893 => 28085, + 14894 => 23506, 14895 => 20989, 14896 => 21898, 14897 => 32597, 14898 => 32752, + 14899 => 25788, 14900 => 25421, 14901 => 26097, 14902 => 25022, 14903 => 24717, + 14904 => 28938, 14905 => 27735, 14906 => 27721, 14907 => 22831, 14908 => 26477, + 14909 => 33322, 14910 => 22741, 14911 => 22158, 14912 => 35946, 14913 => 27627, + 14914 => 37085, 14915 => 22909, 14916 => 32791, 14917 => 21495, 14918 => 28009, + 14919 => 21621, 14920 => 21917, 14921 => 33655, 14922 => 33743, 14923 => 26680, + 14924 => 31166, 14925 => 21644, 14926 => 20309, 14927 => 21512, 14928 => 30418, + 14929 => 35977, 14930 => 38402, 14931 => 27827, 14932 => 28088, 14933 => 36203, + 14934 => 35088, 14935 => 40548, 14936 => 36154, 14937 => 22079, 14938 => 40657, + 14939 => 30165, 14940 => 24456, 14941 => 29408, 14942 => 24680, 14943 => 21756, + 14944 => 20136, 14945 => 27178, 14946 => 34913, 14947 => 24658, 14948 => 36720, + 14949 => 21700, 14950 => 28888, 14951 => 34425, 14952 => 40511, 14953 => 27946, + 14954 => 23439, 14955 => 24344, 14956 => 32418, 14957 => 21897, 14958 => 20399, + 14959 => 29492, 14960 => 21564, 14961 => 21402, 14962 => 20505, 14963 => 21518, + 14964 => 21628, 14965 => 20046, 14966 => 24573, 14967 => 29786, 14968 => 22774, + 14969 => 33899, 14970 => 32993, 14971 => 34676, 14972 => 29392, 14973 => 31946, + 14974 => 28246, 15137 => 24359, 15138 => 34382, 15139 => 21804, 15140 => 25252, + 15141 => 20114, 15142 => 27818, 15143 => 25143, 15144 => 33457, 15145 => 21719, + 15146 => 21326, 15147 => 29502, 15148 => 28369, 15149 => 30011, 15150 => 21010, + 15151 => 21270, 15152 => 35805, 15153 => 27088, 15154 => 24458, 15155 => 24576, + 15156 => 28142, 15157 => 22351, 15158 => 27426, 15159 => 29615, 15160 => 26707, + 15161 => 36824, 15162 => 32531, 15163 => 25442, 15164 => 24739, 15165 => 21796, + 15166 => 30186, 15167 => 35938, 15168 => 28949, 15169 => 28067, 15170 => 23462, + 15171 => 24187, 15172 => 33618, 15173 => 24908, 15174 => 40644, 15175 => 30970, + 15176 => 34647, 15177 => 31783, 15178 => 30343, 15179 => 20976, 15180 => 24822, + 15181 => 29004, 15182 => 26179, 15183 => 24140, 15184 => 24653, 15185 => 35854, + 15186 => 28784, 15187 => 25381, 15188 => 36745, 15189 => 24509, 15190 => 24674, + 15191 => 34516, 15192 => 22238, 15193 => 27585, 15194 => 24724, 15195 => 24935, + 15196 => 21321, 15197 => 24800, 15198 => 26214, 15199 => 36159, 15200 => 31229, + 15201 => 20250, 15202 => 28905, 15203 => 27719, 15204 => 35763, 15205 => 35826, + 15206 => 32472, 15207 => 33636, 15208 => 26127, 15209 => 23130, 15210 => 39746, + 15211 => 27985, 15212 => 28151, 15213 => 35905, 15214 => 27963, 15215 => 20249, + 15216 => 28779, 15217 => 33719, 15218 => 25110, 15219 => 24785, 15220 => 38669, + 15221 => 36135, 15222 => 31096, 15223 => 20987, 15224 => 22334, 15225 => 22522, + 15226 => 26426, 15227 => 30072, 15228 => 31293, 15229 => 31215, 15230 => 31637, + 15393 => 32908, 15394 => 39269, 15395 => 36857, 15396 => 28608, 15397 => 35749, + 15398 => 40481, 15399 => 23020, 15400 => 32489, 15401 => 32521, 15402 => 21513, + 15403 => 26497, 15404 => 26840, 15405 => 36753, 15406 => 31821, 15407 => 38598, + 15408 => 21450, 15409 => 24613, 15410 => 30142, 15411 => 27762, 15412 => 21363, + 15413 => 23241, 15414 => 32423, 15415 => 25380, 15416 => 20960, 15417 => 33034, + 15418 => 24049, 15419 => 34015, 15420 => 25216, 15421 => 20864, 15422 => 23395, + 15423 => 20238, 15424 => 31085, 15425 => 21058, 15426 => 24760, 15427 => 27982, + 15428 => 23492, 15429 => 23490, 15430 => 35745, 15431 => 35760, 15432 => 26082, + 15433 => 24524, 15434 => 38469, 15435 => 22931, 15436 => 32487, 15437 => 32426, + 15438 => 22025, 15439 => 26551, 15440 => 22841, 15441 => 20339, 15442 => 23478, + 15443 => 21152, 15444 => 33626, 15445 => 39050, 15446 => 36158, 15447 => 30002, + 15448 => 38078, 15449 => 20551, 15450 => 31292, 15451 => 20215, 15452 => 26550, + 15453 => 39550, 15454 => 23233, 15455 => 27516, 15456 => 30417, 15457 => 22362, + 15458 => 23574, 15459 => 31546, 15460 => 38388, 15461 => 29006, 15462 => 20860, + 15463 => 32937, 15464 => 33392, 15465 => 22904, 15466 => 32516, 15467 => 33575, + 15468 => 26816, 15469 => 26604, 15470 => 30897, 15471 => 30839, 15472 => 25315, + 15473 => 25441, 15474 => 31616, 15475 => 20461, 15476 => 21098, 15477 => 20943, + 15478 => 33616, 15479 => 27099, 15480 => 37492, 15481 => 36341, 15482 => 36145, + 15483 => 35265, 15484 => 38190, 15485 => 31661, 15486 => 20214, 15649 => 20581, + 15650 => 33328, 15651 => 21073, 15652 => 39279, 15653 => 28176, 15654 => 28293, + 15655 => 28071, 15656 => 24314, 15657 => 20725, 15658 => 23004, 15659 => 23558, + 15660 => 27974, 15661 => 27743, 15662 => 30086, 15663 => 33931, 15664 => 26728, + 15665 => 22870, 15666 => 35762, 15667 => 21280, 15668 => 37233, 15669 => 38477, + 15670 => 34121, 15671 => 26898, 15672 => 30977, 15673 => 28966, 15674 => 33014, + 15675 => 20132, 15676 => 37066, 15677 => 27975, 15678 => 39556, 15679 => 23047, + 15680 => 22204, 15681 => 25605, 15682 => 38128, 15683 => 30699, 15684 => 20389, + 15685 => 33050, 15686 => 29409, 15687 => 35282, 15688 => 39290, 15689 => 32564, + 15690 => 32478, 15691 => 21119, 15692 => 25945, 15693 => 37237, 15694 => 36735, + 15695 => 36739, 15696 => 21483, 15697 => 31382, 15698 => 25581, 15699 => 25509, + 15700 => 30342, 15701 => 31224, 15702 => 34903, 15703 => 38454, 15704 => 25130, + 15705 => 21163, 15706 => 33410, 15707 => 26708, 15708 => 26480, 15709 => 25463, + 15710 => 30571, 15711 => 31469, 15712 => 27905, 15713 => 32467, 15714 => 35299, + 15715 => 22992, 15716 => 25106, 15717 => 34249, 15718 => 33445, 15719 => 30028, + 15720 => 20511, 15721 => 20171, 15722 => 30117, 15723 => 35819, 15724 => 23626, + 15725 => 24062, 15726 => 31563, 15727 => 26020, 15728 => 37329, 15729 => 20170, + 15730 => 27941, 15731 => 35167, 15732 => 32039, 15733 => 38182, 15734 => 20165, + 15735 => 35880, 15736 => 36827, 15737 => 38771, 15738 => 26187, 15739 => 31105, + 15740 => 36817, 15741 => 28908, 15742 => 28024, 15905 => 23613, 15906 => 21170, + 15907 => 33606, 15908 => 20834, 15909 => 33550, 15910 => 30555, 15911 => 26230, + 15912 => 40120, 15913 => 20140, 15914 => 24778, 15915 => 31934, 15916 => 31923, + 15917 => 32463, 15918 => 20117, 15919 => 35686, 15920 => 26223, 15921 => 39048, + 15922 => 38745, 15923 => 22659, 15924 => 25964, 15925 => 38236, 15926 => 24452, + 15927 => 30153, 15928 => 38742, 15929 => 31455, 15930 => 31454, 15931 => 20928, + 15932 => 28847, 15933 => 31384, 15934 => 25578, 15935 => 31350, 15936 => 32416, + 15937 => 29590, 15938 => 38893, 15939 => 20037, 15940 => 28792, 15941 => 20061, + 15942 => 37202, 15943 => 21417, 15944 => 25937, 15945 => 26087, 15946 => 33276, + 15947 => 33285, 15948 => 21646, 15949 => 23601, 15950 => 30106, 15951 => 38816, + 15952 => 25304, 15953 => 29401, 15954 => 30141, 15955 => 23621, 15956 => 39545, + 15957 => 33738, 15958 => 23616, 15959 => 21632, 15960 => 30697, 15961 => 20030, + 15962 => 27822, 15963 => 32858, 15964 => 25298, 15965 => 25454, 15966 => 24040, + 15967 => 20855, 15968 => 36317, 15969 => 36382, 15970 => 38191, 15971 => 20465, + 15972 => 21477, 15973 => 24807, 15974 => 28844, 15975 => 21095, 15976 => 25424, + 15977 => 40515, 15978 => 23071, 15979 => 20518, 15980 => 30519, 15981 => 21367, + 15982 => 32482, 15983 => 25733, 15984 => 25899, 15985 => 25225, 15986 => 25496, + 15987 => 20500, 15988 => 29237, 15989 => 35273, 15990 => 20915, 15991 => 35776, + 15992 => 32477, 15993 => 22343, 15994 => 33740, 15995 => 38055, 15996 => 20891, + 15997 => 21531, 15998 => 23803, 16161 => 20426, 16162 => 31459, 16163 => 27994, + 16164 => 37089, 16165 => 39567, 16166 => 21888, 16167 => 21654, 16168 => 21345, + 16169 => 21679, 16170 => 24320, 16171 => 25577, 16172 => 26999, 16173 => 20975, + 16174 => 24936, 16175 => 21002, 16176 => 22570, 16177 => 21208, 16178 => 22350, + 16179 => 30733, 16180 => 30475, 16181 => 24247, 16182 => 24951, 16183 => 31968, + 16184 => 25179, 16185 => 25239, 16186 => 20130, 16187 => 28821, 16188 => 32771, + 16189 => 25335, 16190 => 28900, 16191 => 38752, 16192 => 22391, 16193 => 33499, + 16194 => 26607, 16195 => 26869, 16196 => 30933, 16197 => 39063, 16198 => 31185, + 16199 => 22771, 16200 => 21683, 16201 => 21487, 16202 => 28212, 16203 => 20811, + 16204 => 21051, 16205 => 23458, 16206 => 35838, 16207 => 32943, 16208 => 21827, + 16209 => 22438, 16210 => 24691, 16211 => 22353, 16212 => 21549, 16213 => 31354, + 16214 => 24656, 16215 => 23380, 16216 => 25511, 16217 => 25248, 16218 => 21475, + 16219 => 25187, 16220 => 23495, 16221 => 26543, 16222 => 21741, 16223 => 31391, + 16224 => 33510, 16225 => 37239, 16226 => 24211, 16227 => 35044, 16228 => 22840, + 16229 => 22446, 16230 => 25358, 16231 => 36328, 16232 => 33007, 16233 => 22359, + 16234 => 31607, 16235 => 20393, 16236 => 24555, 16237 => 23485, 16238 => 27454, + 16239 => 21281, 16240 => 31568, 16241 => 29378, 16242 => 26694, 16243 => 30719, + 16244 => 30518, 16245 => 26103, 16246 => 20917, 16247 => 20111, 16248 => 30420, + 16249 => 23743, 16250 => 31397, 16251 => 33909, 16252 => 22862, 16253 => 39745, + 16254 => 20608, 16417 => 39304, 16418 => 24871, 16419 => 28291, 16420 => 22372, + 16421 => 26118, 16422 => 25414, 16423 => 22256, 16424 => 25324, 16425 => 25193, + 16426 => 24275, 16427 => 38420, 16428 => 22403, 16429 => 25289, 16430 => 21895, + 16431 => 34593, 16432 => 33098, 16433 => 36771, 16434 => 21862, 16435 => 33713, + 16436 => 26469, 16437 => 36182, 16438 => 34013, 16439 => 23146, 16440 => 26639, + 16441 => 25318, 16442 => 31726, 16443 => 38417, 16444 => 20848, 16445 => 28572, + 16446 => 35888, 16447 => 25597, 16448 => 35272, 16449 => 25042, 16450 => 32518, + 16451 => 28866, 16452 => 28389, 16453 => 29701, 16454 => 27028, 16455 => 29436, + 16456 => 24266, 16457 => 37070, 16458 => 26391, 16459 => 28010, 16460 => 25438, + 16461 => 21171, 16462 => 29282, 16463 => 32769, 16464 => 20332, 16465 => 23013, + 16466 => 37226, 16467 => 28889, 16468 => 28061, 16469 => 21202, 16470 => 20048, + 16471 => 38647, 16472 => 38253, 16473 => 34174, 16474 => 30922, 16475 => 32047, + 16476 => 20769, 16477 => 22418, 16478 => 25794, 16479 => 32907, 16480 => 31867, + 16481 => 27882, 16482 => 26865, 16483 => 26974, 16484 => 20919, 16485 => 21400, + 16486 => 26792, 16487 => 29313, 16488 => 40654, 16489 => 31729, 16490 => 29432, + 16491 => 31163, 16492 => 28435, 16493 => 29702, 16494 => 26446, 16495 => 37324, + 16496 => 40100, 16497 => 31036, 16498 => 33673, 16499 => 33620, 16500 => 21519, + 16501 => 26647, 16502 => 20029, 16503 => 21385, 16504 => 21169, 16505 => 30782, + 16506 => 21382, 16507 => 21033, 16508 => 20616, 16509 => 20363, 16510 => 20432, + 16673 => 30178, 16674 => 31435, 16675 => 31890, 16676 => 27813, 16677 => 38582, + 16678 => 21147, 16679 => 29827, 16680 => 21737, 16681 => 20457, 16682 => 32852, + 16683 => 33714, 16684 => 36830, 16685 => 38256, 16686 => 24265, 16687 => 24604, + 16688 => 28063, 16689 => 24088, 16690 => 25947, 16691 => 33080, 16692 => 38142, + 16693 => 24651, 16694 => 28860, 16695 => 32451, 16696 => 31918, 16697 => 20937, + 16698 => 26753, 16699 => 31921, 16700 => 33391, 16701 => 20004, 16702 => 36742, + 16703 => 37327, 16704 => 26238, 16705 => 20142, 16706 => 35845, 16707 => 25769, + 16708 => 32842, 16709 => 20698, 16710 => 30103, 16711 => 29134, 16712 => 23525, + 16713 => 36797, 16714 => 28518, 16715 => 20102, 16716 => 25730, 16717 => 38243, + 16718 => 24278, 16719 => 26009, 16720 => 21015, 16721 => 35010, 16722 => 28872, + 16723 => 21155, 16724 => 29454, 16725 => 29747, 16726 => 26519, 16727 => 30967, + 16728 => 38678, 16729 => 20020, 16730 => 37051, 16731 => 40158, 16732 => 28107, + 16733 => 20955, 16734 => 36161, 16735 => 21533, 16736 => 25294, 16737 => 29618, + 16738 => 33777, 16739 => 38646, 16740 => 40836, 16741 => 38083, 16742 => 20278, + 16743 => 32666, 16744 => 20940, 16745 => 28789, 16746 => 38517, 16747 => 23725, + 16748 => 39046, 16749 => 21478, 16750 => 20196, 16751 => 28316, 16752 => 29705, + 16753 => 27060, 16754 => 30827, 16755 => 39311, 16756 => 30041, 16757 => 21016, + 16758 => 30244, 16759 => 27969, 16760 => 26611, 16761 => 20845, 16762 => 40857, + 16763 => 32843, 16764 => 21657, 16765 => 31548, 16766 => 31423, 16929 => 38534, + 16930 => 22404, 16931 => 25314, 16932 => 38471, 16933 => 27004, 16934 => 23044, + 16935 => 25602, 16936 => 31699, 16937 => 28431, 16938 => 38475, 16939 => 33446, + 16940 => 21346, 16941 => 39045, 16942 => 24208, 16943 => 28809, 16944 => 25523, + 16945 => 21348, 16946 => 34383, 16947 => 40065, 16948 => 40595, 16949 => 30860, + 16950 => 38706, 16951 => 36335, 16952 => 36162, 16953 => 40575, 16954 => 28510, + 16955 => 31108, 16956 => 24405, 16957 => 38470, 16958 => 25134, 16959 => 39540, + 16960 => 21525, 16961 => 38109, 16962 => 20387, 16963 => 26053, 16964 => 23653, + 16965 => 23649, 16966 => 32533, 16967 => 34385, 16968 => 27695, 16969 => 24459, + 16970 => 29575, 16971 => 28388, 16972 => 32511, 16973 => 23782, 16974 => 25371, + 16975 => 23402, 16976 => 28390, 16977 => 21365, 16978 => 20081, 16979 => 25504, + 16980 => 30053, 16981 => 25249, 16982 => 36718, 16983 => 20262, 16984 => 20177, + 16985 => 27814, 16986 => 32438, 16987 => 35770, 16988 => 33821, 16989 => 34746, + 16990 => 32599, 16991 => 36923, 16992 => 38179, 16993 => 31657, 16994 => 39585, + 16995 => 35064, 16996 => 33853, 16997 => 27931, 16998 => 39558, 16999 => 32476, + 17000 => 22920, 17001 => 40635, 17002 => 29595, 17003 => 30721, 17004 => 34434, + 17005 => 39532, 17006 => 39554, 17007 => 22043, 17008 => 21527, 17009 => 22475, + 17010 => 20080, 17011 => 40614, 17012 => 21334, 17013 => 36808, 17014 => 33033, + 17015 => 30610, 17016 => 39314, 17017 => 34542, 17018 => 28385, 17019 => 34067, + 17020 => 26364, 17021 => 24930, 17022 => 28459, 17185 => 35881, 17186 => 33426, + 17187 => 33579, 17188 => 30450, 17189 => 27667, 17190 => 24537, 17191 => 33725, + 17192 => 29483, 17193 => 33541, 17194 => 38170, 17195 => 27611, 17196 => 30683, + 17197 => 38086, 17198 => 21359, 17199 => 33538, 17200 => 20882, 17201 => 24125, + 17202 => 35980, 17203 => 36152, 17204 => 20040, 17205 => 29611, 17206 => 26522, + 17207 => 26757, 17208 => 37238, 17209 => 38665, 17210 => 29028, 17211 => 27809, + 17212 => 30473, 17213 => 23186, 17214 => 38209, 17215 => 27599, 17216 => 32654, + 17217 => 26151, 17218 => 23504, 17219 => 22969, 17220 => 23194, 17221 => 38376, + 17222 => 38391, 17223 => 20204, 17224 => 33804, 17225 => 33945, 17226 => 27308, + 17227 => 30431, 17228 => 38192, 17229 => 29467, 17230 => 26790, 17231 => 23391, + 17232 => 30511, 17233 => 37274, 17234 => 38753, 17235 => 31964, 17236 => 36855, + 17237 => 35868, 17238 => 24357, 17239 => 31859, 17240 => 31192, 17241 => 35269, + 17242 => 27852, 17243 => 34588, 17244 => 23494, 17245 => 24130, 17246 => 26825, + 17247 => 30496, 17248 => 32501, 17249 => 20885, 17250 => 20813, 17251 => 21193, + 17252 => 23081, 17253 => 32517, 17254 => 38754, 17255 => 33495, 17256 => 25551, + 17257 => 30596, 17258 => 34256, 17259 => 31186, 17260 => 28218, 17261 => 24217, + 17262 => 22937, 17263 => 34065, 17264 => 28781, 17265 => 27665, 17266 => 25279, + 17267 => 30399, 17268 => 25935, 17269 => 24751, 17270 => 38397, 17271 => 26126, + 17272 => 34719, 17273 => 40483, 17274 => 38125, 17275 => 21517, 17276 => 21629, + 17277 => 35884, 17278 => 25720, 17441 => 25721, 17442 => 34321, 17443 => 27169, + 17444 => 33180, 17445 => 30952, 17446 => 25705, 17447 => 39764, 17448 => 25273, + 17449 => 26411, 17450 => 33707, 17451 => 22696, 17452 => 40664, 17453 => 27819, + 17454 => 28448, 17455 => 23518, 17456 => 38476, 17457 => 35851, 17458 => 29279, + 17459 => 26576, 17460 => 25287, 17461 => 29281, 17462 => 20137, 17463 => 22982, + 17464 => 27597, 17465 => 22675, 17466 => 26286, 17467 => 24149, 17468 => 21215, + 17469 => 24917, 17470 => 26408, 17471 => 30446, 17472 => 30566, 17473 => 29287, + 17474 => 31302, 17475 => 25343, 17476 => 21738, 17477 => 21584, 17478 => 38048, + 17479 => 37027, 17480 => 23068, 17481 => 32435, 17482 => 27670, 17483 => 20035, + 17484 => 22902, 17485 => 32784, 17486 => 22856, 17487 => 21335, 17488 => 30007, + 17489 => 38590, 17490 => 22218, 17491 => 25376, 17492 => 33041, 17493 => 24700, + 17494 => 38393, 17495 => 28118, 17496 => 21602, 17497 => 39297, 17498 => 20869, + 17499 => 23273, 17500 => 33021, 17501 => 22958, 17502 => 38675, 17503 => 20522, + 17504 => 27877, 17505 => 23612, 17506 => 25311, 17507 => 20320, 17508 => 21311, + 17509 => 33147, 17510 => 36870, 17511 => 28346, 17512 => 34091, 17513 => 25288, + 17514 => 24180, 17515 => 30910, 17516 => 25781, 17517 => 25467, 17518 => 24565, + 17519 => 23064, 17520 => 37247, 17521 => 40479, 17522 => 23615, 17523 => 25423, + 17524 => 32834, 17525 => 23421, 17526 => 21870, 17527 => 38218, 17528 => 38221, + 17529 => 28037, 17530 => 24744, 17531 => 26592, 17532 => 29406, 17533 => 20957, + 17534 => 23425, 17697 => 25319, 17698 => 27870, 17699 => 29275, 17700 => 25197, + 17701 => 38062, 17702 => 32445, 17703 => 33043, 17704 => 27987, 17705 => 20892, + 17706 => 24324, 17707 => 22900, 17708 => 21162, 17709 => 24594, 17710 => 22899, + 17711 => 26262, 17712 => 34384, 17713 => 30111, 17714 => 25386, 17715 => 25062, + 17716 => 31983, 17717 => 35834, 17718 => 21734, 17719 => 27431, 17720 => 40485, + 17721 => 27572, 17722 => 34261, 17723 => 21589, 17724 => 20598, 17725 => 27812, + 17726 => 21866, 17727 => 36276, 17728 => 29228, 17729 => 24085, 17730 => 24597, + 17731 => 29750, 17732 => 25293, 17733 => 25490, 17734 => 29260, 17735 => 24472, + 17736 => 28227, 17737 => 27966, 17738 => 25856, 17739 => 28504, 17740 => 30424, + 17741 => 30928, 17742 => 30460, 17743 => 30036, 17744 => 21028, 17745 => 21467, + 17746 => 20051, 17747 => 24222, 17748 => 26049, 17749 => 32810, 17750 => 32982, + 17751 => 25243, 17752 => 21638, 17753 => 21032, 17754 => 28846, 17755 => 34957, + 17756 => 36305, 17757 => 27873, 17758 => 21624, 17759 => 32986, 17760 => 22521, + 17761 => 35060, 17762 => 36180, 17763 => 38506, 17764 => 37197, 17765 => 20329, + 17766 => 27803, 17767 => 21943, 17768 => 30406, 17769 => 30768, 17770 => 25256, + 17771 => 28921, 17772 => 28558, 17773 => 24429, 17774 => 34028, 17775 => 26842, + 17776 => 30844, 17777 => 31735, 17778 => 33192, 17779 => 26379, 17780 => 40527, + 17781 => 25447, 17782 => 30896, 17783 => 22383, 17784 => 30738, 17785 => 38713, + 17786 => 25209, 17787 => 25259, 17788 => 21128, 17789 => 29749, 17790 => 27607, + 17953 => 21860, 17954 => 33086, 17955 => 30130, 17956 => 30382, 17957 => 21305, + 17958 => 30174, 17959 => 20731, 17960 => 23617, 17961 => 35692, 17962 => 31687, + 17963 => 20559, 17964 => 29255, 17965 => 39575, 17966 => 39128, 17967 => 28418, + 17968 => 29922, 17969 => 31080, 17970 => 25735, 17971 => 30629, 17972 => 25340, + 17973 => 39057, 17974 => 36139, 17975 => 21697, 17976 => 32856, 17977 => 20050, + 17978 => 22378, 17979 => 33529, 17980 => 33805, 17981 => 24179, 17982 => 20973, + 17983 => 29942, 17984 => 35780, 17985 => 23631, 17986 => 22369, 17987 => 27900, + 17988 => 39047, 17989 => 23110, 17990 => 30772, 17991 => 39748, 17992 => 36843, + 17993 => 31893, 17994 => 21078, 17995 => 25169, 17996 => 38138, 17997 => 20166, + 17998 => 33670, 17999 => 33889, 18000 => 33769, 18001 => 33970, 18002 => 22484, + 18003 => 26420, 18004 => 22275, 18005 => 26222, 18006 => 28006, 18007 => 35889, + 18008 => 26333, 18009 => 28689, 18010 => 26399, 18011 => 27450, 18012 => 26646, + 18013 => 25114, 18014 => 22971, 18015 => 19971, 18016 => 20932, 18017 => 28422, + 18018 => 26578, 18019 => 27791, 18020 => 20854, 18021 => 26827, 18022 => 22855, + 18023 => 27495, 18024 => 30054, 18025 => 23822, 18026 => 33040, 18027 => 40784, + 18028 => 26071, 18029 => 31048, 18030 => 31041, 18031 => 39569, 18032 => 36215, + 18033 => 23682, 18034 => 20062, 18035 => 20225, 18036 => 21551, 18037 => 22865, + 18038 => 30732, 18039 => 22120, 18040 => 27668, 18041 => 36804, 18042 => 24323, + 18043 => 27773, 18044 => 27875, 18045 => 35755, 18046 => 25488, 18209 => 24688, + 18210 => 27965, 18211 => 29301, 18212 => 25190, 18213 => 38030, 18214 => 38085, + 18215 => 21315, 18216 => 36801, 18217 => 31614, 18218 => 20191, 18219 => 35878, + 18220 => 20094, 18221 => 40660, 18222 => 38065, 18223 => 38067, 18224 => 21069, + 18225 => 28508, 18226 => 36963, 18227 => 27973, 18228 => 35892, 18229 => 22545, + 18230 => 23884, 18231 => 27424, 18232 => 27465, 18233 => 26538, 18234 => 21595, + 18235 => 33108, 18236 => 32652, 18237 => 22681, 18238 => 34103, 18239 => 24378, + 18240 => 25250, 18241 => 27207, 18242 => 38201, 18243 => 25970, 18244 => 24708, + 18245 => 26725, 18246 => 30631, 18247 => 20052, 18248 => 20392, 18249 => 24039, + 18250 => 38808, 18251 => 25772, 18252 => 32728, 18253 => 23789, 18254 => 20431, + 18255 => 31373, 18256 => 20999, 18257 => 33540, 18258 => 19988, 18259 => 24623, + 18260 => 31363, 18261 => 38054, 18262 => 20405, 18263 => 20146, 18264 => 31206, + 18265 => 29748, 18266 => 21220, 18267 => 33465, 18268 => 25810, 18269 => 31165, + 18270 => 23517, 18271 => 27777, 18272 => 38738, 18273 => 36731, 18274 => 27682, + 18275 => 20542, 18276 => 21375, 18277 => 28165, 18278 => 25806, 18279 => 26228, + 18280 => 27696, 18281 => 24773, 18282 => 39031, 18283 => 35831, 18284 => 24198, + 18285 => 29756, 18286 => 31351, 18287 => 31179, 18288 => 19992, 18289 => 37041, + 18290 => 29699, 18291 => 27714, 18292 => 22234, 18293 => 37195, 18294 => 27845, + 18295 => 36235, 18296 => 21306, 18297 => 34502, 18298 => 26354, 18299 => 36527, + 18300 => 23624, 18301 => 39537, 18302 => 28192, 18465 => 21462, 18466 => 23094, + 18467 => 40843, 18468 => 36259, 18469 => 21435, 18470 => 22280, 18471 => 39079, + 18472 => 26435, 18473 => 37275, 18474 => 27849, 18475 => 20840, 18476 => 30154, + 18477 => 25331, 18478 => 29356, 18479 => 21048, 18480 => 21149, 18481 => 32570, + 18482 => 28820, 18483 => 30264, 18484 => 21364, 18485 => 40522, 18486 => 27063, + 18487 => 30830, 18488 => 38592, 18489 => 35033, 18490 => 32676, 18491 => 28982, + 18492 => 29123, 18493 => 20873, 18494 => 26579, 18495 => 29924, 18496 => 22756, + 18497 => 25880, 18498 => 22199, 18499 => 35753, 18500 => 39286, 18501 => 25200, + 18502 => 32469, 18503 => 24825, 18504 => 28909, 18505 => 22764, 18506 => 20161, + 18507 => 20154, 18508 => 24525, 18509 => 38887, 18510 => 20219, 18511 => 35748, + 18512 => 20995, 18513 => 22922, 18514 => 32427, 18515 => 25172, 18516 => 20173, + 18517 => 26085, 18518 => 25102, 18519 => 33592, 18520 => 33993, 18521 => 33635, + 18522 => 34701, 18523 => 29076, 18524 => 28342, 18525 => 23481, 18526 => 32466, + 18527 => 20887, 18528 => 25545, 18529 => 26580, 18530 => 32905, 18531 => 33593, + 18532 => 34837, 18533 => 20754, 18534 => 23418, 18535 => 22914, 18536 => 36785, + 18537 => 20083, 18538 => 27741, 18539 => 20837, 18540 => 35109, 18541 => 36719, + 18542 => 38446, 18543 => 34122, 18544 => 29790, 18545 => 38160, 18546 => 38384, + 18547 => 28070, 18548 => 33509, 18549 => 24369, 18550 => 25746, 18551 => 27922, + 18552 => 33832, 18553 => 33134, 18554 => 40131, 18555 => 22622, 18556 => 36187, + 18557 => 19977, 18558 => 21441, 18721 => 20254, 18722 => 25955, 18723 => 26705, + 18724 => 21971, 18725 => 20007, 18726 => 25620, 18727 => 39578, 18728 => 25195, + 18729 => 23234, 18730 => 29791, 18731 => 33394, 18732 => 28073, 18733 => 26862, + 18734 => 20711, 18735 => 33678, 18736 => 30722, 18737 => 26432, 18738 => 21049, + 18739 => 27801, 18740 => 32433, 18741 => 20667, 18742 => 21861, 18743 => 29022, + 18744 => 31579, 18745 => 26194, 18746 => 29642, 18747 => 33515, 18748 => 26441, + 18749 => 23665, 18750 => 21024, 18751 => 29053, 18752 => 34923, 18753 => 38378, + 18754 => 38485, 18755 => 25797, 18756 => 36193, 18757 => 33203, 18758 => 21892, + 18759 => 27733, 18760 => 25159, 18761 => 32558, 18762 => 22674, 18763 => 20260, + 18764 => 21830, 18765 => 36175, 18766 => 26188, 18767 => 19978, 18768 => 23578, + 18769 => 35059, 18770 => 26786, 18771 => 25422, 18772 => 31245, 18773 => 28903, + 18774 => 33421, 18775 => 21242, 18776 => 38902, 18777 => 23569, 18778 => 21736, + 18779 => 37045, 18780 => 32461, 18781 => 22882, 18782 => 36170, 18783 => 34503, + 18784 => 33292, 18785 => 33293, 18786 => 36198, 18787 => 25668, 18788 => 23556, + 18789 => 24913, 18790 => 28041, 18791 => 31038, 18792 => 35774, 18793 => 30775, + 18794 => 30003, 18795 => 21627, 18796 => 20280, 18797 => 36523, 18798 => 28145, + 18799 => 23072, 18800 => 32453, 18801 => 31070, 18802 => 27784, 18803 => 23457, + 18804 => 23158, 18805 => 29978, 18806 => 32958, 18807 => 24910, 18808 => 28183, + 18809 => 22768, 18810 => 29983, 18811 => 29989, 18812 => 29298, 18813 => 21319, + 18814 => 32499, 18977 => 30465, 18978 => 30427, 18979 => 21097, 18980 => 32988, + 18981 => 22307, 18982 => 24072, 18983 => 22833, 18984 => 29422, 18985 => 26045, + 18986 => 28287, 18987 => 35799, 18988 => 23608, 18989 => 34417, 18990 => 21313, + 18991 => 30707, 18992 => 25342, 18993 => 26102, 18994 => 20160, 18995 => 39135, + 18996 => 34432, 18997 => 23454, 18998 => 35782, 18999 => 21490, 19000 => 30690, + 19001 => 20351, 19002 => 23630, 19003 => 39542, 19004 => 22987, 19005 => 24335, + 19006 => 31034, 19007 => 22763, 19008 => 19990, 19009 => 26623, 19010 => 20107, + 19011 => 25325, 19012 => 35475, 19013 => 36893, 19014 => 21183, 19015 => 26159, + 19016 => 21980, 19017 => 22124, 19018 => 36866, 19019 => 20181, 19020 => 20365, + 19021 => 37322, 19022 => 39280, 19023 => 27663, 19024 => 24066, 19025 => 24643, + 19026 => 23460, 19027 => 35270, 19028 => 35797, 19029 => 25910, 19030 => 25163, + 19031 => 39318, 19032 => 23432, 19033 => 23551, 19034 => 25480, 19035 => 21806, + 19036 => 21463, 19037 => 30246, 19038 => 20861, 19039 => 34092, 19040 => 26530, + 19041 => 26803, 19042 => 27530, 19043 => 25234, 19044 => 36755, 19045 => 21460, + 19046 => 33298, 19047 => 28113, 19048 => 30095, 19049 => 20070, 19050 => 36174, + 19051 => 23408, 19052 => 29087, 19053 => 34223, 19054 => 26257, 19055 => 26329, + 19056 => 32626, 19057 => 34560, 19058 => 40653, 19059 => 40736, 19060 => 23646, + 19061 => 26415, 19062 => 36848, 19063 => 26641, 19064 => 26463, 19065 => 25101, + 19066 => 31446, 19067 => 22661, 19068 => 24246, 19069 => 25968, 19070 => 28465, + 19233 => 24661, 19234 => 21047, 19235 => 32781, 19236 => 25684, 19237 => 34928, + 19238 => 29993, 19239 => 24069, 19240 => 26643, 19241 => 25332, 19242 => 38684, + 19243 => 21452, 19244 => 29245, 19245 => 35841, 19246 => 27700, 19247 => 30561, + 19248 => 31246, 19249 => 21550, 19250 => 30636, 19251 => 39034, 19252 => 33308, + 19253 => 35828, 19254 => 30805, 19255 => 26388, 19256 => 28865, 19257 => 26031, + 19258 => 25749, 19259 => 22070, 19260 => 24605, 19261 => 31169, 19262 => 21496, + 19263 => 19997, 19264 => 27515, 19265 => 32902, 19266 => 23546, 19267 => 21987, + 19268 => 22235, 19269 => 20282, 19270 => 20284, 19271 => 39282, 19272 => 24051, + 19273 => 26494, 19274 => 32824, 19275 => 24578, 19276 => 39042, 19277 => 36865, + 19278 => 23435, 19279 => 35772, 19280 => 35829, 19281 => 25628, 19282 => 33368, + 19283 => 25822, 19284 => 22013, 19285 => 33487, 19286 => 37221, 19287 => 20439, + 19288 => 32032, 19289 => 36895, 19290 => 31903, 19291 => 20723, 19292 => 22609, + 19293 => 28335, 19294 => 23487, 19295 => 35785, 19296 => 32899, 19297 => 37240, + 19298 => 33948, 19299 => 31639, 19300 => 34429, 19301 => 38539, 19302 => 38543, + 19303 => 32485, 19304 => 39635, 19305 => 30862, 19306 => 23681, 19307 => 31319, + 19308 => 36930, 19309 => 38567, 19310 => 31071, 19311 => 23385, 19312 => 25439, + 19313 => 31499, 19314 => 34001, 19315 => 26797, 19316 => 21766, 19317 => 32553, + 19318 => 29712, 19319 => 32034, 19320 => 38145, 19321 => 25152, 19322 => 22604, + 19323 => 20182, 19324 => 23427, 19325 => 22905, 19326 => 22612, 19489 => 29549, + 19490 => 25374, 19491 => 36427, 19492 => 36367, 19493 => 32974, 19494 => 33492, + 19495 => 25260, 19496 => 21488, 19497 => 27888, 19498 => 37214, 19499 => 22826, + 19500 => 24577, 19501 => 27760, 19502 => 22349, 19503 => 25674, 19504 => 36138, + 19505 => 30251, 19506 => 28393, 19507 => 22363, 19508 => 27264, 19509 => 30192, + 19510 => 28525, 19511 => 35885, 19512 => 35848, 19513 => 22374, 19514 => 27631, + 19515 => 34962, 19516 => 30899, 19517 => 25506, 19518 => 21497, 19519 => 28845, + 19520 => 27748, 19521 => 22616, 19522 => 25642, 19523 => 22530, 19524 => 26848, + 19525 => 33179, 19526 => 21776, 19527 => 31958, 19528 => 20504, 19529 => 36538, + 19530 => 28108, 19531 => 36255, 19532 => 28907, 19533 => 25487, 19534 => 28059, + 19535 => 28372, 19536 => 32486, 19537 => 33796, 19538 => 26691, 19539 => 36867, + 19540 => 28120, 19541 => 38518, 19542 => 35752, 19543 => 22871, 19544 => 29305, + 19545 => 34276, 19546 => 33150, 19547 => 30140, 19548 => 35466, 19549 => 26799, + 19550 => 21076, 19551 => 36386, 19552 => 38161, 19553 => 25552, 19554 => 39064, + 19555 => 36420, 19556 => 21884, 19557 => 20307, 19558 => 26367, 19559 => 22159, + 19560 => 24789, 19561 => 28053, 19562 => 21059, 19563 => 23625, 19564 => 22825, + 19565 => 28155, 19566 => 22635, 19567 => 30000, 19568 => 29980, 19569 => 24684, + 19570 => 33300, 19571 => 33094, 19572 => 25361, 19573 => 26465, 19574 => 36834, + 19575 => 30522, 19576 => 36339, 19577 => 36148, 19578 => 38081, 19579 => 24086, + 19580 => 21381, 19581 => 21548, 19582 => 28867, 19745 => 27712, 19746 => 24311, + 19747 => 20572, 19748 => 20141, 19749 => 24237, 19750 => 25402, 19751 => 33351, + 19752 => 36890, 19753 => 26704, 19754 => 37230, 19755 => 30643, 19756 => 21516, + 19757 => 38108, 19758 => 24420, 19759 => 31461, 19760 => 26742, 19761 => 25413, + 19762 => 31570, 19763 => 32479, 19764 => 30171, 19765 => 20599, 19766 => 25237, + 19767 => 22836, 19768 => 36879, 19769 => 20984, 19770 => 31171, 19771 => 31361, + 19772 => 22270, 19773 => 24466, 19774 => 36884, 19775 => 28034, 19776 => 23648, + 19777 => 22303, 19778 => 21520, 19779 => 20820, 19780 => 28237, 19781 => 22242, + 19782 => 25512, 19783 => 39059, 19784 => 33151, 19785 => 34581, 19786 => 35114, + 19787 => 36864, 19788 => 21534, 19789 => 23663, 19790 => 33216, 19791 => 25302, + 19792 => 25176, 19793 => 33073, 19794 => 40501, 19795 => 38464, 19796 => 39534, + 19797 => 39548, 19798 => 26925, 19799 => 22949, 19800 => 25299, 19801 => 21822, + 19802 => 25366, 19803 => 21703, 19804 => 34521, 19805 => 27964, 19806 => 23043, + 19807 => 29926, 19808 => 34972, 19809 => 27498, 19810 => 22806, 19811 => 35916, + 19812 => 24367, 19813 => 28286, 19814 => 29609, 19815 => 39037, 19816 => 20024, + 19817 => 28919, 19818 => 23436, 19819 => 30871, 19820 => 25405, 19821 => 26202, + 19822 => 30358, 19823 => 24779, 19824 => 23451, 19825 => 23113, 19826 => 19975, + 19827 => 33109, 19828 => 27754, 19829 => 29579, 19830 => 20129, 19831 => 26505, + 19832 => 32593, 19833 => 24448, 19834 => 26106, 19835 => 26395, 19836 => 24536, + 19837 => 22916, 19838 => 23041, 20001 => 24013, 20002 => 24494, 20003 => 21361, + 20004 => 38886, 20005 => 36829, 20006 => 26693, 20007 => 22260, 20008 => 21807, + 20009 => 24799, 20010 => 20026, 20011 => 28493, 20012 => 32500, 20013 => 33479, + 20014 => 33806, 20015 => 22996, 20016 => 20255, 20017 => 20266, 20018 => 23614, + 20019 => 32428, 20020 => 26410, 20021 => 34074, 20022 => 21619, 20023 => 30031, + 20024 => 32963, 20025 => 21890, 20026 => 39759, 20027 => 20301, 20028 => 28205, + 20029 => 35859, 20030 => 23561, 20031 => 24944, 20032 => 21355, 20033 => 30239, + 20034 => 28201, 20035 => 34442, 20036 => 25991, 20037 => 38395, 20038 => 32441, + 20039 => 21563, 20040 => 31283, 20041 => 32010, 20042 => 38382, 20043 => 21985, + 20044 => 32705, 20045 => 29934, 20046 => 25373, 20047 => 34583, 20048 => 28065, + 20049 => 31389, 20050 => 25105, 20051 => 26017, 20052 => 21351, 20053 => 25569, + 20054 => 27779, 20055 => 24043, 20056 => 21596, 20057 => 38056, 20058 => 20044, + 20059 => 27745, 20060 => 35820, 20061 => 23627, 20062 => 26080, 20063 => 33436, + 20064 => 26791, 20065 => 21566, 20066 => 21556, 20067 => 27595, 20068 => 27494, + 20069 => 20116, 20070 => 25410, 20071 => 21320, 20072 => 33310, 20073 => 20237, + 20074 => 20398, 20075 => 22366, 20076 => 25098, 20077 => 38654, 20078 => 26212, + 20079 => 29289, 20080 => 21247, 20081 => 21153, 20082 => 24735, 20083 => 35823, + 20084 => 26132, 20085 => 29081, 20086 => 26512, 20087 => 35199, 20088 => 30802, + 20089 => 30717, 20090 => 26224, 20091 => 22075, 20092 => 21560, 20093 => 38177, + 20094 => 29306, 20257 => 31232, 20258 => 24687, 20259 => 24076, 20260 => 24713, + 20261 => 33181, 20262 => 22805, 20263 => 24796, 20264 => 29060, 20265 => 28911, + 20266 => 28330, 20267 => 27728, 20268 => 29312, 20269 => 27268, 20270 => 34989, + 20271 => 24109, 20272 => 20064, 20273 => 23219, 20274 => 21916, 20275 => 38115, + 20276 => 27927, 20277 => 31995, 20278 => 38553, 20279 => 25103, 20280 => 32454, + 20281 => 30606, 20282 => 34430, 20283 => 21283, 20284 => 38686, 20285 => 36758, + 20286 => 26247, 20287 => 23777, 20288 => 20384, 20289 => 29421, 20290 => 19979, + 20291 => 21414, 20292 => 22799, 20293 => 21523, 20294 => 25472, 20295 => 38184, + 20296 => 20808, 20297 => 20185, 20298 => 40092, 20299 => 32420, 20300 => 21688, + 20301 => 36132, 20302 => 34900, 20303 => 33335, 20304 => 38386, 20305 => 28046, + 20306 => 24358, 20307 => 23244, 20308 => 26174, 20309 => 38505, 20310 => 29616, + 20311 => 29486, 20312 => 21439, 20313 => 33146, 20314 => 39301, 20315 => 32673, + 20316 => 23466, 20317 => 38519, 20318 => 38480, 20319 => 32447, 20320 => 30456, + 20321 => 21410, 20322 => 38262, 20323 => 39321, 20324 => 31665, 20325 => 35140, + 20326 => 28248, 20327 => 20065, 20328 => 32724, 20329 => 31077, 20330 => 35814, + 20331 => 24819, 20332 => 21709, 20333 => 20139, 20334 => 39033, 20335 => 24055, + 20336 => 27233, 20337 => 20687, 20338 => 21521, 20339 => 35937, 20340 => 33831, + 20341 => 30813, 20342 => 38660, 20343 => 21066, 20344 => 21742, 20345 => 22179, + 20346 => 38144, 20347 => 28040, 20348 => 23477, 20349 => 28102, 20350 => 26195, + 20513 => 23567, 20514 => 23389, 20515 => 26657, 20516 => 32918, 20517 => 21880, + 20518 => 31505, 20519 => 25928, 20520 => 26964, 20521 => 20123, 20522 => 27463, + 20523 => 34638, 20524 => 38795, 20525 => 21327, 20526 => 25375, 20527 => 25658, + 20528 => 37034, 20529 => 26012, 20530 => 32961, 20531 => 35856, 20532 => 20889, + 20533 => 26800, 20534 => 21368, 20535 => 34809, 20536 => 25032, 20537 => 27844, + 20538 => 27899, 20539 => 35874, 20540 => 23633, 20541 => 34218, 20542 => 33455, + 20543 => 38156, 20544 => 27427, 20545 => 36763, 20546 => 26032, 20547 => 24571, + 20548 => 24515, 20549 => 20449, 20550 => 34885, 20551 => 26143, 20552 => 33125, + 20553 => 29481, 20554 => 24826, 20555 => 20852, 20556 => 21009, 20557 => 22411, + 20558 => 24418, 20559 => 37026, 20560 => 34892, 20561 => 37266, 20562 => 24184, + 20563 => 26447, 20564 => 24615, 20565 => 22995, 20566 => 20804, 20567 => 20982, + 20568 => 33016, 20569 => 21256, 20570 => 27769, 20571 => 38596, 20572 => 29066, + 20573 => 20241, 20574 => 20462, 20575 => 32670, 20576 => 26429, 20577 => 21957, + 20578 => 38152, 20579 => 31168, 20580 => 34966, 20581 => 32483, 20582 => 22687, + 20583 => 25100, 20584 => 38656, 20585 => 34394, 20586 => 22040, 20587 => 39035, + 20588 => 24464, 20589 => 35768, 20590 => 33988, 20591 => 37207, 20592 => 21465, + 20593 => 26093, 20594 => 24207, 20595 => 30044, 20596 => 24676, 20597 => 32110, + 20598 => 23167, 20599 => 32490, 20600 => 32493, 20601 => 36713, 20602 => 21927, + 20603 => 23459, 20604 => 24748, 20605 => 26059, 20606 => 29572, 20769 => 36873, + 20770 => 30307, 20771 => 30505, 20772 => 32474, 20773 => 38772, 20774 => 34203, + 20775 => 23398, 20776 => 31348, 20777 => 38634, 20778 => 34880, 20779 => 21195, + 20780 => 29071, 20781 => 24490, 20782 => 26092, 20783 => 35810, 20784 => 23547, + 20785 => 39535, 20786 => 24033, 20787 => 27529, 20788 => 27739, 20789 => 35757, + 20790 => 35759, 20791 => 36874, 20792 => 36805, 20793 => 21387, 20794 => 25276, + 20795 => 40486, 20796 => 40493, 20797 => 21568, 20798 => 20011, 20799 => 33469, + 20800 => 29273, 20801 => 34460, 20802 => 23830, 20803 => 34905, 20804 => 28079, + 20805 => 38597, 20806 => 21713, 20807 => 20122, 20808 => 35766, 20809 => 28937, + 20810 => 21693, 20811 => 38409, 20812 => 28895, 20813 => 28153, 20814 => 30416, + 20815 => 20005, 20816 => 30740, 20817 => 34578, 20818 => 23721, 20819 => 24310, + 20820 => 35328, 20821 => 39068, 20822 => 38414, 20823 => 28814, 20824 => 27839, + 20825 => 22852, 20826 => 25513, 20827 => 30524, 20828 => 34893, 20829 => 28436, + 20830 => 33395, 20831 => 22576, 20832 => 29141, 20833 => 21388, 20834 => 30746, + 20835 => 38593, 20836 => 21761, 20837 => 24422, 20838 => 28976, 20839 => 23476, + 20840 => 35866, 20841 => 39564, 20842 => 27523, 20843 => 22830, 20844 => 40495, + 20845 => 31207, 20846 => 26472, 20847 => 25196, 20848 => 20335, 20849 => 30113, + 20850 => 32650, 20851 => 27915, 20852 => 38451, 20853 => 27687, 20854 => 20208, + 20855 => 30162, 20856 => 20859, 20857 => 26679, 20858 => 28478, 20859 => 36992, + 20860 => 33136, 20861 => 22934, 20862 => 29814, 21025 => 25671, 21026 => 23591, + 21027 => 36965, 21028 => 31377, 21029 => 35875, 21030 => 23002, 21031 => 21676, + 21032 => 33280, 21033 => 33647, 21034 => 35201, 21035 => 32768, 21036 => 26928, + 21037 => 22094, 21038 => 32822, 21039 => 29239, 21040 => 37326, 21041 => 20918, + 21042 => 20063, 21043 => 39029, 21044 => 25494, 21045 => 19994, 21046 => 21494, + 21047 => 26355, 21048 => 33099, 21049 => 22812, 21050 => 28082, 21051 => 19968, + 21052 => 22777, 21053 => 21307, 21054 => 25558, 21055 => 38129, 21056 => 20381, + 21057 => 20234, 21058 => 34915, 21059 => 39056, 21060 => 22839, 21061 => 36951, + 21062 => 31227, 21063 => 20202, 21064 => 33008, 21065 => 30097, 21066 => 27778, + 21067 => 23452, 21068 => 23016, 21069 => 24413, 21070 => 26885, 21071 => 34433, + 21072 => 20506, 21073 => 24050, 21074 => 20057, 21075 => 30691, 21076 => 20197, + 21077 => 33402, 21078 => 25233, 21079 => 26131, 21080 => 37009, 21081 => 23673, + 21082 => 20159, 21083 => 24441, 21084 => 33222, 21085 => 36920, 21086 => 32900, + 21087 => 30123, 21088 => 20134, 21089 => 35028, 21090 => 24847, 21091 => 27589, + 21092 => 24518, 21093 => 20041, 21094 => 30410, 21095 => 28322, 21096 => 35811, + 21097 => 35758, 21098 => 35850, 21099 => 35793, 21100 => 24322, 21101 => 32764, + 21102 => 32716, 21103 => 32462, 21104 => 33589, 21105 => 33643, 21106 => 22240, + 21107 => 27575, 21108 => 38899, 21109 => 38452, 21110 => 23035, 21111 => 21535, + 21112 => 38134, 21113 => 28139, 21114 => 23493, 21115 => 39278, 21116 => 23609, + 21117 => 24341, 21118 => 38544, 21281 => 21360, 21282 => 33521, 21283 => 27185, + 21284 => 23156, 21285 => 40560, 21286 => 24212, 21287 => 32552, 21288 => 33721, + 21289 => 33828, 21290 => 33829, 21291 => 33639, 21292 => 34631, 21293 => 36814, + 21294 => 36194, 21295 => 30408, 21296 => 24433, 21297 => 39062, 21298 => 30828, + 21299 => 26144, 21300 => 21727, 21301 => 25317, 21302 => 20323, 21303 => 33219, + 21304 => 30152, 21305 => 24248, 21306 => 38605, 21307 => 36362, 21308 => 34553, + 21309 => 21647, 21310 => 27891, 21311 => 28044, 21312 => 27704, 21313 => 24703, + 21314 => 21191, 21315 => 29992, 21316 => 24189, 21317 => 20248, 21318 => 24736, + 21319 => 24551, 21320 => 23588, 21321 => 30001, 21322 => 37038, 21323 => 38080, + 21324 => 29369, 21325 => 27833, 21326 => 28216, 21327 => 37193, 21328 => 26377, + 21329 => 21451, 21330 => 21491, 21331 => 20305, 21332 => 37321, 21333 => 35825, + 21334 => 21448, 21335 => 24188, 21336 => 36802, 21337 => 28132, 21338 => 20110, + 21339 => 30402, 21340 => 27014, 21341 => 34398, 21342 => 24858, 21343 => 33286, + 21344 => 20313, 21345 => 20446, 21346 => 36926, 21347 => 40060, 21348 => 24841, + 21349 => 28189, 21350 => 28180, 21351 => 38533, 21352 => 20104, 21353 => 23089, + 21354 => 38632, 21355 => 19982, 21356 => 23679, 21357 => 31161, 21358 => 23431, + 21359 => 35821, 21360 => 32701, 21361 => 29577, 21362 => 22495, 21363 => 33419, + 21364 => 37057, 21365 => 21505, 21366 => 36935, 21367 => 21947, 21368 => 23786, + 21369 => 24481, 21370 => 24840, 21371 => 27442, 21372 => 29425, 21373 => 32946, + 21374 => 35465, 21537 => 28020, 21538 => 23507, 21539 => 35029, 21540 => 39044, + 21541 => 35947, 21542 => 39533, 21543 => 40499, 21544 => 28170, 21545 => 20900, + 21546 => 20803, 21547 => 22435, 21548 => 34945, 21549 => 21407, 21550 => 25588, + 21551 => 36757, 21552 => 22253, 21553 => 21592, 21554 => 22278, 21555 => 29503, + 21556 => 28304, 21557 => 32536, 21558 => 36828, 21559 => 33489, 21560 => 24895, + 21561 => 24616, 21562 => 38498, 21563 => 26352, 21564 => 32422, 21565 => 36234, + 21566 => 36291, 21567 => 38053, 21568 => 23731, 21569 => 31908, 21570 => 26376, + 21571 => 24742, 21572 => 38405, 21573 => 32792, 21574 => 20113, 21575 => 37095, + 21576 => 21248, 21577 => 38504, 21578 => 20801, 21579 => 36816, 21580 => 34164, + 21581 => 37213, 21582 => 26197, 21583 => 38901, 21584 => 23381, 21585 => 21277, + 21586 => 30776, 21587 => 26434, 21588 => 26685, 21589 => 21705, 21590 => 28798, + 21591 => 23472, 21592 => 36733, 21593 => 20877, 21594 => 22312, 21595 => 21681, + 21596 => 25874, 21597 => 26242, 21598 => 36190, 21599 => 36163, 21600 => 33039, + 21601 => 33900, 21602 => 36973, 21603 => 31967, 21604 => 20991, 21605 => 34299, + 21606 => 26531, 21607 => 26089, 21608 => 28577, 21609 => 34468, 21610 => 36481, + 21611 => 22122, 21612 => 36896, 21613 => 30338, 21614 => 28790, 21615 => 29157, + 21616 => 36131, 21617 => 25321, 21618 => 21017, 21619 => 27901, 21620 => 36156, + 21621 => 24590, 21622 => 22686, 21623 => 24974, 21624 => 26366, 21625 => 36192, + 21626 => 25166, 21627 => 21939, 21628 => 28195, 21629 => 26413, 21630 => 36711, + 21793 => 38113, 21794 => 38392, 21795 => 30504, 21796 => 26629, 21797 => 27048, + 21798 => 21643, 21799 => 20045, 21800 => 28856, 21801 => 35784, 21802 => 25688, + 21803 => 25995, 21804 => 23429, 21805 => 31364, 21806 => 20538, 21807 => 23528, + 21808 => 30651, 21809 => 27617, 21810 => 35449, 21811 => 31896, 21812 => 27838, + 21813 => 30415, 21814 => 26025, 21815 => 36759, 21816 => 23853, 21817 => 23637, + 21818 => 34360, 21819 => 26632, 21820 => 21344, 21821 => 25112, 21822 => 31449, + 21823 => 28251, 21824 => 32509, 21825 => 27167, 21826 => 31456, 21827 => 24432, + 21828 => 28467, 21829 => 24352, 21830 => 25484, 21831 => 28072, 21832 => 26454, + 21833 => 19976, 21834 => 24080, 21835 => 36134, 21836 => 20183, 21837 => 32960, + 21838 => 30260, 21839 => 38556, 21840 => 25307, 21841 => 26157, 21842 => 25214, + 21843 => 27836, 21844 => 36213, 21845 => 29031, 21846 => 32617, 21847 => 20806, + 21848 => 32903, 21849 => 21484, 21850 => 36974, 21851 => 25240, 21852 => 21746, + 21853 => 34544, 21854 => 36761, 21855 => 32773, 21856 => 38167, 21857 => 34071, + 21858 => 36825, 21859 => 27993, 21860 => 29645, 21861 => 26015, 21862 => 30495, + 21863 => 29956, 21864 => 30759, 21865 => 33275, 21866 => 36126, 21867 => 38024, + 21868 => 20390, 21869 => 26517, 21870 => 30137, 21871 => 35786, 21872 => 38663, + 21873 => 25391, 21874 => 38215, 21875 => 38453, 21876 => 33976, 21877 => 25379, + 21878 => 30529, 21879 => 24449, 21880 => 29424, 21881 => 20105, 21882 => 24596, + 21883 => 25972, 21884 => 25327, 21885 => 27491, 21886 => 25919, 22049 => 24103, + 22050 => 30151, 22051 => 37073, 22052 => 35777, 22053 => 33437, 22054 => 26525, + 22055 => 25903, 22056 => 21553, 22057 => 34584, 22058 => 30693, 22059 => 32930, + 22060 => 33026, 22061 => 27713, 22062 => 20043, 22063 => 32455, 22064 => 32844, + 22065 => 30452, 22066 => 26893, 22067 => 27542, 22068 => 25191, 22069 => 20540, + 22070 => 20356, 22071 => 22336, 22072 => 25351, 22073 => 27490, 22074 => 36286, + 22075 => 21482, 22076 => 26088, 22077 => 32440, 22078 => 24535, 22079 => 25370, + 22080 => 25527, 22081 => 33267, 22082 => 33268, 22083 => 32622, 22084 => 24092, + 22085 => 23769, 22086 => 21046, 22087 => 26234, 22088 => 31209, 22089 => 31258, + 22090 => 36136, 22091 => 28825, 22092 => 30164, 22093 => 28382, 22094 => 27835, + 22095 => 31378, 22096 => 20013, 22097 => 30405, 22098 => 24544, 22099 => 38047, + 22100 => 34935, 22101 => 32456, 22102 => 31181, 22103 => 32959, 22104 => 37325, + 22105 => 20210, 22106 => 20247, 22107 => 33311, 22108 => 21608, 22109 => 24030, + 22110 => 27954, 22111 => 35788, 22112 => 31909, 22113 => 36724, 22114 => 32920, + 22115 => 24090, 22116 => 21650, 22117 => 30385, 22118 => 23449, 22119 => 26172, + 22120 => 39588, 22121 => 29664, 22122 => 26666, 22123 => 34523, 22124 => 26417, + 22125 => 29482, 22126 => 35832, 22127 => 35803, 22128 => 36880, 22129 => 31481, + 22130 => 28891, 22131 => 29038, 22132 => 25284, 22133 => 30633, 22134 => 22065, + 22135 => 20027, 22136 => 33879, 22137 => 26609, 22138 => 21161, 22139 => 34496, + 22140 => 36142, 22141 => 38136, 22142 => 31569, 22305 => 20303, 22306 => 27880, + 22307 => 31069, 22308 => 39547, 22309 => 25235, 22310 => 29226, 22311 => 25341, + 22312 => 19987, 22313 => 30742, 22314 => 36716, 22315 => 25776, 22316 => 36186, + 22317 => 31686, 22318 => 26729, 22319 => 24196, 22320 => 35013, 22321 => 22918, + 22322 => 25758, 22323 => 22766, 22324 => 29366, 22325 => 26894, 22326 => 38181, + 22327 => 36861, 22328 => 36184, 22329 => 22368, 22330 => 32512, 22331 => 35846, + 22332 => 20934, 22333 => 25417, 22334 => 25305, 22335 => 21331, 22336 => 26700, + 22337 => 29730, 22338 => 33537, 22339 => 37196, 22340 => 21828, 22341 => 30528, + 22342 => 28796, 22343 => 27978, 22344 => 20857, 22345 => 21672, 22346 => 36164, + 22347 => 23039, 22348 => 28363, 22349 => 28100, 22350 => 23388, 22351 => 32043, + 22352 => 20180, 22353 => 31869, 22354 => 28371, 22355 => 23376, 22356 => 33258, + 22357 => 28173, 22358 => 23383, 22359 => 39683, 22360 => 26837, 22361 => 36394, + 22362 => 23447, 22363 => 32508, 22364 => 24635, 22365 => 32437, 22366 => 37049, + 22367 => 36208, 22368 => 22863, 22369 => 25549, 22370 => 31199, 22371 => 36275, + 22372 => 21330, 22373 => 26063, 22374 => 31062, 22375 => 35781, 22376 => 38459, + 22377 => 32452, 22378 => 38075, 22379 => 32386, 22380 => 22068, 22381 => 37257, + 22382 => 26368, 22383 => 32618, 22384 => 23562, 22385 => 36981, 22386 => 26152, + 22387 => 24038, 22388 => 20304, 22389 => 26590, 22390 => 20570, 22391 => 20316, + 22392 => 22352, 22393 => 24231, 22561 => 20109, 22562 => 19980, 22563 => 20800, + 22564 => 19984, 22565 => 24319, 22566 => 21317, 22567 => 19989, 22568 => 20120, + 22569 => 19998, 22570 => 39730, 22571 => 23404, 22572 => 22121, 22573 => 20008, + 22574 => 31162, 22575 => 20031, 22576 => 21269, 22577 => 20039, 22578 => 22829, + 22579 => 29243, 22580 => 21358, 22581 => 27664, 22582 => 22239, 22583 => 32996, + 22584 => 39319, 22585 => 27603, 22586 => 30590, 22587 => 40727, 22588 => 20022, + 22589 => 20127, 22590 => 40720, 22591 => 20060, 22592 => 20073, 22593 => 20115, + 22594 => 33416, 22595 => 23387, 22596 => 21868, 22597 => 22031, 22598 => 20164, + 22599 => 21389, 22600 => 21405, 22601 => 21411, 22602 => 21413, 22603 => 21422, + 22604 => 38757, 22605 => 36189, 22606 => 21274, 22607 => 21493, 22608 => 21286, + 22609 => 21294, 22610 => 21310, 22611 => 36188, 22612 => 21350, 22613 => 21347, + 22614 => 20994, 22615 => 21000, 22616 => 21006, 22617 => 21037, 22618 => 21043, + 22619 => 21055, 22620 => 21056, 22621 => 21068, 22622 => 21086, 22623 => 21089, + 22624 => 21084, 22625 => 33967, 22626 => 21117, 22627 => 21122, 22628 => 21121, + 22629 => 21136, 22630 => 21139, 22631 => 20866, 22632 => 32596, 22633 => 20155, + 22634 => 20163, 22635 => 20169, 22636 => 20162, 22637 => 20200, 22638 => 20193, + 22639 => 20203, 22640 => 20190, 22641 => 20251, 22642 => 20211, 22643 => 20258, + 22644 => 20324, 22645 => 20213, 22646 => 20261, 22647 => 20263, 22648 => 20233, + 22649 => 20267, 22650 => 20318, 22651 => 20327, 22652 => 25912, 22653 => 20314, + 22654 => 20317, 22817 => 20319, 22818 => 20311, 22819 => 20274, 22820 => 20285, + 22821 => 20342, 22822 => 20340, 22823 => 20369, 22824 => 20361, 22825 => 20355, + 22826 => 20367, 22827 => 20350, 22828 => 20347, 22829 => 20394, 22830 => 20348, + 22831 => 20396, 22832 => 20372, 22833 => 20454, 22834 => 20456, 22835 => 20458, + 22836 => 20421, 22837 => 20442, 22838 => 20451, 22839 => 20444, 22840 => 20433, + 22841 => 20447, 22842 => 20472, 22843 => 20521, 22844 => 20556, 22845 => 20467, + 22846 => 20524, 22847 => 20495, 22848 => 20526, 22849 => 20525, 22850 => 20478, + 22851 => 20508, 22852 => 20492, 22853 => 20517, 22854 => 20520, 22855 => 20606, + 22856 => 20547, 22857 => 20565, 22858 => 20552, 22859 => 20558, 22860 => 20588, + 22861 => 20603, 22862 => 20645, 22863 => 20647, 22864 => 20649, 22865 => 20666, + 22866 => 20694, 22867 => 20742, 22868 => 20717, 22869 => 20716, 22870 => 20710, + 22871 => 20718, 22872 => 20743, 22873 => 20747, 22874 => 20189, 22875 => 27709, + 22876 => 20312, 22877 => 20325, 22878 => 20430, 22879 => 40864, 22880 => 27718, + 22881 => 31860, 22882 => 20846, 22883 => 24061, 22884 => 40649, 22885 => 39320, + 22886 => 20865, 22887 => 22804, 22888 => 21241, 22889 => 21261, 22890 => 35335, + 22891 => 21264, 22892 => 20971, 22893 => 22809, 22894 => 20821, 22895 => 20128, + 22896 => 20822, 22897 => 20147, 22898 => 34926, 22899 => 34980, 22900 => 20149, + 22901 => 33044, 22902 => 35026, 22903 => 31104, 22904 => 23348, 22905 => 34819, + 22906 => 32696, 22907 => 20907, 22908 => 20913, 22909 => 20925, 22910 => 20924, + 23073 => 20935, 23074 => 20886, 23075 => 20898, 23076 => 20901, 23077 => 35744, + 23078 => 35750, 23079 => 35751, 23080 => 35754, 23081 => 35764, 23082 => 35765, + 23083 => 35767, 23084 => 35778, 23085 => 35779, 23086 => 35787, 23087 => 35791, + 23088 => 35790, 23089 => 35794, 23090 => 35795, 23091 => 35796, 23092 => 35798, + 23093 => 35800, 23094 => 35801, 23095 => 35804, 23096 => 35807, 23097 => 35808, + 23098 => 35812, 23099 => 35816, 23100 => 35817, 23101 => 35822, 23102 => 35824, + 23103 => 35827, 23104 => 35830, 23105 => 35833, 23106 => 35836, 23107 => 35839, + 23108 => 35840, 23109 => 35842, 23110 => 35844, 23111 => 35847, 23112 => 35852, + 23113 => 35855, 23114 => 35857, 23115 => 35858, 23116 => 35860, 23117 => 35861, + 23118 => 35862, 23119 => 35865, 23120 => 35867, 23121 => 35864, 23122 => 35869, + 23123 => 35871, 23124 => 35872, 23125 => 35873, 23126 => 35877, 23127 => 35879, + 23128 => 35882, 23129 => 35883, 23130 => 35886, 23131 => 35887, 23132 => 35890, + 23133 => 35891, 23134 => 35893, 23135 => 35894, 23136 => 21353, 23137 => 21370, + 23138 => 38429, 23139 => 38434, 23140 => 38433, 23141 => 38449, 23142 => 38442, + 23143 => 38461, 23144 => 38460, 23145 => 38466, 23146 => 38473, 23147 => 38484, + 23148 => 38495, 23149 => 38503, 23150 => 38508, 23151 => 38514, 23152 => 38516, + 23153 => 38536, 23154 => 38541, 23155 => 38551, 23156 => 38576, 23157 => 37015, + 23158 => 37019, 23159 => 37021, 23160 => 37017, 23161 => 37036, 23162 => 37025, + 23163 => 37044, 23164 => 37043, 23165 => 37046, 23166 => 37050, 23329 => 37048, + 23330 => 37040, 23331 => 37071, 23332 => 37061, 23333 => 37054, 23334 => 37072, + 23335 => 37060, 23336 => 37063, 23337 => 37075, 23338 => 37094, 23339 => 37090, + 23340 => 37084, 23341 => 37079, 23342 => 37083, 23343 => 37099, 23344 => 37103, + 23345 => 37118, 23346 => 37124, 23347 => 37154, 23348 => 37150, 23349 => 37155, + 23350 => 37169, 23351 => 37167, 23352 => 37177, 23353 => 37187, 23354 => 37190, + 23355 => 21005, 23356 => 22850, 23357 => 21154, 23358 => 21164, 23359 => 21165, + 23360 => 21182, 23361 => 21759, 23362 => 21200, 23363 => 21206, 23364 => 21232, + 23365 => 21471, 23366 => 29166, 23367 => 30669, 23368 => 24308, 23369 => 20981, + 23370 => 20988, 23371 => 39727, 23372 => 21430, 23373 => 24321, 23374 => 30042, + 23375 => 24047, 23376 => 22348, 23377 => 22441, 23378 => 22433, 23379 => 22654, + 23380 => 22716, 23381 => 22725, 23382 => 22737, 23383 => 22313, 23384 => 22316, + 23385 => 22314, 23386 => 22323, 23387 => 22329, 23388 => 22318, 23389 => 22319, + 23390 => 22364, 23391 => 22331, 23392 => 22338, 23393 => 22377, 23394 => 22405, + 23395 => 22379, 23396 => 22406, 23397 => 22396, 23398 => 22395, 23399 => 22376, + 23400 => 22381, 23401 => 22390, 23402 => 22387, 23403 => 22445, 23404 => 22436, + 23405 => 22412, 23406 => 22450, 23407 => 22479, 23408 => 22439, 23409 => 22452, + 23410 => 22419, 23411 => 22432, 23412 => 22485, 23413 => 22488, 23414 => 22490, + 23415 => 22489, 23416 => 22482, 23417 => 22456, 23418 => 22516, 23419 => 22511, + 23420 => 22520, 23421 => 22500, 23422 => 22493, 23585 => 22539, 23586 => 22541, + 23587 => 22525, 23588 => 22509, 23589 => 22528, 23590 => 22558, 23591 => 22553, + 23592 => 22596, 23593 => 22560, 23594 => 22629, 23595 => 22636, 23596 => 22657, + 23597 => 22665, 23598 => 22682, 23599 => 22656, 23600 => 39336, 23601 => 40729, + 23602 => 25087, 23603 => 33401, 23604 => 33405, 23605 => 33407, 23606 => 33423, + 23607 => 33418, 23608 => 33448, 23609 => 33412, 23610 => 33422, 23611 => 33425, + 23612 => 33431, 23613 => 33433, 23614 => 33451, 23615 => 33464, 23616 => 33470, + 23617 => 33456, 23618 => 33480, 23619 => 33482, 23620 => 33507, 23621 => 33432, + 23622 => 33463, 23623 => 33454, 23624 => 33483, 23625 => 33484, 23626 => 33473, + 23627 => 33449, 23628 => 33460, 23629 => 33441, 23630 => 33450, 23631 => 33439, + 23632 => 33476, 23633 => 33486, 23634 => 33444, 23635 => 33505, 23636 => 33545, + 23637 => 33527, 23638 => 33508, 23639 => 33551, 23640 => 33543, 23641 => 33500, + 23642 => 33524, 23643 => 33490, 23644 => 33496, 23645 => 33548, 23646 => 33531, + 23647 => 33491, 23648 => 33553, 23649 => 33562, 23650 => 33542, 23651 => 33556, + 23652 => 33557, 23653 => 33504, 23654 => 33493, 23655 => 33564, 23656 => 33617, + 23657 => 33627, 23658 => 33628, 23659 => 33544, 23660 => 33682, 23661 => 33596, + 23662 => 33588, 23663 => 33585, 23664 => 33691, 23665 => 33630, 23666 => 33583, + 23667 => 33615, 23668 => 33607, 23669 => 33603, 23670 => 33631, 23671 => 33600, + 23672 => 33559, 23673 => 33632, 23674 => 33581, 23675 => 33594, 23676 => 33587, + 23677 => 33638, 23678 => 33637, 23841 => 33640, 23842 => 33563, 23843 => 33641, + 23844 => 33644, 23845 => 33642, 23846 => 33645, 23847 => 33646, 23848 => 33712, + 23849 => 33656, 23850 => 33715, 23851 => 33716, 23852 => 33696, 23853 => 33706, + 23854 => 33683, 23855 => 33692, 23856 => 33669, 23857 => 33660, 23858 => 33718, + 23859 => 33705, 23860 => 33661, 23861 => 33720, 23862 => 33659, 23863 => 33688, + 23864 => 33694, 23865 => 33704, 23866 => 33722, 23867 => 33724, 23868 => 33729, + 23869 => 33793, 23870 => 33765, 23871 => 33752, 23872 => 22535, 23873 => 33816, + 23874 => 33803, 23875 => 33757, 23876 => 33789, 23877 => 33750, 23878 => 33820, + 23879 => 33848, 23880 => 33809, 23881 => 33798, 23882 => 33748, 23883 => 33759, + 23884 => 33807, 23885 => 33795, 23886 => 33784, 23887 => 33785, 23888 => 33770, + 23889 => 33733, 23890 => 33728, 23891 => 33830, 23892 => 33776, 23893 => 33761, + 23894 => 33884, 23895 => 33873, 23896 => 33882, 23897 => 33881, 23898 => 33907, + 23899 => 33927, 23900 => 33928, 23901 => 33914, 23902 => 33929, 23903 => 33912, + 23904 => 33852, 23905 => 33862, 23906 => 33897, 23907 => 33910, 23908 => 33932, + 23909 => 33934, 23910 => 33841, 23911 => 33901, 23912 => 33985, 23913 => 33997, + 23914 => 34000, 23915 => 34022, 23916 => 33981, 23917 => 34003, 23918 => 33994, + 23919 => 33983, 23920 => 33978, 23921 => 34016, 23922 => 33953, 23923 => 33977, + 23924 => 33972, 23925 => 33943, 23926 => 34021, 23927 => 34019, 23928 => 34060, + 23929 => 29965, 23930 => 34104, 23931 => 34032, 23932 => 34105, 23933 => 34079, + 23934 => 34106, 24097 => 34134, 24098 => 34107, 24099 => 34047, 24100 => 34044, + 24101 => 34137, 24102 => 34120, 24103 => 34152, 24104 => 34148, 24105 => 34142, + 24106 => 34170, 24107 => 30626, 24108 => 34115, 24109 => 34162, 24110 => 34171, + 24111 => 34212, 24112 => 34216, 24113 => 34183, 24114 => 34191, 24115 => 34169, + 24116 => 34222, 24117 => 34204, 24118 => 34181, 24119 => 34233, 24120 => 34231, + 24121 => 34224, 24122 => 34259, 24123 => 34241, 24124 => 34268, 24125 => 34303, + 24126 => 34343, 24127 => 34309, 24128 => 34345, 24129 => 34326, 24130 => 34364, + 24131 => 24318, 24132 => 24328, 24133 => 22844, 24134 => 22849, 24135 => 32823, + 24136 => 22869, 24137 => 22874, 24138 => 22872, 24139 => 21263, 24140 => 23586, + 24141 => 23589, 24142 => 23596, 24143 => 23604, 24144 => 25164, 24145 => 25194, + 24146 => 25247, 24147 => 25275, 24148 => 25290, 24149 => 25306, 24150 => 25303, + 24151 => 25326, 24152 => 25378, 24153 => 25334, 24154 => 25401, 24155 => 25419, + 24156 => 25411, 24157 => 25517, 24158 => 25590, 24159 => 25457, 24160 => 25466, + 24161 => 25486, 24162 => 25524, 24163 => 25453, 24164 => 25516, 24165 => 25482, + 24166 => 25449, 24167 => 25518, 24168 => 25532, 24169 => 25586, 24170 => 25592, + 24171 => 25568, 24172 => 25599, 24173 => 25540, 24174 => 25566, 24175 => 25550, + 24176 => 25682, 24177 => 25542, 24178 => 25534, 24179 => 25669, 24180 => 25665, + 24181 => 25611, 24182 => 25627, 24183 => 25632, 24184 => 25612, 24185 => 25638, + 24186 => 25633, 24187 => 25694, 24188 => 25732, 24189 => 25709, 24190 => 25750, + 24353 => 25722, 24354 => 25783, 24355 => 25784, 24356 => 25753, 24357 => 25786, + 24358 => 25792, 24359 => 25808, 24360 => 25815, 24361 => 25828, 24362 => 25826, + 24363 => 25865, 24364 => 25893, 24365 => 25902, 24366 => 24331, 24367 => 24530, + 24368 => 29977, 24369 => 24337, 24370 => 21343, 24371 => 21489, 24372 => 21501, + 24373 => 21481, 24374 => 21480, 24375 => 21499, 24376 => 21522, 24377 => 21526, + 24378 => 21510, 24379 => 21579, 24380 => 21586, 24381 => 21587, 24382 => 21588, + 24383 => 21590, 24384 => 21571, 24385 => 21537, 24386 => 21591, 24387 => 21593, + 24388 => 21539, 24389 => 21554, 24390 => 21634, 24391 => 21652, 24392 => 21623, + 24393 => 21617, 24394 => 21604, 24395 => 21658, 24396 => 21659, 24397 => 21636, + 24398 => 21622, 24399 => 21606, 24400 => 21661, 24401 => 21712, 24402 => 21677, + 24403 => 21698, 24404 => 21684, 24405 => 21714, 24406 => 21671, 24407 => 21670, + 24408 => 21715, 24409 => 21716, 24410 => 21618, 24411 => 21667, 24412 => 21717, + 24413 => 21691, 24414 => 21695, 24415 => 21708, 24416 => 21721, 24417 => 21722, + 24418 => 21724, 24419 => 21673, 24420 => 21674, 24421 => 21668, 24422 => 21725, + 24423 => 21711, 24424 => 21726, 24425 => 21787, 24426 => 21735, 24427 => 21792, + 24428 => 21757, 24429 => 21780, 24430 => 21747, 24431 => 21794, 24432 => 21795, + 24433 => 21775, 24434 => 21777, 24435 => 21799, 24436 => 21802, 24437 => 21863, + 24438 => 21903, 24439 => 21941, 24440 => 21833, 24441 => 21869, 24442 => 21825, + 24443 => 21845, 24444 => 21823, 24445 => 21840, 24446 => 21820, 24609 => 21815, + 24610 => 21846, 24611 => 21877, 24612 => 21878, 24613 => 21879, 24614 => 21811, + 24615 => 21808, 24616 => 21852, 24617 => 21899, 24618 => 21970, 24619 => 21891, + 24620 => 21937, 24621 => 21945, 24622 => 21896, 24623 => 21889, 24624 => 21919, + 24625 => 21886, 24626 => 21974, 24627 => 21905, 24628 => 21883, 24629 => 21983, + 24630 => 21949, 24631 => 21950, 24632 => 21908, 24633 => 21913, 24634 => 21994, + 24635 => 22007, 24636 => 21961, 24637 => 22047, 24638 => 21969, 24639 => 21995, + 24640 => 21996, 24641 => 21972, 24642 => 21990, 24643 => 21981, 24644 => 21956, + 24645 => 21999, 24646 => 21989, 24647 => 22002, 24648 => 22003, 24649 => 21964, + 24650 => 21965, 24651 => 21992, 24652 => 22005, 24653 => 21988, 24654 => 36756, + 24655 => 22046, 24656 => 22024, 24657 => 22028, 24658 => 22017, 24659 => 22052, + 24660 => 22051, 24661 => 22014, 24662 => 22016, 24663 => 22055, 24664 => 22061, + 24665 => 22104, 24666 => 22073, 24667 => 22103, 24668 => 22060, 24669 => 22093, + 24670 => 22114, 24671 => 22105, 24672 => 22108, 24673 => 22092, 24674 => 22100, + 24675 => 22150, 24676 => 22116, 24677 => 22129, 24678 => 22123, 24679 => 22139, + 24680 => 22140, 24681 => 22149, 24682 => 22163, 24683 => 22191, 24684 => 22228, + 24685 => 22231, 24686 => 22237, 24687 => 22241, 24688 => 22261, 24689 => 22251, + 24690 => 22265, 24691 => 22271, 24692 => 22276, 24693 => 22282, 24694 => 22281, + 24695 => 22300, 24696 => 24079, 24697 => 24089, 24698 => 24084, 24699 => 24081, + 24700 => 24113, 24701 => 24123, 24702 => 24124, 24865 => 24119, 24866 => 24132, + 24867 => 24148, 24868 => 24155, 24869 => 24158, 24870 => 24161, 24871 => 23692, + 24872 => 23674, 24873 => 23693, 24874 => 23696, 24875 => 23702, 24876 => 23688, + 24877 => 23704, 24878 => 23705, 24879 => 23697, 24880 => 23706, 24881 => 23708, + 24882 => 23733, 24883 => 23714, 24884 => 23741, 24885 => 23724, 24886 => 23723, + 24887 => 23729, 24888 => 23715, 24889 => 23745, 24890 => 23735, 24891 => 23748, + 24892 => 23762, 24893 => 23780, 24894 => 23755, 24895 => 23781, 24896 => 23810, + 24897 => 23811, 24898 => 23847, 24899 => 23846, 24900 => 23854, 24901 => 23844, + 24902 => 23838, 24903 => 23814, 24904 => 23835, 24905 => 23896, 24906 => 23870, + 24907 => 23860, 24908 => 23869, 24909 => 23916, 24910 => 23899, 24911 => 23919, + 24912 => 23901, 24913 => 23915, 24914 => 23883, 24915 => 23882, 24916 => 23913, + 24917 => 23924, 24918 => 23938, 24919 => 23961, 24920 => 23965, 24921 => 35955, + 24922 => 23991, 24923 => 24005, 24924 => 24435, 24925 => 24439, 24926 => 24450, + 24927 => 24455, 24928 => 24457, 24929 => 24460, 24930 => 24469, 24931 => 24473, + 24932 => 24476, 24933 => 24488, 24934 => 24493, 24935 => 24501, 24936 => 24508, + 24937 => 34914, 24938 => 24417, 24939 => 29357, 24940 => 29360, 24941 => 29364, + 24942 => 29367, 24943 => 29368, 24944 => 29379, 24945 => 29377, 24946 => 29390, + 24947 => 29389, 24948 => 29394, 24949 => 29416, 24950 => 29423, 24951 => 29417, + 24952 => 29426, 24953 => 29428, 24954 => 29431, 24955 => 29441, 24956 => 29427, + 24957 => 29443, 24958 => 29434, 25121 => 29435, 25122 => 29463, 25123 => 29459, + 25124 => 29473, 25125 => 29450, 25126 => 29470, 25127 => 29469, 25128 => 29461, + 25129 => 29474, 25130 => 29497, 25131 => 29477, 25132 => 29484, 25133 => 29496, + 25134 => 29489, 25135 => 29520, 25136 => 29517, 25137 => 29527, 25138 => 29536, + 25139 => 29548, 25140 => 29551, 25141 => 29566, 25142 => 33307, 25143 => 22821, + 25144 => 39143, 25145 => 22820, 25146 => 22786, 25147 => 39267, 25148 => 39271, + 25149 => 39272, 25150 => 39273, 25151 => 39274, 25152 => 39275, 25153 => 39276, + 25154 => 39284, 25155 => 39287, 25156 => 39293, 25157 => 39296, 25158 => 39300, + 25159 => 39303, 25160 => 39306, 25161 => 39309, 25162 => 39312, 25163 => 39313, + 25164 => 39315, 25165 => 39316, 25166 => 39317, 25167 => 24192, 25168 => 24209, + 25169 => 24203, 25170 => 24214, 25171 => 24229, 25172 => 24224, 25173 => 24249, + 25174 => 24245, 25175 => 24254, 25176 => 24243, 25177 => 36179, 25178 => 24274, + 25179 => 24273, 25180 => 24283, 25181 => 24296, 25182 => 24298, 25183 => 33210, + 25184 => 24516, 25185 => 24521, 25186 => 24534, 25187 => 24527, 25188 => 24579, + 25189 => 24558, 25190 => 24580, 25191 => 24545, 25192 => 24548, 25193 => 24574, + 25194 => 24581, 25195 => 24582, 25196 => 24554, 25197 => 24557, 25198 => 24568, + 25199 => 24601, 25200 => 24629, 25201 => 24614, 25202 => 24603, 25203 => 24591, + 25204 => 24589, 25205 => 24617, 25206 => 24619, 25207 => 24586, 25208 => 24639, + 25209 => 24609, 25210 => 24696, 25211 => 24697, 25212 => 24699, 25213 => 24698, + 25214 => 24642, 25377 => 24682, 25378 => 24701, 25379 => 24726, 25380 => 24730, + 25381 => 24749, 25382 => 24733, 25383 => 24707, 25384 => 24722, 25385 => 24716, + 25386 => 24731, 25387 => 24812, 25388 => 24763, 25389 => 24753, 25390 => 24797, + 25391 => 24792, 25392 => 24774, 25393 => 24794, 25394 => 24756, 25395 => 24864, + 25396 => 24870, 25397 => 24853, 25398 => 24867, 25399 => 24820, 25400 => 24832, + 25401 => 24846, 25402 => 24875, 25403 => 24906, 25404 => 24949, 25405 => 25004, + 25406 => 24980, 25407 => 24999, 25408 => 25015, 25409 => 25044, 25410 => 25077, + 25411 => 24541, 25412 => 38579, 25413 => 38377, 25414 => 38379, 25415 => 38385, + 25416 => 38387, 25417 => 38389, 25418 => 38390, 25419 => 38396, 25420 => 38398, + 25421 => 38403, 25422 => 38404, 25423 => 38406, 25424 => 38408, 25425 => 38410, + 25426 => 38411, 25427 => 38412, 25428 => 38413, 25429 => 38415, 25430 => 38418, + 25431 => 38421, 25432 => 38422, 25433 => 38423, 25434 => 38425, 25435 => 38426, + 25436 => 20012, 25437 => 29247, 25438 => 25109, 25439 => 27701, 25440 => 27732, + 25441 => 27740, 25442 => 27722, 25443 => 27811, 25444 => 27781, 25445 => 27792, + 25446 => 27796, 25447 => 27788, 25448 => 27752, 25449 => 27753, 25450 => 27764, + 25451 => 27766, 25452 => 27782, 25453 => 27817, 25454 => 27856, 25455 => 27860, + 25456 => 27821, 25457 => 27895, 25458 => 27896, 25459 => 27889, 25460 => 27863, + 25461 => 27826, 25462 => 27872, 25463 => 27862, 25464 => 27898, 25465 => 27883, + 25466 => 27886, 25467 => 27825, 25468 => 27859, 25469 => 27887, 25470 => 27902, + 25633 => 27961, 25634 => 27943, 25635 => 27916, 25636 => 27971, 25637 => 27976, + 25638 => 27911, 25639 => 27908, 25640 => 27929, 25641 => 27918, 25642 => 27947, + 25643 => 27981, 25644 => 27950, 25645 => 27957, 25646 => 27930, 25647 => 27983, + 25648 => 27986, 25649 => 27988, 25650 => 27955, 25651 => 28049, 25652 => 28015, + 25653 => 28062, 25654 => 28064, 25655 => 27998, 25656 => 28051, 25657 => 28052, + 25658 => 27996, 25659 => 28000, 25660 => 28028, 25661 => 28003, 25662 => 28186, + 25663 => 28103, 25664 => 28101, 25665 => 28126, 25666 => 28174, 25667 => 28095, + 25668 => 28128, 25669 => 28177, 25670 => 28134, 25671 => 28125, 25672 => 28121, + 25673 => 28182, 25674 => 28075, 25675 => 28172, 25676 => 28078, 25677 => 28203, + 25678 => 28270, 25679 => 28238, 25680 => 28267, 25681 => 28338, 25682 => 28255, + 25683 => 28294, 25684 => 28243, 25685 => 28244, 25686 => 28210, 25687 => 28197, + 25688 => 28228, 25689 => 28383, 25690 => 28337, 25691 => 28312, 25692 => 28384, + 25693 => 28461, 25694 => 28386, 25695 => 28325, 25696 => 28327, 25697 => 28349, + 25698 => 28347, 25699 => 28343, 25700 => 28375, 25701 => 28340, 25702 => 28367, + 25703 => 28303, 25704 => 28354, 25705 => 28319, 25706 => 28514, 25707 => 28486, + 25708 => 28487, 25709 => 28452, 25710 => 28437, 25711 => 28409, 25712 => 28463, + 25713 => 28470, 25714 => 28491, 25715 => 28532, 25716 => 28458, 25717 => 28425, + 25718 => 28457, 25719 => 28553, 25720 => 28557, 25721 => 28556, 25722 => 28536, + 25723 => 28530, 25724 => 28540, 25725 => 28538, 25726 => 28625, 25889 => 28617, + 25890 => 28583, 25891 => 28601, 25892 => 28598, 25893 => 28610, 25894 => 28641, + 25895 => 28654, 25896 => 28638, 25897 => 28640, 25898 => 28655, 25899 => 28698, + 25900 => 28707, 25901 => 28699, 25902 => 28729, 25903 => 28725, 25904 => 28751, + 25905 => 28766, 25906 => 23424, 25907 => 23428, 25908 => 23445, 25909 => 23443, + 25910 => 23461, 25911 => 23480, 25912 => 29999, 25913 => 39582, 25914 => 25652, + 25915 => 23524, 25916 => 23534, 25917 => 35120, 25918 => 23536, 25919 => 36423, + 25920 => 35591, 25921 => 36790, 25922 => 36819, 25923 => 36821, 25924 => 36837, + 25925 => 36846, 25926 => 36836, 25927 => 36841, 25928 => 36838, 25929 => 36851, + 25930 => 36840, 25931 => 36869, 25932 => 36868, 25933 => 36875, 25934 => 36902, + 25935 => 36881, 25936 => 36877, 25937 => 36886, 25938 => 36897, 25939 => 36917, + 25940 => 36918, 25941 => 36909, 25942 => 36911, 25943 => 36932, 25944 => 36945, + 25945 => 36946, 25946 => 36944, 25947 => 36968, 25948 => 36952, 25949 => 36962, + 25950 => 36955, 25951 => 26297, 25952 => 36980, 25953 => 36989, 25954 => 36994, + 25955 => 37000, 25956 => 36995, 25957 => 37003, 25958 => 24400, 25959 => 24407, + 25960 => 24406, 25961 => 24408, 25962 => 23611, 25963 => 21675, 25964 => 23632, + 25965 => 23641, 25966 => 23409, 25967 => 23651, 25968 => 23654, 25969 => 32700, + 25970 => 24362, 25971 => 24361, 25972 => 24365, 25973 => 33396, 25974 => 24380, + 25975 => 39739, 25976 => 23662, 25977 => 22913, 25978 => 22915, 25979 => 22925, + 25980 => 22953, 25981 => 22954, 25982 => 22947, 26145 => 22935, 26146 => 22986, + 26147 => 22955, 26148 => 22942, 26149 => 22948, 26150 => 22994, 26151 => 22962, + 26152 => 22959, 26153 => 22999, 26154 => 22974, 26155 => 23045, 26156 => 23046, + 26157 => 23005, 26158 => 23048, 26159 => 23011, 26160 => 23000, 26161 => 23033, + 26162 => 23052, 26163 => 23049, 26164 => 23090, 26165 => 23092, 26166 => 23057, + 26167 => 23075, 26168 => 23059, 26169 => 23104, 26170 => 23143, 26171 => 23114, + 26172 => 23125, 26173 => 23100, 26174 => 23138, 26175 => 23157, 26176 => 33004, + 26177 => 23210, 26178 => 23195, 26179 => 23159, 26180 => 23162, 26181 => 23230, + 26182 => 23275, 26183 => 23218, 26184 => 23250, 26185 => 23252, 26186 => 23224, + 26187 => 23264, 26188 => 23267, 26189 => 23281, 26190 => 23254, 26191 => 23270, + 26192 => 23256, 26193 => 23260, 26194 => 23305, 26195 => 23319, 26196 => 23318, + 26197 => 23346, 26198 => 23351, 26199 => 23360, 26200 => 23573, 26201 => 23580, + 26202 => 23386, 26203 => 23397, 26204 => 23411, 26205 => 23377, 26206 => 23379, + 26207 => 23394, 26208 => 39541, 26209 => 39543, 26210 => 39544, 26211 => 39546, + 26212 => 39551, 26213 => 39549, 26214 => 39552, 26215 => 39553, 26216 => 39557, + 26217 => 39560, 26218 => 39562, 26219 => 39568, 26220 => 39570, 26221 => 39571, + 26222 => 39574, 26223 => 39576, 26224 => 39579, 26225 => 39580, 26226 => 39581, + 26227 => 39583, 26228 => 39584, 26229 => 39586, 26230 => 39587, 26231 => 39589, + 26232 => 39591, 26233 => 32415, 26234 => 32417, 26235 => 32419, 26236 => 32421, + 26237 => 32424, 26238 => 32425, 26401 => 32429, 26402 => 32432, 26403 => 32446, + 26404 => 32448, 26405 => 32449, 26406 => 32450, 26407 => 32457, 26408 => 32459, + 26409 => 32460, 26410 => 32464, 26411 => 32468, 26412 => 32471, 26413 => 32475, + 26414 => 32480, 26415 => 32481, 26416 => 32488, 26417 => 32491, 26418 => 32494, + 26419 => 32495, 26420 => 32497, 26421 => 32498, 26422 => 32525, 26423 => 32502, + 26424 => 32506, 26425 => 32507, 26426 => 32510, 26427 => 32513, 26428 => 32514, + 26429 => 32515, 26430 => 32519, 26431 => 32520, 26432 => 32523, 26433 => 32524, + 26434 => 32527, 26435 => 32529, 26436 => 32530, 26437 => 32535, 26438 => 32537, + 26439 => 32540, 26440 => 32539, 26441 => 32543, 26442 => 32545, 26443 => 32546, + 26444 => 32547, 26445 => 32548, 26446 => 32549, 26447 => 32550, 26448 => 32551, + 26449 => 32554, 26450 => 32555, 26451 => 32556, 26452 => 32557, 26453 => 32559, + 26454 => 32560, 26455 => 32561, 26456 => 32562, 26457 => 32563, 26458 => 32565, + 26459 => 24186, 26460 => 30079, 26461 => 24027, 26462 => 30014, 26463 => 37013, + 26464 => 29582, 26465 => 29585, 26466 => 29614, 26467 => 29602, 26468 => 29599, + 26469 => 29647, 26470 => 29634, 26471 => 29649, 26472 => 29623, 26473 => 29619, + 26474 => 29632, 26475 => 29641, 26476 => 29640, 26477 => 29669, 26478 => 29657, + 26479 => 39036, 26480 => 29706, 26481 => 29673, 26482 => 29671, 26483 => 29662, + 26484 => 29626, 26485 => 29682, 26486 => 29711, 26487 => 29738, 26488 => 29787, + 26489 => 29734, 26490 => 29733, 26491 => 29736, 26492 => 29744, 26493 => 29742, + 26494 => 29740, 26657 => 29723, 26658 => 29722, 26659 => 29761, 26660 => 29788, + 26661 => 29783, 26662 => 29781, 26663 => 29785, 26664 => 29815, 26665 => 29805, + 26666 => 29822, 26667 => 29852, 26668 => 29838, 26669 => 29824, 26670 => 29825, + 26671 => 29831, 26672 => 29835, 26673 => 29854, 26674 => 29864, 26675 => 29865, + 26676 => 29840, 26677 => 29863, 26678 => 29906, 26679 => 29882, 26680 => 38890, + 26681 => 38891, 26682 => 38892, 26683 => 26444, 26684 => 26451, 26685 => 26462, + 26686 => 26440, 26687 => 26473, 26688 => 26533, 26689 => 26503, 26690 => 26474, + 26691 => 26483, 26692 => 26520, 26693 => 26535, 26694 => 26485, 26695 => 26536, + 26696 => 26526, 26697 => 26541, 26698 => 26507, 26699 => 26487, 26700 => 26492, + 26701 => 26608, 26702 => 26633, 26703 => 26584, 26704 => 26634, 26705 => 26601, + 26706 => 26544, 26707 => 26636, 26708 => 26585, 26709 => 26549, 26710 => 26586, + 26711 => 26547, 26712 => 26589, 26713 => 26624, 26714 => 26563, 26715 => 26552, + 26716 => 26594, 26717 => 26638, 26718 => 26561, 26719 => 26621, 26720 => 26674, + 26721 => 26675, 26722 => 26720, 26723 => 26721, 26724 => 26702, 26725 => 26722, + 26726 => 26692, 26727 => 26724, 26728 => 26755, 26729 => 26653, 26730 => 26709, + 26731 => 26726, 26732 => 26689, 26733 => 26727, 26734 => 26688, 26735 => 26686, + 26736 => 26698, 26737 => 26697, 26738 => 26665, 26739 => 26805, 26740 => 26767, + 26741 => 26740, 26742 => 26743, 26743 => 26771, 26744 => 26731, 26745 => 26818, + 26746 => 26990, 26747 => 26876, 26748 => 26911, 26749 => 26912, 26750 => 26873, + 26913 => 26916, 26914 => 26864, 26915 => 26891, 26916 => 26881, 26917 => 26967, + 26918 => 26851, 26919 => 26896, 26920 => 26993, 26921 => 26937, 26922 => 26976, + 26923 => 26946, 26924 => 26973, 26925 => 27012, 26926 => 26987, 26927 => 27008, + 26928 => 27032, 26929 => 27000, 26930 => 26932, 26931 => 27084, 26932 => 27015, + 26933 => 27016, 26934 => 27086, 26935 => 27017, 26936 => 26982, 26937 => 26979, + 26938 => 27001, 26939 => 27035, 26940 => 27047, 26941 => 27067, 26942 => 27051, + 26943 => 27053, 26944 => 27092, 26945 => 27057, 26946 => 27073, 26947 => 27082, + 26948 => 27103, 26949 => 27029, 26950 => 27104, 26951 => 27021, 26952 => 27135, + 26953 => 27183, 26954 => 27117, 26955 => 27159, 26956 => 27160, 26957 => 27237, + 26958 => 27122, 26959 => 27204, 26960 => 27198, 26961 => 27296, 26962 => 27216, + 26963 => 27227, 26964 => 27189, 26965 => 27278, 26966 => 27257, 26967 => 27197, + 26968 => 27176, 26969 => 27224, 26970 => 27260, 26971 => 27281, 26972 => 27280, + 26973 => 27305, 26974 => 27287, 26975 => 27307, 26976 => 29495, 26977 => 29522, + 26978 => 27521, 26979 => 27522, 26980 => 27527, 26981 => 27524, 26982 => 27538, + 26983 => 27539, 26984 => 27533, 26985 => 27546, 26986 => 27547, 26987 => 27553, + 26988 => 27562, 26989 => 36715, 26990 => 36717, 26991 => 36721, 26992 => 36722, + 26993 => 36723, 26994 => 36725, 26995 => 36726, 26996 => 36728, 26997 => 36727, + 26998 => 36729, 26999 => 36730, 27000 => 36732, 27001 => 36734, 27002 => 36737, + 27003 => 36738, 27004 => 36740, 27005 => 36743, 27006 => 36747, 27169 => 36749, + 27170 => 36750, 27171 => 36751, 27172 => 36760, 27173 => 36762, 27174 => 36558, + 27175 => 25099, 27176 => 25111, 27177 => 25115, 27178 => 25119, 27179 => 25122, + 27180 => 25121, 27181 => 25125, 27182 => 25124, 27183 => 25132, 27184 => 33255, + 27185 => 29935, 27186 => 29940, 27187 => 29951, 27188 => 29967, 27189 => 29969, + 27190 => 29971, 27191 => 25908, 27192 => 26094, 27193 => 26095, 27194 => 26096, + 27195 => 26122, 27196 => 26137, 27197 => 26482, 27198 => 26115, 27199 => 26133, + 27200 => 26112, 27201 => 28805, 27202 => 26359, 27203 => 26141, 27204 => 26164, + 27205 => 26161, 27206 => 26166, 27207 => 26165, 27208 => 32774, 27209 => 26207, + 27210 => 26196, 27211 => 26177, 27212 => 26191, 27213 => 26198, 27214 => 26209, + 27215 => 26199, 27216 => 26231, 27217 => 26244, 27218 => 26252, 27219 => 26279, + 27220 => 26269, 27221 => 26302, 27222 => 26331, 27223 => 26332, 27224 => 26342, + 27225 => 26345, 27226 => 36146, 27227 => 36147, 27228 => 36150, 27229 => 36155, + 27230 => 36157, 27231 => 36160, 27232 => 36165, 27233 => 36166, 27234 => 36168, + 27235 => 36169, 27236 => 36167, 27237 => 36173, 27238 => 36181, 27239 => 36185, + 27240 => 35271, 27241 => 35274, 27242 => 35275, 27243 => 35276, 27244 => 35278, + 27245 => 35279, 27246 => 35280, 27247 => 35281, 27248 => 29294, 27249 => 29343, + 27250 => 29277, 27251 => 29286, 27252 => 29295, 27253 => 29310, 27254 => 29311, + 27255 => 29316, 27256 => 29323, 27257 => 29325, 27258 => 29327, 27259 => 29330, + 27260 => 25352, 27261 => 25394, 27262 => 25520, 27425 => 25663, 27426 => 25816, + 27427 => 32772, 27428 => 27626, 27429 => 27635, 27430 => 27645, 27431 => 27637, + 27432 => 27641, 27433 => 27653, 27434 => 27655, 27435 => 27654, 27436 => 27661, + 27437 => 27669, 27438 => 27672, 27439 => 27673, 27440 => 27674, 27441 => 27681, + 27442 => 27689, 27443 => 27684, 27444 => 27690, 27445 => 27698, 27446 => 25909, + 27447 => 25941, 27448 => 25963, 27449 => 29261, 27450 => 29266, 27451 => 29270, + 27452 => 29232, 27453 => 34402, 27454 => 21014, 27455 => 32927, 27456 => 32924, + 27457 => 32915, 27458 => 32956, 27459 => 26378, 27460 => 32957, 27461 => 32945, + 27462 => 32939, 27463 => 32941, 27464 => 32948, 27465 => 32951, 27466 => 32999, + 27467 => 33000, 27468 => 33001, 27469 => 33002, 27470 => 32987, 27471 => 32962, + 27472 => 32964, 27473 => 32985, 27474 => 32973, 27475 => 32983, 27476 => 26384, + 27477 => 32989, 27478 => 33003, 27479 => 33009, 27480 => 33012, 27481 => 33005, + 27482 => 33037, 27483 => 33038, 27484 => 33010, 27485 => 33020, 27486 => 26389, + 27487 => 33042, 27488 => 35930, 27489 => 33078, 27490 => 33054, 27491 => 33068, + 27492 => 33048, 27493 => 33074, 27494 => 33096, 27495 => 33100, 27496 => 33107, + 27497 => 33140, 27498 => 33113, 27499 => 33114, 27500 => 33137, 27501 => 33120, + 27502 => 33129, 27503 => 33148, 27504 => 33149, 27505 => 33133, 27506 => 33127, + 27507 => 22605, 27508 => 23221, 27509 => 33160, 27510 => 33154, 27511 => 33169, + 27512 => 28373, 27513 => 33187, 27514 => 33194, 27515 => 33228, 27516 => 26406, + 27517 => 33226, 27518 => 33211, 27681 => 33217, 27682 => 33190, 27683 => 27428, + 27684 => 27447, 27685 => 27449, 27686 => 27459, 27687 => 27462, 27688 => 27481, + 27689 => 39121, 27690 => 39122, 27691 => 39123, 27692 => 39125, 27693 => 39129, + 27694 => 39130, 27695 => 27571, 27696 => 24384, 27697 => 27586, 27698 => 35315, + 27699 => 26000, 27700 => 40785, 27701 => 26003, 27702 => 26044, 27703 => 26054, + 27704 => 26052, 27705 => 26051, 27706 => 26060, 27707 => 26062, 27708 => 26066, + 27709 => 26070, 27710 => 28800, 27711 => 28828, 27712 => 28822, 27713 => 28829, + 27714 => 28859, 27715 => 28864, 27716 => 28855, 27717 => 28843, 27718 => 28849, + 27719 => 28904, 27720 => 28874, 27721 => 28944, 27722 => 28947, 27723 => 28950, + 27724 => 28975, 27725 => 28977, 27726 => 29043, 27727 => 29020, 27728 => 29032, + 27729 => 28997, 27730 => 29042, 27731 => 29002, 27732 => 29048, 27733 => 29050, + 27734 => 29080, 27735 => 29107, 27736 => 29109, 27737 => 29096, 27738 => 29088, + 27739 => 29152, 27740 => 29140, 27741 => 29159, 27742 => 29177, 27743 => 29213, + 27744 => 29224, 27745 => 28780, 27746 => 28952, 27747 => 29030, 27748 => 29113, + 27749 => 25150, 27750 => 25149, 27751 => 25155, 27752 => 25160, 27753 => 25161, + 27754 => 31035, 27755 => 31040, 27756 => 31046, 27757 => 31049, 27758 => 31067, + 27759 => 31068, 27760 => 31059, 27761 => 31066, 27762 => 31074, 27763 => 31063, + 27764 => 31072, 27765 => 31087, 27766 => 31079, 27767 => 31098, 27768 => 31109, + 27769 => 31114, 27770 => 31130, 27771 => 31143, 27772 => 31155, 27773 => 24529, + 27774 => 24528, 27937 => 24636, 27938 => 24669, 27939 => 24666, 27940 => 24679, + 27941 => 24641, 27942 => 24665, 27943 => 24675, 27944 => 24747, 27945 => 24838, + 27946 => 24845, 27947 => 24925, 27948 => 25001, 27949 => 24989, 27950 => 25035, + 27951 => 25041, 27952 => 25094, 27953 => 32896, 27954 => 32895, 27955 => 27795, + 27956 => 27894, 27957 => 28156, 27958 => 30710, 27959 => 30712, 27960 => 30720, + 27961 => 30729, 27962 => 30743, 27963 => 30744, 27964 => 30737, 27965 => 26027, + 27966 => 30765, 27967 => 30748, 27968 => 30749, 27969 => 30777, 27970 => 30778, + 27971 => 30779, 27972 => 30751, 27973 => 30780, 27974 => 30757, 27975 => 30764, + 27976 => 30755, 27977 => 30761, 27978 => 30798, 27979 => 30829, 27980 => 30806, + 27981 => 30807, 27982 => 30758, 27983 => 30800, 27984 => 30791, 27985 => 30796, + 27986 => 30826, 27987 => 30875, 27988 => 30867, 27989 => 30874, 27990 => 30855, + 27991 => 30876, 27992 => 30881, 27993 => 30883, 27994 => 30898, 27995 => 30905, + 27996 => 30885, 27997 => 30932, 27998 => 30937, 27999 => 30921, 28000 => 30956, + 28001 => 30962, 28002 => 30981, 28003 => 30964, 28004 => 30995, 28005 => 31012, + 28006 => 31006, 28007 => 31028, 28008 => 40859, 28009 => 40697, 28010 => 40699, + 28011 => 40700, 28012 => 30449, 28013 => 30468, 28014 => 30477, 28015 => 30457, + 28016 => 30471, 28017 => 30472, 28018 => 30490, 28019 => 30498, 28020 => 30489, + 28021 => 30509, 28022 => 30502, 28023 => 30517, 28024 => 30520, 28025 => 30544, + 28026 => 30545, 28027 => 30535, 28028 => 30531, 28029 => 30554, 28030 => 30568, + 28193 => 30562, 28194 => 30565, 28195 => 30591, 28196 => 30605, 28197 => 30589, + 28198 => 30592, 28199 => 30604, 28200 => 30609, 28201 => 30623, 28202 => 30624, + 28203 => 30640, 28204 => 30645, 28205 => 30653, 28206 => 30010, 28207 => 30016, + 28208 => 30030, 28209 => 30027, 28210 => 30024, 28211 => 30043, 28212 => 30066, + 28213 => 30073, 28214 => 30083, 28215 => 32600, 28216 => 32609, 28217 => 32607, + 28218 => 35400, 28219 => 32616, 28220 => 32628, 28221 => 32625, 28222 => 32633, + 28223 => 32641, 28224 => 32638, 28225 => 30413, 28226 => 30437, 28227 => 34866, + 28228 => 38021, 28229 => 38022, 28230 => 38023, 28231 => 38027, 28232 => 38026, + 28233 => 38028, 28234 => 38029, 28235 => 38031, 28236 => 38032, 28237 => 38036, + 28238 => 38039, 28239 => 38037, 28240 => 38042, 28241 => 38043, 28242 => 38044, + 28243 => 38051, 28244 => 38052, 28245 => 38059, 28246 => 38058, 28247 => 38061, + 28248 => 38060, 28249 => 38063, 28250 => 38064, 28251 => 38066, 28252 => 38068, + 28253 => 38070, 28254 => 38071, 28255 => 38072, 28256 => 38073, 28257 => 38074, + 28258 => 38076, 28259 => 38077, 28260 => 38079, 28261 => 38084, 28262 => 38088, + 28263 => 38089, 28264 => 38090, 28265 => 38091, 28266 => 38092, 28267 => 38093, + 28268 => 38094, 28269 => 38096, 28270 => 38097, 28271 => 38098, 28272 => 38101, + 28273 => 38102, 28274 => 38103, 28275 => 38105, 28276 => 38104, 28277 => 38107, + 28278 => 38110, 28279 => 38111, 28280 => 38112, 28281 => 38114, 28282 => 38116, + 28283 => 38117, 28284 => 38119, 28285 => 38120, 28286 => 38122, 28449 => 38121, + 28450 => 38123, 28451 => 38126, 28452 => 38127, 28453 => 38131, 28454 => 38132, + 28455 => 38133, 28456 => 38135, 28457 => 38137, 28458 => 38140, 28459 => 38141, + 28460 => 38143, 28461 => 38147, 28462 => 38146, 28463 => 38150, 28464 => 38151, + 28465 => 38153, 28466 => 38154, 28467 => 38157, 28468 => 38158, 28469 => 38159, + 28470 => 38162, 28471 => 38163, 28472 => 38164, 28473 => 38165, 28474 => 38166, + 28475 => 38168, 28476 => 38171, 28477 => 38173, 28478 => 38174, 28479 => 38175, + 28480 => 38178, 28481 => 38186, 28482 => 38187, 28483 => 38185, 28484 => 38188, + 28485 => 38193, 28486 => 38194, 28487 => 38196, 28488 => 38198, 28489 => 38199, + 28490 => 38200, 28491 => 38204, 28492 => 38206, 28493 => 38207, 28494 => 38210, + 28495 => 38197, 28496 => 38212, 28497 => 38213, 28498 => 38214, 28499 => 38217, + 28500 => 38220, 28501 => 38222, 28502 => 38223, 28503 => 38226, 28504 => 38227, + 28505 => 38228, 28506 => 38230, 28507 => 38231, 28508 => 38232, 28509 => 38233, + 28510 => 38235, 28511 => 38238, 28512 => 38239, 28513 => 38237, 28514 => 38241, + 28515 => 38242, 28516 => 38244, 28517 => 38245, 28518 => 38246, 28519 => 38247, + 28520 => 38248, 28521 => 38249, 28522 => 38250, 28523 => 38251, 28524 => 38252, + 28525 => 38255, 28526 => 38257, 28527 => 38258, 28528 => 38259, 28529 => 38202, + 28530 => 30695, 28531 => 30700, 28532 => 38601, 28533 => 31189, 28534 => 31213, + 28535 => 31203, 28536 => 31211, 28537 => 31238, 28538 => 23879, 28539 => 31235, + 28540 => 31234, 28541 => 31262, 28542 => 31252, 28705 => 31289, 28706 => 31287, + 28707 => 31313, 28708 => 40655, 28709 => 39333, 28710 => 31344, 28711 => 30344, + 28712 => 30350, 28713 => 30355, 28714 => 30361, 28715 => 30372, 28716 => 29918, + 28717 => 29920, 28718 => 29996, 28719 => 40480, 28720 => 40482, 28721 => 40488, + 28722 => 40489, 28723 => 40490, 28724 => 40491, 28725 => 40492, 28726 => 40498, + 28727 => 40497, 28728 => 40502, 28729 => 40504, 28730 => 40503, 28731 => 40505, + 28732 => 40506, 28733 => 40510, 28734 => 40513, 28735 => 40514, 28736 => 40516, + 28737 => 40518, 28738 => 40519, 28739 => 40520, 28740 => 40521, 28741 => 40523, + 28742 => 40524, 28743 => 40526, 28744 => 40529, 28745 => 40533, 28746 => 40535, + 28747 => 40538, 28748 => 40539, 28749 => 40540, 28750 => 40542, 28751 => 40547, + 28752 => 40550, 28753 => 40551, 28754 => 40552, 28755 => 40553, 28756 => 40554, + 28757 => 40555, 28758 => 40556, 28759 => 40561, 28760 => 40557, 28761 => 40563, + 28762 => 30098, 28763 => 30100, 28764 => 30102, 28765 => 30112, 28766 => 30109, + 28767 => 30124, 28768 => 30115, 28769 => 30131, 28770 => 30132, 28771 => 30136, + 28772 => 30148, 28773 => 30129, 28774 => 30128, 28775 => 30147, 28776 => 30146, + 28777 => 30166, 28778 => 30157, 28779 => 30179, 28780 => 30184, 28781 => 30182, + 28782 => 30180, 28783 => 30187, 28784 => 30183, 28785 => 30211, 28786 => 30193, + 28787 => 30204, 28788 => 30207, 28789 => 30224, 28790 => 30208, 28791 => 30213, + 28792 => 30220, 28793 => 30231, 28794 => 30218, 28795 => 30245, 28796 => 30232, + 28797 => 30229, 28798 => 30233, 28961 => 30235, 28962 => 30268, 28963 => 30242, + 28964 => 30240, 28965 => 30272, 28966 => 30253, 28967 => 30256, 28968 => 30271, + 28969 => 30261, 28970 => 30275, 28971 => 30270, 28972 => 30259, 28973 => 30285, + 28974 => 30302, 28975 => 30292, 28976 => 30300, 28977 => 30294, 28978 => 30315, + 28979 => 30319, 28980 => 32714, 28981 => 31462, 28982 => 31352, 28983 => 31353, + 28984 => 31360, 28985 => 31366, 28986 => 31368, 28987 => 31381, 28988 => 31398, + 28989 => 31392, 28990 => 31404, 28991 => 31400, 28992 => 31405, 28993 => 31411, + 28994 => 34916, 28995 => 34921, 28996 => 34930, 28997 => 34941, 28998 => 34943, + 28999 => 34946, 29000 => 34978, 29001 => 35014, 29002 => 34999, 29003 => 35004, + 29004 => 35017, 29005 => 35042, 29006 => 35022, 29007 => 35043, 29008 => 35045, + 29009 => 35057, 29010 => 35098, 29011 => 35068, 29012 => 35048, 29013 => 35070, + 29014 => 35056, 29015 => 35105, 29016 => 35097, 29017 => 35091, 29018 => 35099, + 29019 => 35082, 29020 => 35124, 29021 => 35115, 29022 => 35126, 29023 => 35137, + 29024 => 35174, 29025 => 35195, 29026 => 30091, 29027 => 32997, 29028 => 30386, + 29029 => 30388, 29030 => 30684, 29031 => 32786, 29032 => 32788, 29033 => 32790, + 29034 => 32796, 29035 => 32800, 29036 => 32802, 29037 => 32805, 29038 => 32806, + 29039 => 32807, 29040 => 32809, 29041 => 32808, 29042 => 32817, 29043 => 32779, + 29044 => 32821, 29045 => 32835, 29046 => 32838, 29047 => 32845, 29048 => 32850, + 29049 => 32873, 29050 => 32881, 29051 => 35203, 29052 => 39032, 29053 => 39040, + 29054 => 39043, 29217 => 39049, 29218 => 39052, 29219 => 39053, 29220 => 39055, + 29221 => 39060, 29222 => 39066, 29223 => 39067, 29224 => 39070, 29225 => 39071, + 29226 => 39073, 29227 => 39074, 29228 => 39077, 29229 => 39078, 29230 => 34381, + 29231 => 34388, 29232 => 34412, 29233 => 34414, 29234 => 34431, 29235 => 34426, + 29236 => 34428, 29237 => 34427, 29238 => 34472, 29239 => 34445, 29240 => 34443, + 29241 => 34476, 29242 => 34461, 29243 => 34471, 29244 => 34467, 29245 => 34474, + 29246 => 34451, 29247 => 34473, 29248 => 34486, 29249 => 34500, 29250 => 34485, + 29251 => 34510, 29252 => 34480, 29253 => 34490, 29254 => 34481, 29255 => 34479, + 29256 => 34505, 29257 => 34511, 29258 => 34484, 29259 => 34537, 29260 => 34545, + 29261 => 34546, 29262 => 34541, 29263 => 34547, 29264 => 34512, 29265 => 34579, + 29266 => 34526, 29267 => 34548, 29268 => 34527, 29269 => 34520, 29270 => 34513, + 29271 => 34563, 29272 => 34567, 29273 => 34552, 29274 => 34568, 29275 => 34570, + 29276 => 34573, 29277 => 34569, 29278 => 34595, 29279 => 34619, 29280 => 34590, + 29281 => 34597, 29282 => 34606, 29283 => 34586, 29284 => 34622, 29285 => 34632, + 29286 => 34612, 29287 => 34609, 29288 => 34601, 29289 => 34615, 29290 => 34623, + 29291 => 34690, 29292 => 34594, 29293 => 34685, 29294 => 34686, 29295 => 34683, + 29296 => 34656, 29297 => 34672, 29298 => 34636, 29299 => 34670, 29300 => 34699, + 29301 => 34643, 29302 => 34659, 29303 => 34684, 29304 => 34660, 29305 => 34649, + 29306 => 34661, 29307 => 34707, 29308 => 34735, 29309 => 34728, 29310 => 34770, + 29473 => 34758, 29474 => 34696, 29475 => 34693, 29476 => 34733, 29477 => 34711, + 29478 => 34691, 29479 => 34731, 29480 => 34789, 29481 => 34732, 29482 => 34741, + 29483 => 34739, 29484 => 34763, 29485 => 34771, 29486 => 34749, 29487 => 34769, + 29488 => 34752, 29489 => 34762, 29490 => 34779, 29491 => 34794, 29492 => 34784, + 29493 => 34798, 29494 => 34838, 29495 => 34835, 29496 => 34814, 29497 => 34826, + 29498 => 34843, 29499 => 34849, 29500 => 34873, 29501 => 34876, 29502 => 32566, + 29503 => 32578, 29504 => 32580, 29505 => 32581, 29506 => 33296, 29507 => 31482, + 29508 => 31485, 29509 => 31496, 29510 => 31491, 29511 => 31492, 29512 => 31509, + 29513 => 31498, 29514 => 31531, 29515 => 31503, 29516 => 31559, 29517 => 31544, + 29518 => 31530, 29519 => 31513, 29520 => 31534, 29521 => 31537, 29522 => 31520, + 29523 => 31525, 29524 => 31524, 29525 => 31539, 29526 => 31550, 29527 => 31518, + 29528 => 31576, 29529 => 31578, 29530 => 31557, 29531 => 31605, 29532 => 31564, + 29533 => 31581, 29534 => 31584, 29535 => 31598, 29536 => 31611, 29537 => 31586, + 29538 => 31602, 29539 => 31601, 29540 => 31632, 29541 => 31654, 29542 => 31655, + 29543 => 31672, 29544 => 31660, 29545 => 31645, 29546 => 31656, 29547 => 31621, + 29548 => 31658, 29549 => 31644, 29550 => 31650, 29551 => 31659, 29552 => 31668, + 29553 => 31697, 29554 => 31681, 29555 => 31692, 29556 => 31709, 29557 => 31706, + 29558 => 31717, 29559 => 31718, 29560 => 31722, 29561 => 31756, 29562 => 31742, + 29563 => 31740, 29564 => 31759, 29565 => 31766, 29566 => 31755, 29729 => 31775, + 29730 => 31786, 29731 => 31782, 29732 => 31800, 29733 => 31809, 29734 => 31808, + 29735 => 33278, 29736 => 33281, 29737 => 33282, 29738 => 33284, 29739 => 33260, + 29740 => 34884, 29741 => 33313, 29742 => 33314, 29743 => 33315, 29744 => 33325, + 29745 => 33327, 29746 => 33320, 29747 => 33323, 29748 => 33336, 29749 => 33339, + 29750 => 33331, 29751 => 33332, 29752 => 33342, 29753 => 33348, 29754 => 33353, + 29755 => 33355, 29756 => 33359, 29757 => 33370, 29758 => 33375, 29759 => 33384, + 29760 => 34942, 29761 => 34949, 29762 => 34952, 29763 => 35032, 29764 => 35039, + 29765 => 35166, 29766 => 32669, 29767 => 32671, 29768 => 32679, 29769 => 32687, + 29770 => 32688, 29771 => 32690, 29772 => 31868, 29773 => 25929, 29774 => 31889, + 29775 => 31901, 29776 => 31900, 29777 => 31902, 29778 => 31906, 29779 => 31922, + 29780 => 31932, 29781 => 31933, 29782 => 31937, 29783 => 31943, 29784 => 31948, + 29785 => 31949, 29786 => 31944, 29787 => 31941, 29788 => 31959, 29789 => 31976, + 29790 => 33390, 29791 => 26280, 29792 => 32703, 29793 => 32718, 29794 => 32725, + 29795 => 32741, 29796 => 32737, 29797 => 32742, 29798 => 32745, 29799 => 32750, + 29800 => 32755, 29801 => 31992, 29802 => 32119, 29803 => 32166, 29804 => 32174, + 29805 => 32327, 29806 => 32411, 29807 => 40632, 29808 => 40628, 29809 => 36211, + 29810 => 36228, 29811 => 36244, 29812 => 36241, 29813 => 36273, 29814 => 36199, + 29815 => 36205, 29816 => 35911, 29817 => 35913, 29818 => 37194, 29819 => 37200, + 29820 => 37198, 29821 => 37199, 29822 => 37220, 29985 => 37218, 29986 => 37217, + 29987 => 37232, 29988 => 37225, 29989 => 37231, 29990 => 37245, 29991 => 37246, + 29992 => 37234, 29993 => 37236, 29994 => 37241, 29995 => 37260, 29996 => 37253, + 29997 => 37264, 29998 => 37261, 29999 => 37265, 30000 => 37282, 30001 => 37283, + 30002 => 37290, 30003 => 37293, 30004 => 37294, 30005 => 37295, 30006 => 37301, + 30007 => 37300, 30008 => 37306, 30009 => 35925, 30010 => 40574, 30011 => 36280, + 30012 => 36331, 30013 => 36357, 30014 => 36441, 30015 => 36457, 30016 => 36277, + 30017 => 36287, 30018 => 36284, 30019 => 36282, 30020 => 36292, 30021 => 36310, + 30022 => 36311, 30023 => 36314, 30024 => 36318, 30025 => 36302, 30026 => 36303, + 30027 => 36315, 30028 => 36294, 30029 => 36332, 30030 => 36343, 30031 => 36344, + 30032 => 36323, 30033 => 36345, 30034 => 36347, 30035 => 36324, 30036 => 36361, + 30037 => 36349, 30038 => 36372, 30039 => 36381, 30040 => 36383, 30041 => 36396, + 30042 => 36398, 30043 => 36387, 30044 => 36399, 30045 => 36410, 30046 => 36416, + 30047 => 36409, 30048 => 36405, 30049 => 36413, 30050 => 36401, 30051 => 36425, + 30052 => 36417, 30053 => 36418, 30054 => 36433, 30055 => 36434, 30056 => 36426, + 30057 => 36464, 30058 => 36470, 30059 => 36476, 30060 => 36463, 30061 => 36468, + 30062 => 36485, 30063 => 36495, 30064 => 36500, 30065 => 36496, 30066 => 36508, + 30067 => 36510, 30068 => 35960, 30069 => 35970, 30070 => 35978, 30071 => 35973, + 30072 => 35992, 30073 => 35988, 30074 => 26011, 30075 => 35286, 30076 => 35294, + 30077 => 35290, 30078 => 35292, 30241 => 35301, 30242 => 35307, 30243 => 35311, + 30244 => 35390, 30245 => 35622, 30246 => 38739, 30247 => 38633, 30248 => 38643, + 30249 => 38639, 30250 => 38662, 30251 => 38657, 30252 => 38664, 30253 => 38671, + 30254 => 38670, 30255 => 38698, 30256 => 38701, 30257 => 38704, 30258 => 38718, + 30259 => 40832, 30260 => 40835, 30261 => 40837, 30262 => 40838, 30263 => 40839, + 30264 => 40840, 30265 => 40841, 30266 => 40842, 30267 => 40844, 30268 => 40702, + 30269 => 40715, 30270 => 40717, 30271 => 38585, 30272 => 38588, 30273 => 38589, + 30274 => 38606, 30275 => 38610, 30276 => 30655, 30277 => 38624, 30278 => 37518, + 30279 => 37550, 30280 => 37576, 30281 => 37694, 30282 => 37738, 30283 => 37834, + 30284 => 37775, 30285 => 37950, 30286 => 37995, 30287 => 40063, 30288 => 40066, + 30289 => 40069, 30290 => 40070, 30291 => 40071, 30292 => 40072, 30293 => 31267, + 30294 => 40075, 30295 => 40078, 30296 => 40080, 30297 => 40081, 30298 => 40082, + 30299 => 40084, 30300 => 40085, 30301 => 40090, 30302 => 40091, 30303 => 40094, + 30304 => 40095, 30305 => 40096, 30306 => 40097, 30307 => 40098, 30308 => 40099, + 30309 => 40101, 30310 => 40102, 30311 => 40103, 30312 => 40104, 30313 => 40105, + 30314 => 40107, 30315 => 40109, 30316 => 40110, 30317 => 40112, 30318 => 40113, + 30319 => 40114, 30320 => 40115, 30321 => 40116, 30322 => 40117, 30323 => 40118, + 30324 => 40119, 30325 => 40122, 30326 => 40123, 30327 => 40124, 30328 => 40125, + 30329 => 40132, 30330 => 40133, 30331 => 40134, 30332 => 40135, 30333 => 40138, + 30334 => 40139, 30497 => 40140, 30498 => 40141, 30499 => 40142, 30500 => 40143, + 30501 => 40144, 30502 => 40147, 30503 => 40148, 30504 => 40149, 30505 => 40151, + 30506 => 40152, 30507 => 40153, 30508 => 40156, 30509 => 40157, 30510 => 40159, + 30511 => 40162, 30512 => 38780, 30513 => 38789, 30514 => 38801, 30515 => 38802, + 30516 => 38804, 30517 => 38831, 30518 => 38827, 30519 => 38819, 30520 => 38834, + 30521 => 38836, 30522 => 39601, 30523 => 39600, 30524 => 39607, 30525 => 40536, + 30526 => 39606, 30527 => 39610, 30528 => 39612, 30529 => 39617, 30530 => 39616, + 30531 => 39621, 30532 => 39618, 30533 => 39627, 30534 => 39628, 30535 => 39633, + 30536 => 39749, 30537 => 39747, 30538 => 39751, 30539 => 39753, 30540 => 39752, + 30541 => 39757, 30542 => 39761, 30543 => 39144, 30544 => 39181, 30545 => 39214, + 30546 => 39253, 30547 => 39252, 30548 => 39647, 30549 => 39649, 30550 => 39654, + 30551 => 39663, 30552 => 39659, 30553 => 39675, 30554 => 39661, 30555 => 39673, + 30556 => 39688, 30557 => 39695, 30558 => 39699, 30559 => 39711, 30560 => 39715, + 30561 => 40637, 30562 => 40638, 30563 => 32315, 30564 => 40578, 30565 => 40583, + 30566 => 40584, 30567 => 40587, 30568 => 40594, 30569 => 37846, 30570 => 40605, + 30571 => 40607, 30572 => 40667, 30573 => 40668, 30574 => 40669, 30575 => 40672, + 30576 => 40671, 30577 => 40674, 30578 => 40681, 30579 => 40679, 30580 => 40677, + 30581 => 40682, 30582 => 40687, 30583 => 40738, 30584 => 40748, 30585 => 40751, + 30586 => 40761, 30587 => 40759, 30588 => 40765, 30589 => 40766, 30590 => 40772, + 0 => 0 ); + + function gb2utf8($gb) { + if( !trim($gb) ) return $gb; + $utf8=''; + while($gb) { + if( ord(substr($gb,0,1)) > 127 ) { + $t=substr($gb,0,2); + $gb=substr($gb,2); + $utf8 .= $this->u2utf8($this->codetable[hexdec(bin2hex($t))-0x8080]); + } + else { + $t=substr($gb,0,1); + $gb=substr($gb,1); + $utf8 .= $this->u2utf8($t); + } + } + return $utf8; + } + + function u2utf8($c) { + $str=''; + if ($c < 0x80) { + $str.=$c; + } + else if ($c < 0x800) { + $str.=chr(0xC0 | $c>>6); + $str.=chr(0x80 | $c & 0x3F); + } + else if ($c < 0x10000) { + $str.=chr(0xE0 | $c>>12); + $str.=chr(0x80 | $c>>6 & 0x3F); + $str.=chr(0x80 | $c & 0x3F); + } + else if ($c < 0x200000) { + $str.=chr(0xF0 | $c>>18); + $str.=chr(0x80 | $c>>12 & 0x3F); + $str.=chr(0x80 | $c>>6 & 0x3F); + $str.=chr(0x80 | $c & 0x3F); + } + return $str; + } + +} // END Class + +?> diff --git a/includes/jpgraph/src/jpgraph_gradient.php b/includes/jpgraph/src/jpgraph_gradient.php new file mode 100644 index 0000000..e5d7cfb --- /dev/null +++ b/includes/jpgraph/src/jpgraph_gradient.php @@ -0,0 +1,434 @@ +img = $img; + } + + + function SetNumColors($aNum) { + $this->numcolors=$aNum; + } + //--------------- + // PUBLIC METHODS + // Produce a gradient filled rectangle with a smooth transition between + // two colors. + // ($xl,$yt) Top left corner + // ($xr,$yb) Bottom right + // $from_color Starting color in gradient + // $to_color End color in the gradient + // $style Which way is the gradient oriented? + function FilledRectangle($xl,$yt,$xr,$yb,$from_color,$to_color,$style=1) { + $this->img->SetLineWeight(1); + switch( $style ) { + case GRAD_VER: + $steps = ceil(abs($xr-$xl)+1); + $delta = $xr>=$xl ? 1 : -1; + $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); + for( $i=0, $x=$xl; $i < $steps; ++$i ) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yt,$x,$yb); + $x += $delta; + } + break; + + case GRAD_HOR: + $steps = ceil(abs($yb-$yt)+1); + $delta = $yb >= $yt ? 1 : -1; + $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); + for($i=0,$y=$yt; $i < $steps; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($xl,$y,$xr,$y); + $y += $delta; + } + break; + + case GRAD_MIDHOR: + $steps = ceil(abs($yb-$yt)/2); + $delta = $yb >= $yt ? 1 : -1; + $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); + for($y=$yt, $i=0; $i < $steps; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($xl,$y,$xr,$y); + $y += $delta; + } + --$i; + if( abs($yb-$yt) % 2 == 1 ) { + --$steps; + } + for($j=0; $j < $steps; ++$j, --$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($xl,$y,$xr,$y); + $y += $delta; + } + $this->img->Line($xl,$y,$xr,$y); + break; + + case GRAD_MIDVER: + $steps = ceil(abs($xr-$xl)/2); + $delta = $xr>=$xl ? 1 : -1; + $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); + for($x=$xl, $i=0; $i < $steps; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + --$i; + if( abs($xr-$xl) % 2 == 1 ) { + --$steps; + } + for($j=0; $j < $steps; ++$j, --$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + $this->img->Line($x,$yb,$x,$yt); + break; + + case GRAD_WIDE_MIDVER: + $diff = ceil(abs($xr-$xl)); + $steps = floor(abs($diff)/3); + $firststep = $diff - 2*$steps ; + $delta = $xr >= $xl ? 1 : -1; + $this->GetColArray($from_color,$to_color,$firststep,$colors,$this->numcolors); + for($x=$xl, $i=0; $i < $firststep; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + --$i; + $this->img->current_color = $colors[$i]; + for($j=0; $j< $steps; ++$j) { + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + + for($j=0; $j < $steps; ++$j, --$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + break; + + case GRAD_WIDE_MIDHOR: + $diff = ceil(abs($yb-$yt)); + $steps = floor(abs($diff)/3); + $firststep = $diff - 2*$steps ; + $delta = $yb >= $yt? 1 : -1; + $this->GetColArray($from_color,$to_color,$firststep,$colors,$this->numcolors); + for($y=$yt, $i=0; $i < $firststep; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($xl,$y,$xr,$y); + $y += $delta; + } + --$i; + $this->img->current_color = $colors[$i]; + for($j=0; $j < $steps; ++$j) { + $this->img->Line($xl,$y,$xr,$y); + $y += $delta; + } + for($j=0; $j < $steps; ++$j, --$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($xl,$y,$xr,$y); + $y += $delta; + } + break; + + case GRAD_LEFT_REFLECTION: + $steps1 = ceil(0.3*abs($xr-$xl)); + $delta = $xr>=$xl ? 1 : -1; + + $from_color = $this->img->rgb->Color($from_color); + $adj = 1.4; + $m = ($adj-1.0)*(255-min(255,min($from_color[0],min($from_color[1],$from_color[2])))); + $from_color2 = array(min(255,$from_color[0]+$m), + min(255,$from_color[1]+$m), min(255,$from_color[2]+$m)); + + $this->GetColArray($from_color2,$to_color,$steps1,$colors,$this->numcolors); + $n = count($colors); + for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + $steps2 = max(1,ceil(0.08*abs($xr-$xl))); + $this->img->SetColor($to_color); + for($j=0; $j< $steps2; ++$j) { + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + $steps = abs($xr-$xl)-$steps1-$steps2; + $this->GetColArray($to_color,$from_color,$steps,$colors,$this->numcolors); + $n = count($colors); + for($i=0; $i < $steps && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + break; + + case GRAD_RIGHT_REFLECTION: + $steps1 = ceil(0.7*abs($xr-$xl)); + $delta = $xr>=$xl ? 1 : -1; + + $this->GetColArray($from_color,$to_color,$steps1,$colors,$this->numcolors); + $n = count($colors); + for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + $steps2 = max(1,ceil(0.08*abs($xr-$xl))); + $this->img->SetColor($to_color); + for($j=0; $j< $steps2; ++$j) { + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + + $from_color = $this->img->rgb->Color($from_color); + $adj = 1.4; + $m = ($adj-1.0)*(255-min(255,min($from_color[0],min($from_color[1],$from_color[2])))); + $from_color = array(min(255,$from_color[0]+$m), + min(255,$from_color[1]+$m), min(255,$from_color[2]+$m)); + + $steps = abs($xr-$xl)-$steps1-$steps2; + $this->GetColArray($to_color,$from_color,$steps,$colors,$this->numcolors); + $n = count($colors); + for($i=0; $i < $steps && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + break; + + case GRAD_CENTER: + $steps = ceil(min(($yb-$yt)+1,($xr-$xl)+1)/2); + $this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); + $dx = ($xr-$xl)/2; + $dy = ($yb-$yt)/2; + $x=$xl;$y=$yt;$x2=$xr;$y2=$yb; + $n = count($colors); + for($x=$xl, $i=0; $x < $xl+$dx && $y < $yt+$dy && $i < $n; ++$x, ++$y, --$x2, --$y2, ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Rectangle($x,$y,$x2,$y2); + } + $this->img->Line($x,$y,$x2,$y2); + break; + + case GRAD_RAISED_PANEL: + // right to left + $steps1 = $xr-$xl; + $delta = $xr>=$xl ? 1 : -1; + $this->GetColArray($to_color,$from_color,$steps1,$colors,$this->numcolors); + $n = count($colors); + for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + + // left to right + $xr -= 3; + $xl += 3; + $yb -= 3; + $yt += 3; + $steps2 = $xr-$xl; + $delta = $xr>=$xl ? 1 : -1; + for($x=$xl, $j=$steps2; $j >= 0; --$j) { + $this->img->current_color = $colors[$j]; + $this->img->Line($x,$yb,$x,$yt); + $x += $delta; + } + break; + + case GRAD_DIAGONAL: + // use the longer dimension to determine the required number of steps. + // first loop draws from one corner to the mid-diagonal and the second + // loop draws from the mid-diagonal to the opposing corner. + if($xr-$xl > $yb - $yt) { + // width is greater than height -> use x-dimension for steps + $steps = $xr-$xl; + $delta = $xr>=$xl ? 1 : -1; + $this->GetColArray($from_color,$to_color,$steps*2,$colors,$this->numcolors); + $n = count($colors); + + for($x=$xl, $i=0; $i < $steps && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $y = $yt+($i/$steps)*($yb-$yt)*$delta; + $this->img->Line($x,$yt,$xl,$y); + $x += $delta; + } + + for($x=$xl, $i = 0; $i < $steps && $i < $n; ++$i) { + $this->img->current_color = $colors[$steps+$i]; + $y = $yt+($i/$steps)*($yb-$yt)*$delta; + $this->img->Line($x,$yb,$xr,$y); + $x += $delta; + } + } else { + // height is greater than width -> use y-dimension for steps + $steps = $yb-$yt; + $delta = $yb>=$yt ? 1 : -1; + $this->GetColArray($from_color,$to_color,$steps*2,$colors,$this->numcolors); + $n = count($colors); + + for($y=$yt, $i=0; $i < $steps && $i < $n; ++$i) { + $this->img->current_color = $colors[$i]; + $x = $xl+($i/$steps)*($xr-$xl)*$delta; + $this->img->Line($x,$yt,$xl,$y); + $y += $delta; + } + + for($y=$yt, $i = 0; $i < $steps && $i < $n; ++$i) { + $this->img->current_color = $colors[$steps+$i]; + $x = $xl+($i/$steps)*($xr-$xl)*$delta; + $this->img->Line($x,$yb,$xr,$y); + $x += $delta; + } + + } + break; + + default: + JpGraphError::RaiseL(7001,$style); + //("Unknown gradient style (=$style)."); + break; + } + } + + // Fill a special case of a polygon with a flat bottom + // with a gradient. Can be used for filled line plots. + // Please note that this is NOT a generic gradient polygon fill + // routine. It assumes that the bottom is flat (like a drawing + // of a mountain) + function FilledFlatPolygon($pts,$from_color,$to_color) { + if( count($pts) == 0 ) return; + + $maxy=$pts[1]; + $miny=$pts[1]; + $n = count($pts) ; + for( $i=0, $idx=0; $i < $n; $i += 2) { + $x = round($pts[$i]); + $y = round($pts[$i+1]); + $miny = min($miny,$y); + $maxy = max($maxy,$y); + } + + $colors = array(); + $this->GetColArray($from_color,$to_color,abs($maxy-$miny)+1,$colors,$this->numcolors); + for($i=$miny, $idx=0; $i <= $maxy; ++$i ) { + $colmap[$i] = $colors[$idx++]; + } + + $n = count($pts)/2 ; + $idx = 0 ; + while( $idx < $n-1 ) { + $p1 = array(round($pts[$idx*2]),round($pts[$idx*2+1])); + $p2 = array(round($pts[++$idx*2]),round($pts[$idx*2+1])); + + // Find the largest rectangle we can fill + $y = max($p1[1],$p2[1]) ; + for($yy=$maxy; $yy > $y; --$yy) { + $this->img->current_color = $colmap[$yy]; + $this->img->Line($p1[0],$yy,$p2[0]-1,$yy); + } + + if( $p1[1] == $p2[1] ) { + continue; + } + + // Fill the rest using lines (slow...) + $slope = ($p2[0]-$p1[0])/($p1[1]-$p2[1]); + $x1 = $p1[0]; + $x2 = $p2[0]-1; + $start = $y; + if( $p1[1] > $p2[1] ) { + while( $y >= $p2[1] ) { + $x1=$slope*($start-$y)+$p1[0]; + $this->img->current_color = $colmap[$y]; + $this->img->Line($x1,$y,$x2,$y); + --$y; + } + } + else { + while( $y >= $p1[1] ) { + $x2=$p2[0]+$slope*($start-$y); + $this->img->current_color = $colmap[$y]; + $this->img->Line($x1,$y,$x2,$y); + --$y; + } + } + } + } + + //--------------- + // PRIVATE METHODS + // Add to the image color map the necessary colors to do the transition + // between the two colors using $numcolors intermediate colors + function GetColArray($from_color,$to_color,$arr_size,&$colors,$numcols=100) { + if( $arr_size==0 ) { + return; + } + + // If color is given as text get it's corresponding r,g,b values + $from_color = $this->img->rgb->Color($from_color); + $to_color = $this->img->rgb->Color($to_color); + + $rdelta=($to_color[0]-$from_color[0])/$numcols; + $gdelta=($to_color[1]-$from_color[1])/$numcols; + $bdelta=($to_color[2]-$from_color[2])/$numcols; + $colorsperstep = $numcols/$arr_size; + $prevcolnum = -1; + $from_alpha = $from_color[3]; + $to_alpha = $to_color[3]; + $adelta = ( $to_alpha - $from_alpha ) / $numcols ; + for ($i=0; $i < $arr_size; ++$i) { + $colnum = floor($colorsperstep*$i); + if ( $colnum == $prevcolnum ) { + $colors[$i] = $colidx; + } + else { + $r = floor($from_color[0] + $colnum*$rdelta); + $g = floor($from_color[1] + $colnum*$gdelta); + $b = floor($from_color[2] + $colnum*$bdelta); + $alpha = $from_alpha + $colnum*$adelta; + $colidx = $this->img->rgb->Allocate(sprintf("#%02x%02x%02x",$r,$g,$b),$alpha); + $colors[$i] = $colidx; + } + $prevcolnum = $colnum; + } + } +} // Class + +?> diff --git a/includes/jpgraph/src/jpgraph_iconplot.php b/includes/jpgraph/src/jpgraph_iconplot.php new file mode 100644 index 0000000..1a99d52 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_iconplot.php @@ -0,0 +1,190 @@ +iFile = $aFile; + $this->iX=$aX; + $this->iY=$aY; + $this->iScale= $aScale; + if( $aMix < 0 || $aMix > 100 ) { + JpGraphError::RaiseL(8001); //('Mix value for icon must be between 0 and 100.'); + } + $this->iMix = $aMix ; + } + + function SetCountryFlag($aFlag,$aX=0,$aY=0,$aScale=1.0,$aMix=100,$aStdSize=3) { + $this->iCountryFlag = $aFlag; + $this->iX=$aX; + $this->iY=$aY; + $this->iScale= $aScale; + if( $aMix < 0 || $aMix > 100 ) { + JpGraphError::RaiseL(8001);//'Mix value for icon must be between 0 and 100.'); + } + $this->iMix = $aMix; + $this->iCountryStdSize = $aStdSize; + } + + function SetPos($aX,$aY) { + $this->iX=$aX; + $this->iY=$aY; + } + + function CreateFromString($aStr) { + $this->iImgString = $aStr; + } + + function SetScalePos($aX,$aY) { + $this->iScalePosX = $aX; + $this->iScalePosY = $aY; + } + + function SetScale($aScale) { + $this->iScale = $aScale; + } + + function SetMix($aMix) { + if( $aMix < 0 || $aMix > 100 ) { + JpGraphError::RaiseL(8001);//('Mix value for icon must be between 0 and 100.'); + } + $this->iMix = $aMix ; + } + + function SetAnchor($aXAnchor='left',$aYAnchor='center') { + if( !in_array($aXAnchor,$this->iAnchors) || + !in_array($aYAnchor,$this->iAnchors) ) { + JpGraphError::RaiseL(8002);//("Anchor position for icons must be one of 'top', 'bottom', 'left', 'right' or 'center'"); + } + $this->iHorAnchor=$aXAnchor; + $this->iVertAnchor=$aYAnchor; + } + + function PreStrokeAdjust($aGraph) { + // Nothing to do ... + } + + function DoLegend($aGraph) { + // Nothing to do ... + } + + function Max() { + return array(false,false); + } + + + // The next four function are framework function tht gets called + // from Gantt and is not menaiungfull in the context of Icons but + // they must be implemented to avoid errors. + function GetMaxDate() { return false; } + function GetMinDate() { return false; } + function GetLineNbr() { return 0; } + function GetAbsHeight() {return 0; } + + + function Min() { + return array(false,false); + } + + function StrokeMargin(&$aImg) { + return true; + } + + function Stroke($aImg,$axscale=null,$ayscale=null) { + $this->StrokeWithScale($aImg,$axscale,$ayscale); + } + + function StrokeWithScale($aImg,$axscale,$ayscale) { + if( $this->iScalePosX === null || $this->iScalePosY === null || + $axscale === null || $ayscale === null ) { + $this->_Stroke($aImg); + } + else { + $this->_Stroke($aImg, + round($axscale->Translate($this->iScalePosX)), + round($ayscale->Translate($this->iScalePosY))); + } + } + + function GetWidthHeight() { + $dummy=0; + return $this->_Stroke($dummy,null,null,true); + } + + function _Stroke($aImg,$x=null,$y=null,$aReturnWidthHeight=false) { + if( $this->iFile != '' && $this->iCountryFlag != '' ) { + JpGraphError::RaiseL(8003);//('It is not possible to specify both an image file and a country flag for the same icon.'); + } + if( $this->iFile != '' ) { + $gdimg = Graph::LoadBkgImage('',$this->iFile); + } + elseif( $this->iImgString != '') { + $gdimg = Image::CreateFromString($this->iImgString); + } + + else { + if( ! class_exists('FlagImages',false) ) { + JpGraphError::RaiseL(8004);//('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.'); + } + $fobj = new FlagImages($this->iCountryStdSize); + $dummy=''; + $gdimg = $fobj->GetImgByName($this->iCountryFlag,$dummy); + } + + $iconw = imagesx($gdimg); + $iconh = imagesy($gdimg); + + if( $aReturnWidthHeight ) { + return array(round($iconw*$this->iScale),round($iconh*$this->iScale)); + } + + if( $x !== null && $y !== null ) { + $this->iX = $x; $this->iY = $y; + } + if( $this->iX >= 0 && $this->iX <= 1.0 ) { + $w = imagesx($aImg->img); + $this->iX = round($w*$this->iX); + } + if( $this->iY >= 0 && $this->iY <= 1.0 ) { + $h = imagesy($aImg->img); + $this->iY = round($h*$this->iY); + } + + if( $this->iHorAnchor == 'center' ) + $this->iX -= round($iconw*$this->iScale/2); + if( $this->iHorAnchor == 'right' ) + $this->iX -= round($iconw*$this->iScale); + if( $this->iVertAnchor == 'center' ) + $this->iY -= round($iconh*$this->iScale/2); + if( $this->iVertAnchor == 'bottom' ) + $this->iY -= round($iconh*$this->iScale); + + $aImg->CopyMerge($gdimg,$this->iX,$this->iY,0,0, + round($iconw*$this->iScale),round($iconh*$this->iScale), + $iconw,$iconh, + $this->iMix); + } +} + +?> diff --git a/includes/jpgraph/src/jpgraph_imgtrans.php b/includes/jpgraph/src/jpgraph_imgtrans.php new file mode 100644 index 0000000..5f3b9e4 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_imgtrans.php @@ -0,0 +1,223 @@ +gdImg = $aGdImg; + } + + // -------------------------------------------------------------------- + // _TransVert3D() and _TransHor3D() are helper methods to + // Skew3D(). + // -------------------------------------------------------------------- + function _TransVert3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_DOWN,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) { + + + // Parameter check + if( $aHorizonPos < 0 || $aHorizonPos > 1.0 ) { + JpGraphError::RaiseL(9001); + //("Value for image transformation out of bounds.\nVanishing point on horizon must be specified as a value between 0 and 1."); + } + + $w = imagesx($aGdImg); + $h = imagesy($aGdImg); + + // Create new image + $ww = $w; + if( $aMinSize ) + $hh = ceil($h * $aHorizon / ($aSkewDist+$h)); + else + $hh = $h; + + $newgdh = imagecreatetruecolor($ww,$hh); + $crgb = new RGB( $newgdh ); + $fillColor = $crgb->Allocate($aFillColor); + imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor); + + if( $aBorder ) { + $colidx = $crgb->Allocate($aBorder); + imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx); + } + + $mid = round($w * $aHorizonPos); + + $last=$h; + for($y=0; $y < $h; ++$y) { + + $yp = $h-$y-1; + $yt = floor($yp * $aHorizon / ($aSkewDist + $yp)); + + if( !$aQuality ) { + if( $last <= $yt ) continue ; + $last = $yt; + } + + for($x=0; $x < $w; ++$x) { + $xt = ($x-$mid) * $aSkewDist / ($aSkewDist + $yp); + if( $aDir == SKEW3D_UP ) + $rgb = imagecolorat($aGdImg,$x,$h-$y-1); + else + $rgb = imagecolorat($aGdImg,$x,$y); + $r = ($rgb >> 16) & 0xFF; + $g = ($rgb >> 8) & 0xFF; + $b = $rgb & 0xFF; + $colidx = imagecolorallocate($newgdh,$r,$g,$b); + $xt = round($xt+$mid); + if( $aDir == SKEW3D_UP ) { + $syt = $yt; + } + else { + $syt = $hh-$yt-1; + } + + if( !empty($set[$yt]) ) { + $nrgb = imagecolorat($newgdh,$xt,$syt); + $nr = ($nrgb >> 16) & 0xFF; + $ng = ($nrgb >> 8) & 0xFF; + $nb = $nrgb & 0xFF; + $colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2), + floor(($g+$ng)/2),floor(($b+$nb)/2)); + } + + imagesetpixel($newgdh,$xt,$syt,$colidx); + } + + $set[$yt] = true; + } + + return $newgdh; + } + + // -------------------------------------------------------------------- + // _TransVert3D() and _TransHor3D() are helper methods to + // Skew3D(). + // -------------------------------------------------------------------- + function _TransHor3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_LEFT,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) { + + $w = imagesx($aGdImg); + $h = imagesy($aGdImg); + + // Create new image + $hh = $h; + if( $aMinSize ) + $ww = ceil($w * $aHorizon / ($aSkewDist+$w)); + else + $ww = $w; + + $newgdh = imagecreatetruecolor($ww,$hh); + $crgb = new RGB( $newgdh ); + $fillColor = $crgb->Allocate($aFillColor); + imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor); + + if( $aBorder ) { + $colidx = $crgb->Allocate($aBorder); + imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx); + } + + $mid = round($h * $aHorizonPos); + + $last = -1; + for($x=0; $x < $w-1; ++$x) { + $xt = floor($x * $aHorizon / ($aSkewDist + $x)); + if( !$aQuality ) { + if( $last >= $xt ) continue ; + $last = $xt; + } + + for($y=0; $y < $h; ++$y) { + $yp = $h-$y-1; + $yt = ($yp-$mid) * $aSkewDist / ($aSkewDist + $x); + + if( $aDir == SKEW3D_RIGHT ) + $rgb = imagecolorat($aGdImg,$w-$x-1,$y); + else + $rgb = imagecolorat($aGdImg,$x,$y); + $r = ($rgb >> 16) & 0xFF; + $g = ($rgb >> 8) & 0xFF; + $b = $rgb & 0xFF; + $colidx = imagecolorallocate($newgdh,$r,$g,$b); + $yt = floor($hh-$yt-$mid-1); + if( $aDir == SKEW3D_RIGHT ) { + $sxt = $ww-$xt-1; + } + else + $sxt = $xt ; + + if( !empty($set[$xt]) ) { + $nrgb = imagecolorat($newgdh,$sxt,$yt); + $nr = ($nrgb >> 16) & 0xFF; + $ng = ($nrgb >> 8) & 0xFF; + $nb = $nrgb & 0xFF; + $colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2), + floor(($g+$ng)/2),floor(($b+$nb)/2)); + } + imagesetpixel($newgdh,$sxt,$yt,$colidx); + } + + $set[$xt] = true; + } + + return $newgdh; + } + + // -------------------------------------------------------------------- + // Skew image for the apperance of a 3D effect + // This transforms an image into a 3D-skewed version + // of the image. The transformation is specified by giving the height + // of the artificial horizon and specifying a "skew" factor which + // is the distance on the horizon line between the point of + // convergence and perspective line. + // + // The function returns the GD handle of the transformed image + // leaving the original image untouched. + // + // Parameters: + // * $aGdImg, GD handle to the image to be transformed + // * $aHorizon, Distance to the horizon + // * $aSkewDist, Distance from the horizon point of convergence + // on the horizon line to the perspective points. A larger + // value will fore-shorten the image more + // * $aDir, parameter specifies type of convergence. This of this + // as the walls in a room you are looking at. This specifies if the + // image should be applied on the left,right,top or bottom walls. + // * $aMinSize, true=make the new image just as big as needed, + // false = keep the image the same size as the original image + // * $aFillColor, Background fill color in the image + // * $aHiQuality, true=performa some interpolation that improves + // the image quality but at the expense of performace. Enabling + // high quality will have a dramatic effect on the time it takes + // to transform an image. + // * $aBorder, if set to anything besides false this will draw a + // a border of the speciied color around the image + // -------------------------------------------------------------------- + function Skew3D($aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) { + return $this->_Skew3D($this->gdImg,$aHorizon,$aSkewDist,$aDir,$aHiQuality, + $aMinSize,$aFillColor,$aBorder); + } + + function _Skew3D($aGdImg,$aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) { + if( $aDir == SKEW3D_DOWN || $aDir == SKEW3D_UP ) + return $this->_TransVert3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder); + else + return $this->_TransHor3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder); + + } + +} + + +?> diff --git a/includes/jpgraph/src/jpgraph_led.php b/includes/jpgraph/src/jpgraph_led.php new file mode 100644 index 0000000..92b136d --- /dev/null +++ b/includes/jpgraph/src/jpgraph_led.php @@ -0,0 +1,311 @@ + array('red','darkred:0.9','red:0.3'),// 0 + LEDC_GREEN => array('green','darkgreen','green:0.3'),// 1 + LEDC_BLUE => array('lightblue:0.9','darkblue:0.85','darkblue:0.7'),// 2 + LEDC_YELLOW => array('yellow','yellow:0.4','yellow:0.3'),// 3 + LEDC_GRAY => array('gray:1.4','darkgray:0.85','darkgray:0.7'), + LEDC_CHOCOLATE => array('chocolate','chocolate:0.7','chocolate:0.5'), + LEDC_PERU => array('peru:0.95','peru:0.6','peru:0.5'), + LEDC_GOLDENROD => array('goldenrod','goldenrod:0.6','goldenrod:0.5'), + LEDC_KHAKI => array('khaki:0.7','khaki:0.4','khaki:0.3'), + LEDC_OLIVE => array('#808000','#808000:0.7','#808000:0.6'), + LEDC_LIMEGREEN => array('limegreen:0.9','limegreen:0.5','limegreen:0.4'), + LEDC_FORESTGREEN => array('forestgreen','forestgreen:0.7','forestgreen:0.5'), + LEDC_TEAL => array('teal','teal:0.7','teal:0.5'), + LEDC_STEELBLUE => array('steelblue','steelblue:0.65','steelblue:0.5'), + LEDC_NAVY => array('navy:1.3','navy:0.95','navy:0.8'),//14 + LEDC_INVERTGRAY => array('darkgray','lightgray:1.5','white')//15 + ), + + /* Each line of the character is encoded as a 4 bit value + 0 ____ + 1 ___x + 2 __x_ + 3 __xx + 4 _x__ + 5 _x_x + 6 _xx_ + 7 _xxx + 8 x___ + 9 x__x + 10 x_x_ + 11 x_xx + 12 xx__ + 13 xx_x + 14 xxx_ + 15 xxxx + */ + + $iLEDSpec = array( + 0 => array(6,9,11,15,13,9,6), + 1 => array(2,6,10,2,2,2,2), + 2 => array(6,9,1,2,4,8,15), + 3 => array(6,9,1,6,1,9,6), + 4 => array(1,3,5,9,15,1,1), + 5 => array(15,8,8,14,1,9,6), + 6 => array(6,8,8,14,9,9,6), + 7 => array(15,1,1,2,4,4,4), + 8 => array(6,9,9,6,9,9,6), + 9 => array(6,9,9,7,1,1,6), + '!' => array(4,4,4,4,4,0,4), + '?' => array(6,9,1,2,2,0,2), + '#' => array(0,9,15,9,15,9,0), + '@' => array(6,9,11,11,10,9,6), + '-' => array(0,0,0,15,0,0,0), + '_' => array(0,0,0,0,0,0,15), + '=' => array(0,0,15,0,15,0,0), + '+' => array(0,0,4,14,4,0,0), + '|' => array(4,4,4,4,4,4,4), //vertical line, used for simulate rus 'Ы' + ',' => array(0,0,0,0,0,12,4), + '.' => array(0,0,0,0,0,12,12), + ':' => array(12,12,0,0,0,12,12), + ';' => array(12,12,0,0,0,12,4), + '[' => array(3,2,2,2,2,2,3), + ']' => array(12,4,4,4,4,4,12), + '(' => array(1,2,2,2,2,2,1), + ')' => array(8,4,4,4,4,4,8), + '{' => array(3,2,2,6,2,2,3), + '}' => array(12,4,4,6,4,4,12), + '<' => array(1,2,4,8,4,2,1), + '>' => array(8,4,2,1,2,4,8), + '*' => array(9,6,15,6,9,0,0), + '"' => array(10,10,0,0,0,0,0), + '\'' => array(4,4,0,0,0,0,0), + '`' => array(4,2,0,0,0,0,0), + '~' => array(13,11,0,0,0,0,0), + '^' => array(4,10,0,0,0,0,0), + '\\' => array(8,8,4,6,2,1,1), + '/' => array(1,1,2,6,4,8,8), + '%' => array(1,9,2,6,4,9,8), + '&' => array(0,4,10,4,11,10,5), + '$' => array(2,7,8,6,1,14,4), + ' ' => array(0,0,0,0,0,0,0), + '•' => array(0,0,6,6,0,0,0), //149 + '°' => array(14,10,14,0,0,0,0), //176 + '†' => array(4,4,14,4,4,4,4), //134 + '‡' => array(4,4,14,4,14,4,4), //135 + '±' => array(0,4,14,4,0,14,0), //177 + '‰' => array(0,4,2,15,2,4,0), //137 show right arrow + '™' => array(0,2,4,15,4,2,0), //156 show left arrow + 'Ў' => array(0,0,8,8,0,0,0), //159 show small hi-stick - that need for simulate rus 'Ф' + "\t" => array(8,8,8,0,0,0,0), //show hi-stick - that need for simulate rus 'У' + "\r" => array(8,8,8,8,8,8,8), //vertical line - that need for simulate 'M', 'W' and rus 'М','Ш' ,'Щ' + "\n" => array(15,15,15,15,15,15,15), //fill up - that need for simulate rus 'Ж' + "Ґ" => array(10,5,10,5,10,5,10), //chess + "µ" => array(15,0,15,0,15,0,15), //4 horizontal lines + // latin + 'A' => array(6,9,9,15,9,9,9), + 'B' => array(14,9,9,14,9,9,14), + 'C' => array(6,9,8,8,8,9,6), + 'D' => array(14,9,9,9,9,9,14), + 'E' => array(15,8,8,14,8,8,15), + 'F' => array(15,8,8,14,8,8,8), + 'G' => array(6,9,8,8,11,9,6), + 'H' => array(9,9,9,15,9,9,9), + 'I' => array(14,4,4,4,4,4,14), + 'J' => array(15,1,1,1,1,9,6), + 'K' => array(8,9,10,12,12,10,9), + 'L' => array(8,8,8,8,8,8,15), + 'M' => array(8,13,10,8,8,8,8),// need to add \r + 'N' => array(9,9,13,11,9,9,9), + 'O' => array(6,9,9,9,9,9,6), + 'P' => array(14,9,9,14,8,8,8), + 'Q' => array(6,9,9,9,13,11,6), + 'R' => array(14,9,9,14,12,10,9), + 'S' => array(6,9,8,6,1,9,6), + 'T' => array(14,4,4,4,4,4,4), + 'U' => array(9,9,9,9,9,9,6), + 'V' => array(0,0,0,10,10,10,4), + 'W' => array(8,8,8,8,10,13,8),// need to add \r + 'X' => array(9,9,6,6,6,9,9), + 'Y' => array(10,10,10,10,4,4,4), + 'Z' => array(15,1,2,6,4,8,15), + // russian utf-8 + 'А' => array(6,9,9,15,9,9,9), + 'Б' => array(14,8,8,14,9,9,14), + 'В' => array(14,9,9,14,9,9,14), + 'Г' => array(15,8,8,8,8,8,8), + 'Д' => array(14,9,9,9,9,9,14), + 'Е' => array(15,8,8,14,8,8,15), + 'Ё' => array(6,15,8,14,8,8,15), + //Ж is combine: >\n< + 'З' => array(6,9,1,2,1,9,6), + 'И' => array(9,9,9,11,13,9,9), + 'Й' => array(13,9,9,11,13,9,9), + 'К' => array(9,10,12,10,9,9,9), + 'Л' => array(7,9,9,9,9,9,9), + 'М' => array(8,13,10,8,8,8,8),// need to add \r + 'Н' => array(9,9,9,15,9,9,9), + 'О' => array(6,9,9,9,9,9,6), + 'П' => array(15,9,9,9,9,9,9), + 'Р' => array(14,9,9,14,8,8,8), + 'С' => array(6,9,8,8,8,9,6), + 'Т' => array(14,4,4,4,4,4,4), + 'У' => array(9,9,9,7,1,9,6), + 'Ф' => array(2,7,10,10,7,2,2),// need to add Ў + 'Х' => array(9,9,6,6,6,9,9), + 'Ц' => array(10,10,10,10,10,15,1), + 'Ч' => array(9,9,9,7,1,1,1), + 'Ш' => array(10,10,10,10,10,10,15),// \r + 'Щ' => array(10,10,10,10,10,15,0),// need to add \r + 'Ъ' => array(12,4,4,6,5,5,6), + 'Ы' => array(8,8,8,14,9,9,14),// need to add | + 'Ь' => array(8,8,8,14,9,9,14), + 'Э' => array(6,9,1,7,1,9,6), + 'Ю' => array(2,2,2,3,2,2,2),// need to add O + 'Я' => array(7,9,9,7,3,5,9) + ), + + $iSuperSampling = 3, $iMarg = 1, $iRad = 4; + + function __construct($aRadius = 2, $aMargin= 0.6) { + $this->iRad = $aRadius; + $this->iMarg = $aMargin; + } + + function SetSupersampling($aSuperSampling = 2) { + $this->iSuperSampling = $aSuperSampling; + } + + function _GetLED($aLedIdx, $aColor = 0) { + $width= $this->iLED_X*$this->iRad*2 + ($this->iLED_X+1)*$this->iMarg + $this->iRad ; + $height= $this->iLED_Y*$this->iRad*2 + ($this->iLED_Y)*$this->iMarg + $this->iRad * 2; + + // Adjust radious for supersampling + $rad = $this->iRad * $this->iSuperSampling; + + // Margin in between "Led" dots + $marg = $this->iMarg * $this->iSuperSampling; + + $swidth = $width*$this->iSuperSampling; + $sheight = $height*$this->iSuperSampling; + + $simg = new RotImage($swidth, $sheight, 0, DEFAULT_GFORMAT, false); + $simg->SetColor($this->iColorSchema[$aColor][2]); + $simg->FilledRectangle(0, 0, $swidth-1, $sheight-1); + + if( array_key_exists($aLedIdx, $this->iLEDSpec) ) { + $d = $this->iLEDSpec[$aLedIdx]; + } + else { + $d = array(0,0,0,0,0,0,0); + } + + for($r = 0; $r < 7; ++$r) { + $dr = $d[$r]; + for($c = 0; $c < 4; ++$c) { + if( ($dr & pow(2,3-$c)) !== 0 ) { + $color = $this->iColorSchema[$aColor][0]; + } + else { + $color = $this->iColorSchema[$aColor][1]; + } + + $x = 2*$rad*$c+$rad + ($c+1)*$marg + $rad ; + $y = 2*$rad*$r+$rad + ($r+1)*$marg + $rad ; + + $simg->SetColor($color); + $simg->FilledCircle($x,$y,$rad); + } + } + + $img = new Image($width, $height, DEFAULT_GFORMAT, false); + $img->Copy($simg->img, 0, 0, 0, 0, $width, $height, $swidth, $sheight); + $simg->Destroy(); + unset($simg); + return $img; + } + + + function Stroke($aValStr, $aColor = 0, $aFileName = '') { + $this->StrokeNumber($aValStr, $aColor, $aFileName); + } + + + function StrokeNumber($aValStr, $aColor = 0, $aFileName = '') { + if( $aColor < 0 || $aColor >= sizeof($this->iColorSchema) ) { + $aColor = 0; + } + + if(($n = mb_strlen($aValStr,'utf8')) == 0) { + $aValStr = ' '; + $n = 1; + } + + for($i = 0; $i < $n; ++$i) { + $d = mb_substr($aValStr, $i, 1, 'utf8'); + if( ctype_digit($d) ) { + $d = (int)$d; + } + else { + $d = strtoupper($d); + } + $digit_img[$i] = $this->_GetLED($d, $aColor); + } + + $w = imagesx($digit_img[0]->img); + $h = imagesy($digit_img[0]->img); + + $number_img = new Image($w*$n, $h, DEFAULT_GFORMAT, false); + + for($i = 0; $i < $n; ++$i) { + $number_img->Copy($digit_img[$i]->img, $i*$w, 0, 0, 0, $w, $h, $w, $h); + } + + if( $aFileName != '' ) { + $number_img->Stream($aFileName); + } else { + $number_img->Headers(); + $number_img->Stream(); + } + } +} +?> diff --git a/includes/jpgraph/src/jpgraph_legend.inc.php b/includes/jpgraph/src/jpgraph_legend.inc.php new file mode 100644 index 0000000..893ff70 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_legend.inc.php @@ -0,0 +1,494 @@ +hide=$aHide; + } + + function SetHColMargin($aXMarg) { + $this->xmargin = $aXMarg; + } + + function SetVColMargin($aSpacing) { + $this->ylinespacing = $aSpacing ; + } + + function SetLeftMargin($aXMarg) { + $this->xlmargin = $aXMarg; + } + + // Synonym + function SetLineSpacing($aSpacing) { + $this->ylinespacing = $aSpacing ; + } + + function SetShadow($aShow='gray',$aWidth=4) { + if( is_string($aShow) ) { + $this->shadow_color = $aShow; + $this->shadow=true; + } + else { + $this->shadow = $aShow; + } + $this->shadow_width = $aWidth; + } + + function SetMarkAbsSize($aSize) { + $this->mark_abs_vsize = $aSize ; + $this->mark_abs_hsize = $aSize ; + } + + function SetMarkAbsVSize($aSize) { + $this->mark_abs_vsize = $aSize ; + } + + function SetMarkAbsHSize($aSize) { + $this->mark_abs_hsize = $aSize ; + } + + function SetLineWeight($aWeight) { + $this->weight = $aWeight; + } + + function SetFrameWeight($aWeight) { + $this->frameweight = $aWeight; + } + + function SetLayout($aDirection=LEGEND_VERT) { + $this->layout_n = $aDirection==LEGEND_VERT ? 1 : 99 ; + } + + function SetColumns($aCols) { + $this->layout_n = $aCols ; + } + + function SetReverse($f=true) { + $this->reverse = $f ; + } + + // Set color on frame around box + function SetColor($aFontColor,$aColor='black') { + $this->font_color=$aFontColor; + $this->color=$aColor; + } + + function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { + $this->font_family = $aFamily; + $this->font_style = $aStyle; + $this->font_size = $aSize; + } + + function SetPos($aX,$aY,$aHAlign='right',$aVAlign='top') { + $this->Pos($aX,$aY,$aHAlign,$aVAlign); + } + + function SetAbsPos($aX,$aY,$aHAlign='right',$aVAlign='top') { + $this->xabspos=$aX; + $this->yabspos=$aY; + $this->halign=$aHAlign; + $this->valign=$aVAlign; + } + + function Pos($aX,$aY,$aHAlign='right',$aVAlign='top') { + if( !($aX<1 && $aY<1) ) { + JpGraphError::RaiseL(25120);//(" Position for legend must be given as percentage in range 0-1"); + } + $this->xpos=$aX; + $this->ypos=$aY; + $this->halign=$aHAlign; + $this->valign=$aVAlign; + } + + function SetFillColor($aColor) { + $this->fill_color=$aColor; + } + + function Clear() { + $this->txtcol = array(); + } + + function Add($aTxt,$aColor,$aPlotmark='',$aLinestyle=0,$csimtarget='',$csimalt='',$csimwintarget='') { + $this->txtcol[]=array($aTxt,$aColor,$aPlotmark,$aLinestyle,$csimtarget,$csimalt,$csimwintarget); + } + + function GetCSIMAreas() { + return $this->csimareas; + } + + function SetBackgroundGradient($aFrom='navy',$aTo='silver',$aGradType=2) { + $this->bkg_gradtype=$aGradType; + $this->bkg_gradfrom = $aFrom; + $this->bkg_gradto = $aTo; + } + + function HasItems() { + return (boolean)(count($this->txtcol)); + } + + function Stroke($aImg) { + // Constant + $fillBoxFrameWeight=1; + + if( $this->hide ) return; + + $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); + + if( $this->reverse ) { + $this->txtcol = array_reverse($this->txtcol); + } + + $n=count($this->txtcol); + if( $n == 0 ) return; + + // Find out the max width and height of each column to be able + // to size the legend box. + $numcolumns = ($n > $this->layout_n ? $this->layout_n : $n); + for( $i=0; $i < $numcolumns; ++$i ) { + $colwidth[$i] = $aImg->GetTextWidth($this->txtcol[$i][0]) + + 2*$this->xmargin + 2*$this->mark_abs_hsize; + $colheight[$i] = 0; + + } + + // Find our maximum height in each row + $rows = 0 ; $rowheight[0] = 0; + for( $i=0; $i < $n; ++$i ) { + $h = max($this->mark_abs_vsize,$aImg->GetTextHeight($this->txtcol[$i][0]))+$this->ylinespacing; + + // Makes sure we always have a minimum of 1/4 (1/2 on each side) of the mark as space + // between two vertical legend entries + //$h = round(max($h,$this->mark_abs_vsize+$this->ymargin)); + //echo "Textheight #$i: tetxheight=".$aImg->GetTextHeight($this->txtcol[$i][0]).', '; + //echo "h=$h ({$this->mark_abs_vsize},{$this->ymargin})
"; + if( $i % $numcolumns == 0 ) { + $rows++; + $rowheight[$rows-1] = 0; + } + $rowheight[$rows-1] = max($rowheight[$rows-1],$h)+1; + } + + $abs_height = 0; + for( $i=0; $i < $rows; ++$i ) { + $abs_height += $rowheight[$i] ; + } + + // Make sure that the height is at least as high as mark size + ymargin + $abs_height = max($abs_height,$this->mark_abs_vsize); + $abs_height += $this->ybottom_margin; + + // Find out the maximum width in each column + for( $i=$numcolumns; $i < $n; ++$i ) { + $colwidth[$i % $numcolumns] = max( + $aImg->GetTextWidth($this->txtcol[$i][0])+2*$this->xmargin+2*$this->mark_abs_hsize, + $colwidth[$i % $numcolumns]); + } + + // Get the total width + $mtw = 0; + for( $i=0; $i < $numcolumns; ++$i ) { + $mtw += $colwidth[$i] ; + } + + // remove the last rows interpace margin (since there is no next row) + $abs_height -= $this->ylinespacing; + + + // Find out maximum width we need for legend box + $abs_width = $mtw+$this->xlmargin+($numcolumns-1)*$this->mark_abs_hsize; + + if( $this->xabspos === -1 && $this->yabspos === -1 ) { + $this->xabspos = $this->xpos*$aImg->width ; + $this->yabspos = $this->ypos*$aImg->height ; + } + + // Positioning of the legend box + if( $this->halign == 'left' ) { + $xp = $this->xabspos; + } + elseif( $this->halign == 'center' ) { + $xp = $this->xabspos - $abs_width/2; + } + else { + $xp = $aImg->width - $this->xabspos - $abs_width; + } + + $yp=$this->yabspos; + if( $this->valign == 'center' ) { + $yp-=$abs_height/2; + } + elseif( $this->valign == 'bottom' ) { + $yp-=$abs_height; + } + + // Stroke legend box + $aImg->SetColor($this->color); + $aImg->SetLineWeight($this->frameweight); + $aImg->SetLineStyle('solid'); + + if( $this->shadow ) { + $aImg->ShadowRectangle($xp,$yp, + $xp+$abs_width+$this->shadow_width+2, + $yp+$abs_height+$this->shadow_width+2, + $this->fill_color,$this->shadow_width+2,$this->shadow_color); + } + else { + $aImg->SetColor($this->fill_color); + $aImg->FilledRectangle($xp,$yp,$xp+$abs_width,$yp+$abs_height); + $aImg->SetColor($this->color); + $aImg->Rectangle($xp,$yp,$xp+$abs_width,$yp+$abs_height); + } + + if( $this->bkg_gradtype >= 0 ) { + $grad = new Gradient($aImg); + $grad->FilledRectangle($xp+1, $yp+1, + $xp+$abs_width-3, $yp+$abs_height-3, + $this->bkg_gradfrom, $this->bkg_gradto, + $this->bkg_gradtype); + } + + // x1,y1 is the position for the legend marker + text + // The vertical position is the baseline position for the text + // and every marker is adjusted acording to that. + + // For multiline texts this get more complicated. + + $x1 = $xp + $this->xlmargin; + $y1 = $yp + $rowheight[0] - $this->ylinespacing + 2 ; // The ymargin is included in rowheight + + // Now, y1 is the bottom vertical position of the first legend, i.e if + // the legend has multiple lines it is the bottom line. + + $grad = new Gradient($aImg); + $patternFactory = null; + + // Now stroke each legend in turn + // Each plot has added the following information to the legend + // p[0] = Legend text + // p[1] = Color, + // p[2] = For markers a reference to the PlotMark object + // p[3] = For lines the line style, for gradient the negative gradient style + // p[4] = CSIM target + // p[5] = CSIM Alt text + $i = 1 ; $row = 0; + foreach($this->txtcol as $p) { + + // STROKE DEBUG BOX + if( _JPG_DEBUG ) { + $aImg->SetLineWeight(1); + $aImg->SetColor('red'); + $aImg->SetLineStyle('solid'); + $aImg->Rectangle($x1,$y1,$xp+$abs_width-1,$y1-$rowheight[$row]); + } + + $aImg->SetLineWeight($this->weight); + $x1 = round($x1)+1; // We add one to not collide with the border + $y1=round($y1); + + // This is the center offset up from the baseline which is + // considered the "center" of the marks. This gets slightly complicated since + // we need to consider if the text is a multiline paragraph or if it is only + // a single line. The reason is that for single line the y1 corresponds to the baseline + // and that is fine. However for a multiline paragraph there is no single baseline + // and in that case the y1 corresponds to the lowest y for the bounding box. In that + // case we center the mark in the middle of the paragraph + if( !preg_match('/\n/',$p[0]) ) { + // Single line + $marky = ceil($y1-$this->mark_abs_vsize/2)-1; + } else { + // Paragraph + $marky = $y1 - $aImg->GetTextHeight($p[0])/2; + + // echo "y1=$y1, p[o]={$p[0]}, marky=$marky
"; + } + + //echo "
Mark #$i: marky=$marky
"; + + $x1 += $this->mark_abs_hsize; + + if ( !empty($p[2]) && $p[2]->GetType() > -1 ) { + + + // Make a plot mark legend. This is constructed with a mark which + // is run through with a line + + // First construct a bit of the line that looks exactly like the + // line in the plot + $aImg->SetColor($p[1]); + if( is_string($p[3]) || $p[3]>0 ) { + $aImg->SetLineStyle($p[3]); + $aImg->StyleLine($x1-$this->mark_abs_hsize,$marky,$x1+$this->mark_abs_hsize,$marky); + } + + // Stroke a mark using image + if( $p[2]->GetType() == MARK_IMG ) { + $p[2]->Stroke($aImg,$x1,$marky); + } + + // Stroke a mark with the standard size + // (As long as it is not an image mark ) + if( $p[2]->GetType() != MARK_IMG ) { + + // Clear any user callbacks since we ont want them called for + // the legend marks + $p[2]->iFormatCallback = ''; + $p[2]->iFormatCallback2 = ''; + + // Since size for circles is specified as the radius + // this means that we must half the size to make the total + // width behave as the other marks + if( $p[2]->GetType() == MARK_FILLEDCIRCLE || $p[2]->GetType() == MARK_CIRCLE ) { + $p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize)/2); + $p[2]->Stroke($aImg,$x1,$marky); + } + else { + $p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize)); + $p[2]->Stroke($aImg,$x1,$marky); + } + } + } + elseif ( !empty($p[2]) && (is_string($p[3]) || $p[3]>0 ) ) { + // Draw a styled line + $aImg->SetColor($p[1]); + $aImg->SetLineStyle($p[3]); + $aImg->StyleLine($x1-$this->mark_abs_hsize,$marky,$x1+$this->mark_abs_hsize,$marky); + $aImg->StyleLine($x1-$this->mark_abs_hsize,$marky+1,$x1+$this->mark_abs_hsize,$marky+1); + } + else { + // Draw a colored box + $color = $p[1] ; + + // We make boxes slightly larger to better show + $boxsize = max($this->mark_abs_vsize,$this->mark_abs_hsize) + 2 ; + + $ym = $marky-ceil($boxsize/2) ; // Marker y-coordinate + + // We either need to plot a gradient or a + // pattern. To differentiate we use a kludge. + // Patterns have a p[3] value of < -100 + if( $p[3] < -100 ) { + // p[1][0] == iPattern, p[1][1] == iPatternColor, p[1][2] == iPatternDensity + if( $patternFactory == null ) { + $patternFactory = new RectPatternFactory(); + } + $prect = $patternFactory->Create($p[1][0],$p[1][1],1); + $prect->SetBackground($p[1][3]); + $prect->SetDensity($p[1][2]+1); + $prect->SetPos(new Rectangle($x1,$ym,$boxsize,$boxsize)); + $prect->Stroke($aImg); + $prect=null; + } + else { + if( is_array($color) && count($color)==2 ) { + // The client want a gradient color + $grad->FilledRectangle($x1-$boxsize/2,$ym, + $x1+$boxsize/2,$ym+$boxsize, + $color[0],$color[1],-$p[3]); + } + else { + $aImg->SetColor($p[1]); + $aImg->FilledRectangle($x1-$boxsize/2,$ym, $x1+$boxsize/2,$ym+$boxsize); + } + + // Draw a plot frame line + $aImg->SetColor($this->color); + $aImg->SetLineWeight($fillBoxFrameWeight); + $aImg->Rectangle($x1-$boxsize/2,$ym, + $x1+$boxsize/2,$ym+$boxsize); + } + } + $aImg->SetColor($this->font_color); + $aImg->SetFont($this->font_family,$this->font_style,$this->font_size); + $aImg->SetTextAlign('left','baseline'); + + $debug=false; + $aImg->StrokeText($x1+$this->mark_abs_hsize+$this->xmargin,$y1,$p[0], + 0,'left',$debug); + + // Add CSIM for Legend if defined + if( !empty($p[4]) ) { + + $xs = $x1 - $this->mark_abs_hsize ; + $ys = $y1 + 1 ; + $xe = $x1 + $aImg->GetTextWidth($p[0]) + $this->mark_abs_hsize + $this->xmargin ; + $ye = $y1-$rowheight[$row]+1; + $coords = "$xs,$ys,$xe,$y1,$xe,$ye,$xs,$ye"; + if( ! empty($p[4]) ) { + $this->csimareas .= "csimareas .= " target=\"".$p[6]."\""; + } + + if( !empty($p[5]) ) { + $tmp=sprintf($p[5],$p[0]); + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + } + + if( $i >= $this->layout_n ) { + $x1 = $xp+$this->xlmargin; + $row++; + if( !empty($rowheight[$row]) ) + $y1 += $rowheight[$row]; + $i = 1; + } + else { + $x1 += $colwidth[($i-1) % $numcolumns] ; + ++$i; + } + } + } +} // Class + +?> diff --git a/includes/jpgraph/src/jpgraph_line.php b/includes/jpgraph/src/jpgraph_line.php new file mode 100644 index 0000000..04d77b3 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_line.php @@ -0,0 +1,682 @@ +mark = new PlotMark() ; + $this->color = ColorFactory::getColor(); + $this->fill_color = $this->color; + } + //--------------- + // PUBLIC METHODS + + function SetFilled($aFlg=true) { + $this->filled = $aFlg; + } + + function SetBarCenter($aFlag=true) { + $this->barcenter=$aFlag; + } + + function SetStyle($aStyle) { + $this->line_style=$aStyle; + } + + function SetStepStyle($aFlag=true) { + $this->step_style = $aFlag; + } + + function SetColor($aColor) { + parent::SetColor($aColor); + } + + function SetFillFromYMin($f=true) { + $this->fillFromMin = $f ; + } + + function SetFillFromYMax($f=true) { + $this->fillFromMax = $f ; + } + + function SetFillColor($aColor,$aFilled=true) { + //$this->color = $aColor; + $this->fill_color=$aColor; + $this->filled=$aFilled; + } + + function SetFillGradient($aFromColor,$aToColor,$aNumColors=100,$aFilled=true) { + $this->fillgrad_fromcolor = $aFromColor; + $this->fillgrad_tocolor = $aToColor; + $this->fillgrad_numcolors = $aNumColors; + $this->filled = $aFilled; + $this->fillgrad = true; + } + + function Legend($graph) { + if( $this->legend!="" ) { + if( $this->filled && !$this->fillgrad ) { + $graph->legend->Add($this->legend, + $this->fill_color,$this->mark,0, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + elseif( $this->fillgrad ) { + $color=array($this->fillgrad_fromcolor,$this->fillgrad_tocolor); + // In order to differentiate between gradients and cooors specified as an RGB triple + $graph->legend->Add($this->legend,$color,"",-2 /* -GRAD_HOR */, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } else { + $graph->legend->Add($this->legend, + $this->color,$this->mark,$this->line_style, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + } + } + + function AddArea($aMin=0,$aMax=0,$aFilled=LP_AREA_NOT_FILLED,$aColor="gray9",$aBorder=LP_AREA_BORDER) { + if($aMin > $aMax) { + // swap + $tmp = $aMin; + $aMin = $aMax; + $aMax = $tmp; + } + $this->filledAreas[] = array($aMin,$aMax,$aColor,$aFilled,$aBorder); + } + + // Gets called before any axis are stroked + function PreStrokeAdjust($graph) { + + // If another plot type have already adjusted the + // offset we don't touch it. + // (We check for empty in case the scale is a log scale + // and hence doesn't contain any xlabel_offset) + if( empty($graph->xaxis->scale->ticks->xlabel_offset) || $graph->xaxis->scale->ticks->xlabel_offset == 0 ) { + if( $this->center ) { + ++$this->numpoints; + $a=0.5; $b=0.5; + } else { + $a=0; $b=0; + } + $graph->xaxis->scale->ticks->SetXLabelOffset($a); + $graph->SetTextScaleOff($b); + //$graph->xaxis->scale->ticks->SupressMinorTickMarks(); + } + } + + function SetFastStroke($aFlg=true) { + $this->iFastStroke = $aFlg; + } + + function FastStroke($img,$xscale,$yscale,$aStartPoint=0,$exist_x=true) { + // An optimized stroke for many data points with no extra + // features but 60% faster. You can't have values or line styles, or null + // values in plots. + $numpoints=count($this->coords[0]); + if( $this->barcenter ) { + $textadj = 0.5-$xscale->text_scale_off; + } + else { + $textadj = 0; + } + + $img->SetColor($this->color); + $img->SetLineWeight($this->weight); + $pnts=$aStartPoint; + while( $pnts < $numpoints ) { + if( $exist_x ) { + $x=$this->coords[1][$pnts]; + } + else { + $x=$pnts+$textadj; + } + $xt = $xscale->Translate($x); + $y=$this->coords[0][$pnts]; + $yt = $yscale->Translate($y); + if( is_numeric($y) ) { + $cord[] = $xt; + $cord[] = $yt; + } + elseif( $y == '-' && $pnts > 0 ) { + // Just ignore + } + else { + JpGraphError::RaiseL(10002);//('Plot too complicated for fast line Stroke. Use standard Stroke()'); + } + ++$pnts; + } // WHILE + + $img->Polygon($cord,false,true); + } + + function Stroke($img,$xscale,$yscale) { + $idx=0; + $numpoints=count($this->coords[0]); + if( isset($this->coords[1]) ) { + if( count($this->coords[1])!=$numpoints ) { + JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); + //("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); + } + else { + $exist_x = true; + } + } + else { + $exist_x = false; + } + + if( $this->barcenter ) { + $textadj = 0.5-$xscale->text_scale_off; + } + else { + $textadj = 0; + } + + // Find the first numeric data point + $startpoint=0; + while( $startpoint < $numpoints && !is_numeric($this->coords[0][$startpoint]) ) { + ++$startpoint; + } + + // Bail out if no data points + if( $startpoint == $numpoints ) return; + + if( $this->iFastStroke ) { + $this->FastStroke($img,$xscale,$yscale,$startpoint,$exist_x); + return; + } + + if( $exist_x ) { + $xs=$this->coords[1][$startpoint]; + } + else { + $xs= $textadj+$startpoint; + } + + $img->SetStartPoint($xscale->Translate($xs), + $yscale->Translate($this->coords[0][$startpoint])); + + if( $this->filled ) { + if( $this->fillFromMax ) { + //$max = $yscale->GetMaxVal(); + $cord[$idx++] = $xscale->Translate($xs); + $cord[$idx++] = $yscale->scale_abs[1]; + } + else { + $min = $yscale->GetMinVal(); + if( $min > 0 || $this->fillFromMin ) { + $fillmin = $yscale->scale_abs[0];//Translate($min); + } + else { + $fillmin = $yscale->Translate(0); + } + + $cord[$idx++] = $xscale->Translate($xs); + $cord[$idx++] = $fillmin; + } + } + $xt = $xscale->Translate($xs); + $yt = $yscale->Translate($this->coords[0][$startpoint]); + $cord[$idx++] = $xt; + $cord[$idx++] = $yt; + $yt_old = $yt; + $xt_old = $xt; + $y_old = $this->coords[0][$startpoint]; + + $this->value->Stroke($img,$this->coords[0][$startpoint],$xt,$yt); + + $img->SetColor($this->color); + $img->SetLineWeight($this->weight); + $img->SetLineStyle($this->line_style); + $pnts=$startpoint+1; + $firstnonumeric = false; + + + while( $pnts < $numpoints ) { + + if( $exist_x ) { + $x=$this->coords[1][$pnts]; + } + else { + $x=$pnts+$textadj; + } + $xt = $xscale->Translate($x); + $yt = $yscale->Translate($this->coords[0][$pnts]); + + $y=$this->coords[0][$pnts]; + if( $this->step_style ) { + // To handle null values within step style we need to record the + // first non numeric value so we know from where to start if the + // non value is '-'. + if( is_numeric($y) ) { + $firstnonumeric = false; + if( is_numeric($y_old) ) { + $img->StyleLine($xt_old,$yt_old,$xt,$yt_old); + $img->StyleLine($xt,$yt_old,$xt,$yt); + } + elseif( $y_old == '-' ) { + $img->StyleLine($xt_first,$yt_first,$xt,$yt_first); + $img->StyleLine($xt,$yt_first,$xt,$yt); + } + else { + $yt_old = $yt; + $xt_old = $xt; + } + $cord[$idx++] = $xt; + $cord[$idx++] = $yt_old; + $cord[$idx++] = $xt; + $cord[$idx++] = $yt; + } + elseif( $firstnonumeric==false ) { + $firstnonumeric = true; + $yt_first = $yt_old; + $xt_first = $xt_old; + } + } + else { + $tmp1=$y; + $prev=$this->coords[0][$pnts-1]; + if( $tmp1==='' || $tmp1===NULL || $tmp1==='X' ) $tmp1 = 'x'; + if( $prev==='' || $prev===null || $prev==='X' ) $prev = 'x'; + + if( is_numeric($y) || (is_string($y) && $y != '-') ) { + if( is_numeric($y) && (is_numeric($prev) || $prev === '-' ) ) { + $img->StyleLineTo($xt,$yt); + } + else { + $img->SetStartPoint($xt,$yt); + } + } + if( $this->filled && $tmp1 !== '-' ) { + if( $tmp1 === 'x' ) { + $cord[$idx++] = $cord[$idx-3]; + $cord[$idx++] = $fillmin; + } + elseif( $prev === 'x' ) { + $cord[$idx++] = $xt; + $cord[$idx++] = $fillmin; + $cord[$idx++] = $xt; + $cord[$idx++] = $yt; + } + else { + $cord[$idx++] = $xt; + $cord[$idx++] = $yt; + } + } + else { + if( is_numeric($tmp1) && (is_numeric($prev) || $prev === '-' ) ) { + $cord[$idx++] = $xt; + $cord[$idx++] = $yt; + } + } + } + $yt_old = $yt; + $xt_old = $xt; + $y_old = $y; + + $this->StrokeDataValue($img,$this->coords[0][$pnts],$xt,$yt); + + ++$pnts; + } + + if( $this->filled ) { + $cord[$idx++] = $xt; + if( $this->fillFromMax ) { + $cord[$idx++] = $yscale->scale_abs[1]; + } + else { + if( $min > 0 || $this->fillFromMin ) { + $cord[$idx++] = $yscale->Translate($min); + } + else { + $cord[$idx++] = $yscale->Translate(0); + } + } + if( $this->fillgrad ) { + $img->SetLineWeight(1); + $grad = new Gradient($img); + $grad->SetNumColors($this->fillgrad_numcolors); + $grad->FilledFlatPolygon($cord,$this->fillgrad_fromcolor,$this->fillgrad_tocolor); + $img->SetLineWeight($this->weight); + } + else { + $img->SetColor($this->fill_color); + $img->FilledPolygon($cord); + } + if( $this->weight > 0 ) { + $img->SetLineWeight($this->weight); + $img->SetColor($this->color); + // Remove first and last coordinate before drawing the line + // sine we otherwise get the vertical start and end lines which + // doesn't look appropriate + $img->Polygon(array_slice($cord,2,count($cord)-4)); + } + } + + if(!empty($this->filledAreas)) { + + $minY = $yscale->Translate($yscale->GetMinVal()); + $factor = ($this->step_style ? 4 : 2); + + for($i = 0; $i < sizeof($this->filledAreas); ++$i) { + // go through all filled area elements ordered by insertion + // fill polygon array + $areaCoords[] = $cord[$this->filledAreas[$i][0] * $factor]; + $areaCoords[] = $minY; + + $areaCoords = + array_merge($areaCoords, + array_slice($cord, + $this->filledAreas[$i][0] * $factor, + ($this->filledAreas[$i][1] - $this->filledAreas[$i][0] + ($this->step_style ? 0 : 1)) * $factor)); + $areaCoords[] = $areaCoords[sizeof($areaCoords)-2]; // last x + $areaCoords[] = $minY; // last y + + if($this->filledAreas[$i][3]) { + $img->SetColor($this->filledAreas[$i][2]); + $img->FilledPolygon($areaCoords); + $img->SetColor($this->color); + } + // Check if we should draw the frame. + // If not we still re-draw the line since it might have been + // partially overwritten by the filled area and it doesn't look + // very good. + if( $this->filledAreas[$i][4] ) { + $img->Polygon($areaCoords); + } + else { + $img->Polygon($cord); + } + + $areaCoords = array(); + } + } + + if( $this->mark->type == -1 || $this->mark->show == false ) + return; + + for( $pnts=0; $pnts<$numpoints; ++$pnts) { + + if( $exist_x ) { + $x=$this->coords[1][$pnts]; + } + else { + $x=$pnts+$textadj; + } + $xt = $xscale->Translate($x); + $yt = $yscale->Translate($this->coords[0][$pnts]); + + if( is_numeric($this->coords[0][$pnts]) ) { + if( !empty($this->csimtargets[$pnts]) ) { + if( !empty($this->csimwintargets[$pnts]) ) { + $this->mark->SetCSIMTarget($this->csimtargets[$pnts],$this->csimwintargets[$pnts]); + } + else { + $this->mark->SetCSIMTarget($this->csimtargets[$pnts]); + } + $this->mark->SetCSIMAlt($this->csimalts[$pnts]); + } + if( $exist_x ) { + $x=$this->coords[1][$pnts]; + } + else { + $x=$pnts; + } + $this->mark->SetCSIMAltVal($this->coords[0][$pnts],$x); + $this->mark->Stroke($img,$xt,$yt); + $this->csimareas .= $this->mark->GetCSIMAreas(); + } + } + } +} // Class + + +//=================================================== +// CLASS AccLinePlot +// Description: +//=================================================== +class AccLinePlot extends Plot { + protected $plots=null,$nbrplots=0; + private $iStartEndZero=true; + //--------------- + // CONSTRUCTOR + function __construct($plots) { + $this->plots = $plots; + $this->nbrplots = count($plots); + $this->numpoints = $plots[0]->numpoints; + + // Verify that all plots have the same number of data points + for( $i=1; $i < $this->nbrplots; ++$i ) { + if( $plots[$i]->numpoints != $this->numpoints ) { + JpGraphError::RaiseL(10003);//('Each plot in an accumulated lineplot must have the same number of data points',0) + } + } + + for($i=0; $i < $this->nbrplots; ++$i ) { + $this->LineInterpolate($this->plots[$i]->coords[0]); + } + } + + //--------------- + // PUBLIC METHODS + function Legend($graph) { + foreach( $this->plots as $p ) { + $p->DoLegend($graph); + } + } + + function Max() { + list($xmax) = $this->plots[0]->Max(); + $nmax=0; + $n = count($this->plots); + for($i=0; $i < $n; ++$i) { + $nc = count($this->plots[$i]->coords[0]); + $nmax = max($nmax,$nc); + list($x) = $this->plots[$i]->Max(); + $xmax = Max($xmax,$x); + } + for( $i = 0; $i < $nmax; $i++ ) { + // Get y-value for line $i by adding the + // individual bars from all the plots added. + // It would be wrong to just add the + // individual plots max y-value since that + // would in most cases give to large y-value. + $y=$this->plots[0]->coords[0][$i]; + for( $j = 1; $j < $this->nbrplots; $j++ ) { + $y += $this->plots[ $j ]->coords[0][$i]; + } + $ymax[$i] = $y; + } + $ymax = max($ymax); + return array($xmax,$ymax); + } + + function Min() { + $nmax=0; + list($xmin,$ysetmin) = $this->plots[0]->Min(); + $n = count($this->plots); + for($i=0; $i < $n; ++$i) { + $nc = count($this->plots[$i]->coords[0]); + $nmax = max($nmax,$nc); + list($x,$y) = $this->plots[$i]->Min(); + $xmin = Min($xmin,$x); + $ysetmin = Min($y,$ysetmin); + } + for( $i = 0; $i < $nmax; $i++ ) { + // Get y-value for line $i by adding the + // individual bars from all the plots added. + // It would be wrong to just add the + // individual plots min y-value since that + // would in most cases give to small y-value. + $y=$this->plots[0]->coords[0][$i]; + for( $j = 1; $j < $this->nbrplots; $j++ ) { + $y += $this->plots[ $j ]->coords[0][$i]; + } + $ymin[$i] = $y; + } + $ymin = Min($ysetmin,Min($ymin)); + return array($xmin,$ymin); + } + + // Gets called before any axis are stroked + function PreStrokeAdjust($graph) { + + // If another plot type have already adjusted the + // offset we don't touch it. + // (We check for empty in case the scale is a log scale + // and hence doesn't contain any xlabel_offset) + + if( empty($graph->xaxis->scale->ticks->xlabel_offset) || + $graph->xaxis->scale->ticks->xlabel_offset == 0 ) { + if( $this->center ) { + ++$this->numpoints; + $a=0.5; $b=0.5; + } else { + $a=0; $b=0; + } + $graph->xaxis->scale->ticks->SetXLabelOffset($a); + $graph->SetTextScaleOff($b); + $graph->xaxis->scale->ticks->SupressMinorTickMarks(); + } + + } + + function SetInterpolateMode($aIntMode) { + $this->iStartEndZero=$aIntMode; + } + + // Replace all '-' with an interpolated value. We use straightforward + // linear interpolation. If the data starts with one or several '-' they + // will be replaced by the the first valid data point + function LineInterpolate(&$aData) { + + $n=count($aData); + $i=0; + + // If first point is undefined we will set it to the same as the first + // valid data + if( $aData[$i]==='-' ) { + // Find the first valid data + while( $i < $n && $aData[$i]==='-' ) { + ++$i; + } + if( $i < $n ) { + for($j=0; $j < $i; ++$j ) { + if( $this->iStartEndZero ) + $aData[$i] = 0; + else + $aData[$j] = $aData[$i]; + } + } + else { + // All '-' => Error + return false; + } + } + + while($i < $n) { + while( $i < $n && $aData[$i] !== '-' ) { + ++$i; + } + if( $i < $n ) { + $pstart=$i-1; + + // Now see how long this segment of '-' are + while( $i < $n && $aData[$i] === '-' ) { + ++$i; + } + if( $i < $n ) { + $pend=$i; + $size=$pend-$pstart; + $k=($aData[$pend]-$aData[$pstart])/$size; + // Replace the segment of '-' with a linear interpolated value. + for($j=1; $j < $size; ++$j ) { + $aData[$pstart+$j] = $aData[$pstart] + $j*$k ; + } + } + else { + // There are no valid end point. The '-' goes all the way to the end + // In that case we just set all the remaining values the the same as the + // last valid data point. + for( $j=$pstart+1; $j < $n; ++$j ) + if( $this->iStartEndZero ) { + $aData[$j] = 0; + } + else { + $aData[$j] = $aData[$pstart] ; + } + } + } + } + return true; + } + + // To avoid duplicate of line drawing code here we just + // change the y-values for each plot and then restore it + // after we have made the stroke. We must do this copy since + // it wouldn't be possible to create an acc line plot + // with the same graphs, i.e AccLinePlot(array($pl,$pl,$pl)); + // since this method would have a side effect. + function Stroke($img,$xscale,$yscale) { + $img->SetLineWeight($this->weight); + $this->numpoints = count($this->plots[0]->coords[0]); + // Allocate array + $coords[$this->nbrplots][$this->numpoints]=0; + for($i=0; $i<$this->numpoints; $i++) { + $coords[0][$i]=$this->plots[0]->coords[0][$i]; + $accy=$coords[0][$i]; + for($j=1; $j<$this->nbrplots; ++$j ) { + $coords[$j][$i] = $this->plots[$j]->coords[0][$i]+$accy; + $accy = $coords[$j][$i]; + } + } + for($j=$this->nbrplots-1; $j>=0; --$j) { + $p=$this->plots[$j]; + for( $i=0; $i<$this->numpoints; ++$i) { + $tmp[$i]=$p->coords[0][$i]; + $p->coords[0][$i]=$coords[$j][$i]; + } + $p->Stroke($img,$xscale,$yscale); + for( $i=0; $i<$this->numpoints; ++$i) { + $p->coords[0][$i]=$tmp[$i]; + } + $p->coords[0][]=$tmp; + } + } +} // Class + + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_log.php b/includes/jpgraph/src/jpgraph_log.php new file mode 100644 index 0000000..7a4941a --- /dev/null +++ b/includes/jpgraph/src/jpgraph_log.php @@ -0,0 +1,305 @@ +ticks = new LogTicks(); + $this->name = 'log'; + } + + //---------------- + // PUBLIC METHODS + + // Translate between world and screen + function Translate($a) { + if( !is_numeric($a) ) { + if( $a != '' && $a != '-' && $a != 'x' ) { + JpGraphError::RaiseL(11001); + // ('Your data contains non-numeric values.'); + } + return 1; + } + if( $a < 0 ) { + JpGraphError::RaiseL(11002); + //("Negative data values can not be used in a log scale."); + exit(1); + } + if( $a==0 ) $a=1; + $a=log10($a); + return ceil($this->off + ($a*1.0 - $this->scale[0]) * $this->scale_factor); + } + + // Relative translate (don't include offset) usefull when we just want + // to know the relative position (in pixels) on the axis + function RelTranslate($a) { + if( !is_numeric($a) ) { + if( $a != '' && $a != '-' && $a != 'x' ) { + JpGraphError::RaiseL(11001); + //('Your data contains non-numeric values.'); + } + return 1; + } + if( $a==0 ) { + $a=1; + } + $a=log10($a); + return round(($a*1.0 - $this->scale[0]) * $this->scale_factor); + } + + // Use bcpow() for increased precision + function GetMinVal() { + if( function_exists("bcpow") ) { + return round(bcpow(10,$this->scale[0],15),14); + } + else { + return round(pow(10,$this->scale[0]),14); + } + } + + function GetMaxVal() { + if( function_exists("bcpow") ) { + return round(bcpow(10,$this->scale[1],15),14); + } + else { + return round(pow(10,$this->scale[1]),14); + } + } + + // Logarithmic autoscaling is much simplier since we just + // set the min and max to logs of the min and max values. + // Note that for log autoscale the "maxstep" the fourth argument + // isn't used. This is just included to give the method the same + // signature as the linear counterpart. + function AutoScale($img,$min,$max,$maxsteps,$majend=true) { + if( $min==0 ) $min=1; + + if( $max <= 0 ) { + JpGraphError::RaiseL(11004); + //('Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.'); + } + if( is_numeric($this->autoscale_min) ) { + $smin = round($this->autoscale_min); + $smax = ceil(log10($max)); + if( $min >= $max ) { + JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); + } + } + else { + $smin = floor(log10($min)); + if( is_numeric($this->autoscale_max) ) { + $smax = round($this->autoscale_max); + if( $smin >= $smax ) { + JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); + } + } + else + $smax = ceil(log10($max)); + } + + $this->Update($img,$smin,$smax); + } + //--------------- + // PRIVATE METHODS +} // Class + +//=================================================== +// CLASS LogTicks +// Description: +//=================================================== +class LogTicks extends Ticks{ + private $label_logtype=LOGLABELS_MAGNITUDE; + private $ticklabels_pos = array(); + //--------------- + // CONSTRUCTOR + function LogTicks() { + } + //--------------- + // PUBLIC METHODS + function IsSpecified() { + return true; + } + + function SetLabelLogType($aType) { + $this->label_logtype = $aType; + } + + // For log scale it's meaningless to speak about a major step + // We just return -1 to make the framework happy (specifically + // StrokeLabels() ) + function GetMajor() { + return -1; + } + + function SetTextLabelStart($aStart) { + JpGraphError::RaiseL(11005); + //('Specifying tick interval for a logarithmic scale is undefined. Remove any calls to SetTextLabelStart() or SetTextTickInterval() on the logarithmic scale.'); + } + + function SetXLabelOffset($dummy) { + // For log scales we dont care about XLabel offset + } + + // Draw ticks on image "img" using scale "scale". The axis absolute + // position in the image is specified in pos, i.e. for an x-axis + // it specifies the absolute y-coord and for Y-ticks it specified the + // absolute x-position. + function Stroke($img,$scale,$pos) { + $start = $scale->GetMinVal(); + $limit = $scale->GetMaxVal(); + $nextMajor = 10*$start; + $step = $nextMajor / 10.0; + + + $img->SetLineWeight($this->weight); + + if( $scale->type == "y" ) { + // member direction specified if the ticks should be on + // left or right side. + $a=$pos + $this->direction*$this->GetMinTickAbsSize(); + $a2=$pos + $this->direction*$this->GetMajTickAbsSize(); + + $count=1; + $this->maj_ticks_pos[0]=$scale->Translate($start); + $this->maj_ticklabels_pos[0]=$scale->Translate($start); + if( $this->supress_first ) + $this->maj_ticks_label[0]=""; + else { + if( $this->label_formfunc != '' ) { + $f = $this->label_formfunc; + $this->maj_ticks_label[0]=call_user_func($f,$start); + } + elseif( $this->label_logtype == LOGLABELS_PLAIN ) { + $this->maj_ticks_label[0]=$start; + } + else { + $this->maj_ticks_label[0]='10^'.round(log10($start)); + } + } + $i=1; + for($y=$start; $y<=$limit; $y+=$step,++$count ) { + $ys=$scale->Translate($y); + $this->ticks_pos[]=$ys; + $this->ticklabels_pos[]=$ys; + if( $count % 10 == 0 ) { + if( !$this->supress_tickmarks ) { + if( $this->majcolor!="" ) { + $img->PushColor($this->majcolor); + $img->Line($pos,$ys,$a2,$ys); + $img->PopColor(); + } + else { + $img->Line($pos,$ys,$a2,$ys); + } + } + + $this->maj_ticks_pos[$i]=$ys; + $this->maj_ticklabels_pos[$i]=$ys; + + if( $this->label_formfunc != '' ) { + $f = $this->label_formfunc; + $this->maj_ticks_label[$i]=call_user_func($f,$nextMajor); + } + elseif( $this->label_logtype == 0 ) { + $this->maj_ticks_label[$i]=$nextMajor; + } + else { + $this->maj_ticks_label[$i]='10^'.round(log10($nextMajor)); + } + ++$i; + $nextMajor *= 10; + $step *= 10; + $count=1; + } + else { + if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { + if( $this->mincolor!="" ) { + $img->PushColor($this->mincolor); + } + $img->Line($pos,$ys,$a,$ys); + if( $this->mincolor!="" ) { + $img->PopColor(); + } + } + } + } + } + else { + $a=$pos - $this->direction*$this->GetMinTickAbsSize(); + $a2=$pos - $this->direction*$this->GetMajTickAbsSize(); + $count=1; + $this->maj_ticks_pos[0]=$scale->Translate($start); + $this->maj_ticklabels_pos[0]=$scale->Translate($start); + if( $this->supress_first ) { + $this->maj_ticks_label[0]=""; + } + else { + if( $this->label_formfunc != '' ) { + $f = $this->label_formfunc; + $this->maj_ticks_label[0]=call_user_func($f,$start); + } + elseif( $this->label_logtype == 0 ) { + $this->maj_ticks_label[0]=$start; + } + else { + $this->maj_ticks_label[0]='10^'.round(log10($start)); + } + } + $i=1; + for($x=$start; $x<=$limit; $x+=$step,++$count ) { + $xs=$scale->Translate($x); + $this->ticks_pos[]=$xs; + $this->ticklabels_pos[]=$xs; + if( $count % 10 == 0 ) { + if( !$this->supress_tickmarks ) { + $img->Line($xs,$pos,$xs,$a2); + } + $this->maj_ticks_pos[$i]=$xs; + $this->maj_ticklabels_pos[$i]=$xs; + + if( $this->label_formfunc != '' ) { + $f = $this->label_formfunc; + $this->maj_ticks_label[$i]=call_user_func($f,$nextMajor); + } + elseif( $this->label_logtype == 0 ) { + $this->maj_ticks_label[$i]=$nextMajor; + } + else { + $this->maj_ticks_label[$i]='10^'.round(log10($nextMajor)); + } + ++$i; + $nextMajor *= 10; + $step *= 10; + $count=1; + } + else { + if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { + $img->Line($xs,$pos,$xs,$a); + } + } + } + } + return true; + } +} // Class +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_meshinterpolate.inc.php b/includes/jpgraph/src/jpgraph_meshinterpolate.inc.php new file mode 100644 index 0000000..9b46588 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_meshinterpolate.inc.php @@ -0,0 +1,105 @@ +Linear($aData,$aFactor); +} + +/** + * Utility class to interpolate a given data matrix + * + */ +class MeshInterpolate { + private $data = array(); + + /** + * Calculate the mid points of the given rectangle which has its top left + * corner at $row,$col. The $aFactordecides how many spliots should be done. + * i.e. how many more divisions should be done recursively + * + * @param $row Top left corner of square to work with + * @param $col Top left corner of square to work with + * $param $aFactor In how many subsquare should we split this square. A value of 1 indicates that no action + */ + function IntSquare( $aRow, $aCol, $aFactor ) { + if ( $aFactor <= 1 ) + return; + + $step = pow( 2, $aFactor-1 ); + + $v0 = $this->data[$aRow][$aCol]; + $v1 = $this->data[$aRow][$aCol + $step]; + $v2 = $this->data[$aRow + $step][$aCol]; + $v3 = $this->data[$aRow + $step][$aCol + $step]; + + $this->data[$aRow][$aCol + $step / 2] = ( $v0 + $v1 ) / 2; + $this->data[$aRow + $step / 2][$aCol] = ( $v0 + $v2 ) / 2; + $this->data[$aRow + $step][$aCol + $step / 2] = ( $v2 + $v3 ) / 2; + $this->data[$aRow + $step / 2][$aCol + $step] = ( $v1 + $v3 ) / 2; + $this->data[$aRow + $step / 2][$aCol + $step / 2] = ( $v0 + $v1 + $v2 + $v3 ) / 4; + + $this->IntSquare( $aRow, $aCol, $aFactor-1 ); + $this->IntSquare( $aRow, $aCol + $step / 2, $aFactor-1 ); + $this->IntSquare( $aRow + $step / 2, $aCol, $aFactor-1 ); + $this->IntSquare( $aRow + $step / 2, $aCol + $step / 2, $aFactor-1 ); + } + + /** + * Interpolate values in a matrice so that the total number of data points + * in vert and horizontal axis are $aIntNbr more. For example $aIntNbr=2 will + * make the data matrice have tiwce as many vertical and horizontal dta points. + * + * Note: This will blow up the matrcide in memory size in the order of $aInNbr^2 + * + * @param $ &$aData The original data matricde + * @param $aInNbr Interpolation factor + * @return the interpolated matrice + */ + function Linear( &$aData, $aIntFactor ) { + $step = pow( 2, $aIntFactor-1 ); + + $orig_cols = count( $aData[0] ); + $orig_rows = count( $aData ); + // Number of new columns/rows + // N = (a-1) * 2^(f-1) + 1 + $p = pow( 2, $aIntFactor-1 ); + $new_cols = $p * ( $orig_cols - 1 ) + 1; + $new_rows = $p * ( $orig_rows - 1 ) + 1; + + $this->data = array_fill( 0, $new_rows, array_fill( 0, $new_cols, 0 ) ); + // Initialize the new matrix with the values that we know + for ( $i = 0; $i < $new_rows; $i++ ) { + for ( $j = 0; $j < $new_cols; $j++ ) { + $v = 0 ; + if ( ( $i % $step == 0 ) && ( $j % $step == 0 ) ) { + $v = $aData[$i / $step][$j / $step]; + } + $this->data[$i][$j] = $v; + } + } + + for ( $i = 0; $i < $new_rows-1; $i += $step ) { + for ( $j = 0; $j < $new_cols-1; $j += $step ) { + $this->IntSquare( $i, $j, $aIntFactor ); + } + } + + return $this->data; + } +} + +?> diff --git a/includes/jpgraph/src/jpgraph_mgraph.php b/includes/jpgraph/src/jpgraph_mgraph.php new file mode 100644 index 0000000..8ba4192 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_mgraph.php @@ -0,0 +1,345 @@ +iWidth = $aWidth; + $this->iHeight = $aHeight; + + // If the cached version exist just read it directly from the + // cache, stream it back to browser and exit + if( $aCachedName!='' && READ_CACHE && $aInline ) { + $this->cache = new ImgStreamCache(); + $this->cache->SetTimeOut($aTimeOut); + $image = new Image(); + if( $this->cache->GetAndStream($image,$aCachedName) ) { + exit(); + } + } + $this->inline = $aInline; + $this->cache_name = $aCachedName; + + $this->title = new Text(); + $this->title->ParagraphAlign('center'); + $this->title->SetFont(FF_FONT2,FS_BOLD); + $this->title->SetMargin(3); + $this->title->SetAlign('center'); + + $this->subtitle = new Text(); + $this->subtitle->ParagraphAlign('center'); + $this->subtitle->SetFont(FF_FONT1,FS_BOLD); + $this->subtitle->SetMargin(3); + $this->subtitle->SetAlign('center'); + + $this->subsubtitle = new Text(); + $this->subsubtitle->ParagraphAlign('center'); + $this->subsubtitle->SetFont(FF_FONT1,FS_NORMAL); + $this->subsubtitle->SetMargin(3); + $this->subsubtitle->SetAlign('center'); + + $this->footer = new Footer(); + + } + + // Specify background fill color for the combined graph + function SetFillColor($aColor) { + $this->iFillColor = $aColor; + } + + // Add a frame around the combined graph + function SetFrame($aFlg,$aColor='black',$aWeight=1) { + $this->iDoFrame = $aFlg; + $this->iFrameColor = $aColor; + $this->iFrameWeight = $aWeight; + } + + // Specify a background image blend + function SetBackgroundImageMix($aMix) { + $this->background_image_mix = $aMix ; + } + + // Specify a background image + function SetBackgroundImage($aFileName,$aCenter_aX=NULL,$aY=NULL) { + // Second argument can be either a boolean value or + // a numeric + $aCenter=TRUE; + $aX=NULL; + + if( is_numeric($aCenter_aX) ) { + $aX=$aCenter_aX; + } + + // Get extension to determine image type + $e = explode('.',$aFileName); + if( !$e ) { + JpGraphError::RaiseL(12002,$aFileName); + //('Incorrect file name for MGraph::SetBackgroundImage() : '.$aFileName.' Must have a valid image extension (jpg,gif,png) when using autodetection of image type'); + } + + $valid_formats = array('png', 'jpg', 'gif'); + $aImgFormat = strtolower($e[count($e)-1]); + if ($aImgFormat == 'jpeg') { + $aImgFormat = 'jpg'; + } + elseif (!in_array($aImgFormat, $valid_formats) ) { + JpGraphError::RaiseL(12003,$aImgFormat,$aFileName); + //('Unknown file extension ($aImgFormat) in MGraph::SetBackgroundImage() for filename: '.$aFileName); + } + + $this->background_image = $aFileName; + $this->background_image_center=$aCenter; + $this->background_image_format=$aImgFormat; + $this->background_image_x = $aX; + $this->background_image_y = $aY; + } + + function _strokeBackgroundImage() { + if( $this->background_image == '' ) return; + + $bkgimg = Graph::LoadBkgImage('',$this->background_image); + + // Background width & Heoght + $bw = imagesx($bkgimg); + $bh = imagesy($bkgimg); + + // Canvas width and height + $cw = imagesx($this->img); + $ch = imagesy($this->img); + + if( $this->doshadow ) { + $cw -= $this->shadow_width; + $ch -= $this->shadow_width; + } + + if( $this->background_image_x === NULL || $this->background_image_y === NULL ) { + if( $this->background_image_center ) { + // Center original image in the plot area + $x = round($cw/2-$bw/2); $y = round($ch/2-$bh/2); + } + else { + // Just copy the image from left corner, no resizing + $x=0; $y=0; + } + } + else { + $x = $this->background_image_x; + $y = $this->background_image_y; + } + imagecopymerge($this->img,$bkgimg,$x,$y,0,0,$bw,$bh,$this->background_image_mix); + } + + function AddMix($aGraph,$x=0,$y=0,$mix=100,$fx=0,$fy=0,$w=0,$h=0) { + $this->_gdImgHandle($aGraph->Stroke( _IMG_HANDLER),$x,$y,$fx=0,$fy=0,$w,$h,$mix); + } + + function Add($aGraph,$x=0,$y=0,$fx=0,$fy=0,$w=0,$h=0) { + $this->_gdImgHandle($aGraph->Stroke( _IMG_HANDLER),$x,$y,$fx=0,$fy=0,$w,$h); + } + + function _gdImgHandle($agdCanvas,$x,$y,$fx=0,$fy=0,$w=0,$h=0,$mix=100) { + if( $w == 0 ) { + $w = @imagesx($agdCanvas); + } + if( $w === NULL ) { + JpGraphError::RaiseL(12007); + //('Argument to MGraph::Add() is not a valid GD image handle.'); + return; + } + if( $h == 0 ) { + $h = @imagesy($agdCanvas); + } + $this->iGraphs[$this->iCnt++] = array($agdCanvas,$x,$y,$fx,$fy,$w,$h,$mix); + } + + function SetMargin($lm,$rm,$tm,$bm) { + $this->lm = $lm; + $this->rm = $rm; + $this->tm = $tm; + $this->bm = $bm; + } + + function SetExpired($aFlg=true) { + $this->expired = $aFlg; + } + + function SetImgFormat($aFormat,$aQuality=75) { + $this->image_format = $aFormat; + $this->image_quality = $aQuality; + } + + // Set the shadow around the whole image + function SetShadow($aShowShadow=true,$aShadowWidth=4,$aShadowColor='gray@0.3') { + $this->doshadow = $aShowShadow; + $this->shadow_color = $aShadowColor; + $this->shadow_width = $aShadowWidth; + $this->footer->iBottomMargin += $aShadowWidth; + $this->footer->iRightMargin += $aShadowWidth; + } + + function StrokeTitle($image,$w,$h) { + // Stroke title + if( $this->title->t !== '' ) { + + $margin = 3; + + $y = $this->title->margin; + if( $this->title->halign == 'center' ) { + $this->title->Center(0,$w,$y); + } + elseif( $this->title->halign == 'left' ) { + $this->title->SetPos($this->title->margin+2,$y); + } + elseif( $this->title->halign == 'right' ) { + $indent = 0; + if( $this->doshadow ) { + $indent = $this->shadow_width+2; + } + $this->title->SetPos($w-$this->title->margin-$indent,$y,'right'); + } + $this->title->Stroke($image); + + // ... and subtitle + $y += $this->title->GetTextHeight($image) + $margin + $this->subtitle->margin; + if( $this->subtitle->halign == 'center' ) { + $this->subtitle->Center(0,$w,$y); + } + elseif( $this->subtitle->halign == 'left' ) { + $this->subtitle->SetPos($this->subtitle->margin+2,$y); + } + elseif( $this->subtitle->halign == 'right' ) { + $indent = 0; + if( $this->doshadow ) { + $indent = $this->shadow_width+2; + } + $this->subtitle->SetPos($this->img->width-$this->subtitle->margin-$indent,$y,'right'); + } + $this->subtitle->Stroke($image); + + // ... and subsubtitle + $y += $this->subtitle->GetTextHeight($image) + $margin + $this->subsubtitle->margin; + if( $this->subsubtitle->halign == 'center' ) { + $this->subsubtitle->Center(0,$w,$y); + } + elseif( $this->subsubtitle->halign == 'left' ) { + $this->subsubtitle->SetPos($this->subsubtitle->margin+2,$y); + } + elseif( $this->subsubtitle->halign == 'right' ) { + $indent = 0; + if( $this->doshadow ) { + $indent = $this->shadow_width+2; + } + $this->subsubtitle->SetPos($w-$this->subsubtitle->margin-$indent,$y,'right'); + } + $this->subsubtitle->Stroke($image); + + } + } + + function Stroke($aFileName='') { + // Find out the necessary size for the container image + $w=0; $h=0; + for($i=0; $i < $this->iCnt; ++$i ) { + $maxw = $this->iGraphs[$i][1]+$this->iGraphs[$i][5]; + $maxh = $this->iGraphs[$i][2]+$this->iGraphs[$i][6]; + $w = max( $w, $maxw ); + $h = max( $h, $maxh ); + } + $w += $this->lm+$this->rm; + $h += $this->tm+$this->bm; + + // User specified width,height overrides + if( $this->iWidth !== NULL && $this->iWidth !== 0 ) $w = $this->iWidth; + if( $this->iHeight!== NULL && $this->iHeight !== 0) $h = $this->iHeight; + + if( $this->doshadow ) { + $w += $this->shadow_width; + $h += $this->shadow_width; + } + + $image = new Image($w,$h); + $image->SetImgFormat( $this->image_format,$this->image_quality); + + if( $this->doshadow ) { + $image->SetColor($this->iFrameColor); + $image->ShadowRectangle(0,0,$w-1,$h-1,$this->iFillColor,$this->shadow_width,$this->shadow_color); + $w -= $this->shadow_width; + $h -= $this->shadow_width; + } + else { + $image->SetColor($this->iFillColor); + $image->FilledRectangle(0,0,$w-1,$h-1); + } + $image->SetExpired($this->expired); + + $this->img = $image->img; + $this->_strokeBackgroundImage(); + + if( $this->iDoFrame && ! $this->doshadow ) { + $image->SetColor($this->iFrameColor); + $image->SetLineWeight($this->iFrameWeight); + $image->Rectangle(0,0,$w-1,$h-1); + } + + // Copy all sub graphs to the container + for($i=0; $i < $this->iCnt; ++$i ) { + $image->CopyMerge($this->iGraphs[$i][0], + $this->iGraphs[$i][1]+$this->lm,$this->iGraphs[$i][2]+$this->tm, + $this->iGraphs[$i][3],$this->iGraphs[$i][4], + $this->iGraphs[$i][5],$this->iGraphs[$i][6], + -1,-1, /* Full from width and height */ + $this->iGraphs[$i][7]); + + + } + + $this->StrokeTitle($image,$w,$h); + $this->footer->Stroke($image); + + // Output image + if( $aFileName == _IMG_HANDLER ) { + return $image->img; + } + else { + //Finally stream the generated picture + $this->cache = new ImgStreamCache(); + $this->cache->PutAndStream($image,$this->cache_name,$this->inline,$aFileName); + } + } +} + +// EOF + +?> diff --git a/includes/jpgraph/src/jpgraph_pie.php b/includes/jpgraph/src/jpgraph_pie.php new file mode 100644 index 0000000..f9a7dbd --- /dev/null +++ b/includes/jpgraph/src/jpgraph_pie.php @@ -0,0 +1,1495 @@ + array(136,34,40,45,46,62,63,134,74,10,120,136,141,168,180,77,209,218,346,395,89,430), + "pastel" => array(27,415,128,59,66,79,105,110,42,147,152,230,236,240,331,337,405,38), + "water" => array(8,370,24,40,335,56,213,237,268,14,326,387,10,388), + "sand" => array(27,168,34,170,19,50,65,72,131,209,46,393)); + protected $setslicecolors=array(); + protected $labeltype=0; // Default to percentage + protected $pie_border=true,$pie_interior_border=true; + public $value; + protected $ishadowcolor='',$ishadowdrop=4; + protected $ilabelposadj=1; + protected $legendcsimtargets = array(),$legendcsimwintargets = array(); + protected $legendcsimalts = array(); + protected $adjusted_data = array(); + public $guideline = null; + protected $guidelinemargin=10,$iShowGuideLineForSingle = false; + protected $iGuideLineCurve = false,$iGuideVFactor=1.4,$iGuideLineRFactor=0.8; + protected $la = array(); // Holds the exact angle for each label + + //--------------- + // CONSTRUCTOR + function __construct($data) { + $this->data = array_reverse($data); + $this->title = new Text(""); + $this->title->SetFont(FF_DEFAULT,FS_BOLD); + $this->value = new DisplayValue(); + $this->value->Show(); + $this->value->SetFormat('%.1f%%'); + $this->guideline = new LineProperty(); + } + + //--------------- + // PUBLIC METHODS + function SetCenter($x,$y=0.5) { + $this->posx = $x; + $this->posy = $y; + } + + // Enable guideline and set drwaing policy + function SetGuideLines($aFlg=true,$aCurved=true,$aAlways=false) { + $this->guideline->Show($aFlg); + $this->iShowGuideLineForSingle = $aAlways; + $this->iGuideLineCurve = $aCurved; + } + + // Adjuste the distance between labels and labels and pie + function SetGuideLinesAdjust($aVFactor,$aRFactor=0.8) { + $this->iGuideVFactor=$aVFactor; + $this->iGuideLineRFactor=$aRFactor; + } + + function SetColor($aColor) { + $this->color = $aColor; + } + + function SetSliceColors($aColors) { + $this->setslicecolors = $aColors; + } + + function SetShadow($aColor='darkgray',$aDropWidth=4) { + $this->ishadowcolor = $aColor; + $this->ishadowdrop = $aDropWidth; + } + + function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { + $this->csimtargets=array_reverse($aTargets); + if( is_array($aWinTargets) ) + $this->csimwintargets=array_reverse($aWinTargets); + if( is_array($aAlts) ) + $this->csimalts=array_reverse($aAlts); + } + + function GetCSIMareas() { + return $this->csimareas; + } + + function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { + //Slice number, ellipse centre (x,y), height, width, start angle, end angle + while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; + while( $ea > 2*M_PI ) $ea = $ea - 2*M_PI; + + $sa = 2*M_PI - $sa; + $ea = 2*M_PI - $ea; + + // Special case when we have only one slice since then both start and end + // angle will be == 0 + if( abs($sa - $ea) < 0.0001 ) { + $sa=2*M_PI; $ea=0; + } + + //add coordinates of the centre to the map + $xc = floor($xc);$yc=floor($yc); + $coords = "$xc, $yc"; + + //add coordinates of the first point on the arc to the map + $xp = floor(($radius*cos($ea))+$xc); + $yp = floor($yc-$radius*sin($ea)); + $coords.= ", $xp, $yp"; + + //add coordinates every 0.2 radians + $a=$ea+0.2; + + // If we cross the 360-limit with a slice we need to handle + // the fact that end angle is smaller than start + if( $sa < $ea ) { + while ($a <= 2*M_PI) { + $xp = floor($radius*cos($a)+$xc); + $yp = floor($yc-$radius*sin($a)); + $coords.= ", $xp, $yp"; + $a += 0.2; + } + $a -= 2*M_PI; + } + + + while ($a < $sa) { + $xp = floor($radius*cos($a)+$xc); + $yp = floor($yc-$radius*sin($a)); + $coords.= ", $xp, $yp"; + $a += 0.2; + } + + //Add the last point on the arc + $xp = floor($radius*cos($sa)+$xc); + $yp = floor($yc-$radius*sin($sa)); + $coords.= ", $xp, $yp"; + if( !empty($this->csimtargets[$i]) ) { + $this->csimareas .= "csimtargets[$i]."\""; + $tmp=""; + if( !empty($this->csimwintargets[$i]) ) { + $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; + } + if( !empty($this->csimalts[$i]) ) { + $tmp=sprintf($this->csimalts[$i],$this->data[$i]); + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + } + + + function SetTheme($aTheme) { +// JpGraphError::RaiseL(15012,$aTheme); +// return; + + if( in_array($aTheme,array_keys($this->themearr)) ) { + $this->theme = $aTheme; + $this->is_using_plot_theme = true; + } else { + JpGraphError::RaiseL(15001,$aTheme);//("PiePLot::SetTheme() Unknown theme: $aTheme"); + } + } + + function ExplodeSlice($e,$radius=20) { + if( ! is_integer($e) ) + JpGraphError::RaiseL(15002);//('Argument to PiePlot::ExplodeSlice() must be an integer'); + $this->explode_radius[$e]=$radius; + } + + function ExplodeAll($radius=20) { + $this->explode_all=true; + $this->explode_r = $radius; + } + + function Explode($aExplodeArr) { + if( !is_array($aExplodeArr) ) { + JpGraphError::RaiseL(15003); + //("Argument to PiePlot::Explode() must be an array with integer distances."); + } + $this->explode_radius = $aExplodeArr; + } + + function SetStartAngle($aStart) { + if( $aStart < 0 || $aStart > 360 ) { + JpGraphError::RaiseL(15004);//('Slice start angle must be between 0 and 360 degrees.'); + } + if( $aStart == 0 ) { + $this->startangle = 0; + } + else { + $this->startangle = 360-$aStart; + $this->startangle *= M_PI/180; + } + } + + // Size in percentage + function SetSize($aSize) { + if( ($aSize>0 && $aSize<=0.5) || ($aSize>10 && $aSize<1000) ) + $this->radius = $aSize; + else + JpGraphError::RaiseL(15006); + //("PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]"); + } + + // Set label arrays + function SetLegends($aLegend) { + $this->legends = $aLegend; + } + + // Set text labels for slices + function SetLabels($aLabels,$aLblPosAdj="auto") { + $this->labels = array_reverse($aLabels); + $this->ilabelposadj=$aLblPosAdj; + } + + function SetLabelPos($aLblPosAdj) { + $this->ilabelposadj=$aLblPosAdj; + } + + // Should we display actual value or percentage? + function SetLabelType($aType) { + if( $aType < 0 || $aType > 2 ) + JpGraphError::RaiseL(15008,$aType); + //("PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not $t)."); + $this->labeltype = $aType; + } + + // Deprecated. + function SetValueType($aType) { + $this->SetLabelType($aType); + } + + // Should the circle around a pie plot be displayed + function ShowBorder($exterior=true,$interior=true) { + $this->pie_border = $exterior; + $this->pie_interior_border = $interior; + } + + // Setup the legends + function Legend($graph) { + $colors = array_keys($graph->img->rgb->rgb_table); + sort($colors); + $ta=$this->themearr[$this->theme]; + $n = count($this->data); + + if( $this->setslicecolors==null ) { + $numcolors=count($ta); + if( class_exists('PiePlot3D',false) && ($this instanceof PiePlot3D) ) { + $ta = array_reverse(array_slice($ta,0,$n)); + } + } + else { + $this->setslicecolors = array_slice($this->setslicecolors,0,$n); + $numcolors=count($this->setslicecolors); + if( $graph->pieaa && !($this instanceof PiePlot3D) ) { + $this->setslicecolors = array_reverse($this->setslicecolors); + } + } + + $sum=0; + for($i=0; $i < $n; ++$i) + $sum += $this->data[$i]; + + // Bail out with error if the sum is 0 + if( $sum==0 ) + JpGraphError::RaiseL(15009);//("Illegal pie plot. Sum of all data is zero for Pie!"); + + // Make sure we don't plot more values than data points + // (in case the user added more legends than data points) + $n = min(count($this->legends),count($this->data)); + if( $this->legends != "" ) { + $this->legends = array_reverse(array_slice($this->legends,0,$n)); + } + for( $i=$n-1; $i >= 0; --$i ) { + $l = $this->legends[$i]; + // Replace possible format with actual values + if( count($this->csimalts) > $i ) { + $fmt = $this->csimalts[$i]; + } + else { + $fmt = "%d"; // Deafult Alt if no other has been specified + } + if( $this->labeltype==0 ) { + $l = sprintf($l,100*$this->data[$i]/$sum); + $alt = sprintf($fmt,$this->data[$i]); + + } + elseif( $this->labeltype == 1) { + $l = sprintf($l,$this->data[$i]); + $alt = sprintf($fmt,$this->data[$i]); + + } + else { + $l = sprintf($l,$this->adjusted_data[$i]); + $alt = sprintf($fmt,$this->adjusted_data[$i]); + } + + if( empty($this->csimwintargets[$i]) ) { + $wintarg = ''; + } + else { + $wintarg = $this->csimwintargets[$i]; + } + + if( $this->setslicecolors==null ) { + $graph->legend->Add($l,$colors[$ta[$i%$numcolors]],"",0,$this->csimtargets[$i],$alt,$wintarg); + } + else { + $graph->legend->Add($l,$this->setslicecolors[$i%$numcolors],"",0,$this->csimtargets[$i],$alt,$wintarg); + } + } + } + + // Adjust the rounded percetage value so that the sum of + // of the pie slices are always 100% + // Using the Hare/Niemeyer method + function AdjPercentage($aData,$aPrec=0) { + $mul=100; + if( $aPrec > 0 && $aPrec < 3 ) { + if( $aPrec == 1 ) + $mul=1000; + else + $mul=10000; + } + + $tmp = array(); + $result = array(); + $quote_sum=0; + $n = count($aData) ; + for( $i=0, $sum=0; $i < $n; ++$i ) + $sum+=$aData[$i]; + foreach($aData as $index => $value) { + $tmp_percentage=$value/$sum*$mul; + $result[$index]=floor($tmp_percentage); + $tmp[$index]=$tmp_percentage-$result[$index]; + $quote_sum+=$result[$index]; + } + if( $quote_sum == $mul) { + if( $mul > 100 ) { + $tmp = $mul / 100; + for( $i=0; $i < $n; ++$i ) { + $result[$i] /= $tmp ; + } + } + return $result; + } + arsort($tmp,SORT_NUMERIC); + reset($tmp); + for($i=0; $i < $mul-$quote_sum; $i++) + { + $result[key($tmp)]++; + next($tmp); + } + if( $mul > 100 ) { + $tmp = $mul / 100; + for( $i=0; $i < $n; ++$i ) { + $result[$i] /= $tmp ; + } + } + return $result; + } + + + function Stroke($img,$aaoption=0) { + // aaoption is used to handle antialias + // aaoption == 0 a normal pie + // aaoption == 1 just the body + // aaoption == 2 just the values + + // Explode scaling. If anti alias we scale the image + // twice and we also need to scale the exploding distance + $expscale = $aaoption === 1 ? 2 : 1; + + if( $this->labeltype == 2 ) { + // Adjust the data so that it will add up to 100% + $this->adjusted_data = $this->AdjPercentage($this->data); + } + + if ($this->use_plot_theme_colors) { + $this->setslicecolors = null; + } + + $colors = array_keys($img->rgb->rgb_table); + sort($colors); + $ta=$this->themearr[$this->theme]; + $n = count($this->data); + + if( $this->setslicecolors==null ) { + $numcolors=count($ta); + } + else { + // We need to create an array of colors as long as the data + // since we need to reverse it to get the colors in the right order + $numcolors=count($this->setslicecolors); + $i = 2*$numcolors; + while( $n > $i ) { + $this->setslicecolors = array_merge($this->setslicecolors,$this->setslicecolors); + $i += $n; + } + $tt = array_slice($this->setslicecolors,0,$n % $numcolors); + $this->setslicecolors = array_merge($this->setslicecolors,$tt); + $this->setslicecolors = array_reverse($this->setslicecolors); + } + + // Draw the slices + $sum=0; + for($i=0; $i < $n; ++$i) + $sum += $this->data[$i]; + + // Bail out with error if the sum is 0 + if( $sum==0 ) { + JpGraphError::RaiseL(15009);//("Sum of all data is 0 for Pie."); + } + + // Set up the pie-circle + if( $this->radius <= 1 ) { + $radius = floor($this->radius*min($img->width,$img->height)); + } + else { + $radius = $aaoption === 1 ? $this->radius*2 : $this->radius; + } + + if( $this->posx <= 1 && $this->posx > 0 ) { + $xc = round($this->posx*$img->width); + } + else { + $xc = $this->posx ; + } + + if( $this->posy <= 1 && $this->posy > 0 ) { + $yc = round($this->posy*$img->height); + } + else { + $yc = $this->posy ; + } + + $n = count($this->data); + + if( $this->explode_all ) { + for($i=0; $i < $n; ++$i) { + $this->explode_radius[$i]=$this->explode_r; + } + } + + // If we have a shadow and not just drawing the labels + if( $this->ishadowcolor != "" && $aaoption !== 2) { + $accsum=0; + $angle2 = $this->startangle; + $img->SetColor($this->ishadowcolor); + for($i=0; $sum > 0 && $i < $n; ++$i) { + $j = $n-$i-1; + $d = $this->data[$i]; + $angle1 = $angle2; + $accsum += $d; + $angle2 = $this->startangle+2*M_PI*$accsum/$sum; + if( empty($this->explode_radius[$j]) ) { + $this->explode_radius[$j]=0; + } + + if( $d < 0.00001 ) continue; + + $la = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1); + + $xcm = $xc + $this->explode_radius[$j]*cos($la)*$expscale; + $ycm = $yc - $this->explode_radius[$j]*sin($la)*$expscale; + + $xcm += $this->ishadowdrop*$expscale; + $ycm += $this->ishadowdrop*$expscale; + + $_sa = round($angle1*180/M_PI); + $_ea = round($angle2*180/M_PI); + + // The CakeSlice method draws a full circle in case of start angle = end angle + // for pie slices we don't want this behaviour unless we only have one + // slice in the pie in case it is the wanted behaviour + if( $_ea-$_sa > 0.1 || $n==1 ) { + $img->CakeSlice($xcm,$ycm,$radius-1,$radius-1, + $angle1*180/M_PI,$angle2*180/M_PI,$this->ishadowcolor); + } + } + } + + //-------------------------------------------------------------------------------- + // This is the main loop to draw each cake slice + //-------------------------------------------------------------------------------- + + // Set up the accumulated sum, start angle for first slice and border color + $accsum=0; + $angle2 = $this->startangle; + $img->SetColor($this->color); + + // Loop though all the slices if there is a pie to draw (sum>0) + // There are n slices in total + for($i=0; $sum>0 && $i < $n; ++$i) { + + // $j is the actual index used for the slice + $j = $n-$i-1; + + // Make sure we havea valid distance to explode the slice + if( empty($this->explode_radius[$j]) ) { + $this->explode_radius[$j]=0; + } + + // The actual numeric value for the slice + $d = $this->data[$i]; + + $angle1 = $angle2; + + // Accumlate the sum + $accsum += $d; + + // The new angle when we add the "size" of this slice + // angle1 is then the start and angle2 the end of this slice + $angle2 = $this->NormAngle($this->startangle+2*M_PI*$accsum/$sum); + + // We avoid some trouble by not allowing end angle to be 0, in that case + // we translate to 360 + + // la is used to hold the label angle, which is centered on the slice + if( $angle2 < 0.0001 && $angle1 > 0.0001 ) { + $this->la[$i] = 2*M_PI - (abs(2*M_PI-$angle1)/2.0+$angle1); + } + elseif( $angle1 > $angle2 ) { + // The case where the slice crosses the 3 a'clock line + // Remember that the slices are counted clockwise and + // labels are counted counter clockwise so we need to revert with 2 PI + $this->la[$i] = 2*M_PI-$this->NormAngle($angle1 + ((2*M_PI - $angle1)+$angle2)/2); + } + else { + $this->la[$i] = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1); + } + + // Too avoid rounding problems we skip the slice if it is too small + if( $d < 0.00001 ) continue; + + // If the user has specified an array of colors for each slice then use + // that a color otherwise use the theme array (ta) of colors + if( $this->setslicecolors==null ) { + $slicecolor=$colors[$ta[$i%$numcolors]]; + } + else { + $slicecolor=$this->setslicecolors[$i%$numcolors]; + } + +// $_sa = round($angle1*180/M_PI); +// $_ea = round($angle2*180/M_PI); +// $_la = round($this->la[$i]*180/M_PI); +// echo "Slice#$i: ang1=$_sa , ang2=$_ea, la=$_la, color=$slicecolor
"; + + + // If we have enabled antialias then we don't draw any border so + // make the bordedr color the same as the slice color + if( $this->pie_interior_border && $aaoption===0 ) { + $img->SetColor($this->color); + } + else { + $img->SetColor($slicecolor); + } + $arccolor = $this->pie_border && $aaoption===0 ? $this->color : ""; + + // Calculate the x,y coordinates for the base of this slice taking + // the exploded distance into account. Here we use the mid angle as the + // ray of extension and we have the mid angle handy as it is also the + // label angle + $xcm = $xc + $this->explode_radius[$j]*cos($this->la[$i])*$expscale; + $ycm = $yc - $this->explode_radius[$j]*sin($this->la[$i])*$expscale; + + // If we are not just drawing the labels then draw this cake slice + if( $aaoption !== 2 ) { + + $_sa = round($angle1*180/M_PI); + $_ea = round($angle2*180/M_PI); + $_la = round($this->la[$i]*180/M_PI); + //echo "[$i] sa=$_sa, ea=$_ea, la[$i]=$_la, (color=$slicecolor)
"; + + // The CakeSlice method draws a full circle in case of start angle = end angle + // for pie slices we want this in case the slice have a value larger than 99% of the + // total sum + if( abs($_ea-$_sa) >= 1 || $d == $sum ) { + $img->CakeSlice($xcm,$ycm,$radius-1,$radius-1,$_sa,$_ea,$slicecolor,$arccolor); + } + } + + // If the CSIM is used then make sure we register a CSIM area for this slice as well + if( $this->csimtargets && $aaoption !== 1 ) { + $this->AddSliceToCSIM($i,$xcm,$ycm,$radius,$angle1,$angle2); + } + } + + // Format the titles for each slice + if( $aaoption !== 2 ) { + for( $i=0; $i < $n; ++$i) { + if( $this->labeltype==0 ) { + if( $sum != 0 ) + $l = 100.0*$this->data[$i]/$sum; + else + $l = 0.0; + } + elseif( $this->labeltype==1 ) { + $l = $this->data[$i]*1.0; + } + else { + $l = $this->adjusted_data[$i]; + } + if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) + $this->labels[$i]=sprintf($this->labels[$i],$l); + else + $this->labels[$i]=$l; + } + } + + if( $this->value->show && $aaoption !== 1 ) { + $this->StrokeAllLabels($img,$xc,$yc,$radius); + } + + // Adjust title position + if( $aaoption !== 1 ) { + $this->title->SetPos($xc, + $yc-$this->title->GetFontHeight($img)-$radius-$this->title->margin, + "center","bottom"); + $this->title->Stroke($img); + } + + } + + //--------------- + // PRIVATE METHODS + + function NormAngle($a) { + while( $a < 0 ) $a += 2*M_PI; + while( $a > 2*M_PI ) $a -= 2*M_PI; + return $a; + } + + function Quadrant($a) { + $a=$this->NormAngle($a); + if( $a > 0 && $a <= M_PI/2 ) + return 0; + if( $a > M_PI/2 && $a <= M_PI ) + return 1; + if( $a > M_PI && $a <= 1.5*M_PI ) + return 2; + if( $a > 1.5*M_PI ) + return 3; + } + + function StrokeGuideLabels($img,$xc,$yc,$radius) { + $n = count($this->labels); + + //----------------------------------------------------------------------- + // Step 1 of the algorithm is to construct a number of clusters + // a cluster is defined as all slices within the same quadrant (almost) + // that has an angular distance less than the treshold + //----------------------------------------------------------------------- + $tresh_hold=25 * M_PI/180; // 25 degrees difference to be in a cluster + $incluster=false; // flag if we are currently in a cluster or not + $clusters = array(); // array of clusters + $cidx=-1; // running cluster index + + // Go through all the labels and construct a number of clusters + for($i=0; $i < $n-1; ++$i) { + // Calc the angle distance between two consecutive slices + $a1=$this->la[$i]; + $a2=$this->la[$i+1]; + $q1 = $this->Quadrant($a1); + $q2 = $this->Quadrant($a2); + $diff = abs($a1-$a2); + if( $diff < $tresh_hold ) { + if( $incluster ) { + $clusters[$cidx][1]++; + // Each cluster can only cover one quadrant + // Do we cross a quadrant ( and must break the cluster) + if( $q1 != $q2 ) { + // If we cross a quadrant boundary we normally start a + // new cluster. However we need to take the 12'a clock + // and 6'a clock positions into a special consideration. + // Case 1: WE go from q=1 to q=2 if the last slice on + // the cluster for q=1 is close to 12'a clock and the + // first slice in q=0 is small we extend the previous + // cluster + if( $q1 == 1 && $q2 == 0 && $a2 > (90-15)*M_PI/180 ) { + if( $i < $n-2 ) { + $a3 = $this->la[$i+2]; + // If there isn't a cluster coming up with the next-next slice + // we extend the previous cluster to cover this slice as well + if( abs($a3-$a2) >= $tresh_hold ) { + $clusters[$cidx][1]++; + $i++; + } + } + } + elseif( $q1 == 3 && $q2 == 2 && $a2 > (270-15)*M_PI/180 ) { + if( $i < $n-2 ) { + $a3 = $this->la[$i+2]; + // If there isn't a cluster coming up with the next-next slice + // we extend the previous cluster to cover this slice as well + if( abs($a3-$a2) >= $tresh_hold ) { + $clusters[$cidx][1]++; + $i++; + } + } + } + + if( $q1==2 && $q2==1 && $a2 > (180-15)*M_PI/180 ) { + $clusters[$cidx][1]++; + $i++; + } + + $incluster = false; + } + } + elseif( $q1 == $q2) { + $incluster = true; + // Now we have a special case for quadrant 0. If we previously + // have a cluster of one in quadrant 0 we just extend that + // cluster. If we don't do this then we risk that the label + // for the cluster of one will cross the guide-line + if( $q1 == 0 && $cidx > -1 && + $clusters[$cidx][1] == 1 && + $this->Quadrant($this->la[$clusters[$cidx][0]]) == 0 ) { + $clusters[$cidx][1]++; + } + else { + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + } + else { + // Create a "cluster" of one since we are just crossing + // a quadrant + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + } + else { + if( $incluster ) { + // Add the last slice + $clusters[$cidx][1]++; + $incluster = false; + } + else { // Create a "cluster" of one + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + } + } + // Handle the very last slice + if( $incluster ) { + $clusters[$cidx][1]++; + } + else { // Create a "cluster" of one + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + + /* + if( true ) { + // Debug printout in labels + for( $i=0; $i <= $cidx; ++$i ) { + for( $j=0; $j < $clusters[$i][1]; ++$j ) { + $a = $this->la[$clusters[$i][0]+$j]; + $aa = round($a*180/M_PI); + $q = $this->Quadrant($a); + $this->labels[$clusters[$i][0]+$j]="[$q:$aa] $i:$j"; + } + } + } + */ + + //----------------------------------------------------------------------- + // Step 2 of the algorithm is use the clusters and draw the labels + // and guidelines + //----------------------------------------------------------------------- + + // We use the font height as the base factor for how far we need to + // spread the labels in the Y-direction. + $this->value->ApplyFont($img); + $fh = $img->GetFontHeight(); + $origvstep=$fh*$this->iGuideVFactor; + $this->value->SetMargin(0); + + // Number of clusters found + $nc = count($clusters); + + // Walk through all the clusters + for($i=0; $i < $nc; ++$i) { + + // Start angle and number of slices in this cluster + $csize = $clusters[$i][1]; + $a = $this->la[$clusters[$i][0]]; + $q = $this->Quadrant($a); + + // Now set up the start and end conditions to make sure that + // in each cluster we walk through the all the slices starting with the slice + // closest to the equator. Since all slices are numbered clockwise from "3'a clock" + // we have different conditions depending on in which quadrant the slice lies within. + if( $q == 0 ) { + $start = $csize-1; $idx = $start; $step = -1; $vstep = -$origvstep; + } + elseif( $q == 1 ) { + $start = 0; $idx = $start; $step = 1; $vstep = -$origvstep; + } + elseif( $q == 2 ) { + $start = $csize-1; $idx = $start; $step = -1; $vstep = $origvstep; + } + elseif( $q == 3 ) { + $start = 0; $idx = $start; $step = 1; $vstep = $origvstep; + } + + // Walk through all slices within this cluster + for($j=0; $j < $csize; ++$j) { + // Now adjust the position of the labels in each cluster starting + // with the slice that is closest to the equator of the pie + $a = $this->la[$clusters[$i][0]+$idx]; + + // Guide line start in the center of the arc of the slice + $r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; + $x = round($r*cos($a)+$xc); + $y = round($yc-$r*sin($a)); + + // The distance from the arc depends on chosen font and the "R-Factor" + $r += $fh*$this->iGuideLineRFactor; + + // Should the labels be placed curved along the pie or in straight columns + // outside the pie? + if( $this->iGuideLineCurve ) + $xt=round($r*cos($a)+$xc); + + // If this is the first slice in the cluster we need some first time + // proessing + if( $idx == $start ) { + if( ! $this->iGuideLineCurve ) + $xt=round($r*cos($a)+$xc); + $yt=round($yc-$r*sin($a)); + + // Some special consideration in case this cluster starts + // in quadrant 1 or 3 very close to the "equator" (< 20 degrees) + // and the previous clusters last slice is within the tolerance. + // In that case we add a font height to this labels Y-position + // so it doesn't collide with + // the slice in the previous cluster + $prevcluster = ($i + ($nc-1) ) % $nc; + $previdx=$clusters[$prevcluster][0]+$clusters[$prevcluster][1]-1; + if( $q == 1 && $a > 160*M_PI/180 ) { + // Get the angle for the previous clusters last slice + $diff = abs($a-$this->la[$previdx]); + if( $diff < $tresh_hold ) { + $yt -= $fh; + } + } + elseif( $q == 3 && $a > 340*M_PI/180 ) { + // We need to subtract 360 to compare angle distance between + // q=0 and q=3 + $diff = abs($a-$this->la[$previdx]-360*M_PI/180); + if( $diff < $tresh_hold ) { + $yt += $fh; + } + } + + } + else { + // The step is at minimum $vstep but if the slices are relatively large + // we make sure that we add at least a step that corresponds to the vertical + // distance between the centers at the arc on the slice + $prev_a = $this->la[$clusters[$i][0]+($idx-$step)]; + $dy = abs($radius*(sin($a)-sin($prev_a))*1.2); + if( $vstep > 0 ) + $yt += max($vstep,$dy); + else + $yt += min($vstep,-$dy); + } + + $label = $this->labels[$clusters[$i][0]+$idx]; + + if( $csize == 1 ) { + // A "meta" cluster with only one slice + $r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; + $rr = $r+$img->GetFontHeight()/2; + $xt=round($rr*cos($a)+$xc); + $yt=round($yc-$rr*sin($a)); + $this->StrokeLabel($label,$img,$xc,$yc,$a,$r); + if( $this->iShowGuideLineForSingle ) + $this->guideline->Stroke($img,$x,$y,$xt,$yt); + } + else { + $this->guideline->Stroke($img,$x,$y,$xt,$yt); + if( $q==1 || $q==2 ) { + // Left side of Pie + $this->guideline->Stroke($img,$xt,$yt,$xt-$this->guidelinemargin,$yt); + $lbladj = -$this->guidelinemargin-5; + $this->value->halign = "right"; + $this->value->valign = "center"; + } + else { + // Right side of pie + $this->guideline->Stroke($img,$xt,$yt,$xt+$this->guidelinemargin,$yt); + $lbladj = $this->guidelinemargin+5; + $this->value->halign = "left"; + $this->value->valign = "center"; + } + $this->value->Stroke($img,$label,$xt+$lbladj,$yt); + } + + // Udate idx to point to next slice in the cluster to process + $idx += $step; + } + } + } + + function StrokeAllLabels($img,$xc,$yc,$radius) { + // First normalize all angles for labels + $n = count($this->la); + for($i=0; $i < $n; ++$i) { + $this->la[$i] = $this->NormAngle($this->la[$i]); + } + if( $this->guideline->iShow ) { + $this->StrokeGuideLabels($img,$xc,$yc,$radius); + } + else { + $n = count($this->labels); + for($i=0; $i < $n; ++$i) { + $this->StrokeLabel($this->labels[$i],$img,$xc,$yc, + $this->la[$i], + $radius + $this->explode_radius[$n-1-$i]); + } + } + } + + // Position the labels of each slice + function StrokeLabel($label,$img,$xc,$yc,$a,$r) { + + // Default value + if( $this->ilabelposadj === 'auto' ) + $this->ilabelposadj = 0.65; + + // We position the values diferently depending on if they are inside + // or outside the pie + if( $this->ilabelposadj < 1.0 ) { + + $this->value->SetAlign('center','center'); + $this->value->margin = 0; + + $xt=round($this->ilabelposadj*$r*cos($a)+$xc); + $yt=round($yc-$this->ilabelposadj*$r*sin($a)); + + $this->value->Stroke($img,$label,$xt,$yt); + } + else { + + $this->value->halign = "left"; + $this->value->valign = "top"; + $this->value->margin = 0; + + // Position the axis title. + // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text + // that intersects with the extension of the corresponding axis. The code looks a little + // bit messy but this is really the only way of having a reasonable position of the + // axis titles. + $this->value->ApplyFont($img); + $h=$img->GetTextHeight($label); + // For numeric values the format of the display value + // must be taken into account + if( is_numeric($label) ) { + if( $label > 0 ) + $w=$img->GetTextWidth(sprintf($this->value->format,$label)); + else + $w=$img->GetTextWidth(sprintf($this->value->negformat,$label)); + } + else + $w=$img->GetTextWidth($label); + + if( $this->ilabelposadj > 1.0 && $this->ilabelposadj < 5.0) { + $r *= $this->ilabelposadj; + } + + $r += $img->GetFontHeight()/1.5; + + $xt=round($r*cos($a)+$xc); + $yt=round($yc-$r*sin($a)); + + // Normalize angle + while( $a < 0 ) $a += 2*M_PI; + while( $a > 2*M_PI ) $a -= 2*M_PI; + + if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); + + if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; + if( $a<=M_PI/4 ) $dy=(1-$a*2/M_PI); + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; + + $this->value->Stroke($img,$label,$xt-$dx*$w,$yt-$dy*$h); + } + } + + function UsePlotThemeColors($flag = true) { + $this->use_plot_theme_colors = $flag; + } +} // Class + + +//=================================================== +// CLASS PiePlotC +// Description: Same as a normal pie plot but with a +// filled circle in the center +//=================================================== +class PiePlotC extends PiePlot { + private $imidsize=0.5; // Fraction of total width + private $imidcolor='white'; + public $midtitle=''; + private $middlecsimtarget='',$middlecsimwintarget='',$middlecsimalt=''; + + function __construct($data,$aCenterTitle='') { + parent::__construct($data); + $this->midtitle = new Text(); + $this->midtitle->ParagraphAlign('center'); + } + + function SetMid($aTitle,$aColor='white',$aSize=0.5) { + $this->midtitle->Set($aTitle); + + $this->imidsize = $aSize ; + $this->imidcolor = $aColor ; + } + + function SetMidTitle($aTitle) { + $this->midtitle->Set($aTitle); + } + + function SetMidSize($aSize) { + $this->imidsize = $aSize ; + } + + function SetMidColor($aColor) { + $this->imidcolor = $aColor ; + } + + function SetMidCSIM($aTarget,$aAlt='',$aWinTarget='') { + $this->middlecsimtarget = $aTarget; + $this->middlecsimwintarget = $aWinTarget; + $this->middlecsimalt = $aAlt; + } + + function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { + //Slice number, ellipse centre (x,y), radius, start angle, end angle + while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; + while( $ea > 2*M_PI ) $ea = $ea - 2*M_PI; + + $sa = 2*M_PI - $sa; + $ea = 2*M_PI - $ea; + + // Special case when we have only one slice since then both start and end + // angle will be == 0 + if( abs($sa - $ea) < 0.0001 ) { + $sa=2*M_PI; $ea=0; + } + + // Add inner circle first point + $xp = floor(($this->imidsize*$radius*cos($ea))+$xc); + $yp = floor($yc-($this->imidsize*$radius*sin($ea))); + $coords = "$xp, $yp"; + + //add coordinates every 0.25 radians + $a=$ea+0.25; + + // If we cross the 360-limit with a slice we need to handle + // the fact that end angle is smaller than start + if( $sa < $ea ) { + while ($a <= 2*M_PI) { + $xp = floor($radius*cos($a)+$xc); + $yp = floor($yc-$radius*sin($a)); + $coords.= ", $xp, $yp"; + $a += 0.25; + } + $a -= 2*M_PI; + } + + while ($a < $sa) { + $xp = floor(($this->imidsize*$radius*cos($a)+$xc)); + $yp = floor($yc-($this->imidsize*$radius*sin($a))); + $coords.= ", $xp, $yp"; + $a += 0.25; + } + + // Make sure we end at the last point + $xp = floor(($this->imidsize*$radius*cos($sa)+$xc)); + $yp = floor($yc-($this->imidsize*$radius*sin($sa))); + $coords.= ", $xp, $yp"; + + // Straight line to outer circle + $xp = floor($radius*cos($sa)+$xc); + $yp = floor($yc-$radius*sin($sa)); + $coords.= ", $xp, $yp"; + + //add coordinates every 0.25 radians + $a=$sa - 0.25; + while ($a > $ea) { + $xp = floor($radius*cos($a)+$xc); + $yp = floor($yc-$radius*sin($a)); + $coords.= ", $xp, $yp"; + $a -= 0.25; + } + + //Add the last point on the arc + $xp = floor($radius*cos($ea)+$xc); + $yp = floor($yc-$radius*sin($ea)); + $coords.= ", $xp, $yp"; + + // Close the arc + $xp = floor(($this->imidsize*$radius*cos($ea))+$xc); + $yp = floor($yc-($this->imidsize*$radius*sin($ea))); + $coords .= ", $xp, $yp"; + + if( !empty($this->csimtargets[$i]) ) { + $this->csimareas .= "csimtargets[$i]."\""; + if( !empty($this->csimwintargets[$i]) ) { + $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; + } + if( !empty($this->csimalts[$i]) ) { + $tmp=sprintf($this->csimalts[$i],$this->data[$i]); + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + } + + + function Stroke($img,$aaoption=0) { + + // Stroke the pie but don't stroke values + $tmp = $this->value->show; + $this->value->show = false; + parent::Stroke($img,$aaoption); + $this->value->show = $tmp; + + $xc = round($this->posx*$img->width); + $yc = round($this->posy*$img->height); + + $radius = floor($this->radius * min($img->width,$img->height)) ; + + + if( $this->imidsize > 0 && $aaoption !== 2 ) { + + if( $this->ishadowcolor != "" ) { + $img->SetColor($this->ishadowcolor); + $img->FilledCircle($xc+$this->ishadowdrop,$yc+$this->ishadowdrop, + round($radius*$this->imidsize)); + } + + $img->SetColor($this->imidcolor); + $img->FilledCircle($xc,$yc,round($radius*$this->imidsize)); + + if( $this->pie_border && $aaoption === 0 ) { + $img->SetColor($this->color); + $img->Circle($xc,$yc,round($radius*$this->imidsize)); + } + + if( !empty($this->middlecsimtarget) ) + $this->AddMiddleCSIM($xc,$yc,round($radius*$this->imidsize)); + + } + + if( $this->value->show && $aaoption !== 1) { + $this->StrokeAllLabels($img,$xc,$yc,$radius); + $this->midtitle->SetPos($xc,$yc,'center','center'); + $this->midtitle->Stroke($img); + } + + } + + function AddMiddleCSIM($xc,$yc,$r) { + $xc=round($xc);$yc=round($yc);$r=round($r); + $this->csimareas .= "middlecsimtarget."\""; + if( !empty($this->middlecsimwintarget) ) { + $this->csimareas .= " target=\"".$this->middlecsimwintarget."\""; + } + if( !empty($this->middlecsimalt) ) { + $tmp = $this->middlecsimalt; + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + + function StrokeLabel($label,$img,$xc,$yc,$a,$r) { + + if( $this->ilabelposadj === 'auto' ) + $this->ilabelposadj = (1-$this->imidsize)/2+$this->imidsize; + + parent::StrokeLabel($label,$img,$xc,$yc,$a,$r); + + } + +} + + +//=================================================== +// CLASS PieGraph +// Description: +//=================================================== +class PieGraph extends Graph { + private $posx, $posy, $radius; + private $legends=array(); + public $plots=array(); + public $pieaa = false ; + //--------------- + // CONSTRUCTOR + function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { + parent::__construct($width,$height,$cachedName,$timeout,$inline); + $this->posx=$width/2; + $this->posy=$height/2; + $this->SetColor(array(255,255,255)); + + if ($this->graph_theme) { + $this->graph_theme->ApplyGraph($this); + } + } + + //--------------- + // PUBLIC METHODS + function Add($aObj) { + + if( is_array($aObj) && count($aObj) > 0 ) + $cl = $aObj[0]; + else + $cl = $aObj; + + if( $cl instanceof Text ) + $this->AddText($aObj); + elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) + $this->AddIcon($aObj); + else { + if( is_array($aObj) ) { + $n = count($aObj); + for($i=0; $i < $n; ++$i ) { + //if ($aObj[$i]->theme) { + // $this->ClearTheme(); + //} + $this->plots[] = $aObj[$i]; + } + } + else { + //if ($aObj->theme) { + // $this->ClearTheme(); + //} + $this->plots[] = $aObj; + } + } + + if ($this->graph_theme) { + $this->graph_theme->SetupPlot($aObj); + if ($aObj->is_using_plot_theme) { + $aObj->UsePlotThemeColors(); + } + } + } + + function SetAntiAliasing($aFlg=true) { + $this->pieaa = $aFlg; + } + + function SetColor($c) { + $this->SetMarginColor($c); + } + + + function DisplayCSIMAreas() { + $csim=""; + foreach($this->plots as $p ) { + $csim .= $p->GetCSIMareas(); + } + + $csim.= $this->legend->GetCSIMareas(); + if (preg_match_all("/area shape=\"(\w+)\" coords=\"([0-9\, ]+)\"/", $csim, $coords)) { + $this->img->SetColor($this->csimcolor); + $n = count($coords[0]); + for ($i=0; $i < $n; $i++) { + if ($coords[1][$i]=="poly") { + preg_match_all('/\s*([0-9]+)\s*,\s*([0-9]+)\s*,*/',$coords[2][$i],$pts); + $this->img->SetStartPoint($pts[1][count($pts[0])-1],$pts[2][count($pts[0])-1]); + $m = count($pts[0]); + for ($j=0; $j < $m; $j++) { + $this->img->LineTo($pts[1][$j],$pts[2][$j]); + } + } else if ($coords[1][$i]=="rect") { + $pts = preg_split('/,/', $coords[2][$i]); + $this->img->SetStartPoint($pts[0],$pts[1]); + $this->img->LineTo($pts[2],$pts[1]); + $this->img->LineTo($pts[2],$pts[3]); + $this->img->LineTo($pts[0],$pts[3]); + $this->img->LineTo($pts[0],$pts[1]); + + } + } + } + } + + // Method description + function Stroke($aStrokeFileName="") { + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // a best we can. Therefor you will see a lot of tests !$_csim in the + // code below. + $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); + + // If we are called the second time (perhaps the user has called GetHTMLImageMap() + // himself then the legends have alsready been populated once in order to get the + // CSIM coordinats. Since we do not want the legends to be populated a second time + // we clear the legends + $this->legend->Clear(); + + // We need to know if we have stroked the plot in the + // GetCSIMareas. Otherwise the CSIM hasn't been generated + // and in the case of GetCSIM called before stroke to generate + // CSIM without storing an image to disk GetCSIM must call Stroke. + $this->iHasStroked = true; + + $n = count($this->plots); + + if( $this->pieaa ) { + + if( !$_csim ) { + if( $this->background_image != "" ) { + $this->StrokeFrameBackground(); + } + else { + $this->StrokeFrame(); + $this->StrokeBackgroundGrad(); + } + } + + + $w = $this->img->width; + $h = $this->img->height; + $oldimg = $this->img->img; + + $this->img->CreateImgCanvas(2*$w,2*$h); + + $this->img->SetColor( $this->margin_color ); + $this->img->FilledRectangle(0,0,2*$w-1,2*$h-1); + + // Make all icons *2 i size since we will be scaling down the + // imahe to do the anti aliasing + $ni = count($this->iIcons); + for($i=0; $i < $ni; ++$i) { + $this->iIcons[$i]->iScale *= 2 ; + if( $this->iIcons[$i]->iX > 1 ) + $this->iIcons[$i]->iX *= 2 ; + if( $this->iIcons[$i]->iY > 1 ) + $this->iIcons[$i]->iY *= 2 ; + } + + $this->StrokeIcons(); + + for($i=0; $i < $n; ++$i) { + if( $this->plots[$i]->posx > 1 ) + $this->plots[$i]->posx *= 2 ; + if( $this->plots[$i]->posy > 1 ) + $this->plots[$i]->posy *= 2 ; + + $this->plots[$i]->Stroke($this->img,1); + + if( $this->plots[$i]->posx > 1 ) + $this->plots[$i]->posx /= 2 ; + if( $this->plots[$i]->posy > 1 ) + $this->plots[$i]->posy /= 2 ; + } + + $indent = $this->doframe ? ($this->frame_weight + ($this->doshadow ? $this->shadow_width : 0 )) : 0 ; + $indent += $this->framebevel ? $this->framebeveldepth + 1 : 0 ; + $this->img->CopyCanvasH($oldimg,$this->img->img,$indent,$indent,$indent,$indent, + $w-2*$indent,$h-2*$indent,2*($w-$indent),2*($h-$indent)); + + $this->img->img = $oldimg ; + $this->img->width = $w ; + $this->img->height = $h ; + + for($i=0; $i < $n; ++$i) { + $this->plots[$i]->Stroke($this->img,2); // Stroke labels + $this->plots[$i]->Legend($this); + } + + } + else { + + if( !$_csim ) { + if( $this->background_image != "" ) { + $this->StrokeFrameBackground(); + } + else { + $this->StrokeFrame(); + $this->StrokeBackgroundGrad(); + } + } + + $this->StrokeIcons(); + + for($i=0; $i < $n; ++$i) { + $this->plots[$i]->Stroke($this->img); + $this->plots[$i]->Legend($this); + } + } + + $this->legend->Stroke($this->img); + $this->footer->Stroke($this->img); + $this->StrokeTitles(); + + if( !$_csim ) { + + // Stroke texts + if( $this->texts != null ) { + $n = count($this->texts); + for($i=0; $i < $n; ++$i ) { + $this->texts[$i]->Stroke($this->img); + } + } + + if( _JPG_DEBUG ) { + $this->DisplayCSIMAreas(); + } + + // Should we do any final image transformation + if( $this->iImgTrans ) { + if( !class_exists('ImgTrans',false) ) { + require_once('jpgraph_imgtrans.php'); + //JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.'); + } + + $tform = new ImgTrans($this->img->img); + $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, + $this->iImgTransDirection,$this->iImgTransHighQ, + $this->iImgTransMinSize,$this->iImgTransFillColor, + $this->iImgTransBorder); + } + + + // If the filename is given as the special "__handle" + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, + $aStrokeFileName); + } + } + } +} // Class + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_pie3d.php b/includes/jpgraph/src/jpgraph_pie3d.php new file mode 100644 index 0000000..502471f --- /dev/null +++ b/includes/jpgraph/src/jpgraph_pie3d.php @@ -0,0 +1,933 @@ +radius = 0.5; + $this->data = $data; + $this->title = new Text(""); + $this->title->SetFont(FF_FONT1,FS_BOLD); + $this->value = new DisplayValue(); + $this->value->Show(); + $this->value->SetFormat('%.0f%%'); + } + + //--------------- + // PUBLIC METHODS + + // Set label arrays + function SetLegends($aLegend) { + $this->legends = array_reverse(array_slice($aLegend,0,count($this->data))); + } + + function SetSliceColors($aColors) { + $this->setslicecolors = $aColors; + } + + function Legend($aGraph) { + parent::Legend($aGraph); + $aGraph->legend->txtcol = array_reverse($aGraph->legend->txtcol); + } + + function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { + $this->csimtargets = $aTargets; + $this->csimwintargets = $aWinTargets; + $this->csimalts = $aAlts; + } + + // Should the slices be separated by a line? If color is specified as "" no line + // will be used to separate pie slices. + function SetEdge($aColor='black',$aWeight=1) { + $this->edgecolor = $aColor; + $this->edgeweight = $aWeight; + } + + // Specify projection angle for 3D in degrees + // Must be between 20 and 70 degrees + function SetAngle($a) { + if( $a<5 || $a>90 ) { + JpGraphError::RaiseL(14002); + //("PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees."); + } + else { + $this->angle = $a; + } + } + + function Add3DSliceToCSIM($i,$xc,$yc,$height,$width,$thick,$sa,$ea) { //Slice number, ellipse centre (x,y), height, width, start angle, end angle + + $sa *= M_PI/180; + $ea *= M_PI/180; + + //add coordinates of the centre to the map + $coords = "$xc, $yc"; + + //add coordinates of the first point on the arc to the map + $xp = floor($width*cos($sa)/2+$xc); + $yp = floor($yc-$height*sin($sa)/2); + $coords.= ", $xp, $yp"; + + //If on the front half, add the thickness offset + if ($sa >= M_PI && $sa <= 2*M_PI*1.01) { + $yp = floor($yp+$thick); + $coords.= ", $xp, $yp"; + } + + //add coordinates every 0.2 radians + $a=$sa+0.2; + while ($a<$ea) { + $xp = floor($width*cos($a)/2+$xc); + if ($a >= M_PI && $a <= 2*M_PI*1.01) { + $yp = floor($yc-($height*sin($a)/2)+$thick); + } else { + $yp = floor($yc-$height*sin($a)/2); + } + $coords.= ", $xp, $yp"; + $a += 0.2; + } + + //Add the last point on the arc + $xp = floor($width*cos($ea)/2+$xc); + $yp = floor($yc-$height*sin($ea)/2); + + + if ($ea >= M_PI && $ea <= 2*M_PI*1.01) { + $coords.= ", $xp, ".floor($yp+$thick); + } + $coords.= ", $xp, $yp"; + $alt=''; + + if( !empty($this->csimtargets[$i]) ) { + $this->csimareas .= "csimtargets[$i]."\""; + + if( !empty($this->csimwintargets[$i]) ) { + $this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; + } + + if( !empty($this->csimalts[$i]) ) { + $tmp=sprintf($this->csimalts[$i],$this->data[$i]); + $this->csimareas .= "alt=\"$tmp\" title=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + + } + + function SetLabels($aLabels,$aLblPosAdj="auto") { + $this->labels = $aLabels; + $this->ilabelposadj=$aLblPosAdj; + } + + + // Distance from the pie to the labels + function SetLabelMargin($m) { + $this->value->SetMargin($m); + } + + // Show a thin line from the pie to the label for a specific slice + function ShowLabelHint($f=true) { + $this->showlabelhint=$f; + } + + // Set color of hint line to label for each slice + function SetLabelHintColor($c) { + $this->labelhintcolor=$c; + } + + function SetHeight($aHeight) { + $this->iThickness = $aHeight; + } + + + // Normalize Angle between 0-360 + function NormAngle($a) { + // Normalize anle to 0 to 2M_PI + // + if( $a > 0 ) { + while($a > 360) $a -= 360; + } + else { + while($a < 0) $a += 360; + } + if( $a < 0 ) + $a = 360 + $a; + + if( $a == 360 ) $a=0; + return $a; + } + + + + // Draw one 3D pie slice at position ($xc,$yc) with height $z + function Pie3DSlice($img,$xc,$yc,$w,$h,$sa,$ea,$z,$fillcolor,$shadow=0.65) { + + // Due to the way the 3D Pie algorithm works we are + // guaranteed that any slice we get into this method + // belongs to either the left or right side of the + // pie ellipse. Hence, no slice will cross 90 or 270 + // point. + if( ($sa < 90 && $ea > 90) || ( ($sa > 90 && $sa < 270) && $ea > 270) ) { + JpGraphError::RaiseL(14003);//('Internal assertion failed. Pie3D::Pie3DSlice'); + exit(1); + } + + $p[] = array(); + + // Setup pre-calculated values + $rsa = $sa/180*M_PI; // to Rad + $rea = $ea/180*M_PI; // to Rad + $sinsa = sin($rsa); + $cossa = cos($rsa); + $sinea = sin($rea); + $cosea = cos($rea); + + // p[] is the points for the overall slice and + // pt[] is the points for the top pie + + // Angular step when approximating the arc with a polygon train. + $step = 0.05; + + if( $sa >= 270 ) { + if( $ea > 360 || ($ea > 0 && $ea <= 90) ) { + if( $ea > 0 && $ea <= 90 ) { + // Adjust angle to simplify conditions in loops + $rea += 2*M_PI; + } + + $p = array($xc,$yc,$xc,$yc+$z, + $xc+$w*$cossa,$z+$yc-$h*$sinsa); + $pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); + + for( $a=$rsa; $a < 2*M_PI; $a += $step ) { + $tca = cos($a); + $tsa = sin($a); + $p[] = $xc+$w*$tca; + $p[] = $z+$yc-$h*$tsa; + $pt[] = $xc+$w*$tca; + $pt[] = $yc-$h*$tsa; + } + + $pt[] = $xc+$w; + $pt[] = $yc; + + $p[] = $xc+$w; + $p[] = $z+$yc; + $p[] = $xc+$w; + $p[] = $yc; + $p[] = $xc; + $p[] = $yc; + + for( $a=2*M_PI+$step; $a < $rea; $a += $step ) { + $pt[] = $xc + $w*cos($a); + $pt[] = $yc - $h*sin($a); + } + + $pt[] = $xc+$w*$cosea; + $pt[] = $yc-$h*$sinea; + $pt[] = $xc; + $pt[] = $yc; + + } + else { + $p = array($xc,$yc,$xc,$yc+$z, + $xc+$w*$cossa,$z+$yc-$h*$sinsa); + $pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); + + $rea = $rea == 0.0 ? 2*M_PI : $rea; + for( $a=$rsa; $a < $rea; $a += $step ) { + $tca = cos($a); + $tsa = sin($a); + $p[] = $xc+$w*$tca; + $p[] = $z+$yc-$h*$tsa; + $pt[] = $xc+$w*$tca; + $pt[] = $yc-$h*$tsa; + } + + $pt[] = $xc+$w*$cosea; + $pt[] = $yc-$h*$sinea; + $pt[] = $xc; + $pt[] = $yc; + + $p[] = $xc+$w*$cosea; + $p[] = $z+$yc-$h*$sinea; + $p[] = $xc+$w*$cosea; + $p[] = $yc-$h*$sinea; + $p[] = $xc; + $p[] = $yc; + } + } + elseif( $sa >= 180 ) { + $p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea); + $pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); + + for( $a=$rea; $a>$rsa; $a -= $step ) { + $tca = cos($a); + $tsa = sin($a); + $p[] = $xc+$w*$tca; + $p[] = $z+$yc-$h*$tsa; + $pt[] = $xc+$w*$tca; + $pt[] = $yc-$h*$tsa; + } + + $pt[] = $xc+$w*$cossa; + $pt[] = $yc-$h*$sinsa; + $pt[] = $xc; + $pt[] = $yc; + + $p[] = $xc+$w*$cossa; + $p[] = $z+$yc-$h*$sinsa; + $p[] = $xc+$w*$cossa; + $p[] = $yc-$h*$sinsa; + $p[] = $xc; + $p[] = $yc; + + } + elseif( $sa >= 90 ) { + if( $ea > 180 ) { + $p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea); + $pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); + + for( $a=$rea; $a > M_PI; $a -= $step ) { + $tca = cos($a); + $tsa = sin($a); + $p[] = $xc+$w*$tca; + $p[] = $z + $yc - $h*$tsa; + $pt[] = $xc+$w*$tca; + $pt[] = $yc-$h*$tsa; + } + + $p[] = $xc-$w; + $p[] = $z+$yc; + $p[] = $xc-$w; + $p[] = $yc; + $p[] = $xc; + $p[] = $yc; + + $pt[] = $xc-$w; + $pt[] = $z+$yc; + $pt[] = $xc-$w; + $pt[] = $yc; + + for( $a=M_PI-$step; $a > $rsa; $a -= $step ) { + $pt[] = $xc + $w*cos($a); + $pt[] = $yc - $h*sin($a); + } + + $pt[] = $xc+$w*$cossa; + $pt[] = $yc-$h*$sinsa; + $pt[] = $xc; + $pt[] = $yc; + + } + else { // $sa >= 90 && $ea <= 180 + $p = array($xc,$yc,$xc,$yc+$z, + $xc+$w*$cosea,$z+$yc-$h*$sinea, + $xc+$w*$cosea,$yc-$h*$sinea, + $xc,$yc); + + $pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); + + for( $a=$rea; $a>$rsa; $a -= $step ) { + $pt[] = $xc + $w*cos($a); + $pt[] = $yc - $h*sin($a); + } + + $pt[] = $xc+$w*$cossa; + $pt[] = $yc-$h*$sinsa; + $pt[] = $xc; + $pt[] = $yc; + + } + } + else { // sa > 0 && ea < 90 + + $p = array($xc,$yc,$xc,$yc+$z, + $xc+$w*$cossa,$z+$yc-$h*$sinsa, + $xc+$w*$cossa,$yc-$h*$sinsa, + $xc,$yc); + + $pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); + + for( $a=$rsa; $a < $rea; $a += $step ) { + $pt[] = $xc + $w*cos($a); + $pt[] = $yc - $h*sin($a); + } + + $pt[] = $xc+$w*$cosea; + $pt[] = $yc-$h*$sinea; + $pt[] = $xc; + $pt[] = $yc; + } + + $img->PushColor($fillcolor.":".$shadow); + $img->FilledPolygon($p); + $img->PopColor(); + + $img->PushColor($fillcolor); + $img->FilledPolygon($pt); + $img->PopColor(); + } + + function SetStartAngle($aStart) { + if( $aStart < 0 || $aStart > 360 ) { + JpGraphError::RaiseL(14004);//('Slice start angle must be between 0 and 360 degrees.'); + } + $this->startangle = $aStart; + } + + // Draw a 3D Pie + function Pie3D($aaoption,$img,$data,$colors,$xc,$yc,$d,$angle,$z, + $shadow=0.65,$startangle=0,$edgecolor="",$edgeweight=1) { + + //--------------------------------------------------------------------------- + // As usual the algorithm get more complicated than I originally + // envisioned. I believe that this is as simple as it is possible + // to do it with the features I want. It's a good exercise to start + // thinking on how to do this to convince your self that all this + // is really needed for the general case. + // + // The algorithm two draw 3D pies without "real 3D" is done in + // two steps. + // First imagine the pie cut in half through a thought line between + // 12'a clock and 6'a clock. It now easy to imagine that we can plot + // the individual slices for each half by starting with the topmost + // pie slice and continue down to 6'a clock. + // + // In the algortithm this is done in three principal steps + // Step 1. Do the knife cut to ensure by splitting slices that extends + // over the cut line. This is done by splitting the original slices into + // upto 3 subslices. + // Step 2. Find the top slice for each half + // Step 3. Draw the slices from top to bottom + // + // The thing that slightly complicates this scheme with all the + // angle comparisons below is that we can have an arbitrary start + // angle so we must take into account the different equivalence classes. + // For the same reason we must walk through the angle array in a + // modulo fashion. + // + // Limitations of algorithm: + // * A small exploded slice which crosses the 270 degree point + // will get slightly nagged close to the center due to the fact that + // we print the slices in Z-order and that the slice left part + // get printed first and might get slightly nagged by a larger + // slice on the right side just before the right part of the small + // slice. Not a major problem though. + //--------------------------------------------------------------------------- + + + // Determine the height of the ellippse which gives an + // indication of the inclination angle + $h = ($angle/90.0)*$d; + $sum = 0; + for($i=0; $ilabeltype == 2 ) { + $this->adjusted_data = $this->AdjPercentage($data); + } + + // Setup the start + $accsum = 0; + $a = $startangle; + $a = $this->NormAngle($a); + + // + // Step 1 . Split all slices that crosses 90 or 270 + // + $idx=0; + $adjexplode=array(); + $numcolors = count($colors); + for($i=0; $iexplode_radius[$i]) ) { + $this->explode_radius[$i]=0; + } + + $expscale=1; + if( $aaoption == 1 ) { + $expscale=2; + } + + $la = $a + $da/2; + $explode = array( $xc + $this->explode_radius[$i]*cos($la*M_PI/180)*$expscale, + $yc - $this->explode_radius[$i]*sin($la*M_PI/180) * ($h/$d) *$expscale ); + $adjexplode[$idx] = $explode; + $labeldata[$i] = array($la,$explode[0],$explode[1]); + $originalangles[$i] = array($a,$a+$da); + + $ne = $this->NormAngle($a+$da); + if( $da <= 180 ) { + // If the slice size is <= 90 it can at maximum cut across + // one boundary (either 90 or 270) where it needs to be split + $split=-1; // no split + if( ($da<=90 && ($a <= 90 && $ne > 90)) || + (($da <= 180 && $da >90) && (($a < 90 || $a >= 270) && $ne > 90)) ) { + $split = 90; + } + elseif( ($da<=90 && ($a <= 270 && $ne > 270)) || + (($da<=180 && $da>90) && ($a >= 90 && $a < 270 && ($a+$da) > 270 )) ) { + $split = 270; + } + if( $split > 0 ) { // split in two + $angles[$idx] = array($a,$split); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + $angles[++$idx] = array($split,$ne); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + } + else { // no split + $angles[$idx] = array($a,$ne); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + } + } + else { + // da>180 + // Slice may, depending on position, cross one or two + // bonudaries + + if( $a < 90 ) $split = 90; + elseif( $a <= 270 ) $split = 270; + else $split = 90; + + $angles[$idx] = array($a,$split); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + //if( $a+$da > 360-$split ) { + // For slices larger than 270 degrees we might cross + // another boundary as well. This means that we must + // split the slice further. The comparison gets a little + // bit complicated since we must take into accound that + // a pie might have a startangle >0 and hence a slice might + // wrap around the 0 angle. + // Three cases: + // a) Slice starts before 90 and hence gets a split=90, but + // we must also check if we need to split at 270 + // b) Slice starts after 90 but before 270 and slices + // crosses 90 (after a wrap around of 0) + // c) If start is > 270 (hence the firstr split is at 90) + // and the slice is so large that it goes all the way + // around 270. + if( ($a < 90 && ($a+$da > 270)) || ($a > 90 && $a<=270 && ($a+$da>360+90) ) || ($a > 270 && $this->NormAngle($a+$da)>270) ) { + $angles[++$idx] = array($split,360-$split); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + $angles[++$idx] = array(360-$split,$ne); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + } + else { + // Just a simple split to the previous decided + // angle. + $angles[++$idx] = array($split,$ne); + $adjcolors[$idx] = $colors[$i % $numcolors]; + $adjexplode[$idx] = $explode; + } + } + $a += $da; + $a = $this->NormAngle($a); + } + + // Total number of slices + $n = count($angles); + + for($i=0; $i<$n; ++$i) { + list($dbgs,$dbge) = $angles[$i]; + } + + // + // Step 2. Find start index (first pie that starts in upper left quadrant) + // + $minval = $angles[0][0]; + $min = 0; + for( $i=0; $i<$n; ++$i ) { + if( $angles[$i][0] < $minval ) { + $minval = $angles[$i][0]; + $min = $i; + } + } + $j = $min; + $cnt = 0; + while( $angles[$j][1] <= 90 ) { + $j++; + if( $j>=$n) { + $j=0; + } + if( $cnt > $n ) { + JpGraphError::RaiseL(14005); + //("Pie3D Internal error (#1). Trying to wrap twice when looking for start index"); + } + ++$cnt; + } + $start = $j; + + // + // Step 3. Print slices in z-order + // + $cnt = 0; + + // First stroke all the slices between 90 and 270 (left half circle) + // counterclockwise + + while( $angles[$j][0] < 270 && $aaoption !== 2 ) { + + list($x,$y) = $adjexplode[$j]; + + $this->Pie3DSlice($img,$x,$y,$d,$h,$angles[$j][0],$angles[$j][1], + $z,$adjcolors[$j],$shadow); + + $last = array($x,$y,$j); + + $j++; + if( $j >= $n ) $j=0; + if( $cnt > $n ) { + JpGraphError::RaiseL(14006); + //("Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking."); + } + ++$cnt; + } + + $slice_left = $n-$cnt; + $j=$start-1; + if($j<0) $j=$n-1; + $cnt = 0; + + // The stroke all slices from 90 to -90 (right half circle) + // clockwise + while( $cnt < $slice_left && $aaoption !== 2 ) { + + list($x,$y) = $adjexplode[$j]; + + $this->Pie3DSlice($img,$x,$y,$d,$h,$angles[$j][0],$angles[$j][1], + $z,$adjcolors[$j],$shadow); + $j--; + if( $cnt > $n ) { + JpGraphError::RaiseL(14006); + //("Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking."); + } + if($j<0) $j=$n-1; + $cnt++; + } + + // Now do a special thing. Stroke the last slice on the left + // halfcircle one more time. This is needed in the case where + // the slice close to 270 have been exploded. In that case the + // part of the slice close to the center of the pie might be + // slightly nagged. + if( $aaoption !== 2 ) + $this->Pie3DSlice($img,$last[0],$last[1],$d,$h,$angles[$last[2]][0], + $angles[$last[2]][1],$z,$adjcolors[$last[2]],$shadow); + + + if( $aaoption !== 1 ) { + // Now print possible labels and add csim + $this->value->ApplyFont($img); + $margin = $img->GetFontHeight()/2 + $this->value->margin ; + for($i=0; $i < count($data); ++$i ) { + $la = $labeldata[$i][0]; + $x = $labeldata[$i][1] + cos($la*M_PI/180)*($d+$margin)*$this->ilabelposadj; + $y = $labeldata[$i][2] - sin($la*M_PI/180)*($h+$margin)*$this->ilabelposadj; + if( $this->ilabelposadj >= 1.0 ) { + if( $la > 180 && $la < 360 ) $y += $z; + } + if( $this->labeltype == 0 ) { + if( $sum > 0 ) $l = 100*$data[$i]/$sum; + else $l = 0; + } + elseif( $this->labeltype == 1 ) { + $l = $data[$i]; + } + else { + $l = $this->adjusted_data[$i]; + } + if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) { + $l=sprintf($this->labels[$i],$l); + } + + $this->StrokeLabels($l,$img,$labeldata[$i][0]*M_PI/180,$x,$y,$z); + + $this->Add3DSliceToCSIM($i,$labeldata[$i][1],$labeldata[$i][2],$h*2,$d*2,$z, + $originalangles[$i][0],$originalangles[$i][1]); + } + } + + // + // Finally add potential lines in pie + // + + if( $edgecolor=="" || $aaoption !== 0 ) return; + + $accsum = 0; + $a = $startangle; + $a = $this->NormAngle($a); + + $a *= M_PI/180.0; + + $idx=0; + $img->PushColor($edgecolor); + $img->SetLineWeight($edgeweight); + + $fulledge = true; + for($i=0; $i < count($data) && $fulledge; ++$i ) { + if( empty($this->explode_radius[$i]) ) { + $this->explode_radius[$i]=0; + } + if( $this->explode_radius[$i] > 0 ) { + $fulledge = false; + } + } + + + for($i=0; $i < count($data); ++$i, ++$idx ) { + + $da = $data[$i]/$sum * 2*M_PI; + $this->StrokeFullSliceFrame($img,$xc,$yc,$a,$a+$da,$d,$h,$z,$edgecolor, + $this->explode_radius[$i],$fulledge); + $a += $da; + } + $img->PopColor(); + } + + function StrokeFullSliceFrame($img,$xc,$yc,$sa,$ea,$w,$h,$z,$edgecolor,$exploderadius,$fulledge) { + $step = 0.02; + + if( $exploderadius > 0 ) { + $la = ($sa+$ea)/2; + $xc += $exploderadius*cos($la); + $yc -= $exploderadius*sin($la) * ($h/$w) ; + + } + + $p = array($xc,$yc,$xc+$w*cos($sa),$yc-$h*sin($sa)); + + for($a=$sa; $a < $ea; $a += $step ) { + $p[] = $xc + $w*cos($a); + $p[] = $yc - $h*sin($a); + } + + $p[] = $xc+$w*cos($ea); + $p[] = $yc-$h*sin($ea); + $p[] = $xc; + $p[] = $yc; + + $img->SetColor($edgecolor); + $img->Polygon($p); + + // Unfortunately we can't really draw the full edge around the whole of + // of the slice if any of the slices are exploded. The reason is that + // this algorithm is to simply. There are cases where the edges will + // "overwrite" other slices when they have been exploded. + // Doing the full, proper 3D hidden lines stiff is actually quite + // tricky. So for exploded pies we only draw the top edge. Not perfect + // but the "real" solution is much more complicated. + if( $fulledge && !( $sa > 0 && $sa < M_PI && $ea < M_PI) ) { + + if($sa < M_PI && $ea > M_PI) { + $sa = M_PI; + } + + if($sa < 2*M_PI && (($ea >= 2*M_PI) || ($ea > 0 && $ea < $sa ) ) ) { + $ea = 2*M_PI; + } + + if( $sa >= M_PI && $ea <= 2*M_PI ) { + $p = array($xc + $w*cos($sa),$yc - $h*sin($sa), + $xc + $w*cos($sa),$z + $yc - $h*sin($sa)); + + for($a=$sa+$step; $a < $ea; $a += $step ) { + $p[] = $xc + $w*cos($a); + $p[] = $z + $yc - $h*sin($a); + } + $p[] = $xc + $w*cos($ea); + $p[] = $z + $yc - $h*sin($ea); + $p[] = $xc + $w*cos($ea); + $p[] = $yc - $h*sin($ea); + $img->SetColor($edgecolor); + $img->Polygon($p); + } + } + } + + function Stroke($img,$aaoption=0) { + $n = count($this->data); + + // If user hasn't set the colors use the theme array + if( $this->setslicecolors==null ) { + $colors = array_keys($img->rgb->rgb_table); + sort($colors); + $idx_a=$this->themearr[$this->theme]; + $ca = array(); + $m = count($idx_a); + for($i=0; $i < $m; ++$i) { + $ca[$i] = $colors[$idx_a[$i]]; + } + $ca = array_reverse(array_slice($ca,0,$n)); + } + else { + $ca = $this->setslicecolors; + } + + + if( $this->posx <= 1 && $this->posx > 0 ) { + $xc = round($this->posx*$img->width); + } + else { + $xc = $this->posx ; + } + + if( $this->posy <= 1 && $this->posy > 0 ) { + $yc = round($this->posy*$img->height); + } + else { + $yc = $this->posy ; + } + + if( $this->radius <= 1 ) { + $width = floor($this->radius*min($img->width,$img->height)); + // Make sure that the pie doesn't overflow the image border + // The 0.9 factor is simply an extra margin to leave some space + // between the pie an the border of the image. + $width = min($width,min($xc*0.9,($yc*90/$this->angle-$width/4)*0.9)); + } + else { + $width = $this->radius * ($aaoption === 1 ? 2 : 1 ) ; + } + + // Add a sanity check for width + if( $width < 1 ) { + JpGraphError::RaiseL(14007);//("Width for 3D Pie is 0. Specify a size > 0"); + } + + // Establish a thickness. By default the thickness is a fifth of the + // pie slice width (=pie radius) but since the perspective depends + // on the inclination angle we use some heuristics to make the edge + // slightly thicker the less the angle. + + // Has user specified an absolute thickness? In that case use + // that instead + + if( $this->iThickness ) { + $thick = $this->iThickness; + $thick *= ($aaoption === 1 ? 2 : 1 ); + } + else { + $thick = $width/12; + } + $a = $this->angle; + + if( $a <= 30 ) $thick *= 1.6; + elseif( $a <= 40 ) $thick *= 1.4; + elseif( $a <= 50 ) $thick *= 1.2; + elseif( $a <= 60 ) $thick *= 1.0; + elseif( $a <= 70 ) $thick *= 0.8; + elseif( $a <= 80 ) $thick *= 0.7; + else $thick *= 0.6; + + $thick = floor($thick); + + if( $this->explode_all ) { + for($i=0; $i < $n; ++$i) + $this->explode_radius[$i]=$this->explode_r; + } + + $this->Pie3D($aaoption,$img,$this->data, $ca, $xc, $yc, $width, $this->angle, + $thick, 0.65, $this->startangle, $this->edgecolor, $this->edgeweight); + + // Adjust title position + if( $aaoption != 1 ) { + $this->title->SetPos($xc,$yc-$this->title->GetFontHeight($img)-$width/2-$this->title->margin, "center","bottom"); + $this->title->Stroke($img); + } + } + + //--------------- + // PRIVATE METHODS + + // Position the labels of each slice + function StrokeLabels($label,$img,$a,$xp,$yp,$z) { + $this->value->halign="left"; + $this->value->valign="top"; + + // Position the axis title. + // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text + // that intersects with the extension of the corresponding axis. The code looks a little + // bit messy but this is really the only way of having a reasonable position of the + // axis titles. + $this->value->ApplyFont($img); + $h=$img->GetTextHeight($label); + // For numeric values the format of the display value + // must be taken into account + if( is_numeric($label) ) { + if( $label >= 0 ) { + $w=$img->GetTextWidth(sprintf($this->value->format,$label)); + } + else { + $w=$img->GetTextWidth(sprintf($this->value->negformat,$label)); + } + } + else { + $w=$img->GetTextWidth($label); + } + + while( $a > 2*M_PI ) { + $a -= 2*M_PI; + } + + if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); + + if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; + if( $a<=M_PI/4 ) $dy=(1-$a*2/M_PI); + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; + + $x = round($xp-$dx*$w); + $y = round($yp-$dy*$h); + + // Mark anchor point for debugging + /* + $img->SetColor('red'); + $img->Line($xp-10,$yp,$xp+10,$yp); + $img->Line($xp,$yp-10,$xp,$yp+10); + */ + + $oldmargin = $this->value->margin; + $this->value->margin=0; + $this->value->Stroke($img,$label,$x,$y); + $this->value->margin=$oldmargin; + + } +} // Class + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_plotband.php b/includes/jpgraph/src/jpgraph_plotband.php new file mode 100644 index 0000000..b0ce393 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_plotband.php @@ -0,0 +1,635 @@ +x=$aX; + $this->y=$aY; + $this->w=$aWidth; + $this->h=$aHeight; + $this->xe=$aX+$aWidth-1; + $this->ye=$aY+$aHeight-1; + } +} + +//===================================================================== +// Class RectPattern +// Base class for pattern hierarchi that is used to display patterned +// bands on the graph. Any subclass that doesn't override Stroke() +// must at least implement method DoPattern($aImg) which is responsible +// for drawing the pattern onto the graph. +//===================================================================== +class RectPattern { + protected $color; + protected $weight; + protected $rect=null; + protected $doframe=true; + protected $linespacing; // Line spacing in pixels + protected $iBackgroundColor=-1; // Default is no background fill + + function __construct($aColor,$aWeight=1) { + $this->color = $aColor; + $this->weight = $aWeight; + } + + function SetBackground($aBackgroundColor) { + $this->iBackgroundColor=$aBackgroundColor; + } + + function SetPos($aRect) { + $this->rect = $aRect; + } + + function ShowFrame($aShow=true) { + $this->doframe=$aShow; + } + + function SetDensity($aDens) { + if( $aDens < 1 || $aDens > 100 ) + JpGraphError::RaiseL(16001,$aDens); + //(" Desity for pattern must be between 1 and 100. (You tried $aDens)"); + // 1% corresponds to linespacing=50 + // 100 % corresponds to linespacing 1 + $this->linespacing = floor(((100-$aDens)/100.0)*50)+1; + + } + + function Stroke($aImg) { + if( $this->rect == null ) + JpGraphError::RaiseL(16002); + //(" No positions specified for pattern."); + + if( !(is_numeric($this->iBackgroundColor) && $this->iBackgroundColor==-1) ) { + $aImg->SetColor($this->iBackgroundColor); + $aImg->FilledRectangle($this->rect->x,$this->rect->y,$this->rect->xe,$this->rect->ye); + } + + $aImg->SetColor($this->color); + $aImg->SetLineWeight($this->weight); + + // Virtual function implemented by subclass + $this->DoPattern($aImg); + + // Frame around the pattern area + if( $this->doframe ) + $aImg->Rectangle($this->rect->x,$this->rect->y,$this->rect->xe,$this->rect->ye); + } + +} + + +//===================================================================== +// Class RectPatternSolid +// Implements a solid band +//===================================================================== +class RectPatternSolid extends RectPattern { + + function __construct($aColor="black",$aWeight=1) { + parent::__construct($aColor,$aWeight); + } + + function DoPattern($aImg) { + $aImg->SetColor($this->color); + $aImg->FilledRectangle($this->rect->x,$this->rect->y, + $this->rect->xe,$this->rect->ye); + } +} + +//===================================================================== +// Class RectPatternHor +// Implements horizontal line pattern +//===================================================================== +class RectPatternHor extends RectPattern { + + function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) { + parent::__construct($aColor,$aWeight); + $this->linespacing = $aLineSpacing; + } + + function DoPattern($aImg) { + $x0 = $this->rect->x; + $x1 = $this->rect->xe; + $y = $this->rect->y; + while( $y < $this->rect->ye ) { + $aImg->Line($x0,$y,$x1,$y); + $y += $this->linespacing; + } + } +} + +//===================================================================== +// Class RectPatternVert +// Implements vertical line pattern +//===================================================================== +class RectPatternVert extends RectPattern { + + function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) { + parent::__construct($aColor,$aWeight); + $this->linespacing = $aLineSpacing; + } + + //-------------------- + // Private methods + // + function DoPattern($aImg) { + $x = $this->rect->x; + $y0 = $this->rect->y; + $y1 = $this->rect->ye; + while( $x < $this->rect->xe ) { + $aImg->Line($x,$y0,$x,$y1); + $x += $this->linespacing; + } + } +} + + +//===================================================================== +// Class RectPatternRDiag +// Implements right diagonal pattern +//===================================================================== +class RectPatternRDiag extends RectPattern { + + function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) { + parent::__construct($aColor,$aWeight); + $this->linespacing = $aLineSpacing; + } + + function DoPattern($aImg) { + // -------------------- + // | / / / / /| + // |/ / / / / | + // | / / / / | + // -------------------- + $xe = $this->rect->xe; + $ye = $this->rect->ye; + $x0 = $this->rect->x + round($this->linespacing/2); + $y0 = $this->rect->y; + $x1 = $this->rect->x; + $y1 = $this->rect->y + round($this->linespacing/2); + + while($x0<=$xe && $y1<=$ye) { + $aImg->Line($x0,$y0,$x1,$y1); + $x0 += $this->linespacing; + $y1 += $this->linespacing; + } + + if( $xe-$x1 > $ye-$y0 ) { + // Width larger than height + $x1 = $this->rect->x + ($y1-$ye); + $y1 = $ye; + $y0 = $this->rect->y; + while( $x0 <= $xe ) { + $aImg->Line($x0,$y0,$x1,$y1); + $x0 += $this->linespacing; + $x1 += $this->linespacing; + } + + $y0=$this->rect->y + ($x0-$xe); + $x0=$xe; + } + else { + // Height larger than width + $diff = $x0-$xe; + $y0 = $diff+$this->rect->y; + $x0 = $xe; + $x1 = $this->rect->x; + while( $y1 <= $ye ) { + $aImg->Line($x0,$y0,$x1,$y1); + $y1 += $this->linespacing; + $y0 += $this->linespacing; + } + + $diff = $y1-$ye; + $y1 = $ye; + $x1 = $diff + $this->rect->x; + } + + while( $y0 <= $ye ) { + $aImg->Line($x0,$y0,$x1,$y1); + $y0 += $this->linespacing; + $x1 += $this->linespacing; + } + } +} + +//===================================================================== +// Class RectPatternLDiag +// Implements left diagonal pattern +//===================================================================== +class RectPatternLDiag extends RectPattern { + + function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) { + $this->linespacing = $aLineSpacing; + parent::__construct($aColor,$aWeight); + } + + function DoPattern($aImg) { + // -------------------- + // |\ \ \ \ \ | + // | \ \ \ \ \| + // | \ \ \ \ | + // |------------------| + $xe = $this->rect->xe; + $ye = $this->rect->ye; + $x0 = $this->rect->x + round($this->linespacing/2); + $y0 = $this->rect->ye; + $x1 = $this->rect->x; + $y1 = $this->rect->ye - round($this->linespacing/2); + + while($x0<=$xe && $y1>=$this->rect->y) { + $aImg->Line($x0,$y0,$x1,$y1); + $x0 += $this->linespacing; + $y1 -= $this->linespacing; + } + if( $xe-$x1 > $ye-$this->rect->y ) { + // Width larger than height + $x1 = $this->rect->x + ($this->rect->y-$y1); + $y0=$ye; $y1=$this->rect->y; + while( $x0 <= $xe ) { + $aImg->Line($x0,$y0,$x1,$y1); + $x0 += $this->linespacing; + $x1 += $this->linespacing; + } + + $y0=$this->rect->ye - ($x0-$xe); + $x0=$xe; + } + else { + // Height larger than width + $diff = $x0-$xe; + $y0 = $ye-$diff; + $x0 = $xe; + while( $y1 >= $this->rect->y ) { + $aImg->Line($x0,$y0,$x1,$y1); + $y0 -= $this->linespacing; + $y1 -= $this->linespacing; + } + $diff = $this->rect->y - $y1; + $x1 = $this->rect->x + $diff; + $y1 = $this->rect->y; + } + while( $y0 >= $this->rect->y ) { + $aImg->Line($x0,$y0,$x1,$y1); + $y0 -= $this->linespacing; + $x1 += $this->linespacing; + } + } +} + +//===================================================================== +// Class RectPattern3DPlane +// Implements "3D" plane pattern +//===================================================================== +class RectPattern3DPlane extends RectPattern { + private $alpha=50; // Parameter that specifies the distance + // to "simulated" horizon in pixel from the + // top of the band. Specifies how fast the lines + // converge. + + function __construct($aColor="black",$aWeight=1) { + parent::__construct($aColor,$aWeight); + $this->SetDensity(10); // Slightly larger default + } + + function SetHorizon($aHorizon) { + $this->alpha=$aHorizon; + } + + function DoPattern($aImg) { + // "Fake" a nice 3D grid-effect. + $x0 = $this->rect->x + $this->rect->w/2; + $y0 = $this->rect->y; + $x1 = $x0; + $y1 = $this->rect->ye; + $x0_right = $x0; + $x1_right = $x1; + + // BTW "apa" means monkey in Swedish but is really a shortform for + // "alpha+a" which was the labels I used on paper when I derived the + // geometric to get the 3D perspective right. + // $apa is the height of the bounding rectangle plus the distance to the + // artifical horizon (alpha) + $apa = $this->rect->h + $this->alpha; + + // Three cases and three loops + // 1) The endpoint of the line ends on the bottom line + // 2) The endpoint ends on the side + // 3) Horizontal lines + + // Endpoint falls on bottom line + $middle=$this->rect->x + $this->rect->w/2; + $dist=$this->linespacing; + $factor=$this->alpha /($apa); + while($x1>$this->rect->x) { + $aImg->Line($x0,$y0,$x1,$y1); + $aImg->Line($x0_right,$y0,$x1_right,$y1); + $x1 = $middle - $dist; + $x0 = $middle - $dist * $factor; + $x1_right = $middle + $dist; + $x0_right = $middle + $dist * $factor; + $dist += $this->linespacing; + } + + // Endpoint falls on sides + $dist -= $this->linespacing; + $d=$this->rect->w/2; + $c = $apa - $d*$apa/$dist; + while( $x0>$this->rect->x ) { + $aImg->Line($x0,$y0,$this->rect->x,$this->rect->ye-$c); + $aImg->Line($x0_right,$y0,$this->rect->xe,$this->rect->ye-$c); + $dist += $this->linespacing; + $x0 = $middle - $dist * $factor; + $x1 = $middle - $dist; + $x0_right = $middle + $dist * $factor; + $c = $apa - $d*$apa/$dist; + } + + // Horizontal lines + // They need some serious consideration since they are a function + // of perspective depth (alpha) and density (linespacing) + $x0=$this->rect->x; + $x1=$this->rect->xe; + $y=$this->rect->ye; + + // The first line is drawn directly. Makes the loop below slightly + // more readable. + $aImg->Line($x0,$y,$x1,$y); + $hls = $this->linespacing; + + // A correction factor for vertical "brick" line spacing to account for + // a) the difference in number of pixels hor vs vert + // b) visual apperance to make the first layer of "bricks" look more + // square. + $vls = $this->linespacing*0.6; + + $ds = $hls*($apa-$vls)/$apa; + // Get the slope for the "perspective line" going from bottom right + // corner to top left corner of the "first" brick. + + // Uncomment the following lines if you want to get a visual understanding + // of what this helpline does. BTW this mimics the way you would get the + // perspective right when drawing on paper. + /* + $x0 = $middle; + $y0 = $this->rect->ye; + $len=floor(($this->rect->ye-$this->rect->y)/$vls); + $x1 = $middle+round($len*$ds); + $y1 = $this->rect->ye-$len*$vls; + $aImg->PushColor("red"); + $aImg->Line($x0,$y0,$x1,$y1); + $aImg->PopColor(); + */ + + $y -= $vls; + $k=($this->rect->ye-($this->rect->ye-$vls))/($middle-($middle-$ds)); + $dist = $hls; + while( $y>$this->rect->y ) { + $aImg->Line($this->rect->x,$y,$this->rect->xe,$y); + $adj = $k*$dist/(1+$dist*$k/$apa); + if( $adj < 2 ) $adj=1; + $y = $this->rect->ye - round($adj); + $dist += $hls; + } + } +} + +//===================================================================== +// Class RectPatternCross +// Vert/Hor crosses +//===================================================================== +class RectPatternCross extends RectPattern { + private $vert=null; + private $hor=null; + function __construct($aColor="black",$aWeight=1) { + parent::__construct($aColor,$aWeight); + $this->vert = new RectPatternVert($aColor,$aWeight); + $this->hor = new RectPatternHor($aColor,$aWeight); + } + + function SetOrder($aDepth) { + $this->vert->SetOrder($aDepth); + $this->hor->SetOrder($aDepth); + } + + function SetPos($aRect) { + parent::SetPos($aRect); + $this->vert->SetPos($aRect); + $this->hor->SetPos($aRect); + } + + function SetDensity($aDens) { + $this->vert->SetDensity($aDens); + $this->hor->SetDensity($aDens); + } + + function DoPattern($aImg) { + $this->vert->DoPattern($aImg); + $this->hor->DoPattern($aImg); + } +} + +//===================================================================== +// Class RectPatternDiagCross +// Vert/Hor crosses +//===================================================================== + +class RectPatternDiagCross extends RectPattern { + private $left=null; + private $right=null; + function __construct($aColor="black",$aWeight=1) { + parent::__construct($aColor,$aWeight); + $this->right = new RectPatternRDiag($aColor,$aWeight); + $this->left = new RectPatternLDiag($aColor,$aWeight); + } + + function SetOrder($aDepth) { + $this->left->SetOrder($aDepth); + $this->right->SetOrder($aDepth); + } + + function SetPos($aRect) { + parent::SetPos($aRect); + $this->left->SetPos($aRect); + $this->right->SetPos($aRect); + } + + function SetDensity($aDens) { + $this->left->SetDensity($aDens); + $this->right->SetDensity($aDens); + } + + function DoPattern($aImg) { + $this->left->DoPattern($aImg); + $this->right->DoPattern($aImg); + } + +} + +//===================================================================== +// Class RectPatternFactory +// Factory class for rectangular pattern +//===================================================================== +class RectPatternFactory { + function __construct() { + // Empty + } + function Create($aPattern,$aColor,$aWeight=1) { + switch($aPattern) { + case BAND_RDIAG: + $obj = new RectPatternRDiag($aColor,$aWeight); + break; + case BAND_LDIAG: + $obj = new RectPatternLDiag($aColor,$aWeight); + break; + case BAND_SOLID: + $obj = new RectPatternSolid($aColor,$aWeight); + break; + case BAND_VLINE: + $obj = new RectPatternVert($aColor,$aWeight); + break; + case BAND_HLINE: + $obj = new RectPatternHor($aColor,$aWeight); + break; + case BAND_3DPLANE: + $obj = new RectPattern3DPlane($aColor,$aWeight); + break; + case BAND_HVCROSS: + $obj = new RectPatternCross($aColor,$aWeight); + break; + case BAND_DIAGCROSS: + $obj = new RectPatternDiagCross($aColor,$aWeight); + break; + default: + JpGraphError::RaiseL(16003,$aPattern); + //(" Unknown pattern specification ($aPattern)"); + } + return $obj; + } +} + + +//===================================================================== +// Class PlotBand +// Factory class which is used by the client. +// It is responsible for factoring the corresponding pattern +// concrete class. +//===================================================================== +class PlotBand { + public $depth; // Determine if band should be over or under the plots + private $prect=null; + private $dir, $min, $max; + + function __construct($aDir,$aPattern,$aMin,$aMax,$aColor="black",$aWeight=1,$aDepth=DEPTH_BACK) { + $f = new RectPatternFactory(); + $this->prect = $f->Create($aPattern,$aColor,$aWeight); + if( is_numeric($aMin) && is_numeric($aMax) && ($aMin > $aMax) ) + JpGraphError::RaiseL(16004); + //('Min value for plotband is larger than specified max value. Please correct.'); + $this->dir = $aDir; + $this->min = $aMin; + $this->max = $aMax; + $this->depth=$aDepth; + } + + // Set position. aRect contains absolute image coordinates + function SetPos($aRect) { + assert( $this->prect != null ) ; + $this->prect->SetPos($aRect); + } + + function ShowFrame($aFlag=true) { + $this->prect->ShowFrame($aFlag); + } + + // Set z-order. In front of pplot or in the back + function SetOrder($aDepth) { + $this->depth=$aDepth; + } + + function SetDensity($aDens) { + $this->prect->SetDensity($aDens); + } + + function GetDir() { + return $this->dir; + } + + function GetMin() { + return $this->min; + } + + function GetMax() { + return $this->max; + } + + function PreStrokeAdjust($aGraph) { + // Nothing to do + } + + // Display band + function Stroke($aImg,$aXScale,$aYScale) { + assert( $this->prect != null ) ; + if( $this->dir == HORIZONTAL ) { + if( $this->min === 'min' ) $this->min = $aYScale->GetMinVal(); + if( $this->max === 'max' ) $this->max = $aYScale->GetMaxVal(); + + // Only draw the bar if it actually appears in the range + if ($this->min < $aYScale->GetMaxVal() && $this->max > $aYScale->GetMinVal()) { + + // Trucate to limit of axis + $this->min = max($this->min, $aYScale->GetMinVal()); + $this->max = min($this->max, $aYScale->GetMaxVal()); + + $x=$aXScale->scale_abs[0]; + $y=$aYScale->Translate($this->max); + $width=$aXScale->scale_abs[1]-$aXScale->scale_abs[0]+1; + $height=abs($y-$aYScale->Translate($this->min))+1; + $this->prect->SetPos(new Rectangle($x,$y,$width,$height)); + $this->prect->Stroke($aImg); + } + } + else { // VERTICAL + if( $this->min === 'min' ) $this->min = $aXScale->GetMinVal(); + if( $this->max === 'max' ) $this->max = $aXScale->GetMaxVal(); + + // Only draw the bar if it actually appears in the range + if ($this->min < $aXScale->GetMaxVal() && $this->max > $aXScale->GetMinVal()) { + + // Trucate to limit of axis + $this->min = max($this->min, $aXScale->GetMinVal()); + $this->max = min($this->max, $aXScale->GetMaxVal()); + + $y=$aYScale->scale_abs[1]; + $x=$aXScale->Translate($this->min); + $height=abs($aYScale->scale_abs[1]-$aYScale->scale_abs[0]); + $width=abs($x-$aXScale->Translate($this->max)); + $this->prect->SetPos(new Rectangle($x,$y,$width,$height)); + $this->prect->Stroke($aImg); + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/jpgraph_plotline.php b/includes/jpgraph/src/jpgraph_plotline.php new file mode 100644 index 0000000..b0ba30e --- /dev/null +++ b/includes/jpgraph/src/jpgraph_plotline.php @@ -0,0 +1,142 @@ +direction = $aDir; + $this->color=$aColor; + $this->weight=$aWeight; + $this->scaleposition=$aPos; + } + + function SetLegend($aLegend,$aCSIM='',$aCSIMAlt='',$aCSIMWinTarget='') { + $this->legend = $aLegend; + $this->legendcsimtarget = $aCSIM; + $this->legendcsimwintarget = $aCSIMWinTarget; + $this->legendcsimalt = $aCSIMAlt; + } + + function HideLegend($f=true) { + $this->hidelegend = $f; + } + + function SetPosition($aScalePosition) { + $this->scaleposition=$aScalePosition; + } + + function SetDirection($aDir) { + $this->direction = $aDir; + } + + function SetColor($aColor) { + $this->color=$aColor; + } + + function SetWeight($aWeight) { + $this->weight=$aWeight; + } + + function SetLineStyle($aStyle) { + $this->iLineStyle = $aStyle; + } + + function GetCSIMAreas() { + return ''; + } + + //--------------- + // PRIVATE METHODS + + function DoLegend($graph) { + if( !$this->hidelegend ) $this->Legend($graph); + } + + // Framework function the chance for each plot class to set a legend + function Legend($aGraph) { + if( $this->legend != '' ) { + $dummyPlotMark = new PlotMark(); + $lineStyle = 1; + $aGraph->legend->Add($this->legend,$this->color,$dummyPlotMark,$lineStyle, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + } + + function PreStrokeAdjust($aGraph) { + // Nothing to do + } + + // Called by framework to allow the object to draw + // optional information in the margin area + function StrokeMargin($aImg) { + // Nothing to do + } + + // Framework function to allow the object to adjust the scale + function PrescaleSetup($aGraph) { + // Nothing to do + } + + function Min() { + return array(null,null); + } + + function Max() { + return array(null,null); + } + + function _Stroke($aImg,$aMinX,$aMinY,$aMaxX,$aMaxY,$aXPos,$aYPos) { + $aImg->SetColor($this->color); + $aImg->SetLineWeight($this->weight); + $oldStyle = $aImg->SetLineStyle($this->iLineStyle); + if( $this->direction == VERTICAL ) { + $ymin_abs = $aMinY; + $ymax_abs = $aMaxY; + $xpos_abs = $aXPos; + $aImg->StyleLine($xpos_abs, $ymin_abs, $xpos_abs, $ymax_abs); + } + elseif( $this->direction == HORIZONTAL ) { + $xmin_abs = $aMinX; + $xmax_abs = $aMaxX; + $ypos_abs = $aYPos; + $aImg->StyleLine($xmin_abs, $ypos_abs, $xmax_abs, $ypos_abs); + } + else { + JpGraphError::RaiseL(25125);//(" Illegal direction for static line"); + } + $aImg->SetLineStyle($oldStyle); + } + + function Stroke($aImg,$aXScale,$aYScale) { + $this->_Stroke($aImg, + $aImg->left_margin, + $aYScale->Translate($aYScale->GetMinVal()), + $aImg->width-$aImg->right_margin, + $aYScale->Translate($aYScale->GetMaxVal()), + $aXScale->Translate($this->scaleposition), + $aYScale->Translate($this->scaleposition) + ); + } +} + + +?> diff --git a/includes/jpgraph/src/jpgraph_plotmark.inc.php b/includes/jpgraph/src/jpgraph_plotmark.inc.php new file mode 100644 index 0000000..48e42c3 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_plotmark.inc.php @@ -0,0 +1,504 @@ +title = new Text(); + $this->title->Hide(); + $this->csimareas = ''; + $this->type=-1; + } + //--------------- + // PUBLIC METHODS + function SetType($aType,$aFileName='',$aScale=1.0) { + $this->type = $aType; + if( $aType == MARK_IMG && $aFileName=='' ) { + JpGraphError::RaiseL(23003);//('A filename must be specified if you set the mark type to MARK_IMG.'); + } + $this->iFileName = $aFileName; + $this->iScale = $aScale; + } + + function SetCallback($aFunc) { + $this->iFormatCallback = $aFunc; + } + + function SetCallbackYX($aFunc) { + $this->iFormatCallback2 = $aFunc; + } + + function GetType() { + return $this->type; + } + + function SetColor($aColor) { + $this->color=$aColor; + } + + function SetFillColor($aFillColor) { + $this->fill_color = $aFillColor; + } + + function SetWeight($aWeight) { + $this->weight = $aWeight; + } + + // Synonym for SetWidth() + function SetSize($aWidth) { + $this->width=$aWidth; + } + + function SetWidth($aWidth) { + $this->width=$aWidth; + } + + function SetDefaultWidth() { + switch( $this->type ) { + case MARK_CIRCLE: + case MARK_FILLEDCIRCLE: + $this->width=4; + break; + default: + $this->width=7; + } + } + + function GetWidth() { + return $this->width; + } + + function Hide($aHide=true) { + $this->show = !$aHide; + } + + function Show($aShow=true) { + $this->show = $aShow; + } + + function SetCSIMAltVal($aY,$aX='') { + $this->yvalue=$aY; + $this->xvalue=$aX; + } + + function SetCSIMTarget($aTarget,$aWinTarget='') { + $this->csimtarget=$aTarget; + $this->csimwintarget=$aWinTarget; + } + + function SetCSIMAlt($aAlt) { + $this->csimalt=$aAlt; + } + + function GetCSIMAreas(){ + return $this->csimareas; + } + + function AddCSIMPoly($aPts) { + $coords = round($aPts[0]).", ".round($aPts[1]); + $n = count($aPts)/2; + for( $i=1; $i < $n; ++$i){ + $coords .= ", ".round($aPts[2*$i]).", ".round($aPts[2*$i+1]); + } + $this->csimareas=""; + if( !empty($this->csimtarget) ) { + $this->csimareas .= "csimtarget)."\""; + + if( !empty($this->csimwintarget) ) { + $this->csimareas .= " target=\"".$this->csimwintarget."\" "; + } + + if( !empty($this->csimalt) ) { + $tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue); + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\""; + } + $this->csimareas .= " />\n"; + } + } + + function AddCSIMCircle($x,$y,$r) { + $x = round($x); $y=round($y); $r=round($r); + $this->csimareas=""; + if( !empty($this->csimtarget) ) { + $this->csimareas .= "csimtarget)."\""; + + if( !empty($this->csimwintarget) ) { + $this->csimareas .= " target=\"".$this->csimwintarget."\" "; + } + + if( !empty($this->csimalt) ) { + $tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue); + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + } + + function Stroke($img,$x,$y) { + if( !$this->show ) return; + + if( $this->iFormatCallback != '' || $this->iFormatCallback2 != '' ) { + + if( $this->iFormatCallback != '' ) { + $f = $this->iFormatCallback; + list($width,$color,$fcolor) = call_user_func($f,$this->yvalue); + $filename = $this->iFileName; + $imgscale = $this->iScale; + } + else { + $f = $this->iFormatCallback2; + list($width,$color,$fcolor,$filename,$imgscale) = call_user_func($f,$this->yvalue,$this->xvalue); + if( $filename=="" ) $filename = $this->iFileName; + if( $imgscale=="" ) $imgscale = $this->iScale; + } + + if( $width=="" ) $width = $this->width; + if( $color=="" ) $color = $this->color; + if( $fcolor=="" ) $fcolor = $this->fill_color; + + } + else { + $fcolor = $this->fill_color; + $color = $this->color; + $width = $this->width; + $filename = $this->iFileName; + $imgscale = $this->iScale; + } + + if( $this->type == MARK_IMG || + ($this->type >= MARK_FLAG1 && $this->type <= MARK_FLAG4 ) || + $this->type >= MARK_IMG_PUSHPIN ) { + + // Note: For the builtin images we use the "filename" parameter + // to denote the color + $anchor_x = 0.5; + $anchor_y = 0.5; + switch( $this->type ) { + case MARK_FLAG1: + case MARK_FLAG2: + case MARK_FLAG3: + case MARK_FLAG4: + $this->markimg = FlagCache::GetFlagImgByName($this->type-MARK_FLAG1+1,$filename); + break; + + case MARK_IMG : + // Load an image and use that as a marker + // Small optimization, if we have already read an image don't + // waste time reading it again. + if( $this->markimg == '' || !($this->oldfilename === $filename) ) { + $this->markimg = Graph::LoadBkgImage('',$filename); + $this->oldfilename = $filename ; + } + break; + + case MARK_IMG_PUSHPIN: + case MARK_IMG_SPUSHPIN: + case MARK_IMG_LPUSHPIN: + if( $this->imgdata_pushpins == null ) { + require_once 'imgdata_pushpins.inc.php'; + $this->imgdata_pushpins = new ImgData_PushPins(); + } + $this->markimg = $this->imgdata_pushpins->GetImg($this->type,$filename); + list($anchor_x,$anchor_y) = $this->imgdata_pushpins->GetAnchor(); + break; + + case MARK_IMG_SQUARE: + if( $this->imgdata_squares == null ) { + require_once 'imgdata_squares.inc.php'; + $this->imgdata_squares = new ImgData_Squares(); + } + $this->markimg = $this->imgdata_squares->GetImg($this->type,$filename); + list($anchor_x,$anchor_y) = $this->imgdata_squares->GetAnchor(); + break; + + case MARK_IMG_STAR: + if( $this->imgdata_stars == null ) { + require_once 'imgdata_stars.inc.php'; + $this->imgdata_stars = new ImgData_Stars(); + } + $this->markimg = $this->imgdata_stars->GetImg($this->type,$filename); + list($anchor_x,$anchor_y) = $this->imgdata_stars->GetAnchor(); + break; + + case MARK_IMG_BEVEL: + if( $this->imgdata_bevels == null ) { + require_once 'imgdata_bevels.inc.php'; + $this->imgdata_bevels = new ImgData_Bevels(); + } + $this->markimg = $this->imgdata_bevels->GetImg($this->type,$filename); + list($anchor_x,$anchor_y) = $this->imgdata_bevels->GetAnchor(); + break; + + case MARK_IMG_DIAMOND: + if( $this->imgdata_diamonds == null ) { + require_once 'imgdata_diamonds.inc.php'; + $this->imgdata_diamonds = new ImgData_Diamonds(); + } + $this->markimg = $this->imgdata_diamonds->GetImg($this->type,$filename); + list($anchor_x,$anchor_y) = $this->imgdata_diamonds->GetAnchor(); + break; + + case MARK_IMG_BALL: + case MARK_IMG_SBALL: + case MARK_IMG_MBALL: + case MARK_IMG_LBALL: + if( $this->imgdata_balls == null ) { + require_once 'imgdata_balls.inc.php'; + $this->imgdata_balls = new ImgData_Balls(); + } + $this->markimg = $this->imgdata_balls->GetImg($this->type,$filename); + list($anchor_x,$anchor_y) = $this->imgdata_balls->GetAnchor(); + break; + } + + $w = $img->GetWidth($this->markimg); + $h = $img->GetHeight($this->markimg); + + $dw = round($imgscale * $w ); + $dh = round($imgscale * $h ); + + // Do potential rotation + list($x,$y) = $img->Rotate($x,$y); + + $dx = round($x-$dw*$anchor_x); + $dy = round($y-$dh*$anchor_y); + + $this->width = max($dx,$dy); + + $img->Copy($this->markimg,$dx,$dy,0,0,$dw,$dh,$w,$h); + if( !empty($this->csimtarget) ) { + $this->csimareas = "csimtarget)."\""; + + if( !empty($this->csimwintarget) ) { + $this->csimareas .= " target=\"".$this->csimwintarget."\" "; + } + + if( !empty($this->csimalt) ) { + $tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue); + $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; + } + $this->csimareas .= " />\n"; + } + + // Stroke title + $this->title->Align("center","top"); + $this->title->Stroke($img,$x,$y+round($dh/2)); + return; + } + + $weight = $this->weight; + $dx=round($width/2,0); + $dy=round($width/2,0); + $pts=0; + + switch( $this->type ) { + case MARK_SQUARE: + $c[]=$x-$dx;$c[]=$y-$dy; + $c[]=$x+$dx;$c[]=$y-$dy; + $c[]=$x+$dx;$c[]=$y+$dy; + $c[]=$x-$dx;$c[]=$y+$dy; + $c[]=$x-$dx;$c[]=$y-$dy; + $pts=5; + break; + case MARK_UTRIANGLE: + ++$dx;++$dy; + $c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx + $c[]=$x;$c[]=$y-0.87*$dy; + $c[]=$x+$dx;$c[]=$y+0.87*$dy; + $c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx + $pts=4; + break; + case MARK_DTRIANGLE: + ++$dx;++$dy; + $c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx + $c[]=$x-$dx;$c[]=$y-0.87*$dy; + $c[]=$x+$dx;$c[]=$y-0.87*$dy; + $c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx + $pts=4; + break; + case MARK_DIAMOND: + $c[]=$x;$c[]=$y+$dy; + $c[]=$x-$dx;$c[]=$y; + $c[]=$x;$c[]=$y-$dy; + $c[]=$x+$dx;$c[]=$y; + $c[]=$x;$c[]=$y+$dy; + $pts=5; + break; + case MARK_LEFTTRIANGLE: + $c[]=$x;$c[]=$y; + $c[]=$x;$c[]=$y+2*$dy; + $c[]=$x+$dx*2;$c[]=$y; + $c[]=$x;$c[]=$y; + $pts=4; + break; + case MARK_RIGHTTRIANGLE: + $c[]=$x-$dx*2;$c[]=$y; + $c[]=$x;$c[]=$y+2*$dy; + $c[]=$x;$c[]=$y; + $c[]=$x-$dx*2;$c[]=$y; + $pts=4; + break; + case MARK_FLASH: + $dy *= 2; + $c[]=$x+$dx/2; $c[]=$y-$dy; + $c[]=$x-$dx+$dx/2; $c[]=$y+$dy*0.7-$dy; + $c[]=$x+$dx/2; $c[]=$y+$dy*1.3-$dy; + $c[]=$x-$dx+$dx/2; $c[]=$y+2*$dy-$dy; + $img->SetLineWeight($weight); + $img->SetColor($color); + $img->Polygon($c); + $img->SetLineWeight(1); + $this->AddCSIMPoly($c); + break; + } + + if( $pts>0 ) { + $this->AddCSIMPoly($c); + $img->SetLineWeight($weight); + $img->SetColor($fcolor); + $img->FilledPolygon($c); + $img->SetColor($color); + $img->Polygon($c); + $img->SetLineWeight(1); + } + elseif( $this->type==MARK_CIRCLE ) { + $img->SetColor($color); + $img->Circle($x,$y,$width); + $this->AddCSIMCircle($x,$y,$width); + } + elseif( $this->type==MARK_FILLEDCIRCLE ) { + $img->SetColor($fcolor); + $img->FilledCircle($x,$y,$width); + $img->SetColor($color); + $img->Circle($x,$y,$width); + $this->AddCSIMCircle($x,$y,$width); + } + elseif( $this->type==MARK_CROSS ) { + // Oversize by a pixel to match the X + $img->SetColor($color); + $img->SetLineWeight($weight); + $img->Line($x,$y+$dy+1,$x,$y-$dy-1); + $img->Line($x-$dx-1,$y,$x+$dx+1,$y); + $this->AddCSIMCircle($x,$y,$dx); + } + elseif( $this->type==MARK_X ) { + $img->SetColor($color); + $img->SetLineWeight($weight); + $img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy); + $img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy); + $this->AddCSIMCircle($x,$y,$dx+$dy); + } + elseif( $this->type==MARK_STAR ) { + $img->SetColor($color); + $img->SetLineWeight($weight); + $img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy); + $img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy); + // Oversize by a pixel to match the X + $img->Line($x,$y+$dy+1,$x,$y-$dy-1); + $img->Line($x-$dx-1,$y,$x+$dx+1,$y); + $this->AddCSIMCircle($x,$y,$dx+$dy); + } + + // Stroke title + $this->title->Align("center","center"); + $this->title->Stroke($img,$x,$y); + } +} // Class + + + +//======================================================================== +// CLASS ImgData +// Description: Base class for all image data classes that contains the +// real image data. +//======================================================================== +class ImgData { + protected $name = ''; // Each subclass gives a name + protected $an = array(); // Data array names + protected $colors = array(); // Available colors + protected $index = array(); // Index for colors + protected $maxidx = 0 ; // Max color index + protected $anchor_x=0.5, $anchor_y=0.5 ; // Where is the center of the image + + function __construct() { + // Empty + } + + // Create a GD image from the data and return a GD handle + function GetImg($aMark,$aIdx) { + $n = $this->an[$aMark]; + if( is_string($aIdx) ) { + if( !in_array($aIdx,$this->colors) ) { + JpGraphError::RaiseL(23001,$this->name,$aIdx);//('This marker "'.($this->name).'" does not exist in color: '.$aIdx); + } + $idx = $this->index[$aIdx]; + } + elseif( !is_integer($aIdx) || + (is_integer($aIdx) && $aIdx > $this->maxidx ) ) { + JpGraphError::RaiseL(23002,$this->name);//('Mark color index too large for marker "'.($this->name).'"'); + } + else + $idx = $aIdx ; + return Image::CreateFromString(base64_decode($this->{$n}[$idx][1])); + } + + function GetAnchor() { + return array($this->anchor_x,$this->anchor_y); + } +} + + +// Keep a global flag cache to reduce memory usage +$_gFlagCache=array( +1 => null, +2 => null, +3 => null, +4 => null, +); +// Only supposed to b called as statics +class FlagCache { + + static function GetFlagImgByName($aSize,$aName) { + global $_gFlagCache; + require_once('jpgraph_flags.php'); + if( $_gFlagCache[$aSize] === null ) { + $_gFlagCache[$aSize] = new FlagImages($aSize); + } + $f = $_gFlagCache[$aSize]; + $idx = $f->GetIdxByName($aName,$aFullName); + return $f->GetImgByIdx($idx); + } +} + +?> diff --git a/includes/jpgraph/src/jpgraph_polar.php b/includes/jpgraph/src/jpgraph_polar.php new file mode 100644 index 0000000..7459dff --- /dev/null +++ b/includes/jpgraph/src/jpgraph_polar.php @@ -0,0 +1,897 @@ +numpoints = $n/2; + $this->coord = $aData; + $this->mark = new PlotMark(); + } + + function SetWeight($aWeight) { + $this->iLineWeight = $aWeight; + } + + function SetColor($aColor){ + $this->iColor = $aColor; + } + + function SetFillColor($aColor){ + $this->iFillColor = $aColor; + } + + function Max() { + $m = $this->coord[1]; + $i=1; + while( $i < $this->numpoints ) { + $m = max($m,$this->coord[2*$i+1]); + ++$i; + } + return $m; + } + // Set href targets for CSIM + function SetCSIMTargets($aTargets,$aAlts=null) { + $this->csimtargets=$aTargets; + $this->csimalts=$aAlts; + } + + // Get all created areas + function GetCSIMareas() { + return $this->csimareas; + } + + function SetLegend($aLegend,$aCSIM="",$aCSIMAlt="") { + $this->legend = $aLegend; + $this->legendcsimtarget = $aCSIM; + $this->legendcsimalt = $aCSIMAlt; + } + + // Private methods + + function Legend($aGraph) { + $color = $this->iColor ; + if( $this->legend != "" ) { + if( $this->iFillColor!='' ) { + $color = $this->iFillColor; + $aGraph->legend->Add($this->legend,$color,$this->mark,0, + $this->legendcsimtarget,$this->legendcsimalt); + } + else { + $aGraph->legend->Add($this->legend,$color,$this->mark,$this->line_style, + $this->legendcsimtarget,$this->legendcsimalt); + } + } + } + + function Stroke($img,$scale) { + + $i=0; + $p=array(); + $this->csimareas=''; + while($i < $this->numpoints) { + list($x1,$y1) = $scale->PTranslate($this->coord[2*$i],$this->coord[2*$i+1]); + $p[2*$i] = $x1; + $p[2*$i+1] = $y1; + + if( isset($this->csimtargets[$i]) ) { + $this->mark->SetCSIMTarget($this->csimtargets[$i]); + $this->mark->SetCSIMAlt($this->csimalts[$i]); + $this->mark->SetCSIMAltVal($this->coord[2*$i], $this->coord[2*$i+1]); + $this->mark->Stroke($img,$x1,$y1); + $this->csimareas .= $this->mark->GetCSIMAreas(); + } + else { + $this->mark->Stroke($img,$x1,$y1); + } + + ++$i; + } + + if( $this->iFillColor != '' ) { + $img->SetColor($this->iFillColor); + $img->FilledPolygon($p); + } + $img->SetLineWeight($this->iLineWeight); + $img->SetColor($this->iColor); + $img->Polygon($p,$this->iFillColor!=''); + } +} + +//-------------------------------------------------------------------------- +// class PolarAxis +//-------------------------------------------------------------------------- +class PolarAxis extends Axis { + private $angle_step=15,$angle_color='lightgray',$angle_label_color='black'; + private $angle_fontfam=FF_FONT1,$angle_fontstyle=FS_NORMAL,$angle_fontsize=10; + private $angle_fontcolor = 'navy'; + private $gridminor_color='lightgray',$gridmajor_color='lightgray'; + private $show_minor_grid = false, $show_major_grid = true ; + private $show_angle_mark=true, $show_angle_grid=true, $show_angle_label=true; + private $angle_tick_len=3, $angle_tick_len2=3, $angle_tick_color='black'; + private $show_angle_tick=true; + private $radius_tick_color='black'; + + function __construct($img,$aScale) { + parent::__construct($img,$aScale); + } + + function ShowAngleDegreeMark($aFlg=true) { + $this->show_angle_mark = $aFlg; + } + + function SetAngleStep($aStep) { + $this->angle_step=$aStep; + } + + function HideTicks($aFlg=true,$aAngleFlg=true) { + parent::HideTicks($aFlg,$aFlg); + $this->show_angle_tick = !$aAngleFlg; + } + + function ShowAngleLabel($aFlg=true) { + $this->show_angle_label = $aFlg; + } + + function ShowGrid($aMajor=true,$aMinor=false,$aAngle=true) { + $this->show_minor_grid = $aMinor; + $this->show_major_grid = $aMajor; + $this->show_angle_grid = $aAngle ; + } + + function SetAngleFont($aFontFam,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->angle_fontfam = $aFontFam; + $this->angle_fontstyle = $aFontStyle; + $this->angle_fontsize = $aFontSize; + } + + function SetColor($aColor,$aRadColor='',$aAngleColor='') { + if( $aAngleColor == '' ) + $aAngleColor=$aColor; + parent::SetColor($aColor,$aRadColor); + $this->angle_fontcolor = $aAngleColor; + } + + function SetGridColor($aMajorColor,$aMinorColor='',$aAngleColor='') { + if( $aMinorColor == '' ) + $aMinorColor = $aMajorColor; + if( $aAngleColor == '' ) + $aAngleColor = $aMajorColor; + + $this->gridminor_color = $aMinorColor; + $this->gridmajor_color = $aMajorColor; + $this->angle_color = $aAngleColor; + } + + function SetTickColors($aRadColor,$aAngleColor='') { + $this->radius_tick_color = $aRadColor; + $this->angle_tick_color = $aAngleColor; + } + + // Private methods + function StrokeGrid($pos) { + $x = round($this->img->left_margin + $this->img->plotwidth/2); + $this->scale->ticks->Stroke($this->img,$this->scale,$pos); + + // Stroke the minor arcs + $pmin = array(); + $p = $this->scale->ticks->ticks_pos; + $n = count($p); + $i = 0; + $this->img->SetColor($this->gridminor_color); + while( $i < $n ) { + $r = $p[$i]-$x+1; + $pmin[]=$r; + if( $this->show_minor_grid ) { + $this->img->Circle($x,$pos,$r); + } + $i++; + } + + $limit = max($this->img->plotwidth,$this->img->plotheight)*1.4 ; + while( $r < $limit ) { + $off = $r; + $i=1; + $r = $off + round($p[$i]-$x+1); + while( $r < $limit && $i < $n ) { + $r = $off+$p[$i]-$x; + $pmin[]=$r; + if( $this->show_minor_grid ) { + $this->img->Circle($x,$pos,$r); + } + $i++; + } + } + + // Stroke the major arcs + if( $this->show_major_grid ) { + // First determine how many minor step on + // every major step. We have recorded the minor radius + // in pmin and use these values. This is done in order + // to avoid rounding errors if we were to recalculate the + // different major radius. + $pmaj = $this->scale->ticks->maj_ticks_pos; + $p = $this->scale->ticks->ticks_pos; + if( $this->scale->name == 'lin' ) { + $step=round(($pmaj[1] - $pmaj[0])/($p[1] - $p[0])); + } + else { + $step=9; + } + $n = round(count($pmin)/$step); + $i = 0; + $this->img->SetColor($this->gridmajor_color); + $limit = max($this->img->plotwidth,$this->img->plotheight)*1.4 ; + $off = $r; + $i=0; + $r = $pmin[$i*$step]; + while( $r < $limit && $i < $n ) { + $r = $pmin[$i*$step]; + $this->img->Circle($x,$pos,$r); + $i++; + } + } + + // Draw angles + if( $this->show_angle_grid ) { + $this->img->SetColor($this->angle_color); + $d = max($this->img->plotheight,$this->img->plotwidth)*1.4 ; + $a = 0; + $p = $this->scale->ticks->ticks_pos; + $start_radius = $p[1]-$x; + while( $a < 360 ) { + if( $a == 90 || $a == 270 ) { + // Make sure there are no rounding problem with + // exactly vertical lines + $this->img->Line($x+$start_radius*cos($a/180*M_PI)+1, + $pos-$start_radius*sin($a/180*M_PI), + $x+$start_radius*cos($a/180*M_PI)+1, + $pos-$d*sin($a/180*M_PI)); + + } + else { + $this->img->Line($x+$start_radius*cos($a/180*M_PI)+1, + $pos-$start_radius*sin($a/180*M_PI), + $x+$d*cos($a/180*M_PI), + $pos-$d*sin($a/180*M_PI)); + } + $a += $this->angle_step; + } + } + } + + function StrokeAngleLabels($pos,$type) { + + if( !$this->show_angle_label ) + return; + + $x0 = round($this->img->left_margin+$this->img->plotwidth/2)+1; + + $d = max($this->img->plotwidth,$this->img->plotheight)*1.42; + $a = $this->angle_step; + $t = new Text(); + $t->SetColor($this->angle_fontcolor); + $t->SetFont($this->angle_fontfam,$this->angle_fontstyle,$this->angle_fontsize); + $xright = $this->img->width - $this->img->right_margin; + $ytop = $this->img->top_margin; + $xleft = $this->img->left_margin; + $ybottom = $this->img->height - $this->img->bottom_margin; + $ha = 'left'; + $va = 'center'; + $w = $this->img->plotwidth/2; + $h = $this->img->plotheight/2; + $xt = $x0; $yt = $pos; + $margin=5; + + $tl = $this->angle_tick_len ; // Outer len + $tl2 = $this->angle_tick_len2 ; // Interior len + + $this->img->SetColor($this->angle_tick_color); + $rot90 = $this->img->a == 90 ; + + if( $type == POLAR_360 ) { + + // Corner angles of the four corners + $ca1 = atan($h/$w)/M_PI*180; + $ca2 = 180-$ca1; + $ca3 = $ca1+180; + $ca4 = 360-$ca1; + $end = 360; + + while( $a < $end ) { + $ca = cos($a/180*M_PI); + $sa = sin($a/180*M_PI); + $x = $d*$ca; + $y = $d*$sa; + $xt=1000;$yt=1000; + if( $a <= $ca1 || $a >= $ca4 ) { + $yt = $pos - $w * $y/$x; + $xt = $xright + $margin; + if( $rot90 ) { + $ha = 'center'; + $va = 'top'; + } + else { + $ha = 'left'; + $va = 'center'; + } + $x1=$xright-$tl2; $x2=$xright+$tl; + $y1=$y2=$yt; + } + elseif( $a > $ca1 && $a < $ca2 ) { + $xt = $x0 + $h * $x/$y; + $yt = $ytop - $margin; + if( $rot90 ) { + $ha = 'left'; + $va = 'center'; + } + else { + $ha = 'center'; + $va = 'bottom'; + } + $y1=$ytop+$tl2;$y2=$ytop-$tl; + $x1=$x2=$xt; + } + elseif( $a >= $ca2 && $a <= $ca3 ) { + $yt = $pos + $w * $y/$x; + $xt = $xleft - $margin; + if( $rot90 ) { + $ha = 'center'; + $va = 'bottom'; + } + else { + $ha = 'right'; + $va = 'center'; + } + $x1=$xleft+$tl2;$x2=$xleft-$tl; + $y1=$y2=$yt; + } + else { + $xt = $x0 - $h * $x/$y; + $yt = $ybottom + $margin; + if( $rot90 ) { + $ha = 'right'; + $va = 'center'; + } + else { + $ha = 'center'; + $va = 'top'; + } + $y1=$ybottom-$tl2;$y2=$ybottom+$tl; + $x1=$x2=$xt; + } + if( $a != 0 && $a != 180 ) { + $t->Align($ha,$va); + if( $this->scale->clockwise ) { + $t->Set(360-$a); + } + else { + $t->Set($a); + } + if( $this->show_angle_mark && $t->font_family > 4 ) { + $a .= SymChar::Get('degree'); + } + $t->Stroke($this->img,$xt,$yt); + if( $this->show_angle_tick ) { + $this->img->Line($x1,$y1,$x2,$y2); + } + } + $a += $this->angle_step; + } + } + else { + // POLAR_HALF + $ca1 = atan($h/$w*2)/M_PI*180; + $ca2 = 180-$ca1; + $end = 180; + while( $a < $end ) { + $ca = cos($a/180*M_PI); + $sa = sin($a/180*M_PI); + $x = $d*$ca; + $y = $d*$sa; + if( $a <= $ca1 ) { + $yt = $pos - $w * $y/$x; + $xt = $xright + $margin; + if( $rot90 ) { + $ha = 'center'; + $va = 'top'; + } + else { + $ha = 'left'; + $va = 'center'; + } + $x1=$xright-$tl2; $x2=$xright+$tl; + $y1=$y2=$yt; + } + elseif( $a > $ca1 && $a < $ca2 ) { + $xt = $x0 + 2*$h * $x/$y; + $yt = $ytop - $margin; + if( $rot90 ) { + $ha = 'left'; + $va = 'center'; + } + else { + $ha = 'center'; + $va = 'bottom'; + } + $y1=$ytop+$tl2;$y2=$ytop-$tl; + $x1=$x2=$xt; + } + elseif( $a >= $ca2 ) { + $yt = $pos + $w * $y/$x; + $xt = $xleft - $margin; + if( $rot90 ) { + $ha = 'center'; + $va = 'bottom'; + } + else { + $ha = 'right'; + $va = 'center'; + } + $x1=$xleft+$tl2;$x2=$xleft-$tl; + $y1=$y2=$yt; + } + $t->Align($ha,$va); + if( $this->show_angle_mark && $t->font_family > 4 ) { + $a .= SymChar::Get('degree'); + } + $t->Set($a); + $t->Stroke($this->img,$xt,$yt); + if( $this->show_angle_tick ) { + $this->img->Line($x1,$y1,$x2,$y2); + } + $a += $this->angle_step; + } + } + } + + function Stroke($pos,$dummy=true) { + + $this->img->SetLineWeight($this->weight); + $this->img->SetColor($this->color); + $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); + if( !$this->hide_line ) { + $this->img->FilledRectangle($this->img->left_margin,$pos, + $this->img->width-$this->img->right_margin, + $pos+$this->weight-1); + } + $y=$pos+$this->img->GetFontHeight()+$this->title_margin+$this->title->margin; + if( $this->title_adjust=="high" ) { + $this->title->SetPos($this->img->width-$this->img->right_margin,$y,"right","top"); + } + elseif( $this->title_adjust=="middle" || $this->title_adjust=="center" ) { + $this->title->SetPos(($this->img->width-$this->img->left_margin-$this->img->right_margin)/2+$this->img->left_margin, + $y,"center","top"); + } + elseif($this->title_adjust=="low") { + $this->title->SetPos($this->img->left_margin,$y,"left","top"); + } + else { + JpGraphError::RaiseL(17002,$this->title_adjust); + //('Unknown alignment specified for X-axis title. ('.$this->title_adjust.')'); + } + + + if (!$this->hide_labels) { + $this->StrokeLabels($pos,false); + } + $this->img->SetColor($this->radius_tick_color); + $this->scale->ticks->Stroke($this->img,$this->scale,$pos); + + // + // Mirror the positions for the left side of the scale + // + $mid = 2*($this->img->left_margin+$this->img->plotwidth/2); + $n = count($this->scale->ticks->ticks_pos); + $i=0; + while( $i < $n ) { + $this->scale->ticks->ticks_pos[$i] = + $mid-$this->scale->ticks->ticks_pos[$i] ; + ++$i; + } + + $n = count($this->scale->ticks->maj_ticks_pos); + $i=0; + while( $i < $n ) { + $this->scale->ticks->maj_ticks_pos[$i] = + $mid-$this->scale->ticks->maj_ticks_pos[$i] ; + ++$i; + } + + $n = count($this->scale->ticks->maj_ticklabels_pos); + $i=1; + while( $i < $n ) { + $this->scale->ticks->maj_ticklabels_pos[$i] = + $mid-$this->scale->ticks->maj_ticklabels_pos[$i] ; + ++$i; + } + + // Draw the left side of the scale + $n = count($this->scale->ticks->ticks_pos); + $yu = $pos - $this->scale->ticks->direction*$this->scale->ticks->GetMinTickAbsSize(); + + + // Minor ticks + if( ! $this->scale->ticks->supress_minor_tickmarks ) { + $i=1; + while( $i < $n/2 ) { + $x = round($this->scale->ticks->ticks_pos[$i]) ; + $this->img->Line($x,$pos,$x,$yu); + ++$i; + } + } + + $n = count($this->scale->ticks->maj_ticks_pos); + $yu = $pos - $this->scale->ticks->direction*$this->scale->ticks->GetMajTickAbsSize(); + + + // Major ticks + if( ! $this->scale->ticks->supress_tickmarks ) { + $i=1; + while( $i < $n/2 ) { + $x = round($this->scale->ticks->maj_ticks_pos[$i]) ; + $this->img->Line($x,$pos,$x,$yu); + ++$i; + } + } + if (!$this->hide_labels) { + $this->StrokeLabels($pos,false); + } + $this->title->Stroke($this->img); + } +} + +class PolarScale extends LinearScale { + private $graph; + public $clockwise=false; + + function __construct($aMax,$graph,$aClockwise) { + parent::__construct(0,$aMax,'x'); + $this->graph = $graph; + $this->clockwise = $aClockwise; + } + + function SetClockwise($aFlg) { + $this->clockwise = $aFlg; + } + + function _Translate($v) { + return parent::Translate($v); + } + + function PTranslate($aAngle,$aRad) { + + $m = $this->scale[1]; + $w = $this->graph->img->plotwidth/2; + $aRad = $aRad/$m*$w; + + $a = $aAngle/180 * M_PI; + if( $this->clockwise ) { + $a = 2*M_PI-$a; + } + + $x = cos($a) * $aRad; + $y = sin($a) * $aRad; + + $x += $this->_Translate(0); + + if( $this->graph->iType == POLAR_360 ) { + $y = ($this->graph->img->top_margin + $this->graph->img->plotheight/2) - $y; + } + else { + $y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; + } + return array($x,$y); + } +} + +class PolarLogScale extends LogScale { + private $graph; + public $clockwise=false; + + function __construct($aMax,$graph,$aClockwise=false) { + parent::__construct(0,$aMax,'x'); + $this->graph = $graph; + $this->ticks->SetLabelLogType(LOGLABELS_MAGNITUDE); + $this->clockwise = $aClockwise; + + } + + function SetClockwise($aFlg) { + $this->clockwise = $aFlg; + } + + function PTranslate($aAngle,$aRad) { + + if( $aRad == 0 ) + $aRad = 1; + $aRad = log10($aRad); + $m = $this->scale[1]; + $w = $this->graph->img->plotwidth/2; + $aRad = $aRad/$m*$w; + + $a = $aAngle/180 * M_PI; + if( $this->clockwise ) { + $a = 2*M_PI-$a; + } + + $x = cos( $a ) * $aRad; + $y = sin( $a ) * $aRad; + + $x += $w+$this->graph->img->left_margin;//$this->_Translate(0); + if( $this->graph->iType == POLAR_360 ) { + $y = ($this->graph->img->top_margin + $this->graph->img->plotheight/2) - $y; + } + else { + $y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; + } + return array($x,$y); + } +} + +class PolarGraph extends Graph { + public $scale; + public $axis; + public $iType=POLAR_360; + private $iClockwise=false; + + function __construct($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { + parent::__construct($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline) ; + $this->SetDensity(TICKD_DENSE); + $this->SetBox(); + $this->SetMarginColor('white'); + } + + function SetDensity($aDense) { + $this->SetTickDensity(TICKD_NORMAL,$aDense); + } + + function SetClockwise($aFlg) { + $this->scale->SetClockwise($aFlg); + } + + function Set90AndMargin($lm=0,$rm=0,$tm=0,$bm=0) { + $adj = ($this->img->height - $this->img->width)/2; + $this->SetAngle(90); + $lm2 = -$adj + ($lm-$rm+$tm+$bm)/2; + $rm2 = -$adj + (-$lm+$rm+$tm+$bm)/2; + $tm2 = $adj + ($tm-$bm+$lm+$rm)/2; + $bm2 = $adj + (-$tm+$bm+$lm+$rm)/2; + $this->SetMargin($lm2, $rm2, $tm2, $bm2); + $this->axis->SetLabelAlign('right','center'); + } + + function SetScale($aScale,$rmax=0,$dummy1=1,$dummy2=1,$dummy3=1) { + if( $aScale == 'lin' ) { + $this->scale = new PolarScale($rmax,$this,$this->iClockwise); + } + elseif( $aScale == 'log' ) { + $this->scale = new PolarLogScale($rmax,$this,$this->iClockwise); + } + else { + JpGraphError::RaiseL(17004);//('Unknown scale type for polar graph. Must be "lin" or "log"'); + } + + $this->axis = new PolarAxis($this->img,$this->scale); + $this->SetMargin(40,40,50,40); + } + + function SetType($aType) { + $this->iType = $aType; + } + + function SetPlotSize($w,$h) { + $this->SetMargin(($this->img->width-$w)/2,($this->img->width-$w)/2, + ($this->img->height-$h)/2,($this->img->height-$h)/2); + } + + // Private methods + function GetPlotsMax() { + $n = count($this->plots); + $m = $this->plots[0]->Max(); + $i=1; + while($i < $n) { + $m = max($this->plots[$i]->Max(),$m); + ++$i; + } + return $m; + } + + function Stroke($aStrokeFileName="") { + + // Start by adjusting the margin so that potential titles will fit. + $this->AdjustMarginsForTitles(); + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // a best we can. Therefor you will see a lot of tests !$_csim in the + // code below. + $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); + + // We need to know if we have stroked the plot in the + // GetCSIMareas. Otherwise the CSIM hasn't been generated + // and in the case of GetCSIM called before stroke to generate + // CSIM without storing an image to disk GetCSIM must call Stroke. + $this->iHasStroked = true; + + //Check if we should autoscale axis + if( !$this->scale->IsSpecified() && count($this->plots)>0 ) { + $max = $this->GetPlotsMax(); + $t1 = $this->img->plotwidth; + $this->img->plotwidth /= 2; + $t2 = $this->img->left_margin; + $this->img->left_margin += $this->img->plotwidth+1; + $this->scale->AutoScale($this->img,0,$max, + $this->img->plotwidth/$this->xtick_factor/2); + $this->img->plotwidth = $t1; + $this->img->left_margin = $t2; + } + else { + // The tick calculation will use the user suplied min/max values to determine + // the ticks. If auto_ticks is false the exact user specifed min and max + // values will be used for the scale. + // If auto_ticks is true then the scale might be slightly adjusted + // so that the min and max values falls on an even major step. + //$min = 0; + $max = $this->scale->scale[1]; + $t1 = $this->img->plotwidth; + $this->img->plotwidth /= 2; + $t2 = $this->img->left_margin; + $this->img->left_margin += $this->img->plotwidth+1; + $this->scale->AutoScale($this->img,0,$max, + $this->img->plotwidth/$this->xtick_factor/2); + $this->img->plotwidth = $t1; + $this->img->left_margin = $t2; + } + + if( $this->iType == POLAR_180 ) { + $pos = $this->img->height - $this->img->bottom_margin; + } + else { + $pos = $this->img->plotheight/2 + $this->img->top_margin; + } + + if( !$_csim ) { + $this->StrokePlotArea(); + } + + $this->iDoClipping = true; + + if( $this->iDoClipping ) { + $oldimage = $this->img->CloneCanvasH(); + } + + if( !$_csim ) { + $this->axis->StrokeGrid($pos); + } + + // Stroke all plots for Y1 axis + for($i=0; $i < count($this->plots); ++$i) { + $this->plots[$i]->Stroke($this->img,$this->scale); + } + + + if( $this->iDoClipping ) { + // Clipping only supports graphs at 0 and 90 degrees + if( $this->img->a == 0 ) { + $this->img->CopyCanvasH($oldimage,$this->img->img, + $this->img->left_margin,$this->img->top_margin, + $this->img->left_margin,$this->img->top_margin, + $this->img->plotwidth+1,$this->img->plotheight+1); + } + elseif( $this->img->a == 90 ) { + $adj1 = round(($this->img->height - $this->img->width)/2); + $adj2 = round(($this->img->width - $this->img->height)/2); + $lm = $this->img->left_margin; + $rm = $this->img->right_margin; + $tm = $this->img->top_margin; + $bm = $this->img->bottom_margin; + $this->img->CopyCanvasH($oldimage,$this->img->img, + $adj2 + round(($lm-$rm+$tm+$bm)/2), + $adj1 + round(($tm-$bm+$lm+$rm)/2), + $adj2 + round(($lm-$rm+$tm+$bm)/2), + $adj1 + round(($tm-$bm+$lm+$rm)/2), + $this->img->plotheight+1, + $this->img->plotwidth+1); + } + $this->img->Destroy(); + $this->img->SetCanvasH($oldimage); + } + + if( !$_csim ) { + $this->axis->Stroke($pos); + $this->axis->StrokeAngleLabels($pos,$this->iType); + } + + if( !$_csim ) { + $this->StrokePlotBox(); + $this->footer->Stroke($this->img); + + // The titles and legends never gets rotated so make sure + // that the angle is 0 before stroking them + $aa = $this->img->SetAngle(0); + $this->StrokeTitles(); + } + + for($i=0; $i < count($this->plots) ; ++$i ) { + $this->plots[$i]->Legend($this); + } + + $this->legend->Stroke($this->img); + + if( !$_csim ) { + + $this->StrokeTexts(); + $this->img->SetAngle($aa); + + // Draw an outline around the image map + if(_JPG_DEBUG) + $this->DisplayClientSideaImageMapAreas(); + + // If the filename is given as the special "__handle" + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); + } + } + } +} + + + +?> diff --git a/includes/jpgraph/src/jpgraph_radar.php b/includes/jpgraph/src/jpgraph_radar.php new file mode 100644 index 0000000..a5545ea --- /dev/null +++ b/includes/jpgraph/src/jpgraph_radar.php @@ -0,0 +1,861 @@ +GetMinVal(); + $limit = $aScale->GetMaxVal(); + $nextMajor = 10*$start; + $step = $nextMajor / 10.0; + $count=1; + + $ticklen_maj=5; + $dx_maj=round(sin($aAxisAngle)*$ticklen_maj); + $dy_maj=round(cos($aAxisAngle)*$ticklen_maj); + $ticklen_min=3; + $dx_min=round(sin($aAxisAngle)*$ticklen_min); + $dy_min=round(cos($aAxisAngle)*$ticklen_min); + + $aMajPos=array(); + $aMajLabel=array(); + + if( $this->supress_first ) { + $aMajLabel[] = ''; + } + else { + $aMajLabel[]=$start; + } + + $yr=$aScale->RelTranslate($start); + $xt=round($yr*cos($aAxisAngle))+$aScale->scale_abs[0]; + $yt=$aPos-round($yr*sin($aAxisAngle)); + $aMajPos[]=$xt+2*$dx_maj; + $aMajPos[]=$yt-$aImg->GetFontheight()/2; + $grid[]=$xt; + $grid[]=$yt; + + $aImg->SetLineWeight($this->weight); + + for($y=$start; $y<=$limit; $y+=$step,++$count ) { + $yr=$aScale->RelTranslate($y); + $xt=round($yr*cos($aAxisAngle))+$aScale->scale_abs[0]; + $yt=$aPos-round($yr*sin($aAxisAngle)); + if( $count % 10 == 0 ) { + $grid[]=$xt; + $grid[]=$yt; + $aMajPos[]=$xt+2*$dx_maj; + $aMajPos[]=$yt-$aImg->GetFontheight()/2; + if( !$this->supress_tickmarks ) { + if( $this->majcolor != '' ) { + $aImg->PushColor($this->majcolor); + } + $aImg->Line($xt+$dx_maj,$yt+$dy_maj,$xt-$dx_maj,$yt-$dy_maj); + if( $this->majcolor != '' ) { + $aImg->PopColor(); + } + } + if( $this->label_formfunc != '' ) { + $f=$this->label_formfunc; + $l = call_user_func($f,$nextMajor); + } + else { + $l = $nextMajor; + } + + $aMajLabel[]=$l; + $nextMajor *= 10; + $step *= 10; + $count=1; + } + else { + if( !$this->supress_minor_tickmarks ) { + if( $this->mincolor != '' ) { + $aImg->PushColor($this->mincolor); + } + $aImg->Line($xt+$dx_min,$yt+$dy_min,$xt-$dx_min,$yt-$dy_min); + if( $this->mincolor != '' ) { + $aImg->PopColor(); + } + } + } + } + } +} + +//=================================================== +// CLASS RadarLinear +// Description: Linear ticks +//=================================================== +class RadarLinearTicks extends Ticks { + + private $minor_step=1, $major_step=2; + private $xlabel_offset=0,$xtick_offset=0; + + function __construct() { + // Empty + } + + // Return major step size in world coordinates + function GetMajor() { + return $this->major_step; + } + + // Return minor step size in world coordinates + function GetMinor() { + return $this->minor_step; + } + + // Set Minor and Major ticks (in world coordinates) + function Set($aMajStep,$aMinStep=false) { + if( $aMinStep==false ) { + $aMinStep=$aMajStep; + } + + if( $aMajStep <= 0 || $aMinStep <= 0 ) { + JpGraphError::RaiseL(25064); + //JpGraphError::Raise(" Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem."); + } + + $this->major_step=$aMajStep; + $this->minor_step=$aMinStep; + $this->is_set = true; + } + + function Stroke($aImg,&$grid,$aPos,$aAxisAngle,$aScale,&$aMajPos,&$aMajLabel) { + // Prepare to draw linear ticks + $maj_step_abs = abs($aScale->scale_factor*$this->major_step); + $min_step_abs = abs($aScale->scale_factor*$this->minor_step); + $nbrmaj = round($aScale->world_abs_size/$maj_step_abs); + $nbrmin = round($aScale->world_abs_size/$min_step_abs); + $skip = round($nbrmin/$nbrmaj); // Don't draw minor on top of major + + // Draw major ticks + $ticklen2=$this->major_abs_size; + $dx=round(sin($aAxisAngle)*$ticklen2); + $dy=round(cos($aAxisAngle)*$ticklen2); + $label=$aScale->scale[0]+$this->major_step; + + $aImg->SetLineWeight($this->weight); + + $aMajPos = array(); + $aMajLabel = array(); + + for($i=1; $i<=$nbrmaj; ++$i) { + $xt=round($i*$maj_step_abs*cos($aAxisAngle))+$aScale->scale_abs[0]; + $yt=$aPos-round($i*$maj_step_abs*sin($aAxisAngle)); + + if( $this->label_formfunc != '' ) { + $f=$this->label_formfunc; + $l = call_user_func($f,$label); + } + else { + $l = $label; + } + + $aMajLabel[]=$l; + $label += $this->major_step; + $grid[]=$xt; + $grid[]=$yt; + $aMajPos[($i-1)*2]=$xt+2*$dx; + $aMajPos[($i-1)*2+1]=$yt-$aImg->GetFontheight()/2; + if( !$this->supress_tickmarks ) { + if( $this->majcolor != '' ) { + $aImg->PushColor($this->majcolor); + } + $aImg->Line($xt+$dx,$yt+$dy,$xt-$dx,$yt-$dy); + if( $this->majcolor != '' ) { + $aImg->PopColor(); + } + } + } + + // Draw minor ticks + $ticklen2=$this->minor_abs_size; + $dx=round(sin($aAxisAngle)*$ticklen2); + $dy=round(cos($aAxisAngle)*$ticklen2); + if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { + if( $this->mincolor != '' ) { + $aImg->PushColor($this->mincolor); + } + for($i=1; $i<=$nbrmin; ++$i) { + if( ($i % $skip) == 0 ) { + continue; + } + $xt=round($i*$min_step_abs*cos($aAxisAngle))+$aScale->scale_abs[0]; + $yt=$aPos-round($i*$min_step_abs*sin($aAxisAngle)); + $aImg->Line($xt+$dx,$yt+$dy,$xt-$dx,$yt-$dy); + } + if( $this->mincolor != '' ) { + $aImg->PopColor(); + } + } + } +} + + +//=================================================== +// CLASS RadarAxis +// Description: Implements axis for the radar graph +//=================================================== +class RadarAxis extends AxisPrototype { + public $title=null; + private $title_color='navy'; + private $len=0; + + function __construct($img,$aScale,$color=array(0,0,0)) { + parent::__construct($img,$aScale,$color); + $this->len = $img->plotheight; + $this->title = new Text(); + $this->title->SetFont(FF_FONT1,FS_BOLD); + $this->color = array(0,0,0); + } + + // Stroke the axis + // $pos = Vertical position of axis + // $aAxisAngle = Axis angle + // $grid = Returns an array with positions used to draw the grid + // $lf = Label flag, TRUE if the axis should have labels + function Stroke($pos,$aAxisAngle,&$grid,$title,$lf) { + $this->img->SetColor($this->color); + + // Determine end points for the axis + $x=round($this->scale->world_abs_size*cos($aAxisAngle)+$this->scale->scale_abs[0]); + $y=round($pos-$this->scale->world_abs_size*sin($aAxisAngle)); + + // Draw axis + $this->img->SetColor($this->color); + $this->img->SetLineWeight($this->weight); + if( !$this->hide ) { + $this->img->Line($this->scale->scale_abs[0],$pos,$x,$y); + } + + $this->scale->ticks->Stroke($this->img,$grid,$pos,$aAxisAngle,$this->scale,$majpos,$majlabel); + $ncolor=0; + if( isset($this->ticks_label_colors) ) { + $ncolor=count($this->ticks_label_colors); + } + + // Draw labels + if( $lf && !$this->hide ) { + $this->img->SetFont($this->font_family,$this->font_style,$this->font_size); + $this->img->SetTextAlign('left','top'); + $this->img->SetColor($this->label_color); + + // majpos contains (x,y) coordinates for labels + if( ! $this->hide_labels ) { + $n = floor(count($majpos)/2); + for($i=0; $i < $n; ++$i) { + // Set specific label color if specified + if( $ncolor > 0 ) { + $this->img->SetColor($this->ticks_label_colors[$i % $ncolor]); + } + + if( $this->ticks_label != null && isset($this->ticks_label[$i]) ) { + $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$this->ticks_label[$i]); + } + else { + $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$majlabel[$i]); + } + } + } + } + $this->_StrokeAxisTitle($pos,$aAxisAngle,$title); + } + + function _StrokeAxisTitle($pos,$aAxisAngle,$title) { + $this->title->Set($title); + $marg=6+$this->title->margin; + $xt=round(($this->scale->world_abs_size+$marg)*cos($aAxisAngle)+$this->scale->scale_abs[0]); + $yt=round($pos-($this->scale->world_abs_size+$marg)*sin($aAxisAngle)); + + // Position the axis title. + // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text + // that intersects with the extension of the corresponding axis. The code looks a little + // bit messy but this is really the only way of having a reasonable position of the + // axis titles. + if( $this->title->iWordwrap > 0 ) { + $title = wordwrap($title,$this->title->iWordwrap,"\n"); + } + + $h=$this->img->GetTextHeight($title)*1.2; + $w=$this->img->GetTextWidth($title)*1.2; + + while( $aAxisAngle > 2*M_PI ) + $aAxisAngle -= 2*M_PI; + + // Around 3 a'clock + if( $aAxisAngle>=7*M_PI/4 || $aAxisAngle <= M_PI/4 ) $dx=-0.15; // Small trimming to make the dist to the axis more even + + // Around 12 a'clock + if( $aAxisAngle>=M_PI/4 && $aAxisAngle <= 3*M_PI/4 ) $dx=($aAxisAngle-M_PI/4)*2/M_PI; + + // Around 9 a'clock + if( $aAxisAngle>=3*M_PI/4 && $aAxisAngle <= 5*M_PI/4 ) $dx=1; + + // Around 6 a'clock + if( $aAxisAngle>=5*M_PI/4 && $aAxisAngle <= 7*M_PI/4 ) $dx=(1-($aAxisAngle-M_PI*5/4)*2/M_PI); + + if( $aAxisAngle>=7*M_PI/4 ) $dy=(($aAxisAngle-M_PI)-3*M_PI/4)*2/M_PI; + if( $aAxisAngle<=M_PI/12 ) $dy=(0.5-$aAxisAngle*2/M_PI); + if( $aAxisAngle<=M_PI/4 && $aAxisAngle > M_PI/12) $dy=(1-$aAxisAngle*2/M_PI); + if( $aAxisAngle>=M_PI/4 && $aAxisAngle <= 3*M_PI/4 ) $dy=1; + if( $aAxisAngle>=3*M_PI/4 && $aAxisAngle <= 5*M_PI/4 ) $dy=(1-($aAxisAngle-3*M_PI/4)*2/M_PI); + if( $aAxisAngle>=5*M_PI/4 && $aAxisAngle <= 7*M_PI/4 ) $dy=0; + + if( !$this->hide ) { + $this->title->Stroke($this->img,$xt-$dx*$w,$yt-$dy*$h,$title); + } + } + +} // Class + + +//=================================================== +// CLASS RadarGrid +// Description: Draws grid for the radar graph +//=================================================== +class RadarGrid { //extends Grid { + private $type='solid'; + private $grid_color='#DDDDDD'; + private $show=false, $weight=1; + + function __construct() { + // Empty + } + + function SetColor($aMajColor) { + $this->grid_color = $aMajColor; + } + + function SetWeight($aWeight) { + $this->weight=$aWeight; + } + + // Specify if grid should be dashed, dotted or solid + function SetLineStyle($aType) { + $this->type = $aType; + } + + // Decide if both major and minor grid should be displayed + function Show($aShowMajor=true) { + $this->show=$aShowMajor; + } + + function Stroke($img,$grid) { + if( !$this->show ) { + return; + } + + $nbrticks = count($grid[0])/2; + $nbrpnts = count($grid); + $img->SetColor($this->grid_color); + $img->SetLineWeight($this->weight); + + for($i=0; $i<$nbrticks; ++$i) { + for($j=0; $j<$nbrpnts; ++$j) { + $pnts[$j*2]=$grid[$j][$i*2]; + $pnts[$j*2+1]=$grid[$j][$i*2+1]; + } + for($k=0; $k<$nbrpnts; ++$k ){ + $l=($k+1)%$nbrpnts; + if( $this->type == 'solid' ) + $img->Line($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1]); + elseif( $this->type == 'dotted' ) + $img->DashedLine($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1],1,6); + elseif( $this->type == 'dashed' ) + $img->DashedLine($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1],2,4); + elseif( $this->type == 'longdashed' ) + $img->DashedLine($pnts[$k*2],$pnts[$k*2+1],$pnts[$l*2],$pnts[$l*2+1],8,6); + } + $pnts=array(); + } + } +} // Class + + +//=================================================== +// CLASS RadarPlot +// Description: Plot a radarplot +//=================================================== +class RadarPlot { + public $mark=null; + public $legend=''; + public $legendcsimtarget=''; + public $legendcsimalt=''; + public $csimtargets=array(); // Array of targets for CSIM + public $csimareas=""; // Resultant CSIM area tags + public $csimalts=null; // ALT:s for corresponding target + private $data=array(); + private $fill=false, $fill_color=array(200,170,180); + private $color=array(0,0,0); + private $weight=1; + private $linestyle='solid'; + + //--------------- + // CONSTRUCTOR + function __construct($data) { + $this->data = $data; + $this->mark = new PlotMark(); + } + + function Min() { + return Min($this->data); + } + + function Max() { + return Max($this->data); + } + + function SetLegend($legend) { + $this->legend=$legend; + } + + function SetLineStyle($aStyle) { + $this->linestyle=$aStyle; + } + + function SetLineWeight($w) { + $this->weight=$w; + } + + function SetFillColor($aColor) { + $this->fill_color = $aColor; + $this->fill = true; + } + + function SetFill($f=true) { + $this->fill = $f; + } + + function SetColor($aColor,$aFillColor=false) { + $this->color = $aColor; + if( $aFillColor ) { + $this->SetFillColor($aFillColor); + $this->fill = true; + } + } + + // Set href targets for CSIM + function SetCSIMTargets($aTargets,$aAlts=null) { + $this->csimtargets=$aTargets; + $this->csimalts=$aAlts; + } + + // Get all created areas + function GetCSIMareas() { + return $this->csimareas; + } + + function Stroke($img, $pos, $scale, $startangle) { + $nbrpnts = count($this->data); + $astep=2*M_PI/$nbrpnts; + $a=$startangle; + + for($i=0; $i<$nbrpnts; ++$i) { + + // Rotate each non null point to the correct axis-angle + $cs=$scale->RelTranslate($this->data[$i]); + $x=round($cs*cos($a)+$scale->scale_abs[0]); + $y=round($pos-$cs*sin($a)); + + $pnts[$i*2]=$x; + $pnts[$i*2+1]=$y; + + // If the next point is null then we draw this polygon segment + // to the center, skip the next and draw the next segment from + // the center up to the point on the axis with the first non-null + // value and continues from that point. Some additoinal logic is necessary + // to handle the boundary conditions + if( $i < $nbrpnts-1 ) { + if( is_null($this->data[$i+1]) ) { + $cs = 0; + $x=round($cs*cos($a)+$scale->scale_abs[0]); + $y=round($pos-$cs*sin($a)); + $pnts[$i*2]=$x; + $pnts[$i*2+1]=$y; + $a += $astep; + } + } + + $a += $astep; + } + + if( $this->fill ) { + $img->SetColor($this->fill_color); + $img->FilledPolygon($pnts); + } + + $img->SetLineWeight($this->weight); + $img->SetColor($this->color); + $img->SetLineStyle($this->linestyle); + $pnts[] = $pnts[0]; + $pnts[] = $pnts[1]; + $img->Polygon($pnts); + $img->SetLineStyle('solid'); // Reset line style to default + + // Add plotmarks on top + if( $this->mark->show ) { + for($i=0; $i < $nbrpnts; ++$i) { + if( isset($this->csimtargets[$i]) ) { + $this->mark->SetCSIMTarget($this->csimtargets[$i]); + $this->mark->SetCSIMAlt($this->csimalts[$i]); + $this->mark->SetCSIMAltVal($pnts[$i*2], $pnts[$i*2+1]); + $this->mark->Stroke($img, $pnts[$i*2], $pnts[$i*2+1]); + $this->csimareas .= $this->mark->GetCSIMAreas(); + } + else { + $this->mark->Stroke($img,$pnts[$i*2],$pnts[$i*2+1]); + } + } + } + + } + + function GetCount() { + return count($this->data); + } + + function Legend($graph) { + if( $this->legend == '' ) { + return; + } + if( $this->fill ) { + $graph->legend->Add($this->legend,$this->fill_color,$this->mark); + } else { + $graph->legend->Add($this->legend,$this->color,$this->mark); + } + } + +} // Class + +//=================================================== +// CLASS RadarGraph +// Description: Main container for a radar graph +//=================================================== +class RadarGraph extends Graph { + public $grid,$axis=null; + private $posx,$posy; + private $len; + private $axis_title=null; + + function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { + parent::__construct($width,$height,$cachedName,$timeout,$inline); + $this->posx = $width/2; + $this->posy = $height/2; + $this->len = min($width,$height)*0.35; + $this->SetColor(array(255,255,255)); + $this->SetTickDensity(TICKD_NORMAL); + $this->SetScale('lin'); + $this->SetGridDepth(DEPTH_FRONT); + } + + function HideTickMarks($aFlag=true) { + $this->axis->scale->ticks->SupressTickMarks($aFlag); + } + + function ShowMinorTickmarks($aFlag=true) { + $this->yscale->ticks->SupressMinorTickMarks(!$aFlag); + } + + function SetScale($axtype,$ymin=1,$ymax=1,$dummy1=null,$dumy2=null) { + if( $axtype != 'lin' && $axtype != 'log' ) { + JpGraphError::RaiseL(18003,$axtype); + //("Illegal scale for radarplot ($axtype). Must be \"lin\" or \"log\""); + } + if( $axtype == 'lin' ) { + $this->yscale = new LinearScale($ymin,$ymax); + $this->yscale->ticks = new RadarLinearTicks(); + $this->yscale->ticks->SupressMinorTickMarks(); + } + elseif( $axtype == 'log' ) { + $this->yscale = new LogScale($ymin,$ymax); + $this->yscale->ticks = new RadarLogTicks(); + } + + $this->axis = new RadarAxis($this->img,$this->yscale); + $this->grid = new RadarGrid(); + } + + function SetSize($aSize) { + if( $aSize < 0.1 || $aSize>1 ) { + JpGraphError::RaiseL(18004,$aSize); + //("Radar Plot size must be between 0.1 and 1. (Your value=$s)"); + } + $this->len=min($this->img->width,$this->img->height)*$aSize/2; + } + + function SetPlotSize($aSize) { + $this->SetSize($aSize); + } + + function SetTickDensity($densy=TICKD_NORMAL,$dummy1=null) { + $this->ytick_factor=25; + switch( $densy ) { + case TICKD_DENSE: + $this->ytick_factor=12; + break; + case TICKD_NORMAL: + $this->ytick_factor=25; + break; + case TICKD_SPARSE: + $this->ytick_factor=40; + break; + case TICKD_VERYSPARSE: + $this->ytick_factor=70; + break; + default: + JpGraphError::RaiseL(18005,$densy); + //("RadarPlot Unsupported Tick density: $densy"); + } + } + + function SetPos($px,$py=0.5) { + $this->SetCenter($px,$py); + } + + function SetCenter($px,$py=0.5) { + if( $px >= 0 && $px <= 1 ) { + $this->posx = $this->img->width*$px; + } + else { + $this->posx = $px; + } + if( $py >= 0 && $py <= 1 ) { + $this->posy = $this->img->height*$py; + } + else { + $this->posy = $py; + } + } + + function SetColor($aColor) { + $this->SetMarginColor($aColor); + } + + function SetTitles($aTitleArray) { + $this->axis_title = $aTitleArray; + } + + function Add($aPlot) { + if( $aPlot == null ) { + JpGraphError::RaiseL(25010);//("Graph::Add() You tried to add a null plot to the graph."); + } + if( is_array($aPlot) && count($aPlot) > 0 ) { + $cl = $aPlot[0]; + } + else { + $cl = $aPlot; + } + + if( $cl instanceof Text ) $this->AddText($aPlot); + elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) $this->AddIcon($aPlot); + else { + $this->plots[] = $aPlot; + } + } + + function GetPlotsYMinMax($aPlots) { + $min=$aPlots[0]->Min(); + $max=$aPlots[0]->Max(); + foreach( $this->plots as $p ) { + $max=max($max,$p->Max()); + $min=min($min,$p->Min()); + } + if( $min < 0 ) { + JpGraphError::RaiseL(18006,$min); + //("Minimum data $min (Radar plots should only be used when all data points > 0)"); + } + return array($min,$max); + } + + function StrokeIcons() { + if( $this->iIcons != null ) { + $n = count($this->iIcons); + for( $i=0; $i < $n; ++$i ) { + $this->iIcons[$i]->Stroke($this->img); + } + } + } + + function StrokeTexts() { + if( $this->texts != null ) { + $n = count($this->texts); + for( $i=0; $i < $n; ++$i ) { + $this->texts[$i]->Stroke($this->img); + } + } + } + + // Stroke the Radar graph + function Stroke($aStrokeFileName='') { + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // a best we can. Therefor you will see a lot of tests !$_csim in the + // code below. + $_csim = ( $aStrokeFileName === _CSIM_SPECIALFILE ); + + // We need to know if we have stroked the plot in the + // GetCSIMareas. Otherwise the CSIM hasn't been generated + // and in the case of GetCSIM called before stroke to generate + // CSIM without storing an image to disk GetCSIM must call Stroke. + $this->iHasStroked = true; + + $n = count($this->plots); + // Set Y-scale + + if( !$this->yscale->IsSpecified() && count($this->plots) > 0 ) { + list($min,$max) = $this->GetPlotsYMinMax($this->plots); + $this->yscale->AutoScale($this->img,0,$max,$this->len/$this->ytick_factor); + } + elseif( $this->yscale->IsSpecified() && + ( $this->yscale->auto_ticks || !$this->yscale->ticks->IsSpecified()) ) { + + // The tick calculation will use the user suplied min/max values to determine + // the ticks. If auto_ticks is false the exact user specifed min and max + // values will be used for the scale. + // If auto_ticks is true then the scale might be slightly adjusted + // so that the min and max values falls on an even major step. + $min = $this->yscale->scale[0]; + $max = $this->yscale->scale[1]; + $this->yscale->AutoScale($this->img,$min,$max, + $this->len/$this->ytick_factor, + $this->yscale->auto_ticks); + } + + // Set start position end length of scale (in absolute pixels) + $this->yscale->SetConstants($this->posx,$this->len); + + // We need as many axis as there are data points + $nbrpnts=$this->plots[0]->GetCount(); + + // If we have no titles just number the axis 1,2,3,... + if( $this->axis_title==null ) { + for($i=0; $i < $nbrpnts; ++$i ) { + $this->axis_title[$i] = $i+1; + } + } + elseif( count($this->axis_title) < $nbrpnts) { + JpGraphError::RaiseL(18007); + // ("Number of titles does not match number of points in plot."); + } + for( $i=0; $i < $n; ++$i ) { + if( $nbrpnts != $this->plots[$i]->GetCount() ) { + JpGraphError::RaiseL(18008); + //("Each radar plot must have the same number of data points."); + } + } + + if( !$_csim ) { + if( $this->background_image != '' ) { + $this->StrokeFrameBackground(); + } + else { + $this->StrokeFrame(); + $this->StrokeBackgroundGrad(); + } + } + $astep=2*M_PI/$nbrpnts; + + if( !$_csim ) { + if( $this->iIconDepth == DEPTH_BACK ) { + $this->StrokeIcons(); + } + + + // Prepare legends + for($i=0; $i < $n; ++$i) { + $this->plots[$i]->Legend($this); + } + $this->legend->Stroke($this->img); + $this->footer->Stroke($this->img); + } + + if( !$_csim ) { + if( $this->grid_depth == DEPTH_BACK ) { + // Draw axis and grid + for( $i=0,$a=M_PI/2; $i < $nbrpnts; ++$i, $a += $astep ) { + $this->axis->Stroke($this->posy,$a,$grid[$i],$this->axis_title[$i],$i==0); + } + $this->grid->Stroke($this->img,$grid); + } + if( $this->iIconDepth == DEPTH_BACK ) { + $this->StrokeIcons(); + } + + } + + // Plot points + $a=M_PI/2; + for($i=0; $i < $n; ++$i ) { + $this->plots[$i]->Stroke($this->img, $this->posy, $this->yscale, $a); + } + + if( !$_csim ) { + if( $this->grid_depth != DEPTH_BACK ) { + // Draw axis and grid + for( $i=0,$a=M_PI/2; $i < $nbrpnts; ++$i, $a += $astep ) { + $this->axis->Stroke($this->posy,$a,$grid[$i],$this->axis_title[$i],$i==0); + } + $this->grid->Stroke($this->img,$grid); + } + + $this->StrokeTitles(); + $this->StrokeTexts(); + if( $this->iIconDepth == DEPTH_FRONT ) { + $this->StrokeIcons(); + } + } + + // Should we do any final image transformation + if( $this->iImgTrans && !$_csim ) { + if( !class_exists('ImgTrans',false) ) { + require_once('jpgraph_imgtrans.php'); + } + + $tform = new ImgTrans($this->img->img); + $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, + $this->iImgTransDirection,$this->iImgTransHighQ, + $this->iImgTransMinSize,$this->iImgTransFillColor, + $this->iImgTransBorder); + } + + if( !$_csim ) { + // If the filename is given as the special "__handle" + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); + } + } + } +} // Class + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_regstat.php b/includes/jpgraph/src/jpgraph_regstat.php new file mode 100644 index 0000000..5313715 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_regstat.php @@ -0,0 +1,215 @@ +y2 = array(); + $this->xdata = $xdata; + $this->ydata = $ydata; + + $n = count($ydata); + $this->n = $n; + if( $this->n !== count($xdata) ) { + JpGraphError::RaiseL(19001); + //('Spline: Number of X and Y coordinates must be the same'); + } + + // Natural spline 2:derivate == 0 at endpoints + $this->y2[0] = 0.0; + $this->y2[$n-1] = 0.0; + $delta[0] = 0.0; + + // Calculate 2:nd derivate + for($i=1; $i < $n-1; ++$i) { + $d = ($xdata[$i+1]-$xdata[$i-1]); + if( $d == 0 ) { + JpGraphError::RaiseL(19002); + //('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.'); + } + $s = ($xdata[$i]-$xdata[$i-1])/$d; + $p = $s*$this->y2[$i-1]+2.0; + $this->y2[$i] = ($s-1.0)/$p; + $delta[$i] = ($ydata[$i+1]-$ydata[$i])/($xdata[$i+1]-$xdata[$i]) - + ($ydata[$i]-$ydata[$i-1])/($xdata[$i]-$xdata[$i-1]); + $delta[$i] = (6.0*$delta[$i]/($xdata[$i+1]-$xdata[$i-1])-$s*$delta[$i-1])/$p; + } + + // Backward substitution + for( $j=$n-2; $j >= 0; --$j ) { + $this->y2[$j] = $this->y2[$j]*$this->y2[$j+1] + $delta[$j]; + } + } + + // Return the two new data vectors + function Get($num=50) { + $n = $this->n ; + $step = ($this->xdata[$n-1]-$this->xdata[0]) / ($num-1); + $xnew=array(); + $ynew=array(); + $xnew[0] = $this->xdata[0]; + $ynew[0] = $this->ydata[0]; + for( $j=1; $j < $num; ++$j ) { + $xnew[$j] = $xnew[0]+$j*$step; + $ynew[$j] = $this->Interpolate($xnew[$j]); + } + return array($xnew,$ynew); + } + + // Return a single interpolated Y-value from an x value + function Interpolate($xpoint) { + + $max = $this->n-1; + $min = 0; + + // Binary search to find interval + while( $max-$min > 1 ) { + $k = ($max+$min) / 2; + if( $this->xdata[$k] > $xpoint ) + $max=$k; + else + $min=$k; + } + + // Each interval is interpolated by a 3:degree polynom function + $h = $this->xdata[$max]-$this->xdata[$min]; + + if( $h == 0 ) { + JpGraphError::RaiseL(19002); + //('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.'); + } + + + $a = ($this->xdata[$max]-$xpoint)/$h; + $b = ($xpoint-$this->xdata[$min])/$h; + return $a*$this->ydata[$min]+$b*$this->ydata[$max]+ + (($a*$a*$a-$a)*$this->y2[$min]+($b*$b*$b-$b)*$this->y2[$max])*($h*$h)/6.0; + } +} + +//------------------------------------------------------------------------ +// CLASS Bezier +// Create a new data array from a number of control points +//------------------------------------------------------------------------ +class Bezier { + /** + * @author Thomas Despoix, openXtrem company + * @license released under QPL + * @abstract Bezier interoplated point generation, + * computed from control points data sets, based on Paul Bourke algorithm : + * http://local.wasp.uwa.edu.au/~pbourke/geometry/bezier/index2.html + */ + private $datax = array(); + private $datay = array(); + private $n=0; + + function __construct($datax, $datay, $attraction_factor = 1) { + // Adding control point multiple time will raise their attraction power over the curve + $this->n = count($datax); + if( $this->n !== count($datay) ) { + JpGraphError::RaiseL(19003); + //('Bezier: Number of X and Y coordinates must be the same'); + } + $idx=0; + foreach($datax as $datumx) { + for ($i = 0; $i < $attraction_factor; $i++) { + $this->datax[$idx++] = $datumx; + } + } + $idx=0; + foreach($datay as $datumy) { + for ($i = 0; $i < $attraction_factor; $i++) { + $this->datay[$idx++] = $datumy; + } + } + $this->n *= $attraction_factor; + } + + /** + * Return a set of data points that specifies the bezier curve with $steps points + * @param $steps Number of new points to return + * @return array($datax, $datay) + */ + function Get($steps) { + $datax = array(); + $datay = array(); + for ($i = 0; $i < $steps; $i++) { + list($datumx, $datumy) = $this->GetPoint((double) $i / (double) $steps); + $datax[$i] = $datumx; + $datay[$i] = $datumy; + } + + $datax[] = end($this->datax); + $datay[] = end($this->datay); + + return array($datax, $datay); + } + + /** + * Return one point on the bezier curve. $mu is the position on the curve where $mu is in the + * range 0 $mu < 1 where 0 is tha start point and 1 is the end point. Note that every newly computed + * point depends on all the existing points + * + * @param $mu Position on the bezier curve + * @return array($x, $y) + */ + function GetPoint($mu) { + $n = $this->n - 1; + $k = 0; + $kn = 0; + $nn = 0; + $nkn = 0; + $blend = 0.0; + $newx = 0.0; + $newy = 0.0; + + $muk = 1.0; + $munk = (double) pow(1-$mu,(double) $n); + + for ($k = 0; $k <= $n; $k++) { + $nn = $n; + $kn = $k; + $nkn = $n - $k; + $blend = $muk * $munk; + $muk *= $mu; + $munk /= (1-$mu); + while ($nn >= 1) { + $blend *= $nn; + $nn--; + if ($kn > 1) { + $blend /= (double) $kn; + $kn--; + } + if ($nkn > 1) { + $blend /= (double) $nkn; + $nkn--; + } + } + $newx += $this->datax[$k] * $blend; + $newy += $this->datay[$k] * $blend; + } + + return array($newx, $newy); + } +} + +// EOF +?> diff --git a/includes/jpgraph/src/jpgraph_rgb.inc.php b/includes/jpgraph/src/jpgraph_rgb.inc.php new file mode 100644 index 0000000..a3c3985 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_rgb.inc.php @@ -0,0 +1,615 @@ +img = $aImg; + + // Conversion array between color names and RGB + $this->rgb_table = array( + 'aqua'=> array(0,255,255), + 'lime'=> array(0,255,0), + 'teal'=> array(0,128,128), + 'whitesmoke'=>array(245,245,245), + 'gainsboro'=>array(220,220,220), + 'oldlace'=>array(253,245,230), + 'linen'=>array(250,240,230), + 'antiquewhite'=>array(250,235,215), + 'papayawhip'=>array(255,239,213), + 'blanchedalmond'=>array(255,235,205), + 'bisque'=>array(255,228,196), + 'peachpuff'=>array(255,218,185), + 'navajowhite'=>array(255,222,173), + 'moccasin'=>array(255,228,181), + 'cornsilk'=>array(255,248,220), + 'ivory'=>array(255,255,240), + 'lemonchiffon'=>array(255,250,205), + 'seashell'=>array(255,245,238), + 'mintcream'=>array(245,255,250), + 'azure'=>array(240,255,255), + 'aliceblue'=>array(240,248,255), + 'lavender'=>array(230,230,250), + 'lavenderblush'=>array(255,240,245), + 'mistyrose'=>array(255,228,225), + 'white'=>array(255,255,255), + 'black'=>array(0,0,0), + 'darkslategray'=>array(47,79,79), + 'dimgray'=>array(105,105,105), + 'slategray'=>array(112,128,144), + 'lightslategray'=>array(119,136,153), + 'gray'=>array(190,190,190), + 'lightgray'=>array(211,211,211), + 'midnightblue'=>array(25,25,112), + 'navy'=>array(0,0,128), + 'indigo'=>array(75,0,130), + 'electricindigo'=>array(102,0,255), + 'deepindigo'=>array(138,43,226), + 'pigmentindigo'=>array(75,0,130), + 'indigodye'=>array(0,65,106), + 'cornflowerblue'=>array(100,149,237), + 'darkslateblue'=>array(72,61,139), + 'slateblue'=>array(106,90,205), + 'mediumslateblue'=>array(123,104,238), + 'lightslateblue'=>array(132,112,255), + 'mediumblue'=>array(0,0,205), + 'royalblue'=>array(65,105,225), + 'blue'=>array(0,0,255), + 'dodgerblue'=>array(30,144,255), + 'deepskyblue'=>array(0,191,255), + 'skyblue'=>array(135,206,235), + 'lightskyblue'=>array(135,206,250), + 'steelblue'=>array(70,130,180), + 'lightred'=>array(211,167,168), + 'lightsteelblue'=>array(176,196,222), + 'lightblue'=>array(173,216,230), + 'powderblue'=>array(176,224,230), + 'paleturquoise'=>array(175,238,238), + 'darkturquoise'=>array(0,206,209), + 'mediumturquoise'=>array(72,209,204), + 'turquoise'=>array(64,224,208), + 'cyan'=>array(0,255,255), + 'lightcyan'=>array(224,255,255), + 'cadetblue'=>array(95,158,160), + 'mediumaquamarine'=>array(102,205,170), + 'aquamarine'=>array(127,255,212), + 'darkgreen'=>array(0,100,0), + 'darkolivegreen'=>array(85,107,47), + 'darkseagreen'=>array(143,188,143), + 'seagreen'=>array(46,139,87), + 'mediumseagreen'=>array(60,179,113), + 'lightseagreen'=>array(32,178,170), + 'palegreen'=>array(152,251,152), + 'springgreen'=>array(0,255,127), + 'lawngreen'=>array(124,252,0), + 'green'=>array(0,255,0), + 'chartreuse'=>array(127,255,0), + 'mediumspringgreen'=>array(0,250,154), + 'greenyellow'=>array(173,255,47), + 'limegreen'=>array(50,205,50), + 'yellowgreen'=>array(154,205,50), + 'forestgreen'=>array(34,139,34), + 'olivedrab'=>array(107,142,35), + 'darkkhaki'=>array(189,183,107), + 'khaki'=>array(240,230,140), + 'palegoldenrod'=>array(238,232,170), + 'lightgoldenrodyellow'=>array(250,250,210), + 'lightyellow'=>array(255,255,200), + 'yellow'=>array(255,255,0), + 'gold'=>array(255,215,0), + 'lightgoldenrod'=>array(238,221,130), + 'goldenrod'=>array(218,165,32), + 'darkgoldenrod'=>array(184,134,11), + 'rosybrown'=>array(188,143,143), + 'indianred'=>array(205,92,92), + 'saddlebrown'=>array(139,69,19), + 'sienna'=>array(160,82,45), + 'peru'=>array(205,133,63), + 'burlywood'=>array(222,184,135), + 'beige'=>array(245,245,220), + 'wheat'=>array(245,222,179), + 'sandybrown'=>array(244,164,96), + 'tan'=>array(210,180,140), + 'chocolate'=>array(210,105,30), + 'firebrick'=>array(178,34,34), + 'brown'=>array(165,42,42), + 'darksalmon'=>array(233,150,122), + 'salmon'=>array(250,128,114), + 'lightsalmon'=>array(255,160,122), + 'orange'=>array(255,165,0), + 'darkorange'=>array(255,140,0), + 'coral'=>array(255,127,80), + 'lightcoral'=>array(240,128,128), + 'tomato'=>array(255,99,71), + 'orangered'=>array(255,69,0), + 'red'=>array(255,0,0), + 'hotpink'=>array(255,105,180), + 'deeppink'=>array(255,20,147), + 'pink'=>array(255,192,203), + 'lightpink'=>array(255,182,193), + 'palevioletred'=>array(219,112,147), + 'maroon'=>array(176,48,96), + 'mediumvioletred'=>array(199,21,133), + 'violetred'=>array(208,32,144), + 'magenta'=>array(255,0,255), + 'violet'=>array(238,130,238), + 'plum'=>array(221,160,221), + 'orchid'=>array(218,112,214), + 'mediumorchid'=>array(186,85,211), + 'darkorchid'=>array(153,50,204), + 'darkviolet'=>array(148,0,211), + 'blueviolet'=>array(138,43,226), + 'purple'=>array(160,32,240), + 'mediumpurple'=>array(147,112,219), + 'thistle'=>array(216,191,216), + 'snow1'=>array(255,250,250), + 'snow2'=>array(238,233,233), + 'snow3'=>array(205,201,201), + 'snow4'=>array(139,137,137), + 'seashell1'=>array(255,245,238), + 'seashell2'=>array(238,229,222), + 'seashell3'=>array(205,197,191), + 'seashell4'=>array(139,134,130), + 'AntiqueWhite1'=>array(255,239,219), + 'AntiqueWhite2'=>array(238,223,204), + 'AntiqueWhite3'=>array(205,192,176), + 'AntiqueWhite4'=>array(139,131,120), + 'bisque1'=>array(255,228,196), + 'bisque2'=>array(238,213,183), + 'bisque3'=>array(205,183,158), + 'bisque4'=>array(139,125,107), + 'peachPuff1'=>array(255,218,185), + 'peachpuff2'=>array(238,203,173), + 'peachpuff3'=>array(205,175,149), + 'peachpuff4'=>array(139,119,101), + 'navajowhite1'=>array(255,222,173), + 'navajowhite2'=>array(238,207,161), + 'navajowhite3'=>array(205,179,139), + 'navajowhite4'=>array(139,121,94), + 'lemonchiffon1'=>array(255,250,205), + 'lemonchiffon2'=>array(238,233,191), + 'lemonchiffon3'=>array(205,201,165), + 'lemonchiffon4'=>array(139,137,112), + 'ivory1'=>array(255,255,240), + 'ivory2'=>array(238,238,224), + 'ivory3'=>array(205,205,193), + 'ivory4'=>array(139,139,131), + 'honeydew'=>array(193,205,193), + 'lavenderblush1'=>array(255,240,245), + 'lavenderblush2'=>array(238,224,229), + 'lavenderblush3'=>array(205,193,197), + 'lavenderblush4'=>array(139,131,134), + 'mistyrose1'=>array(255,228,225), + 'mistyrose2'=>array(238,213,210), + 'mistyrose3'=>array(205,183,181), + 'mistyrose4'=>array(139,125,123), + 'azure1'=>array(240,255,255), + 'azure2'=>array(224,238,238), + 'azure3'=>array(193,205,205), + 'azure4'=>array(131,139,139), + 'slateblue1'=>array(131,111,255), + 'slateblue2'=>array(122,103,238), + 'slateblue3'=>array(105,89,205), + 'slateblue4'=>array(71,60,139), + 'royalblue1'=>array(72,118,255), + 'royalblue2'=>array(67,110,238), + 'royalblue3'=>array(58,95,205), + 'royalblue4'=>array(39,64,139), + 'dodgerblue1'=>array(30,144,255), + 'dodgerblue2'=>array(28,134,238), + 'dodgerblue3'=>array(24,116,205), + 'dodgerblue4'=>array(16,78,139), + 'steelblue1'=>array(99,184,255), + 'steelblue2'=>array(92,172,238), + 'steelblue3'=>array(79,148,205), + 'steelblue4'=>array(54,100,139), + 'deepskyblue1'=>array(0,191,255), + 'deepskyblue2'=>array(0,178,238), + 'deepskyblue3'=>array(0,154,205), + 'deepskyblue4'=>array(0,104,139), + 'skyblue1'=>array(135,206,255), + 'skyblue2'=>array(126,192,238), + 'skyblue3'=>array(108,166,205), + 'skyblue4'=>array(74,112,139), + 'lightskyblue1'=>array(176,226,255), + 'lightskyblue2'=>array(164,211,238), + 'lightskyblue3'=>array(141,182,205), + 'lightskyblue4'=>array(96,123,139), + 'slategray1'=>array(198,226,255), + 'slategray2'=>array(185,211,238), + 'slategray3'=>array(159,182,205), + 'slategray4'=>array(108,123,139), + 'lightsteelblue1'=>array(202,225,255), + 'lightsteelblue2'=>array(188,210,238), + 'lightsteelblue3'=>array(162,181,205), + 'lightsteelblue4'=>array(110,123,139), + 'lightblue1'=>array(191,239,255), + 'lightblue2'=>array(178,223,238), + 'lightblue3'=>array(154,192,205), + 'lightblue4'=>array(104,131,139), + 'lightcyan1'=>array(224,255,255), + 'lightcyan2'=>array(209,238,238), + 'lightcyan3'=>array(180,205,205), + 'lightcyan4'=>array(122,139,139), + 'paleturquoise1'=>array(187,255,255), + 'paleturquoise2'=>array(174,238,238), + 'paleturquoise3'=>array(150,205,205), + 'paleturquoise4'=>array(102,139,139), + 'cadetblue1'=>array(152,245,255), + 'cadetblue2'=>array(142,229,238), + 'cadetblue3'=>array(122,197,205), + 'cadetblue4'=>array(83,134,139), + 'turquoise1'=>array(0,245,255), + 'turquoise2'=>array(0,229,238), + 'turquoise3'=>array(0,197,205), + 'turquoise4'=>array(0,134,139), + 'cyan1'=>array(0,255,255), + 'cyan2'=>array(0,238,238), + 'cyan3'=>array(0,205,205), + 'cyan4'=>array(0,139,139), + 'darkslategray1'=>array(151,255,255), + 'darkslategray2'=>array(141,238,238), + 'darkslategray3'=>array(121,205,205), + 'darkslategray4'=>array(82,139,139), + 'aquamarine1'=>array(127,255,212), + 'aquamarine2'=>array(118,238,198), + 'aquamarine3'=>array(102,205,170), + 'aquamarine4'=>array(69,139,116), + 'darkseagreen1'=>array(193,255,193), + 'darkseagreen2'=>array(180,238,180), + 'darkseagreen3'=>array(155,205,155), + 'darkseagreen4'=>array(105,139,105), + 'seagreen1'=>array(84,255,159), + 'seagreen2'=>array(78,238,148), + 'seagreen3'=>array(67,205,128), + 'seagreen4'=>array(46,139,87), + 'palegreen1'=>array(154,255,154), + 'palegreen2'=>array(144,238,144), + 'palegreen3'=>array(124,205,124), + 'palegreen4'=>array(84,139,84), + 'springgreen1'=>array(0,255,127), + 'springgreen2'=>array(0,238,118), + 'springgreen3'=>array(0,205,102), + 'springgreen4'=>array(0,139,69), + 'chartreuse1'=>array(127,255,0), + 'chartreuse2'=>array(118,238,0), + 'chartreuse3'=>array(102,205,0), + 'chartreuse4'=>array(69,139,0), + 'olivedrab1'=>array(192,255,62), + 'olivedrab2'=>array(179,238,58), + 'olivedrab3'=>array(154,205,50), + 'olivedrab4'=>array(105,139,34), + 'darkolivegreen1'=>array(202,255,112), + 'darkolivegreen2'=>array(188,238,104), + 'darkolivegreen3'=>array(162,205,90), + 'darkolivegreen4'=>array(110,139,61), + 'khaki1'=>array(255,246,143), + 'khaki2'=>array(238,230,133), + 'khaki3'=>array(205,198,115), + 'khaki4'=>array(139,134,78), + 'lightgoldenrod1'=>array(255,236,139), + 'lightgoldenrod2'=>array(238,220,130), + 'lightgoldenrod3'=>array(205,190,112), + 'lightgoldenrod4'=>array(139,129,76), + 'yellow1'=>array(255,255,0), + 'yellow2'=>array(238,238,0), + 'yellow3'=>array(205,205,0), + 'yellow4'=>array(139,139,0), + 'gold1'=>array(255,215,0), + 'gold2'=>array(238,201,0), + 'gold3'=>array(205,173,0), + 'gold4'=>array(139,117,0), + 'goldenrod1'=>array(255,193,37), + 'goldenrod2'=>array(238,180,34), + 'goldenrod3'=>array(205,155,29), + 'goldenrod4'=>array(139,105,20), + 'darkgoldenrod1'=>array(255,185,15), + 'darkgoldenrod2'=>array(238,173,14), + 'darkgoldenrod3'=>array(205,149,12), + 'darkgoldenrod4'=>array(139,101,8), + 'rosybrown1'=>array(255,193,193), + 'rosybrown2'=>array(238,180,180), + 'rosybrown3'=>array(205,155,155), + 'rosybrown4'=>array(139,105,105), + 'indianred1'=>array(255,106,106), + 'indianred2'=>array(238,99,99), + 'indianred3'=>array(205,85,85), + 'indianred4'=>array(139,58,58), + 'sienna1'=>array(255,130,71), + 'sienna2'=>array(238,121,66), + 'sienna3'=>array(205,104,57), + 'sienna4'=>array(139,71,38), + 'burlywood1'=>array(255,211,155), + 'burlywood2'=>array(238,197,145), + 'burlywood3'=>array(205,170,125), + 'burlywood4'=>array(139,115,85), + 'wheat1'=>array(255,231,186), + 'wheat2'=>array(238,216,174), + 'wheat3'=>array(205,186,150), + 'wheat4'=>array(139,126,102), + 'tan1'=>array(255,165,79), + 'tan2'=>array(238,154,73), + 'tan3'=>array(205,133,63), + 'tan4'=>array(139,90,43), + 'chocolate1'=>array(255,127,36), + 'chocolate2'=>array(238,118,33), + 'chocolate3'=>array(205,102,29), + 'chocolate4'=>array(139,69,19), + 'firebrick1'=>array(255,48,48), + 'firebrick2'=>array(238,44,44), + 'firebrick3'=>array(205,38,38), + 'firebrick4'=>array(139,26,26), + 'brown1'=>array(255,64,64), + 'brown2'=>array(238,59,59), + 'brown3'=>array(205,51,51), + 'brown4'=>array(139,35,35), + 'salmon1'=>array(255,140,105), + 'salmon2'=>array(238,130,98), + 'salmon3'=>array(205,112,84), + 'salmon4'=>array(139,76,57), + 'lightsalmon1'=>array(255,160,122), + 'lightsalmon2'=>array(238,149,114), + 'lightsalmon3'=>array(205,129,98), + 'lightsalmon4'=>array(139,87,66), + 'orange1'=>array(255,165,0), + 'orange2'=>array(238,154,0), + 'orange3'=>array(205,133,0), + 'orange4'=>array(139,90,0), + 'darkorange1'=>array(255,127,0), + 'darkorange2'=>array(238,118,0), + 'darkorange3'=>array(205,102,0), + 'darkorange4'=>array(139,69,0), + 'coral1'=>array(255,114,86), + 'coral2'=>array(238,106,80), + 'coral3'=>array(205,91,69), + 'coral4'=>array(139,62,47), + 'tomato1'=>array(255,99,71), + 'tomato2'=>array(238,92,66), + 'tomato3'=>array(205,79,57), + 'tomato4'=>array(139,54,38), + 'orangered1'=>array(255,69,0), + 'orangered2'=>array(238,64,0), + 'orangered3'=>array(205,55,0), + 'orangered4'=>array(139,37,0), + 'deeppink1'=>array(255,20,147), + 'deeppink2'=>array(238,18,137), + 'deeppink3'=>array(205,16,118), + 'deeppink4'=>array(139,10,80), + 'hotpink1'=>array(255,110,180), + 'hotpink2'=>array(238,106,167), + 'hotpink3'=>array(205,96,144), + 'hotpink4'=>array(139,58,98), + 'pink1'=>array(255,181,197), + 'pink2'=>array(238,169,184), + 'pink3'=>array(205,145,158), + 'pink4'=>array(139,99,108), + 'lightpink1'=>array(255,174,185), + 'lightpink2'=>array(238,162,173), + 'lightpink3'=>array(205,140,149), + 'lightpink4'=>array(139,95,101), + 'palevioletred1'=>array(255,130,171), + 'palevioletred2'=>array(238,121,159), + 'palevioletred3'=>array(205,104,137), + 'palevioletred4'=>array(139,71,93), + 'maroon1'=>array(255,52,179), + 'maroon2'=>array(238,48,167), + 'maroon3'=>array(205,41,144), + 'maroon4'=>array(139,28,98), + 'violetred1'=>array(255,62,150), + 'violetred2'=>array(238,58,140), + 'violetred3'=>array(205,50,120), + 'violetred4'=>array(139,34,82), + 'magenta1'=>array(255,0,255), + 'magenta2'=>array(238,0,238), + 'magenta3'=>array(205,0,205), + 'magenta4'=>array(139,0,139), + 'mediumred'=>array(140,34,34), + 'orchid1'=>array(255,131,250), + 'orchid2'=>array(238,122,233), + 'orchid3'=>array(205,105,201), + 'orchid4'=>array(139,71,137), + 'plum1'=>array(255,187,255), + 'plum2'=>array(238,174,238), + 'plum3'=>array(205,150,205), + 'plum4'=>array(139,102,139), + 'mediumorchid1'=>array(224,102,255), + 'mediumorchid2'=>array(209,95,238), + 'mediumorchid3'=>array(180,82,205), + 'mediumorchid4'=>array(122,55,139), + 'darkorchid1'=>array(191,62,255), + 'darkorchid2'=>array(178,58,238), + 'darkorchid3'=>array(154,50,205), + 'darkorchid4'=>array(104,34,139), + 'purple1'=>array(155,48,255), + 'purple2'=>array(145,44,238), + 'purple3'=>array(125,38,205), + 'purple4'=>array(85,26,139), + 'mediumpurple1'=>array(171,130,255), + 'mediumpurple2'=>array(159,121,238), + 'mediumpurple3'=>array(137,104,205), + 'mediumpurple4'=>array(93,71,139), + 'thistle1'=>array(255,225,255), + 'thistle2'=>array(238,210,238), + 'thistle3'=>array(205,181,205), + 'thistle4'=>array(139,123,139), + 'gray1'=>array(10,10,10), + 'gray2'=>array(40,40,30), + 'gray3'=>array(70,70,70), + 'gray4'=>array(100,100,100), + 'gray5'=>array(130,130,130), + 'gray6'=>array(160,160,160), + 'gray7'=>array(190,190,190), + 'gray8'=>array(210,210,210), + 'gray9'=>array(240,240,240), + 'darkgray'=>array(100,100,100), + 'darkblue'=>array(0,0,139), + 'darkcyan'=>array(0,139,139), + 'darkmagenta'=>array(139,0,139), + 'darkred'=>array(139,0,0), + 'silver'=>array(192, 192, 192), + 'eggplant'=>array(144,176,168), + 'lightgreen'=>array(144,238,144)); + } + + + //---------------- + // PUBLIC METHODS + // Colors can be specified as either + // 1. #xxxxxx HTML style + // 2. "colorname" as a named color + // 3. array(r,g,b) RGB triple + // This function translates this to a native RGB format and returns an + // RGB triple. + + function Color($aColor) { + if (is_string($aColor)) { + $matches = array(); + // this regex will parse a color string and fill the $matches array as such: + // 0: the full match if any + // 1: a hex string preceded by a hash, can be 3 characters (#fff) or 6 (#ffffff) (4 or 5 also accepted but...) + // 2,3,4: r,g,b values in hex if the first character of the string is # + // 5: all alpha-numeric characters at the beginning of the string if string does not start with # + // 6: alpha value prefixed by @ if supplied + // 7: alpha value with @ stripped + // 8: adjust value prefixed with : if supplied + // 9: adjust value with : stripped + $regex = '/(#([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2}))?([\w]+)?(@([\d\.,]+))?(:([\d\.,]+))?/'; + if(!preg_match($regex, $aColor, $matches)) { + JpGraphError::RaiseL(25078,$aColor);//(" Unknown color: $aColor"); + } + if(empty($matches[5])) { + $r = strlen($matches[2]) == 1 ? $matches[2].$matches[2] : $matches[2]; + $g = strlen($matches[3]) == 1 ? $matches[3].$matches[3] : $matches[3]; + $b = strlen($matches[4]) == 1 ? $matches[4].$matches[4] : $matches[4]; + $r = hexdec($r); + $g = hexdec($g); + $b = hexdec($b); + }else { + if(!isset($this->rgb_table[$matches[5]]) ) { + JpGraphError::RaiseL(25078,$aColor);//(" Unknown color: $aColor"); + } + $r = $this->rgb_table[$matches[5]][0]; + $g = $this->rgb_table[$matches[5]][1]; + $b = $this->rgb_table[$matches[5]][2]; + } + $alpha = isset($matches[7]) ? str_replace(',','.',$matches[7]) : 0; + $adj = isset($matches[9]) ? str_replace(',','.',$matches[9]) : 1.0; + + if( $adj < 0 ) { + JpGraphError::RaiseL(25077);//('Adjustment factor for color must be > 0'); + } + + // Scale adj so that an adj=2 always + // makes the color 100% white (i.e. 255,255,255. + // and adj=1 neutral and adj=0 black. + if( $adj == 1) { + return array($r,$g,$b,$alpha); + } + elseif( $adj > 1 ) { + $m = ($adj-1.0)*(255-min(255,min($r,min($g,$b)))); + return array(min(255,$r+$m), min(255,$g+$m), min(255,$b+$m),$alpha); + } + elseif( $adj < 1 ) { + $m = ($adj-1.0)*max(255,max($r,max($g,$b))); + return array(max(0,$r+$m), max(0,$g+$m), max(0,$b+$m),$alpha); + } + } elseif( is_array($aColor) ) { + if(!isset($aColor[3])) $aColor[3] = 0; + return $aColor; + } + else { + JpGraphError::RaiseL(25079,$aColor,count($aColor));//(" Unknown color specification: $aColor , size=".count($aColor)); + } + } + + // Compare two colors + // return true if equal + function Equal($aCol1,$aCol2) { + $c1 = $this->Color($aCol1); + $c2 = $this->Color($aCol2); + return $c1[0]==$c2[0] && $c1[1]==$c2[1] && $c1[2]==$c2[2] ; + } + + // Allocate a new color in the current image + // Return new color index, -1 if no more colors could be allocated + function Allocate($aColor,$aAlpha=0.0) { + list ($r, $g, $b, $a) = $this->color($aColor); + // If alpha is specified in the color string then this + // takes precedence over the second argument + if( $a > 0 ) { + $aAlpha = $a; + } + if( $aAlpha < 0 || $aAlpha > 1 ) { + JpGraphError::RaiseL(25080);//('Alpha parameter for color must be between 0.0 and 1.0'); + } + return imagecolorresolvealpha($this->img, $r, $g, $b, round($aAlpha * 127)); + } + + // Try to convert an array with three valid numbers to the corresponding hex array + // This is currenly only used in processing the colors for barplots in order to be able + // to handle the case where the color might be specified as an array of colros as well. + // In that case we must be able to find out if an array of values should be interpretated as + // a single color (specifeid as an RGB triple) + static function tryHexConversion($aColor) { + if( is_array( $aColor ) ) { + if( count( $aColor ) == 3 ) { + if( is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2]) ) { + if( ($aColor[0] >= 0 && $aColor[0] <= 255) && + ($aColor[1] >= 0 && $aColor[1] <= 255) && + ($aColor[2] >= 0 && $aColor[2] <= 255) ) { + return sprintf('#%02x%02x%02x',$aColor[0],$aColor[1],$aColor[2]); + } + } + } + } + return $aColor; + } + + // Return a RGB tripple corresponding to a position in the normal light spectrum + // The argumen values is in the range [0, 1] where a value of 0 correponds to blue and + // a value of 1 corresponds to red. Values in betwen is mapped to a linear interpolation + // of the constituting colors in the visible color spectra. + // The $aDynamicRange specified how much of the dynamic range we shold use + // a value of 1.0 give the full dyanmic range and a lower value give more dark + // colors. In the extreme of 0.0 then all colors will be black. + static function GetSpectrum($aVal,$aDynamicRange=1.0) { + if( $aVal < 0 || $aVal > 1.0001 ) { + return array(0,0,0); // Invalid case - just return black + } + + $sat = round(255*$aDynamicRange); + $a = 0.25; + if( $aVal <= 0.25 ) { + return array(0, round($sat*$aVal/$a), $sat); + } + elseif( $aVal <= 0.5 ) { + return array(0, $sat, round($sat-$sat*($aVal-0.25)/$a)); + } + elseif( $aVal <= 0.75 ) { + return array(round($sat*($aVal-0.5)/$a), $sat, 0); + } + else { + return array($sat, round($sat-$sat*($aVal-0.75)/$a), 0); + } + } + +} // Class + +?> diff --git a/includes/jpgraph/src/jpgraph_scatter.php b/includes/jpgraph/src/jpgraph_scatter.php new file mode 100644 index 0000000..9b403de --- /dev/null +++ b/includes/jpgraph/src/jpgraph_scatter.php @@ -0,0 +1,242 @@ +iSize = $aSize; + $this->iArrowSize = $aArrowSize; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function Stroke($aImg,$x,$y,$a) { + // First rotate the center coordinates + list($x,$y) = $aImg->Rotate($x,$y); + + $old_origin = $aImg->SetCenter($x,$y); + $old_a = $aImg->a; + $aImg->SetAngle(-$a+$old_a); + + $dx = round($this->iSize/2); + $c = array($x-$dx,$y,$x+$dx,$y); + $x += $dx; + + list($dx,$dy) = $this->isizespec[$this->iArrowSize]; + $ca = array($x,$y,$x-$dx,$y-$dy,$x-$dx,$y+$dy,$x,$y); + + $aImg->SetColor($this->iColor); + $aImg->Polygon($c); + $aImg->FilledPolygon($ca); + + $aImg->SetCenter($old_origin[0],$old_origin[1]); + $aImg->SetAngle($old_a); + } +} + +//=================================================== +// CLASS FieldPlot +// Description: Render a field plot +//=================================================== +class FieldPlot extends Plot { + public $arrow = ''; + private $iAngles = array(); + private $iCallback = ''; + + function __construct($datay,$datax,$angles) { + if( (count($datax) != count($datay)) ) + JpGraphError::RaiseL(20001);//("Fieldplots must have equal number of X and Y points."); + if( (count($datax) != count($angles)) ) + JpGraphError::RaiseL(20002);//("Fieldplots must have an angle specified for each X and Y points."); + + $this->iAngles = $angles; + + parent::__construct($datay,$datax); + $this->value->SetAlign('center','center'); + $this->value->SetMargin(15); + + $this->arrow = new FieldArrow(); + } + + function SetCallback($aFunc) { + $this->iCallback = $aFunc; + } + + function Stroke($img,$xscale,$yscale) { + + // Remeber base color and size + $bc = $this->arrow->iColor; + $bs = $this->arrow->iSize; + $bas = $this->arrow->iArrowSize; + + for( $i=0; $i<$this->numpoints; ++$i ) { + // Skip null values + if( $this->coords[0][$i]==="" ) + continue; + + $f = $this->iCallback; + if( $f != "" ) { + list($cc,$cs,$cas) = call_user_func($f,$this->coords[1][$i],$this->coords[0][$i],$this->iAngles[$i]); + // Fall back on global data if the callback isn't set + if( $cc == "" ) $cc = $bc; + if( $cs == "" ) $cs = $bs; + if( $cas == "" ) $cas = $bas; + $this->arrow->SetColor($cc); + $this->arrow->SetSize($cs,$cas); + } + + $xt = $xscale->Translate($this->coords[1][$i]); + $yt = $yscale->Translate($this->coords[0][$i]); + + $this->arrow->Stroke($img,$xt,$yt,$this->iAngles[$i]); + $this->value->Stroke($img,$this->coords[0][$i],$xt,$yt); + } + } + + // Framework function + function Legend($aGraph) { + if( $this->legend != "" ) { + $aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + } +} + +//=================================================== +// CLASS ScatterPlot +// Description: Render X and Y plots +//=================================================== +class ScatterPlot extends Plot { + public $mark,$link; + private $impuls = false; + //--------------- + // CONSTRUCTOR + function __construct($datay,$datax=false) { + if( (count($datax) != count($datay)) && is_array($datax)) { + JpGraphError::RaiseL(20003);//("Scatterplot must have equal number of X and Y points."); + } + parent::__construct($datay,$datax); + $this->mark = new PlotMark(); + $this->mark->SetType(MARK_SQUARE); + $this->mark->SetColor($this->color); + $this->value->SetAlign('center','center'); + $this->value->SetMargin(0); + $this->link = new LineProperty(1,'black','solid'); + $this->link->iShow = false; + } + + //--------------- + // PUBLIC METHODS + function SetImpuls($f=true) { + $this->impuls = $f; + } + + function SetStem($f=true) { + $this->impuls = $f; + } + + // Combine the scatter plot points with a line + function SetLinkPoints($aFlag=true,$aColor="black",$aWeight=1,$aStyle='solid') { + $this->link->iShow = $aFlag; + $this->link->iColor = $aColor; + $this->link->iWeight = $aWeight; + $this->link->iStyle = $aStyle; + } + + function Stroke($img,$xscale,$yscale) { + + $ymin=$yscale->scale_abs[0]; + if( $yscale->scale[0] < 0 ) + $yzero=$yscale->Translate(0); + else + $yzero=$yscale->scale_abs[0]; + + $this->csimareas = ''; + for( $i=0; $i<$this->numpoints; ++$i ) { + + // Skip null values + if( $this->coords[0][$i]==='' || $this->coords[0][$i]==='-' || $this->coords[0][$i]==='x') + continue; + + if( isset($this->coords[1]) ) + $xt = $xscale->Translate($this->coords[1][$i]); + else + $xt = $xscale->Translate($i); + $yt = $yscale->Translate($this->coords[0][$i]); + + + if( $this->link->iShow && isset($yt_old) ) { + $img->SetColor($this->link->iColor); + $img->SetLineWeight($this->link->iWeight); + $old = $img->SetLineStyle($this->link->iStyle); + $img->StyleLine($xt_old,$yt_old,$xt,$yt); + $img->SetLineStyle($old); + } + + if( $this->impuls ) { + $img->SetColor($this->color); + $img->SetLineWeight($this->weight); + $img->Line($xt,$yzero,$xt,$yt); + } + + if( !empty($this->csimtargets[$i]) ) { + if( !empty($this->csimwintargets[$i]) ) { + $this->mark->SetCSIMTarget($this->csimtargets[$i],$this->csimwintargets[$i]); + } + else { + $this->mark->SetCSIMTarget($this->csimtargets[$i]); + } + $this->mark->SetCSIMAlt($this->csimalts[$i]); + } + + if( isset($this->coords[1]) ) { + $this->mark->SetCSIMAltVal($this->coords[0][$i],$this->coords[1][$i]); + } + else { + $this->mark->SetCSIMAltVal($this->coords[0][$i],$i); + } + + $this->mark->Stroke($img,$xt,$yt); + + $this->csimareas .= $this->mark->GetCSIMAreas(); + $this->value->Stroke($img,$this->coords[0][$i],$xt,$yt); + + $xt_old = $xt; + $yt_old = $yt; + } + } + + // Framework function + function Legend($aGraph) { + if( $this->legend != "" ) { + $aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0, + $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); + } + } +} // Class +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_stock.php b/includes/jpgraph/src/jpgraph_stock.php new file mode 100644 index 0000000..4487986 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_stock.php @@ -0,0 +1,198 @@ +iTupleSize ) { + JpGraphError::RaiseL(21001,$this->iTupleSize); + //('Data values for Stock charts must contain an even multiple of '.$this->iTupleSize.' data points.'); + } + parent::__construct($datay,$datax); + $this->numpoints /= $this->iTupleSize; + } + //--------------- + // PUBLIC METHODS + + function SetColor($aColor,$aColor1='white',$aColor2='darkred',$aColor3='darkred') { + $this->color = $aColor; + $this->iStockColor1 = $aColor1; + $this->iStockColor2 = $aColor2; + $this->iStockColor3 = $aColor3; + } + + function SetWidth($aWidth) { + // Make sure it's odd + $this->iWidth = 2*floor($aWidth/2)+1; + } + + function HideEndLines($aHide=true) { + $this->iEndLines = !$aHide; + } + + // Gets called before any axis are stroked + function PreStrokeAdjust($graph) { + if( $this->center ) { + $a=0.5; $b=0.5; + $this->numpoints++; + } else { + $a=0; $b=0; + } + $graph->xaxis->scale->ticks->SetXLabelOffset($a); + $graph->SetTextScaleOff($b); + } + + // Method description + function Stroke($img,$xscale,$yscale) { + $n=$this->numpoints; + if( $this->center ) $n--; + if( isset($this->coords[1]) ) { + if( count($this->coords[1])!=$n ) { + JpGraphError::RaiseL(2003,count($this->coords[1]),$n); + // ("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); + } + else { + $exist_x = true; + } + } + else { + $exist_x = false; + } + + if( $exist_x ) { + $xs=$this->coords[1][0]; + } + else { + $xs=0; + } + + $ts = $this->iTupleSize; + $this->csimareas = ''; + for( $i=0; $i<$n; ++$i) { + + //If value is NULL, then don't draw a bar at all + if ($this->coords[0][$i*$ts] === null) continue; + + if( $exist_x ) { + $x=$this->coords[1][$i]; + if ($x === null) continue; + } + else { + $x=$i; + } + $xt = $xscale->Translate($x); + + $neg = $this->coords[0][$i*$ts] > $this->coords[0][$i*$ts+1] ; + $yopen = $yscale->Translate($this->coords[0][$i*$ts]); + $yclose = $yscale->Translate($this->coords[0][$i*$ts+1]); + $ymin = $yscale->Translate($this->coords[0][$i*$ts+2]); + $ymax = $yscale->Translate($this->coords[0][$i*$ts+3]); + + $dx = floor($this->iWidth/2); + $xl = $xt - $dx; + $xr = $xt + $dx; + + if( $neg ) { + $img->SetColor($this->iStockColor3); + } + else { + $img->SetColor($this->iStockColor1); + } + $img->FilledRectangle($xl,$yopen,$xr,$yclose); + $img->SetLineWeight($this->weight); + if( $neg ) { + $img->SetColor($this->iStockColor2); + } + else { + $img->SetColor($this->color); + } + + $img->Rectangle($xl,$yopen,$xr,$yclose); + + if( $yopen < $yclose ) { + $ytop = $yopen ; + $ybottom = $yclose ; + } + else { + $ytop = $yclose ; + $ybottom = $yopen ; + } + $img->SetColor($this->color); + $img->Line($xt,$ytop,$xt,$ymax); + $img->Line($xt,$ybottom,$xt,$ymin); + + if( $this->iEndLines ) { + $img->Line($xl,$ymax,$xr,$ymax); + $img->Line($xl,$ymin,$xr,$ymin); + } + + // A chance for subclasses to add things to the bar + // for data point i + $this->ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg); + + // Setup image maps + if( !empty($this->csimtargets[$i]) ) { + $this->csimareas.= 'csimareas .= ' href="'.$this->csimtargets[$i].'"'; + if( !empty($this->csimalts[$i]) ) { + $sval=$this->csimalts[$i]; + $this->csimareas .= " title=\"$sval\" alt=\"$sval\" "; + } + $this->csimareas.= " />\n"; + } + } + return true; + } + + // A hook for subclasses to modify the plot + function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) {} + +} // Class + +//=================================================== +// CLASS BoxPlot +//=================================================== +class BoxPlot extends StockPlot { + private $iPColor='black',$iNColor='white'; + + function __construct($datay,$datax=false) { + $this->iTupleSize=5; + parent::__construct($datay,$datax); + } + + function SetMedianColor($aPos,$aNeg) { + $this->iPColor = $aPos; + $this->iNColor = $aNeg; + } + + function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) { + if( $neg ) + $img->SetColor($this->iNColor); + else + $img->SetColor($this->iPColor); + + $y = $yscale->Translate($this->coords[0][$i*5+4]); + $img->Line($xl,$y,$xr,$y); + } +} + +/* EOF */ +?> diff --git a/includes/jpgraph/src/jpgraph_table.php b/includes/jpgraph/src/jpgraph_table.php new file mode 100644 index 0000000..b9a6b22 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_table.php @@ -0,0 +1,1325 @@ +iVal = new Text($aVal); + $this->iRow = $aRow; + $this->iCol = $aCol; + $this->iPRow = $aRow; // Initialiy each cell is its own parent + $this->iPCol = $aCol; + $this->iIconConstrain = array(-1,-1); + } + + function Init($aTable) { + $this->iTable = $aTable; + } + + function SetCSIMTarget($aTarget,$aAlt='',$aWinTarget='') { + $this->iCSIMtarget = $aTarget; + $this->iCSIMwintarget = $aWinTarget; + $this->iCSIMalt = $aAlt; + } + + function GetCSIMArea() { + if( $this->iCSIMtarget !== '' ) + return $this->iCSIMArea; + else + return ''; + } + + function SetImageConstrain($aType,$aVal) { + if( !in_array($aType,array(TIMG_WIDTH, TIMG_HEIGHT)) ) { + JpGraphError::RaiseL(27015); + } + $this->iIconConstrain = array($aType,$aVal); + } + + function SetCountryFlag($aFlag,$aScale=1.0,$aMix=100,$aStdSize=3) { + $this->iIcon = new IconPlot(); + $this->iIcon->SetCountryFlag($aFlag,0,0,$aScale,$aMix,$aStdSize); + } + + function SetImage($aFile,$aScale=1.0,$aMix=100) { + $this->iIcon = new IconPlot($aFile,0,0,$aScale,$aMix); + } + + function SetImageFromString($aStr,$aScale=1.0,$aMix=100) { + $this->iIcon = new IconPlot("",0,0,$aScale,$aMix); + $this->iIcon->CreateFromString($aStr); + } + + function SetRowColSpan($aRowSpan,$aColSpan) { + $this->iRowSpan = $aRowSpan; + $this->iColSpan = $aColSpan; + $this->iMerged = true; + } + + function SetMerged($aPRow,$aPCol,$aFlg=true) { + $this->iMerged = $aFlg; + $this->iPRow=$aPRow; + $this->iPCol=$aPCol; + } + + function IsMerged() { + return $this->iMerged; + } + + function SetNumberFormat($aF) { + $this->iNumberFormat = $aF; + } + + function Set($aTxt) { + $this->iVal->Set($aTxt); + } + + function SetFont($aFF,$aFS,$aFSize) { + $this->iFF = $aFF; + $this->iFS = $aFS; + $this->iFSize = $aFSize; + $this->iVal->SetFont($aFF,$aFS,$aFSize); + } + + function SetFillColor($aColor) { + $this->iBGColor=$aColor; + } + + function SetFontColor($aColor) { + $this->iFontColor=$aColor; + } + + function SetGridColor($aLeft,$aTop=null,$aBottom=null,$aRight=null) { + if( $aLeft !== null ) $this->iGridColor[0] = $aLeft; + if( $aTop !== null ) $this->iGridColor[1] = $aTop; + if( $aBottom !== null ) $this->iGridColor[2] = $aBottom; + if( $aRight !== null )$this->iGridColor[3] = $aRight; + } + + function SetGridStyle($aLeft,$aTop=null,$aBottom=null,$aRight=null) { + if( $aLeft !== null ) $this->iGridStyle[0] = $aLeft; + if( $aTop !== null ) $this->iGridStyle[1] = $aTop; + if( $aBottom !== null ) $this->iGridStyle[2] = $aBottom; + if( $aRight !== null )$this->iGridStyle[3] = $aRight; + } + + function SetGridWeight($aLeft=null,$aTop=null,$aBottom=null,$aRight=null) { + if( $aLeft !== null ) $this->iGridWeight[0] = $aLeft; + if( $aTop !== null ) $this->iGridWeight[1] = $aTop; + if( $aBottom !== null ) $this->iGridWeight[2] = $aBottom; + if( $aRight !== null ) $this->iGridWeight[3] = $aRight; + } + + function SetMargin($aLeft,$aRight,$aTop,$aBottom) { + $this->iMarginLeft=$aLeft; + $this->iMarginRight=$aRight; + $this->iMarginTop=$aTop; + $this->iMarginBottom=$aBottom; + } + + function GetWidth($aImg) { + if( $this->iIcon !== null ) { + if( $this->iIconConstrain[0] == TIMG_WIDTH ) { + $this->iIcon->SetScale(1); + $tmp = $this->iIcon->GetWidthHeight(); + $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[0]); + } + elseif( $this->iIconConstrain[0] == TIMG_HEIGHT ) { + $this->iIcon->SetScale(1); + $tmp = $this->iIcon->GetWidthHeight(); + $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[1]); + } + $tmp = $this->iIcon->GetWidthHeight(); + $iwidth = $tmp[0]; + } + else { + $iwidth=0; + } + if( $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->dir == 0 ) { + $pwidth = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetWidth($aImg); + } + elseif( $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->dir == 90 ) { + $pwidth = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetFontHeight($aImg)+2; + } + else { + $pwidth = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetWidth($aImg)+2; + } + + $pcolspan = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iColSpan; + return round(max($iwidth,$pwidth)/$pcolspan) + $this->iMarginLeft + $this->iMarginRight; + } + + function GetHeight($aImg) { + if( $this->iIcon !== null ) { + if( $this->iIconConstrain[0] == TIMG_WIDTH ) { + $this->iIcon->SetScale(1); + $tmp = $this->iIcon->GetWidthHeight(); + $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[0]); + } + elseif( $this->iIconConstrain[0] == TIMG_HEIGHT ) { + $this->iIcon->SetScale(1); + $tmp = $this->iIcon->GetWidthHeight(); + $this->iIcon->SetScale($this->iIconConstrain[1]/$tmp[1]); + } + $tmp = $this->iIcon->GetWidthHeight(); + $iheight = $tmp[1]; + } + else { + $iheight = 0; + } + if( $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->dir == 0 ) { + $pheight = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetHeight($aImg); + } + else { + $pheight = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iVal->GetHeight($aImg)+1; + } + $prowspan = $this->iTable->iCells[$this->iPRow][$this->iPCol]->iRowSpan; + return round(max($iheight,$pheight)/$prowspan) + $this->iMarginTop + $this->iMarginBottom; + } + + function SetAlign($aHorAlign='left',$aVertAlign='bottom') { + $aHorAlign = strtolower($aHorAlign); + $aVertAlign = strtolower($aVertAlign); + $chk = array('left','right','center','bottom','top','middle'); + if( !in_array($aHorAlign,$chk) || !in_array($aVertAlign,$chk) ) { + JpGraphError::RaiseL(27011,$aHorAlign,$aVertAlign); + } + $this->iVertAlign = $aVertAlign; + $this->iHorAlign = $aHorAlign; + } + + function AdjustMarginsForGrid() { + if( $this->iCol > 0 ) { + switch( $this->iGridStyle[0] ) { + case TGRID_SINGLE: $wf=1; break; + case TGRID_DOUBLE: $wf=3; break; + case TGRID_DOUBLE2: $wf=4; break; + } + $this->iMarginLeft += $this->iGridWeight[0]*$wf; + } + if( $this->iRow > 0 ) { + switch( $this->iGridStyle[1] ) { + case TGRID_SINGLE: $wf=1; break; + case TGRID_DOUBLE: $wf=3; break; + case TGRID_DOUBLE2: $wf=4; break; + } + $this->iMarginTop += $this->iGridWeight[1]*$wf; + } + if( $this->iRow+$this->iRowSpan-1 < $this->iTable->iSize[0]-1 ) { + switch( $this->iGridStyle[2] ) { + case TGRID_SINGLE: $wf=1; break; + case TGRID_DOUBLE: $wf=3; break; + case TGRID_DOUBLE2: $wf=4; break; + } + $this->iMarginBottom += $this->iGridWeight[2]*$wf; + } + if( $this->iCol+$this->iColSpan-1 < $this->iTable->iSize[1]-1 ) { + switch( $this->iGridStyle[3] ) { + case TGRID_SINGLE: $wf=1; break; + case TGRID_DOUBLE: $wf=3; break; + case TGRID_DOUBLE2: $wf=4; break; + } + $this->iMarginRight += $this->iGridWeight[3]*$wf; + } + } + + function StrokeVGrid($aImg,$aX,$aY,$aWidth,$aHeight,$aDir=1) { + // Left or right grid line + // For the right we increase the X-pos and for the right we decrease it. This is + // determined by the direction argument. + $idx = $aDir==1 ? 0 : 3; + + // We don't stroke the grid lines that are on the edge of the table since this is + // the place of the border. + if( ( ($this->iCol > 0 && $idx==0) || ($this->iCol+$this->iColSpan-1 < $this->iTable->iSize[1]-1 && $idx==3) ) + && $this->iGridWeight[$idx] > 0 ) { + $x = $aDir==1 ? $aX : $aX + $aWidth-1; + $y = $aY+$aHeight-1; + $aImg->SetColor($this->iGridColor[$idx]); + switch( $this->iGridStyle[$idx] ) { + case TGRID_SINGLE: + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); + break; + + case TGRID_DOUBLE: + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); + $x += $this->iGridWeight[$idx]*2; + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); + break; + + case TGRID_DOUBLE2: + for( $i=0; $i < $this->iGridWeight[$idx]*2; ++$i ) + $aImg->Line($x+$i*$aDir,$aY,$x+$i*$aDir,$y); + $x += $this->iGridWeight[$idx]*3; + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($x+$i*$aDir,$aY, $x+$i*$aDir,$y); + break; + } + } + } + + function StrokeHGrid($aImg,$aX,$aY,$aWidth,$aHeight,$aDir=1) { + // Top or bottom grid line + // For the left we increase the X-pos and for the right we decrease it. This is + // determined by the direction argument. + $idx = $aDir==1 ? 1 : 2; + + // We don't stroke the grid lines that are on the edge of the table since this is + // the place of the border. + if( ( ($this->iRow > 0 && $idx==1) || ($this->iRow+$this->iRowSpan-1 < $this->iTable->iSize[0]-1 && $idx==2) ) + && $this->iGridWeight[$idx] > 0) { + $y = $aDir==1 ? $aY : $aY+$aHeight-1; + $x = $aX+$aWidth-1; + $aImg->SetColor($this->iGridColor[$idx]); + switch( $this->iGridStyle[$idx] ) { + case TGRID_SINGLE: + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($aX,$y+$i, $x,$y+$i); + break; + + case TGRID_DOUBLE: + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($aX,$y+$i, $x,$y+$i); + $y += $this->iGridWeight[$idx]*2; + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($aX,$y+$i, $x,$y+$i); + break; + + case TGRID_DOUBLE2: + for( $i=0; $i < $this->iGridWeight[$idx]*2; ++$i ) + $aImg->Line($aX,$y+$i, $x,$y+$i); + $y += $this->iGridWeight[$idx]*3; + for( $i=0; $i < $this->iGridWeight[$idx]; ++$i ) + $aImg->Line($aX,$y+$i, $x,$y+$i); + break; + } + } + } + + function Stroke($aImg,$aX,$aY,$aWidth,$aHeight) { + // If this is a merged cell we only stroke if it is the parent cell. + // The parent cell holds the merged cell block + if( $this->iMerged && ($this->iRow != $this->iPRow || $this->iCol != $this->iPCol) ) { + return; + } + + if( $this->iBGColor != '' ) { + $aImg->SetColor($this->iBGColor); + $aImg->FilledRectangle($aX,$aY,$aX+$aWidth-1,$aY+$aHeight-1); + } + + $coords = $aX.','.$aY.','.($aX+$aWidth-1).','.$aY.','.($aX+$aWidth-1).','.($aY+$aHeight-1).','.$aX.','.($aY+$aHeight-1); + if( ! empty($this->iCSIMtarget) ) { + $this->iCSIMArea = 'iCSIMwintarget) ) { + $this->iCSIMArea .= " target=\"".$this->iCSIMwintarget."\""; + } + if( ! empty($this->iCSIMalt) ) { + $this->iCSIMArea .= ' alt="'.$this->iCSIMalt.'" title="'.$this->iCSIMalt."\" "; + } + $this->iCSIMArea .= " />\n"; + } + + $this->StrokeVGrid($aImg,$aX,$aY,$aWidth,$aHeight); + $this->StrokeVGrid($aImg,$aX,$aY,$aWidth,$aHeight,-1); + $this->StrokeHGrid($aImg,$aX,$aY,$aWidth,$aHeight); + $this->StrokeHGrid($aImg,$aX,$aY,$aWidth,$aHeight,-1); + + if( $this->iIcon !== null ) { + switch( $this->iHorAlign ) { + case 'left': + $x = $aX+$this->iMarginLeft; + $hanchor='left'; + break; + case 'center': + case 'middle': + $x = $aX+$this->iMarginLeft+round(($aWidth-$this->iMarginLeft-$this->iMarginRight)/2); + $hanchor='center'; + break; + case 'right': + $x = $aX+$aWidth-$this->iMarginRight-1; + $hanchor='right'; + break; + default: + JpGraphError::RaiseL(27012,$this->iHorAlign); + } + + switch( $this->iVertAlign ) { + case 'top': + $y = $aY+$this->iMarginTop; + $vanchor='top'; + break; + case 'center': + case 'middle': + $y = $aY+$this->iMarginTop+round(($aHeight-$this->iMarginTop-$this->iMarginBottom)/2); + $vanchor='center'; + break; + case 'bottom': + $y = $aY+$aHeight-1-$this->iMarginBottom; + $vanchor='bottom'; + break; + default: + JpGraphError::RaiseL(27012,$this->iVertAlign); + } + $this->iIcon->SetAnchor($hanchor,$vanchor); + $this->iIcon->_Stroke($aImg,$x,$y); + } + $this->iVal->SetColor($this->iFontColor); + $this->iVal->SetFont($this->iFF,$this->iFS,$this->iFSize); + switch( $this->iHorAlign ) { + case 'left': + $x = $aX+$this->iMarginLeft; + break; + case 'center': + case 'middle': + $x = $aX+$this->iMarginLeft+round(($aWidth-$this->iMarginLeft-$this->iMarginRight)/2); + break; + case 'right': + $x = $aX+$aWidth-$this->iMarginRight-1; + break; + default: + JpGraphError::RaiseL(27012,$this->iHorAlign); + } + // A workaround for the shortcomings in the TTF font handling in GD + // The anchor position for rotated text (=90) is to "short" so we add + // an offset based on the actual font size + if( $this->iVal->dir != 0 && $this->iVal->font_family >= 10 ) { + $aY += 4 + round($this->iVal->font_size*0.8); + } + switch( $this->iVertAlign ) { + case 'top': + $y = $aY+$this->iMarginTop; + break; + case 'center': + case 'middle': + $y = $aY+$this->iMarginTop+round(($aHeight-$this->iMarginTop-$this->iMarginBottom)/2); + //$y -= round($this->iVal->GetFontHeight($aImg)/2); + $y -= round($this->iVal->GetHeight($aImg)/2); + break; + case 'bottom': + //$y = $aY+$aHeight-1-$this->iMarginBottom-$this->iVal->GetFontHeight($aImg); + $y = $aY+$aHeight-$this->iMarginBottom-$this->iVal->GetHeight($aImg); + break; + default: + JpGraphError::RaiseL(27012,$this->iVertAlign); + } + $this->iVal->SetAlign($this->iHorAlign,'top'); + if( $this->iNumberFormat !== null && is_numeric($this->iVal->t) ) { + $this->iVal->t = sprintf($this->iNumberFormat,$this->iVal->t); + } + $this->iVal->Stroke($aImg,$x,$y); + } +} + +//--------------------------------------------------------------------- +// CLASS GTextTable +// Description: +// Graphic text table +//--------------------------------------------------------------------- +class GTextTable { + public $iCells = array(), $iSize=array(0,0); // Need to be public since they are used by the cell + private $iWidth=0, $iHeight=0; + private $iColWidth=NULL,$iRowHeight=NULL; + private $iImg=NULL; + private $iXPos=0, $iYPos=0; + private $iScaleXPos=null,$iScaleYPos=null; + private $iBGColor=''; + private $iBorderColor='black',$iBorderWeight=1; + private $iInit=false; + private $iYAnchor='top',$iXAnchor='left'; + /*----------------------------------------------------------------- + * First and second phase constructors + *----------------------------------------------------------------- + */ + function __construct() { + // Empty + } + + function Init($aRows=0,$aCols=0,$aFillText='') { + $this->iSize[0] = $aRows; + $this->iSize[1] = $aCols; + for($i=0; $i < $this->iSize[0]; ++$i) { + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$i][$j] = new GTextTableCell($aFillText,$i,$j); + $this->iCells[$i][$j]->Init($this); + } + } + $this->iInit=true; + } + + /*----------------------------------------------------------------- + * Outer border of table + *----------------------------------------------------------------- + */ + function SetBorder($aWeight=1,$aColor='black') { + $this->iBorderColor=$aColor; + $this->iBorderWeight = $aWeight; + } + + + /*----------------------------------------------------------------- + * Position in graph of table + *----------------------------------------------------------------- + */ + function SetPos($aX,$aY) { + $this->iXPos = $aX; + $this->iYPos = $aY; + } + + function SetScalePos($aX,$aY) { + $this->iScaleXPos = $aX; + $this->iScaleYPos = $aY; + } + + function SetAnchorPos($aXAnchor,$aYAnchor='top') { + $this->iXAnchor = $aXAnchor; + $this->iYAnchor = $aYAnchor; + } + + /*----------------------------------------------------------------- + * Setup country flag in a cell + *----------------------------------------------------------------- + */ + function SetCellCountryFlag($aRow,$aCol,$aFlag,$aScale=1.0,$aMix=100,$aStdSize=3) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetCountryFlag($aFlag,$aScale,$aMix,$aStdSize); + + } + + /*----------------------------------------------------------------- + * Setup image in a cell + *----------------------------------------------------------------- + */ + function SetCellImage($aRow,$aCol,$aFile,$aScale=1.0,$aMix=100) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetImage($aFile,$aScale,$aMix); + } + + function SetRowImage($aRow,$aFile,$aScale=1.0,$aMix=100) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetImage($aFile,$aScale,$aMix); + } + } + + function SetColImage($aCol,$aFile,$aScale=1.0,$aMix=100) { + $this->_chkC($aCol); + for($j=0; $j < $this->iSize[0]; ++$j) { + $this->iCells[$j][$aCol]->SetImage($aFile,$aScale,$aMix); + } + } + + function SetImage($aFileR1,$aScaleC1=null,$aMixR2=null,$aC2=null,$aFile=null,$aScale=1.0,$aMix=100) { + if( $aScaleC1 !== null && $aMixR2!==null && $aC2!==null && $aFile!==null ) { + $this->_chkR($aArgR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + } + else { + if( $aScaleC1 !== null ) $aScale = $aScaleC1; + if( $aMixR2 !== null ) $aMix = $aMixR2; + $aFile = $aFileR1; + $aMixR2 = $this->iSize[0]-1; $aFileR1 = 0; + $aC2 = $this->iSize[1]-1; $aScaleC1 = 0; + } + for($i=$aArgR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetImage($aFile,$aScale,$aMix); + } + } + } + + function SetCellImageConstrain($aRow,$aCol,$aType,$aVal) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetImageConstrain($aType,$aVal); + } + + /*----------------------------------------------------------------- + * Generate a HTML version of the table + *----------------------------------------------------------------- + */ + function toString() { + $t = ''; + for($i=0; $i < $this->iSize[0]; ++$i) { + $t .= ''; + for($j=0; $j < $this->iSize[1]; ++$j) { + $t .= ''; + } + $t .= ''; + } + $t .= '
'; + if( $this->iCells[$i][$j]->iMerged ) + $t .= 'M '; + $t .= 'val='.$this->iCells[$i][$j]->iVal->t; + $t .= ' (cs='.$this->iCells[$i][$j]->iColSpan. + ', rs='.$this->iCells[$i][$j]->iRowSpan.')'; + $t .= '
'; + return $t; + } + + /*----------------------------------------------------------------- + * Specify data for table + *----------------------------------------------------------------- + */ + function Set($aArg1,$aArg2=NULL,$aArg3=NULL) { + if( $aArg2===NULL && $aArg3===NULL ) { + if( is_array($aArg1) ) { + if( is_array($aArg1[0]) ) { + $m = count($aArg1); + // Find the longest row + $n=0; + for($i=0; $i < $m; ++$i) + $n = max(count($aArg1[$i]),$n); + for($i=0; $i < $m; ++$i) { + for($j=0; $j < $n; ++$j) { + if( isset($aArg1[$i][$j]) ){ + $this->_setcell($i,$j,(string)$aArg1[$i][$j]); + } + else { + $this->_setcell($i,$j); + } + } + } + $this->iSize[0] = $m; + $this->iSize[1] = $n; + $this->iInit=true; + } + else { + JpGraphError::RaiseL(27001); + //('Illegal argument to GTextTable::Set(). Array must be 2 dimensional'); + } + } + else { + JpGraphError::RaiseL(27002); + //('Illegal argument to GTextTable::Set()'); + } + } + else { + // Must be in the form (row,col,val) + $this->_chkR($aArg1); + $this->_chkC($aArg2); + $this->_setcell($aArg1,$aArg2,(string)$aArg3); + } + } + + /*--------------------------------------------------------------------- + * Cell margin setting + *--------------------------------------------------------------------- + */ + function SetPadding($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aPad=null) { + if( $aC1 !== null && $aR2!==null && $aC2!==null && $aPad!==null ) { + $this->_chkR($aArgR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + } + else { + $aPad = $aArgR1; + $aR2 = $this->iSize[0]-1; $aArgR1 = 0; + $aC2 = $this->iSize[1]-1; $aC1 = 0; + } + for($i=$aArgR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetMargin($aPad,$aPad,$aPad,$aPad); + } + } + } + + function SetRowPadding($aRow,$aPad) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetMargin($aPad,$aPad,$aPad,$aPad); + } + } + + function SetColPadding($aCol,$aPad) { + $this->_chkC($aCol); + for($j=0; $j < $this->iSize[0]; ++$j) { + $this->iCells[$j][$aCol]->SetMargin($aPad,$aPad,$aPad,$aPad); + } + } + + function SetCellPadding($aRow,$aCol,$aPad) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetMargin($aPad,$aPad,$aPad,$aPad); + } + + + /*--------------------------------------------------------------------- + * Cell text orientation setting + *--------------------------------------------------------------------- + */ + function SetTextOrientation($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aO=null) { + if( $aC1 !== null && $aR2!==null && $aC2!==null && $aPad!==null ) { + $this->_chkR($aArgR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + } + else { + $aO = $aArgR1; + $aR2 = $this->iSize[0]-1; $aArgR1 = 0; + $aC2 = $this->iSize[1]-1; $aC1 = 0; + } + for($i=$aArgR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->iVal->SetOrientation($aO); + } + } + } + + function SetRowTextOrientation($aRow,$aO) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->iVal->SetOrientation($aO); + } + } + + function SetColTextOrientation($aCol,$aO) { + $this->_chkC($aCol); + for($j=0; $j < $this->iSize[0]; ++$j) { + $this->iCells[$j][$aCol]->iVal->SetOrientation($aO); + } + } + + function SetCellTextOrientation($aRow,$aCol,$aO) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->iVal->SetOrientation($aO); + } + + + + + /*--------------------------------------------------------------------- + * Font color setting + *--------------------------------------------------------------------- + */ + + function SetColor($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aArg=null) { + if( $aC1 !== null && $aR2!==null && $aC2!==null && $aArg!==null ) { + $this->_chkR($aArgR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + } + else { + $aArg = $aArgR1; + $aR2 = $this->iSize[0]-1; $aArgR1 = 0; + $aC2 = $this->iSize[1]-1; $aC1 = 0; + } + for($i=$aArgR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetFontColor($aArg); + } + } + } + + function SetRowColor($aRow,$aColor) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetFontColor($aColor); + } + } + + function SetColColor($aCol,$aColor) { + $this->_chkC($aCol); + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iCells[$i][$aCol]->SetFontColor($aColor); + } + } + + function SetCellColor($aRow,$aCol,$aColor) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetFontColor($aColor); + } + + /*--------------------------------------------------------------------- + * Fill color settings + *--------------------------------------------------------------------- + */ + + function SetFillColor($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aArg=null) { + if( $aC1 !== null && $aR2!==null && $aC2!==null && $aArg!==null ) { + $this->_chkR($aArgR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + for($i=$aArgR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetFillColor($aArg); + } + } + } + else { + $this->iBGColor = $aArgR1; + } + } + + function SetRowFillColor($aRow,$aColor) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetFillColor($aColor); + } + } + + function SetColFillColor($aCol,$aColor) { + $this->_chkC($aCol); + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iCells[$i][$aCol]->SetFillColor($aColor); + } + } + + function SetCellFillColor($aRow,$aCol,$aColor) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetFillColor($aColor); + } + + /*--------------------------------------------------------------------- + * Font family setting + *--------------------------------------------------------------------- + */ + function SetFont() { + $numargs = func_num_args(); + if( $numargs == 2 || $numargs == 3 ) { + $aFF = func_get_arg(0); + $aFS = func_get_arg(1); + if( $numargs == 3 ) + $aFSize=func_get_arg(2); + else + $aFSize=10; + $aR2 = $this->iSize[0]-1; $aR1 = 0; + $aC2 = $this->iSize[1]-1; $aC1 = 0; + + } + elseif($numargs == 6 || $numargs == 7 ) { + $aR1 = func_get_arg(0); $aC1 = func_get_arg(1); + $aR2 = func_get_arg(2); $aC2 = func_get_arg(3); + $aFF = func_get_arg(4); $aFS = func_get_arg(5); + if( $numargs == 7 ) + $aFSize=func_get_arg(6); + else + $aFSize=10; + } + else { + JpGraphError::RaiseL(27003); + //('Wrong number of arguments to GTextTable::SetColor()'); + } + $this->_chkR($aR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + for($i=$aR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetFont($aFF,$aFS,$aFSize); + } + } + } + + function SetRowFont($aRow,$aFF,$aFS,$aFSize=10) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetFont($aFF,$aFS,$aFSize); + } + } + + function SetColFont($aCol,$aFF,$aFS,$aFSize=10) { + $this->_chkC($aCol); + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iCells[$i][$aCol]->SetFont($aFF,$aFS,$aFSize); + } + } + + function SetCellFont($aRow,$aCol,$aFF,$aFS,$aFSize=10) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetFont($aFF,$aFS,$aFSize); + } + + /*--------------------------------------------------------------------- + * Cell align settings + *--------------------------------------------------------------------- + */ + + function SetAlign($aR1HAlign=null,$aC1VAlign=null,$aR2=null,$aC2=null,$aHArg=null,$aVArg='center') { + if( $aC1VAlign !== null && $aR2!==null && $aC2!==null && $aHArg!==null ) { + $this->_chkR($aR1HAlign); $this->_chkC($aC1VAlign); + $this->_chkR($aR2); $this->_chkC($aC2); + } + else { + if( $aR1HAlign === null ) { + JpGraphError::RaiseL(27010); + } + if( $aC1VAlign === null ) { + $aC1VAlign = 'center'; + } + $aHArg = $aR1HAlign; + $aVArg = $aC1VAlign === null ? 'center' : $aC1VAlign ; + $aR2 = $this->iSize[0]-1; $aR1HAlign = 0; + $aC2 = $this->iSize[1]-1; $aC1VAlign = 0; + } + for($i=$aR1HAlign; $i <= $aR2; ++$i) { + for($j=$aC1VAlign; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetAlign($aHArg,$aVArg); + } + } + } + + function SetCellAlign($aRow,$aCol,$aHorAlign,$aVertAlign='bottom') { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetAlign($aHorAlign,$aVertAlign); + } + + function SetRowAlign($aRow,$aHorAlign,$aVertAlign='bottom') { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetAlign($aHorAlign,$aVertAlign); + } + } + + function SetColAlign($aCol,$aHorAlign,$aVertAlign='bottom') { + $this->_chkC($aCol); + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iCells[$i][$aCol]->SetAlign($aHorAlign,$aVertAlign); + } + } + + /*--------------------------------------------------------------------- + * Cell number format + *--------------------------------------------------------------------- + */ + + function SetNumberFormat($aArgR1,$aC1=null,$aR2=null,$aC2=null,$aArg=null) { + if( $aC1 !== null && $aR2!==null && $aC2!==null && $aArg!==null ) { + $this->_chkR($aArgR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + } + else { + $aArg = $aArgR1; + $aR2 = $this->iSize[0]-1; $aArgR1 = 0; + $aC2 = $this->iSize[1]-1; $aC1 = 0; + } + if( !is_string($aArg) ) { + JpGraphError::RaiseL(27013); // argument must be a string + } + for($i=$aArgR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + $this->iCells[$i][$j]->SetNumberFormat($aArg); + } + } + } + + function SetRowNumberFormat($aRow,$aF) { + $this->_chkR($aRow); + if( !is_string($aF) ) { + JpGraphError::RaiseL(27013); // argument must be a string + } + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetNumberFormat($aF); + } + } + + function SetColNumberFormat($aCol,$aF) { + $this->_chkC($aCol); + if( !is_string($aF) ) { + JpGraphError::RaiseL(27013); // argument must be a string + } + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iCells[$i][$aCol]->SetNumberFormat($aF); + } + } + + function SetCellNumberFormat($aRow,$aCol,$aF) { + $this->_chkR($aRow); $this->_chkC($aCol); + if( !is_string($aF) ) { + JpGraphError::RaiseL(27013); // argument must be a string + } + $this->iCells[$aRow][$aCol]->SetNumberFormat($aF); + } + + /*--------------------------------------------------------------------- + * Set row and column min size + *--------------------------------------------------------------------- + */ + + function SetMinColWidth($aColWidth,$aWidth=null) { + // If there is only one argument this means that all + // columns get set to the same width + if( $aWidth===null ) { + for($i=0; $i < $this->iSize[1]; ++$i) { + $this->iColWidth[$i] = $aColWidth; + } + } + else { + $this->_chkC($aColWidth); + $this->iColWidth[$aColWidth] = $aWidth; + } + } + + function SetMinRowHeight($aRowHeight,$aHeight=null) { + // If there is only one argument this means that all + // rows get set to the same height + if( $aHeight===null ) { + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iRowHeight[$i] = $aRowHeight; + } + } + else { + $this->_chkR($aRowHeight); + $this->iRowHeight[$aRowHeight] = $aHeight; + } + } + + /*--------------------------------------------------------------------- + * Grid line settings + *--------------------------------------------------------------------- + */ + + function SetGrid($aWeight=1,$aColor='black',$aStyle=TGRID_SINGLE) { + $rc = $this->iSize[0]; + $cc = $this->iSize[1]; + for($i=0; $i < $rc; ++$i) { + for($j=0; $j < $cc; ++$j) { + $this->iCells[$i][$j]->SetGridColor($aColor,$aColor); + $this->iCells[$i][$j]->SetGridWeight($aWeight,$aWeight); + $this->iCells[$i][$j]->SetGridStyle($aStyle); + } + } + } + + function SetColGrid($aCol,$aWeight=1,$aColor='black',$aStyle=TGRID_SINGLE) { + $this->_chkC($aCol); + for($i=0; $i < $this->iSize[0]; ++$i) { + $this->iCells[$i][$aCol]->SetGridWeight($aWeight); + $this->iCells[$i][$aCol]->SetGridColor($aColor); + $this->iCells[$i][$aCol]->SetGridStyle($aStyle); + } + } + + function SetRowGrid($aRow,$aWeight=1,$aColor='black',$aStyle=TGRID_SINGLE) { + $this->_chkR($aRow); + for($j=0; $j < $this->iSize[1]; ++$j) { + $this->iCells[$aRow][$j]->SetGridWeight(NULL,$aWeight); + $this->iCells[$aRow][$j]->SetGridColor(NULL,$aColor); + $this->iCells[$aRow][$j]->SetGridStyle(NULL,$aStyle); + } + } + + /*--------------------------------------------------------------------- + * Merge cells + *--------------------------------------------------------------------- + */ + + function MergeRow($aRow,$aHAlign='center',$aVAlign='center') { + $this->_chkR($aRow); + $this->MergeCells($aRow,0,$aRow,$this->iSize[1]-1,$aHAlign,$aVAlign); + } + + function MergeCol($aCol,$aHAlign='center',$aVAlign='center') { + $this->_chkC($aCol); + $this->MergeCells(0,$aCol,$this->iSize[0]-1,$aCol,$aHAlign,$aVAlign); + } + + function MergeCells($aR1,$aC1,$aR2,$aC2,$aHAlign='center',$aVAlign='center') { + if( $aR1 > $aR2 || $aC1 > $aC2 ) { + JpGraphError::RaiseL(27004); + //('GTextTable::MergeCells(). Specified cell range to be merged is not valid.'); + } + $this->_chkR($aR1); $this->_chkC($aC1); + $this->_chkR($aR2); $this->_chkC($aC2); + $rspan = $aR2-$aR1+1; + $cspan = $aC2-$aC1+1; + // Setup the parent cell for this merged group + if( $this->iCells[$aR1][$aC1]->IsMerged() ) { + JpGraphError::RaiseL(27005,$aR1,$aC1,$aR2,$aC2); + //("Cannot merge already merged cells in the range ($aR1,$aC1), ($aR2,$aC2)"); + } + $this->iCells[$aR1][$aC1]->SetRowColSpan($rspan,$cspan); + $this->iCells[$aR1][$aC1]->SetAlign($aHAlign,$aVAlign); + for($i=$aR1; $i <= $aR2; ++$i) { + for($j=$aC1; $j <= $aC2; ++$j) { + if( ! ($i == $aR1 && $j == $aC1) ) { + if( $this->iCells[$i][$j]->IsMerged() ) { + JpGraphError::RaiseL(27005,$aR1,$aC1,$aR2,$aC2); + //("Cannot merge already merged cells in the range ($aR1,$aC1), ($aR2,$aC2)"); + } + $this->iCells[$i][$j]->SetMerged($aR1,$aC1,true); + } + } + } + } + + + /*--------------------------------------------------------------------- + * CSIM methods + *--------------------------------------------------------------------- + */ + + function SetCSIMTarget($aTarget,$aAlt=null,$aAutoTarget=false) { + $m = $this->iSize[0]; + $n = $this->iSize[1]; + $csim = ''; + for($i=0; $i < $m; ++$i) { + for($j=0; $j < $n; ++$j) { + if( $aAutoTarget ) + $t = $aTarget."?row=$i&col=$j"; + else + $t = $aTarget; + $this->iCells[$i][$j]->SetCSIMTarget($t,$aAlt); + } + } + } + + function SetCellCSIMTarget($aRow,$aCol,$aTarget,$aAlt=null) { + $this->_chkR($aRow); + $this->_chkC($aCol); + $this->iCells[$aRow][$aCol]->SetCSIMTarget($aTarget,$aAlt); + } + + /*--------------------------------------------------------------------- + * Private methods + *--------------------------------------------------------------------- + */ + + function GetCSIMAreas() { + $m = $this->iSize[0]; + $n = $this->iSize[1]; + $csim = ''; + for($i=0; $i < $m; ++$i) { + for($j=0; $j < $n; ++$j) { + $csim .= $this->iCells[$i][$j]->GetCSIMArea(); + } + } + return $csim; + } + + function _chkC($aCol) { + if( ! $this->iInit ) { + JpGraphError::Raise(27014); // Table not initialized + } + if( $aCol < 0 || $aCol >= $this->iSize[1] ) + JpGraphError::RaiseL(27006,$aCol); + //("GTextTable:\nColumn argument ($aCol) is outside specified table size."); + } + + function _chkR($aRow) { + if( ! $this->iInit ) { + JpGraphError::Raise(27014); // Table not initialized + } + if( $aRow < 0 || $aRow >= $this->iSize[0] ) + JpGraphError::RaiseL(27007,$aRow); + //("GTextTable:\nRow argument ($aRow) is outside specified table size."); + } + + function _getScalePos() { + if( $this->iScaleXPos === null || $this->iScaleYPos === null ) { + return false; + } + return array($this->iScaleXPos, $this->iScaleYPos); + } + + function _autoSizeTable($aImg) { + // Get maximum column width and row height + $m = $this->iSize[0]; + $n = $this->iSize[1]; + $w=1;$h=1; + + // Get maximum row height per row + for($i=0; $i < $m; ++$i) { + $h=0; + for($j=0; $j < $n; ++$j) { + $h = max($h,$this->iCells[$i][$j]->GetHeight($aImg)); + } + if( isset($this->iRowHeight[$i]) ) { + $this->iRowHeight[$i] = max($h,$this->iRowHeight[$i]); + } + else + $this->iRowHeight[$i] = $h; + } + + // Get maximum col width per columns + for($j=0; $j < $n; ++$j) { + $w=0; + for($i=0; $i < $m; ++$i) { + $w = max($w,$this->iCells[$i][$j]->GetWidth($aImg)); + } + if( isset($this->iColWidth[$j]) ) { + $this->iColWidth[$j] = max($w,$this->iColWidth[$j]); + } + else + $this->iColWidth[$j] = $w; + } + } + + function _setcell($aRow,$aCol,$aVal='') { + if( isset($this->iCells[$aRow][$aCol]) ) { + $this->iCells[$aRow][$aCol]->Set($aVal); + } + else { + $this->iCells[$aRow][$aCol] = new GTextTableCell((string)$aVal,$aRow,$aCol); + $this->iCells[$aRow][$aCol]->Init($this); + } + } + + function StrokeWithScale($aImg,$aXScale,$aYScale) { + if( is_numeric($this->iScaleXPos) && is_numeric($this->iScaleYPos) ) { + $x = round($aXScale->Translate($this->iScaleXPos)); + $y = round($aYScale->Translate($this->iScaleYPos)); + $this->Stroke($aImg,$x,$y); + } + else { + $this->Stroke($aImg); + } + } + + function Stroke($aImg,$aX=NULL,$aY=NULL) { + if( $aX !== NULL && $aY !== NULL ) { + $this->iXPos = $aX; + $this->iYPos = $aY; + } + + $rc = $this->iSize[0]; // row count + $cc = $this->iSize[1]; // column count + + if( $rc == 0 || $cc == 0 ) { + JpGraphError::RaiseL(27009); + } + + // Adjust margins of each cell based on the weight of the grid. Each table grid line + // is actually occupying the left side and top part of each cell. + for($j=0; $j < $cc; ++$j) { + $this->iCells[0][$j]->iMarginTop += $this->iBorderWeight; + } + for($i=0; $i < $rc; ++$i) { + $this->iCells[$i][0]->iMarginLeft += $this->iBorderWeight; + } + for($i=0; $i < $rc; ++$i) { + for($j=0; $j < $cc; ++$j) { + $this->iCells[$i][$j]->AdjustMarginsForGrid(); + } + } + + // adjust row and column size depending on cell content + $this->_autoSizeTable($aImg); + + if( $this->iSize[1] != count($this->iColWidth) || $this->iSize[0] != count($this->iRowHeight) ) { + JpGraphError::RaiseL(27008); + //('Column and row size arrays must match the dimesnions of the table'); + } + + // Find out overall table size + $width=0; + for($i=0; $i < $cc; ++$i) { + $width += $this->iColWidth[$i]; + } + $height=0; + for($i=0; $i < $rc; ++$i) { + $height += $this->iRowHeight[$i]; + } + + // Adjust the X,Y position to alway be at the top left corner + // The anchor position, i.e. how the client want to interpret the specified + // x and y coordinate must be taken into account + switch( strtolower($this->iXAnchor) ) { + case 'left' : + break; + case 'center': + $this->iXPos -= round($width/2); + break; + case 'right': + $this->iXPos -= $width; + break; + } + switch( strtolower($this->iYAnchor) ) { + case 'top' : + break; + case 'center': + case 'middle': + $this->iYPos -= round($height/2); + break; + case 'bottom': + $this->iYPos -= $height; + break; + } + + // Set the overall background color of the table if set + if( $this->iBGColor !== '' ) { + $aImg->SetColor($this->iBGColor); + $aImg->FilledRectangle($this->iXPos,$this->iYPos,$this->iXPos+$width,$this->iYPos+$height); + } + + // Stroke all cells + $rpos=$this->iYPos; + for($i=0; $i < $rc; ++$i) { + $cpos=$this->iXPos; + for($j=0; $j < $cc; ++$j) { + // Calculate width and height of this cell if it is spanning + // more than one column or row + $cwidth=0; + for( $k=0; $k < $this->iCells[$i][$j]->iColSpan; ++$k ) { + $cwidth += $this->iColWidth[$j+$k]; + } + $cheight=0; + for( $k=0; $k < $this->iCells[$i][$j]->iRowSpan; ++$k ) { + $cheight += $this->iRowHeight[$i+$k]; + } + + $this->iCells[$i][$j]->Stroke($aImg,$cpos,$rpos,$cwidth,$cheight); + $cpos += $this->iColWidth[$j]; + } + $rpos += $this->iRowHeight[$i]; + } + + // Stroke outer border + $aImg->SetColor($this->iBorderColor); + if( $this->iBorderWeight == 1 ) + $aImg->Rectangle($this->iXPos,$this->iYPos,$this->iXPos+$width,$this->iYPos+$height); + else { + for( $i=0; $i < $this->iBorderWeight; ++$i ) + $aImg->Rectangle($this->iXPos+$i,$this->iYPos+$i, + $this->iXPos+$width-1+$this->iBorderWeight-$i, + $this->iYPos+$height-1+$this->iBorderWeight-$i); + } + } +} + +/* + EOF + */ +?> diff --git a/includes/jpgraph/src/jpgraph_text.inc.php b/includes/jpgraph/src/jpgraph_text.inc.php new file mode 100644 index 0000000..aa97092 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_text.inc.php @@ -0,0 +1,327 @@ +t = $aTxt; + $this->x = round($aXAbsPos); + $this->y = round($aYAbsPos); + $this->margin = 0; + } + //--------------- + // PUBLIC METHODS + // Set the string in the text object + function Set($aTxt) { + $this->t = $aTxt; + } + + // Alias for Pos() + function SetPos($aXAbsPos=0,$aYAbsPos=0,$aHAlign="left",$aVAlign="top") { + //$this->Pos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign); + $this->x = $aXAbsPos; + $this->y = $aYAbsPos; + $this->halign = $aHAlign; + $this->valign = $aVAlign; + } + + function SetScalePos($aX,$aY) { + $this->iScalePosX = $aX; + $this->iScalePosY = $aY; + } + + // Specify alignment for the text + function Align($aHAlign,$aVAlign="top",$aParagraphAlign="") { + $this->halign = $aHAlign; + $this->valign = $aVAlign; + if( $aParagraphAlign != "" ) + $this->paragraph_align = $aParagraphAlign; + } + + // Alias + function SetAlign($aHAlign,$aVAlign="top",$aParagraphAlign="") { + $this->Align($aHAlign,$aVAlign,$aParagraphAlign); + } + + // Specifies the alignment for a multi line text + function ParagraphAlign($aAlign) { + $this->paragraph_align = $aAlign; + } + + // Specifies the alignment for a multi line text + function SetParagraphAlign($aAlign) { + $this->paragraph_align = $aAlign; + } + + function SetShadow($aShadowColor='gray',$aShadowWidth=3) { + $this->ishadowwidth=$aShadowWidth; + $this->shadow=$aShadowColor; + $this->boxed=true; + } + + function SetWordWrap($aCol) { + $this->iWordwrap = $aCol ; + } + + // Specify that the text should be boxed. fcolor=frame color, bcolor=border color, + // $shadow=drop shadow should be added around the text. + function SetBox($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) { + if( $aFrameColor === false ) { + $this->boxed=false; + } + else { + $this->boxed=true; + } + $this->fcolor=$aFrameColor; + $this->bcolor=$aBorderColor; + // For backwards compatibility when shadow was just true or false + if( $aShadowColor === true ) { + $aShadowColor = 'gray'; + } + $this->shadow=$aShadowColor; + $this->icornerradius=$aCornerRadius; + $this->ishadowwidth=$aShadowWidth; + } + + function SetBox2($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) { + $this->iBoxType=2; + $this->SetBox($aFrameColor,$aBorderColor,$aShadowColor,$aCornerRadius,$aShadowWidth); + } + + // Hide the text + function Hide($aHide=true) { + $this->hide=$aHide; + } + + // This looks ugly since it's not a very orthogonal design + // but I added this "inverse" of Hide() to harmonize + // with some classes which I designed more recently (especially) + // jpgraph_gantt + function Show($aShow=true) { + $this->hide=!$aShow; + } + + // Specify font + function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { + $this->font_family=$aFamily; + $this->font_style=$aStyle; + $this->font_size=$aSize; + } + + // Center the text between $left and $right coordinates + function Center($aLeft,$aRight,$aYAbsPos=false) { + $this->x = $aLeft + ($aRight-$aLeft )/2; + $this->halign = "center"; + if( is_numeric($aYAbsPos) ) + $this->y = $aYAbsPos; + } + + // Set text color + function SetColor($aColor) { + $this->color = $aColor; + } + + function SetAngle($aAngle) { + $this->SetOrientation($aAngle); + } + + // Orientation of text. Note only TTF fonts can have an arbitrary angle + function SetOrientation($aDirection=0) { + if( is_numeric($aDirection) ) + $this->dir=$aDirection; + elseif( $aDirection=="h" ) + $this->dir = 0; + elseif( $aDirection=="v" ) + $this->dir = 90; + else + JpGraphError::RaiseL(25051);//(" Invalid direction specified for text."); + } + + // Total width of text + function GetWidth($aImg) { + $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); + $w = $aImg->GetTextWidth($this->t,$this->dir); + return $w; + } + + // Hight of font + function GetFontHeight($aImg) { + $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); + $h = $aImg->GetFontHeight(); + return $h; + + } + + function GetTextHeight($aImg) { + $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); + $h = $aImg->GetTextHeight($this->t,$this->dir); + return $h; + } + + function GetHeight($aImg) { + // Synonym for GetTextHeight() + $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); + $h = $aImg->GetTextHeight($this->t,$this->dir); + return $h; + } + + // Set the margin which will be interpretated differently depending + // on the context. + function SetMargin($aMarg) { + $this->margin = $aMarg; + } + + function StrokeWithScale($aImg,$axscale,$ayscale) { + if( $this->iScalePosX === null || $this->iScalePosY === null ) { + $this->Stroke($aImg); + } + else { + $this->Stroke($aImg, + round($axscale->Translate($this->iScalePosX)), + round($ayscale->Translate($this->iScalePosY))); + } + } + + function SetCSIMTarget($aURITarget,$aAlt='',$aWinTarget='') { + $this->iCSIMtarget = $aURITarget; + $this->iCSIMalt = $aAlt; + $this->iCSIMWinTarget = $aWinTarget; + } + + function GetCSIMareas() { + if( $this->iCSIMtarget !== '' ) { + return $this->iCSIMarea; + } + else { + return ''; + } + } + + // Display text in image + function Stroke($aImg,$x=null,$y=null) { + + if( $x !== null ) $this->x = round($x); + if( $y !== null ) $this->y = round($y); + + // Insert newlines + if( $this->iWordwrap > 0 ) { + $this->t = wordwrap($this->t,$this->iWordwrap,"\n"); + } + + // If position been given as a fraction of the image size + // calculate the absolute position + if( $this->x < 1 && $this->x > 0 ) $this->x *= $aImg->width; + if( $this->y < 1 && $this->y > 0 ) $this->y *= $aImg->height; + + $aImg->PushColor($this->color); + $aImg->SetFont($this->font_family,$this->font_style,$this->raw_font_size); + $aImg->SetTextAlign($this->halign,$this->valign); + + if( $this->boxed ) { + if( $this->fcolor=="nofill" ) { + $this->fcolor=false; + } + + $oldweight=$aImg->SetLineWeight(1); + + if( $this->iBoxType == 2 && $this->font_family > FF_FONT2+2 ) { + + $bbox = $aImg->StrokeBoxedText2($this->x, $this->y, + $this->t, $this->dir, + $this->fcolor, + $this->bcolor, + $this->shadow, + $this->paragraph_align, + 2,4, + $this->icornerradius, + $this->ishadowwidth); + } + else { + $bbox = $aImg->StrokeBoxedText($this->x,$this->y,$this->t, + $this->dir,$this->fcolor,$this->bcolor,$this->shadow, + $this->paragraph_align,3,3,$this->icornerradius, + $this->ishadowwidth); + } + + $aImg->SetLineWeight($oldweight); + } + else { + $debug=false; + $bbox = $aImg->StrokeText($this->x,$this->y,$this->t,$this->dir,$this->paragraph_align,$debug); + } + + // Create CSIM targets + $coords = $bbox[0].','.$bbox[1].','.$bbox[2].','.$bbox[3].','.$bbox[4].','.$bbox[5].','.$bbox[6].','.$bbox[7]; + $this->iCSIMarea = "iCSIMtarget)."\" "; + if( trim($this->iCSIMalt) != '' ) { + $this->iCSIMarea .= " alt=\"".$this->iCSIMalt."\" "; + $this->iCSIMarea .= " title=\"".$this->iCSIMalt."\" "; + } + if( trim($this->iCSIMWinTarget) != '' ) { + $this->iCSIMarea .= " target=\"".$this->iCSIMWinTarget."\" "; + } + $this->iCSIMarea .= " />\n"; + + $aImg->PopColor($this->color); + } + + function __get($name) { + + if (strpos($name, 'raw_') !== false) { + // if $name == 'raw_left_margin' , return $this->_left_margin; + $variable_name = '_' . str_replace('raw_', '', $name); + return $this->$variable_name; + } + + $variable_name = '_' . $name; + + if (isset($this->$variable_name)) { + return $this->$variable_name * SUPERSAMPLING_SCALE; + } else { + JpGraphError::RaiseL('25132', $name); + } + } + + function __set($name, $value) { + $this->{'_'.$name} = $value; + } +} // Class + + +?> diff --git a/includes/jpgraph/src/jpgraph_theme.inc.php b/includes/jpgraph/src/jpgraph_theme.inc.php new file mode 100644 index 0000000..a6d9789 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_theme.inc.php @@ -0,0 +1,136 @@ +color_index = 0; + } + /** + * + */ + abstract function GetColorList(); + + /** + * + */ + abstract function ApplyPlot($plot); + + + /** + * + */ + function SetupPlot($plot) { + if (is_array($plot)) { + foreach ($plot as $obj) { + $this->ApplyPlot($obj); + } + } else { + $this->ApplyPlot($plot); + } + } + + /** + * + */ + function ApplyGraph($graph) { + + $this->graph = $graph; + $method_name = ''; + + if (get_class($graph) == 'Graph') { + $method_name = 'SetupGraph'; + } else { + $method_name = 'Setup' . get_class($graph); + } + + if (method_exists($this, $method_name)) { + $this->$method_name($graph); + } else { + JpGraphError::RaiseL(30001, $method_name, $method_name); //Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs. + } + } + + /** + * + */ + function PreStrokeApply($graph) { + } + + /** + * + */ + function GetThemeColors($num = 30) { + $result_list = array(); + + $old_index = $this->color_index; + $this->color_index = 0; + $count = 0; + + $i = 0; + while (true) { + for ($j = 0; $j < count($this->GetColorList()); $j++) { + if (++$count > $num) { + break 2; + } + $result_list[] = $this->GetNextColor(); + } + $i++; + } + + $this->color_index = $old_index; + + return $result_list; + } + + /** + * + */ + function GetNextColor() { + $color_list = $this->GetColorList(); + + $color = null; + if (isset($color_list[$this->color_index])) { + $color = $color_list[$this->color_index]; + } else { + $color_count = count($color_list); + if ($color_count <= $this->color_index) { + $color_tmp = $color_list[$this->color_index % $color_count]; + $brightness = 1.0 - intval($this->color_index / $color_count) * 0.2; + $rgb = new RGB(); + $color = $color_tmp . ':' . $brightness; + $color = $rgb->Color($color); + $alpha = array_pop($color); + $color = $rgb->tryHexConversion($color); + if ($alpha) { + $color .= '@' . $alpha; + } + } + } + + $this->color_index++; + + return $color; + } + +} // Class + +?> diff --git a/includes/jpgraph/src/jpgraph_ttf.inc.php b/includes/jpgraph/src/jpgraph_ttf.inc.php new file mode 100644 index 0000000..341245e --- /dev/null +++ b/includes/jpgraph/src/jpgraph_ttf.inc.php @@ -0,0 +1,631 @@ +g2312 == null ) { + include_once 'jpgraph_gb2312.php' ; + $this->g2312 = new GB2312toUTF8(); + } + return $this->g2312->gb2utf8($aTxt); + } + elseif( $aFF === FF_BIG5 ) { + if( !function_exists('iconv') ) { + JpGraphError::RaiseL(25006); + //('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).'); + } + return iconv('BIG5','UTF-8',$aTxt); + } + elseif( ASSUME_EUCJP_ENCODING && + ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC) ) { + if( !function_exists('mb_convert_encoding') ) { + JpGraphError::RaiseL(25127); + } + return mb_convert_encoding($aTxt, 'UTF-8','EUC-JP'); + } + elseif( $aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON ) { + return LanguageConv::heb_iso2uni($aTxt); + } + else + return $aTxt; + } + + // Translate iso encoding to unicode + public static function iso2uni ($isoline){ + $uniline=''; + for ($i=0; $i < strlen($isoline); $i++){ + $thischar=substr($isoline,$i,1); + $charcode=ord($thischar); + $uniline.=($charcode>175) ? "&#" . (1040+($charcode-176)). ";" : $thischar; + } + return $uniline; + } + + // Translate greek iso encoding to unicode + public static function gr_iso2uni ($isoline) { + $uniline=''; + for ($i=0; $i < strlen($isoline); $i++) { + $thischar=substr($isoline,$i,1); + $charcode=ord($thischar); + $uniline.=($charcode>179 && $charcode!=183 && $charcode!=187 && $charcode!=189) ? "&#" . (900+($charcode-180)). ";" : $thischar; + } + return $uniline; + } + + // Translate greek win encoding to unicode + public static function gr_win2uni ($winline) { + $uniline=''; + for ($i=0; $i < strlen($winline); $i++) { + $thischar=substr($winline,$i,1); + $charcode=ord($thischar); + if ($charcode==161 || $charcode==162) { + $uniline.="&#" . (740+$charcode). ";"; + } + else { + $uniline.=(($charcode>183 && $charcode!=187 && $charcode!=189) || $charcode==180) ? "&#" . (900+($charcode-180)). ";" : $thischar; + } + } + return $uniline; + } + + public static function heb_iso2uni($isoline) { + $isoline = hebrev($isoline); + $o = ''; + + $n = strlen($isoline); + for($i=0; $i < $n; $i++) { + $c=ord( substr($isoline,$i,1) ); + $o .= ($c > 223) && ($c < 251) ? '&#'.(1264+$c).';' : chr($c); + } + return utf8_encode($o); + } +} + +//============================================================= +// CLASS TTF +// Description: Handle TTF font names and mapping and loading of +// font files +//============================================================= +class TTF { + private $font_files,$style_names; + + function __construct() { + + // String names for font styles to be used in error messages + $this->style_names=array( + FS_NORMAL =>'normal', + FS_BOLD =>'bold', + FS_ITALIC =>'italic', + FS_BOLDITALIC =>'bolditalic'); + + // File names for available fonts + $this->font_files=array( + FF_COURIER => array(FS_NORMAL =>'cour.ttf', + FS_BOLD =>'courbd.ttf', + FS_ITALIC =>'couri.ttf', + FS_BOLDITALIC =>'courbi.ttf' ), + FF_GEORGIA => array(FS_NORMAL =>'georgia.ttf', + FS_BOLD =>'georgiab.ttf', + FS_ITALIC =>'georgiai.ttf', + FS_BOLDITALIC =>'' ), + FF_TREBUCHE =>array(FS_NORMAL =>'trebuc.ttf', + FS_BOLD =>'trebucbd.ttf', + FS_ITALIC =>'trebucit.ttf', + FS_BOLDITALIC =>'trebucbi.ttf' ), + FF_VERDANA => array(FS_NORMAL =>'verdana.ttf', + FS_BOLD =>'verdanab.ttf', + FS_ITALIC =>'verdanai.ttf', + FS_BOLDITALIC =>'' ), + FF_TIMES => array(FS_NORMAL =>'times.ttf', + FS_BOLD =>'timesbd.ttf', + FS_ITALIC =>'timesi.ttf', + FS_BOLDITALIC =>'timesbi.ttf' ), + FF_COMIC => array(FS_NORMAL =>'comic.ttf', + FS_BOLD =>'comicbd.ttf', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + FF_ARIAL => array(FS_NORMAL =>'arial.ttf', + FS_BOLD =>'arialbd.ttf', + FS_ITALIC =>'ariali.ttf', + FS_BOLDITALIC =>'arialbi.ttf' ) , + FF_VERA => array(FS_NORMAL =>'Vera.ttf', + FS_BOLD =>'VeraBd.ttf', + FS_ITALIC =>'VeraIt.ttf', + FS_BOLDITALIC =>'VeraBI.ttf' ), + FF_VERAMONO => array(FS_NORMAL =>'VeraMono.ttf', + FS_BOLD =>'VeraMoBd.ttf', + FS_ITALIC =>'VeraMoIt.ttf', + FS_BOLDITALIC =>'VeraMoBI.ttf' ), + FF_VERASERIF=> array(FS_NORMAL =>'VeraSe.ttf', + FS_BOLD =>'VeraSeBd.ttf', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ) , + + /* Chinese fonts */ + FF_SIMSUN => array( + FS_NORMAL =>'simsun.ttc', + FS_BOLD =>'simhei.ttf', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + FF_CHINESE => array( + FS_NORMAL =>CHINESE_TTF_FONT, + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + FF_BIG5 => array( + FS_NORMAL =>CHINESE_TTF_FONT, + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + /* Japanese fonts */ + FF_MINCHO => array( + FS_NORMAL =>MINCHO_TTF_FONT, + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_PMINCHO => array( + FS_NORMAL =>PMINCHO_TTF_FONT, + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_GOTHIC => array( + FS_NORMAL =>GOTHIC_TTF_FONT, + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_PGOTHIC => array( + FS_NORMAL =>PGOTHIC_TTF_FONT, + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + /* Hebrew fonts */ + FF_DAVID => array( + FS_NORMAL =>'DAVIDNEW.TTF', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_MIRIAM => array( + FS_NORMAL =>'MRIAMY.TTF', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_AHRON => array( + FS_NORMAL =>'ahronbd.ttf', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + /* Misc fonts */ + FF_DIGITAL => array( + FS_NORMAL =>'DIGIRU__.TTF', + FS_BOLD =>'Digirtu_.ttf', + FS_ITALIC =>'Digir___.ttf', + FS_BOLDITALIC =>'DIGIRT__.TTF' ), + + /* This is an experimental font for the speedometer development + FF_SPEEDO => array( + FS_NORMAL =>'Speedo.ttf', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + */ + + FF_COMPUTER => array( + FS_NORMAL =>'COMPUTER.TTF', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_CALCULATOR => array( + FS_NORMAL =>'Triad_xs.ttf', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + /* Dejavu fonts */ + FF_DV_SANSSERIF => array( + FS_NORMAL =>array('DejaVuSans.ttf'), + FS_BOLD =>array('DejaVuSans-Bold.ttf','DejaVuSansBold.ttf'), + FS_ITALIC =>array('DejaVuSans-Oblique.ttf','DejaVuSansOblique.ttf'), + FS_BOLDITALIC =>array('DejaVuSans-BoldOblique.ttf','DejaVuSansBoldOblique.ttf') ), + + FF_DV_SANSSERIFMONO => array( + FS_NORMAL =>array('DejaVuSansMono.ttf','DejaVuMonoSans.ttf'), + FS_BOLD =>array('DejaVuSansMono-Bold.ttf','DejaVuMonoSansBold.ttf'), + FS_ITALIC =>array('DejaVuSansMono-Oblique.ttf','DejaVuMonoSansOblique.ttf'), + FS_BOLDITALIC =>array('DejaVuSansMono-BoldOblique.ttf','DejaVuMonoSansBoldOblique.ttf') ), + + FF_DV_SANSSERIFCOND => array( + FS_NORMAL =>array('DejaVuSansCondensed.ttf','DejaVuCondensedSans.ttf'), + FS_BOLD =>array('DejaVuSansCondensed-Bold.ttf','DejaVuCondensedSansBold.ttf'), + FS_ITALIC =>array('DejaVuSansCondensed-Oblique.ttf','DejaVuCondensedSansOblique.ttf'), + FS_BOLDITALIC =>array('DejaVuSansCondensed-BoldOblique.ttf','DejaVuCondensedSansBoldOblique.ttf') ), + + FF_DV_SERIF => array( + FS_NORMAL =>array('DejaVuSerif.ttf'), + FS_BOLD =>array('DejaVuSerif-Bold.ttf','DejaVuSerifBold.ttf'), + FS_ITALIC =>array('DejaVuSerif-Italic.ttf','DejaVuSerifItalic.ttf'), + FS_BOLDITALIC =>array('DejaVuSerif-BoldItalic.ttf','DejaVuSerifBoldItalic.ttf') ), + + FF_DV_SERIFCOND => array( + FS_NORMAL =>array('DejaVuSerifCondensed.ttf','DejaVuCondensedSerif.ttf'), + FS_BOLD =>array('DejaVuSerifCondensed-Bold.ttf','DejaVuCondensedSerifBold.ttf'), + FS_ITALIC =>array('DejaVuSerifCondensed-Italic.ttf','DejaVuCondensedSerifItalic.ttf'), + FS_BOLDITALIC =>array('DejaVuSerifCondensed-BoldItalic.ttf','DejaVuCondensedSerifBoldItalic.ttf') ), + + + /* Placeholders for defined fonts */ + FF_USERFONT1 => array( + FS_NORMAL =>'', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_USERFONT2 => array( + FS_NORMAL =>'', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + FF_USERFONT3 => array( + FS_NORMAL =>'', + FS_BOLD =>'', + FS_ITALIC =>'', + FS_BOLDITALIC =>'' ), + + ); + } + + //--------------- + // PUBLIC METHODS + // Create the TTF file from the font specification + function File($family,$style=FS_NORMAL) { + $fam = @$this->font_files[$family]; + if( !$fam ) { + JpGraphError::RaiseL(25046,$family);//("Specified TTF font family (id=$family) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/"); + } + $ff = @$fam[$style]; + + // There are several optional file names. They are tried in order + // and the first one found is used + if( !is_array($ff) ) { + $ff = array($ff); + } + + $jpgraph_font_dir = dirname(__FILE__).'/fonts/'; + + foreach ($ff as $font_file) { + // All font families are guaranteed to have the normal style + + if( $font_file==='' ) + JpGraphError::RaiseL(25047,$this->style_names[$style],$this->font_files[$family][FS_NORMAL]);//('Style "'.$this->style_names[$style].'" is not available for font family '.$this->font_files[$family][FS_NORMAL].'.'); + if( !$font_file ) { + JpGraphError::RaiseL(25048,$fam);//("Unknown font style specification [$fam]."); + } + + // check jpgraph/src/fonts dir + $jpgraph_font_file = $jpgraph_font_dir . $font_file; + if (file_exists($jpgraph_font_file) === true && is_readable($jpgraph_font_file) === true) { + $font_file = $jpgraph_font_file; + break; + } + + // check OS font dir + if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) { + $font_file = MBTTF_DIR.$font_file; + } else { + $font_file = TTF_DIR.$font_file; + } + if (file_exists($font_file) === true && is_readable($font_file) === true) { + break; + } + } + + if( !file_exists($font_file) ) { + JpGraphError::RaiseL(25049,$font_file);//("Font file \"$font_file\" is not readable or does not exist."); + } + + return $font_file; + } + + function SetUserFont($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->font_files[FF_USERFONT] = + array(FS_NORMAL => $aNormal, + FS_BOLD => $aBold, + FS_ITALIC => $aItalic, + FS_BOLDITALIC => $aBoldIt ) ; + } + + function SetUserFont1($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->font_files[FF_USERFONT1] = + array(FS_NORMAL => $aNormal, + FS_BOLD => $aBold, + FS_ITALIC => $aItalic, + FS_BOLDITALIC => $aBoldIt ) ; + } + + function SetUserFont2($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->font_files[FF_USERFONT2] = + array(FS_NORMAL => $aNormal, + FS_BOLD => $aBold, + FS_ITALIC => $aItalic, + FS_BOLDITALIC => $aBoldIt ) ; + } + + function SetUserFont3($aNormal,$aBold='',$aItalic='',$aBoldIt='') { + $this->font_files[FF_USERFONT3] = + array(FS_NORMAL => $aNormal, + FS_BOLD => $aBold, + FS_ITALIC => $aItalic, + FS_BOLDITALIC => $aBoldIt ) ; + } + +} // Class + + +//============================================================================= +// CLASS SymChar +// Description: Code values for some commonly used characters that +// normally isn't available directly on the keyboard, for example +// mathematical and greek symbols. +//============================================================================= +class SymChar { + static function Get($aSymb,$aCapital=FALSE) { + $iSymbols = array( + /* Greek */ + array('alpha','03B1','0391'), + array('beta','03B2','0392'), + array('gamma','03B3','0393'), + array('delta','03B4','0394'), + array('epsilon','03B5','0395'), + array('zeta','03B6','0396'), + array('ny','03B7','0397'), + array('eta','03B8','0398'), + array('theta','03B8','0398'), + array('iota','03B9','0399'), + array('kappa','03BA','039A'), + array('lambda','03BB','039B'), + array('mu','03BC','039C'), + array('nu','03BD','039D'), + array('xi','03BE','039E'), + array('omicron','03BF','039F'), + array('pi','03C0','03A0'), + array('rho','03C1','03A1'), + array('sigma','03C3','03A3'), + array('tau','03C4','03A4'), + array('upsilon','03C5','03A5'), + array('phi','03C6','03A6'), + array('chi','03C7','03A7'), + array('psi','03C8','03A8'), + array('omega','03C9','03A9'), + /* Money */ + array('euro','20AC'), + array('yen','00A5'), + array('pound','20A4'), + /* Math */ + array('approx','2248'), + array('neq','2260'), + array('not','2310'), + array('def','2261'), + array('inf','221E'), + array('sqrt','221A'), + array('int','222B'), + /* Misc */ + array('copy','00A9'), + array('para','00A7'), + array('tm','2122'), /* Trademark symbol */ + array('rtm','00AE'), /* Registered trademark */ + array('degree','00b0'), + array('lte','2264'), /* Less than or equal */ + array('gte','2265'), /* Greater than or equal */ + + ); + + $n = count($iSymbols); + $i=0; + $found = false; + $aSymb = strtolower($aSymb); + while( $i < $n && !$found ) { + $found = $aSymb === $iSymbols[$i++][0]; + } + if( $found ) { + $ca = $iSymbols[--$i]; + if( $aCapital && count($ca)==3 ) + $s = $ca[2]; + else + $s = $ca[1]; + return sprintf('&#%04d;',hexdec($s)); + } + else + return ''; + } +} + + +?> diff --git a/includes/jpgraph/src/jpgraph_utils.inc.php b/includes/jpgraph/src/jpgraph_utils.inc.php new file mode 100644 index 0000000..3562d3b --- /dev/null +++ b/includes/jpgraph/src/jpgraph_utils.inc.php @@ -0,0 +1,685 @@ +iFunc = $aFunc; + $this->iXFunc = $aXFunc; + } + + function E($aXMin,$aXMax,$aSteps=50) { + $this->iMin = $aXMin; + $this->iMax = $aXMax; + $this->iStepSize = ($aXMax-$aXMin)/$aSteps; + + if( $this->iXFunc != '' ) + $t = 'for($i='.$aXMin.'; $i<='.$aXMax.'; $i += '.$this->iStepSize.') {$ya[]='.$this->iFunc.';$xa[]='.$this->iXFunc.';}'; + elseif( $this->iFunc != '' ) + $t = 'for($x='.$aXMin.'; $x<='.$aXMax.'; $x += '.$this->iStepSize.') {$ya[]='.$this->iFunc.';$xa[]=$x;} $x='.$aXMax.';$ya[]='.$this->iFunc.';$xa[]=$x;'; + else + JpGraphError::RaiseL(24001);//('FuncGenerator : No function specified. '); + + @eval($t); + + // If there is an error in the function specifcation this is the only + // way we can discover that. + if( empty($xa) || empty($ya) ) + JpGraphError::RaiseL(24002);//('FuncGenerator : Syntax error in function specification '); + + return array($xa,$ya); + } +} + + +//============================================================================= +// CLASS DateScaleUtils +// Description: Help to create a manual date scale +//============================================================================= +define('DSUTILS_MONTH',1); // Major and minor ticks on a monthly basis +define('DSUTILS_MONTH1',1); // Major and minor ticks on a monthly basis +define('DSUTILS_MONTH2',2); // Major ticks on a bi-monthly basis +define('DSUTILS_MONTH3',3); // Major icks on a tri-monthly basis +define('DSUTILS_MONTH6',4); // Major on a six-monthly basis +define('DSUTILS_WEEK1',5); // Major ticks on a weekly basis +define('DSUTILS_WEEK2',6); // Major ticks on a bi-weekly basis +define('DSUTILS_WEEK4',7); // Major ticks on a quod-weekly basis +define('DSUTILS_DAY1',8); // Major ticks on a daily basis +define('DSUTILS_DAY2',9); // Major ticks on a bi-daily basis +define('DSUTILS_DAY4',10); // Major ticks on a qoud-daily basis +define('DSUTILS_YEAR1',11); // Major ticks on a yearly basis +define('DSUTILS_YEAR2',12); // Major ticks on a bi-yearly basis +define('DSUTILS_YEAR5',13); // Major ticks on a five-yearly basis + + +class DateScaleUtils { + public static $iMin=0, $iMax=0; + + private static $starthour,$startmonth, $startday, $startyear; + private static $endmonth, $endyear, $endday; + private static $tickPositions=array(),$minTickPositions=array(); + private static $iUseWeeks = true; + + static function UseWeekFormat($aFlg) { + self::$iUseWeeks = $aFlg; + } + + static function doYearly($aType,$aMinor=false) { + $i=0; $j=0; + $m = self::$startmonth; + $y = self::$startyear; + + if( self::$startday == 1 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); + } + ++$m; + + + switch( $aType ) { + case DSUTILS_YEAR1: + for($y=self::$startyear; $y <= self::$endyear; ++$y ) { + if( $aMinor ) { + while( $m <= 12 ) { + if( !($y == self::$endyear && $m > self::$endmonth) ) { + self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); + } + ++$m; + } + $m=1; + } + self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); + } + break; + case DSUTILS_YEAR2: + $y=self::$startyear; + while( $y <= self::$endyear ) { + self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); + for($k=0; $k < 1; ++$k ) { + ++$y; + if( $aMinor ) { + self::$minTickPositions[$j++] = mktime(0,0,0,1,1,$y); + } + } + ++$y; + } + break; + case DSUTILS_YEAR5: + $y=self::$startyear; + while( $y <= self::$endyear ) { + self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); + for($k=0; $k < 4; ++$k ) { + ++$y; + if( $aMinor ) { + self::$minTickPositions[$j++] = mktime(0,0,0,1,1,$y); + } + } + ++$y; + } + break; + } + } + + static function doDaily($aType,$aMinor=false) { + $m = self::$startmonth; + $y = self::$startyear; + $d = self::$startday; + $h = self::$starthour; + $i=0;$j=0; + + if( $h == 0 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,$d,$y); + } + $t = mktime(0,0,0,$m,$d,$y); + + switch($aType) { + case DSUTILS_DAY1: + while( $t <= self::$iMax ) { + $t = strtotime('+1 day',$t); + self::$tickPositions[$i++] = $t; + if( $aMinor ) { + self::$minTickPositions[$j++] = strtotime('+12 hours',$t); + } + } + break; + case DSUTILS_DAY2: + while( $t <= self::$iMax ) { + $t = strtotime('+1 day',$t); + if( $aMinor ) { + self::$minTickPositions[$j++] = $t; + } + $t = strtotime('+1 day',$t); + self::$tickPositions[$i++] = $t; + } + break; + case DSUTILS_DAY4: + while( $t <= self::$iMax ) { + for($k=0; $k < 3; ++$k ) { + $t = strtotime('+1 day',$t); + if( $aMinor ) { + self::$minTickPositions[$j++] = $t; + } + } + $t = strtotime('+1 day',$t); + self::$tickPositions[$i++] = $t; + } + break; + } + } + + static function doWeekly($aType,$aMinor=false) { + $hpd = 3600*24; + $hpw = 3600*24*7; + // Find out week number of min date + $thursday = self::$iMin + $hpd * (3 - (date('w', self::$iMin) + 6) % 7); + $week = 1 + (date('z', $thursday) - (11 - date('w', mktime(0, 0, 0, 1, 1, date('Y', $thursday)))) % 7) / 7; + $daynumber = date('w',self::$iMin); + if( $daynumber == 0 ) $daynumber = 7; + $m = self::$startmonth; + $y = self::$startyear; + $d = self::$startday; + $i=0;$j=0; + // The assumption is that the weeks start on Monday. If the first day + // is later in the week then the first week tick has to be on the following + // week. + if( $daynumber == 1 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,$d,$y); + $t = mktime(0,0,0,$m,$d,$y) + $hpw; + } + else { + $t = mktime(0,0,0,$m,$d,$y) + $hpd*(8-$daynumber); + } + + switch($aType) { + case DSUTILS_WEEK1: + $cnt=0; + break; + case DSUTILS_WEEK2: + $cnt=1; + break; + case DSUTILS_WEEK4: + $cnt=3; + break; + } + while( $t <= self::$iMax ) { + self::$tickPositions[$i++] = $t; + for($k=0; $k < $cnt; ++$k ) { + $t += $hpw; + if( $aMinor ) { + self::$minTickPositions[$j++] = $t; + } + } + $t += $hpw; + } + } + + static function doMonthly($aType,$aMinor=false) { + $monthcount=0; + $m = self::$startmonth; + $y = self::$startyear; + $i=0; $j=0; + + // Skip the first month label if it is before the startdate + if( self::$startday == 1 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); + $monthcount=1; + } + if( $aType == 1 ) { + if( self::$startday < 15 ) { + self::$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y); + } + } + ++$m; + + // Loop through all the years included in the scale + for($y=self::$startyear; $y <= self::$endyear; ++$y ) { + // Loop through all the months. There are three cases to consider: + // 1. We are in the first year and must start with the startmonth + // 2. We are in the end year and we must stop at last month of the scale + // 3. A year in between where we run through all the 12 months + $stopmonth = $y == self::$endyear ? self::$endmonth : 12; + while( $m <= $stopmonth ) { + switch( $aType ) { + case DSUTILS_MONTH1: + // Set minor tick at the middle of the month + if( $aMinor ) { + if( $m <= $stopmonth ) { + if( !($y==self::$endyear && $m==$stopmonth && self::$endday < 15) ) + self::$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y); + } + } + // Major at month + // Get timestamp of first hour of first day in each month + self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); + + break; + case DSUTILS_MONTH2: + if( $aMinor ) { + // Set minor tick at start of each month + self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); + } + + // Major at every second month + // Get timestamp of first hour of first day in each month + if( $monthcount % 2 == 0 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); + } + break; + case DSUTILS_MONTH3: + if( $aMinor ) { + // Set minor tick at start of each month + self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); + } + // Major at every third month + // Get timestamp of first hour of first day in each month + if( $monthcount % 3 == 0 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); + } + break; + case DSUTILS_MONTH6: + if( $aMinor ) { + // Set minor tick at start of each month + self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); + } + // Major at every third month + // Get timestamp of first hour of first day in each month + if( $monthcount % 6 == 0 ) { + self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); + } + break; + } + ++$m; + ++$monthcount; + } + $m=1; + } + + // For the case where all dates are within the same month + // we want to make sure we have at least two ticks on the scale + // since the scale want work properly otherwise + if(self::$startmonth == self::$endmonth && self::$startyear == self::$endyear && $aType==1 ) { + self::$tickPositions[$i++] = mktime(0 ,0 ,0, self::$startmonth + 1, 1, self::$startyear); + } + + return array(self::$tickPositions,self::$minTickPositions); + } + + static function GetTicks($aData,$aType=1,$aMinor=false,$aEndPoints=false) { + $n = count($aData); + return self::GetTicksFromMinMax($aData[0],$aData[$n-1],$aType,$aMinor,$aEndPoints); + } + + static function GetAutoTicks($aMin,$aMax,$aMaxTicks=10,$aMinor=false) { + $diff = $aMax - $aMin; + $spd = 3600*24; + $spw = $spd*7; + $spm = $spd*30; + $spy = $spd*352; + + if( self::$iUseWeeks ) + $w = 'W'; + else + $w = 'd M'; + + // Decision table for suitable scales + // First value: Main decision point + // Second value: Array of formatting depending on divisor for wanted max number of ticks. ,.. + $tt = array( + array($spw, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',-1,DSUTILS_DAY4,'d M')), + array($spm, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',4,DSUTILS_DAY4,'d M',7,DSUTILS_WEEK1,$w,-1,DSUTILS_WEEK2,$w)), + array($spy, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',4,DSUTILS_DAY4,'d M',7,DSUTILS_WEEK1,$w,14,DSUTILS_WEEK2,$w,30,DSUTILS_MONTH1,'M',60,DSUTILS_MONTH2,'M',-1,DSUTILS_MONTH3,'M')), + array(-1, array(30,DSUTILS_MONTH1,'M-Y',60,DSUTILS_MONTH2,'M-Y',90,DSUTILS_MONTH3,'M-Y',180,DSUTILS_MONTH6,'M-Y',352,DSUTILS_YEAR1,'Y',704,DSUTILS_YEAR2,'Y',-1,DSUTILS_YEAR5,'Y'))); + + $ntt = count($tt); + $nd = floor($diff/$spd); + for($i=0; $i < $ntt; ++$i ) { + if( $diff <= $tt[$i][0] || $i==$ntt-1) { + $t = $tt[$i][1]; + $n = count($t)/3; + for( $j=0; $j < $n; ++$j ) { + if( $nd/$t[3*$j] <= $aMaxTicks || $j==$n-1) { + $type = $t[3*$j+1]; + $fs = $t[3*$j+2]; + list($tickPositions,$minTickPositions) = self::GetTicksFromMinMax($aMin,$aMax,$type,$aMinor); + return array($fs,$tickPositions,$minTickPositions,$type); + } + } + } + } + } + + static function GetTicksFromMinMax($aMin,$aMax,$aType,$aMinor=false,$aEndPoints=false) { + self::$starthour = date('G',$aMin); + self::$startmonth = date('n',$aMin); + self::$startday = date('j',$aMin); + self::$startyear = date('Y',$aMin); + self::$endmonth = date('n',$aMax); + self::$endyear = date('Y',$aMax); + self::$endday = date('j',$aMax); + self::$iMin = $aMin; + self::$iMax = $aMax; + + if( $aType <= DSUTILS_MONTH6 ) { + self::doMonthly($aType,$aMinor); + } + elseif( $aType <= DSUTILS_WEEK4 ) { + self::doWeekly($aType,$aMinor); + } + elseif( $aType <= DSUTILS_DAY4 ) { + self::doDaily($aType,$aMinor); + } + elseif( $aType <= DSUTILS_YEAR5 ) { + self::doYearly($aType,$aMinor); + } + else { + JpGraphError::RaiseL(24003); + } + // put a label at the very left data pos + if( $aEndPoints ) { + $tickPositions[$i++] = $aData[0]; + } + + // put a label at the very right data pos + if( $aEndPoints ) { + $tickPositions[$i] = $aData[$n-1]; + } + + return array(self::$tickPositions,self::$minTickPositions); + } +} + +//============================================================================= +// Class ReadFileData +//============================================================================= +Class ReadFileData { + //---------------------------------------------------------------------------- + // Desciption: + // Read numeric data from a file. + // Each value should be separated by either a new line or by a specified + // separator character (default is ','). + // Before returning the data each value is converted to a proper float + // value. The routine is robust in the sense that non numeric data in the + // file will be discarded. + // + // Returns: + // The number of data values read on success, FALSE on failure + //---------------------------------------------------------------------------- + static function FromCSV($aFile,&$aData,$aSepChar=',',$aMaxLineLength=1024) { + $rh = @fopen($aFile,'r'); + if( $rh === false ) { + return false; + } + $tmp = array(); + $lineofdata = fgetcsv($rh, 1000, ','); + while ( $lineofdata !== FALSE) { + $tmp = array_merge($tmp,$lineofdata); + $lineofdata = fgetcsv($rh, $aMaxLineLength, $aSepChar); + } + fclose($rh); + + // Now make sure that all data is numeric. By default + // all data is read as strings + $n = count($tmp); + $aData = array(); + $cnt=0; + for($i=0; $i < $n; ++$i) { + if( $tmp[$i] !== "" ) { + $aData[$cnt++] = floatval($tmp[$i]); + } + } + return $cnt; + } + + //---------------------------------------------------------------------------- + // Desciption: + // Read numeric data from a file. + // Each value should be separated by either a new line or by a specified + // separator character (default is ','). + // Before returning the data each value is converted to a proper float + // value. The routine is robust in the sense that non numeric data in the + // file will be discarded. + // + // Options: + // 'separator' => ',', + // 'enclosure' => '"', + // 'readlength' => 1024, + // 'ignore_first' => false, + // 'first_as_key' => false + // 'escape' => '\', # PHP >= 5.3 only + // + // Returns: + // The number of lines read on success, FALSE on failure + //---------------------------------------------------------------------------- + static function FromCSV2($aFile, &$aData, $aOptions = array()) { + $aDefaults = array( + 'separator' => ',', + 'enclosure' => chr(34), + 'escape' => chr(92), + 'readlength' => 1024, + 'ignore_first' => false, + 'first_as_key' => false + ); + + $aOptions = array_merge( + $aDefaults, is_array($aOptions) ? $aOptions : array()); + + if( $aOptions['first_as_key'] ) { + $aOptions['ignore_first'] = true; + } + + $rh = @fopen($aFile, 'r'); + + if( $rh === false ) { + return false; + } + + $aData = array(); + $aLine = fgetcsv($rh, + $aOptions['readlength'], + $aOptions['separator'], + $aOptions['enclosure'] + /*, $aOptions['escape'] # PHP >= 5.3 only */ + ); + + // Use numeric array keys for the columns by default + // If specified use first lines values as assoc keys instead + $keys = array_keys($aLine); + if( $aOptions['first_as_key'] ) { + $keys = array_values($aLine); + } + + $num_lines = 0; + $num_cols = count($aLine); + + while ($aLine !== false) { + if( is_array($aLine) && count($aLine) != $num_cols ) { + JpGraphError::RaiseL(24004); + // 'ReadCSV2: Column count mismatch in %s line %d' + } + + // fgetcsv returns NULL for empty lines + if( !is_null($aLine) ) { + $num_lines++; + + if( !($aOptions['ignore_first'] && $num_lines == 1) && is_numeric($aLine[0]) ) { + for( $i = 0; $i < $num_cols; $i++ ) { + $aData[ $keys[$i] ][] = floatval($aLine[$i]); + } + } + } + + $aLine = fgetcsv($rh, + $aOptions['readlength'], + $aOptions['separator'], + $aOptions['enclosure'] + /*, $aOptions['escape'] # PHP >= 5.3 only*/ + ); + } + + fclose($rh); + + if( $aOptions['ignore_first'] ) { + $num_lines--; + } + + return $num_lines; + } + + // Read data from two columns in a plain text file + static function From2Col($aFile, $aCol1, $aCol2, $aSepChar=' ') { + $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); + if( $lines === false ) { + return false; + } + $s = '/[\s]+/'; + if( $aSepChar == ',' ) { + $s = '/[\s]*,[\s]*/'; + } + elseif( $aSepChar == ';' ) { + $s = '/[\s]*;[\s]*/'; + } + foreach( $lines as $line => $datarow ) { + $split = preg_split($s,$datarow); + $aCol1[] = floatval(trim($split[0])); + $aCol2[] = floatval(trim($split[1])); + } + + return count($lines); + } + + // Read data from one columns in a plain text file + static function From1Col($aFile, $aCol1) { + $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); + if( $lines === false ) { + return false; + } + foreach( $lines as $line => $datarow ) { + $aCol1[] = floatval(trim($datarow)); + } + + return count($lines); + } + + static function FromMatrix($aFile,$aSepChar=' ') { + $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); + if( $lines === false ) { + return false; + } + $mat = array(); + $reg = '/'.$aSepChar.'/'; + foreach( $lines as $line => $datarow ) { + $row = preg_split($reg,trim($datarow)); + foreach ($row as $key => $cell ) { + $row[$key] = floatval(trim($cell)); + } + $mat[] = $row; + } + return $mat; + } + + +} + +define('__LR_EPSILON', 1.0e-8); +//============================================================================= +// Class LinearRegression +//============================================================================= +class LinearRegression { + private $ix=array(),$iy=array(); + private $ib=0, $ia=0; + private $icalculated=false; + public $iDet=0, $iCorr=0, $iStdErr=0; + + public function __construct($aDataX,$aDataY) { + if( count($aDataX) !== count($aDataY) ) { + JpGraph::Raise('LinearRegression: X and Y data array must be of equal length.'); + } + $this->ix = $aDataX; + $this->iy = $aDataY; + } + + public function Calc() { + + $this->icalculated = true; + + $n = count($this->ix); + $sx2 = 0 ; + $sy2 = 0 ; + $sxy = 0 ; + $sx = 0 ; + $sy = 0 ; + + for( $i=0; $i < $n; ++$i ) { + $sx2 += $this->ix[$i] * $this->ix[$i]; + $sy2 += $this->iy[$i] * $this->iy[$i]; + $sxy += $this->ix[$i] * $this->iy[$i]; + $sx += $this->ix[$i]; + $sy += $this->iy[$i]; + } + + if( $n*$sx2 - $sx*$sx > __LR_EPSILON ) { + $this->ib = ($n*$sxy - $sx*$sy) / ( $n*$sx2 - $sx*$sx ); + $this->ia = ( $sy - $this->ib*$sx ) / $n; + + $sx = $this->ib * ( $sxy - $sx*$sy/$n ); + $sy2 = $sy2 - $sy*$sy/$n; + $sy = $sy2 - $sx; + + $this->iDet = $sx / $sy2; + $this->iCorr = sqrt($this->iDet); + if( $n > 2 ) { + $this->iStdErr = sqrt( $sy / ($n-2) ); + } + else { + $this->iStdErr = NAN ; + } + } + else { + $this->ib = 0; + $this->ia = 0; + } + + } + + public function GetAB() { + if( $this->icalculated == false ) + $this->Calc(); + return array($this->ia, $this->ib); + } + + public function GetStat() { + if( $this->icalculated == false ) + $this->Calc(); + return array($this->iStdErr, $this->iCorr, $this->iDet); + } + + public function GetY($aMinX, $aMaxX, $aStep=1) { + if( $this->icalculated == false ) + $this->Calc(); + + $yy = array(); + $i = 0; + for( $x=$aMinX; $x <= $aMaxX; $x += $aStep ) { + $xx[$i ] = $x; + $yy[$i++] = $this->ia + $this->ib * $x; + } + + return array($xx,$yy); + } + +} + +?> diff --git a/includes/jpgraph/src/jpgraph_windrose.php b/includes/jpgraph/src/jpgraph_windrose.php new file mode 100644 index 0000000..3870635 --- /dev/null +++ b/includes/jpgraph/src/jpgraph_windrose.php @@ -0,0 +1,1566 @@ +iZeroSum=0; + foreach( $aData as $idx => $legdata ) { + $legsum = array_sum($legdata); + $maxnum = max($maxnum,count($legdata)-1); + $max = max($legsum-$legdata[0],$max); + $totlegsum += $legsum; + $this->iZeroSum += $legdata[0] ; + } + if( round($totlegsum) > 100 ) { + JpGraphError::RaiseL(22001,$legsum); + //("Total percentage for all windrose legs in a windrose plot can not exceed 100% !\n(Current max is: ".$legsum.')'); + } + $this->iMax = $max ; + $this->iMaxNum = $maxnum; + $this->iNumCirc = $this->GetNumCirc(); + $this->iMaxVal = $this->iNumCirc * $this->iDelta ; + } + + // Return number of grid circles + function GetNumCirc() { + // Never return less than 1 circles + $num = ceil($this->iMax / $this->iDelta); + return max(1,$num) ; + } + + function SetMaxValue($aMax) { + $this->iMax = $aMax; + $this->iNumCirc = $this->GetNumCirc(); + $this->iMaxVal = $this->iNumCirc * $this->iDelta ; + } + + // Set step size for circular grid + function Set($aMax,$aDelta=null) { + if( $aDelta==null ) { + $this->SetMaxValue($aMax); + return; + } + $this->iDelta = $aDelta; + $this->iNumCirc = ceil($aMax/$aDelta); //$this->GetNumCirc(); + $this->iMaxVal = $this->iNumCirc * $this->iDelta ; + $this->iMax=$aMax; + // Remember that user has specified interval so don't + // do autoscaling + $this->iManualScale = true; + } + + function AutoScale($aRadius,$aMinDist=30) { + + if( $this->iManualScale ) return; + + // Make sure distance (in pixels) between two circles + // is never less than $aMinDist pixels + $tst = ceil($aRadius / $this->iNumCirc) ; + + while( $tst <= $aMinDist && $this->iDelta < 100 ) { + $this->iDelta += 5; + $tst = ceil($aRadius / $this->GetNumCirc()) ; + } + + if( $this->iDelta >= 100 ) { + JpGraphError::RaiseL(22002);//('Graph is too small to have a scale. Please make the graph larger.'); + } + + // If the distance is to large try with multiples of 2 instead + if( $tst > $aMinDist * 3 ) { + $this->iDelta = 2; + $tst = ceil($aRadius / $this->iNumCirc) ; + + while( $tst <= $aMinDist && $this->iDelta < 100 ) { + $this->iDelta += 2; + $tst = ceil($aRadius / $this->GetNumCirc()) ; + } + + if( $this->iDelta >= 100 ) { + JpGraphError::RaiseL(22002); //('Graph is too small to have a scale. Please make the graph larger.'); + } + } + + $this->iNumCirc = $this->GetNumCirc(); + $this->iMaxVal = $this->iNumCirc * $this->iDelta ; + } + + // Return max of all leg values + function GetMax() { + return $this->iMax; + } + + function Hide($aFlg=true) { + $this->iHideLabels = $aFlg; + } + + function SetAngle($aAngle) { + $this->iAngle = $aAngle ; + } + + // Translate a Leg value to radius distance + function RelTranslate($aVal,$r,$ri) { + $tv = round($aVal/$this->iMaxVal*($r-$ri)); + return $tv ; + } + + function SetLabelAlign($aAlign) { + $this->iLblAlign = $aAlign ; + } + + function SetLabelFormat($aFmt) { + $this->iLblFmt = $aFmt ; + } + + function SetLabelFillColor($aBkgColor,$aBorderColor=false) { + + $this->iFontBkgColor = $aBkgColor; + if( $aBorderColor === false ) { + $this->iFontFrameColor = $aBkgColor; + } + else { + $this->iFontFrameColor = $aBorderColor; + } + } + + function SetFontColor($aColor) { + $this->iFontColor = $aColor ; + $this->iZFontColor = $aColor ; + } + + function SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->iFontFamily = $aFontFamily ; + $this->iFontStyle = $aFontStyle ; + $this->iFontSize = $aFontSize ; + $this->SetZFont($aFontFamily,$aFontStyle,$aFontSize); + } + + function SetZFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->iZFontFamily = $aFontFamily ; + $this->iZFontStyle = $aFontStyle ; + $this->iZFontSize = $aFontSize ; + } + + function SetZeroLabel($aTxt) { + $this->iLblZeroTxt = $aTxt ; + } + + function SetZFontColor($aColor) { + $this->iZFontColor = $aColor ; + } + + function StrokeLabels($aImg,$xc,$yc,$ri,$rr) { + + if( $this->iHideLabels ) return; + + // Setup some convinient vairables + $a = $this->iAngle * M_PI/180.0; + $n = $this->iNumCirc; + $d = $this->iDelta; + + // Setup the font and font color + $val = new Text(); + $val->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize); + $val->SetColor($this->iFontColor); + + if( $this->iFontBkgColor !== false ) { + $val->SetBox($this->iFontBkgColor,$this->iFontFrameColor); + } + + // Position the labels relative to the radiant circles + if( $this->iLblAlign == LBLALIGN_TOP ) { + if( $a > 0 && $a <= M_PI/2 ) { + $val->SetAlign('left','bottom'); + } + elseif( $a > M_PI/2 && $a <= M_PI ) { + $val->SetAlign('right','bottom'); + } + } + elseif( $this->iLblAlign == LBLALIGN_CENTER ) { + $val->SetAlign('center','center'); + } + + // Stroke the labels close to each circle + $v = $d ; + $si = sin($a); + $co = cos($a); + for( $i=0; $i < $n; ++$i, $v += $d ) { + $r = $ri + ($i+1) * $rr; + $x = $xc + $co * $r; + $y = $yc - $si * $r; + $val->Set(sprintf($this->iLblFmt,$v)); + $val->Stroke($aImg,$x,$y); + } + + // Print the text in the zero circle + if( $this->iLblZeroTxt === null ) { + $this->iLblZeroTxt = sprintf($this->iLblFmt,$this->iZeroSum); + } + else { + $this->iLblZeroTxt = sprintf($this->iLblZeroTxt,$this->iZeroSum); + } + + $val->Set($this->iLblZeroTxt); + $val->SetAlign('center','center'); + $val->SetParagraphAlign('center'); + $val->SetColor($this->iZFontColor); + $val->SetFont($this->iZFontFamily,$this->iZFontStyle,$this->iZFontSize); + $val->Stroke($aImg,$xc,$yc); + } +} + +//=================================================== +// CLASS LegendStyle +//=================================================== +class LegendStyle { + public $iLength = 40, $iMargin = 20 , $iBottomMargin=5; + public $iCircleWeight=2, $iCircleRadius = 18, $iCircleColor='black'; + public $iTxtFontFamily=FF_VERDANA,$iTxtFontStyle=FS_NORMAL,$iTxtFontSize=8; + public $iLblFontFamily=FF_VERDANA,$iLblFontStyle=FS_NORMAL,$iLblFontSize=8; + public $iCircleFontFamily=FF_VERDANA,$iCircleFontStyle=FS_NORMAL,$iCircleFontSize=8; + public $iLblFontColor='black',$iTxtFontColor='black',$iCircleFontColor='black'; + public $iShow=true; + public $iFormatString='%.1f'; + public $iTxtMargin=6, $iTxt=''; + public $iZCircleTxt='Calm'; + + function SetFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->iLblFontFamily = $aFontFamily ; + $this->iLblFontStyle = $aFontStyle ; + $this->iLblFontSize = $aFontSize ; + $this->iTxtFontFamily = $aFontFamily ; + $this->iTxtFontStyle = $aFontStyle ; + $this->iTxtFontSize = $aFontSize ; + $this->iCircleFontFamily = $aFontFamily ; + $this->iCircleFontStyle = $aFontStyle ; + $this->iCircleFontSize = $aFontSize ; + } + + function SetLFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->iLblFontFamily = $aFontFamily ; + $this->iLblFontStyle = $aFontStyle ; + $this->iLblFontSize = $aFontSize ; + } + + function SetTFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->iTxtFontFamily = $aFontFamily ; + $this->iTxtFontStyle = $aFontStyle ; + $this->iTxtFontSize = $aFontSize ; + } + + function SetCFont($aFontFamily,$aFontStyle=FS_NORMAL,$aFontSize=10) { + $this->iCircleFontFamily = $aFontFamily ; + $this->iCircleFontStyle = $aFontStyle ; + $this->iCircleFontSize = $aFontSize ; + } + + + function SetFontColor($aColor) { + $this->iTxtFontColor = $aColor ; + $this->iLblFontColor = $aColor ; + $this->iCircleFontColor = $aColor ; + } + + function SetTFontColor($aColor) { + $this->iTxtFontColor = $aColor ; + } + + function SetLFontColor($aColor) { + $this->iLblFontColor = $aColor ; + } + + function SetCFontColor($aColor) { + $this->iCircleFontColor = $aColor ; + } + + function SetCircleWeight($aWeight) { + $this->iCircleWeight = $aWeight; + } + + function SetCircleRadius($aRadius) { + $this->iCircleRadius = $aRadius; + } + + function SetCircleColor($aColor) { + $this->iCircleColor = $aColor ; + } + + function SetCircleText($aTxt) { + $this->iZCircleTxt = $aTxt; + } + + function SetMargin($aMarg,$aBottomMargin=5) { + $this->iMargin=$aMarg; + $this->iBottomMargin=$aBottomMargin; + } + + function SetLength($aLength) { + $this->iLength = $aLength ; + } + + function Show($aFlg=true) { + $this->iShow = $aFlg; + } + + function Hide($aFlg=true) { + $this->iShow = ! $aFlg; + } + + function SetFormat($aFmt) { + $this->iFormatString=$aFmt; + } + + function SetText($aTxt) { + $this->iTxt = $aTxt ; + } + +} + +define('RANGE_OVERLAPPING',0); +define('RANGE_DISCRETE',1); + +//=================================================== +// CLASS WindrosePlot +//=================================================== +class WindrosePlot { + private $iAntiAlias=true; + private $iData=array(); + public $iX=0.5,$iY=0.5; + public $iSize=0.55; + private $iGridColor1='gray',$iGridColor2='darkgreen'; + private $iRadialColorArray=array(); + private $iRadialWeightArray=array(); + private $iRadialStyleArray=array(); + private $iRanges = array(1,2,3,5,6,10,13.5,99.0); + private $iRangeStyle = RANGE_OVERLAPPING ; + public $iCenterSize=60; + private $iType = WINDROSE_TYPE16; + public $iFontFamily=FF_VERDANA,$iFontStyle=FS_NORMAL,$iFontSize=10; + public $iFontColor='darkgray'; + private $iRadialGridStyle='longdashed'; + private $iAllDirectionLabels = array('E','ENE','NE','NNE','N','NNW','NW','WNW','W','WSW','SW','SSW','S','SSE','SE','ESE'); + private $iStandardDirections = array(); + private $iCircGridWeight=3, $iRadialGridWeight=1; + private $iLabelMargin=12; + private $iLegweights = array(2,4,6,8,10,12,14,16,18,20); + private $iLegColors = array('orange','black','blue','red','green','purple','navy','yellow','brown'); + private $iLabelFormatString='', $iLabels=array(); + private $iLabelPositioning = LBLPOSITION_EDGE; + private $iColor='white'; + private $iShowBox=false, $iBoxColor='black',$iBoxWeight=1,$iBoxStyle='solid'; + private $iOrdinalEncoding=KEYENCODING_ANTICLOCKWISE; + public $legend=null; + + function __construct($aData) { + $this->iData = $aData; + $this->legend = new LegendStyle(); + + // Setup the scale + $this->scale = new WindrosePlotScale($this->iData); + + // default label for free type i agle and a degree sign + $this->iLabelFormatString = '%.1f'.SymChar::Get('degree'); + + $delta = 2*M_PI/16; + for( $i=0, $a=0; $i < 16; ++$i, $a += $delta ) { + $this->iStandardDirections[$this->iAllDirectionLabels[$i]] = $a; + } + } + + // Dummy method to make window plots have the same signature as the + // layout classes since windrose plots are "leaf" classes in the hierarchy + function LayoutSize() { + return 1; + } + + function SetSize($aSize) { + $this->iSize = $aSize; + } + + function SetDataKeyEncoding($aEncoding) { + $this->iOrdinalEncoding = $aEncoding; + } + + function SetColor($aColor) { + $this->iColor = $aColor; + } + + function SetRadialColors($aColors) { + $this->iRadialColorArray = $aColors; + } + + function SetRadialWeights($aWeights) { + $this->iRadialWeightArray = $aWeights; + } + + function SetRadialStyles($aStyles) { + $this->iRadialStyleArray = $aStyles; + } + + function SetBox($aColor='black',$aWeight=1, $aStyle='solid', $aShow=true) { + $this->iShowBox = $aShow ; + $this->iBoxColor = $aColor ; + $this->iBoxWeight = $aWeight ; + $this->iBoxStyle = $aStyle; + } + + function SetLabels($aLabels) { + $this->iLabels = $aLabels ; + } + + function SetLabelMargin($aMarg) { + $this->iLabelMargin = $aMarg ; + } + + function SetLabelFormat($aLblFormat) { + $this->iLabelFormatString = $aLblFormat ; + } + + function SetCompassLabels($aLabels) { + if( count($aLabels) != 16 ) { + JpgraphError::RaiseL(22004); //('Label specification for windrose directions must have 16 values (one for each compass direction).'); + } + $this->iAllDirectionLabels = $aLabels ; + + $delta = 2*M_PI/16; + for( $i=0, $a=0; $i < 16; ++$i, $a += $delta ) { + $this->iStandardDirections[$this->iAllDirectionLabels[$i]] = $a; + } + + } + + function SetCenterSize($aSize) { + $this->iCenterSize = $aSize; + } + // Alias for SetCenterSize + function SetZCircleSize($aSize) { + $this->iCenterSize = $aSize; + } + + function SetFont($aFFam,$aFStyle=FS_NORMAL,$aFSize=10) { + $this->iFontFamily = $aFFam ; + $this->iFontStyle = $aFStyle ; + $this->iFontSize = $aFSize ; + } + + function SetFontColor($aColor) { + $this->iFontColor=$aColor; + } + + function SetGridColor($aColor1,$aColor2) { + $this->iGridColor1 = $aColor1; + $this->iGridColor2 = $aColor2; + } + + function SetGridWeight($aGrid1=1,$aGrid2=2) { + $this->iCircGridWeight = $aGrid1 ; + $this->iRadialGridWeight = $aGrid2 ; + } + + function SetRadialGridStyle($aStyle) { + $aStyle = strtolower($aStyle); + if( !in_array($aStyle,array('solid','dotted','dashed','longdashed')) ) { + JpGraphError::RaiseL(22005); //("Line style for radial lines must be on of ('solid','dotted','dashed','longdashed') "); + } + $this->iRadialGridStyle=$aStyle; + } + + function SetRanges($aRanges) { + $this->iRanges = $aRanges; + } + + function SetRangeStyle($aStyle) { + $this->iRangeStyle = $aStyle; + } + + function SetRangeColors($aLegColors) { + $this->iLegColors = $aLegColors; + } + + function SetRangeWeights($aWeights) { + $n=count($aWeights); + for($i=0; $i< $n; ++$i ) { + $aWeights[$i] = floor($aWeights[$i]/2); + } + $this->iLegweights = $aWeights; + + } + + function SetType($aType) { + if( $aType < WINDROSE_TYPE4 || $aType > WINDROSE_TYPEFREE ) { + JpGraphError::RaiseL(22006); //('Illegal windrose type specified.'); + } + $this->iType = $aType; + } + + // Alias for SetPos() + function SetCenterPos($aX,$aY) { + $this->iX = $aX; + $this->iY = $aY; + } + + function SetPos($aX,$aY) { + $this->iX = $aX; + $this->iY = $aY; + } + + function SetAntiAlias($aFlag) { + $this->iAntiAlias = $aFlag ; + if( ! $aFlag ) + $this->iCircGridWeight = 1; + } + + function _ThickCircle($aImg,$aXC,$aYC,$aRad,$aWeight=2,$aColor) { + + $aImg->SetColor($aColor); + $aRad *= 2 ; + $aImg->Ellipse($aXC,$aYC,$aRad,$aRad); + if( $aWeight > 1 ) { + $aImg->Ellipse($aXC,$aYC,$aRad+1,$aRad+1); + $aImg->Ellipse($aXC,$aYC,$aRad+2,$aRad+2); + if( $aWeight > 2 ) { + $aImg->Ellipse($aXC,$aYC,$aRad+3,$aRad+3); + $aImg->Ellipse($aXC,$aYC,$aRad+3,$aRad+4); + $aImg->Ellipse($aXC,$aYC,$aRad+4,$aRad+3); + } + } + } + + function _StrokeWindLeg($aImg,$xc,$yc,$a,$ri,$r,$weight,$color) { + + // If less than 1 px long then we assume this has been caused by rounding problems + // and should not be stroked + if( $r < 1 ) return; + + $xt = $xc + cos($a)*$ri; + $yt = $yc - sin($a)*$ri; + $xxt = $xc + cos($a)*($ri+$r); + $yyt = $yc - sin($a)*($ri+$r); + + $x1 = $xt - $weight*sin($a); + $y1 = $yt - $weight*cos($a); + $x2 = $xxt - $weight*sin($a); + $y2 = $yyt - $weight*cos($a); + + $x3 = $xxt + $weight*sin($a); + $y3 = $yyt + $weight*cos($a); + $x4 = $xt + $weight*sin($a); + $y4 = $yt + $weight*cos($a); + + $pts = array($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4); + $aImg->SetColor($color); + $aImg->FilledPolygon($pts); + + } + + function _StrokeLegend($aImg,$x,$y,$scaling=1,$aReturnWidth=false) { + + if( ! $this->legend->iShow ) return 0; + + $nlc = count($this->iLegColors); + $nlw = count($this->iLegweights); + + // Setup font for ranges + $value = new Text(); + $value->SetAlign('center','bottom'); + $value->SetFont($this->legend->iLblFontFamily, + $this->legend->iLblFontStyle, + $this->legend->iLblFontSize*$scaling); + $value->SetColor($this->legend->iLblFontColor); + + // Remember x-center + $xcenter = $x ; + + // Construct format string + $fmt = $this->legend->iFormatString.'-'.$this->legend->iFormatString; + + // Make sure that the length of each range is enough to cover the + // size of the labels + $tst = sprintf($fmt,$this->iRanges[0],$this->iRanges[1]); + $value->Set($tst); + $w = $value->GetWidth($aImg); + $l = round(max($this->legend->iLength * $scaling,$w*1.5)); + + $r = $this->legend->iCircleRadius * $scaling ; + $len = 2*$r + $this->scale->iMaxNum * $l; + + // We are called just to find out the width + if( $aReturnWidth ) return $len; + + $x -= round($len/2); + $x += $r; + + // 4 pixels extra vertical margin since the circle sometimes is +/- 1 pixel of the + // theorethical radius due to imperfection in the GD library + //$y -= round(max($r,$scaling*$this->iLegweights[($this->scale->iMaxNum-1) % $nlw])+4*$scaling); + $y -= ($this->legend->iCircleRadius + 2)*$scaling+$this->legend->iBottomMargin*$scaling; + + // Adjust for bottom text + if( $this->legend->iTxt != '' ) { + // Setup font for text + $value->Set($this->legend->iTxt); + $y -= /*$this->legend->iTxtMargin + */ $value->GetHeight($aImg); + } + + // Stroke 0-circle + $this->_ThickCircle($aImg,$x,$y,$r,$this->legend->iCircleWeight, + $this->legend->iCircleColor); + + // Remember the center of the circe + $xc=$x; $yc=$y; + + $value->SetAlign('center','bottom'); + $x += $r+1; + + // Stroke all used ranges + $txty = $y - + round($this->iLegweights[($this->scale->iMaxNum-1)%$nlw]*$scaling) - 4*$scaling; + if( $this->scale->iMaxNum >= count($this->iRanges) ) { + JpGraphError::RaiseL(22007); //('To few values for the range legend.'); + } + $i=0;$idx=0; + while( $i < $this->scale->iMaxNum ) { + $y1 = $y - round($this->iLegweights[$i % $nlw]*$scaling); + $y2 = $y + round($this->iLegweights[$i % $nlw]*$scaling); + $x2 = $x + $l ; + $aImg->SetColor($this->iLegColors[$i % $nlc]); + $aImg->FilledRectangle($x,$y1,$x2,$y2); + if( $this->iRangeStyle == RANGE_OVERLAPPING ) { + $lbl = sprintf($fmt,$this->iRanges[$idx],$this->iRanges[$idx+1]); + } + else { + $lbl = sprintf($fmt,$this->iRanges[$idx],$this->iRanges[$idx+1]); + ++$idx; + } + $value->Set($lbl); + $value->Stroke($aImg,$x+$l/2,$txty); + $x = $x2; + ++$i;++$idx; + } + + // Setup circle font + $value->SetFont($this->legend->iCircleFontFamily, + $this->legend->iCircleFontStyle, + $this->legend->iCircleFontSize*$scaling); + $value->SetColor($this->legend->iCircleFontColor); + + // Stroke 0-circle text + $value->Set($this->legend->iZCircleTxt); + $value->SetAlign('center','center'); + $value->ParagraphAlign('center'); + $value->Stroke($aImg,$xc,$yc); + + // Setup circle font + $value->SetFont($this->legend->iTxtFontFamily, + $this->legend->iTxtFontStyle, + $this->legend->iTxtFontSize*$scaling); + $value->SetColor($this->legend->iTxtFontColor); + + // Draw the text under the legend + $value->Set($this->legend->iTxt); + $value->SetAlign('center','top'); + $value->SetParagraphAlign('center'); + $value->Stroke($aImg,$xcenter,$y2+$this->legend->iTxtMargin*$scaling); + } + + function SetAutoScaleAngle($aIsRegRose=true) { + + // If the user already has manually set an angle don't + // trye to find a position + if( is_numeric($this->scale->iAngle) ) + return; + + if( $aIsRegRose ) { + + // Create a complete data for all directions + // and translate string directions to ordinal values. + // This will much simplify the logic below + for( $i=0; $i < 16; ++$i ) { + $dtxt = $this->iAllDirectionLabels[$i]; + if( !empty($this->iData[$dtxt]) ) { + $data[$i] = $this->iData[$dtxt]; + } + elseif( !empty($this->iData[strtolower($dtxt)]) ) { + $data[$i] = $this->iData[strtolower($dtxt)]; + } + elseif( !empty($this->iData[$i]) ) { + $data[$i] = $this->iData[$i]; + } + else { + $data[$i] = array(); + } + } + + // Find the leg which has the lowest weighted sum of number of data around it + $c0 = array_sum($data[0]); + $c1 = array_sum($data[1]); + $found = 1; + $min = $c0+$c1*100; // Initialize to a high value + for( $i=1; $i < 15; ++$i ) { + $c2 = array_sum($data[$i+1]); + + // Weight the leg we will use more to give preference + // to a short middle leg even if the 3 way sum is similair + $w = $c0 + 3*$c1 + $c2 ; + if( $w < $min ) { + $min = $w; + $found = $i; + } + $c0 = $c1; + $c1 = $c2; + } + $this->scale->iAngle = $found*22.5; + } + else { + $n = count($this->iData); + foreach( $this->iData as $dir => $leg ) { + if( !is_numeric($dir) ) { + $pos = array_search(strtoupper($dir),$this->iAllDirectionLabels); + if( $pos !== false ) { + $dir = $pos*22.5; + } + } + $data[round($dir)] = $leg; + } + + // Get all the angles for the data and sort it + $keys = array_keys($data); + sort($keys, SORT_NUMERIC); + + $n = count($data); + $found = false; + $max = 0 ; + for( $i=0; $i < 15; ++$i ) { + $try_a = round(22.5*$i); + + if( $try_a > $keys[$n-1] ) break; + + if( in_array($try_a,$keys) ) continue; + + // Find the angle just lower than this + $j=0; + while( $j < $n && $keys[$j] <= $try_a ) ++$j; + if( $j == 0 ) { + $kj = 0; $keys[$n-1]; + $d1 = 0; abs($kj-$try_a); + } + else { + --$j; + $kj = $keys[$j]; + $d1 = abs($kj-$try_a); + } + + // Find the angle just larger than this + $l=$n-1; + while( $l >= 0 && $keys[$l] >= $try_a ) --$l; + if( $l == $n-1) { + $kl = $keys[0]; + $d2 = abs($kl-$try_a); + } + else { + ++$l; + $kl = $keys[$l]; + $d2 = abs($kl-$try_a); + } + + // Weight the distance so that legs with large spread + // gets a better weight + $w = $d1 + $d2; + if( $i == 0 ) { + $w = round(1.4 * $w); + } + $diff = abs($d1 - $d2); + $w *= (360-$diff); + if( $w > $max ) { + $found = $i; + $max = $w; + } + } + + $a = $found*22.5; + + // Some heuristics to have some preferred positions + if( $keys[$n-1] < 25 ) $a = 45; + elseif( $keys[0] > 60 ) $a = 45; + elseif( $keys[0] > 25 && $keys[$n-1] < 340 ) $a = 0; + elseif( $keys[$n-1] < 75 ) $a = 90; + elseif( $keys[$n-1] < 120 ) $a = 135; + elseif( $keys[$n-1] < 160 ) $a = 180; + + $this->scale->iAngle = $a ; + } + } + + function NormAngle($a) { + while( $a > 360 ) { + $a -= 360; + } + return $a; + } + + function SetLabelPosition($aPos) { + $this->iLabelPositioning = $aPos ; + } + + function _StrokeFreeRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri) { + + // Plot radial grid lines and remember the end position + // and the angle for later use when plotting the labels + if( $this->iType != WINDROSE_TYPEFREE ) { + JpGraphError::RaiseL(22008); //('Internal error: Trying to plot free Windrose even though type is not a free windorose'); + } + + // Check if we should auto-position the angle for the + // labels. Basically we try to find a firection with smallest + // (or none) data. + $this->SetAutoScaleAngle(false); + + $nlc = count($this->iLegColors); + $nlw = count($this->iLegweights); + + // Stroke grid lines for directions and remember the + // position for the labels + $txtpos=array(); + $num = count($this->iData); + + $keys = array_keys($this->iData); + + foreach( $this->iData as $dir => $legdata ) { + if( in_array($dir,$this->iAllDirectionLabels,true) === true) { + $a = $this->iStandardDirections[strtoupper($dir)]; + if( in_array($a*180/M_PI,$keys) ) { + JpGraphError::RaiseL(22009,round($a*180/M_PI)); + //('You have specified the same direction twice, once with an angle and once with a compass direction ('.$a*180/M_PI.' degrees.)'); + } + } + elseif( is_numeric($dir) ) { + $this->NormAngle($dir); + + if( $this->iOrdinalEncoding == KEYENCODING_CLOCKWISE ) { + $dir = 360-$dir; + } + + $a = $dir * M_PI/180; + } + else { + JpGraphError::RaiseL(22010);//('Direction must either be a numeric value or one of the 16 compass directions'); + } + + $xxc = round($xc + cos($a)*$ri); + $yyc = round($yc - sin($a)*$ri); + $x = round($xc + cos($a)*$r); + $y = round($yc - sin($a)*$r); + if( empty($this->iRadialColorArray[$dir]) ) { + $dblImg->SetColor($this->iGridColor2); + } + else { + $dblImg->SetColor($this->iRadialColorArray[$dir]); + } + if( empty($this->iRadialWeightArray[$dir]) ) { + $dblImg->SetLineWeight($this->iRadialGridWeight); + } + else { + $dblImg->SetLineWeight($this->iRadialWeightArray[$dir]); + } + if( empty($this->iRadialStyleArray[$dir]) ) { + $dblImg->SetLineStyle($this->iRadialGridStyle); + } + else { + $dblImg->SetLineStyle($this->iRadialStyleArray[$dir]); + } + $dblImg->StyleLine($xxc,$yyc,$x,$y); + $txtpos[] = array($x,$y,$a); + } + $dblImg->SetLineWeight(1); + + // Setup labels + $lr = $scaling * $this->iLabelMargin; + + if( $this->iLabelPositioning == LBLPOSITION_EDGE ) { + $value->SetAlign('left','top'); + } + else { + $value->SetAlign('center','center'); + $value->SetMargin(0); + } + + for($i=0; $i < $num; ++$i ) { + + list($x,$y,$a) = $txtpos[$i]; + + // Determine the label + + $da = $a*180/M_PI; + if( $this->iOrdinalEncoding == KEYENCODING_CLOCKWISE ) { + $da = 360 - $da; + } + + //$da = 360-$da; + + if( !empty($this->iLabels[$keys[$i]]) ) { + $lbl = $this->iLabels[$keys[$i]]; + } + else { + $lbl = sprintf($this->iLabelFormatString,$da); + } + + if( $this->iLabelPositioning == LBLPOSITION_CENTER ) { + $dx = $dy = 0; + } + else { + // LBLPOSIITON_EDGE + if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); + + if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; + if( $a<=M_PI/4 ) $dy=(0.5+$a*2/M_PI); + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; + } + + $value->Set($lbl); + $th = $value->GetHeight($dblImg); + $tw = $value->GetWidth($dblImg); + $xt=round($lr*cos($a)+$x) - $dx*$tw; + $yt=round($y-$lr*sin($a)) - $dy*$th; + + $value->Stroke($dblImg,$xt,$yt); + } + + if( __DEBUG ) { + $dblImg->SetColor('red'); + $dblImg->Circle($xc,$yc,$lr+$r); + } + + // Stroke all the legs + reset($this->iData); + $i=0; + foreach($this->iData as $dir => $legdata) { + $legdata = array_slice($legdata,1); + $nn = count($legdata); + + $a = $txtpos[$i][2]; + $rri = $ri/$scaling; + for( $j=0; $j < $nn; ++$j ) { + // We want the non scaled original radius + $legr = $this->scale->RelTranslate($legdata[$j],$r/$scaling,$ri/$scaling) ; + $this->_StrokeWindLeg($dblImg, $xc, $yc, $a, + $rri *$scaling, + $legr *$scaling, + $this->iLegweights[$j % $nlw] * $scaling, + $this->iLegColors[$j % $nlc]); + $rri += $legr; + } + ++$i; + } + } + + // Translate potential string specified compass labels to their + // corresponding index. + function FixupIndexes($aDataArray,$num) { + $ret = array(); + $keys = array_keys($aDataArray); + foreach($aDataArray as $idx => $data) { + if( is_string($idx) ) { + $idx = strtoupper($idx); + $res = array_search($idx,$this->iAllDirectionLabels); + if( $res === false ) { + JpGraphError::RaiseL(22011,$idx); //('Windrose index must be numeric or direction label. You have specified index='.$idx); + } + $idx = $res; + if( $idx % (16 / $num) !== 0 ) { + JpGraphError::RaiseL(22012); //('Windrose radial axis specification contains a direction which is not enabled.'); + } + $idx /= (16/$num) ; + + if( in_array($idx,$keys,1) ) { + JpgraphError::RaiseL(22013,$idx); //('You have specified the look&feel for the same compass direction twice, once with text and once with index (Index='.$idx.')'); + } + } + if( $idx < 0 || $idx > 15 ) { + JpgraphError::RaiseL(22014); //('Index for copmass direction must be between 0 and 15.'); + } + $ret[$idx] = $data; + } + return $ret; + } + + function _StrokeRegularRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri) { + // _StrokeRegularRose($dblImg,$xc,$yc,$r,$ri) + // Plot radial grid lines and remember the end position + // and the angle for later use when plotting the labels + switch( $this->iType ) { + case WINDROSE_TYPE4: + $num = 4; break; + case WINDROSE_TYPE8: + $num = 8; break; + case WINDROSE_TYPE16: + $num = 16; break; + default: + JpGraphError::RaiseL(22015);//('You have specified an undefined Windrose plot type.'); + } + + // Check if we should auto-position the angle for the + // labels. Basically we try to find a firection with smallest + // (or none) data. + $this->SetAutoScaleAngle(true); + + $nlc = count($this->iLegColors); + $nlw = count($this->iLegweights); + + $this->iRadialColorArray = $this->FixupIndexes($this->iRadialColorArray,$num); + $this->iRadialWeightArray = $this->FixupIndexes($this->iRadialWeightArray,$num); + $this->iRadialStyleArray = $this->FixupIndexes($this->iRadialStyleArray,$num); + + $txtpos=array(); + $a = 2*M_PI/$num; + $dblImg->SetColor($this->iGridColor2); + $dblImg->SetLineStyle($this->iRadialGridStyle); + $dblImg->SetLineWeight($this->iRadialGridWeight); + + // Translate any name specified directions to the index + // so we can easily use it in the loop below + for($i=0; $i < $num; ++$i ) { + $xxc = round($xc + cos($a*$i)*$ri); + $yyc = round($yc - sin($a*$i)*$ri); + $x = round($xc + cos($a*$i)*$r); + $y = round($yc - sin($a*$i)*$r); + if( empty($this->iRadialColorArray[$i]) ) { + $dblImg->SetColor($this->iGridColor2); + } + else { + $dblImg->SetColor($this->iRadialColorArray[$i]); + } + if( empty($this->iRadialWeightArray[$i]) ) { + $dblImg->SetLineWeight($this->iRadialGridWeight); + } + else { + $dblImg->SetLineWeight($this->iRadialWeightArray[$i]); + } + if( empty($this->iRadialStyleArray[$i]) ) { + $dblImg->SetLineStyle($this->iRadialGridStyle); + } + else { + $dblImg->SetLineStyle($this->iRadialStyleArray[$i]); + } + + $dblImg->StyleLine($xxc,$yyc,$x,$y); + $txtpos[] = array($x,$y,$a*$i); + } + $dblImg->SetLineWeight(1); + + $lr = $scaling * $this->iLabelMargin; + if( $this->iLabelPositioning == LBLPOSITION_CENTER ) { + $value->SetAlign('center','center'); + } + else { + $value->SetAlign('left','top'); + $value->SetMargin(0); + $lr /= 2 ; + } + + for($i=0; $i < $num; ++$i ) { + list($x,$y,$a) = $txtpos[$i]; + + // Set the position of the label + if( $this->iLabelPositioning == LBLPOSITION_CENTER ) { + $dx = $dy = 0; + } + else { + // LBLPOSIITON_EDGE + if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); + + if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; + if( $a<=M_PI/4 ) $dy=(0.5+$a*2/M_PI); + if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; + if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); + if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; + } + + $value->Set($this->iAllDirectionLabels[$i*(16/$num)]); + $th = $value->GetHeight($dblImg); + $tw = $value->GetWidth($dblImg); + $xt=round($lr*cos($a)+$x) - $dx*$tw; + $yt=round($y-$lr*sin($a)) - $dy*$th; + + $value->Stroke($dblImg,$xt,$yt); + } + + if( __DEBUG ) { + $dblImg->SetColor("red"); + $dblImg->Circle($xc,$yc,$lr+$r); + } + + // Stroke all the legs + reset($this->iData); + $keys = array_keys($this->iData); + foreach($this->iData as $idx => $legdata) { + $legdata = array_slice($legdata,1); + $nn = count($legdata); + if( is_string($idx) ) { + $idx = strtoupper($idx); + $idx = array_search($idx,$this->iAllDirectionLabels); + if( $idx === false ) { + JpGraphError::RaiseL(22016);//('Windrose leg index must be numeric or direction label.'); + } + if( $idx % (16 / $num) !== 0 ) { + JpGraphError::RaiseL(22017);//('Windrose data contains a direction which is not enabled. Please adjust what labels are displayed.'); + } + $idx /= (16/$num) ; + + if( in_array($idx,$keys,1) ) { + JpgraphError::RaiseL(22018,$idx);//('You have specified data for the same compass direction twice, once with text and once with index (Index='.$idx.')'); + + } + } + if( $idx < 0 || $idx > 15 ) { + JpgraphError::RaiseL(22019);//('Index for direction must be between 0 and 15. You can\'t specify angles for a Regular Windplot, only index and compass directions.'); + } + $a = $idx * (360 / $num) ; + $a *= M_PI/180.0; + $rri = $ri/$scaling; + for( $j=0; $j < $nn; ++$j ) { + // We want the non scaled original radius + $legr = $this->scale->RelTranslate($legdata[$j], $r/$scaling,$ri/$scaling) ; + $this->_StrokeWindLeg($dblImg, $xc, $yc, $a, + $rri *$scaling, + $legr *$scaling, + $this->iLegweights[$j % $nlw] * $scaling, + $this->iLegColors[$j % $nlc]); + $rri += $legr; + } + } + } + + + function getWidth($aImg) { + + $scaling = 1;//$this->iAntiAlias ? 2 : 1 ; + if( $this->iSize > 0 && $this->iSize < 1 ) { + $this->iSize *= min($aImg->width,$aImg->height); + } + + + $value = new Text(); + $value->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize*$scaling); + $value->SetColor($this->iFontColor); + // Setup extra size around the graph needed so that the labels + // doesn't get cut. For this we need to find the largest label. + // The code below gives a possible a little to large margin. The + // really, really proper way would be to account for what angle + // the label are at + $n = count($this->iLabels); + if( $n > 0 ) { + $maxh=0;$maxw=0; + foreach($this->iLabels as $key => $lbl) { + $value->Set($lbl); + $maxw = max($maxw,$value->GetWidth($aImg)); + } + } + else { + $value->Set('888.888'); // Dummy value to get width/height + $maxw = $value->GetWidth($aImg); + } + // Add an extra margin of 50% the font size + $maxw += round($this->iFontSize*$scaling * 0.4) ; + + $valxmarg = 1.5*$maxw+2*$this->iLabelMargin*$scaling; + $w = round($this->iSize*$scaling + $valxmarg); + + // Make sure that the width of the legend fits + $legendwidth = $this->_StrokeLegend($aImg,0,0,$scaling,true)+10*$scaling; + $w = max($w,$legendwidth); + + return $w; + } + + function getHeight($aImg) { + + $scaling = 1;//$this->iAntiAlias ? 2 : 1 ; + if( $this->iSize > 0 && $this->iSize < 1 ) { + $this->iSize *= min($aImg->width,$aImg->height); + } + + $value = new Text(); + $value->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize*$scaling); + $value->SetColor($this->iFontColor); + // Setup extra size around the graph needed so that the labels + // doesn't get cut. For this we need to find the largest label. + // The code below gives a possible a little to large margin. The + // really, really proper way would be to account for what angle + // the label are at + $n = count($this->iLabels); + if( $n > 0 ) { + $maxh=0;$maxw=0; + foreach($this->iLabels as $key => $lbl) { + $value->Set($lbl); + $maxh = max($maxh,$value->GetHeight($aImg)); + } + } + else { + $value->Set('180.8'); // Dummy value to get width/height + $maxh = $value->GetHeight($aImg); + } + // Add an extra margin of 50% the font size + //$maxh += round($this->iFontSize*$scaling * 0.5) ; + $valymarg = 2*$maxh+2*$this->iLabelMargin*$scaling; + + $legendheight = round($this->legend->iShow ? 1 : 0); + $legendheight *= max($this->legend->iCircleRadius*2,$this->legend->iTxtFontSize*2)+ + $this->legend->iMargin + $this->legend->iBottomMargin + 2; + $legendheight *= $scaling; + $h = round($this->iSize*$scaling + $valymarg) + $legendheight ; + + return $h; + } + + function Stroke($aGraph) { + + $aImg = $aGraph->img; + + if( $this->iX > 0 && $this->iX < 1 ) { + $this->iX = round( $aImg->width * $this->iX ) ; + } + + if( $this->iY > 0 && $this->iY < 1 ) { + $this->iY = round( $aImg->height * $this->iY ) ; + } + + if( $this->iSize > 0 && $this->iSize < 1 ) { + $this->iSize *= min($aImg->width,$aImg->height); + } + + if( $this->iCenterSize > 0 && $this->iCenterSize < 1 ) { + $this->iCenterSize *= $this->iSize; + } + + $this->scale->AutoScale(($this->iSize - $this->iCenterSize)/2, round(2.5*$this->scale->iFontSize)); + + $scaling = $this->iAntiAlias ? 2 : 1 ; + + $value = new Text(); + $value->SetFont($this->iFontFamily,$this->iFontStyle,$this->iFontSize*$scaling); + $value->SetColor($this->iFontColor); + + $legendheight = round($this->legend->iShow ? 1 : 0); + $legendheight *= max($this->legend->iCircleRadius*2,$this->legend->iTxtFontSize*2)+ + $this->legend->iMargin + $this->legend->iBottomMargin + 2; + $legendheight *= $scaling; + + $w = $scaling*$this->getWidth($aImg); + $h = $scaling*$this->getHeight($aImg); + + // Copy back the double buffered image to the proper canvas + $ww = $w / $scaling ; + $hh = $h / $scaling ; + + // Create the double buffer + if( $this->iAntiAlias ) { + $dblImg = new RotImage($w,$h); + // Set the background color + $dblImg->SetColor($this->iColor); + $dblImg->FilledRectangle(0,0,$w,$h); + } + else { + $dblImg = $aImg ; + // Make sure the ix and it coordinates correpond to the new top left center + $dblImg->SetTranslation($this->iX-$w/2, $this->iY-$h/2); + } + + if( __DEBUG ) { + $dblImg->SetColor('red'); + $dblImg->Rectangle(0,0,$w-1,$h-1); + } + + $dblImg->SetColor('black'); + + if( $this->iShowBox ) { + $dblImg->SetColor($this->iBoxColor); + $old = $dblImg->SetLineWeight($this->iBoxWeight); + $dblImg->SetLineStyle($this->iBoxStyle); + $dblImg->Rectangle(0,0,$w-1,$h-1); + $dblImg->SetLineWeight($old); + } + + $xc = round($w/2); + $yc = round(($h-$legendheight)/2); + + if( __DEBUG ) { + $dblImg->SetColor('red'); + $old = $dblImg->SetLineWeight(2); + $dblImg->Line($xc-5,$yc-5,$xc+5,$yc+5); + $dblImg->Line($xc+5,$yc-5,$xc-5,$yc+5); + $dblImg->SetLineWeight($old); + } + + $this->iSize *= $scaling; + + // Inner circle size + $ri = $this->iCenterSize/2 ; + + // Full circle radius + $r = round( $this->iSize/2 ); + + // Get number of grid circles + $n = $this->scale->GetNumCirc(); + + // Plot circle grids + $ri *= $scaling ; + $rr = round(($r-$ri)/$n); + for( $i = 1; $i <= $n; ++$i ) { + $this->_ThickCircle($dblImg,$xc,$yc,$rr*$i+$ri, + $this->iCircGridWeight,$this->iGridColor1); + } + + $num = 0 ; + + if( $this->iType == WINDROSE_TYPEFREE ) { + $this->_StrokeFreeRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri); + } + else { + // Check if we need to re-code the interpretation of the ordinal + // number in the data. Internally ordinal value 0 is East and then + // counted anti-clockwise. The user might choose an encoding + // that have 0 being the first axis to the right of the "N" axis and then + // counted clock-wise + if( $this->iOrdinalEncoding == KEYENCODING_CLOCKWISE ) { + if( $this->iType == WINDROSE_TYPE16 ) { + $const1 = 19; $const2 = 16; + } + elseif( $this->iType == WINDROSE_TYPE8 ) { + $const1 = 9; $const2 = 8; + } + else { + $const1 = 4; $const2 = 4; + } + $tmp = array(); + $n=count($this->iData); + foreach( $this->iData as $key => $val ) { + if( is_numeric($key) ) { + $key = ($const1 - $key) % $const2 ; + } + $tmp[$key] = $val; + } + $this->iData = $tmp; + } + $this->_StrokeRegularRose($dblImg,$value,$scaling,$xc,$yc,$r,$ri); + } + + // Stroke the labels + $this->scale->iFontSize *= $scaling; + $this->scale->iZFontSize *= $scaling; + $this->scale->StrokeLabels($dblImg,$xc,$yc,$ri,$rr); + + // Stroke the inner circle again since the legs + // might have written over it + $this->_ThickCircle($dblImg,$xc,$yc,$ri,$this->iCircGridWeight,$this->iGridColor1); + + if( $ww > $aImg->width ) { + JpgraphError::RaiseL(22020); + //('Windrose plot is too large to fit the specified Graph size. Please use WindrosePlot::SetSize() to make the plot smaller or increase the size of the Graph in the initial WindroseGraph() call.'); + } + + $x = $xc; + $y = $h; + $this->_StrokeLegend($dblImg,$x,$y,$scaling); + + if( $this->iAntiAlias ) { + $aImg->Copy($dblImg->img, $this->iX-$ww/2, $this->iY-$hh/2, 0, 0, $ww,$hh, $w,$h); + } + + // We need to restore the translation matrix + $aImg->SetTranslation(0,0); + + } + +} + +//============================================================ +// CLASS WindroseGraph +//============================================================ +class WindroseGraph extends Graph { + private $posx, $posy; + public $plots=array(); + + function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { + parent::__construct($width,$height,$cachedName,$timeout,$inline); + $this->posx=$width/2; + $this->posy=$height/2; + $this->SetColor('white'); + $this->title->SetFont(FF_VERDANA,FS_NORMAL,12); + $this->title->SetMargin(8); + $this->subtitle->SetFont(FF_VERDANA,FS_NORMAL,10); + $this->subtitle->SetMargin(0); + $this->subsubtitle->SetFont(FF_VERDANA,FS_NORMAL,8); + $this->subsubtitle->SetMargin(0); + } + + function StrokeTexts() { + if( $this->texts != null ) { + $n = count($this->texts); + for($i=0; $i < $n; ++$i ) { + $this->texts[$i]->Stroke($this->img); + } + } + } + + function StrokeIcons() { + if( $this->iIcons != null ) { + $n = count($this->iIcons); + for( $i=0; $i < $n; ++$i ) { + // Since Windrose graphs doesn't have any linear scale the position of + // each icon has to be given as absolute coordinates + $this->iIcons[$i]->_Stroke($this->img); + } + } + } + + //--------------- + // PUBLIC METHODS + function Add($aObj) { + if( is_array($aObj) && count($aObj) > 0 ) { + $cl = $aObj[0]; + } + else { + $cl = $aObj; + } + if( $cl instanceof Text ) { + $this->AddText($aObj); + } + elseif( $cl instanceof IconPlot ) { + $this->AddIcon($aObj); + } + elseif( ($cl instanceof WindrosePlot) || ($cl instanceof LayoutRect) || ($cl instanceof LayoutHor)) { + $this->plots[] = $aObj; + } + else { + JpgraphError::RaiseL(22021); + } + } + + function AddText($aTxt,$aToY2=false) { + parent::AddText($aTxt); + } + + function SetColor($c) { + $this->SetMarginColor($c); + } + + // Method description + function Stroke($aStrokeFileName="") { + + // If the filename is the predefined value = '_csim_special_' + // we assume that the call to stroke only needs to do enough + // to correctly generate the CSIM maps. + // We use this variable to skip things we don't strictly need + // to do to generate the image map to improve performance + // as best we can. Therefore you will see a lot of tests !$_csim in the + // code below. + $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); + + // We need to know if we have stroked the plot in the + // GetCSIMareas. Otherwise the CSIM hasn't been generated + // and in the case of GetCSIM called before stroke to generate + // CSIM without storing an image to disk GetCSIM must call Stroke. + $this->iHasStroked = true; + + if( $this->background_image != "" || $this->background_cflag != "" ) { + $this->StrokeFrameBackground(); + } + else { + $this->StrokeFrame(); + } + + // n holds number of plots + $n = count($this->plots); + for($i=0; $i < $n ; ++$i) { + $this->plots[$i]->Stroke($this); + } + + $this->footer->Stroke($this->img); + $this->StrokeIcons(); + $this->StrokeTexts(); + $this->StrokeTitles(); + + // If the filename is given as the special "__handle" + // then the image handler is returned and the image is NOT + // streamed back + if( $aStrokeFileName == _IMG_HANDLER ) { + return $this->img->img; + } + else { + // Finally stream the generated picture + $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, + $aStrokeFileName); + } + } + +} // Class + +?> diff --git a/includes/jpgraph/src/lang/de.inc.php b/includes/jpgraph/src/lang/de.inc.php new file mode 100644 index 0000000..37ba264 --- /dev/null +++ b/includes/jpgraph/src/lang/de.inc.php @@ -0,0 +1,552 @@ +,) +$_jpg_messages = array( + +/* +** Headers wurden bereits gesendet - Fehler. Dies wird als HTML formatiert, weil es direkt als text zurueckgesendet wird +*/ +10 => array('
JpGraph Fehler: +HTTP header wurden bereits gesendet.
Fehler in der Datei %s in der Zeile %d.
Erklärung:
HTTP header wurden bereits zum Browser gesendet, wobei die Daten als Text gekennzeichnet wurden, bevor die Bibliothek die Chance hatte, seinen Bild-HTTP-Header zum Browser zu schicken. Dies verhindert, dass die Bibliothek Bilddaten zum Browser schicken kann (weil sie vom Browser als Text interpretiert würden und daher nur Mist dargestellt würde).

Wahrscheinlich steht Text im Skript bevor Graph::Stroke() aufgerufen wird. Wenn dieser Text zum Browser gesendet wird, nimmt dieser an, dass die gesamten Daten aus Text bestehen. Such nach irgendwelchem Text, auch nach Leerzeichen und Zeilenumbrüchen, die eventuell bereits zum Browser gesendet wurden.

Zum Beispiel ist ein oft auftretender Fehler, eine Leerzeile am Anfang der Datei oder vor Graph::Stroke() zu lassen."<?php".

',2), + +/* +** Setup Fehler +*/ +11 => array('Es wurde kein Pfad für CACHE_DIR angegeben. Bitte gib einen Pfad CACHE_DIR in der Datei jpg-config.inc an.',0), +12 => array('Es wurde kein Pfad für TTF_DIR angegeben und der Pfad kann nicht automatisch ermittelt werden. Bitte gib den Pfad in der Datei jpg-config.inc an.',0), +13 => array('The installed PHP version (%s) is not compatible with this release of the library. The library requires at least PHP version %s',2), + +/* +** jpgraph_bar +*/ + +2001 => array('Die Anzahl der Farben ist nicht gleich der Anzahl der Vorlagen in BarPlot::SetPattern().',0), +2002 => array('Unbekannte Vorlage im Aufruf von BarPlot::SetPattern().',0), +2003 => array('Anzahl der X- und Y-Koordinaten sind nicht identisch. Anzahl der X-Koordinaten: %d; Anzahl der Y-Koordinaten: %d.',2), +2004 => array('Alle Werte für ein Balkendiagramm (barplot) müssen numerisch sein. Du hast den Wert nr [%d] == %s angegeben.',2), +2005 => array('Du hast einen leeren Vektor für die Schattierungsfarben im Balkendiagramm (barplot) angegeben.',0), +2006 => array('Unbekannte Position für die Werte der Balken: %s.',1), +2007 => array('Kann GroupBarPlot nicht aus einem leeren Vektor erzeugen.',0), +2008 => array('GroupBarPlot Element nbr %d wurde nicht definiert oder ist leer.',0), +2009 => array('Eins der Objekte, das an GroupBar weitergegeben wurde ist kein Balkendiagramm (BarPlot). Versichere Dich, dass Du den GroupBarPlot aus einem Vektor von Balkendiagrammen (barplot) oder AccBarPlot-Objekten erzeugst. (Class = %s)',1), +2010 => array('Kann AccBarPlot nicht aus einem leeren Vektor erzeugen.',0), +2011 => array('AccBarPlot-Element nbr %d wurde nicht definiert oder ist leer.',1), +2012 => array('Eins der Objekte, das an AccBar weitergegeben wurde ist kein Balkendiagramm (barplot). Versichere Dich, dass Du den AccBar-Plot aus einem Vektor von Balkendiagrammen (barplot) erzeugst. (Class=%s)',1), +2013 => array('Du hast einen leeren Vektor für die Schattierungsfarben im Balkendiagramm (barplot) angegeben.',0), +2014 => array('Die Anzahl der Datenpunkte jeder Datenreihe in AccBarPlot muss gleich sein.',0), +2015 => array('Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates',0), + + +/* +** jpgraph_date +*/ + +3001 => array('Es ist nur möglich, entweder SetDateAlign() oder SetTimeAlign() zu benutzen, nicht beides!',0), + +/* +** jpgraph_error +*/ + +4002 => array('Fehler bei den Eingabedaten von LineErrorPlot. Die Anzahl der Datenpunkte mus ein Mehrfaches von drei sein!',0), + +/* +** jpgraph_flags +*/ + +5001 => array('Unbekannte Flaggen-Größe (%d).',1), +5002 => array('Der Flaggen-Index %s existiert nicht.',1), +5003 => array('Es wurde eine ungültige Ordnungszahl (%d) für den Flaggen-Index angegeben.',1), +5004 => array('Der Landesname %s hat kein korrespondierendes Flaggenbild. Die Flagge mag existieren, abr eventuell unter einem anderen Namen, z.B. versuche "united states" statt "usa".',1), + + +/* +** jpgraph_gantt +*/ + +6001 => array('Interner Fehler. Die Höhe für ActivityTitles ist < 0.',0), +6002 => array('Es dürfen keine negativen Werte für die Gantt-Diagramm-Dimensionen angegeben werden. Verwende 0, wenn die Dimensionen automatisch ermittelt werden sollen.',0), +6003 => array('Ungültiges Format für den Bedingungs-Parameter bei Index=%d in CreateSimple(). Der Parameter muss bei index 0 starten und Vektoren in der Form (Row,Constrain-To,Constrain-Type) enthalten.',1), +6004 => array('Ungültiges Format für den Fortschritts-Parameter bei Index=%d in CreateSimple(). Der Parameter muss bei Index 0 starten und Vektoren in der Form (Row,Progress) enthalten.',1), +6005 => array('SetScale() ist nicht sinnvoll bei Gantt-Diagrammen.',0), +6006 => array('Das Gantt-Diagramm kann nicht automatisch skaliert werden. Es existieren keine Aktivitäten mit Termin. [GetBarMinMax() start >= n]',0), +6007 => array('Plausibiltätsprüfung für die automatische Gantt-Diagramm-Größe schlug fehl. Entweder die Breite (=%d) oder die Höhe (=%d) ist größer als MAX_GANTTIMG_SIZE. Dies kann möglicherweise durch einen falschen Wert bei einer Aktivität hervorgerufen worden sein.',2), +6008 => array('Du hast eine Bedingung angegeben von Reihe=%d bis Reihe=%d, die keine Aktivität hat.',2), +6009 => array('Unbekannter Bedingungstyp von Reihe=%d bis Reihe=%d',2), +6010 => array('Ungültiger Icon-Index für das eingebaute Gantt-Icon [%d]',1), +6011 => array('Argument für IconImage muss entweder ein String oder ein Integer sein.',0), +6012 => array('Unbekannter Typ bei der Gantt-Objekt-Title-Definition.',0), +6015 => array('Ungültige vertikale Position %d',1), +6016 => array('Der eingegebene Datums-String (%s) für eine Gantt-Aktivität kann nicht interpretiert werden. Versichere Dich, dass es ein gültiger Datumsstring ist, z.B. 2005-04-23 13:30',1), +6017 => array('Unbekannter Datumstyp in GanttScale (%s).',1), +6018 => array('Intervall für Minuten muss ein gerader Teiler einer Stunde sein, z.B. 1,5,10,12,15,20,30, etc. Du hast ein Intervall von %d Minuten angegeben.',1), +6019 => array('Die vorhandene Breite (%d) für die Minuten ist zu klein, um angezeigt zu werden. Bitte benutze die automatische Größenermittlung oder vergrößere die Breite des Diagramms.',1), +6020 => array('Das Intervall für die Stunden muss ein gerader Teiler eines Tages sein, z.B. 0:30, 1:00, 1:30, 4:00, etc. Du hast ein Intervall von %d eingegeben.',1), +6021 => array('Unbekanntes Format für die Woche.',0), +6022 => array('Die Gantt-Skala wurde nicht eingegeben.',0), +6023 => array('Wenn Du sowohl Stunden als auch Minuten anzeigen lassen willst, muss das Stunden-Interval gleich 1 sein (anderenfalls ist es nicht sinnvoll, Minuten anzeigen zu lassen).',0), +6024 => array('Das CSIM-Ziel muss als String angegeben werden. Der Start des Ziels ist: %d',1), +6025 => array('Der CSIM-Alt-Text muss als String angegeben werden. Der Beginn des Alt-Textes ist: %d',1), +6027 => array('Der Fortschrittswert muss im Bereich [0, 1] liegen.',0), +6028 => array('Die eingegebene Höhe (%d) für GanttBar ist nicht im zulässigen Bereich.',1), +6029 => array('Der Offset für die vertikale Linie muss im Bereich [0,1] sein.',0), +6030 => array('Unbekannte Pfeilrichtung für eine Verbindung.',0), +6031 => array('Unbekannter Pfeiltyp für eine Verbindung.',0), +6032 => array('Interner Fehler: Unbekannter Pfadtyp (=%d) für eine Verbindung.',1), +6033 => array('Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)',0), + +/* +** jpgraph_gradient +*/ + +7001 => array('Unbekannter Gradiententyp (=%d).',1), + +/* +** jpgraph_iconplot +*/ + +8001 => array('Der Mix-Wert für das Icon muss zwischen 0 und 100 sein.',0), +8002 => array('Die Ankerposition für Icons muss entweder "top", "bottom", "left", "right" oder "center" sein.',0), +8003 => array('Es ist nicht möglich, gleichzeitig ein Bild und eine Landesflagge für dasselbe Icon zu definieren',0), +8004 => array('Wenn Du Landesflaggen benutzen willst, musst Du die Datei "jpgraph_flags.php" hinzufügen (per include).',0), + +/* +** jpgraph_imgtrans +*/ + +9001 => array('Der Wert für die Bildtransformation ist außerhalb des zulässigen Bereichs. Der verschwindende Punkt am Horizont muss als Wert zwischen 0 und 1 angegeben werden.',0), + +/* +** jpgraph_lineplot +*/ + +10001 => array('Die Methode LinePlot::SetFilled() sollte nicht mehr benutzt werden. Benutze lieber SetFillColor()',0), +10002 => array('Der Plot ist zu kompliziert für FastLineStroke. Benutze lieber den StandardStroke()',0), +10003 => array('Each plot in an accumulated lineplot must have the same number of data points.',0), +/* +** jpgraph_log +*/ + +11001 => array('Deine Daten enthalten nicht-numerische Werte.',0), +11002 => array('Negative Werte können nicht für logarithmische Achsen verwendet werden.',0), +11003 => array('Deine Daten enthalten nicht-numerische Werte.',0), +11004 => array('Skalierungsfehler für die logarithmische Achse. Es gibt ein Problem mit den Daten der Achse. Der größte Wert muss größer sein als Null. Es ist mathematisch nicht möglich, einen Wert gleich Null in der Skala zu haben.',0), +11005 => array('Das Tick-Intervall für die logarithmische Achse ist nicht definiert. Lösche jeden Aufruf von SetTextLabelStart() oder SetTextTickInterval() bei der logarithmischen Achse.',0), + +/* +** jpgraph_mgraph +*/ + +12001 => array("Du benutzt GD 2.x und versuchst ein Nicht-Truecolor-Bild als Hintergrundbild zu benutzen. Um Hintergrundbilder mit GD 2.x zu benutzen, ist es notwendig Truecolor zu aktivieren, indem die USE_TRUECOLOR-Konstante auf TRUE gesetzt wird. Wegen eines Bugs in GD 2.0.1 ist die Qualität der Truetype-Schriften sehr schlecht, wenn man Truetype-Schriften mit Truecolor-Bildern verwendet.",0), +12002 => array('Ungültiger Dateiname für MGraph::SetBackgroundImage() : %s. Die Datei muss eine gültige Dateierweiterung haben (jpg,gif,png), wenn die automatische Typerkennung verwendet wird.',1), +12003 => array('Unbekannte Dateierweiterung (%s) in MGraph::SetBackgroundImage() für Dateiname: %s',2), +12004 => array('Das Bildformat des Hintergrundbildes (%s) wird von Deiner System-Konfiguration nicht unterstützt. ',1), +12005 => array('Das Hintergrundbild kann nicht gelesen werden: %s',1), +12006 => array('Es wurden ungültige Größen für Breite oder Höhe beim Erstellen des Bildes angegeben, (Breite=%d, Höhe=%d)',2), +12007 => array('Das Argument für MGraph::Add() ist nicht gültig für GD.',0), +12008 => array('Deine PHP- (und GD-lib-) Installation scheint keine bekannten Bildformate zu unterstützen.',0), +12009 => array('Deine PHP-Installation unterstützt das gewählte Bildformat nicht: %s',1), +12010 => array('Es konnte kein Bild als Datei %s erzeugt werden. Überprüfe, ob Du die entsprechenden Schreibrechte im aktuellen Verzeichnis hast.',1), +12011 => array('Es konnte kein Truecolor-Bild erzeugt werden. Überprüfe, ob Du wirklich die GD2-Bibliothek installiert hast.',0), +12012 => array('Es konnte kein Bild erzeugt werden. Überprüfe, ob Du wirklich die GD2-Bibliothek installiert hast.',0), + +/* +** jpgraph_pie3d +*/ + +14001 => array('Pie3D::ShowBorder(). Missbilligte Funktion. Benutze Pie3D::SetEdge(), um die Ecken der Tortenstücke zu kontrollieren.',0), +14002 => array('PiePlot3D::SetAngle() 3D-Torten-Projektionswinkel muss zwischen 5 und 85 Grad sein.',0), +14003 => array('Interne Festlegung schlug fehl. Pie3D::Pie3DSlice',0), +14004 => array('Tortenstück-Startwinkel muss zwischen 0 und 360 Grad sein.',0), +14005 => array('Pie3D Interner Fehler: Versuch, zweimal zu umhüllen bei der Suche nach dem Startindex.',0,), +14006 => array('Pie3D Interner Fehler: Z-Sortier-Algorithmus für 3D-Tortendiagramme funktioniert nicht einwandfrei (2). Versuch, zweimal zu umhüllen beim Erstellen des Bildes.',0), +14007 => array('Die Breite für das 3D-Tortendiagramm ist 0. Gib eine Breite > 0 an.',0), + +/* +** jpgraph_pie +*/ + +15001 => array('PiePLot::SetTheme() Unbekannter Stil: %s',1), +15002 => array('Argument für PiePlot::ExplodeSlice() muss ein Integer-Wert sein',0), +15003 => array('Argument für PiePlot::Explode() muss ein Vektor mit Integer-Werten sein.',0), +15004 => array('Tortenstück-Startwinkel muss zwischen 0 und 360 Grad sein.',0), +15005 => array('PiePlot::SetFont() sollte nicht mehr verwendet werden. Benutze stattdessen PiePlot->value->SetFont().',0), +15006 => array('PiePlot::SetSize() Radius für Tortendiagramm muss entweder als Bruch [0, 0.5] der Bildgröße oder als Absoluwert in Pixel im Bereich [10, 1000] angegeben werden.',0), +15007 => array('PiePlot::SetFontColor() sollte nicht mehr verwendet werden. Benutze stattdessen PiePlot->value->SetColor()..',0), +15008 => array('PiePlot::SetLabelType() der Typ für Tortendiagramme muss entweder 0 or 1 sein (nicht %d).',1), +15009 => array('Ungültiges Tortendiagramm. Die Summe aller Daten ist Null.',0), +15010 => array('Die Summe aller Daten ist Null.',0), +15011 => array('Um Bildtransformationen benutzen zu können, muss die Datei jpgraph_imgtrans.php eingefügt werden (per include).',0), // @todo translate into German +15012 => array('PiePlot::SetTheme() is no longer recommended. Use PieGraph::SetTheme()',0), + +/* +** jpgraph_plotband +*/ + +16001 => array('Die Dichte für das Pattern muss zwischen 1 und 100 sein. (Du hast %f eingegeben)',1), +16002 => array('Es wurde keine Position für das Pattern angegeben.',0), +16003 => array('Unbekannte Pattern-Definition (%d)',0), +16004 => array('Der Mindeswert für das PlotBand ist größer als der Maximalwert. Bitte korrigiere dies!',0), + + +/* +** jpgraph_polar +*/ + +17001 => array('PolarPlots müssen eine gerade Anzahl von Datenpunkten haben. Jeder Datenpunkt ist ein Tupel (Winkel, Radius).',0), +17002 => array('Unbekannte Ausrichtung für X-Achsen-Titel. (%s)',1), +//17003 => array('Set90AndMargin() wird für PolarGraph nicht unterstützt.',0), +17004 => array('Unbekannter Achsentyp für PolarGraph. Er muss entweder \'lin\' oder \'log\' sein.',0), + +/* +** jpgraph_radar +*/ + +18001 => array('ClientSideImageMaps werden für RadarPlots nicht unterstützt.',0), +18002 => array('RadarGraph::SupressTickMarks() sollte nicht mehr verwendet werden. Benutze stattdessen HideTickMarks().',0), +18003 => array('Ungültiger Achsentyp für RadarPlot (%s). Er muss entweder \'lin\' oder \'log\' sein.',1), +18004 => array('Die RadarPlot-Größe muss zwischen 0.1 und 1 sein. (Dein Wert=%f)',1), +18005 => array('RadarPlot: nicht unterstützte Tick-Dichte: %d',1), +18006 => array('Minimum Daten %f (RadarPlots sollten nur verwendet werden, wenn alle Datenpunkte einen Wert > 0 haben).',1), +18007 => array('Die Anzahl der Titel entspricht nicht der Anzahl der Datenpunkte.',0), +18008 => array('Jeder RadarPlot muss die gleiche Anzahl von Datenpunkten haben.',0), + +/* +** jpgraph_regstat +*/ + +19001 => array('Spline: Anzahl der X- und Y-Koordinaten muss gleich sein.',0), +19002 => array('Ungültige Dateneingabe für Spline. Zwei oder mehr aufeinanderfolgende X-Werte sind identisch. Jeder eigegebene X-Wert muss unterschiedlich sein, weil vom mathematischen Standpunkt ein Eins-zu-Eins-Mapping vorliegen muss, d.h. jeder X-Wert korrespondiert mit exakt einem Y-Wert.',0), +19003 => array('Bezier: Anzahl der X- und Y-Koordinaten muss gleich sein.',0), + +/* +** jpgraph_scatter +*/ + +20001 => array('Fieldplots müssen die gleiche Anzahl von X und Y Datenpunkten haben.',0), +20002 => array('Bei Fieldplots muss ein Winkel für jeden X und Y Datenpunkt angegeben werden.',0), +20003 => array('Scatterplots müssen die gleiche Anzahl von X- und Y-Datenpunkten haben.',0), + +/* +** jpgraph_stock +*/ + +21001 => array('Die Anzahl der Datenwerte für Stock-Charts müssen ein Mehrfaches von %d Datenpunkten sein.',1), + +/* +** jpgraph_plotmark +*/ + +23001 => array('Der Marker "%s" existiert nicht in der Farbe: %d',2), +23002 => array('Der Farb-Index ist zu hoch für den Marker "%s"',1), +23003 => array('Ein Dateiname muss angegeben werden, wenn Du den Marker-Typ auf MARK_IMG setzt.',0), + +/* +** jpgraph_utils +*/ + +24001 => array('FuncGenerator : Keine Funktion definiert. ',0), +24002 => array('FuncGenerator : Syntax-Fehler in der Funktionsdefinition ',0), +24003 => array('DateScaleUtils: Unknown tick type specified in call to GetTicks()',0), +24004 => array('ReadCSV2: Die anzahl der spalten fehler in %s reihe %d',2), +/* +** jpgraph +*/ + +25001 => array('Diese PHP-Installation ist nicht mit der GD-Bibliothek kompiliert. Bitte kompiliere PHP mit GD-Unterstützung neu, damit JpGraph funktioniert. (Weder die Funktion imagetypes() noch imagecreatefromstring() existiert!)',0), +25002 => array('Diese PHP-Installation scheint nicht die benötigte GD-Bibliothek zu unterstützen. Bitte schau in der PHP-Dokumentation nach, wie man die GD-Bibliothek installiert und aktiviert.',0), +25003 => array('Genereller PHP Fehler : Bei %s:%d : %s',3), +25004 => array('Genereller PHP Fehler : %s ',1), +25005 => array('PHP_SELF, die PHP-Global-Variable kann nicht ermittelt werden. PHP kann nicht von der Kommandozeile gestartet werden, wenn der Cache oder die Bilddateien automatisch benannt werden sollen.',0), +25006 => array('Die Benutzung der FF_CHINESE (FF_BIG5) Schriftfamilie benötigt die iconv() Funktion in Deiner PHP-Konfiguration. Dies wird nicht defaultmäßig in PHP kompiliert (benötigt "--width-iconv" bei der Konfiguration).',0), +25007 => array('Du versuchst das lokale (%s) zu verwenden, was von Deiner PHP-Installation nicht unterstützt wird. Hinweis: Benutze \'\', um das defaultmäßige Lokale für diese geographische Region festzulegen.',1), +25008 => array('Die Bild-Breite und Höhe in Graph::Graph() müssen numerisch sein',0), +25009 => array('Die Skalierung der Achsen muss angegeben werden mit Graph::SetScale()',0), + +25010 => array('Graph::Add() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0), +25011 => array('Graph::AddY2() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0), +25012 => array('Graph::AddYN() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0), +25013 => array('Es können nur Standard-Plots zu multiplen Y-Achsen hinzugefügt werden',0), +25014 => array('Graph::AddText() Du hast versucht, einen leeren Text zum Graph hinzuzufügen.',0), +25015 => array('Graph::AddLine() Du hast versucht, eine leere Linie zum Graph hinzuzufügen.',0), +25016 => array('Graph::AddBand() Du hast versucht, ein leeres Band zum Graph hinzuzufügen.',0), +25017 => array('Du benutzt GD 2.x und versuchst, ein Hintergrundbild in einem Truecolor-Bild zu verwenden. Um Hintergrundbilder mit GD 2.x zu verwenden, ist es notwendig, Truecolor zu aktivieren, indem die USE_TRUECOLOR-Konstante auf TRUE gesetzt wird. Wegen eines Bugs in GD 2.0.1 ist die Qualität der Schrift sehr schlecht, wenn Truetype-Schrift in Truecolor-Bildern verwendet werden.',0), +25018 => array('Falscher Dateiname für Graph::SetBackgroundImage() : "%s" muss eine gültige Dateinamenerweiterung (jpg,gif,png) haben, wenn die automatische Dateityperkennung verwenndet werden soll.',1), +25019 => array('Unbekannte Dateinamenerweiterung (%s) in Graph::SetBackgroundImage() für Dateiname: "%s"',2), + +25020 => array('Graph::SetScale(): Dar Maximalwert muss größer sein als der Mindestwert.',0), +25021 => array('Unbekannte Achsendefinition für die Y-Achse. (%s)',1), +25022 => array('Unbekannte Achsendefinition für die X-Achse. (%s)',1), +25023 => array('Nicht unterstützter Y2-Achsentyp: "%s" muss einer von (lin,log,int) sein.',1), +25024 => array('Nicht unterstützter X-Achsentyp: "%s" muss einer von (lin,log,int) sein.',1), +25025 => array('Nicht unterstützte Tick-Dichte: %d',1), +25026 => array('Nicht unterstützter Typ der nicht angegebenen Y-Achse. Du hast entweder: 1. einen Y-Achsentyp für automatisches Skalieren definiert, aber keine Plots angegeben. 2. eine Achse direkt definiert, aber vergessen, die Tick-Dichte zu festzulegen.',0), +25027 => array('Kann cached CSIM "%s" zum Lesen nicht öffnen.',1), +25028 => array('Apache/PHP hat keine Schreibrechte, in das CSIM-Cache-Verzeichnis (%s) zu schreiben. Überprüfe die Rechte.',1), +25029 => array('Kann nicht in das CSIM "%s" schreiben. Überprüfe die Schreibrechte und den freien Speicherplatz.',1), + +25030 => array('Fehlender Skriptname für StrokeCSIM(). Der Name des aktuellen Skriptes muss als erster Parameter von StrokeCSIM() angegeben werden.',0), +25031 => array('Der Achsentyp muss mittels Graph::SetScale() angegeben werden.',0), +25032 => array('Es existieren keine Plots für die Y-Achse nbr:%d',1), +25033 => array('',0), +25034 => array('Undefinierte X-Achse kann nicht gezeichnet werden. Es wurden keine Plots definiert.',0), +25035 => array('Du hast Clipping aktiviert. Clipping wird nur für Diagramme mit 0 oder 90 Grad Rotation unterstützt. Bitte verändere Deinen Rotationswinkel (=%d Grad) dementsprechend oder deaktiviere Clipping.',1), +25036 => array('Unbekannter Achsentyp AxisStyle() : %s',1), +25037 => array('Das Bildformat Deines Hintergrundbildes (%s) wird von Deiner System-Konfiguration nicht unterstützt. ',1), +25038 => array('Das Hintergrundbild scheint von einem anderen Typ (unterschiedliche Dateierweiterung) zu sein als der angegebene Typ. Angegebenen: %s; Datei: %s',2), +25039 => array('Hintergrundbild kann nicht gelesen werden: "%s"',1), + +25040 => array('Es ist nicht möglich, sowohl ein Hintergrundbild als auch eine Hintergrund-Landesflagge anzugeben.',0), +25041 => array('Um Landesflaggen als Hintergrund benutzen zu können, muss die Datei "jpgraph_flags.php" eingefügt werden (per include).',0), +25042 => array('Unbekanntes Hintergrundbild-Layout',0), +25043 => array('Unbekannter Titelhintergrund-Stil.',0), +25044 => array('Automatisches Skalieren kann nicht verwendet werden, weil es unmöglich ist, einen gültigen min/max Wert für die Y-Achse zu ermitteln (nur Null-Werte).',0), +25045 => array('Die Schriftfamilien FF_HANDWRT und FF_BOOK sind wegen Copyright-Problemen nicht mehr verfügbar. Diese Schriften können nicht mehr mit JpGraph verteilt werden. Bitte lade Dir Schriften von http://corefonts.sourceforge.net/ herunter.',0), +25046 => array('Angegebene TTF-Schriftfamilie (id=%d) ist unbekannt oder existiert nicht. Bitte merke Dir, dass TTF-Schriften wegen Copyright-Problemen nicht mit JpGraph mitgeliefert werden. Du findest MS-TTF-Internetschriften (arial, courier, etc.) zum Herunterladen unter http://corefonts.sourceforge.net/',1), +25047 => array('Stil %s ist nicht verfügbar für Schriftfamilie %s',2), +25048 => array('Unbekannte Schriftstildefinition [%s].',1), +25049 => array('Schriftdatei "%s" ist nicht lesbar oder existiert nicht.',1), + +25050 => array('Erstes Argument für Text::Text() muss ein String sein.',0), +25051 => array('Ungültige Richtung angegeben für Text.',0), +25052 => array('PANIK: Interner Fehler in SuperScript::Stroke(). Unbekannte vertikale Ausrichtung für Text.',0), +25053 => array('PANIK: Interner Fehler in SuperScript::Stroke(). Unbekannte horizontale Ausrichtung für Text.',0), +25054 => array('Interner Fehler: Unbekannte Grid-Achse %s',1), +25055 => array('Axis::SetTickDirection() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetTickSide().',0), +25056 => array('SetTickLabelMargin() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetLabelMargin().',0), +25057 => array('SetTextTicks() sollte nicht mehr verwendet werden. Benutze stattdessen SetTextTickInterval().',0), +25058 => array('TextLabelIntevall >= 1 muss angegeben werden.',0), +25059 => array('SetLabelPos() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetLabelSide().',0), + +25060 => array('Unbekannte Ausrichtung angegeben für X-Achsentitel (%s).',1), +25061 => array('Unbekannte Ausrichtung angegeben für Y-Achsentitel (%s).',1), +25062 => array('Label unter einem Winkel werden für die Y-Achse nicht unterstützt.',0), +25063 => array('Ticks::SetPrecision() sollte nicht mehr verwendet werden. Benutze stattdessen Ticks::SetLabelFormat() (oder Ticks::SetFormatCallback()).',0), +25064 => array('Kleinere oder größere Schrittgröße ist 0. Überprüfe, ob Du fälschlicherweise SetTextTicks(0) in Deinem Skript hast. Wenn dies nicht der Fall ist, bist Du eventuell über einen Bug in JpGraph gestolpert. Bitte sende einen Report und füge den Code an, der den Fehler verursacht hat.',0), +25065 => array('Tick-Positionen müssen als array() angegeben werden',0), +25066 => array('Wenn die Tick-Positionen und -Label von Hand eingegeben werden, muss die Anzahl der Ticks und der Label gleich sein.',0), +25067 => array('Deine von Hand eingegebene Achse und Ticks sind nicht korrekt. Die Skala scheint zu klein zu sein für den Tickabstand.',0), +25068 => array('Ein Plot hat eine ungültige Achse. Dies kann beispielsweise der Fall sein, wenn Du automatisches Text-Skalieren verwendest, um ein Liniendiagramm zu zeichnen mit nur einem Datenpunkt, oder wenn die Bildfläche zu klein ist. Es kann auch der Fall sein, dass kein Datenpunkt einen numerischen Wert hat (vielleicht nur \'-\' oder \'x\').',0), +25069 => array('Grace muss größer sein als 0',0), + +25070 => array('Deine Daten enthalten nicht-numerische Werte.',0), +25071 => array('Du hast mit SetAutoMin() einen Mindestwert angegeben, der größer ist als der Maximalwert für die Achse. Dies ist nicht möglich.',0), +25072 => array('Du hast mit SetAutoMax() einen Maximalwert angegeben, der kleiner ist als der Minimalwert der Achse. Dies ist nicht möglich.',0), +25073 => array('Interner Fehler. Der Integer-Skalierungs-Algorithmus-Vergleich ist außerhalb der Grenzen (r=%f).',1), +25074 => array('Interner Fehler. Der Skalierungsbereich ist negativ (%f) [für %s Achse]. Dieses Problem könnte verursacht werden durch den Versuch, \'ungültige\' Werte in die Daten-Vektoren einzugeben (z.B. nur String- oder NULL-Werte), was beim automatischen Skalieren einen Fehler erzeugt.',2), +25075 => array('Die automatischen Ticks können nicht gesetzt werden, weil min==max.',0), +25077 => array('Einstellfaktor für die Farbe muss größer sein als 0',0), +25078 => array('Unbekannte Farbe: %s',1), +25079 => array('Unbekannte Farbdefinition: %s, Größe=%d',2), + +25080 => array('Der Alpha-Parameter für Farben muss zwischen 0.0 und 1.0 liegen.',0), +25081 => array('Das ausgewählte Grafikformat wird entweder nicht unterstützt oder ist unbekannt [%s]',1), +25082 => array('Es wurden ungültige Größen für Breite und Höhe beim Erstellen des Bildes definiert (Breite=%d, Höhe=%d).',2), +25083 => array('Es wurde eine ungültige Größe beim Kopieren des Bildes angegeben. Die Größe für das kopierte Bild wurde auf 1 Pixel oder weniger gesetzt.',0), +25084 => array('Fehler beim Erstellen eines temporären GD-Canvas. Möglicherweise liegt ein Arbeitsspeicherproblem vor.',0), +25085 => array('Ein Bild kann nicht aus dem angegebenen String erzeugt werden. Er ist entweder in einem nicht unterstützen Format oder er represäntiert ein kaputtes Bild.',0), +25086 => array('Du scheinst nur GD 1.x installiert zu haben. Um Alphablending zu aktivieren, ist GD 2.x oder höher notwendig. Bitte installiere GD 2.x oder versichere Dich, dass die Konstante USE_GD2 richtig gesetzt ist. Standardmäßig wird die installierte GD-Version automatisch erkannt. Ganz selten wird GD2 erkannt, obwohl nur GD1 installiert ist. Die Konstante USE_GD2 muss dann zu "false" gesetzt werden.',0), +25087 => array('Diese PHP-Version wurde ohne TTF-Unterstützung konfiguriert. PHP muss mit TTF-Unterstützung neu kompiliert und installiert werden.',0), +25088 => array('Die GD-Schriftunterstützung wurde falsch konfiguriert. Der Aufruf von imagefontwidth() ist fehlerhaft.',0), +25089 => array('Die GD-Schriftunterstützung wurde falsch konfiguriert. Der Aufruf von imagefontheight() ist fehlerhaft.',0), + +25090 => array('Unbekannte Richtung angegeben im Aufruf von StrokeBoxedText() [%s].',1), +25091 => array('Die interne Schrift untestützt das Schreiben von Text in einem beliebigen Winkel nicht. Benutze stattdessen TTF-Schriften.',0), +25092 => array('Es liegt entweder ein Konfigurationsproblem mit TrueType oder ein Problem beim Lesen der Schriftdatei "%s" vor. Versichere Dich, dass die Datei existiert und Leserechte und -pfad vergeben sind. (wenn \'basedir\' restriction in PHP aktiviert ist, muss die Schriftdatei im Dokumentwurzelverzeichnis abgelegt werden). Möglicherweise ist die FreeType-Bibliothek falsch installiert. Versuche, mindestens zur FreeType-Version 2.1.13 zu aktualisieren und kompiliere GD mit einem korrekten Setup neu, damit die FreeType-Bibliothek gefunden werden kann.',1), +25093 => array('Die Schriftdatei "%s" kann nicht gelesen werden beim Aufruf von Image::GetBBoxTTF. Bitte versichere Dich, dass die Schrift gesetzt wurde, bevor diese Methode aufgerufen wird, und dass die Schrift im TTF-Verzeichnis installiert ist.',1), +25094 => array('Die Textrichtung muss in einem Winkel zwischen 0 und 90 engegeben werden.',0), +25095 => array('Unbekannte Schriftfamilien-Definition. ',0), +25096 => array('Der Farbpalette können keine weiteren Farben zugewiesen werden. Dem Bild wurde bereits die größtmögliche Anzahl von Farben (%d) zugewiesen und die Palette ist voll. Verwende stattdessen ein TrueColor-Bild',0), +25097 => array('Eine Farbe wurde als leerer String im Aufruf von PushColor() angegegeben.',0), +25098 => array('Negativer Farbindex. Unpassender Aufruf von PopColor().',0), +25099 => array('Die Parameter für Helligkeit und Kontrast sind außerhalb des zulässigen Bereichs [-1,1]',0), + +25100 => array('Es liegt ein Problem mit der Farbpalette und dem GD-Setup vor. Bitte deaktiviere anti-aliasing oder verwende GD2 mit TrueColor. Wenn die GD2-Bibliothek installiert ist, versichere Dich, dass die Konstante USE_GD2 auf "true" gesetzt und TrueColor aktiviert ist.',0), +25101 => array('Ungültiges numerisches Argument für SetLineStyle(): (%d)',1), +25102 => array('Ungültiges String-Argument für SetLineStyle(): %s',1), +25103 => array('Ungültiges Argument für SetLineStyle %s',1), +25104 => array('Unbekannter Linientyp: %s',1), +25105 => array('Es wurden NULL-Daten für ein gefülltes Polygon angegeben. Sorge dafür, dass keine NULL-Daten angegeben werden.',0), +25106 => array('Image::FillToBorder : es können keine weiteren Farben zugewiesen werden.',0), +25107 => array('In Datei "%s" kann nicht geschrieben werden. Überprüfe die aktuellen Schreibrechte.',1), +25108 => array('Das Bild kann nicht gestreamt werden. Möglicherweise liegt ein Fehler im PHP/GD-Setup vor. Kompiliere PHP neu und verwende die eingebaute GD-Bibliothek, die mit PHP angeboten wird.',0), +25109 => array('Deine PHP- (und GD-lib-) Installation scheint keine bekannten Grafikformate zu unterstützen. Sorge zunächst dafür, dass GD als PHP-Modul kompiliert ist. Wenn Du außerdem JPEG-Bilder verwenden willst, musst Du die JPEG-Bibliothek installieren. Weitere Details sind in der PHP-Dokumentation zu finden.',0), + +25110 => array('Dein PHP-Installation unterstützt das gewählte Grafikformat nicht: %s',1), +25111 => array('Das gecachete Bild %s kann nicht gelöscht werden. Problem mit den Rechten?',1), +25112 => array('Das Datum der gecacheten Datei (%s) liegt in der Zukunft.',1), +25113 => array('Das gecachete Bild %s kann nicht gelöscht werden. Problem mit den Rechten?',1), +25114 => array('PHP hat nicht die erforderlichen Rechte, um in die Cache-Datei %s zu schreiben. Bitte versichere Dich, dass der Benutzer, der PHP anwendet, die entsprechenden Schreibrechte für die Datei hat, wenn Du das Cache-System in JPGraph verwenden willst.',1), +25115 => array('Berechtigung für gecachetes Bild %s kann nicht gesetzt werden. Problem mit den Rechten?',1), +25116 => array('Datei kann nicht aus dem Cache %s geöffnet werden',1), +25117 => array('Gecachetes Bild %s kann nicht zum Lesen geöffnet werden.',1), +25118 => array('Verzeichnis %s kann nicht angelegt werden. Versichere Dich, dass PHP die Schreibrechte in diesem Verzeichnis hat.',1), +25119 => array('Rechte für Datei %s können nicht gesetzt werden. Problem mit den Rechten?',1), + +25120 => array('Die Position für die Legende muss als Prozentwert im Bereich 0-1 angegeben werden.',0), +25121 => array('Eine leerer Datenvektor wurde für den Plot eingegeben. Es muss wenigstens ein Datenpunkt vorliegen.',0), +25122 => array('Stroke() muss als Subklasse der Klasse Plot definiert sein.',0), +25123 => array('Du kannst keine Text-X-Achse mit X-Koordinaten verwenden. Benutze stattdessen eine "int" oder "lin" Achse.',0), +25124 => array('Der Eingabedatenvektor mus aufeinanderfolgende Werte von 0 aufwärts beinhalten. Der angegebene Y-Vektor beginnt mit leeren Werten (NULL).',0), +25125 => array('Ungültige Richtung für statische Linie.',0), +25126 => array('Es kann kein TrueColor-Bild erzeugt werden. Überprüfe, ob die GD2-Bibliothek und PHP korrekt aufgesetzt wurden.',0), +25127 => array('The library has been configured for automatic encoding conversion of Japanese fonts. This requires that PHP has the mb_convert_encoding() function. Your PHP installation lacks this function (PHP needs the "--enable-mbstring" when compiled).',0), +25128 => array('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.',0), +25129 => array('Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines.',0), +25130 => array('Too small plot area. (%d x %d). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.',2), + +25131 => array('StrokeBoxedText2() only supports TTF fonts and not built-in bitmap fonts.',0), +25132 => array('Undefined property %s.',1), // @todo translate +25133 => array('Use Graph::SetTheme() after Graph::SetScale().',0), // @todo translate + +/* +** jpgraph_led +*/ + +25500 => array('Multibyte strings must be enabled in the PHP installation in order to run the LED module so that the function mb_strlen() is available. See PHP documentation for more information.',0), + + +/* +**--------------------------------------------------------------------------------------------- +** Pro-version strings +**--------------------------------------------------------------------------------------------- +*/ + +/* +** jpgraph_table +*/ + +27001 => array('GTextTable: Ungültiges Argument für Set(). Das Array-Argument muss 2-- dimensional sein.',0), +27002 => array('GTextTable: Ungültiges Argument für Set()',0), +27003 => array('GTextTable: Falsche Anzahl von Argumenten für GTextTable::SetColor()',0), +27004 => array('GTextTable: Angegebener Zellenbereich, der verschmolzen werden soll, ist ungültig.',0), +27005 => array('GTextTable: Bereits verschmolzene Zellen im Bereich (%d,%d) bis (%d,%d) können nicht ein weiteres Mal verschmolzen werden.',4), +27006 => array('GTextTable: Spalten-Argument = %d liegt außerhalb der festgelegten Tabellengröße.',1), +27007 => array('GTextTable: Zeilen-Argument = %d liegt außerhalb der festgelegten Tabellengröße.',1), +27008 => array('GTextTable: Spalten- und Zeilengröße müssen zu den Dimensionen der Tabelle passen.',0), +27009 => array('GTextTable: Die Anzahl der Tabellenspalten oder -zeilen ist 0. Versichere Dich, dass die Methoden Init() oder Set() aufgerufen werden.',0), +27010 => array('GTextTable: Es wurde keine Ausrichtung beim Aufruf von SetAlign() angegeben.',0), +27011 => array('GTextTable: Es wurde eine unbekannte Ausrichtung beim Aufruf von SetAlign() abgegeben. Horizontal=%s, Vertikal=%s',2), +27012 => array('GTextTable: Interner Fehler. Es wurde ein ungültiges Argument festgeleget %s',1), +27013 => array('GTextTable: Das Argument für FormatNumber() muss ein String sein.',0), +27014 => array('GTextTable: Die Tabelle wurde weder mit einem Aufruf von Set() noch von Init() initialisiert.',0), +27015 => array('GTextTable: Der Zellenbildbedingungstyp muss entweder TIMG_WIDTH oder TIMG_HEIGHT sein.',0), + +/* +** jpgraph_windrose +*/ + +22001 => array('Die Gesamtsumme der prozentualen Anteile aller Windrosenarme darf 100%% nicht überschreiten!\n(Aktuell max: %d)',1), +22002 => array('Das Bild ist zu klein für eine Skala. Bitte vergrößere das Bild.',0), +22004 => array('Die Etikettendefinition für Windrosenrichtungen müssen 16 Werte haben (eine für jede Kompassrichtung).',0), +22005 => array('Der Linientyp für radiale Linien muss einer von ("solid","dotted","dashed","longdashed") sein.',0), +22006 => array('Es wurde ein ungültiger Windrosentyp angegeben.',0), +22007 => array('Es wurden zu wenig Werte für die Bereichslegende angegeben.',0), +22008 => array('Interner Fehler: Versuch, eine freie Windrose zu plotten, obwohl der Typ keine freie Windrose ist.',0), +22009 => array('Du hast die gleiche Richtung zweimal angegeben, einmal mit einem Winkel und einmal mit einer Kompassrichtung (%f Grad).',0), +22010 => array('Die Richtung muss entweder ein numerischer Wert sein oder eine der 16 Kompassrichtungen',0), +22011 => array('Der Windrosenindex muss ein numerischer oder Richtungswert sein. Du hast angegeben Index=%d',1), +22012 => array('Die radiale Achsendefinition für die Windrose enthält eine nicht aktivierte Richtung.',0), +22013 => array('Du hast dasselbe Look&Feel für die gleiche Kompassrichtung zweimal engegeben, einmal mit Text und einmal mit einem Index (Index=%d)',1), +22014 => array('Der Index für eine Kompassrichtung muss zwischen 0 und 15 sein.',0), +22015 => array('Du hast einen unbekannten Windrosenplottyp angegeben.',0), +22016 => array('Der Windrosenarmindex muss ein numerischer oder ein Richtungswert sein.',0), +22017 => array('Die Windrosendaten enthalten eine Richtung, die nicht aktiviert ist. Bitte berichtige, welche Label angezeigt werden sollen.',0), +22018 => array('Du hast für dieselbe Kompassrichtung zweimal Daten angegeben, einmal mit Text und einmal mit einem Index (Index=%d)',1), +22019 => array('Der Index für eine Richtung muss zwischen 0 und 15 sein. Winkel dürfen nicht für einen regelmäßigen Windplot angegeben werden, sondern entweder ein Index oder eine Kompassrichtung.',0), +22020 => array('Der Windrosenplot ist zu groß für die angegebene Bildgröße. Benutze entweder WindrosePlot::SetSize(), um den Plot kleiner zu machen oder vergrößere das Bild im ursprünglichen Aufruf von WindroseGraph().',0), +22021 => array('It is only possible to add Text, IconPlot or WindrosePlot to a Windrose Graph',0), + +/* +** jpgraph_odometer +*/ + +13001 => array('Unbekannter Nadeltypstil (%d).',1), +13002 => array('Ein Wert für das Odometer (%f) ist außerhalb des angegebenen Bereichs [%f,%f]',3), + +/* +** jpgraph_barcode +*/ + +1001 => array('Unbekannte Kodier-Specifikation: %s',1), +1002 => array('datenvalidierung schlug fehl. [%s] kann nicht mittels der Kodierung "%s" kodiert werden',2), +1003 => array('Interner Kodierfehler. Kodieren von %s ist nicht möglich in Code 128',1), +1004 => array('Interner barcode Fehler. Unbekannter UPC-E Kodiertyp: %s',1), +1005 => array('Interner Fehler. Das Textzeichen-Tupel (%s, %s) kann nicht im Code-128 Zeichensatz C kodiert werden.',2), +1006 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, CTRL in CHARSET != A zu kodieren.',0), +1007 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, DEL in CHARSET != B zu kodieren.',0), +1008 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, kleine Buchstaben in CHARSET != B zu kodieren.',0), +1009 => array('Kodieren mittels CODE 93 wird noch nicht unterstützt.',0), +1010 => array('Kodieren mittels POSTNET wird noch nicht unterstützt.',0), +1011 => array('Nicht untrstütztes Barcode-Backend für den Typ %s',1), + +/* +** PDF417 +*/ + +26000 => array('PDF417: The PDF417 module requires that the PHP installation must support the function bcmod(). This is normally enabled at compile time. See documentation for more information.',0), +26001 => array('PDF417: Die Anzahl der Spalten muss zwischen 1 und 30 sein.',0), +26002 => array('PDF417: Der Fehler-Level muss zwischen 0 und 8 sein.',0), +26003 => array('PDF417: Ungültiges Format für Eingabedaten, um sie mit PDF417 zu kodieren.',0), +26004 => array('PDF417: die eigebenen Daten können nicht mit Fehler-Level %d und %d spalten kodiert werden, weil daraus zu viele Symbole oder mehr als 90 Zeilen resultieren.',2), +26005 => array('PDF417: Die Datei "%s" kann nicht zum Schreiben geöffnet werden.',1), +26006 => array('PDF417: Interner Fehler. Die Eingabedatendatei für PDF417-Cluster %d ist fehlerhaft.',1), +26007 => array('PDF417: Interner Fehler. GetPattern: Ungültiger Code-Wert %d (Zeile %d)',2), +26008 => array('PDF417: Interner Fehler. Modus wurde nicht in der Modusliste!! Modus %d',1), +26009 => array('PDF417: Kodierfehler: Ungültiges Zeichen. Zeichen kann nicht mit ASCII-Code %d kodiert werden.',1), +26010 => array('PDF417: Interner Fehler: Keine Eingabedaten beim Dekodieren.',0), +26011 => array('PDF417: Kodierfehler. Numerisches Kodieren bei nicht-numerischen Daten nicht möglich.',0), +26012 => array('PDF417: Interner Fehler. Es wurden für den Binary-Kompressor keine Daten zum Dekodieren eingegeben.',0), +26013 => array('PDF417: Interner Fehler. Checksum Fehler. Koeffiziententabellen sind fehlerhaft.',0), +26014 => array('PDF417: Interner Fehler. Es wurden keine Daten zum Berechnen von Kodewörtern eingegeben.',0), +26015 => array('PDF417: Interner Fehler. Ein Eintrag 0 in die Statusübertragungstabellen ist nicht NULL. Eintrag 1 = (%s)',1), +26016 => array('PDF417: Interner Fehler: Nichtregistrierter Statusübertragungsmodus beim Dekodieren.',0), + + +/* +** jpgraph_contour +*/ + +28001 => array('Dritten parameter fur Contour muss ein vector der fargen sind.',0), +28002 => array('Die anzahlen der farges jeder isobar linien muss gleich sein.',0), +28003 => array('ContourPlot Interner Fehler: isobarHCrossing: Spalten index ist zu hoch (%d)',1), +28004 => array('ContourPlot Interner Fehler: isobarHCrossing: Reihe index ist zu hoch (%d)',1), +28005 => array('ContourPlot Interner Fehler: isobarVCrossing: Reihe index ist zu hoch (%d)',1), +28006 => array('ContourPlot Interner Fehler: isobarVCrossing: Spalten index ist zu hoch (%d)',1), +28007 => array('ContourPlot. Interpolation faktor ist zu hoch (>5)',0), + + +/* + * jpgraph_matrix and colormap +*/ +29201 => array('Min range value must be less or equal to max range value for colormaps',0), +29202 => array('The distance between min and max value is too small for numerical precision',0), +29203 => array('Number of color quantification level must be at least %d',1), +29204 => array('Number of colors (%d) is invalid for this colormap. It must be a number that can be written as: %d + k*%d',3), +29205 => array('Colormap specification out of range. Must be an integer in range [0,%d]',1), +29206 => array('Invalid object added to MatrixGraph',0), +29207 => array('Empty input data specified for MatrixPlot',0), +29208 => array('Unknown side specifiction for matrix labels "%s"',1), +29209 => array('CSIM Target matrix must be the same size as the data matrix (csim=%d x %d, data=%d x %d)',4), +29210 => array('CSIM Target for matrix labels does not match the number of labels (csim=%d, labels=%d)',2), + + +/* +* jpgraph_theme +*/ +30001 => array("Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.",2), + + +); + +?> diff --git a/includes/jpgraph/src/lang/en.inc.php b/includes/jpgraph/src/lang/en.inc.php new file mode 100644 index 0000000..7911552 --- /dev/null +++ b/includes/jpgraph/src/lang/en.inc.php @@ -0,0 +1,545 @@ +,) +$_jpg_messages = array( + +/* +** Headers already sent error. This is formatted as HTML different since this will be sent back directly as text +*/ +10 => array('
JpGraph Error: +HTTP headers have already been sent.
Caused by output from file %s at line %d.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it\'s image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).

Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".

',2), + +/* +** Setup errors +*/ +11 => array('No path specified for CACHE_DIR. Please specify CACHE_DIR manually in jpg-config.inc',0), +12 => array('No path specified for TTF_DIR and path can not be determined automatically. Please specify TTF_DIR manually (in jpg-config.inc).',0), +13 => array('The installed PHP version (%s) is not compatible with this release of the library. The library requires at least PHP version %s',2), + + +/* +** jpgraph_bar +*/ + +2001 => array('Number of colors is not the same as the number of patterns in BarPlot::SetPattern()',0), +2002 => array('Unknown pattern specified in call to BarPlot::SetPattern()',0), +2003 => array('Number of X and Y points are not equal. Number of X-points: %d Number of Y-points: %d',2), +2004 => array('All values for a barplot must be numeric. You have specified value nr [%d] == %s',2), +2005 => array('You have specified an empty array for shadow colors in the bar plot.',0), +2006 => array('Unknown position for values on bars : %s',1), +2007 => array('Cannot create GroupBarPlot from empty plot array.',0), +2008 => array('Group bar plot element nbr %d is undefined or empty.',0), +2009 => array('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the GroupBar plot from an array of BarPlot or AccBarPlot objects. (Class = %s)',1), +2010 => array('Cannot create AccBarPlot from empty plot array.',0), +2011 => array('Acc bar plot element nbr %d is undefined or empty.',1), +2012 => array('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects. (Class=%s)',1), +2013 => array('You have specified an empty array for shadow colors in the bar plot.',0), +2014 => array('Number of datapoints for each data set in accbarplot must be the same',0), +2015 => array('Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates',0), + + +/* +** jpgraph_date +*/ + +3001 => array('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both',0), + +/* +** jpgraph_error +*/ + +4002 => array('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3',0), + +/* +** jpgraph_flags +*/ + +5001 => array('Unknown flag size (%d).',1), +5002 => array('Flag index %s does not exist.',1), +5003 => array('Invalid ordinal number (%d) specified for flag index.',1), +5004 => array('The (partial) country name %s does not have a corresponding flag image. The flag may still exist but under another name, e.g. instead of "usa" try "united states".',1), + + +/* +** jpgraph_gantt +*/ + +6001 => array('Internal error. Height for ActivityTitles is < 0',0), +6002 => array('You can\'t specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension.',0), +6003 => array('Invalid format for Constrain parameter at index=%d in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)',1), +6004 => array('Invalid format for Progress parameter at index=%d in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)',1), +6005 => array('SetScale() is not meaningful with Gantt charts.',0), +6006 => array('Cannot autoscale Gantt chart. No dated activities exist. [GetBarMinMax() start >= n]',0), +6007 => array('Sanity check for automatic Gantt chart size failed. Either the width (=%d) or height (=%d) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.',2), +6008 => array('You have specified a constrain from row=%d to row=%d which does not have any activity',2), +6009 => array('Unknown constrain type specified from row=%d to row=%d',2), +6010 => array('Illegal icon index for Gantt builtin icon [%d]',1), +6011 => array('Argument to IconImage must be string or integer',0), +6012 => array('Unknown type in Gantt object title specification',0), +6015 => array('Illegal vertical position %d',1), +6016 => array('Date string (%s) specified for Gantt activity can not be interpretated. Please make sure it is a valid time string, e.g. 2005-04-23 13:30',1), +6017 => array('Unknown date format in GanttScale (%s).',1), +6018 => array('Interval for minutes must divide the hour evenly, e.g. 1,5,10,12,15,20,30 etc You have specified an interval of %d minutes.',1), +6019 => array('The available width (%d) for minutes are to small for this scale to be displayed. Please use auto-sizing or increase the width of the graph.',1), +6020 => array('Interval for hours must divide the day evenly, e.g. 0:30, 1:00, 1:30, 4:00 etc. You have specified an interval of %d',1), +6021 => array('Unknown formatting style for week.',0), +6022 => array('Gantt scale has not been specified.',0), +6023 => array('If you display both hour and minutes the hour interval must be 1 (Otherwise it doesn\'t make sense to display minutes).',0), +6024 => array('CSIM Target must be specified as a string. Start of target is: %d',1), +6025 => array('CSIM Alt text must be specified as a string. Start of alt text is: %d',1), +6027 => array('Progress value must in range [0, 1]',0), +6028 => array('Specified height (%d) for gantt bar is out of range.',1), +6029 => array('Offset for vertical line must be in range [0,1]',0), +6030 => array('Unknown arrow direction for link.',0), +6031 => array('Unknown arrow type for link.',0), +6032 => array('Internal error: Unknown path type (=%d) specified for link.',1), +6033 => array('Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)',0), + +/* +** jpgraph_gradient +*/ + +7001 => array('Unknown gradient style (=%d).',1), + +/* +** jpgraph_iconplot +*/ + +8001 => array('Mix value for icon must be between 0 and 100.',0), +8002 => array('Anchor position for icons must be one of "top", "bottom", "left", "right" or "center"',0), +8003 => array('It is not possible to specify both an image file and a country flag for the same icon.',0), +8004 => array('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.',0), + +/* +** jpgraph_imgtrans +*/ + +9001 => array('Value for image transformation out of bounds. Vanishing point on horizon must be specified as a value between 0 and 1.',0), + +/* +** jpgraph_lineplot +*/ + +10001 => array('LinePlot::SetFilled() is deprecated. Use SetFillColor()',0), +10002 => array('Plot too complicated for fast line Stroke. Use standard Stroke()',0), +10003 => array('Each plot in an accumulated lineplot must have the same number of data points.',0), + +/* +** jpgraph_log +*/ + +11001 => array('Your data contains non-numeric values.',0), +11002 => array('Negative data values can not be used in a log scale.',0), +11003 => array('Your data contains non-numeric values.',0), +11004 => array('Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.',0), +11005 => array('Specifying tick interval for a logarithmic scale is undefined. Remove any calls to SetTextLabelStart() or SetTextTickInterval() on the logarithmic scale.',0), + +/* +** jpgraph_mgraph +*/ + +12001 => array("You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x it is necessary to enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.",0), +12002 => array('Incorrect file name for MGraph::SetBackgroundImage() : %s Must have a valid image extension (jpg,gif,png) when using auto detection of image type',1), +12003 => array('Unknown file extension (%s) in MGraph::SetBackgroundImage() for filename: %s',2), +12004 => array('The image format of your background image (%s) is not supported in your system configuration. ',1), +12005 => array('Can\'t read background image: %s',1), +12006 => array('Illegal sizes specified for width or height when creating an image, (width=%d, height=%d)',2), +12007 => array('Argument to MGraph::Add() is not a valid GD image handle.',0), +12008 => array('Your PHP (and GD-lib) installation does not appear to support any known graphic formats.',0), +12009 => array('Your PHP installation does not support the chosen graphic format: %s',1), +12010 => array('Can\'t create or stream image to file %s Check that PHP has enough permission to write a file to the current directory.',1), +12011 => array('Can\'t create truecolor image. Check that you really have GD2 library installed.',0), +12012 => array('Can\'t create image. Check that you really have GD2 library installed.',0), + +/* +** jpgraph_pie3d +*/ + +14001 => array('Pie3D::ShowBorder() . Deprecated function. Use Pie3D::SetEdge() to control the edges around slices.',0), +14002 => array('PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees.',0), +14003 => array('Internal assertion failed. Pie3D::Pie3DSlice',0), +14004 => array('Slice start angle must be between 0 and 360 degrees.',0), +14005 => array('Pie3D Internal error: Trying to wrap twice when looking for start index',0,), +14006 => array('Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking.',0), +14007 => array('Width for 3D Pie is 0. Specify a size > 0',0), + +/* +** jpgraph_pie +*/ + +15001 => array('PiePLot::SetTheme() Unknown theme: %s',1), +15002 => array('Argument to PiePlot::ExplodeSlice() must be an integer',0), +15003 => array('Argument to PiePlot::Explode() must be an array with integer distances.',0), +15004 => array('Slice start angle must be between 0 and 360 degrees.',0), +15005 => array('PiePlot::SetFont() is deprecated. Use PiePlot->value->SetFont() instead.',0), +15006 => array('PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]',0), +15007 => array('PiePlot::SetFontColor() is deprecated. Use PiePlot->value->SetColor() instead.',0), +15008 => array('PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not %d).',1), +15009 => array('Illegal pie plot. Sum of all data is zero for Pie Plot',0), +15010 => array('Sum of all data is 0 for Pie.',0), +15011 => array('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.',0), +15012 => array('PiePlot::SetTheme() is no longer supported. Use PieGraph::SetTheme()',0), + +/* +** jpgraph_plotband +*/ + +16001 => array('Density for pattern must be between 1 and 100. (You tried %f)',1), +16002 => array('No positions specified for pattern.',0), +16003 => array('Unknown pattern specification (%d)',0), +16004 => array('Min value for plotband is larger than specified max value. Please correct.',0), + + +/* +** jpgraph_polar +*/ + +17001 => array('Polar plots must have an even number of data point. Each data point is a tuple (angle,radius).',0), +17002 => array('Unknown alignment specified for X-axis title. (%s)',1), +//17003 => array('Set90AndMargin() is not supported for polar graphs.',0), +17004 => array('Unknown scale type for polar graph. Must be "lin" or "log"',0), + +/* +** jpgraph_radar +*/ + +18001 => array('Client side image maps not supported for RadarPlots.',0), +18002 => array('RadarGraph::SupressTickMarks() is deprecated. Use HideTickMarks() instead.',0), +18003 => array('Illegal scale for radarplot (%s). Must be \'lin\' or \'log\'',1), +18004 => array('Radar Plot size must be between 0.1 and 1. (Your value=%f)',1), +18005 => array('RadarPlot Unsupported Tick density: %d',1), +18006 => array('Minimum data %f (Radar plots should only be used when all data points > 0)',1), +18007 => array('Number of titles does not match number of points in plot.',0), +18008 => array('Each radar plot must have the same number of data points.',0), + +/* +** jpgraph_regstat +*/ + +19001 => array('Spline: Number of X and Y coordinates must be the same',0), +19002 => array('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.',0), +19003 => array('Bezier: Number of X and Y coordinates must be the same',0), + +/* +** jpgraph_scatter +*/ + +20001 => array('Fieldplots must have equal number of X and Y points.',0), +20002 => array('Fieldplots must have an angle specified for each X and Y points.',0), +20003 => array('Scatterplot must have equal number of X and Y points.',0), + +/* +** jpgraph_stock +*/ + +21001 => array('Data values for Stock charts must contain an even multiple of %d data points.',1), + +/* +** jpgraph_plotmark +*/ + +23001 => array('This marker "%s" does not exist in color with index: %d',2), +23002 => array('Mark color index too large for marker "%s"',1), +23003 => array('A filename must be specified if you set the mark type to MARK_IMG.',0), + +/* +** jpgraph_utils +*/ + +24001 => array('FuncGenerator : No function specified. ',0), +24002 => array('FuncGenerator : Syntax error in function specification ',0), +24003 => array('DateScaleUtils: Unknown tick type specified in call to GetTicks()',0), +24004 => array('ReadCSV2: Column count mismatch in %s line %d',2), +/* +** jpgraph +*/ + +25001 => array('This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)',0), +25002 => array('Your PHP installation does not seem to have the required GD library. Please see the PHP documentation on how to install and enable the GD library.',0), +25003 => array('General PHP error : At %s:%d : %s',3), +25004 => array('General PHP error : %s ',1), +25005 => array('Can\'t access PHP_SELF, PHP global variable. You can\'t run PHP from command line if you want to use the \'auto\' naming of cache or image files.',0), +25006 => array('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).',0), +25007 => array('You are trying to use the locale (%s) which your PHP installation does not support. Hint: Use \'\' to indicate the default locale for this geographic region.',1), +25008 => array('Image width/height argument in Graph::Graph() must be numeric',0), +25009 => array('You must specify what scale to use with a call to Graph::SetScale()',0), + +25010 => array('Graph::Add() You tried to add a null plot to the graph.',0), +25011 => array('Graph::AddY2() You tried to add a null plot to the graph.',0), +25012 => array('Graph::AddYN() You tried to add a null plot to the graph.',0), +25013 => array('You can only add standard plots to multiple Y-axis',0), +25014 => array('Graph::AddText() You tried to add a null text to the graph.',0), +25015 => array('Graph::AddLine() You tried to add a null line to the graph.',0), +25016 => array('Graph::AddBand() You tried to add a null band to the graph.',0), +25017 => array('You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x it is necessary to enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.',0), +25018 => array('Incorrect file name for Graph::SetBackgroundImage() : "%s" Must have a valid image extension (jpg,gif,png) when using auto detection of image type',1), +25019 => array('Unknown file extension (%s) in Graph::SetBackgroundImage() for filename: "%s"',2), + +25020 => array('Graph::SetScale(): Specified Max value must be larger than the specified Min value.',0), +25021 => array('Unknown scale specification for Y-scale. (%s)',1), +25022 => array('Unknown scale specification for X-scale. (%s)',1), +25023 => array('Unsupported Y2 axis type: "%s" Must be one of (lin,log,int)',1), +25024 => array('Unsupported Y axis type: "%s" Must be one of (lin,log,int)',1), +25025 => array('Unsupported Tick density: %d',1), +25026 => array('Can\'t draw unspecified Y-scale. You have either: 1. Specified an Y axis for auto scaling but have not supplied any plots. 2. Specified a scale manually but have forgot to specify the tick steps',0), +25027 => array('Can\'t open cached CSIM "%s" for reading.',1), +25028 => array('Apache/PHP does not have permission to write to the CSIM cache directory (%s). Check permissions.',1), +25029 => array('Can\'t write CSIM "%s" for writing. Check free space and permissions.',1), + +25030 => array('Missing script name in call to StrokeCSIM(). You must specify the name of the actual image script as the first parameter to StrokeCSIM().',0), +25031 => array('You must specify what scale to use with a call to Graph::SetScale().',0), +25032 => array('No plots for Y-axis nbr:%d',1), +25033 => array('',0), +25034 => array('Can\'t draw unspecified X-scale. No plots specified.',0), +25035 => array('You have enabled clipping. Clipping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (=%d degrees) or disable clipping.',1), +25036 => array('Unknown AxisStyle() : %s',1), +25037 => array('The image format of your background image (%s) is not supported in your system configuration. ',1), +25038 => array('Background image seems to be of different type (has different file extension) than specified imagetype. Specified: %s File: %s',2), +25039 => array('Can\'t read background image: "%s"',1), + +25040 => array('It is not possible to specify both a background image and a background country flag.',0), +25041 => array('In order to use Country flags as backgrounds you must include the "jpgraph_flags.php" file.',0), +25042 => array('Unknown background image layout',0), +25043 => array('Unknown title background style.',0), +25044 => array('Cannot use auto scaling since it is impossible to determine a valid min/max value of the Y-axis (only null values).',0), +25045 => array('Font families FF_HANDWRT and FF_BOOK are no longer available due to copyright problem with these fonts. Fonts can no longer be distributed with JpGraph. Please download fonts from http://corefonts.sourceforge.net/',0), +25046 => array('Specified TTF font family (id=%d) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/',1), +25047 => array('Style %s is not available for font family %s',2), +25048 => array('Unknown font style specification [%s].',1), +25049 => array('Font file "%s" is not readable or does not exist.',1), + +25050 => array('First argument to Text::Text() must be a string.',0), +25051 => array('Invalid direction specified for text.',0), +25052 => array('PANIC: Internal error in SuperScript::Stroke(). Unknown vertical alignment for text',0), +25053 => array('PANIC: Internal error in SuperScript::Stroke(). Unknown horizontal alignment for text',0), +25054 => array('Internal error: Unknown grid axis %s',1), +25055 => array('Axis::SetTickDirection() is deprecated. Use Axis::SetTickSide() instead',0), +25056 => array('SetTickLabelMargin() is deprecated. Use Axis::SetLabelMargin() instead.',0), +25057 => array('SetTextTicks() is deprecated. Use SetTextTickInterval() instead.',0), +25058 => array('Text label interval must be specified >= 1.',0), +25059 => array('SetLabelPos() is deprecated. Use Axis::SetLabelSide() instead.',0), + +25060 => array('Unknown alignment specified for X-axis title. (%s)',1), +25061 => array('Unknown alignment specified for Y-axis title. (%s)',1), +25062 => array('Labels at an angle are not supported on Y-axis',0), +25063 => array('Ticks::SetPrecision() is deprecated. Use Ticks::SetLabelFormat() (or Ticks::SetFormatCallback()) instead',0), +25064 => array('Minor or major step size is 0. Check that you haven\'t got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem',0), +25065 => array('Tick positions must be specified as an array()',0), +25066 => array('When manually specifying tick positions and labels the number of labels must be the same as the number of specified ticks.',0), +25067 => array('Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tick marks.',0), +25068 => array('A plot has an illegal scale. This could for example be that you are trying to use text auto scaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only \'-\' or \'x\')',0), +25069 => array('Grace must be larger then 0',0), +25070 => array('Either X or Y data arrays contains non-numeric values. Check that the data is really specified as numeric data and not as strings. It is an error to specify data for example as \'-2345.2\' (using quotes).',0), +25071 => array('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.',0), +25072 => array('You have specified a max value with SetAutoMax() which is smaller than the minimum value used for the scale. This is not possible.',0), +25073 => array('Internal error. Integer scale algorithm comparison out of bound (r=%f)',1), +25074 => array('Internal error. The scale range is negative (%f) [for %s scale] This problem could potentially be caused by trying to use \"illegal\" values in the input data arrays (like trying to send in strings or only NULL values) which causes the auto scaling to fail.',2), +25075 => array('Can\'t automatically determine ticks since min==max.',0), +25077 => array('Adjustment factor for color must be > 0',0), +25078 => array('Unknown color: %s',1), +25079 => array('Unknown color specification: %s, size=%d',2), + +25080 => array('Alpha parameter for color must be between 0.0 and 1.0',0), +25081 => array('Selected graphic format is either not supported or unknown [%s]',1), +25082 => array('Illegal sizes specified for width or height when creating an image, (width=%d, height=%d)',2), +25083 => array('Illegal image size when copying image. Size for copied to image is 1 pixel or less.',0), +25084 => array('Failed to create temporary GD canvas. Possible Out of memory problem.',0), +25085 => array('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.',0), +25086 => array('You only seem to have GD 1.x installed. To enable Alphablending requires GD 2.x or higher. Please install GD or make sure the constant USE_GD2 is specified correctly to reflect your installation. By default it tries to auto detect what version of GD you have installed. On some very rare occasions it may falsely detect GD2 where only GD1 is installed. You must then set USE_GD2 to false.',0), +25087 => array('This PHP build has not been configured with TTF support. You need to recompile your PHP installation with FreeType support.',0), +25088 => array('You have a misconfigured GD font support. The call to imagefontwidth() fails.',0), +25089 => array('You have a misconfigured GD font support. The call to imagefontheight() fails.',0), + +25090 => array('Unknown direction specified in call to StrokeBoxedText() [%s]',1), +25091 => array('Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead.',0), +25092 => array('There is either a configuration problem with TrueType or a problem reading font file "%s" Make sure file exists and is in a readable place for the HTTP process. (If \'basedir\' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try upgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library.',1), +25093 => array('Can not read font file "%s" in call to Image::GetBBoxTTF. Please make sure that you have set a font before calling this method and that the font is installed in the TTF directory.',1), +25094 => array('Direction for text most be given as an angle between 0 and 90.',0), +25095 => array('Unknown font font family specification. ',0), +25096 => array('Can\'t allocate any more colors in palette image. Image has already allocated maximum of %d colors and the palette is now full. Change to a truecolor image instead',0), +25097 => array('Color specified as empty string in PushColor().',0), +25098 => array('Negative Color stack index. Unmatched call to PopColor()',0), +25099 => array('Parameters for brightness and Contrast out of range [-1,1]',0), + +25100 => array('Problem with color palette and your GD setup. Please disable anti-aliasing or use GD2 with true-color. If you have GD2 library installed please make sure that you have set the USE_GD2 constant to true and truecolor is enabled.',0), +25101 => array('Illegal numeric argument to SetLineStyle(): (%d)',1), +25102 => array('Illegal string argument to SetLineStyle(): %s',1), +25103 => array('Illegal argument to SetLineStyle %s',1), +25104 => array('Unknown line style: %s',1), +25105 => array('NULL data specified for a filled polygon. Check that your data is not NULL.',0), +25106 => array('Image::FillToBorder : Can not allocate more colors',0), +25107 => array('Can\'t write to file "%s". Check that the process running PHP has enough permission.',1), +25108 => array('Can\'t stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP.',0), +25109 => array('Your PHP (and GD-lib) installation does not appear to support any known graphic formats. You need to first make sure GD is compiled as a module to PHP. If you also want to use JPEG images you must get the JPEG library. Please see the PHP docs for details.',0), + +25110 => array('Your PHP installation does not support the chosen graphic format: %s',1), +25111 => array('Can\'t delete cached image %s. Permission problem?',1), +25112 => array('Cached imagefile (%s) has file date in the future.',1), +25113 => array('Can\'t delete cached image "%s". Permission problem?',1), +25114 => array('PHP has not enough permissions to write to the cache file "%s". Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.',1), +25115 => array('Can\'t set permission for cached image "%s". Permission problem?',1), +25116 => array('Cant open file from cache "%s"',1), +25117 => array('Can\'t open cached image "%s" for reading.',1), +25118 => array('Can\'t create directory "%s". Make sure PHP has write permission to this directory.',1), +25119 => array('Can\'t set permissions for "%s". Permission problems?',1), + +25120 => array('Position for legend must be given as percentage in range 0-1',0), +25121 => array('Empty input data array specified for plot. Must have at least one data point.',0), +25122 => array('Stroke() must be implemented by concrete subclass to class Plot',0), +25123 => array('You can\'t use a text X-scale with specified X-coords. Use a "int" or "lin" scale instead.',0), +25124 => array('The input data array must have consecutive values from position 0 and forward. The given y-array starts with empty values (NULL)',0), +25125 => array('Illegal direction for static line',0), +25126 => array('Can\'t create truecolor image. Check that the GD2 library is properly setup with PHP.',0), +25127 => array('The library has been configured for automatic encoding conversion of Japanese fonts. This requires that PHP has the mb_convert_encoding() function. Your PHP installation lacks this function (PHP needs the "--enable-mbstring" when compiled).',0), +25128 => array('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.',0), +25129 => array('Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines.',0), +25130 => array('Too small plot area. (%d x %d). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.',2), + +25131 => array('StrokeBoxedText2() only supports TTF fonts and not built-in bitmap fonts.',0), +25132 => array('Undefined property %s.',1), +25133 => array('Use Graph::SetTheme() after Graph::SetScale().',0), + +/* +** jpgraph_led +*/ + +25500 => array('Multibyte strings must be enabled in the PHP installation in order to run the LED module so that the function mb_strlen() is available. See PHP documentation for more information.',0), + +/* +**--------------------------------------------------------------------------------------------- +** Pro-version strings +**--------------------------------------------------------------------------------------------- +*/ + +/* +** jpgraph_table +*/ + +27001 => array('GTextTable: Invalid argument to Set(). Array argument must be 2 dimensional',0), +27002 => array('GTextTable: Invalid argument to Set()',0), +27003 => array('GTextTable: Wrong number of arguments to GTextTable::SetColor()',0), +27004 => array('GTextTable: Specified cell range to be merged is not valid.',0), +27005 => array('GTextTable: Cannot merge already merged cells in the range: (%d,%d) to (%d,%d)',4), +27006 => array('GTextTable: Column argument = %d is outside specified table size.',1), +27007 => array('GTextTable: Row argument = %d is outside specified table size.',1), +27008 => array('GTextTable: Column and row size arrays must match the dimensions of the table',0), +27009 => array('GTextTable: Number of table columns or rows are 0. Make sure Init() or Set() is called.',0), +27010 => array('GTextTable: No alignment specified in call to SetAlign()',0), +27011 => array('GTextTable: Unknown alignment specified in SetAlign(). Horizontal=%s, Vertical=%s',2), +27012 => array('GTextTable: Internal error. Invalid alignment specified =%s',1), +27013 => array('GTextTable: Argument to FormatNumber() must be a string.',0), +27014 => array('GTextTable: Table is not initilaized with either a call to Set() or Init()',0), +27015 => array('GTextTable: Cell image constrain type must be TIMG_WIDTH or TIMG_HEIGHT',0), + +/* +** jpgraph_windrose +*/ + +22001 => array('Total percentage for all windrose legs in a windrose plot can not exceed 100%% !\n(Current max is: %d)',1), +22002 => array('Graph is too small to have a scale. Please make the graph larger.',0), +22004 => array('Label specification for windrose directions must have 16 values (one for each compass direction).',0), +22005 => array('Line style for radial lines must be on of ("solid","dotted","dashed","longdashed") ',0), +22006 => array('Illegal windrose type specified.',0), +22007 => array('To few values for the range legend.',0), +22008 => array('Internal error: Trying to plot free Windrose even though type is not a free windrose',0), +22009 => array('You have specified the same direction twice, once with an angle and once with a compass direction (%f degrees)',0), +22010 => array('Direction must either be a numeric value or one of the 16 compass directions',0), +22011 => array('Windrose index must be numeric or direction label. You have specified index=%d',1), +22012 => array('Windrose radial axis specification contains a direction which is not enabled.',0), +22013 => array('You have specified the look&feel for the same compass direction twice, once with text and once with index (Index=%d)',1), +22014 => array('Index for compass direction must be between 0 and 15.',0), +22015 => array('You have specified an undefined Windrose plot type.',0), +22016 => array('Windrose leg index must be numeric or direction label.',0), +22017 => array('Windrose data contains a direction which is not enabled. Please adjust what labels are displayed.',0), +22018 => array('You have specified data for the same compass direction twice, once with text and once with index (Index=%d)',1), +22019 => array('Index for direction must be between 0 and 15. You can\'t specify angles for a Regular Windplot, only index and compass directions.',0), +22020 => array('Windrose plot is too large to fit the specified Graph size. Please use WindrosePlot::SetSize() to make the plot smaller or increase the size of the Graph in the initial WindroseGraph() call.',0), +22021 => array('It is only possible to add Text, IconPlot or WindrosePlot to a Windrose Graph',0), +/* +** jpgraph_odometer +*/ + +13001 => array('Unknown needle style (%d).',1), +13002 => array('Value for odometer (%f) is outside specified scale [%f,%f]',3), + +/* +** jpgraph_barcode +*/ + +1001 => array('Unknown encoder specification: %s',1), +1002 => array('Data validation failed. Can\'t encode [%s] using encoding "%s"',2), +1003 => array('Internal encoding error. Trying to encode %s is not possible in Code 128',1), +1004 => array('Internal barcode error. Unknown UPC-E encoding type: %s',1), +1005 => array('Internal error. Can\'t encode character tuple (%s, %s) in Code-128 charset C',2), +1006 => array('Internal encoding error for CODE 128. Trying to encode control character in CHARSET != A',0), +1007 => array('Internal encoding error for CODE 128. Trying to encode DEL in CHARSET != B',0), +1008 => array('Internal encoding error for CODE 128. Trying to encode small letters in CHARSET != B',0), +1009 => array('Encoding using CODE 93 is not yet supported.',0), +1010 => array('Encoding using POSTNET is not yet supported.',0), +1011 => array('Non supported barcode backend for type %s',1), + +/* +** PDF417 +*/ +26000 => array('PDF417: The PDF417 module requires that the PHP installation must support the function bcmod(). This is normally enabled at compile time. See documentation for more information.',0), +26001 => array('PDF417: Number of Columns must be >= 1 and <= 30',0), +26002 => array('PDF417: Error level must be between 0 and 8',0), +26003 => array('PDF417: Invalid format for input data to encode with PDF417',0), +26004 => array('PDF417: Can\'t encode given data with error level %d and %d columns since it results in too many symbols or more than 90 rows.',2), +26005 => array('PDF417: Can\'t open file "%s" for writing',1), +26006 => array('PDF417: Internal error. Data files for PDF417 cluster %d is corrupted.',1), +26007 => array('PDF417: Internal error. GetPattern: Illegal Code Value = %d (row=%d)',2), +26008 => array('PDF417: Internal error. Mode not found in mode list!! mode=%d',1), +26009 => array('PDF417: Encode error: Illegal character. Can\'t encode character with ASCII code=%d',1), +26010 => array('PDF417: Internal error: No input data in decode.',0), +26011 => array('PDF417: Encoding error. Can\'t use numeric encoding on non-numeric data.',0), +26012 => array('PDF417: Internal error. No input data to decode for Binary compressor.',0), +26013 => array('PDF417: Internal error. Checksum error. Coefficient tables corrupted.',0), +26014 => array('PDF417: Internal error. No data to calculate codewords on.',0), +26015 => array('PDF417: Internal error. State transition table entry 0 is NULL. Entry 1 = (%s)',1), +26016 => array('PDF417: Internal error: Unrecognized state transition mode in decode.',0), + +/* +** jpgraph_contour +*/ + +28001 => array('Third argument to Contour must be an array of colors.',0), +28002 => array('Number of colors must equal the number of isobar lines specified',0), +28003 => array('ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)',1), +28004 => array('ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)',1), +28005 => array('ContourPlot Internal Error: isobarVCrossing: Row index too large (%d)',1), +28006 => array('ContourPlot Internal Error: isobarVCrossing: Col index too large (%d)',1), +28007 => array('ContourPlot interpolation factor is too large (>5)',0), + +/* + * jpgraph_matrix and colormap +*/ +29201 => array('Min range value must be less or equal to max range value for colormaps',0), +29202 => array('The distance between min and max value is too small for numerical precision',0), +29203 => array('Number of color quantification level must be at least %d',1), +29204 => array('Number of colors (%d) is invalid for this colormap. It must be a number that can be written as: %d + k*%d',3), +29205 => array('Colormap specification out of range. Must be an integer in range [0,%d]',1), +29206 => array('Invalid object added to MatrixGraph',0), +29207 => array('Empty input data specified for MatrixPlot',0), +29208 => array('Unknown side specifiction for matrix labels "%s"',1), +29209 => array('CSIM Target matrix must be the same size as the data matrix (csim=%d x %d, data=%d x %d)',4), +29210 => array('CSIM Target for matrix labels does not match the number of labels (csim=%d, labels=%d)',2), + + +/* +* jpgraph_theme +*/ +30001 => array("Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.",2), + +); + +?> diff --git a/includes/jpgraph/src/lang/prod.inc.php b/includes/jpgraph/src/lang/prod.inc.php new file mode 100644 index 0000000..6bda8a8 --- /dev/null +++ b/includes/jpgraph/src/lang/prod.inc.php @@ -0,0 +1,386 @@ +,) +$_jpg_messages = array( + +/* +** Headers already sent error. This is formatted as HTML different since this will be sent back directly as text +*/ +10 => array('
JpGraph Error: +HTTP headers have already been sent.
Caused by output from file %s at line %d.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it\'s image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).

Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".

',2), + + +11 => array(DEFAULT_ERROR_MESSAGE.'11',0), +12 => array(DEFAULT_ERROR_MESSAGE.'12',0), +13 => array(DEFAULT_ERROR_MESSAGE.'13',0), +2001 => array(DEFAULT_ERROR_MESSAGE.'2001',0), +2002 => array(DEFAULT_ERROR_MESSAGE.'2002',0), +2003 => array(DEFAULT_ERROR_MESSAGE.'2003',0), +2004 => array(DEFAULT_ERROR_MESSAGE.'2004',0), +2005 => array(DEFAULT_ERROR_MESSAGE.'2005',0), +2006 => array(DEFAULT_ERROR_MESSAGE.'2006',0), +2007 => array(DEFAULT_ERROR_MESSAGE.'2007',0), +2008 => array(DEFAULT_ERROR_MESSAGE.'2008',0), +2009 => array(DEFAULT_ERROR_MESSAGE.'2009',0), +2010 => array(DEFAULT_ERROR_MESSAGE.'2010',0), +2011 => array(DEFAULT_ERROR_MESSAGE.'2011',0), +2012 => array(DEFAULT_ERROR_MESSAGE.'2012',0), +2013 => array(DEFAULT_ERROR_MESSAGE.'2013',0), +2014 => array(DEFAULT_ERROR_MESSAGE.'2014',0), +3001 => array(DEFAULT_ERROR_MESSAGE.'3001',0), +4002 => array(DEFAULT_ERROR_MESSAGE.'4002',0), +5001 => array(DEFAULT_ERROR_MESSAGE.'5001',0), +5002 => array(DEFAULT_ERROR_MESSAGE.'5002',0), +5003 => array(DEFAULT_ERROR_MESSAGE.'5003',0), +5004 => array(DEFAULT_ERROR_MESSAGE.'5004',0), +6001 => array(DEFAULT_ERROR_MESSAGE.'6001',0), +6002 => array(DEFAULT_ERROR_MESSAGE.'6002',0), +6003 => array(DEFAULT_ERROR_MESSAGE.'6003',0), +6004 => array(DEFAULT_ERROR_MESSAGE.'6004',0), +6005 => array(DEFAULT_ERROR_MESSAGE.'6005',0), +6006 => array(DEFAULT_ERROR_MESSAGE.'6006',0), +6007 => array(DEFAULT_ERROR_MESSAGE.'6007',0), +6008 => array(DEFAULT_ERROR_MESSAGE.'6008',0), +6009 => array(DEFAULT_ERROR_MESSAGE.'6009',0), +6010 => array(DEFAULT_ERROR_MESSAGE.'6010',0), +6011 => array(DEFAULT_ERROR_MESSAGE.'6011',0), +6012 => array(DEFAULT_ERROR_MESSAGE.'6012',0), +6015 => array(DEFAULT_ERROR_MESSAGE.'6015',0), +6016 => array(DEFAULT_ERROR_MESSAGE.'6016',0), +6017 => array(DEFAULT_ERROR_MESSAGE.'6017',0), +6018 => array(DEFAULT_ERROR_MESSAGE.'6018',0), +6019 => array(DEFAULT_ERROR_MESSAGE.'6019',0), +6020 => array(DEFAULT_ERROR_MESSAGE.'6020',0), +6021 => array(DEFAULT_ERROR_MESSAGE.'6021',0), +6022 => array(DEFAULT_ERROR_MESSAGE.'6022',0), +6023 => array(DEFAULT_ERROR_MESSAGE.'6023',0), +6024 => array(DEFAULT_ERROR_MESSAGE.'6024',0), +6025 => array(DEFAULT_ERROR_MESSAGE.'6025',0), +6027 => array(DEFAULT_ERROR_MESSAGE.'6027',0), +6028 => array(DEFAULT_ERROR_MESSAGE.'6028',0), +6029 => array(DEFAULT_ERROR_MESSAGE.'6029',0), +6030 => array(DEFAULT_ERROR_MESSAGE.'6030',0), +6031 => array(DEFAULT_ERROR_MESSAGE.'6031',0), +6032 => array(DEFAULT_ERROR_MESSAGE.'6032',0), +6033 => array(DEFAULT_ERROR_MESSAGE.'6033',0), +7001 => array(DEFAULT_ERROR_MESSAGE.'7001',0), +8001 => array(DEFAULT_ERROR_MESSAGE.'8001',0), +8002 => array(DEFAULT_ERROR_MESSAGE.'8002',0), +8003 => array(DEFAULT_ERROR_MESSAGE.'8003',0), +8004 => array(DEFAULT_ERROR_MESSAGE.'8004',0), +9001 => array(DEFAULT_ERROR_MESSAGE.'9001',0), +10001 => array(DEFAULT_ERROR_MESSAGE.'10001',0), +10002 => array(DEFAULT_ERROR_MESSAGE.'10002',0), +10003 => array(DEFAULT_ERROR_MESSAGE.'10003',0), +11001 => array(DEFAULT_ERROR_MESSAGE.'11001',0), +11002 => array(DEFAULT_ERROR_MESSAGE.'11002',0), +11003 => array(DEFAULT_ERROR_MESSAGE.'11003',0), +11004 => array(DEFAULT_ERROR_MESSAGE.'11004',0), +11005 => array(DEFAULT_ERROR_MESSAGE.'11005',0), +12001 => array(DEFAULT_ERROR_MESSAGE.'12001',0), +12002 => array(DEFAULT_ERROR_MESSAGE.'12002',0), +12003 => array(DEFAULT_ERROR_MESSAGE.'12003',0), +12004 => array(DEFAULT_ERROR_MESSAGE.'12004',0), +12005 => array(DEFAULT_ERROR_MESSAGE.'12005',0), +12006 => array(DEFAULT_ERROR_MESSAGE.'12006',0), +12007 => array(DEFAULT_ERROR_MESSAGE.'12007',0), +12008 => array(DEFAULT_ERROR_MESSAGE.'12008',0), +12009 => array(DEFAULT_ERROR_MESSAGE.'12009',0), +12010 => array(DEFAULT_ERROR_MESSAGE.'12010',0), +12011 => array(DEFAULT_ERROR_MESSAGE.'12011',0), +12012 => array(DEFAULT_ERROR_MESSAGE.'12012',0), +14001 => array(DEFAULT_ERROR_MESSAGE.'14001',0), +14002 => array(DEFAULT_ERROR_MESSAGE.'14002',0), +14003 => array(DEFAULT_ERROR_MESSAGE.'14003',0), +14004 => array(DEFAULT_ERROR_MESSAGE.'14004',0), +14005 => array(DEFAULT_ERROR_MESSAGE.'14005',0), +14006 => array(DEFAULT_ERROR_MESSAGE.'14006',0), +14007 => array(DEFAULT_ERROR_MESSAGE.'14007',0), +15001 => array(DEFAULT_ERROR_MESSAGE.'15001',0), +15002 => array(DEFAULT_ERROR_MESSAGE.'15002',0), +15003 => array(DEFAULT_ERROR_MESSAGE.'15003',0), +15004 => array(DEFAULT_ERROR_MESSAGE.'15004',0), +15005 => array(DEFAULT_ERROR_MESSAGE.'15005',0), +15006 => array(DEFAULT_ERROR_MESSAGE.'15006',0), +15007 => array(DEFAULT_ERROR_MESSAGE.'15007',0), +15008 => array(DEFAULT_ERROR_MESSAGE.'15008',0), +15009 => array(DEFAULT_ERROR_MESSAGE.'15009',0), +15010 => array(DEFAULT_ERROR_MESSAGE.'15010',0), +15011 => array(DEFAULT_ERROR_MESSAGE.'15011',0), +15012 => array(DEFAULT_ERROR_MESSAGE.'15012',0), +16001 => array(DEFAULT_ERROR_MESSAGE.'16001',0), +16002 => array(DEFAULT_ERROR_MESSAGE.'16002',0), +16003 => array(DEFAULT_ERROR_MESSAGE.'16003',0), +16004 => array(DEFAULT_ERROR_MESSAGE.'16004',0), +17001 => array(DEFAULT_ERROR_MESSAGE.'17001',0), +17002 => array(DEFAULT_ERROR_MESSAGE.'17002',0), +17004 => array(DEFAULT_ERROR_MESSAGE.'17004',0), +18001 => array(DEFAULT_ERROR_MESSAGE.'18001',0), +18002 => array(DEFAULT_ERROR_MESSAGE.'18002',0), +18003 => array(DEFAULT_ERROR_MESSAGE.'18003',0), +18004 => array(DEFAULT_ERROR_MESSAGE.'18004',0), +18005 => array(DEFAULT_ERROR_MESSAGE.'18005',0), +18006 => array(DEFAULT_ERROR_MESSAGE.'18006',0), +18007 => array(DEFAULT_ERROR_MESSAGE.'18007',0), +18008 => array(DEFAULT_ERROR_MESSAGE.'18008',0), +19001 => array(DEFAULT_ERROR_MESSAGE.'19001',0), +19002 => array(DEFAULT_ERROR_MESSAGE.'19002',0), +19003 => array(DEFAULT_ERROR_MESSAGE.'19003',0), +20001 => array(DEFAULT_ERROR_MESSAGE.'20001',0), +20002 => array(DEFAULT_ERROR_MESSAGE.'20002',0), +20003 => array(DEFAULT_ERROR_MESSAGE.'20003',0), +21001 => array(DEFAULT_ERROR_MESSAGE.'21001',0), +23001 => array(DEFAULT_ERROR_MESSAGE.'23001',0), +23002 => array(DEFAULT_ERROR_MESSAGE.'23002',0), +23003 => array(DEFAULT_ERROR_MESSAGE.'23003',0), +24001 => array(DEFAULT_ERROR_MESSAGE.'24001',0), +24002 => array(DEFAULT_ERROR_MESSAGE.'24002',0), +24003 => array(DEFAULT_ERROR_MESSAGE.'24003',0), +24004 => array(DEFAULT_ERROR_MESSAGE.'24004',0), +25001 => array(DEFAULT_ERROR_MESSAGE.'25001',0), +25002 => array(DEFAULT_ERROR_MESSAGE.'25002',0), +25003 => array(DEFAULT_ERROR_MESSAGE.'25003',0), +25004 => array(DEFAULT_ERROR_MESSAGE.'25004',0), +25005 => array(DEFAULT_ERROR_MESSAGE.'25005',0), +25006 => array(DEFAULT_ERROR_MESSAGE.'25006',0), +25007 => array(DEFAULT_ERROR_MESSAGE.'25007',0), +25008 => array(DEFAULT_ERROR_MESSAGE.'25008',0), +25009 => array(DEFAULT_ERROR_MESSAGE.'25009',0), +25010 => array(DEFAULT_ERROR_MESSAGE.'25010',0), +25011 => array(DEFAULT_ERROR_MESSAGE.'25011',0), +25012 => array(DEFAULT_ERROR_MESSAGE.'25012',0), +25013 => array(DEFAULT_ERROR_MESSAGE.'25013',0), +25014 => array(DEFAULT_ERROR_MESSAGE.'25014',0), +25015 => array(DEFAULT_ERROR_MESSAGE.'25015',0), +25016 => array(DEFAULT_ERROR_MESSAGE.'25016',0), +25017 => array(DEFAULT_ERROR_MESSAGE.'25017',0), +25018 => array(DEFAULT_ERROR_MESSAGE.'25018',0), +25019 => array(DEFAULT_ERROR_MESSAGE.'25019',0), +25020 => array(DEFAULT_ERROR_MESSAGE.'25020',0), +25021 => array(DEFAULT_ERROR_MESSAGE.'25021',0), +25022 => array(DEFAULT_ERROR_MESSAGE.'25022',0), +25023 => array(DEFAULT_ERROR_MESSAGE.'25023',0), +25024 => array(DEFAULT_ERROR_MESSAGE.'25024',0), +25025 => array(DEFAULT_ERROR_MESSAGE.'25025',0), +25026 => array(DEFAULT_ERROR_MESSAGE.'25026',0), +25027 => array(DEFAULT_ERROR_MESSAGE.'25027',0), +25028 => array(DEFAULT_ERROR_MESSAGE.'25028',0), +25029 => array(DEFAULT_ERROR_MESSAGE.'25029',0), +25030 => array(DEFAULT_ERROR_MESSAGE.'25030',0), +25031 => array(DEFAULT_ERROR_MESSAGE.'25031',0), +25032 => array(DEFAULT_ERROR_MESSAGE.'25032',0), +25033 => array(DEFAULT_ERROR_MESSAGE.'25033',0), +25034 => array(DEFAULT_ERROR_MESSAGE.'25034',0), +25035 => array(DEFAULT_ERROR_MESSAGE.'25035',0), +25036 => array(DEFAULT_ERROR_MESSAGE.'25036',0), +25037 => array(DEFAULT_ERROR_MESSAGE.'25037',0), +25038 => array(DEFAULT_ERROR_MESSAGE.'25038',0), +25039 => array(DEFAULT_ERROR_MESSAGE.'25039',0), +25040 => array(DEFAULT_ERROR_MESSAGE.'25040',0), +25041 => array(DEFAULT_ERROR_MESSAGE.'25041',0), +25042 => array(DEFAULT_ERROR_MESSAGE.'25042',0), +25043 => array(DEFAULT_ERROR_MESSAGE.'25043',0), +25044 => array(DEFAULT_ERROR_MESSAGE.'25044',0), +25045 => array(DEFAULT_ERROR_MESSAGE.'25045',0), +25046 => array(DEFAULT_ERROR_MESSAGE.'25046',0), +25047 => array(DEFAULT_ERROR_MESSAGE.'25047',0), +25048 => array(DEFAULT_ERROR_MESSAGE.'25048',0), +25049 => array(DEFAULT_ERROR_MESSAGE.'25049',0), +25050 => array(DEFAULT_ERROR_MESSAGE.'25050',0), +25051 => array(DEFAULT_ERROR_MESSAGE.'25051',0), +25052 => array(DEFAULT_ERROR_MESSAGE.'25052',0), +25053 => array(DEFAULT_ERROR_MESSAGE.'25053',0), +25054 => array(DEFAULT_ERROR_MESSAGE.'25054',0), +25055 => array(DEFAULT_ERROR_MESSAGE.'25055',0), +25056 => array(DEFAULT_ERROR_MESSAGE.'25056',0), +25057 => array(DEFAULT_ERROR_MESSAGE.'25057',0), +25058 => array(DEFAULT_ERROR_MESSAGE.'25058',0), +25059 => array(DEFAULT_ERROR_MESSAGE.'25059',0), +25060 => array(DEFAULT_ERROR_MESSAGE.'25060',0), +25061 => array(DEFAULT_ERROR_MESSAGE.'25061',0), +25062 => array(DEFAULT_ERROR_MESSAGE.'25062',0), +25063 => array(DEFAULT_ERROR_MESSAGE.'25063',0), +25064 => array(DEFAULT_ERROR_MESSAGE.'25064',0), +25065 => array(DEFAULT_ERROR_MESSAGE.'25065',0), +25066 => array(DEFAULT_ERROR_MESSAGE.'25066',0), +25067 => array(DEFAULT_ERROR_MESSAGE.'25067',0), +25068 => array(DEFAULT_ERROR_MESSAGE.'25068',0), +25069 => array(DEFAULT_ERROR_MESSAGE.'25069',0), +25070 => array(DEFAULT_ERROR_MESSAGE.'25070',0), +25071 => array(DEFAULT_ERROR_MESSAGE.'25071',0), +25072 => array(DEFAULT_ERROR_MESSAGE.'25072',0), +25073 => array(DEFAULT_ERROR_MESSAGE.'25073',0), +25074 => array(DEFAULT_ERROR_MESSAGE.'25074',0), +25075 => array(DEFAULT_ERROR_MESSAGE.'25075',0), +25077 => array(DEFAULT_ERROR_MESSAGE.'25077',0), +25078 => array(DEFAULT_ERROR_MESSAGE.'25078',0), +25079 => array(DEFAULT_ERROR_MESSAGE.'25079',0), +25080 => array(DEFAULT_ERROR_MESSAGE.'25080',0), +25081 => array(DEFAULT_ERROR_MESSAGE.'25081',0), +25082 => array(DEFAULT_ERROR_MESSAGE.'25082',0), +25083 => array(DEFAULT_ERROR_MESSAGE.'25083',0), +25084 => array(DEFAULT_ERROR_MESSAGE.'25084',0), +25085 => array(DEFAULT_ERROR_MESSAGE.'25085',0), +25086 => array(DEFAULT_ERROR_MESSAGE.'25086',0), +25087 => array(DEFAULT_ERROR_MESSAGE.'25087',0), +25088 => array(DEFAULT_ERROR_MESSAGE.'25088',0), +25089 => array(DEFAULT_ERROR_MESSAGE.'25089',0), +25090 => array(DEFAULT_ERROR_MESSAGE.'25090',0), +25091 => array(DEFAULT_ERROR_MESSAGE.'25091',0), +25092 => array(DEFAULT_ERROR_MESSAGE.'25092',0), +25093 => array(DEFAULT_ERROR_MESSAGE.'25093',0), +25094 => array(DEFAULT_ERROR_MESSAGE.'25094',0), +25095 => array(DEFAULT_ERROR_MESSAGE.'25095',0), +25096 => array(DEFAULT_ERROR_MESSAGE.'25096',0), +25097 => array(DEFAULT_ERROR_MESSAGE.'25097',0), +25098 => array(DEFAULT_ERROR_MESSAGE.'25098',0), +25099 => array(DEFAULT_ERROR_MESSAGE.'25099',0), +25100 => array(DEFAULT_ERROR_MESSAGE.'25100',0), +25101 => array(DEFAULT_ERROR_MESSAGE.'25101',0), +25102 => array(DEFAULT_ERROR_MESSAGE.'25102',0), +25103 => array(DEFAULT_ERROR_MESSAGE.'25103',0), +25104 => array(DEFAULT_ERROR_MESSAGE.'25104',0), +25105 => array(DEFAULT_ERROR_MESSAGE.'25105',0), +25106 => array(DEFAULT_ERROR_MESSAGE.'25106',0), +25107 => array(DEFAULT_ERROR_MESSAGE.'25107',0), +25108 => array(DEFAULT_ERROR_MESSAGE.'25108',0), +25109 => array(DEFAULT_ERROR_MESSAGE.'25109',0), +25110 => array(DEFAULT_ERROR_MESSAGE.'25110',0), +25111 => array(DEFAULT_ERROR_MESSAGE.'25111',0), +25112 => array(DEFAULT_ERROR_MESSAGE.'25112',0), +25113 => array(DEFAULT_ERROR_MESSAGE.'25113',0), +25114 => array(DEFAULT_ERROR_MESSAGE.'25114',0), +25115 => array(DEFAULT_ERROR_MESSAGE.'25115',0), +25116 => array(DEFAULT_ERROR_MESSAGE.'25116',0), +25117 => array(DEFAULT_ERROR_MESSAGE.'25117',0), +25118 => array(DEFAULT_ERROR_MESSAGE.'25118',0), +25119 => array(DEFAULT_ERROR_MESSAGE.'25119',0), +25120 => array(DEFAULT_ERROR_MESSAGE.'25120',0), +25121 => array(DEFAULT_ERROR_MESSAGE.'25121',0), +25122 => array(DEFAULT_ERROR_MESSAGE.'25122',0), +25123 => array(DEFAULT_ERROR_MESSAGE.'25123',0), +25124 => array(DEFAULT_ERROR_MESSAGE.'25124',0), +25125 => array(DEFAULT_ERROR_MESSAGE.'25125',0), +25126 => array(DEFAULT_ERROR_MESSAGE.'25126',0), +25127 => array(DEFAULT_ERROR_MESSAGE.'25127',0), +25128 => array(DEFAULT_ERROR_MESSAGE.'25128',0), +25129 => array(DEFAULT_ERROR_MESSAGE.'25129',0), +25130 => array(DEFAULT_ERROR_MESSAGE.'25130',0), +25131 => array(DEFAULT_ERROR_MESSAGE.'25131',0), +25132 => array(DEFAULT_ERROR_MESSAGE.'25132',0), +25133 => array(DEFAULT_ERROR_MESSAGE.'25133',0), +25500 => array(DEFAULT_ERROR_MESSAGE.'25500',0), +24003 => array(DEFAULT_ERROR_MESSAGE.'24003',0), +24004 => array(DEFAULT_ERROR_MESSAGE.'24004',0), +24005 => array(DEFAULT_ERROR_MESSAGE.'24005',0), +24006 => array(DEFAULT_ERROR_MESSAGE.'24006',0), +24007 => array(DEFAULT_ERROR_MESSAGE.'24007',0), +24008 => array(DEFAULT_ERROR_MESSAGE.'24008',0), +24009 => array(DEFAULT_ERROR_MESSAGE.'24009',0), +24010 => array(DEFAULT_ERROR_MESSAGE.'24010',0), +24011 => array(DEFAULT_ERROR_MESSAGE.'24011',0), +24012 => array(DEFAULT_ERROR_MESSAGE.'24012',0), +24013 => array(DEFAULT_ERROR_MESSAGE.'24013',0), +24014 => array(DEFAULT_ERROR_MESSAGE.'24014',0), +24015 => array(DEFAULT_ERROR_MESSAGE.'24015',0), +22001 => array(DEFAULT_ERROR_MESSAGE.'22001',0), +22002 => array(DEFAULT_ERROR_MESSAGE.'22002',0), +22004 => array(DEFAULT_ERROR_MESSAGE.'22004',0), +22005 => array(DEFAULT_ERROR_MESSAGE.'22005',0), +22006 => array(DEFAULT_ERROR_MESSAGE.'22006',0), +22007 => array(DEFAULT_ERROR_MESSAGE.'22007',0), +22008 => array(DEFAULT_ERROR_MESSAGE.'22008',0), +22009 => array(DEFAULT_ERROR_MESSAGE.'22009',0), +22010 => array(DEFAULT_ERROR_MESSAGE.'22010',0), +22011 => array(DEFAULT_ERROR_MESSAGE.'22011',0), +22012 => array(DEFAULT_ERROR_MESSAGE.'22012',0), +22013 => array(DEFAULT_ERROR_MESSAGE.'22013',0), +22014 => array(DEFAULT_ERROR_MESSAGE.'22014',0), +22015 => array(DEFAULT_ERROR_MESSAGE.'22015',0), +22016 => array(DEFAULT_ERROR_MESSAGE.'22016',0), +22017 => array(DEFAULT_ERROR_MESSAGE.'22017',0), +22018 => array(DEFAULT_ERROR_MESSAGE.'22018',0), +22019 => array(DEFAULT_ERROR_MESSAGE.'22019',0), +22020 => array(DEFAULT_ERROR_MESSAGE.'22020',0), +13001 => array(DEFAULT_ERROR_MESSAGE.'13001',0), +13002 => array(DEFAULT_ERROR_MESSAGE.'13002',0), +1001 => array(DEFAULT_ERROR_MESSAGE.'1001',0), +1002 => array(DEFAULT_ERROR_MESSAGE.'1002',0), +1003 => array(DEFAULT_ERROR_MESSAGE.'1003',0), +1004 => array(DEFAULT_ERROR_MESSAGE.'1004',0), +1005 => array(DEFAULT_ERROR_MESSAGE.'1005',0), +1006 => array(DEFAULT_ERROR_MESSAGE.'1006',0), +1007 => array(DEFAULT_ERROR_MESSAGE.'1007',0), +1008 => array(DEFAULT_ERROR_MESSAGE.'1008',0), +1009 => array(DEFAULT_ERROR_MESSAGE.'1009',0), +1010 => array(DEFAULT_ERROR_MESSAGE.'1010',0), +1011 => array(DEFAULT_ERROR_MESSAGE.'1011',0), +26000 => array(DEFAULT_ERROR_MESSAGE.'26000',0), +26001 => array(DEFAULT_ERROR_MESSAGE.'26001',0), +26002 => array(DEFAULT_ERROR_MESSAGE.'26002',0), +26003 => array(DEFAULT_ERROR_MESSAGE.'26003',0), +26004 => array(DEFAULT_ERROR_MESSAGE.'26004',0), +26005 => array(DEFAULT_ERROR_MESSAGE.'26005',0), +26006 => array(DEFAULT_ERROR_MESSAGE.'26006',0), +26007 => array(DEFAULT_ERROR_MESSAGE.'26007',0), +26008 => array(DEFAULT_ERROR_MESSAGE.'26008',0), +26009 => array(DEFAULT_ERROR_MESSAGE.'26009',0), +26010 => array(DEFAULT_ERROR_MESSAGE.'26010',0), +26011 => array(DEFAULT_ERROR_MESSAGE.'26011',0), +26012 => array(DEFAULT_ERROR_MESSAGE.'26012',0), +26013 => array(DEFAULT_ERROR_MESSAGE.'26013',0), +26014 => array(DEFAULT_ERROR_MESSAGE.'26014',0), +26015 => array(DEFAULT_ERROR_MESSAGE.'26015',0), +26016 => array(DEFAULT_ERROR_MESSAGE.'26016',0), + +27001 => array(DEFAULT_ERROR_MESSAGE.'27001',0), +27002 => array(DEFAULT_ERROR_MESSAGE.'27002',0), +27003 => array(DEFAULT_ERROR_MESSAGE.'27003',0), +27004 => array(DEFAULT_ERROR_MESSAGE.'27004',0), +27005 => array(DEFAULT_ERROR_MESSAGE.'27005',0), +27006 => array(DEFAULT_ERROR_MESSAGE.'27006',0), +27007 => array(DEFAULT_ERROR_MESSAGE.'27007',0), +27008 => array(DEFAULT_ERROR_MESSAGE.'27008',0), +27009 => array(DEFAULT_ERROR_MESSAGE.'27009',0), +27010 => array(DEFAULT_ERROR_MESSAGE.'27010',0), +27011 => array(DEFAULT_ERROR_MESSAGE.'27011',0), +27012 => array(DEFAULT_ERROR_MESSAGE.'27012',0), +27013 => array(DEFAULT_ERROR_MESSAGE.'27013',0), +27014 => array(DEFAULT_ERROR_MESSAGE.'27014',0), +27015 => array(DEFAULT_ERROR_MESSAGE.'27015',0), + +28001 => array(DEFAULT_ERROR_MESSAGE.'28001',0), +28002 => array(DEFAULT_ERROR_MESSAGE.'28002',0), +28003 => array(DEFAULT_ERROR_MESSAGE.'28003',0), +28004 => array(DEFAULT_ERROR_MESSAGE.'28004',0), +28005 => array(DEFAULT_ERROR_MESSAGE.'28005',0), +28006 => array(DEFAULT_ERROR_MESSAGE.'28006',0), +28007 => array(DEFAULT_ERROR_MESSAGE.'28007',0), + +29201 => array(DEFAULT_ERROR_MESSAGE.'28001',0), +29202 => array(DEFAULT_ERROR_MESSAGE.'28002',0), +29203 => array(DEFAULT_ERROR_MESSAGE.'28003',0), +29204 => array(DEFAULT_ERROR_MESSAGE.'28004',0), +29205 => array(DEFAULT_ERROR_MESSAGE.'28005',0), +29206 => array(DEFAULT_ERROR_MESSAGE.'28006',0), +29207 => array(DEFAULT_ERROR_MESSAGE.'28007',0), +29208 => array(DEFAULT_ERROR_MESSAGE.'28008',0), +29209 => array(DEFAULT_ERROR_MESSAGE.'28009',0), +29210 => array(DEFAULT_ERROR_MESSAGE.'28010',0), + +); + +?> diff --git a/includes/jpgraph/src/themes/AquaTheme.class.php b/includes/jpgraph/src/themes/AquaTheme.class.php new file mode 100644 index 0000000..751b420 --- /dev/null +++ b/includes/jpgraph/src/themes/AquaTheme.class.php @@ -0,0 +1,202 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.80, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(4); + + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin( + $img->raw_left_margin, + $img->raw_right_margin, + $img->raw_top_margin, + $height * 0.25 + ); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + //$plot->SetShadow(); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + $plot->SetColor($this->GetNextColor()); + $plot->SetWeight(2); +// $plot->SetBarCenter(); + break; + } + + case 'PiePlot': + { + $plot->SetCenter(0.5, 0.45); + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/GreenTheme.class.php b/includes/jpgraph/src/themes/GreenTheme.class.php new file mode 100644 index 0000000..a61fbd8 --- /dev/null +++ b/includes/jpgraph/src/themes/GreenTheme.class.php @@ -0,0 +1,178 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + /* + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + */ + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + + $plot->SetColor($this->GetNextColor().'@0.4'); + $plot->SetWeight(2); + break; + } + + case 'PiePlot': + { + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/OceanTheme.class.php b/includes/jpgraph/src/themes/OceanTheme.class.php new file mode 100644 index 0000000..b275036 --- /dev/null +++ b/includes/jpgraph/src/themes/OceanTheme.class.php @@ -0,0 +1,180 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + /* + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + */ + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + + $plot->SetColor($this->GetNextColor()); + $plot->SetWeight(2); + break; + } + + case 'PiePlot': + { + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/OrangeTheme.class.php b/includes/jpgraph/src/themes/OrangeTheme.class.php new file mode 100644 index 0000000..ea26dad --- /dev/null +++ b/includes/jpgraph/src/themes/OrangeTheme.class.php @@ -0,0 +1,180 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + /* + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + */ + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + + $plot->SetColor($this->GetNextColor().'@0.4'); + $plot->SetWeight(2); + break; + } + + case 'PiePlot': + { + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/PastelTheme.class.php b/includes/jpgraph/src/themes/PastelTheme.class.php new file mode 100644 index 0000000..d3f1ddb --- /dev/null +++ b/includes/jpgraph/src/themes/PastelTheme.class.php @@ -0,0 +1,175 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.80, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(4); + + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + $plot->SetColor($this->GetNextColor().'@0.4'); + $plot->SetWeight(2); +// $plot->SetBarCenter(); + break; + } + + case 'PiePlot': + { + $plot->SetCenter(0.5, 0.45); + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/RoseTheme.class.php b/includes/jpgraph/src/themes/RoseTheme.class.php new file mode 100644 index 0000000..5a14630 --- /dev/null +++ b/includes/jpgraph/src/themes/RoseTheme.class.php @@ -0,0 +1,180 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + /* + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + */ + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + + $plot->SetColor($this->GetNextColor().'@0.4'); + $plot->SetWeight(2); + break; + } + + case 'PiePlot': + { + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/SoftyTheme.class.php b/includes/jpgraph/src/themes/SoftyTheme.class.php new file mode 100644 index 0000000..222cf85 --- /dev/null +++ b/includes/jpgraph/src/themes/SoftyTheme.class.php @@ -0,0 +1,209 @@ +SetFrame(false); + $graph->SetMarginColor('white'); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // y2~ + if (isset($graph->y2axis)) { + $graph->y2axis->title->SetColor($this->font_color); + $graph->y2axis->SetColor($this->axis_color, $this->font_color); + $graph->y2axis->SetTickSide(SIDE_LEFT); + $graph->y2axis->SetLabelMargin(8); + $graph->y2axis->HideLine(); + $graph->y2axis->HideTicks(); + } + + // yn + if (isset($graph->y2axis)) { + foreach ($graph->ynaxis as $axis) { + $axis->title->SetColor($this->font_color); + $axis->SetColor($this->axis_color, $this->font_color); + $axis->SetTickSide(SIDE_LEFT); + $axis->SetLabelMargin(8); + $axis->HideLine(); + $axis->HideTicks(); + } + } + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + $graph->ygrid->SetFill(true, '#FFFFFF', $this->background_color); + $graph->xgrid->Show(); + $graph->xgrid->SetColor($this->grid_color); + $graph->xgrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $img->height * 0.25); +// $graph->SetMargin(200, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + $plot->value->SetAlign('center', 'center'); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + + $plot->SetColor($this->GetNextColor()); + $plot->SetWeight(2); +// $plot->SetBarCenter(); + break; + } + + case 'PiePlot': + { + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + $plot->value->SetAlign('center', 'center'); + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + $_plot->SetValuePos('center'); + } + break; + } + + case 'ScatterPlot': + { + break; + } + + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/UniversalTheme.class.php b/includes/jpgraph/src/themes/UniversalTheme.class.php new file mode 100644 index 0000000..44b57a6 --- /dev/null +++ b/includes/jpgraph/src/themes/UniversalTheme.class.php @@ -0,0 +1,188 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBox(true, '#DADADA'); +// $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + $graph->xaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + //$graph->xaxis->SetLabelMargin(30); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); +// $graph->yaxis->SetTickPositions(array(50, 100, 150)); +// $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetFill(true, '#FFFFFF', $this->background_color); + // $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.80, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(4); + + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin( + $img->raw_left_margin, + $img->raw_right_margin, + $img->raw_top_margin, + $height * 0.25 + ); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + $plot->SetColor($this->GetNextColor().'@0.4'); + $plot->SetWeight(2); + break; + } + + case 'PiePlot': + { + $plot->SetCenter(0.5, 0.45); + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?> diff --git a/includes/jpgraph/src/themes/VividTheme.class.php b/includes/jpgraph/src/themes/VividTheme.class.php new file mode 100644 index 0000000..38a7709 --- /dev/null +++ b/includes/jpgraph/src/themes/VividTheme.class.php @@ -0,0 +1,175 @@ +img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + */ + $graph->SetFrame(false); + $graph->SetMarginColor('white'); + $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); + + // legend + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.85, 'center', 'top'); + $graph->legend->SetFillColor('white'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(3); + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // xaxis + $graph->xaxis->title->SetColor($this->font_color); + $graph->xaxis->SetColor($this->axis_color, $this->font_color); + $graph->xaxis->SetTickSide(SIDE_BOTTOM); + $graph->xaxis->SetLabelMargin(10); + + // yaxis + $graph->yaxis->title->SetColor($this->font_color); + $graph->yaxis->SetColor($this->axis_color, $this->font_color); + $graph->yaxis->SetTickSide(SIDE_LEFT); + $graph->yaxis->SetLabelMargin(8); + $graph->yaxis->HideLine(); + $graph->yaxis->HideTicks(); + $graph->xaxis->SetTitleMargin(15); + + // grid + $graph->ygrid->SetColor($this->grid_color); + $graph->ygrid->SetLineStyle('dotted'); + + + // font + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + +// $graph->img->SetAntiAliasing(); + } + + + function SetupPieGraph($graph) { + + // graph + $graph->SetFrame(false); + + // legend + $graph->legend->SetFillColor('white'); + + $graph->legend->SetFrameWeight(0); + $graph->legend->Pos(0.5, 0.80, 'center', 'top'); + $graph->legend->SetLayout(LEGEND_HOR); + $graph->legend->SetColumns(4); + + $graph->legend->SetShadow(false); + $graph->legend->SetMarkAbsSize(5); + + // title + $graph->title->SetColor($this->font_color); + $graph->subtitle->SetColor($this->font_color); + $graph->subsubtitle->SetColor($this->font_color); + + $graph->SetAntiAliasing(); + } + + + function PreStrokeApply($graph) { + if ($graph->legend->HasItems()) { + $img = $graph->img; + $height = $img->height; + $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); + } + } + + function ApplyPlot($plot) { + + switch (get_class($plot)) + { + case 'GroupBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'AccBarPlot': + { + foreach ($plot->plots as $_plot) { + $this->ApplyPlot($_plot); + } + break; + } + + case 'BarPlot': + { + $plot->Clear(); + + $color = $this->GetNextColor(); + $plot->SetColor($color); + $plot->SetFillColor($color); + $plot->SetShadow('red', 3, 4, false); + break; + } + + case 'LinePlot': + { + $plot->Clear(); + $plot->SetColor($this->GetNextColor().'@0.4'); + $plot->SetWeight(2); +// $plot->SetBarCenter(); + break; + } + + case 'PiePlot': + { + $plot->SetCenter(0.5, 0.45); + $plot->ShowBorder(false); + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + case 'PiePlot3D': + { + $plot->SetSliceColors($this->GetThemeColors()); + break; + } + + default: + { + } + } + } +} + + +?>