Skip to content
alkemann edited this page Sep 13, 2010 · 1 revision

FlashChartHelper documentation

Introduction

The sole purpose of this helper is to integrate OpenFlashChart2 with cake in an easy to use way. It is based on the work of Joaquin Windmuller and hist article on the bakery . It also replaces the behavior made by the same authors as this helper, ChartableBehavior.

Working chart and graph types

  • Line, Line Dot, Line Hollow,
  • Bar, Bar Filled, Bar Glass, Bar 3D, Bar Sketch, Bar Stack
  • Area Line, Area Hollow,
  • Pie Chart
  • Scatter, Scatter Line
  • Radar Line, Radar Area (called radar and radar_filled)

(Horizontal Bar is not yet implemented)

Install instructions

Make sure you have these folders and files in the correct locations:

  • /app/views/helpers/flash_chart.php
  • /app/views/helpers/flash.php
  • /app/vendors/flashchart/open-flash-chart.php
  • /app/vendors/flashchart/37 other files at the time of this writing
  • /app/webroot/flash/open-flash-chart.swf
  • /app/webroot/js/swfobject.js
  • /app/webroot/js/json/json2.js (not used if you use prototype)

Add the helper to your controllers “helpers” property:
var $helpers = array('Html','FlashChart');
If you’re allready using prototype in your application, make sure you tell the helper this through the begin call:
echo $flashChart->begin(array('prototype'=>true));

API

For the most updated API, check the file. Online version may be found [FlashChartHelperApi here] and on the [http://bakery.cakephp.org cake bakery].

Examples

  • [ExampleMinimum Minimum usage. You will always need at least this.]
  • [Example2Datasets Minimum with 2 datasets.]
  • [ExampleCharts Minimum with 2 seperate charts.]
  • [ExampleCustomize Customizing your chart and setting labels.]
  • [Example4 Charting non-numeric data and labels on y-axis.]
  • [ExampleScatter Scatter and loading message.]
  • [ExampleRadar Radar]
  • [ExampleStacked Stacked Bars, prototype, multiple charts and dom id]