PHP library to draw Column, Bar, Line and Pie Charts

3.0.2 2017-03-05 23:37 UTC

This package is auto-updated.

Last update: 2020-05-09 22:43:50 UTC


Phpopenchart was based on Libchart and allows you to create charts using PHP. It's specially useful when you need to create charts on the server-side and so you can't use a front-end library such as Highcharts.


use Phpopenchart\Chart\Column;

$chart = new Column([
    'chart' => [
        'width' => 1000,
        'height' => 300,
    'title' => [
        'text' => 'Values'
    'dataset' => [
        'series' => ['Product A', 'Product B', 'Product C'],
        'labels' => ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
        'data' => [
            [3296, 4852, 2010, 6004, 5014, 7695],
            [2036, 1816, 687, 1025, 3074, 3651],
            [123, 984, 102, 707, 853, 696],


Documentation & examples

There's an extensive documentation here with all the available options, methods and datasets.

If you're looking for examples check the examples page for all the available options or the /tests/actual.


Require the package in your composer.json file and update composer, using the following data:

"luismarto/phpopenchart": "3.*"


In a forseable future

  • Improve demo/examples section (display comparison between libchart and phpopenchart)
  • Make this easily integrated with Laravel


This library is is based on the original work of Jean-Marc Trémeaux (check the original website). Also used the fork from Alexander Stehlik.

Phpopenchart is distributed under the terms of the GNU GPL v3. This includes everything in the source code distribution except where otherwise stated.

Third Party Content

The following third party software is distributed with Phpopenchart and is provided under other licenses and/or has source available from other locations.

Files in the fonts directory are distributed under their own licence, which is located under the fonts directory.