syncfusion-blazor-sparkline-charts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing Sparkline Charts
实现Sparkline Charts
When to Use This Skill
何时使用本技能
Use this skill when you need to guide the user to implement Syncfusion Blazor Sparkline Charts in their application. Sparklines are small, word-sized charts designed to show trends in data at a glance - perfect for inline visualization within text, tables, or dashboards.
Use this when the user:
- Wants to add inline trend charts to dashboards or tables
- Needs compact KPI indicators with visual trends
- Asks about small charts, mini charts, or micro charts
- Wants to visualize trends without full chart axes/labels
- Needs data-dense visualizations for limited space
- Asks about sparkline, line trends, or inline data visualization
- Wants to add visual indicators to email reports or mobile views
当你需要指导用户在其应用中实现Syncfusion Blazor Sparkline Charts时,可使用本技能。迷你走势图(Sparkline)是小巧的、文字尺寸的图表,旨在快速展示数据趋势——非常适合嵌入文本、表格或仪表盘内进行可视化。
适用于以下用户场景:
- 希望在仪表盘或表格中添加嵌入式趋势图表
- 需要带有可视化趋势的紧凑KPI指标
- 询问关于小型图表、迷你图表或微图表的实现方法
- 希望在不显示完整图表坐标轴/标签的情况下可视化趋势
- 需要在有限空间内实现数据密集型可视化
- 询问关于sparkline、折线趋势或嵌入式数据可视化的问题
- 希望在邮件报表或移动端视图中添加可视化指标
Component Overview
组件概述
Sparkline Charts are specialized data visualizations optimized for small spaces. Unlike full-featured charts, sparklines:
- Display trends without axes, legends, or extensive labels
- Fit inline within text or table cells
- Show data patterns at a glance
- Support multiple chart types (line, area, column, WinLoss, pie)
- Highlight special data points (high, low, negative, start, end)
- Provide tooltips for detailed information on hover
Perfect for: KPI dashboards, data tables, financial reports, analytics summaries, mobile interfaces, email reports, and any scenario requiring compact trend visualization.
Sparkline Charts是专为小空间优化的特殊数据可视化组件。与全功能图表不同,迷你走势图:
- 无需坐标轴、图例或大量标签即可展示趋势
- 可嵌入文本或表格单元格内
- 快速呈现数据模式
- 支持多种图表类型(折线、面积、柱状、WinLoss、饼图)
- 高亮特殊数据点(最高、最低、负值、起始、结束)
- 提供悬停时显示详细信息的工具提示
适用场景: KPI仪表盘、数据表格、财务报表、分析摘要、移动界面、邮件报表,以及任何需要紧凑趋势可视化的场景。
Documentation and Navigation Guide
文档与导航指南
This skill uses progressive disclosure. The main SKILL.md (this file) provides overview and navigation. Read the appropriate reference files based on what the user needs:
本技能采用渐进式披露方式。主文档SKILL.md(即本文档)提供概述与导航。根据用户需求阅读对应的参考文档:
API Reference
API参考
📄 Read: references/api-reference.md
- Complete property, method, and event surface
SfSparkline - Supported child components and nested tags
- Enum and value-type reference
- Compact example for quick implementation
📄 阅读: references/api-reference.md
- 完整的属性、方法和事件说明
SfSparkline - 支持的子组件和嵌套标签
- 枚举和值类型参考
- 快速实现的简洁示例
Getting Started
快速入门
📄 Read: references/getting-started.md
- Installation and NuGet package setup
- Basic sparkline implementation
- CSS theme imports
- First working example
- WebAssembly vs Server setup differences
📄 阅读: references/getting-started.md
- 安装和NuGet包配置
- 基础迷你走势图实现
- CSS主题导入
- 第一个可运行示例
- WebAssembly与Server模式的配置差异
Chart Types and Visualization
图表类型与可视化
📄 Read: references/chart-types.md
- Line sparkline (default, shows continuous trends)
- Area sparkline (filled line chart)
- Column sparkline (vertical bars)
- WinLoss sparkline (binary win/loss indicators)
- Pie sparkline (proportional segments)
- When to use each type
- Type-specific properties and examples
📄 Read: references/data-binding.md
- DataSource property configuration
- Array and list data binding
- XName and YName field mapping
- Value types and formatting
- Dynamic data updates
- Data transformation patterns
📄 阅读: references/chart-types.md
- 折线迷你走势图(默认类型,展示连续趋势)
- 面积迷你走势图(填充式折线图表)
- 柱状迷你走势图(垂直条形)
- WinLoss迷你走势图(二元盈亏指标)
- 饼图迷你走势图(比例分段)
- 各类型的适用场景
- 类型专属属性与示例
📄 阅读: references/data-binding.md
- DataSource属性配置
- 数组与列表数据绑定
- XName和YName字段映射
- 值类型与格式化
- 动态数据更新
- 数据转换模式
Data Presentation
数据展示
📄 Read: references/markers-and-data-labels.md
- Marker configuration (shapes, sizes, colors)
- Data label visibility and formatting
- Edge label handling
- Label templates
- Marker visibility for specific points
📄 Read: references/special-points-customization.md
- Highlighting start and end points
- High point customization
- Low point customization
- Negative point styling
- Color and size configuration for special points
📄 Read: references/range-bands.md
- Range band configuration (horizontal threshold zones)
- Start and end range values
- Color and opacity customization
- Multiple range bands
- Use cases: targets, thresholds, acceptable ranges
📄 阅读: references/markers-and-data-labels.md
- 标记点配置(形状、尺寸、颜色)
- 数据标签可见性与格式化
- 边缘标签处理
- 标签模板
- 指定点的标记点可见性
📄 阅读: references/special-points-customization.md
- 高亮起始和结束点
- 最高点自定义
- 最低点自定义
- 负值点样式
- 特殊点的颜色与尺寸配置
📄 阅读: references/range-bands.md
- 范围带配置(水平阈值区域)
- 范围起始与结束值
- 颜色与透明度自定义
- 多范围带设置
- 适用场景:目标值、阈值、可接受范围
Customization and Styling
自定义与样式
📄 Read: references/axis-customization.md
- Axis line visibility and styling
- Min and max value configuration
- Value display modes
- Axis label formatting
- Grid line customization
📄 Read: references/dimensions-and-appearance.md
- Width and height configuration
- Padding and margins
- Border styling
- Background and fill colors
- Line width customization
- RTL (right-to-left) support
- Container area styling
📄 阅读: references/axis-customization.md
- 坐标轴线条可见性与样式
- 最小值与最大值配置
- 值显示模式
- 坐标轴标签格式化
- 网格线自定义
📄 阅读: references/dimensions-and-appearance.md
- 宽度与高度配置
- 内边距与外边距
- 边框样式
- 背景与填充色
- 线条宽度自定义
- RTL(从右到左)支持
- 容器区域样式
Interactivity and Events
交互性与事件
📄 Read: references/user-interaction-and-events.md
- Tooltip configuration and templates
- Tooltip formatting
- Tracking line for hover
- Component events (,
OnLoaded,OnPointRendering,OnSeriesRendering,OnMarkerRendering,OnDataLabelRendering,OnPointRegionMouseClick,OnResizing)OnAxisRendering - Method:
RefreshAsync() - User interaction patterns
📄 阅读: references/user-interaction-and-events.md
- 工具提示配置与模板
- 工具提示格式化
- 悬停跟踪线
- 组件事件(,
OnLoaded,OnPointRendering,OnSeriesRendering,OnMarkerRendering,OnDataLabelRendering,OnPointRegionMouseClick,OnResizing)OnAxisRendering - 方法:
RefreshAsync() - 用户交互模式
Globalization and Accessibility
全球化与可访问性
📄 Read: references/globalization-and-accessibility.md
- Internationalization and localization
- Number format customization
- Currency and date formatting
- RTL support
- WCAG compliance
- Keyboard navigation
- Screen reader support
📄 阅读: references/globalization-and-accessibility.md
- 国际化与本地化
- 数字格式自定义
- 货币与日期格式化
- RTL支持
- WCAG合规性
- 键盘导航
- 屏幕阅读器支持
Quick Start Example
快速入门示例
Here's a minimal sparkline showing sales trends:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<h3>Monthly Sales Trend</h3>
<SfSparkline DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="SparklineType.Line"
Height="50px"
Width="200px"
Fill="#3366cc"
LineWidth="2" TValue="SalesInfo">
<SparklineMarkerSettings Visible="new List<VisibleType> { VisibleType.All }"
Size="4"
Fill="#ffffff"
Border="new SparklineMarkerBorder { Color = "#3366cc", Width = 1 }">
</SparklineMarkerSettings>
<SparklineTooltipSettings TValue="SalesInfo" Visible="true" Format="${Month}: ${Sales}"></SparklineTooltipSettings>
</SfSparkline>
@code {
public class SalesInfo
{
public string Month { get; set; }
public double Sales { get; set; }
}
public List<SalesInfo> SalesData = new List<SalesInfo>
{
new SalesInfo { Month = "Jan", Sales = 35000 },
new SalesInfo { Month = "Feb", Sales = 28000 },
new SalesInfo { Month = "Mar", Sales = 34000 },
new SalesInfo { Month = "Apr", Sales = 32000 },
new SalesInfo { Month = "May", Sales = 40000 },
new SalesInfo { Month = "Jun", Sales = 32000 },
new SalesInfo { Month = "Jul", Sales = 35000 }
};
}Result: A compact line chart showing monthly sales trends with markers and tooltips.
以下是展示销售趋势的最简迷你走势图:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<h3>Monthly Sales Trend</h3>
<SfSparkline DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="SparklineType.Line"
Height="50px"
Width="200px"
Fill="#3366cc"
LineWidth="2" TValue="SalesInfo">
<SparklineMarkerSettings Visible="new List<VisibleType> { VisibleType.All }"
Size="4"
Fill="#ffffff"
Border="new SparklineMarkerBorder { Color = "#3366cc", Width = 1 }">
</SparklineMarkerSettings>
<SparklineTooltipSettings TValue="SalesInfo" Visible="true" Format="${Month}: ${Sales}"></SparklineTooltipSettings>
</SfSparkline>
@code {
public class SalesInfo
{
public string Month { get; set; }
public double Sales { get; set; }
}
public List<SalesInfo> SalesData = new List<SalesInfo>
{
new SalesInfo { Month = "Jan", Sales = 35000 },
new SalesInfo { Month = "Feb", Sales = 28000 },
new SalesInfo { Month = "Mar", Sales = 34000 },
new SalesInfo { Month = "Apr", Sales = 32000 },
new SalesInfo { Month = "May", Sales = 40000 },
new SalesInfo { Month = "Jun", Sales = 32000 },
new SalesInfo { Month = "Jul", Sales = 35000 }
};
}效果: 一个紧凑的折线图表,展示月度销售趋势,带有标记点和工具提示。
Common Patterns
常见模式
Pattern 1: KPI Dashboard with Sparklines
模式1:带迷你走势图的KPI仪表盘
When user needs a dashboard showing multiple KPIs with trend indicators:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<div class="kpi-grid">
<div class="kpi-card">
<h4>Revenue</h4>
<p class="value">$1.2M <span class="change positive">+15%</span></p>
<SfSparkline DataSource="@RevenueData" Type="SparklineType.Area" Height="40px" Width="150px" Fill="#28a745">
</SfSparkline>
</div>
<div class="kpi-card">
<h4>Orders</h4>
<p class="value">5,432 <span class="change negative">-3%</span></p>
<SfSparkline DataSource="@OrdersData" Type="SparklineType.Column" Height="40px" Width="150px" Fill="#dc3545">
</SfSparkline>
</div>
</div>
@code {
public List<double> RevenueData { get; set; } = new()
{
820000, 900000, 870000, 960000, 1100000, 1200000
};
public List<double> OrdersData { get; set; } = new()
{
5200, 5400, 5600, 5300, 5500, 5432
};
}Guide user to: Use Area type for cumulative metrics, Column for discrete counts, and configure special points to highlight highs/lows.
当用户需要展示多个带趋势指标的KPI仪表盘时:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<div class="kpi-grid">
<div class="kpi-card">
<h4>Revenue</h4>
<p class="value">$1.2M <span class="change positive">+15%</span></p>
<SfSparkline DataSource="@RevenueData" Type="SparklineType.Area" Height="40px" Width="150px" Fill="#28a745">
</SfSparkline>
</div>
<div class="kpi-card">
<h4>Orders</h4>
<p class="value">5,432 <span class="change negative">-3%</span></p>
<SfSparkline DataSource="@OrdersData" Type="SparklineType.Column" Height="40px" Width="150px" Fill="#dc3545">
</SfSparkline>
</div>
</div>
@code {
public List<double> RevenueData { get; set; } = new()
{
820000, 900000, 870000, 960000, 1100000, 1200000
};
public List<double> OrdersData { get; set; } = new()
{
5200, 5400, 5600, 5300, 5500, 5432
};
}指导用户: 对累积指标使用面积类型,对离散计数使用柱状类型,并配置特殊点来高亮最高/最低值。
Pattern 2: Data Table with Inline Trends
模式2:带嵌入式趋势的数据表格
When user wants to add sparklines to table cells:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<table class="data-table">
<thead>
<tr>
<th>Product</th>
<th>Current</th>
<th>Trend (7 days)</th>
</tr>
</thead>
<tbody>
@foreach (var product in Products)
{
<tr>
<td>@product.Name</td>
<td>@product.CurrentValue.ToString("C")</td>
<td>
<SfSparkline DataSource="@product.TrendData"
Type="SparklineType.Line"
Height="30px"
Width="100px"
LineWidth="1">
</SfSparkline>
</td>
</tr>
}
</tbody>
</table>
@code {
public class ProductInfo
{
public string Name { get; set; }
public decimal CurrentValue { get; set; }
public List<double> TrendData { get; set; } = new();
}
public List<ProductInfo> Products { get; set; } = new()
{
new ProductInfo
{
Name = "Product A",
CurrentValue = 1250.75m,
TrendData = new List<double> { 1200, 1220, 1235, 1240, 1245, 1250, 1251 }
},
new ProductInfo
{
Name = "Product B",
CurrentValue = 980.30m,
TrendData = new List<double> { 950, 955, 960, 970, 975, 980, 980 }
}
};
}Guide user to: Keep sparklines minimal (no markers, no labels), use consistent dimensions across rows, and enable tooltips for details.
当用户希望在表格单元格中添加迷你走势图时:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<table class="data-table">
<thead>
<tr>
<th>Product</th>
<th>Current</th>
<th>Trend (7 days)</th>
</tr>
</thead>
<tbody>
@foreach (var product in Products)
{
<tr>
<td>@product.Name</td>
<td>@product.CurrentValue.ToString("C")</td>
<td>
<SfSparkline DataSource="@product.TrendData"
Type="SparklineType.Line"
Height="30px"
Width="100px"
LineWidth="1">
</SfSparkline>
</td>
</tr>
}
</tbody>
</table>
@code {
public class ProductInfo
{
public string Name { get; set; }
public decimal CurrentValue { get; set; }
public List<double> TrendData { get; set; } = new();
}
public List<ProductInfo> Products { get; set; } = new()
{
new ProductInfo
{
Name = "Product A",
CurrentValue = 1250.75m,
TrendData = new List<double> { 1200, 1220, 1235, 1240, 1245, 1250, 1251 }
},
new ProductInfo
{
Name = "Product B",
CurrentValue = 980.30m,
TrendData = new List<double> { 950, 955, 960, 970, 975, 980, 980 }
}
};
}指导用户: 保持迷你走势图简洁(无标记点、无标签),在各行间使用一致的尺寸,并启用工具提示展示详情。
Pattern 3: Win/Loss Indicator
模式3:盈亏指标
When user needs binary success/failure visualization:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<SfSparkline DataSource="@WinLossData"
Type="SparklineType.WinLoss"
Height="50px"
Width="300px"
TiePointColor="#ffc107">
<SparklineAxisSettings MinY="-1" MaxY="1"></SparklineAxisSettings>
</SfSparkline>Guide user to: Use WinLoss type with values of 1 (win), -1 (loss), and 0 (tie). Configure TiePointColor for neutral outcomes.
当用户需要展示二元成功/失败可视化时:
razor
@page "/sparkline-demo"
@using Syncfusion.Blazor.Charts
<SfSparkline DataSource="@WinLossData"
Type="SparklineType.WinLoss"
Height="50px"
Width="300px"
TiePointColor="#ffc107">
<SparklineAxisSettings MinY="-1" MaxY="1"></SparklineAxisSettings>
</SfSparkline>指导用户: 使用WinLoss类型,值为1(赢)、-1(输)、0(平局)。配置TiePointColor来展示中性结果。
Pattern 4: Highlighting Special Points
模式4:高亮特殊点
When user wants to emphasize specific data points:
razor
@using Syncfusion.Blazor.Charts
<SfSparkline DataSource="@TemperatureData"
Type="SparklineType.Line"
Height="60px"
Width="250px">
<SparklineMarkerSettings Visible="new List<VisibleType> { VisibleType.High, VisibleType.Low }">
</SparklineMarkerSettings>
<SparklineHighPointColor>#28a745</SparklineHighPointColor>
<SparklineLowPointColor>#dc3545</SparklineLowPointColor>
</SfSparkline>
@code {
public List<int> WinLossData { get; set; } = new()
{
1, 1, -1, 0, 1, -1, 1, 1, 0, -1
};
}Guide user to: Use VisibleType enumeration to show markers only for High/Low/Start/End/Negative points. Configure colors for visual emphasis.
当用户希望强调特定数据点时:
razor
@using Syncfusion.Blazor.Charts
<SfSparkline DataSource="@TemperatureData"
Type="SparklineType.Line"
Height="60px"
Width="250px">
<SparklineMarkerSettings Visible="new List<VisibleType> { VisibleType.High, VisibleType.Low }">
</SparklineMarkerSettings>
<SparklineHighPointColor>#28a745</SparklineHighPointColor>
<SparklineLowPointColor>#dc3545</SparklineLowPointColor>
</SfSparkline>
@code {
public List<int> WinLossData { get; set; } = new()
{
1, 1, -1, 0, 1, -1, 1, 1, 0, -1
};
}指导用户: 使用VisibleType枚举仅为最高/最低/起始/结束/负值点显示标记点。配置颜色以实现视觉强调。
API Surface Reference
API表面参考
Use the API reference file for the authoritative surface. The most important members are:
SfSparklineComponent properties:
- ,
DataSource,EnableGroupingSeparator,EnableRtl,EndPointColor,Fill,Format,Height,HighPointColor,ID,LineWidth,LowPointColor,NegativePointColor,Opacity,Palette,Query,RangePadding,StartPointColor,Theme,TiePointColor,Type,ValueType,Width,XNameYName
Methods:
RefreshAsync()
Events:
- ,
OnAxisRendering,OnDataLabelRendering,OnLoaded,OnMarkerRendering,OnPointRegionMouseClick,OnPointRendering,OnResizingOnSeriesRendering
Child components:
- ,
SparklineAxisLineSettings,SparklineAxisSettings,SparklineBorder,SparklineContainerArea,SparklineContainerAreaBorder,SparklineDataLabelBorder,SparklineDataLabelOffset,SparklineDataLabelSettings,SparklineEvents,SparklineFont,SparklineMarkerBorder,SparklineMarkerSettings,SparklinePadding,SparklineRangeBand,SparklineRangeBandSettings,SparklineTooltipBorder,SparklineTooltipSettings,SparklineTooltipTextStyleSparklineTrackLineSettings
Enums:
- ,
SparklineRangePadding,SparklineType,SparklineValueTypeVisibleType
请参考API参考文档获取的权威说明。最重要的成员包括:
SfSparkline组件属性:
- ,
DataSource,EnableGroupingSeparator,EnableRtl,EndPointColor,Fill,Format,Height,HighPointColor,ID,LineWidth,LowPointColor,NegativePointColor,Opacity,Palette,Query,RangePadding,StartPointColor,Theme,TiePointColor,Type,ValueType,Width,XNameYName
方法:
RefreshAsync()
事件:
- ,
OnAxisRendering,OnDataLabelRendering,OnLoaded,OnMarkerRendering,OnPointRegionMouseClick,OnPointRendering,OnResizingOnSeriesRendering
子组件:
- ,
SparklineAxisLineSettings,SparklineAxisSettings,SparklineBorder,SparklineContainerArea,SparklineContainerAreaBorder,SparklineDataLabelBorder,SparklineDataLabelOffset,SparklineDataLabelSettings,SparklineEvents,SparklineFont,SparklineMarkerBorder,SparklineMarkerSettings,SparklinePadding,SparklineRangeBand,SparklineRangeBandSettings,SparklineTooltipBorder,SparklineTooltipSettings,SparklineTooltipTextStyleSparklineTrackLineSettings
枚举:
- ,
SparklineRangePadding,SparklineType,SparklineValueTypeVisibleType
Common Use Cases
常见使用场景
Use Case 1: Financial Dashboard
场景1:金融仪表盘
User wants to show stock prices, portfolio performance, or financial KPIs with inline trends. Guide to: Line or Area sparklines with special point highlighting for highs/lows.
用户希望展示股票价格、投资组合表现或带嵌入式趋势的财务KPI。指导方案: 使用折线或面积迷你走势图,高亮最高/最低值等特殊点。
Use Case 2: Analytics Dashboard
场景2:分析仪表盘
User needs compact visualizations for page views, user engagement, or conversion rates. Guide to: Column sparklines for discrete metrics, Area for cumulative data.
用户需要为页面浏览量、用户参与度或转化率创建紧凑可视化。指导方案: 对离散指标使用柱状迷你走势图,对累积数据使用面积类型。
Use Case 3: Reporting Tables
场景3:报表表格
User wants to add visual trends to data tables without cluttering the layout. Guide to: Minimal Line sparklines (30-40px height) with tooltips enabled.
用户希望在数据表格中添加可视化趋势,同时避免布局混乱。指导方案: 使用简洁的折线迷你走势图(高度30-40px),启用工具提示。
Use Case 4: Email Reports
场景4:邮件报表
User needs charts that render well in email clients with size constraints. Guide to: Simple sparklines without complex styling, fixed dimensions.
用户需要在邮件客户端中良好渲染且受尺寸限制的图表。指导方案: 使用无复杂样式的简单迷你走势图,设置固定尺寸。
Use Case 5: Mobile Dashboards
场景5:移动仪表盘
User requires data visualization optimized for small screens. Guide to: Compact sparklines with touch-friendly tooltips, responsive dimensions.
用户需要针对小屏幕优化的数据可视化。指导方案: 使用紧凑的迷你走势图,搭配触控友好的工具提示和响应式尺寸。
Use Case 6: Performance Monitoring
场景6:性能监控
User wants to visualize server metrics, response times, or system health. Guide to: Line sparklines with range bands for threshold zones (green/yellow/red).
用户希望可视化服务器指标、响应时间或系统健康状况。指导方案: 使用折线迷你走势图,添加范围带作为阈值区域(绿/黄/红)。
Use Case 7: E-commerce Analytics
场景7:电商分析
User needs product performance trends, sales velocity, or inventory indicators. Guide to: Column sparklines for sales counts, WinLoss for stock status.
用户需要产品表现趋势、销售速度或库存指标。指导方案: 对销售计数使用柱状迷你走势图,对库存状态使用WinLoss类型。
Implementation Tips
实现技巧
When guiding users:
- Start Simple: Begin with basic DataSource and Type, add features incrementally
- Choose Type Based on Data: Line for continuous trends, Column for discrete counts, WinLoss for binary outcomes
- Keep It Minimal: Sparklines work best with minimal styling - avoid clutter
- Enable Tooltips: Since sparklines lack axes, tooltips provide essential details
- Consider Context: Match sparkline size to surrounding content (inline vs. standalone)
- Use Special Points: Highlight meaningful data points (high/low) for quick insights
- Consistent Sizing: Use uniform dimensions when displaying multiple sparklines
- Test Responsiveness: Ensure sparklines scale appropriately on different screen sizes
Read the appropriate reference files above based on the specific features the user needs to implement.
指导用户时需注意:
- 从简开始: 先配置基础的DataSource和Type,逐步添加功能
- 根据数据选择类型: 折线用于连续趋势,柱状用于离散计数,WinLoss用于二元结果
- 保持简洁: 迷你走势图在极简样式下效果最佳,避免杂乱
- 启用工具提示: 由于迷你走势图无坐标轴,工具提示可提供关键详情
- 考虑上下文: 匹配迷你走势图尺寸与周边内容(嵌入式 vs 独立式)
- 使用特殊点: 高亮有意义的数据点(最高/最低)以快速获取洞察
- 统一尺寸: 展示多个迷你走势图时使用一致的尺寸
- 测试响应性: 确保迷你走势图在不同屏幕尺寸下能适当缩放
根据用户需要实现的具体功能,阅读上述对应的参考文档。