2020-10-19 09:24:57 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:55:45 -05:00
2020-10-19 09:24:57 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-18 23:54:30 -05:00
2020-10-19 00:05:19 -05:00
2020-10-19 09:24:57 -05:00

Livewire Charts

Neat Livewire Charts for your Laravel projects.

Preview

preview

Installation

You can install the package via composer:

composer require asantibanez/livewire-charts

Requirements

This package requires the following packages/libraries to work:

Please follow each package/library instructions on how to set them properly in your project.

NOTE: At the moment, Apex Charts is only supported for drawing charts.

Usage

Livewire Charts supports out of the box the following types of charts

  • Line Chart (LivewireLineChart component)
  • Pie Chart (LivewirePieChart component)
  • Column Chart (LivewireColumnChart component)

Each one comes with its own "model" class that allows you to define the chart's data and render behavior.

  • LivewireLineChart uses LineChartModel to set up data points, markers, events and other ui customizations.
  • LivewirePieChart uses PieChartModel to set up data slices, events and other ui customizations.
  • LivewireColumnChart uses ColumnChartModel to set up data columns, events and other ui customizations.

For example, to render a column chart, we can create an instance of ColumnChartModel and add some data to it

$columnChartModel = 
    (new ColumnChartModel())
        ->setTitle('Expenses by Type')
        ->addColumn('Food', 100, '#f6ad55')
        ->addColumn('Shopping', 200, '#fc8181')
        ->addColumn('Travel', 300, '#90cdf4')
    ;

With $columnChartModel at hand, we pass it to our LivewireColumnChart component in our Blade template.

<livewire:livewire-column-chart
    :column-chart-model="$columnChartModel"
/>

And that's it! You have a beautiful rendered chart in seconds. 👌

column chart example

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email santibanez.andres@gmail.com instead of using the issue tracker.

Credits

License

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

Description
Neat Livewire Charts for your Laravel projects
Readme 4.1 MiB
Languages
PHP 60.3%
JavaScript 37.8%
Blade 1.9%