Tag Archives: programming tips

phpChart Online Documentation

Online Documentation

 
phpChart does NOT required GD or any other third party, server-side graph library or extension. It is strongly recommended to read the Programming Quick Tips first before proceeding to the below online documentation.

online technical documentation

Programming Quick Tips

 

  • It is strongly recommended to leave doctype declaration <!DOCTYPE HTML> right before tag <HTML> to force browser into HTML5 Standards mode.
  • Each PHP chart must have an unique id associating to corresponding DIV as the draw area. It’s set as the 2nd parameter in phpChart constructor.
  • Look and feel, and most of the cosmetics can also be controlled using CSS .e.g .jqplot-point-label
  • Most of functions parameters are PHP array.
  • Except numbers, all properites should be surrounded by double or single quotes.
  • Plugins without “Renderer” suffix in their names should be loaded using add_plugins() method. e.g. add_plugins(array(“highlighter”, “cursor”));
  • Different renderer has different renderer options(rendererOptions). Each plugin may add its own set of rendererOptions attributes.
  • phpChart automatically includes any required plugin files only once on a single page regardless how many times it is used. This prevents javascript conflicts.
  • When loading renderer, use plugin:: prefix to indicate a plugin used.
  • Custom javascript:
    • When passing user defined custom javascript function to phpChart, use js:: prefix.
    • Custom js should be added before ending <body> tag between <script> tags; or can be added through phpChart add_custom_js() method(less convenient).
    • All js files should be named in lower case so they works on both *nix and Windows system
  • The default label renderer creates labels in DIV tags, which allows full CSS control over every label.
  • Use CanvasTextRenderers to replace the default label renderer to draw labels onto canvas elements to support advanced featrues such as rotated text. However, it loses CSS support.
  • Tick options(tickOptions) are only used by Axes object. A tick represents a data point.
  • Some renderer are designed to represent 3D dimensional data such as Bubble Chart.
  • for Date Axes render plugin, it’s recommended to specify both date and time.
  • Cursor plugin also enables plot zooming functionality
  • Built-in data renderer(dataRenderer) allows data from external JSON source such as retrieving from a external URL through AJAX.
  • Some plugins can trigger events using bind_js() function. e.g. http://www.jqplot.com/docs/files/plugins/jqplot-donutRenderer-js.html
    • jqplotDataMouseOver – triggered when user mouseing over a slice.
    • jqplotDataHighlight – triggered the first time user mouses over a slice, if highlighting is enabled.
    • jqplotDataUnhighlight – triggered when a user moves the mouse out of a highlighted slice.
    • jqplotDataClick – triggered when the user clicks on a slice.
    • jqplotDataRightClick – tiggered when the user right clicks on a slice if the “captureRightClick” option is set to true on the plot.
  • canvasTextRenderer is the only renderer that has no renderer options but ends with ‘Renderer’ suffix

Top

Clicky