定制 mrshanebarron/chart 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mrshanebarron/chart

Composer 安装命令:

composer require mrshanebarron/chart

包简介

Charting component for Laravel - supports Livewire and Vue with Chart.js

README 文档

README

A chart visualization component for Laravel applications. Supports line, bar, pie, and other chart types. Works with Livewire and Vue 3.

Installation

composer require mrshanebarron/chart

Livewire Usage

Line Chart

<livewire:sb-chart
    type="line"
    :data="[10, 20, 15, 30, 25, 40]"
    :labels="['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']"
/>

Bar Chart

<livewire:sb-chart
    type="bar"
    :data="$salesData"
    :labels="$months"
    title="Monthly Sales"
/>

Pie Chart

<livewire:sb-chart
    type="pie"
    :data="[30, 25, 20, 15, 10]"
    :labels="['Category A', 'B', 'C', 'D', 'E']"
/>

Livewire Props

Prop Type Default Description
type string 'line' Chart type
data array required Data points
labels array [] X-axis labels
title string null Chart title
height number 300 Chart height (px)
colors array defaults Data colors

Vue 3 Usage

Setup

import { SbChart } from './vendor/sb-chart';
app.component('SbChart', SbChart);

Line Chart

<template>
  <SbChart
    type="line"
    :data="data"
    :labels="labels"
  />
</template>

<script setup>
const data = [10, 20, 15, 30, 25, 40, 35];
const labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
</script>

Bar Chart

<template>
  <SbChart
    type="bar"
    :data="salesData"
    :labels="months"
    title="Monthly Revenue"
  />
</template>

<script setup>
const salesData = [12000, 19000, 15000, 22000, 18000, 25000];
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'];
</script>

Pie Chart

<template>
  <SbChart
    type="pie"
    :data="distribution"
    :labels="categories"
  />
</template>

<script setup>
const distribution = [35, 25, 20, 15, 5];
const categories = ['Direct', 'Organic', 'Social', 'Referral', 'Other'];
</script>

Multiple Datasets

<template>
  <SbChart
    type="line"
    :datasets="[
      { label: '2023', data: [10, 20, 30, 40] },
      { label: '2024', data: [15, 25, 35, 45] }
    ]"
    :labels="['Q1', 'Q2', 'Q3', 'Q4']"
  />
</template>

Custom Colors

<template>
  <SbChart
    type="bar"
    :data="data"
    :labels="labels"
    :colors="['#3B82F6', '#10B981', '#F59E0B', '#EF4444']"
  />
</template>

Vue Props

Prop Type Default Description
type String 'line' line, bar, pie, doughnut, area
data Array - Single dataset data
datasets Array - Multiple datasets
labels Array [] Axis labels
title String null Chart title
height Number 300 Height in pixels
colors Array Default palette Data colors
showLegend Boolean true Display legend
showGrid Boolean true Display grid lines

Chart Types

Type Description
line Line chart with points
bar Vertical bar chart
pie Pie chart
doughnut Donut chart
area Filled area chart

Features

  • Multiple Types: Line, bar, pie, etc.
  • Responsive: Adapts to container
  • Tooltips: Hover for values
  • Legend: Optional legend display
  • Animations: Smooth transitions

Requirements

  • PHP 8.1+
  • Laravel 10, 11, or 12
  • Tailwind CSS 3.x

License

MIT License

mrshanebarron/chart 适用场景与选型建议

mrshanebarron/chart 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mrshanebarron/chart 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mrshanebarron/chart 我们能提供哪些服务?
定制开发 / 二次开发

基于 mrshanebarron/chart 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-14