ucharts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用本技能
Use this skill whenever the user wants to:
- Install and set up uCharts in a project
- Create charts in uni-app applications
- Use uCharts in WeChat Mini Program
- Use uCharts in H5 applications
- Configure chart options
- Use different chart types
- Handle chart events
- Customize chart appearance
- Understand uCharts API and methods
- Troubleshoot uCharts issues
当用户有以下需求时,可使用本技能:
- 在项目中安装和配置uCharts
- 在uni-app应用中创建图表
- 在微信小程序中使用uCharts
- 在H5应用中使用uCharts
- 配置图表选项
- 使用不同类型的图表
- 处理图表事件
- 自定义图表外观
- 了解uCharts的API和方法
- 排查uCharts相关问题
How to use this skill
如何使用本技能
This skill is organized to match the uCharts official documentation structure (https://www.ucharts.cn/v2/#/, https://www.ucharts.cn/v2/#/guide/index, https://www.ucharts.cn/v2/#/document/index). When working with uCharts:
-
Identify the topic from the user's request:
- Installation/安装 →
examples/guide/installation.md - Quick Start/快速开始 →
examples/guide/quick-start.md - Chart Types/图表类型 →
examples/charts/ - Features/功能特性 →
examples/features/ - API/API 文档 →
api/
- Installation/安装 →
-
Load the appropriate example file from thedirectory:
examples/Guide (使用指南):- - Introduction to uCharts
examples/guide/intro.md - - Installation guide
examples/guide/installation.md - - Quick start guide
examples/guide/quick-start.md - - Configuration
examples/guide/configuration.md - - Platform support
examples/guide/platform-support.md
Charts (图表类型):- - Line chart
examples/charts/line.md - - Column chart
examples/charts/column.md - - Area chart
examples/charts/area.md - - Pie chart
examples/charts/pie.md - - Ring chart
examples/charts/ring.md - - Radar chart
examples/charts/radar.md - - Funnel chart
examples/charts/funnel.md - - Gauge chart
examples/charts/gauge.md - - Candle chart
examples/charts/candle.md - - Mixed chart
examples/charts/mix.md
Features (功能特性):- - Data format
examples/features/data-format.md - - Chart events
examples/features/chart-events.md - - Chart methods
examples/features/chart-methods.md - - Chart update
examples/features/chart-update.md - - Chart customization
examples/features/chart-customization.md
-
Follow the specific instructions in that example file for syntax, structure, and best practicesImportant Notes:
- uCharts supports multiple platforms (uni-app, WeChat Mini Program, H5, APP)
- Charts use canvas for rendering
- Configuration through options object
- Each example file includes key concepts, code examples, and key points
-
Reference API documentation in thedirectory when needed:
api/- - Chart component API
api/chart-api.md - - Options API
api/options-api.md - - Data API
api/data-api.md - - Events API
api/events-api.md - - Methods API
api/methods-api.md
-
Use templates from thedirectory:
templates/- - Installation templates
templates/installation.md - - Basic chart templates
templates/basic-chart.md - - Configuration templates
templates/configuration.md
本技能的结构与uCharts官方文档结构一致(https://www.ucharts.cn/v2/#/, https://www.ucharts.cn/v2/#/guide/index, https://www.ucharts.cn/v2/#/document/index)。使用uCharts时:
-
从用户的请求中确定主题:
- 安装 →
examples/guide/installation.md - 快速开始 →
examples/guide/quick-start.md - 图表类型 →
examples/charts/ - 功能特性 →
examples/features/ - API →
api/
- 安装 →
-
从目录中加载对应的示例文件:
examples/使用指南:- - uCharts介绍
examples/guide/intro.md - - 安装指南
examples/guide/installation.md - - 快速开始指南
examples/guide/quick-start.md - - 配置说明
examples/guide/configuration.md - - 平台支持说明
examples/guide/platform-support.md
图表类型:- - 折线图
examples/charts/line.md - - 柱状图
examples/charts/column.md - - 面积图
examples/charts/area.md - - 饼图
examples/charts/pie.md - - 环形图
examples/charts/ring.md - - 雷达图
examples/charts/radar.md - - 漏斗图
examples/charts/funnel.md - - 仪表盘
examples/charts/gauge.md - - K线图
examples/charts/candle.md - - 混合图
examples/charts/mix.md
功能特性:- - 数据格式
examples/features/data-format.md - - 图表事件
examples/features/chart-events.md - - 图表方法
examples/features/chart-methods.md - - 图表更新
examples/features/chart-update.md - - 图表自定义
examples/features/chart-customization.md
-
遵循示例文件中的具体说明,包括语法、结构和最佳实践重要说明:
- uCharts支持多平台(uni-app、微信小程序、H5、APP)
- 图表使用canvas进行渲染
- 通过options对象进行配置
- 每个示例文件都包含核心概念、代码示例和关键点
-
必要时参考目录下的API文档:
api/- - 图表组件API
api/chart-api.md - - 配置项API
api/options-api.md - - 数据API
api/data-api.md - - 事件API
api/events-api.md - - 方法API
api/methods-api.md
-
使用目录下的模板:
templates/- - 安装模板
templates/installation.md - - 基础图表模板
templates/basic-chart.md - - 配置模板
templates/configuration.md
1. Understanding uCharts
1. 了解uCharts
uCharts is a high-performance cross-platform charting library that supports uni-app, WeChat Mini Program, H5, APP and more.
Key Concepts:
- Chart Component: Main chart component
- Options: Chart configuration options
- Data: Chart data format
- Events: Chart events
- Methods: Chart methods
- Platform Support: Multi-platform compatibility
uCharts是一款高性能跨平台图表库,支持uni-app、微信小程序、H5、APP等多个平台。
核心概念:
- Chart Component: 主图表组件
- Options: 图表配置选项
- Data: 图表数据格式
- Events: 图表事件
- Methods: 图表方法
- Platform Support: 多平台兼容性
2. Installation
2. 安装
Using npm:
bash
npm install @qiun/uchartsUsing yarn:
bash
yarn add @qiun/uchartsUsing pnpm:
bash
pnpm add @qiun/ucharts使用npm安装:
bash
npm install @qiun/ucharts使用yarn安装:
bash
yarn add @qiun/ucharts使用pnpm安装:
bash
pnpm add @qiun/ucharts3. Basic Setup
3. 基础配置
vue
<template>
<qiun-data-chart type="line" :chartData="chartData" :opts="opts" />
</template>
<script>
export default {
data() {
return {
chartData: {
categories: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
series: [
{
name: 'Sales',
data: [35, 36, 31, 33, 13]
}
]
},
opts: {}
}
}
}
</script>vue
<template>
<qiun-data-chart type="line" :chartData="chartData" :opts="opts" />
</template>
<script>
export default {
data() {
return {
chartData: {
categories: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
series: [
{
name: 'Sales',
data: [35, 36, 31, 33, 13]
}
]
},
opts: {}
}
}
}
</script>Doc mapping (one-to-one with official documentation)
文档映射(与官方文档一一对应)
- or
examples/guide/→ https://www.ucharts.cn/v2/#/guide/indexexamples/getting-started/ - → https://www.ucharts.cn/v2/#/document/index
examples/
- 或
examples/guide/→ https://www.ucharts.cn/v2/#/guide/indexexamples/getting-started/ - → https://www.ucharts.cn/v2/#/document/index
examples/
Examples and Templates
示例与模板
This skill includes detailed examples organized to match the official documentation structure. All examples are in the directory (see mapping above).
examples/To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in directory for common scaffolding
templates/ - Adapt templates to your specific needs and coding style
本技能包含详细的示例,结构与官方文档一致。所有示例都位于目录中(见上述映射关系)。
examples/使用示例:
- 从用户的请求中确定主题
- 根据上述映射关系加载对应的示例文件
- 遵循文件中的说明、语法和最佳实践
- 根据具体需求调整代码示例
使用模板:
- 参考目录下的模板搭建基础框架
templates/ - 根据具体需求和编码风格调整模板
API Reference
API参考
Detailed API documentation is available in the directory, organized to match the official uCharts API documentation structure (https://www.ucharts.cn/v2/#/document/index):
api/详细的API文档位于目录中,结构与uCharts官方API文档一致(https://www.ucharts.cn/v2/#/document/index):
api/Chart Component API (api/chart-api.md
)
api/chart-api.md图表组件API (api/chart-api.md
)
api/chart-api.md- Chart component props
- Chart component events
- Chart component methods
- 图表组件属性
- 图表组件事件
- 图表组件方法
Options API (api/options-api.md
)
api/options-api.md配置项API (api/options-api.md
)
api/options-api.md- Chart options configuration
- Option properties
- Option methods
- 图表配置项说明
- 配置项属性
- 配置项方法
Data API (api/data-api.md
)
api/data-api.md数据API (api/data-api.md
)
api/data-api.md- Data format
- Data structure
- Data transformation
- 数据格式
- 数据结构
- 数据转换
Events API (api/events-api.md
)
api/events-api.md事件API (api/events-api.md
)
api/events-api.md- Chart events
- Event handlers
- Event parameters
- 图表事件
- 事件处理器
- 事件参数
Methods API (api/methods-api.md
)
api/methods-api.md方法API (api/methods-api.md
)
api/methods-api.md- Chart methods
- Method parameters
- Method return values
To use API reference:
- Identify the API you need help with
- Load the corresponding API file from the directory
api/ - Find the API signature, parameters, return type, and examples
- Reference the linked example files for detailed usage patterns
- All API files include links to relevant example files in the directory
examples/
- 图表方法
- 方法参数
- 方法返回值
使用API参考:
- 确定需要查询的API
- 从目录中加载对应的API文件
api/ - 查找API签名、参数、返回类型和示例
- 参考关联的示例文件了解详细使用方式
- 所有API文件都包含指向目录中相关示例文件的链接
examples/
Best Practices
最佳实践
- Configure options properly: Set up chart options correctly
- Format data correctly: Use proper data format
- Handle events: Use chart events for interactions
- Use methods: Leverage chart methods for operations
- Optimize performance: Optimize chart rendering performance
- Customize appearance: Customize chart appearance when needed
- Follow platform patterns: Follow platform-specific best practices
- 正确配置选项:合理设置图表配置项
- 规范数据格式:使用正确的数据格式
- 处理事件:利用图表事件实现交互
- 使用方法:借助图表方法执行操作
- 优化性能:优化图表渲染性能
- 自定义外观:根据需求自定义图表外观
- 遵循平台规范:遵循各平台的最佳实践
Resources
资源
- Official Documentation: https://www.ucharts.cn/v2/#/
- Guide: https://www.ucharts.cn/v2/#/guide/index
- Documentation: https://www.ucharts.cn/v2/#/document/index
Keywords
关键词
uCharts, @qiun/ucharts, chart, 图表, 折线图, 柱状图, 饼图, 环形图, 雷达图, 漏斗图, 仪表盘, K线图, 混合图, line chart, column chart, area chart, pie chart, ring chart, radar chart, funnel chart, gauge chart, candle chart, mixed chart, uni-app, WeChat Mini Program, H5, APP, canvas, chart options, chart data, chart events, chart methods
uCharts, @qiun/ucharts, chart, 图表, 折线图, 柱状图, 饼图, 环形图, 雷达图, 漏斗图, 仪表盘, K线图, 混合图, line chart, column chart, area chart, pie chart, ring chart, radar chart, funnel chart, gauge chart, candle chart, mixed chart, uni-app, 微信小程序, H5, APP, canvas, chart options, chart data, chart events, chart methods