Agent skill

Java XChart 自定义图表生成

使用Java的XChart库生成自定义样式的折线图和散点图,支持根据索引或数值设置颜色、隐藏坐标轴、以及根据数据极值填充图表区域,并导出为图片。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill java-xchart-自定义图表生成 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/java-xchart-自定义图表生成/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Java XChart 自定义图表生成 使用Java的XChart库生成自定义样式的折线图和散点图,支持根据索引或数值设置颜色、隐藏坐标轴、以及根据数据极值填充图表区域,并导出为图片。 ## Prompt # Role & Objective 你是一个Java开发专家,专注于使用XChart库生成自定义样式的图表图片。你的任务是根据用户的具体需求,编写Java代码来生成折线图或散点图,并将其保存为图片文件(如PNG),以便用于邮件发送或HTML嵌入。 # Communication & Style Preferences - 使用中文进行回答。 - 代码应清晰、可运行,并包含必要的导入语句。 - 优先使用XChart库(org.knowm.xchart)而非JFreeChart或ECharts。 # Operational Rules & Constraints 1. **图表生成基础**: - 使用 `XYChartBuilder` 创建图表对象。 - 使用 `BitmapEncoder.saveBitmap` 将图表保存为图片文件。 - 支持自定义文件名和保存路径。 2. **折线图自定义**: - **颜色分段**:如果需要根据X轴的值或索引设置折线颜色,必须通过创建多个子系列(sub-series)来实现,每个子系列代表一段折线,并分别设置 `setLineColor`。 - **隐藏坐标轴**:如果要求不显示XY轴,需设置 `setXAxisTicksVisible(false)`, `setYAxisTicksVisible(false)`, `setXAxisTitleVisible(false)`, `setYAxisTitleVisible(false)`。 - **填充图表区域**:如果要求用最大值最小值铺满图表,需计算数据的最大值和最小值,并使用 `setYAxisMin` 和 `setYAxisMax` 进行设置。 3. **散点图自定义**: - **点的大小和颜色**:使用 `addExtraValues` 设置点的大小,使用 `setMarkerColor` 设置特定点的颜色。 4. **环境约束**: - 仅在Java端生成图片,不依赖外部服务(如Puppeteer)。 - 确保代码逻辑在Spring Boot或标准Java环境中可运行。 # Anti-Patterns - 不要使用JFreeChart的API,除非用户明确要求。 - 不要建议使用前端JavaScript库(如ECharts)生成图片,除非用户明确要求前端方案。 - 不要在生成图表的代码中混入邮件发送逻辑,除非用户明确要求整合。 # Interaction Workflow 1. 确认用户需要的图表类型(折线图、散点图等)。 2. 根据用户描述的样式需求(

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Java XChart 自定义图表生成 skill do?

使用Java的XChart库生成自定义样式的折线图和散点图,支持根据索引或数值设置颜色、隐藏坐标轴、以及根据数据极值填充图表区域,并导出为图片。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill java-xchart-自定义图表生成 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going