-
Notifications
You must be signed in to change notification settings - Fork 463
docs: add grouped stacked column line demo #3061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthrough新增一个 React 示例 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as User
participant Browser as Browser
participant React as React App
participant DualAxes as DualAxes Chart
participant Bars as Interval (stacked & grouped)
participant Line as Line (right axis)
User->>Browser: 打开示例页面
Browser->>React: 初始化应用
React->>DualAxes: 渲染 DualAxes(config)
Note right of DualAxes: 自定义图例标记(线=虚线,柱=方块)<br/>xField=time;左轴=value;右轴=count
DualAxes->>Bars: 渲染分组堆叠柱(groupBy: [x, series])
DualAxes->>Line: 渲染折线(count, lineWidth=2)
Bars-->>DualAxes: 完成
Line-->>DualAxes: 完成
DualAxes-->>Browser: 绘制到画布
Browser-->>User: 显示双轴图
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @goldenfishzhenianqi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
此拉取请求旨在通过添加一个新的分组堆叠柱线图示例来扩展现有图表库的文档和示例集。这为用户提供了更多可视化选项的参考,并展示了如何结合使用堆叠柱状图和折线图来呈现复杂的数据关系。
Highlights
- 新增图表示例: 此PR新增了一个分组堆叠柱线图的参考示例,丰富了图表库的展示能力。
- 文件变更: 新增了
grouped-stacked-column-line.js文件,其中包含了使用@ant-design/plots的DualAxes组件实现的图表配置和数据。同时更新了meta.json文件,注册了新的图表示例及其元数据。
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
此 PR 新增了一个分组堆叠柱线图的示例,实现清晰。我主要提出了一些关于示例数据和代码简洁性的建议,以提高示例的清晰度和代码质量。请查看具体评论。
| { time: '2025-03', value: 350, group: 'uv', type: 'b' }, | ||
| { time: '2025-04', value: 900, group: 'uv', type: 'b' }, | ||
| { time: '2025-05', value: 300, group: 'uv', type: 'b' }, | ||
| { time: '2025-06', value: 450, group: 'uv', type: 'b' }, | ||
| { time: '2025-07', value: 470, group: 'uv', type: 'b' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uvBillData 中 group: 'uv' 的两组数据(type: 'a' 和 type: 'b')是完全相同的。这会导致堆叠效果不明显,因为两个系列的值一样。为了更好地展示堆叠柱状图的效果,建议修改其中一组数据的值,使其有所区别。
| { time: '2025-03', value: 350, group: 'uv', type: 'b' }, | |
| { time: '2025-04', value: 900, group: 'uv', type: 'b' }, | |
| { time: '2025-05', value: 300, group: 'uv', type: 'b' }, | |
| { time: '2025-06', value: 450, group: 'uv', type: 'b' }, | |
| { time: '2025-07', value: 470, group: 'uv', type: 'b' }, | |
| { time: '2025-03', value: 400, group: 'uv', type: 'b' }, | |
| { time: '2025-04', value: 500, group: 'uv', type: 'b' }, | |
| { time: '2025-05', value: 600, group: 'uv', type: 'b' }, | |
| { time: '2025-06', value: 350, group: 'uv', type: 'b' }, | |
| { time: '2025-07', value: 570, group: 'uv', type: 'b' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
site/examples/statistics/dual-axes/demo/meta.json (1)
181-181: 截图使用 AVIF,建议与站内格式保持一致并兼容回退大多数现有示例使用 WebP 或 original;为提升兼容性与一致性,建议改为 WebP(或提供回退)。
可以直接替换为同路径的 WebP 版本(若资源已同步):
- "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hhUWS6yU84YAAAAAQWAAAAgAemJ7AQ/fmt.avif" + "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hhUWS6yU84YAAAAAQWAAAAgAemJ7AQ/fmt.webp"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
site/examples/statistics/dual-axes/demo/grouped-stacked-column-line.js(1 hunks)site/examples/statistics/dual-axes/demo/meta.json(1 hunks)
🔇 Additional comments (5)
site/examples/statistics/dual-axes/demo/meta.json (1)
176-181: 新增 demo 元数据整体 OK文件名、标题与实际示例一致,插入位置也合理。
site/examples/statistics/dual-axes/demo/grouped-stacked-column-line.js (4)
70-75: 右轴配置与线型样式清晰右侧 y 轴的位置与线宽设置合理,能直观区分度量。
6-24: 数据示例覆盖了分组与堆叠维度
group+type组合清晰,时间序列从 2025-03 至 2025-07 连贯,便于读者理解。Also applies to: 26-32
48-68: 保持 children 配置并确认 stack.groupBy 使用通道名
site/examples/statistics/dual-axes/demo 目录下所有 DualAxes 示例均已统一采用 children 配置,无 geometryOptions 用法;stack.groupBy 传入通道名 'series' 符合 v2 API 要求。
34-46: 保持 'dash' 标记,无需修改 legend.itemMarker 支持 'dash',当前主题配置中 shapes.line 包含 'dash',为合法内置 marker 类型。 (g2-v3.antv.vision)Likely an incorrect or invalid review comment.
此PR新增一个堆叠分组柱线图的参考示例

Summary by CodeRabbit