Javascript charts for Jaxon with the Flot library

v3.1.0 2019-12-07 11:00 UTC

This package is auto-updated.

Last update: 2022-04-21 21:35:56 UTC


Javascript charts for Jaxon with the Flot library. http://www.flotcharts.org


Install this package with Composer.

"require": {
    "jaxon-php/jaxon-flot": "~1.0"


Create a new plot to be displayed in a div with a given id, eg. "flot-container".

    $plot = $response->flot->plot('#flot-container');

Add a graph in the plot, and set its parameters.

    $graph = $plot->graph(['label' => 'Plot example', 'lines' => ['show' => true]]);

The options are defined in the API docs.

Set the graph data using an array of points.

    $graph->series()->points([[0, 3], [4, 8], [8, 5], [9, 13]]);

Or a javascript expression.

    $graph->series()->expr(0, 14, 0.5, 'Math.sqrt(x * 10)');

Optionally, set the xaxis labels.

    $ticks = [];
    for($i = 0; $i < 10; $i++) $ticks[] = [$i, 'Pt' . $i];

Optionally, set the dimensions of the plot. If the dimensions are not set here, make sure they are in HTML or CSS code. The Flot library requires the container to have width and height set.


Finally, draw the graph.


You can add as many graphs as you need in a single plot, and you can draw many plots in a single page.


  • Issue Tracker: github.com/jaxon-php/jaxon-flot/issues
  • Source Code: github.com/jaxon-php/jaxon-flot


The project is licensed under the BSD license.