JpGraph Manual

Version : 3.5.0b1

Asial Corporation

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 Tables

1.1. Feature matrix for JpGraph library
1.2. External JpGraph tutorial
3.1. Latin TTF font file names
8.1. Supported Font Styles
8.2. Supported Latin Font family specifiers
8.3. Supported character entities in class SymChar
8.4. Japanese encoding options
8.5. Cyrillic encoding options
8.6. Greek encoding options
10.1. CSIM Examples (in Examples/ directory)
14.1. Axis configurations
16.1. Gantt bar patterns
19.1. Table API Overview
20.1. Available arrow size
21.1. Default windrose buckets
25.1. Available error levels
25.2. Recommended error levels
26.1. Datamatrix encodation efficiency
26.2. Maximum data capacity for the different symbol sizes in ECC-200 Data Matrix subset.
26.3. Datamatrix error messages
26.4. Datamatrix encodation schemas
26.5. Tilde processing translating
27.1. QR Data capacity
27.2. Maximum data capacity for the different symbol sizes in the QR-code.
27.3. QR Error correction levels
27.4. QR Error messages
D.1. Named color list
E.1. Built in line based plot marks
F.1. List of all country flags sorted by country name
G.1. List of files included in the library
G.2. List of subdirectories in main src directory
H.1. English error messages
H.2. English error messages
H.3. English error messages

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)