pringgojs/livewire-charts

Livewire 图表组件

v1.0.0 2024-09-11 07:06 UTC

This package is not auto-updated.

Last update: 2024-09-26 05:35:55 UTC


README

Apexchart livewire 组件

以下是一个如何在视图中使用它的示例

$legend = ['Category A', 'Category B', 'Category C', 'Category D'];
$series = [
    [
        'name' => 'Series 1',
        'data' => [10, 20, 15, 25],
    ],
    [
        'name' => 'Series 2',
        'data' => [12, 18, 22, 30],
    ],
];
<livewire:bar-chart-component :series="$series" :categories="$legend" :$title  />

安装

您可以通过 composer 安装此包

composer require pringgojs/livewire-charts

更新数据图表

以下是一个示例

use Pringgojs\LivewireCharts\BarChartComponent;

function updateChart() {
    ...
    $this->dispatch('updateChart', $categories, $series)->to(BarChartComponent::class);
}