Token导航 LogoToken导航

Agent Skill · 前端设计

charts(charts 前端)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

charts 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,985。

总安装 188周安装 8GitHub Stars 11下载 66核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:charts(charts 前端)
来源仓库:https://github.com/lobbi-docs/claude
仓库路径:skills/charts
安装命令:
npx skills add https://github.com/lobbi-docs/claude --skill charts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lobbi-docs/claude --skill charts

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。适合提炼结构、补齐章节、统一术语或检查链接,提升内容可读性。使用时保留项目已有事实和命令,避免将未确认信息写成确定结论。涉及对外文案时需控制语气,防止过度营销或夸大能力。安装方式:通过 npx 从 GitHub 仓库添加技能。

来源仓库内路径:skills/charts

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/lobbi-docs/claude --skill charts;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

charts 怎么安装?

在终端执行 npx skills add https://github.com/lobbi-docs/claude --skill charts。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

charts 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

charts 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

charts 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

charts 用的人多吗?

公开数据是累计安装 188 次,近一周安装 8 次,下载 66 次,GitHub 11 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

charts 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
charts

charts 前端 · 本页

18811需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

MUI X Charts

Package

npm install @mui/x-charts
# Free, MIT license — all chart types included

All charts are available in the free Community tier.


Basic Charts

BarChart

import { BarChart } from '@mui/x-charts/BarChart';

const data = [
  { month: 'Jan', revenue: 4000, expenses: 2400 },
  { month: 'Feb', revenue: 3000, expenses: 1398 },
  { month: 'Mar', revenue: 2000, expenses: 9800 },
  { month: 'Apr', revenue: 2780, expenses: 3908 },
];

<BarChart
  dataset={data}
  xAxis={[{ scaleType: 'band', dataKey: 'month' }]}
  series={[
    { dataKey: 'revenue', label: 'Revenue', color: '#2563eb' },
    { dataKey: 'expenses', label: 'Expenses', color: '#dc2626' },
  ]}
  width={600}
  height={400}
/>

Horizontal Bar Chart

<BarChart
  dataset={data}
  yAxis={[{ scaleType: 'band', dataKey: 'month' }]}
  series={[{ dataKey: 'revenue', label: 'Revenue' }]}
  layout="horizontal"
  width={600}
  height={400}
/>

LineChart

import { LineChart } from '@mui/x-charts/LineChart';

<LineChart
  xAxis={[{
    scaleType: 'time',
    data: [new Date(2024, 0), new Date(2024, 1), new Date(2024, 2), new Date(2024, 3)],
    valueFormatter: (date: Date) => date.toLocaleDateString('en-US', { month: 'short' }),
  }]}
  series={[
    {
      data: [2400, 1398, 9800, 3908],
      label: 'Revenue',
      area: true,              // fill area under line
      curve: 'catmullRom',     // 'linear' | 'monotoneX' | 'catmullRom' | 'step'
      showMark: true,
    },
  ]}
  width={600}
  height={400}
/>

PieChart

import { PieChart } from '@mui/x-charts/PieChart';

<PieChart
  series={[{
    data: [
      { id: 0, value: 10, label: 'Series A', color: '#2563eb' },
      { id: 1, value: 15, label: 'Series B', color: '#7c3aed' },
      { id: 2, value: 20, label: 'Series C', color: '#16a34a' },
    ],
    innerRadius: 30,          // donut chart when > 0
    outerRadius: 100,
    paddingAngle: 2,
    cornerRadius: 5,
    startAngle: -90,
    endAngle: 270,
    cx: 150,
    cy: 150,
    highlightScope: { faded: 'global', highlighted: 'item' },
    faded: { innerRadius: 30, additionalRadius: -30, color: 'gray' },
  }]}
  width={400}
  height={300}
/>

ScatterChart

import { ScatterChart } from '@mui/x-charts/ScatterChart';

<ScatterChart
  series={[{
    label: 'Height vs Weight',
    data: [
      { x: 170, y: 70, id: 'p1' },
      { x: 175, y: 85, id: 'p2' },
      { x: 160, y: 60, id: 'p3' },
      { x: 180, y: 90, id: 'p4' },
    ],
  }]}
  xAxis={[{ label: 'Height (cm)' }]}
  yAxis={[{ label: 'Weight (kg)' }]}
  width={500}
  height={400}
/>

Composition API

Build charts from primitives for maximum control. Mix chart types in one view.

import {
  ResponsiveChartContainer,
  BarPlot,
  LinePlot,
  ChartsXAxis,
  ChartsYAxis,
  ChartsTooltip,
  ChartsAxisHighlight,
  ChartsLegend,
  ChartsGrid,
  MarkPlot,
} from '@mui/x-charts';

// Mixed bar + line chart with dual Y-axis
<ResponsiveChartContainer
  series={[
    { type: 'bar', data: [10, 20, 15, 25], label: 'Revenue ($K)', yAxisId: 'leftAxis' },
    { type: 'line', data: [5, 15, 10, 20], label: 'Growth (%)', yAxisId: 'rightAxis' },
  ]}
  xAxis={[{
    id: 'x-axis',
    data: ['Q1', 'Q2', 'Q3', 'Q4'],
    scaleType: 'band',
  }]}
  yAxis={[
    { id: 'leftAxis', label: 'Revenue ($K)' },
    { id: 'rightAxis', label: 'Growth (%)', position: 'right' },
  ]}
  height={400}
>
  <ChartsGrid horizontal />
  <BarPlot />
  <LinePlot />
  <MarkPlot />
  <ChartsXAxis axisId="x-axis" />
  <ChartsYAxis axisId="leftAxis" />
  <ChartsYAxis axisId="rightAxis" position="right" />
  <ChartsTooltip trigger="axis" />
  <ChartsAxisHighlight x="band" />
  <ChartsLegend />
</ResponsiveChartContainer>

Why Composition?

  • Mix bar + line + scatter in one chart
  • Dual Y-axis configurations
  • Custom layout ordering (what renders on top)
  • Add custom SVG elements between chart layers
  • Full control over which sub-components are included

Custom Axes

Scale Types

// Band axis (categorical) — most common for bar charts
xAxis={[{ scaleType: 'band', data: ['Jan', 'Feb', 'Mar'] }]}

// Linear axis (numeric) — scatter plots, continuous data
yAxis={[{ scaleType: 'linear', min: 0, max: 100 }]}

// Time axis — date values
xAxis={[{
  scaleType: 'time',
  data: [new Date('2024-01-01'), new Date('2024-02-01'), new Date('2024-03-01')],
  valueFormatter: (date: Date) => date.toLocaleDateString(),
}]}

// Log axis — logarithmic scale
yAxis={[{ scaleType: 'log', min: 1, max: 10000 }]}

// Point axis — evenly spaced regardless of value
xAxis={[{ scaleType: 'point', data: [1, 10, 100, 1000] }]}

Tick Formatting

yAxis={[{
  valueFormatter: (value: number) => `$${(value / 1000).toFixed(0)}K`,
  label: 'Revenue',
  tickMinStep: 1000,
  tickMaxStep: 5000,
}]}

Dual Y-Axis

yAxis={[
  { id: 'left', label: 'Revenue ($)', position: 'left' },
  { id: 'right', label: 'Percentage (%)', position: 'right', min: 0, max: 100 },
]}
series={[
  { data: [1000, 2000, 3000], yAxisId: 'left', type: 'bar' },
  { data: [20, 45, 80], yAxisId: 'right', type: 'line' },
]}

Custom Tooltips

Built-in Tooltip Modes

// Show tooltip per data item (hover over specific bar/point)
<ChartsTooltip trigger="item" />

// Show tooltip for entire axis value (all series at that x position)
<ChartsTooltip trigger="axis" />

// Disable tooltip
<ChartsTooltip trigger="none" />

Custom Tooltip Content

import { ChartsTooltip, type ChartsItemContentProps } from '@mui/x-charts';
import Paper from '@mui/material/Paper';
import Typography from '@mui/material/Typography';

function CustomItemTooltip(props: ChartsItemContentProps) {
  const { series, dataIndex, color } = props;
  if (dataIndex === undefined) return null;

  return (
    <Paper sx={{ p: 1.5, borderRadius: 1 }} elevation={4}>
      <Typography variant="caption" sx={{ color }}>
        {series.label}
      </Typography>
      <Typography variant="body2" fontWeight={700}>
        ${series.data[dataIndex]?.toLocaleString()}
      </Typography>
    </Paper>
  );
}

<BarChart
  series={[...]}
  slots={{ itemContent: CustomItemTooltip }}
/>

Legends

// Position legend at the top
<BarChart
  series={[...]}
  slotProps={{
    legend: {
      direction: 'row',        // 'row' | 'column'
      position: {
        vertical: 'top',       // 'top' | 'middle' | 'bottom'
        horizontal: 'middle',  // 'left' | 'middle' | 'right'
      },
      padding: { top: 20 },
      itemMarkWidth: 10,
      itemMarkHeight: 10,
      markGap: 5,
      itemGap: 15,
    },
  }}
/>

// Hide legend
<BarChart
  series={[...]}
  slotProps={{ legend: { hidden: true } }}
/>

Click Handlers & Interactivity

<BarChart
  series={[{ data: [10, 20, 30], label: 'Revenue' }]}
  xAxis={[{ scaleType: 'band', data: ['Jan', 'Feb', 'Mar'] }]}
  onItemClick={(event, d) => {
    // d.type: 'bar' | 'line' | 'scatter' | 'pie'
    // d.seriesId: string
    // d.dataIndex: number
    console.log(`Clicked: series=${d.seriesId}, index=${d.dataIndex}`);
    router.push(`/details/${data[d.dataIndex].id}`);
  }}
  onAxisClick={(event, d) => {
    // d.axisValue: the x-axis value at click position
    // d.dataIndex: index into the data array
    console.log(`Axis clicked: ${d.axisValue}`);
  }}
/>

Highlight & Dim

<BarChart
  series={[
    {
      data: [10, 20, 30],
      highlightScope: { highlighted: 'item', faded: 'global' },
    },
  ]}
/>

Responsive Charts

Charts auto-fill parent width when using ResponsiveChartContainer or when width/height are omitted on basic charts with a sized parent.

// Parent must have explicit dimensions
<Box sx={{ width: '100%', height: 400 }}>
  <BarChart
    series={[...]}
    xAxis={[...]}
    // width and height omitted — fills parent
  />
</Box>

// Or use ResponsiveChartContainer for composition
<Box sx={{ width: '100%', height: 400 }}>
  <ResponsiveChartContainer series={[...]} xAxis={[...]}>
    <BarPlot />
    <ChartsXAxis />
    <ChartsYAxis />
  </ResponsiveChartContainer>
</Box>

Margin Configuration

<BarChart
  margin={{ top: 20, right: 30, bottom: 40, left: 60 }}
  // Increase left margin for wide y-axis labels
  // Increase bottom for rotated x-axis labels
/>

Stacked Series

<BarChart
  series={[
    { data: [10, 15, 20], stack: 'total', label: 'Product A' },
    { data: [5, 10, 15], stack: 'total', label: 'Product B' },
    { data: [3, 7, 12], stack: 'total', label: 'Product C' },
  ]}
  xAxis={[{ scaleType: 'band', data: ['Q1', 'Q2', 'Q3'] }]}
/>

// Stacked area chart
<LineChart
  series={[
    { data: [10, 15, 20], area: true, stack: 'total', label: 'Desktop' },
    { data: [5, 10, 15], area: true, stack: 'total', label: 'Mobile' },
    { data: [3, 7, 12], area: true, stack: 'total', label: 'Tablet' },
  ]}
/>

Multiple stack groups:

series={[
  { data: [10, 15], stack: 'group1', stackOrder: 'ascending' },
  { data: [5, 10], stack: 'group1' },
  { data: [3, 7], stack: 'group2' },   // separate stack
]}

Animation

// Disable animation
<BarChart
  skipAnimation={true}
  series={[...]}
/>

// Animations are enabled by default with sensible durations
// Custom duration/easing not directly exposed as props — use CSS transitions
// for additional animation effects on the container

Color Palette

Custom Colors per Series

<BarChart
  series={[
    { data: [10, 20, 30], label: 'A', color: '#2563eb' },
    { data: [5, 15, 25], label: 'B', color: '#7c3aed' },
  ]}
/>

Categorical Palette

import { blueberryTwilightPalette, mangoFusionPalette, cheerfulFiestaPalette } from '@mui/x-charts/colorPalettes';

<BarChart
  colors={mangoFusionPalette}
  series={[...]}
/>

Theme-Aware Colors

import { useTheme } from '@mui/material/styles';

function ThemedChart({ data }) {
  const theme = useTheme();

  return (
    <BarChart
      series={[
        { data: data.values, color: theme.palette.primary.main },
      ]}
      sx={{
        '& .MuiChartsAxis-tickLabel': {
          fill: theme.palette.text.secondary,
        },
        '& .MuiChartsAxis-line': {
          stroke: theme.palette.divider,
        },
      }}
    />
  );
}

SparkLineChart

Inline mini charts for dashboards and tables.

import { SparkLineChart } from '@mui/x-charts/SparkLineChart';

// Line sparkline
<SparkLineChart
  data={[1, 4, 2, 5, 7, 2, 4, 6]}
  height={40}
  width={150}
  curve="natural"
  area
  colors={['#2563eb']}
/>

// Bar sparkline
<SparkLineChart
  data={[3, 1, 4, 1, 5, 9, 2, 6]}
  height={40}
  width={150}
  plotType="bar"
  colors={['#16a34a']}
/>

// In a DataGrid cell
const columns: GridColDef[] = [
  { field: 'name', headerName: 'Product' },
  {
    field: 'trend',
    headerName: 'Last 7 Days',
    width: 150,
    renderCell: (params) => (
      <SparkLineChart
        data={params.value}
        height={30}
        width={120}
        area
        colors={[params.value[params.value.length - 1] > params.value[0] ? '#16a34a' : '#dc2626']}
      />
    ),
  },
];

Gauge Charts

import { Gauge, gaugeClasses } from '@mui/x-charts/Gauge';

// Simple gauge
<Gauge
  value={75}
  startAngle={-110}
  endAngle={110}
  width={200}
  height={200}
  text={({ value }) => `${value}%`}
  sx={{
    [`& .${gaugeClasses.valueArc}`]: {
      fill: '#2563eb',
    },
    [`& .${gaugeClasses.valueText}`]: {
      fontSize: 24,
      fontWeight: 'bold',
    },
  }}
/>

Dataset Approach

Pass a dataset array and reference fields by dataKey:

const dataset = [
  { month: 'Jan', revenue: 4000, profit: 2400 },
  { month: 'Feb', revenue: 3000, profit: 1398 },
  { month: 'Mar', revenue: 2000, profit: 800 },
];

<BarChart
  dataset={dataset}
  xAxis={[{ scaleType: 'band', dataKey: 'month' }]}
  series={[
    { dataKey: 'revenue', label: 'Revenue' },
    { dataKey: 'profit', label: 'Profit' },
  ]}
/>

This is the preferred pattern when data comes from an API — avoids manual array extraction.


Styling with sx

<BarChart
  series={[...]}
  sx={{
    // Axis labels
    '& .MuiChartsAxis-tickLabel': {
      fontSize: '0.75rem',
      fill: 'text.secondary',
    },
    // Axis lines
    '& .MuiChartsAxis-line': {
      stroke: 'divider',
    },
    // Grid lines
    '& .MuiChartsGrid-line': {
      strokeDasharray: '4 4',
      stroke: 'divider',
    },
    // Legend text
    '& .MuiChartsLegend-series text': {
      fontSize: '0.8rem !important',
    },
  }}
/>

Performance Tips

  • Use dataset + dataKey instead of extracting arrays manually
  • For large datasets (1000+ points), consider downsampling before rendering
  • skipAnimation for frequently updating charts (real-time data)
  • Lazy-load chart components with React.lazy: const BarChart = lazy(() => import('@mui/x-charts/BarChart').then(m => ({default: m.BarChart})));
  • Charts auto-resize on window resize — avoid unnecessary re-renders of the parent

平台分布

Codex

32.1%
按下载量换算21

Claude

31.5%
按下载量换算21

Cursor

17.58%
按下载量换算12

Gemini CLI

9.42%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills