A simple chart generation and manipulation library

dev-master 2020-08-07 20:13 UTC

This package is auto-updated.

Last update: 2024-12-08 14:58:27 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

A very simple PHP library to create static charts.

Install

Via Composer

$ composer require carlosafonso/plotta

Usage

$builder = new PlotBuilder();
$builder
    ->withDimensions(500, 250)
    ->withTitle('Average monthly temperature in Madrid, Spain')
    ->withXAxis(new XAxisConfig('Month of year', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']))
    ->withYAxis(new YAxisConfig('Degrees Celsius'))
    ->withData([10,12,16,18,22,28,32,31,26,19,13,10])
    ->withData([3,4,6,8,11,16,19,19,15,11,6,4])
    ->render('/path/to/chart.png');

This will produce a chart like the following one:

sample_chart.png

Security

If you discover any security related issues, please email the author instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.