syncfusion-aspnetcore-accumulation-chart
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing Syncfusion ASP.NET Core Accumulation Charts
实现Syncfusion ASP.NET Core Accumulation Charts
A comprehensive skill for implementing Syncfusion's ASP.NET Core Accumulation Chart component. This component renders circular data visualizations including Pie, Doughnut, Pyramid, and Funnel charts using Scalable Vector Graphics (SVG).
这是一套用于实现Syncfusion ASP.NET Core Accumulation Chart组件的完整技能指南。该组件使用可缩放矢量图形(SVG)渲染环形数据可视化图表,包括饼图、环形图、金字塔图和漏斗图。
When to Use This Skill
何时使用本技能
Use this skill when you need to:
- Create pie, doughnut, pyramid, or funnel charts in ASP.NET Core applications
- Visualize proportional data or percentage distributions
- Display hierarchical data with pyramid/funnel charts
- Add data labels, tooltips, and legends to accumulation charts
- Implement interactive features (exploding slices, selection, drill-down)
- Handle grouped data or empty points in charts
- Export or print accumulation charts
- Make charts accessible (WCAG 2.2 compliant)
- Dynamically update chart data in real-time
- Customize chart appearance with themes, colors, and gradients
当你需要完成以下需求时可使用本技能:
- 在ASP.NET Core应用中创建饼图、环形图、金字塔图或漏斗图
- 可视化比例数据或百分比分布
- 用金字塔/漏斗图展示层级数据
- 为累计图表添加数据标签、工具提示和图例
- 实现交互功能(切片弹出、选中、下钻)
- 处理图表中的分组数据或空数据点
- 导出或打印累计图表
- 实现符合无障碍标准的图表(WCAG 2.2合规)
- 实时动态更新图表数据
- 通过主题、颜色和渐变自定义图表外观
Component Overview
组件概述
AccumulationChart is a circular graphics component that divides data into segments to illustrate numerical proportions. It supports:
- Chart Types: Pie (including Doughnut variant), Pyramid, Funnel
- Note: Doughnut is achieved by setting on a Pie chart, not a separate type
innerRadius
- Note: Doughnut is achieved by setting
- Smart Labels: Automatic label positioning to prevent overlapping
- Grouping: Combine small data points based on value or count
- Semi-Charts: Customize start and end angles for semi-pie/doughnut
- Legend: Display additional point information
- Tooltips: Interactive data point details
- Empty Points: Graceful handling of missing data
- Accessibility: Full WCAG 2.2 Level A & AA compliance
- Export: PNG, JPEG, SVG, PDF formats
- Print: Direct browser printing support
AccumulationChart 是一个环形图形组件,它将数据拆分为多个分段来展示数值比例,支持以下功能:
- 图表类型: 饼图(包含环形图变体)、金字塔图、漏斗图
- 注意: 环形图通过设置饼图的实现,并非独立的图表类型
innerRadius
- 注意: 环形图通过设置饼图的
- 智能标签: 自动调整标签位置避免重叠
- 分组: 根据数值或数量合并小数据点
- 半环图表: 自定义起止角度实现半饼图/半环形图
- 图例: 展示额外的数据点信息
- 工具提示: 交互式展示数据点详情
- 空数据点: 优雅处理缺失数据
- 无障碍: 完全符合WCAG 2.2 Level A & AA标准
- 导出: 支持PNG、JPEG、SVG、PDF格式
- 打印: 支持浏览器直接打印
Documentation and Navigation Guide
文档与导航指南
Getting Started
入门指南
📄 Read: references/getting-started.md
When to read: Setting up accumulation charts for the first time, or need complete installation and basic implementation guidance.
What you'll learn:
- Prerequisites and system requirements
- Installing Syncfusion NuGet packages
- Registering tag helpers and script resources
- Creating your first pie/doughnut chart
- Basic data binding (dataSource, xName, yName)
- CSS theme imports and script manager setup
- Running and testing the chart
- Complete minimal working example
📄 阅读: references/getting-started.md
适用场景: 首次搭建累计图表,或需要完整的安装和基础实现指导时。
你将学到:
- 前置条件与系统要求
- 安装Syncfusion NuGet包
- 注册Tag Helper和脚本资源
- 创建你的第一个饼图/环形图
- 基础数据绑定(dataSource、xName、yName)
- CSS主题导入与脚本管理器设置
- 运行和测试图表
- 完整的最小可运行示例
Chart Types and Variants
图表类型与变体
📄 Read: references/chart-types.md
When to read: Need to implement specific chart types (Pie, Doughnut, Pyramid, Funnel) or customize chart geometry and appearance.
What you'll learn:
- Pie chart implementation and configuration
- Doughnut chart with inner radius and center labels
- Pyramid chart with width, gap, and neck customization
- Funnel chart with neck dimensions
- Radius customization for all chart types
- Start and end angles for semi-pie/semi-doughnut
- Exploding slices (single and multiple points)
- Chart center positioning
- Complete code examples for each type
📄 阅读: references/chart-types.md
适用场景: 需要实现特定图表类型(饼图、环形图、金字塔图、漏斗图)或自定义图表几何形状与外观时。
你将学到:
- 饼图的实现与配置
- 带内半径和中心标签的环形图
- 支持宽度、间距、颈部自定义的金字塔图
- 支持颈部尺寸配置的漏斗图
- 所有图表类型的半径自定义
- 半饼图/半环形图的起止角度设置
- 切片弹出(单点和多点)
- 图表中心位置调整
- 每种类型的完整代码示例
Data Visualization Features
数据可视化功能
📄 Read: references/data-visualization.md
When to read: Enhancing charts with data labels, tooltips, legends, colors, or custom styling.
What you'll learn:
- Data label visibility, positioning, and templates
- Smart labels for overlap prevention
- Connector lines for outside labels
- Tooltip configuration and templates
- Legend positioning, alignment, and customization
- Title and subtitle configuration
- Point colors and gradient fills
- Text mapping from data source
- Border and margin customization
- Complete styling patterns
📄 阅读: references/data-visualization.md
适用场景: 通过数据标签、工具提示、图例、颜色或自定义样式增强图表能力时。
你将学到:
- 数据标签可见性、位置与模板设置
- 避免重叠的智能标签功能
- 外部标签的连接线设置
- 工具提示配置与模板
- 图例位置、对齐方式与自定义
- 标题与副标题配置
- 数据点颜色与渐变填充
- 从数据源映射文本
- 边框与边距自定义
- 完整的样式实现模式
Data Handling
数据处理
📄 Read: references/data-handling.md
When to read: Working with complex data scenarios like grouping small values, handling missing data, or updating charts dynamically.
What you'll learn:
- Grouping points by value or count threshold
- Group settings (threshold, mode, color, name)
- Empty points handling (null/undefined values)
- Empty point modes (Zero, Drop, Average, Gap)
- Dynamic data updates and live scenarios
- Data source binding patterns
- Sorting and ordering data
- Edge cases and troubleshooting
📄 阅读: references/data-handling.md
适用场景: 处理复杂数据场景,比如小数值分组、缺失数据处理或动态更新图表时。
你将学到:
- 按数值或数量阈值分组数据点
- 分组设置(阈值、模式、颜色、名称)
- 空数据点处理(null/undefined值)
- 空数据点模式(Zero、Drop、Average、Gap)
- 动态数据更新与实时场景
- 数据源绑定模式
- 数据排序与顺序调整
- 边缘场景与问题排查
Advanced Features
高级功能
📄 Read: references/advanced-features.md
When to read: Implementing annotations, export/print functionality, or migrating from EJ1 to EJ2.
What you'll learn:
- Chart annotations (text, shapes, images)
- Annotation positioning (coordinate, region, alignment)
- Export to image formats (PNG, JPEG, SVG)
- Export to PDF
- Print functionality and customization
- EJ1 to EJ2 API migration guide
- Performance optimization tips
- Complex implementation patterns
📄 阅读: references/advanced-features.md
适用场景: 实现注释、导出/打印功能,或从EJ1迁移到EJ2时。
你将学到:
- 图表注释(文本、形状、图片)
- 注释定位(坐标、区域、对齐方式)
- 导出为图片格式(PNG、JPEG、SVG)
- 导出为PDF
- 打印功能与自定义
- EJ1到EJ2的API迁移指南
- 性能优化技巧
- 复杂实现模式
Accessibility
无障碍功能
📄 Read: references/accessibility.md
When to read: Making charts accessible for users with disabilities or ensuring WCAG 2.2 compliance.
What you'll learn:
- WCAG 2.2 Level A & AA compliance features
- Keyboard navigation (Tab, arrow keys, Enter)
- ARIA attributes and roles
- Screen reader support and announcements
- High contrast theme support
- Focus indicators and visual feedback
- Color contrast requirements
- Accessible color palettes
- Testing with assistive technologies
- Complete accessible chart implementation
📄 阅读: references/accessibility.md
适用场景: 为残障用户提供无障碍访问能力,或确保符合WCAG 2.2标准时。
你将学到:
- WCAG 2.2 Level A & AA合规功能
- 键盘导航(Tab、方向键、Enter)
- ARIA属性与角色
- 屏幕阅读器支持与播报
- 高对比度主题支持
- 焦点指示器与视觉反馈
- 颜色对比度要求
- 无障碍调色板
- 辅助技术测试方法
- 完整的无障碍图表实现方案
Quick Start Example
快速入门示例
Here's a minimal example to render a pie chart in ASP.NET Core:
以下是在ASP.NET Core中渲染饼图的最小示例:
1. Install Package
1. 安装包
bash
Install-Package Syncfusion.EJ2.AspNet.Core -Version {{ site.releaseversion }}bash
Install-Package Syncfusion.EJ2.AspNet.Core -Version {{ site.releaseversion }}2. Register Tag Helper (~/Pages/_ViewImports.cshtml)
2. 注册Tag Helper (~/Pages/_ViewImports.cshtml)
csharp
@addTagHelper *, Syncfusion.EJ2csharp
@addTagHelper *, Syncfusion.EJ23. Add Scripts (~/Pages/Shared/_Layout.cshtml)
3. 添加脚本 (~/Pages/Shared/_Layout.cshtml)
html
<head>
<!-- Syncfusion CSS -->
<link href="https://cdn.syncfusion.com/ej2/{{ site.ej2version }}/material.css" rel="stylesheet" />
<!-- Syncfusion JS -->
<script src="https://cdn.syncfusion.com/ej2/{{ site.ej2version }}/dist/ej2.min.js"></script>
</head>
<body>
<!-- Content -->
<ejs-scripts></ejs-scripts>
</body>html
<head>
<!-- Syncfusion CSS -->
<link href="https://cdn.syncfusion.com/ej2/{{ site.ej2version }}/material.css" rel="stylesheet" />
<!-- Syncfusion JS -->
<script src="https://cdn.syncfusion.com/ej2/{{ site.ej2version }}/dist/ej2.min.js"></script>
</head>
<body>
<!-- Content -->
<ejs-scripts></ejs-scripts>
</body>4. Create Pie Chart (~/Pages/Index.cshtml)
4. 创建饼图 (~/Pages/Index.cshtml)
cshtml
@{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { xValue = "Chrome", yValue = 37 },
new PieChartData { xValue = "Firefox", yValue = 22 },
new PieChartData { xValue = "Safari", yValue = 19 },
new PieChartData { xValue = "Edge", yValue = 12 },
new PieChartData { xValue = "Others", yValue = 10 }
};
}
<ejs-accumulationchart id="pieChart">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData" xName="xValue" yName="yValue">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>cshtml
@{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { xValue = "Chrome", yValue = 37 },
new PieChartData { xValue = "Firefox", yValue = 22 },
new PieChartData { xValue = "Safari", yValue = 19 },
new PieChartData { xValue = "Edge", yValue = 12 },
new PieChartData { xValue = "Others", yValue = 10 }
};
}
<ejs-accumulationchart id="pieChart">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData" xName="xValue" yName="yValue">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>5. Define Data Model (~/Pages/Index.cshtml.cs or separate class)
5. 定义数据模型 (~/Pages/Index.cshtml.cs 或独立类)
csharp
public class PieChartData
{
public string xValue { get; set; }
public double yValue { get; set; }
}Result: A basic pie chart displaying browser usage statistics.
csharp
public class PieChartData
{
public string xValue { get; set; }
public double yValue { get; set; }
}效果: 一个展示浏览器使用占比的基础饼图。
Common Patterns
常用实现模式
Pattern 1: Doughnut Chart with Center Label
模式1:带中心标签的环形图
cshtml
<ejs-accumulationchart id="container">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="chartData" xName="x" yName="y" innerRadius="65%">
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-centerlabel text="Mobile<br>Browsers<br>Statistics">
</e-accumulationchart-centerlabel>
<e-accumulationchart-legendsettings visible="false">
</e-accumulationchart-legendsettings>
</ejs-accumulationchart>Use Case: Dashboard KPIs with center text showing total value.
cshtml
<ejs-accumulationchart id="container">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="chartData" xName="x" yName="y" innerRadius="65%">
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-centerlabel text="Mobile<br>Browsers<br>Statistics">
</e-accumulationchart-centerlabel>
<e-accumulationchart-legendsettings visible="false">
</e-accumulationchart-legendsettings>
</ejs-accumulationchart>适用场景: 仪表盘KPI展示,中心文本展示总数值。
Pattern 2: Pie Chart with Smart Labels and Tooltips
模式2:带智能标签和工具提示的饼图
cshtml
<ejs-accumulationchart id="smartLabelChart" enableSmartLabels="true">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData" xName="xValue" yName="yValue">
<e-accumulationseries-datalabel visible="true"
position="Outside"
name="text">
<e-connectorstyle type="Curve"></e-connectorstyle>
</e-accumulationseries-datalabel>
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-tooltipsettings enable="true" format="${point.x}: ${point.y}%">
</e-accumulationchart-tooltipsettings>
</ejs-accumulationchart>Use Case: Preventing label overlap in charts with many small slices.
cshtml
<ejs-accumulationchart id="smartLabelChart" enableSmartLabels="true">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData" xName="xValue" yName="yValue">
<e-accumulationseries-datalabel visible="true"
position="Outside"
name="text">
<e-connectorstyle type="Curve"></e-connectorstyle>
</e-accumulationseries-datalabel>
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-tooltipsettings enable="true" format="${point.x}: ${point.y}%">
</e-accumulationchart-tooltipsettings>
</ejs-accumulationchart>适用场景: 避免多小切片场景下的标签重叠问题。
Pattern 3: Grouped Data with Small Values
模式3:小数值分组数据
cshtml
<ejs-accumulationchart id="groupedChart">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData"
xName="xValue"
yName="yValue"
groupTo="11">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>Use Case: Combining values below 11% into a single "Others" group.
cshtml
<ejs-accumulationchart id="groupedChart">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData"
xName="xValue"
yName="yValue"
groupTo="11">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>适用场景: 将低于11%的数值合并为单个“其他”分组。
Pattern 4: Funnel Chart with Export
模式4:带导出功能的漏斗图
cshtml
<button id="exportBtn">Export as PNG</button>
<ejs-accumulationchart id="funnelChart">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData"
xName="xValue"
yName="yValue"
type="Funnel"
neckWidth="15%"
neckHeight="18%">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>
<script>
document.getElementById('exportBtn').onclick = function() {
var chart = document.getElementById('funnelChart').ej2_instances[0];
chart.export('PNG', 'funnel-chart');
};
</script>Use Case: Sales funnel visualization with image export.
cshtml
<button id="exportBtn">Export as PNG</button>
<ejs-accumulationchart id="funnelChart">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="@chartData"
xName="xValue"
yName="yValue"
type="Funnel"
neckWidth="15%"
neckHeight="18%">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>
<script>
document.getElementById('exportBtn').onclick = function() {
var chart = document.getElementById('funnelChart').ej2_instances[0];
chart.export('PNG', 'funnel-chart');
};
</script>适用场景: 销售漏斗可视化,支持图片导出。
API Reference
API参考
AccumulationChart Class
AccumulationChart类
Represents the main accumulation chart component. All properties are defined in the namespace.
Syncfusion.EJ2.Charts代表累计图表的核心组件,所有属性都定义在命名空间下。
Syncfusion.EJ2.ChartsConstructor
构造函数
csharp
public AccumulationChart()csharp
public AccumulationChart()Core Properties
核心属性
| Property | Type | Default | Description | API Reference |
|---|---|---|---|---|
| | null | Options to improve accessibility for accumulation chart elements | AccumulationAccessibility |
| | null | Annotations for highlighting specific data points | AccumulationAnnotationSettings |
| | null | Background color (hex or rgba) | - |
| | null | Background image URL | - |
| | null | Chart border configuration | AccumulationChartBorder |
| | null | Center position of pie/doughnut (x, y percentages) | AccumulationChartCenter |
| | null | Center label configuration for doughnut charts | AccumulationChartCenterLabel |
| | null | Chart data collection | - |
| | true | Enable chart animation on load | - |
| | true | Enable border on mouse hover | - |
| | true | Enable export to JPEG, PNG, SVG, PDF, XLSX, CSV | - |
| | false | Sanitize untrusted HTML in chart content | - |
| | false | Persist component state across page reloads | - |
| | false | Enable right-to-left rendering | - |
| | true | Auto-arrange labels to prevent overlap | - |
| | - | Focus border color for accessibility | - |
| | 0 | Focus border margin | - |
| | 1.5 | Focus border width | - |
| | null | Chart height (e.g., "450px", "100%") | - |
| | "" | Color for highlighting data points on hover | - |
| | None | Highlight mode: None or Point | AccumulationHighlightMode |
| | None | Pattern for highlighting series/points | SelectionPattern |
| | false | Enable multiple point selection (requires selectionMode=Point) | - |
| | null | Legend configuration | AccumulationChartLegendSettings |
| | "" | Culture/localization override (default: en-US) | - |
| | null | Chart margins (left, right, top, bottom) | AccumulationChartMargin |
| | null | Template for empty chart state | - |
| | null | Initial selected point indexes | - |
| | None | Selection mode: None or Point | AccumulationSelectionMode |
| | None | Pattern for selected series/points | SelectionPattern |
| | null | Chart series collection | AccumulationSeries |
| | null | Chart subtitle text | - |
| | null | Subtitle font and styling | AccumulationChartSubTitleStyle |
| | Material | Visual theme | AccumulationTheme |
| | null | Chart title text | - |
| | null | Title font and styling | AccumulationChartTitleStyleSettings |
| | null | Tooltip configuration | AccumulationChartTooltipSettings |
| | false | Use thousand separator for numbers | - |
| | null | Chart width (e.g., "100px", "100%") | - |
| 属性 | 类型 | 默认值 | 描述 | API参考 |
|---|---|---|---|---|
| | null | 优化累计图表元素无障碍访问能力的配置项 | AccumulationAccessibility |
| | null | 用于高亮特定数据点的注释配置 | AccumulationAnnotationSettings |
| | null | 背景颜色(十六进制或rgba格式) | - |
| | null | 背景图片URL | - |
| | null | 图表边框配置 | AccumulationChartBorder |
| | null | 饼图/环形图的中心位置(x、y百分比) | AccumulationChartCenter |
| | null | 环形图的中心标签配置 | AccumulationChartCenterLabel |
| | null | 图表数据集 | - |
| | true | 启用图表加载动画 | - |
| | true | 鼠标悬停时显示边框 | - |
| | true | 启用导出为JPEG、PNG、SVG、PDF、XLSX、CSV格式的能力 | - |
| | false | 对图表内容中的不可信HTML进行消毒处理 | - |
| | false | 页面重载时保留组件状态 | - |
| | false | 启用从右到左渲染 | - |
| | true | 自动排列标签避免重叠 | - |
| | - | 无障碍功能的焦点边框颜色 | - |
| | 0 | 焦点边框边距 | - |
| | 1.5 | 焦点边框宽度 | - |
| | null | 图表高度(例如"450px"、"100%") | - |
| | "" | 鼠标悬停时数据点的高亮颜色 | - |
| | None | 高亮模式:None或Point | AccumulationHighlightMode |
| | None | 高亮系列/数据点的图案 | SelectionPattern |
| | false | 启用多数据点选择(需要selectionMode=Point) | - |
| | null | 图例配置 | AccumulationChartLegendSettings |
| | "" | 文化/本地化覆盖(默认:en-US) | - |
| | null | 图表边距(左、右、上、下) | AccumulationChartMargin |
| | null | 空图表状态的模板 | - |
| | null | 初始选中的数据点索引 | - |
| | None | 选择模式:None或Point | AccumulationSelectionMode |
| | None | 选中系列/数据点的图案 | SelectionPattern |
| | null | 图表系列集合 | AccumulationSeries |
| | null | 图表副标题文本 | - |
| | null | 副标题字体与样式 | AccumulationChartSubTitleStyle |
| | Material | 视觉主题 | AccumulationTheme |
| | null | 图表标题文本 | - |
| | null | 标题字体与样式 | AccumulationChartTitleStyleSettings |
| | null | 工具提示配置 | AccumulationChartTooltipSettings |
| | false | 数字使用千位分隔符 | - |
| | null | 图表宽度(例如"100px"、"100%") | - |
Event Properties
事件属性
| Event | Type | Description |
|---|---|---|
| | Triggered after export completes |
| | Triggered after animation completes |
| | Triggered before annotation renders |
| | Triggered before export starts |
| | Triggered before print starts |
| | Triggered before window resize |
| | Triggered on double-click |
| | Triggered on mouse click |
| | Triggered on mouse down |
| | Triggered when cursor leaves |
| | Triggered on mouse move/hover |
| | Triggered on mouse up |
| | Triggered after legend click |
| | Triggered before legend renders |
| | Triggered before chart loads |
| | Triggered after chart loads |
| | Triggered when point is clicked |
| | Triggered when point is hovered |
| | Triggered before point renders |
| | Triggered after window resize completes |
| | Triggered after selection completes |
| | Triggered before series renders |
| | Triggered before data label renders |
| | Triggered before tooltip renders |
| 事件 | 类型 | 描述 |
|---|---|---|
| | 导出完成后触发 |
| | 动画完成后触发 |
| | 注释渲染前触发 |
| | 导出开始前触发 |
| | 打印开始前触发 |
| | 窗口调整大小前触发 |
| | 双击时触发 |
| | 鼠标点击时触发 |
| | 鼠标按下时触发 |
| | 光标离开时触发 |
| | 鼠标移动/悬停时触发 |
| | 鼠标松开时触发 |
| | 图例点击后触发 |
| | 图例渲染前触发 |
| | 图表加载前触发 |
| | 图表加载后触发 |
| | 数据点被点击时触发 |
| | 数据点被悬停时触发 |
| | 数据点渲染前触发 |
| | 窗口调整大小完成后触发 |
| | 选择完成后触发 |
| | 系列渲染前触发 |
| | 数据标签渲染前触发 |
| | 工具提示渲染前触发 |
AccumulationSeries Class
AccumulationSeries类
Represents a data series in the accumulation chart.
代表累计图表中的一个数据系列。
Properties
属性
| Property | Type | Default | Description | API Reference |
|---|---|---|---|---|
| | null | Series data collection | - |
| | null | Field name for X values (categories) | - |
| | null | Field name for Y values (numeric data) | - |
| | "Pie" | Series type: Pie, Pyramid, Funnel (Doughnut = Pie + innerRadius) | - |
| | "80%" | Chart radius (percentage or pixels) | - |
| | "0%" | Inner radius for doughnut effect (percentage) | - |
| | 0 | Start angle in degrees (0-360) | - |
| | 360 | End angle in degrees (0-360) | - |
| | false | Enable explosion on click | - |
| | null | Index of pre-exploded point | - |
| | "10%" | Distance exploded slice moves | - |
| | null | Grouping threshold (value or percentage) | - |
| | "Value" | Group mode: Value or Point | - |
| | "Others" | Name for grouped points | - |
| | "Linear" | Pyramid mode: Linear or Surface | - |
| | "Standard" | Funnel mode: Standard or Trapezoidal | - |
| | "20%" | Funnel neck width (percentage) | - |
| | "20%" | Funnel neck height (percentage) | - |
| | "80%" | Pyramid/Funnel width (percentage) | - |
| | "80%" | Pyramid/Funnel height (percentage) | - |
| | 0 | Gap between pyramid/funnel segments | - |
| | null | Custom color palette | - |
| | null | Field name for point colors | - |
| | null | Event triggered before point renders | - |
| | null | Data label configuration | AccumulationDataLabelSettings |
| | null | Empty point handling | AccumulationChartEmptyPointSettings |
| | null | Connector line styling | AccumulationChartConnector |
| | null | Series border styling | AccumulationChartBorder |
| | SeriesType | Legend icon shape | LegendShape |
| | null | Field for custom tooltip content | - |
| 属性 | 类型 | 默认值 | 描述 | API参考 |
|---|---|---|---|---|
| | null | 系列数据集 | - |
| | null | X值(分类)对应的字段名 | - |
| | null | Y值(数值数据)对应的字段名 | - |
| | "Pie" | 系列类型:Pie、Pyramid、Funnel(Doughnut = Pie + innerRadius) | - |
| | "80%" | 图表半径(百分比或像素) | - |
| | "0%" | 实现环形效果的内半径(百分比) | - |
| | 0 | 起始角度(0-360度) | - |
| | 360 | 结束角度(0-360度) | - |
| | false | 启用点击弹出切片功能 | - |
| | null | 预弹出切片的索引 | - |
| | "10%" | 切片弹出的距离 | - |
| | null | 分组阈值(数值或百分比) | - |
| | "Value" | 分组模式:Value或Point | - |
| | "Others" | 分组合并后的名称 | - |
| | "Linear" | 金字塔模式:Linear或Surface | - |
| | "Standard" | 漏斗模式:Standard或Trapezoidal | - |
| | "20%" | 漏斗颈部宽度(百分比) | - |
| | "20%" | 漏斗颈部高度(百分比) | - |
| | "80%" | 金字塔/漏斗宽度(百分比) | - |
| | "80%" | 金字塔/漏斗高度(百分比) | - |
| | 0 | 金字塔/漏斗分段之间的间距 | - |
| | null | 自定义调色板 | - |
| | null | 数据点颜色对应的字段名 | - |
| | null | 数据点渲染前触发的事件 | - |
| | null | 数据标签配置 | AccumulationDataLabelSettings |
| | null | 空数据点处理配置 | AccumulationChartEmptyPointSettings |
| | null | 连接线样式配置 | AccumulationChartConnector |
| | null | 系列边框样式 | AccumulationChartBorder |
| | SeriesType | 图例图标形状 | LegendShape |
| | null | 自定义工具提示内容对应的字段名 | - |
AccumulationDataLabelSettings Class
AccumulationDataLabelSettings类
Configures data labels displayed on data points.
配置数据点上显示的数据标签。
Properties
属性
| Property | Type | Default | Description |
|---|---|---|---|
| | false | Show/hide data labels |
| | "Outside" | Label position: Inside or Outside |
| | null | Field name for label text |
| | null | HTML template for labels |
| | null | Number format (e.g., "p1", "n2", "c2") |
| | "Normal" | Text wrapping: Normal, Wrap, AnyWhere |
| | null | Max label width (pixels) |
| | null | Font configuration |
| | null | Label border configuration |
| | "Line" | Connector type: Line or Curve |
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| | false | 显示/隐藏数据标签 |
| | "Outside" | 标签位置:Inside或Outside |
| | null | 标签文本对应的字段名 |
| | null | 标签的HTML模板 |
| | null | 数字格式(例如"p1"、"n2"、"c2") |
| | "Normal" | 文本换行:Normal、Wrap、AnyWhere |
| | null | 标签最大宽度(像素) |
| | null | 字体配置 |
| | null | 标签边框配置 |
| | "Line" | 连接线类型:Line或Curve |
AccumulationChartLegendSettings Class
AccumulationChartLegendSettings类
Configures the legend for the chart.
配置图表的图例。
Properties
属性
| Property | Type | Default | Description | API Reference |
|---|---|---|---|---|
| | false | Show/hide legend | - |
| | "Right" | Legend position: Top, Bottom, Left, Right | LegendPosition |
| | "Center" | Legend alignment: Near, Center, Far | Alignment |
| | "0" | Legend width (pixels or percentage) | - |
| | "0" | Legend height (pixels or percentage) | - |
| | false | Reverse legend item order | - |
| | "Vertical" | Layout: Vertical or Horizontal | - |
| | null | Max columns in horizontal layout | - |
| | 15 | Legend shape width | - |
| | 15 | Legend shape height | - |
| | null | Legend title configuration | - |
| | null | Custom HTML template for legend | - |
| | "Normal" | Text wrapping: Normal or Wrap | - |
| | null | Max legend item label width | - |
| | false | Enable paging for large legends | - |
| | true | Toggle point visibility on legend click | - |
| 属性 | 类型 | 默认值 | 描述 | API参考 |
|---|---|---|---|---|
| | false | 显示/隐藏图例 | - |
| | "Right" | 图例位置:Top、Bottom、Left、Right | LegendPosition |
| | "Center" | 图例对齐方式:Near、Center、Far | Alignment |
| | "0" | 图例宽度(像素或百分比) | - |
| | "0" | 图例高度(像素或百分比) | - |
| | false | 反转图例项顺序 | - |
| | "Vertical" | 布局:Vertical或Horizontal | - |
| | null | 水平布局下的最大列数 | - |
| | 15 | 图例形状宽度 | - |
| | 15 | 图例形状高度 | - |
| | null | 图例标题配置 | - |
| | null | 图例的自定义HTML模板 | - |
| | "Normal" | 文本换行:Normal或Wrap | - |
| | null | 图例项标签的最大宽度 | - |
| | false | 大量图例时启用分页 | - |
| | true | 点击图例时切换数据点可见性 | - |
AccumulationChartTooltipSettings Class
AccumulationChartTooltipSettings类
Configures tooltips for the chart.
配置图表的工具提示。
Properties
属性
| Property | Type | Default | Description |
|---|---|---|---|
| | false | Enable/disable tooltips |
| | null | Custom tooltip header |
| | null | Tooltip text format |
| | null | HTML template for tooltips |
| | null | Tooltip background color |
| | null | Tooltip border configuration |
| | null | Tooltip text styling |
| | null | Fixed tooltip position (x, y) |
| | 1 | Tooltip opacity |
| | false | Show shared tooltip |
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| | false | 启用/禁用工具提示 |
| | null | 自定义工具提示头部 |
| | null | 工具提示文本格式 |
| | null | 工具提示的HTML模板 |
| | null | 工具提示背景颜色 |
| | null | 工具提示边框配置 |
| | null | 工具提示文本样式 |
| | null | 固定工具提示位置(x、y坐标) |
| | 1 | 工具提示透明度 |
| | false | 展示共享工具提示 |
Available Enumerations
可用枚举
| Enum | Values | Description |
|---|---|---|
| Fabric, FabricDark, Bootstrap4, Bootstrap, BootstrapDark, HighContrastLight, HighContrast, Tailwind, TailwindDark, Bootstrap5, Bootstrap5Dark, Fluent, FluentDark, Fluent2, Fluent2Dark, Fluent2HighContrast, Material3, Material3Dark, Material, MaterialDark | Chart theme options |
| None, Point | Highlight behavior |
| None, Point | Selection behavior |
| None, Chessboard, Dots, DiagonalForward, Crosshatch, Pacman, DiagonalBackward, Grid, Turquoise, Star, Triangle, Circle, Tile, HorizontalDash, VerticalDash, Rectangle, Box, VerticalStripe, HorizontalStripe, Bubble | Pattern options for highlighting/selection |
| Circle, Rectangle, Triangle, Diamond, Cross, HorizontalLine, VerticalLine, Pentagon, InvertedTriangle, SeriesType | Legend icon shapes |
| 枚举 | 取值 | 描述 |
|---|---|---|
| Fabric, FabricDark, Bootstrap4, Bootstrap, BootstrapDark, HighContrastLight, HighContrast, Tailwind, TailwindDark, Bootstrap5, Bootstrap5Dark, Fluent, FluentDark, Fluent2, Fluent2Dark, Fluent2HighContrast, Material3, Material3Dark, Material, MaterialDark | 图表主题选项 |
| None, Point | 高亮行为 |
| None, Point | 选择行为 |
| None, Chessboard, Dots, DiagonalForward, Crosshatch, Pacman, DiagonalBackward, Grid, Turquoise, Star, Triangle, Circle, Tile, HorizontalDash, VerticalDash, Rectangle, Box, VerticalStripe, HorizontalStripe, Bubble | 高亮/选择的图案选项 |
| Circle, Rectangle, Triangle, Diamond, Cross, HorizontalLine, VerticalLine, Pentagon, InvertedTriangle, SeriesType | 图例图标形状 |
Related Classes
相关类
| Class | Namespace | Description | API Reference |
|---|---|---|---|
| Syncfusion.EJ2.Charts | Border configuration | AccumulationChartBorder |
| Syncfusion.EJ2.Charts | Center position | AccumulationChartCenter |
| Syncfusion.EJ2.Charts | Margin configuration | AccumulationChartMargin |
| Syncfusion.EJ2.Charts | Connector line styling | AccumulationChartConnector |
| Syncfusion.EJ2.Charts | Empty point handling | AccumulationChartEmptyPointSettings |
| Syncfusion.EJ2.Charts | Annotation configuration | AccumulationAnnotationSettings |
| Syncfusion.EJ2.Charts | Accessibility options | AccumulationAccessibility |
| 类 | 命名空间 | 描述 | API参考 |
|---|---|---|---|
| Syncfusion.EJ2.Charts | 边框配置 | AccumulationChartBorder |
| Syncfusion.EJ2.Charts | 中心位置配置 | AccumulationChartCenter |
| Syncfusion.EJ2.Charts | 边距配置 | AccumulationChartMargin |
| Syncfusion.EJ2.Charts | 连接线样式配置 | AccumulationChartConnector |
| Syncfusion.EJ2.Charts | 空数据点处理配置 | AccumulationChartEmptyPointSettings |
| Syncfusion.EJ2.Charts | 注释配置 | AccumulationAnnotationSettings |
| Syncfusion.EJ2.Charts | 无障碍功能选项 | AccumulationAccessibility |
Key Properties
核心属性
AccumulationChart Properties
AccumulationChart属性
| Property | Type | Description | Example |
|---|---|---|---|
| boolean | Auto-arrange labels to prevent overlap | |
| object | Position of chart center (x, y percentages) | |
| object | Legend configuration (position, alignment) | |
| object | Tooltip configuration and templates | |
| string | Chart title text | |
| string | Chart height | |
| string | Chart width | |
| string | Visual theme | |
| string | Background color | |
| 属性 | 类型 | 描述 | 示例 |
|---|---|---|---|
| boolean | 自动排列标签避免重叠 | |
| object | 图表中心位置(x、y百分比) | |
| object | 图例配置(位置、对齐方式) | |
| object | 工具提示配置与模板 | |
| string | 图表标题文本 | |
| string | 图表高度 | |
| string | 图表宽度 | |
| string | 视觉主题 | |
| string | 背景颜色 | |
AccumulationSeries Properties
AccumulationSeries属性
| Property | Type | Description | Example |
|---|---|---|---|
| string | Chart type: Pie, Pyramid, Funnel (Doughnut = Pie + innerRadius) | |
| object[] | Data collection | |
| string | Field for category labels | |
| string | Field for values | |
| string | Chart radius (percentage or pixel) | |
| string | Inner radius for doughnut (percentage) | |
| number | Start angle in degrees | |
| number | End angle in degrees | |
| boolean | Enable slice explosion on click | |
| number | Index of pre-exploded slice | |
| string | Explode distance | |
| string | Threshold for grouping | |
| string | Group by: Point, Value | |
| 属性 | 类型 | 描述 | 示例 |
|---|---|---|---|
| string | 图表类型:Pie、Pyramid、Funnel(Doughnut = Pie + innerRadius) | |
| object[] | 数据集 | |
| string | 分类标签对应的字段 | |
| string | 数值对应的字段 | |
| string | 图表半径(百分比或像素) | |
| string | 环形图内半径(百分比) | |
| number | 起始角度(度) | |
| number | 结束角度(度) | |
| boolean | 启用点击弹出切片功能 | |
| number | 预弹出切片的索引 | |
| string | 弹出距离 | |
| string | 分组阈值 | |
| string | 分组依据:Point、Value | |
DataLabel Properties
DataLabel属性
| Property | Type | Description | Example |
|---|---|---|---|
| boolean | Show/hide data labels | |
| string | Inside or Outside | |
| string | Field name for label text | |
| string | Custom HTML template | |
| string | Line or Curve | |
| object | Font customization | |
| 属性 | 类型 | 描述 | 示例 |
|---|---|---|---|
| boolean | 显示/隐藏数据标签 | |
| string | 内部或外部 | |
| string | 标签文本对应的字段名 | |
| string | 自定义HTML模板 | |
| string | 直线或曲线 | |
| object | 字体自定义 | |
Common Use Cases
常见使用场景
1. Market Share Analysis
1. 市场份额分析
Display product/service market distribution with pie charts showing competitor percentages.
用饼图展示竞品占比,呈现产品/服务的市场分布情况。
2. Budget Allocation
2. 预算分配
Visualize department spending or resource allocation with doughnut charts and center totals.
用环形图和中心总数值可视化部门支出或资源分配情况。
3. Survey Results
3. 调查结果
Present poll or survey responses with grouped categories for small values.
用分组分类展示投票或调查的反馈结果,合并小占比选项。
4. Sales Funnel Tracking
4. 销售漏斗追踪
Monitor conversion stages from leads to customers using funnel charts.
用漏斗图监控从线索到客户的转化阶段。
5. Organizational Hierarchy
5. 组织架构
Display team size distribution or role distribution with pyramid charts.
用金字塔图展示团队规模分布或角色分布。
6. Mobile Dashboards
6. 移动端仪表盘
Create responsive data visualizations optimized for touch interactions and small screens.
创建适配触摸交互和小屏幕的响应式数据可视化图表。
7. Report Generation
7. 报告生成
Export charts as images or PDFs for automated reporting systems.
将图表导出为图片或PDF,用于自动化报告系统。
8. Real-Time Monitoring
8. 实时监控
Update charts dynamically to show live statistics (server status, user activity).
动态更新图表展示实时统计数据(服务器状态、用户活跃度)。
Related Components
相关组件
- Chart: For line, bar, column, area, and other Cartesian charts
- RangeNavigator: For timeline-based data exploration
- StockChart: For financial data visualization
- TreeMap: For hierarchical data with rectangles
- Chart: 用于折线图、柱状图、面积图等笛卡尔坐标系图表
- RangeNavigator: 用于基于时间线的数据探索
- StockChart: 用于金融数据可视化
- TreeMap: 用矩形展示层级数据
Browser Support
浏览器支持
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Opera (latest)
- Chrome(最新版)
- Firefox(最新版)
- Safari(最新版)
- Edge(最新版)
- Opera(最新版)
Additional Resources
额外资源
Next Steps:
- Read getting-started.md for detailed installation
- Explore chart-types.md for type-specific features
- Review data-visualization.md for styling
- Check accessibility.md for compliance requirements
后续步骤:
- 阅读 getting-started.md 了解详细安装流程
- 查看 chart-types.md 了解不同图表类型的特性
- 参考 data-visualization.md 学习样式自定义
- 查阅 accessibility.md 满足合规要求