Skip to content

Jason Roman's PHP Flot class for converting PHP arrays to Flot JSON format

License

Notifications You must be signed in to change notification settings

jasonroman/flot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jason Roman's PHP Flot Class

Build Status

This is a class that transforms PHP arrays of series data into a JSON format that Flot can understand. It supports line/bar charts, pie charts, horizontal/vertical orientation, and time series data. It also supports single or multiple series.

To load as a service in a Symfony bundle, see my jasonroman/flot-bundle package.

Usage

// convert to Flot JSON data from PHP arrays
use JasonRoman\Flot\Flot;

$flot = new Flot;

$flotData = $flot->convert($data);
$flotData = $flot->convert($data, 'horizontal');
$flotData = $flot->convert($data, 'vertical', $datetime = true);
$flotData = $flot->convert($pieData);

See the comments in the class for more examples of the various forms of array $data that can be passed to the convert() function.

About

Jason Roman's PHP Flot class for converting PHP arrays to Flot JSON format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages