📜  LarapexChart (1)

📅  最后修改于: 2023-12-03 14:43:43.927000             🧑  作者: Mango

LarapexChart

LarapexChart is a powerful charting library for Laravel, based on the popular ApexCharts.js. It provides developers with an easy-to-use interface for creating beautiful and interactive charts in their Laravel applications.

Features
  • Wide range of chart types, including line, area, bar, column, pie, donut, radial bar, scatter, bubble, heatmap, and more.
  • Interactive and responsive charts that adapt to different screen sizes and devices.
  • Customizable chart options and configurations, such as data labels, tooltips, legends, colors, and animations.
  • Support for multiple series and multiple axes in a single chart.
  • Ability to load data from various sources, including arrays, databases, and APIs.
  • Integration with Laravel's authentication system for secure and personalized chart rendering.
  • Seamless integration with Laravel Blade templates for easy chart display.
  • Efficient data handling and processing, with support for large data sets.
Installation

To install LarapexChart in your Laravel project, you can use composer:

composer require khill/larapex-charts

After the installation, you need to publish the configuration file:

php artisan vendor:publish --tag=larapex-charts_config

This will create a larapex-charts.php file in the config directory of your Laravel application.

Usage

To start using LarapexChart, you can create a new chart instance in your controller or view:

use Khill\LarapexCharts\LarapexChart;

$chart = new LarapexChart();

Next, you can set the chart type, series data, and other options according to your needs:

$chart->setType('line')
    ->setXAxis(['Jan', 'Feb', 'Mar', 'Apr', 'May'])
    ->setSeries([
        ['name' => 'Sales', 'data' => [30, 40, 35, 50, 49]],
        ['name' => 'Expenses', 'data' => [25, 20, 30, 35, 40]],
    ])
    ->setColors(['#0084ff', '#f76304'])
    ->setTitle('Monthly Sales')
    ->setSubtitle('2021')
    ->setHeight(400);

Finally, you can render the chart in your Blade template using the renders() method:

{!! $chart->render() !!}
Documentation

For detailed documentation and examples, please visit the official LarapexChart GitHub repository.

Conclusion

LarapexChart provides Laravel developers with a simple yet powerful way to create stunning charts in their applications. With its rich features and seamless integration, it is a must-have tool for visualizing data and making insights. Give LarapexChart a try and take your charts to the next level!