
Syncfusion Blazor Charts
- 262 installs
- 4 repo stars
- Updated July 28, 2026
- syncfusion/blazor-ui-components-skills
Use syncfusion-blazor-charts for development tasks
About
syncfusion-blazor-charts: A skill for development. This provides functionality for development workflows.
- syncfusion-blazor-charts
Syncfusion Blazor Charts by the numbers
- 262 all-time installs (skills.sh)
- +15 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #1,474 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/syncfusion/blazor-ui-components-skills --skill syncfusion-blazor-chartsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 262 |
|---|---|
| repo stars | ★ 4 |
| Last updated | July 28, 2026 |
| Repository | syncfusion/blazor-ui-components-skills ↗ |
What it does
Use syncfusion-blazor-charts for development tasks
Files
Implementing Syncfusion Blazor Charts
NuGet: Syncfusion.Blazor.Charts + Syncfusion.Blazor.Themes Namespace: Syncfusion.Blazor.Charts
A comprehensive guide for implementing the Syncfusion Blazor Chart component to create interactive, feature-rich data visualizations in Blazor applications. The Chart component supports 33+ chart types, multiple axes, advanced interactivity, and extensive customization options.
When to Use This Skill
Use this skill when you need to:
- Create data visualizations in Blazor applications (line, column, bar, area, etc.)
- Implement financial charts for stock analysis (candle, HILO, HILOOC)
- Build statistical visualizations (histogram, box-whisker, pareto, waterfall)
- Display comparative data with stacked or grouped charts
- Show range-based data with range area/column charts
- Create polar or radar charts for circular data representation
- Add interactive features like tooltips, zooming, crosshair, selection
- Customize chart appearance with themes, gradients, annotations
- Handle dynamic data with live updates and data editing
- Implement accessible charts with ARIA support and internationalization
Component Overview
The Syncfusion Blazor Chart component is a powerful data visualization tool that provides:
- 33+ Chart Types: Line, Column, Bar, Area, Spline, Scatter, Bubble, Candle, HILO, Polar, Radar, and more
- Multiple Axes: Support for category, numeric, datetime, and logarithmic axes
- Rich Interactivity: Zooming, panning, crosshair, trackball, tooltips, selection
- Data Binding: Work with List, DataManager, dynamic updates, and live data
- Visual Elements: Markers, data labels, annotations, legends, gradients
- Advanced Features: Technical indicators, trend lines, strip lines, multiple panes
- Accessibility: Full ARIA support, keyboard navigation, localization, RTL
- Customization: Themes, responsive design, print support, adaptive layout
Documentation and Navigation Guide
Complete API Reference
📄 Read: references/api-reference.md
CRITICAL: Use this reference FIRST for all API-related questions
Use this authoritative API reference when:
- Looking up correct enum values (ChartSeriesType, ValueType, SelectionMode, etc.)
- Finding public method signatures (RefreshAsync, ExportAsync, ShowTooltip, etc.)
- Verifying property names and types
- Generating code samples
- Troubleshooting API-related issues
Topics covered:
- Complete list of SfChart public methods with signatures
- All chart enumerations with correct values
- Key component classes and their properties
- Method usage examples
- Common patterns and best practices
Key Points:
- All enum values are exact - do not use variations
- Method names follow C# conventions (e.g.,
RefreshAsyncnotRefresh) - Always use
@refto access chart instance for method calls - Namespace:
Syncfusion.Blazor.Charts
---
Getting Started
📄 Read: references/getting-started.md
Use this when:
- Setting up a new Blazor Chart project
- Installing NuGet packages and configuring services
- Creating your first chart component
- Understanding basic chart structure and data binding
- Working with Visual Studio, VS Code, or .NET CLI
Topics covered:
- Installation and prerequisites
- Package setup (Syncfusion.Blazor.Charts)
- Namespace imports and service registration
- Script references
- Basic chart implementation
- Simple data binding example
---
Chart Types
Common Chart Types
📄 Read: references/chart-types-common.md
Use this for frequently-used chart types:
- Line charts for trend visualization
- Area charts for showing magnitude over time
- Column charts for categorical comparisons
- Bar charts for horizontal comparisons
- Spline charts for smooth curves
- Step charts for stepped data progression
Topics covered:
- Line, Area, Column, Bar chart implementations
- Spline and Spline Area variations
- Step Line and Step Area patterns
- When to use each chart type
- Configuration and customization
- Multi-series examples
Specialized Chart Types
📄 Read: references/chart-types-specialized.md
Use this for specialized visualization needs:
- Financial charts (Candle, HILO, HILOOC)
- Statistical charts (Box-Whisker, Histogram, Error Bar, Pareto, Waterfall)
- Stacked charts (Stack Area/Bar/Column/Line)
- Range charts (Range Area/Column/Step Area)
- Polar and Radar charts
- Scatter and Bubble charts
- Vertical chart orientation
Topics covered:
- Financial chart patterns and configurations
- Statistical analysis chart types
- Stacking modes (normal vs 100%)
- Range visualization techniques
- Circular chart layouts
- XY scatter relationships
- Chart orientation options
---
Axes and Data Configuration
📄 Read: references/axes-and-scales.md
Use this when:
- Configuring axis types (category, numeric, datetime, logarithmic)
- Customizing axis appearance and behavior
- Formatting axis labels and values
- Working with multiple axes
- Setting axis ranges and intervals
Topics covered:
- Category axis for discrete data
- Numeric axis for continuous values
- DateTime axis for time-series data
- Logarithmic axis for exponential data
- Axis customization (title, range, interval)
- Label formatting, rotation, and positioning
- Multiple axis configuration
- Inverse and opposed axes
📄 Read: references/data-handling.md
Use this when:
- Binding data sources to charts
- Adding, removing, or updating data dynamically
- Enabling data editing
- Sorting chart data
- Working with live or streaming data
Topics covered:
- Data source binding (List, DataManager)
- Dynamic data operations
- Data editing functionality
- Chart sorting options
- Real-time data updates
- Data serialization patterns
---
Visual Elements
📄 Read: references/visual-elements.md
Use this when:
- Adding data markers to chart points
- Displaying data labels on series
- Creating custom label templates
- Adding annotations (text, shapes, images)
- Applying gradient fills
Topics covered:
- Data marker types and customization
- Data label visibility and formatting
- Label positioning strategies
- Data label templates
- Last data label highlighting
- Chart annotations (text, shapes, images)
- Gradient color fills
📄 Read: references/legend.md
Use this when:
- Enabling and configuring chart legend
- Positioning legend (top, bottom, left, right)
- Customizing legend appearance
- Implementing legend click behavior
- Creating custom legend templates
Topics covered:
- Legend visibility and positioning
- Legend shape and text customization
- Interactive legend (toggle series)
- Legend pagination
- Custom legend templates
- Legend alignment options
---
Interactive Features
📄 Read: references/interactive-features.md
Use this when:
- Enabling tooltips with custom formatting
- Adding crosshair or trackball for data tracking
- Implementing point, series, or cluster selection
- Enabling zooming and panning
- Creating interactive user experiences
Topics covered:
- Tooltip configuration and templates
- Crosshair and trackball features
- Selection modes and patterns
- Zoom types (selection, pinch, mousewheel)
- Zoom toolbar configuration
- Pan functionality
- User interaction events
---
Customization and Appearance
📄 Read: references/appearance-styling.md
Use this when:
- Customizing chart appearance and themes
- Setting chart dimensions and sizing
- Configuring responsive/adaptive layout
- Enabling print functionality
- Styling background, borders, and margins
Topics covered:
- Chart appearance customization
- Theme configuration
- Chart dimensions and sizing
- Responsive design patterns
- Adaptive layout for mobile
- Print support
- Background and border styling
- Gradient customization
📄 Read: references/advanced-features.md
Use this when:
- Adding technical indicators (EMA, SMA, RSI, etc.)
- Implementing trend lines (linear, exponential, polynomial)
- Creating strip lines (horizontal/vertical bands)
- Using multiple panes (sub-charts)
- Handling empty points
Topics covered:
- Technical indicators for financial charts
- Trend line types and configuration
- Strip line patterns
- Multiple pane layouts
- Empty point handling strategies
- Row and column definitions
---
Accessibility and Internationalization
📄 Read: references/accessibility-internationalization.md
Use this when:
- Implementing accessible charts (ARIA, keyboard nav)
- Configuring advanced accessibility features
- Enabling internationalization (i18n)
- Setting up localization (l10n)
- Supporting RTL layouts
Topics covered:
- Accessibility features and ARIA support
- Keyboard navigation patterns
- Advanced accessibility configuration
- Internationalization setup
- Localization resources
- RTL support
- Screen reader compatibility
---
Events
📄 Read: references/events.md
Use this when:
- Handling chart lifecycle events
- Responding to user interactions (clicks, mouse events)
- Listening to axis, series, or point events
- Implementing custom event handlers
- Triggering actions on zoom, pan, or selection
Topics covered:
- Chart load and render events
- Point and series events
- Mouse events (click, move, leave)
- Axis label render events
- Legend events
- Zoom and pan events
- Selection events
- Event handler patterns
---
Practical Examples and How-To Guides
📄 Read: references/practical-examples.md
Use this for common implementation scenarios:
- Adding/removing series dynamically
- Hiding axes programmatically
- Converting milliseconds to datetime
- Updating points dynamically
- Implementing lazy loading
- Creating live/real-time charts
- Getting selected data
- Synchronizing multiple charts
- Adding threshold lines
- Custom tooltip tables
Topics covered:
- Dynamic series management
- Axis visibility control
- Date conversion techniques
- Dynamic point updates
- Lazy loading patterns
- Live chart implementation
- Selection data retrieval
- Chart synchronization
- Threshold line implementation
- Custom tooltip tables
---
Public Methods Reference
The SfChart component provides several public methods for programmatic control. Always use @ref to access these methods:
Essential Methods
<SfChart @ref="ChartRef">
<!-- Configuration -->
</SfChart>
@code {
SfChart ChartRef;
// Refresh the chart
async Task RefreshChart() => await ChartRef.RefreshAsync();
// Export the chart
async Task ExportChart() => await ChartRef.ExportAsync(ExportType.PNG, "chart.png");
// Print the chart
async Task PrintChart() => await ChartRef.PrintAsync();
// Show/Hide tooltip
void ShowChartTooltip() => ChartRef.ShowTooltip("January", 35);
void HideChartTooltip() => ChartRef.HideTooltip();
// Show/Hide crosshair
void ShowChartCrosshair() => ChartRef.ShowCrosshair(100, 50);
void HideChartCrosshair() => ChartRef.HideCrosshair();
// Selection control
void ClearSelections() => ChartRef.ClearSelection();
// Sorting
void SortData() => ChartRef.Sort("YValue", ListSortDirection.Descending);
void ClearChartSort() => ChartRef.ClearSort();
}See [references/api-reference.md](references/api-reference.md) for complete method documentation.
---
⚠️ CRITICAL: API Usage Guidelines
1. Enum Names - MUST Use Full Namespace
Syncfusion Blazor Charts requires FULLY QUALIFIED enum names:
<!-- ✅ CORRECT - Use full namespace -->
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
<ChartSeries Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" />
<!-- ❌ WRONG - Short form will cause errors -->
<ChartPrimaryXAxis ValueType="ValueType.Category" />
<ChartSeries Type="ChartSeriesType.Column" />Always use `Syncfusion.Blazor.Charts.` prefix for:
ValueType(Category, Double, DateTime, etc.)ChartSeriesType(Column, Line, Area, etc.)LegendPosition,SelectionMode,ZoomMode,ChartShape, etc.
2. Component Property Restrictions
⚠️ Common Property Errors to Avoid:
ChartCrosshairLine - Limited Properties
<!-- ✅ CORRECT - Only Width and Color supported -->
<ChartCrosshairSettings Enable="true">
<ChartCrosshairLine Width="1" Color="#666"></ChartCrosshairLine>
</ChartCrosshairSettings>
<!-- ❌ WRONG - DashArray NOT supported on ChartCrosshairLine -->
<ChartCrosshairLine Width="1" Color="#666" DashArray="5,5"></ChartCrosshairLine>Supported ChartCrosshairLine Properties:
Width- Line width (number)Color- Line color (string)
NOT Supported:
- ❌
DashArray- Will cause runtime error - ❌
Opacity- Not available on this component
Striplines - Use Plural Form
<!-- ✅ CORRECT - ChartStriplines (plural) -->
<ChartPrimaryYAxis>
<ChartStriplines>
<ChartStripline Start="50" End="60" Color="red" />
</ChartStriplines>
</ChartPrimaryYAxis>
<!-- ❌ WRONG - ChartAxisStripLineSettings does not exist -->
<ChartAxisStripLineSettings>
<ChartAxisStripLine Start="50" End="60" />
</ChartAxisStripLineSettings>3. Validation Checklist
Before deploying, verify:
- ✅ All enums use
Syncfusion.Blazor.Charts.prefix - ✅ ChartCrosshairLine uses ONLY Width and Color
- ✅ Striplines use
<ChartStriplines>and<ChartStripline> - ✅ Component references use
@reffor method access - ✅ Property names match official API exactly (case-sensitive)
---
Quick Start Example
Here's a minimal example to create a column chart with data:
@page "/chart-demo"
@using Syncfusion.Blazor.Charts
<SfChart Title="Sales Analysis">
<ChartPrimaryXAxis Title="Month" ValueType="Syncfusion.Blazor.Charts.ValueType.Category">
</ChartPrimaryXAxis>
<ChartPrimaryYAxis Title="Sales in Dollar">
</ChartPrimaryYAxis>
<ChartTooltipSettings Enable="true"></ChartTooltipSettings>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData"
Name="Sales"
XName="Month"
YName="SalesValue"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
<ChartMarker>
<ChartDataLabel Visible="true"></ChartDataLabel>
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public class SalesInfo
{
public string Month { get; set; }
public double SalesValue { get; set; }
}
public List<SalesInfo> SalesData = new List<SalesInfo>
{
new SalesInfo { Month = "Jan", SalesValue = 35 },
new SalesInfo { Month = "Feb", SalesValue = 28 },
new SalesInfo { Month = "Mar", SalesValue = 34 },
new SalesInfo { Month = "Apr", SalesValue = 32 },
new SalesInfo { Month = "May", SalesValue = 40 },
new SalesInfo { Month = "Jun", SalesValue = 32 }
};
}Prerequisites: 1. Install Syncfusion.Blazor.Charts NuGet package 2. Add @using Syncfusion.Blazor.Charts to _Imports.razor 3. Register service: builder.Services.AddSyncfusionBlazor(); in Program.cs 4. Add script reference in App.razor
---
Common Patterns
Multi-Series Comparison Chart
<SfChart Title="Product Sales Comparison">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@Product1Sales" XName="Month" YName="Sales"
Name="Product 1" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
<ChartSeries DataSource="@Product2Sales" XName="Month" YName="Sales"
Name="Product 2" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
<ChartLegendSettings Visible="true"></ChartLegendSettings>
</SfChart>Time-Series Line Chart with Zooming
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"
Title="Date">
</ChartPrimaryXAxis>
<ChartZoomSettings EnableSelectionZooming="true"
EnablePan="true"
EnableMouseWheelZooming="true">
</ChartZoomSettings>
<ChartSeriesCollection>
<ChartSeries DataSource="@TimeSeriesData"
XName="Date"
YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Stacked Area Chart with Legend
<SfChart Title="Resource Allocation">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@ResourceData1" XName="Period" YName="Hours"
Name="Development" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingArea">
</ChartSeries>
<ChartSeries DataSource="@ResourceData2" XName="Period" YName="Hours"
Name="Testing" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingArea">
</ChartSeries>
<ChartSeries DataSource="@ResourceData3" XName="Period" YName="Hours"
Name="Documentation" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingArea">
</ChartSeries>
</ChartSeriesCollection>
<ChartLegendSettings Visible="true" Position="Syncfusion.Blazor.Charts.LegendPosition.Bottom">
</ChartLegendSettings>
</SfChart>---
Key Configuration Properties
Chart Component (SfChart)
Title- Chart title textWidth/Height- Chart dimensions (accepts px or %, default: "100%")Theme- Visual theme (see Theme enum in API reference)Background- Chart background colorEnableAnimation- Enable/disable animation (default: true)SelectionMode- Selection mode (None, Series, Point, Cluster, DragXY, DragX, DragY, Lasso)HighlightMode- Highlight mode (None, Series, Point, Cluster)
Primary Axes (ChartPrimaryXAxis, ChartPrimaryYAxis)
ValueType- Axis type:Syncfusion.Blazor.Charts.ValueType.Category,ValueType.Double,ValueType.DateTime,ValueType.Logarithmic,ValueType.DateTimeCategoryTitle- Axis titleMinimum/Maximum- Axis rangeInterval- Spacing between labelsLabelFormat- Format string for labels (e.g., "C0", "N2", "dd MMM")EdgeLabelPlacement- Edge label handling (None, Hide, Shift)LabelIntersectAction- Label intersection handling (None, Hide, Trim, Wrap, MultipleRows, Rotate45, Rotate90)- Striplines - Use
<ChartStriplines>(plural) for horizontal/vertical bands
Series (ChartSeries)
DataSource- Data collection (IEnumerable<object>)XName/YName- Property names for X and Y values (case-sensitive)Type- Chart type:Syncfusion.Blazor.Charts.ChartSeriesType.Column,ChartSeriesType.Line, etc. (see API reference)Name- Series name for legendFill- Series color (CSS color string)Width- Line/border width (pixels)DashArray- Dash pattern (e.g., "5,5")Opacity- Transparency (0 to 1)
Interactivity
ChartTooltipSettings- Tooltip configurationEnable- Show/hide tooltipShared- Enable shared tooltip for multiple seriesFormat- Custom tooltip formatTemplate- Custom tooltip template (RenderFragment)ChartZoomSettings- Zoom and pan optionsEnableSelectionZooming- Enable selection-based zoomEnableMouseWheelZooming- Enable mouse wheel zoomEnablePinchZooming- Enable pinch zoom (touch devices)EnablePan- Enable panningMode- Zoom mode (X, Y, XY)SelectionMode- Selection behavior (see SelectionMode enum)ChartCrosshairSettings- Crosshair configurationEnable- Show/hide crosshairLineType- Crosshair line type (Vertical, Horizontal, Both)ChartCrosshairLine- Line style (Width, Color ONLY - NO DashArray)
Visual Elements
ChartMarker- Data point markersVisible- Show/hide markersShape- Marker shape (see ChartShape enum)Width/Height- Marker dimensionsChartDataLabel- Data labels on pointsVisible- Show/hide labelsPosition- Label positionTemplate- Custom label templateChartLegendSettings- Legend configurationVisible- Show/hide legendPosition- Legend position (see LegendPosition enum)ChartAnnotations- Custom annotations- Support for text, images, and shapes
---
Additional Resources
- Official Documentation: Syncfusion Blazor Chart Documentation
- API Reference: Chart API
- Live Demos: Blazor Chart Demos
Accessibility and Internationalization Reference
Table of Contents
- Accessibility Features
- ARIA Labels and Roles
- Keyboard Navigation
- Screen Reader Support
- High Contrast Modes
- Focus Management
- Internationalization (i18n)
- Locale Configuration
- Number Formatting
- Date Formatting
- Currency Symbols
- Localization (l10n)
- Text Translation
- RTL Support
- Custom Locales
- Loading Locale Data
- Color Accessibility
- WCAG Compliance
- Color-Blind Friendly Palettes
- Contrast Ratios
- Pattern Alternatives
- Responsive Accessibility
- Touch Target Sizing
- Mobile Accessibility
- Adaptive Features
- Testing and Validation
- Accessibility Testing Tools
- Compliance Checklists
- Common Issues and Fixes
Accessibility Features
ARIA Labels and Roles
Syncfusion Blazor Charts follow WAI-ARIA standards to provide semantic information for assistive technologies.
Default ARIA Attributes
@using Syncfusion.Blazor.Charts
<SfChart Title="Sales Analysis">
<ChartPrimaryXAxis Title="Months" />
<ChartPrimaryYAxis Title="Revenue" />
<ChartSeriesCollection>
<ChartSeries DataSource="@ChartData" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Revenue">
<ChartMarker>
<ChartDataLabel Visible="true" />
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<SalesData> ChartData = new List<SalesData>
{
new SalesData { Month = "Jan", Sales = 35 },
new SalesData { Month = "Feb", Sales = 28 },
new SalesData { Month = "Mar", Sales = 42 }
};
public class SalesData
{
public string Month { get; set; }
public double Sales { get; set; }
}
}ARIA Role Mappings
| Element | ARIA Role | Description |
|---|---|---|
| Chart Container | region | Main chart area |
| Legend | button | Toggleable series visibility |
| Data Point | img | Individual data representations |
| Tooltip | tooltip | Contextual information |
| Axis Labels | text | Axis value descriptions |
Keyboard Navigation
Complete keyboard support following WCAG 2.2 guidelines.
Basic Navigation
@using Syncfusion.Blazor.Charts
<SfChart Title="Keyboard Accessible Chart">
<ChartPrimaryXAxis Title="Years" />
<ChartPrimaryYAxis Title="Growth %" />
<ChartLegendSettings Visible="true" Position="LegendPosition.Top" />
<ChartZoomSettings EnableSelectionZooming="true"
EnableMouseWheelZooming="true">
<ChartZoomToolbarButtons>
<ChartZoomToolbarButton>Zoom</ChartZoomToolbarButton>
<ChartZoomToolbarButton>ZoomIn</ChartZoomToolbarButton>
<ChartZoomToolbarButton>ZoomOut</ChartZoomToolbarButton>
<ChartZoomToolbarButton>Pan</ChartZoomToolbarButton>
<ChartZoomToolbarButton>Reset</ChartZoomToolbarButton>
</ChartZoomToolbarButtons>
</ChartZoomSettings>
<ChartSeriesCollection>
<ChartSeries DataSource="@GrowthData" XName="Year" YName="Rate"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line" Name="Growth Rate" />
</ChartSeriesCollection>
</SfChart>
@code {
public List<GrowthInfo> GrowthData = new List<GrowthInfo>
{
new GrowthInfo { Year = 2020, Rate = 5.2 },
new GrowthInfo { Year = 2021, Rate = 6.8 },
new GrowthInfo { Year = 2022, Rate = 7.5 }
};
public class GrowthInfo
{
public int Year { get; set; }
public double Rate { get; set; }
}
}Keyboard Shortcuts Reference
| Key Combination | Action |
|---|---|
Alt + J | Focus chart element |
Tab / Shift + Tab | Navigate elements |
Arrow Keys | Navigate data points/series |
Enter / Space | Select/toggle element |
Ctrl + + / Ctrl + - | Zoom in/out |
Arrow Keys (during pan) | Pan chart |
R | Reset zoom |
Ctrl + P | Print chart |
Screen Reader Support
Optimize chart content for screen readers with descriptive labels.
@using Syncfusion.Blazor.Charts
<SfChart Title="Quarterly Revenue Report"
Description="Bar chart showing quarterly revenue from Q1 to Q4">
<ChartPrimaryXAxis Title="Quarter" />
<ChartPrimaryYAxis Title="Revenue in Millions" LabelFormat="c0" />
<ChartTooltipSettings Enable="true"
Format="${point.x}: ${point.y}" />
<ChartSeriesCollection>
<ChartSeries DataSource="@RevenueData" XName="Quarter" YName="Amount"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Bar" Name="Revenue">
<ChartMarker>
<ChartDataLabel Visible="true" Position="LabelPosition.Top">
<ChartDataLabelFont FontWeight="600" />
</ChartDataLabel>
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<QuarterData> RevenueData = new List<QuarterData>
{
new QuarterData { Quarter = "Q1", Amount = 25.5 },
new QuarterData { Quarter = "Q2", Amount = 32.8 },
new QuarterData { Quarter = "Q3", Amount = 28.3 },
new QuarterData { Quarter = "Q4", Amount = 41.2 }
};
public class QuarterData
{
public string Quarter { get; set; }
public double Amount { get; set; }
}
}High Contrast Modes
Support system high contrast themes for improved visibility.
@using Syncfusion.Blazor.Charts
<SfChart Title="High Contrast Chart" Theme="Theme.HighContrast">
<ChartPrimaryXAxis Title="Categories" />
<ChartPrimaryYAxis Title="Values" />
<ChartSeriesCollection>
<ChartSeries DataSource="@ContrastData" XName="Category" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Series 1">
<ChartSeriesBorder Width="2" Color="#FFFFFF" />
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<CategoryData> ContrastData = new List<CategoryData>
{
new CategoryData { Category = "A", Value = 45 },
new CategoryData { Category = "B", Value = 62 },
new CategoryData { Category = "C", Value = 38 }
};
public class CategoryData
{
public string Category { get; set; }
public double Value { get; set; }
}
}Focus Management
Implement proper focus indicators and management.
@using Syncfusion.Blazor.Charts
<SfChart Title="Focus Managed Chart">
<ChartPrimaryXAxis Title="Products" />
<ChartPrimaryYAxis Title="Units Sold" />
<ChartSeriesCollection>
<ChartSeries DataSource="@ProductData" XName="Product" YName="Units"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Sales">
<ChartSeriesAnimation Enable="true" Duration="1000" />
<ChartEmptyPointSettings Mode="EmptyPointMode.Gap" />
</ChartSeries>
</ChartSeriesCollection>
<ChartSelectionSettings Enable="true" Mode="Syncfusion.Blazor.Charts.SelectionMode.Point">
<ChartSelectionPattern>
<ChartSelectionPattern Type="SelectionPattern.Dots" />
</ChartSelectionPattern>
</ChartSelectionSettings>
</SfChart>
@code {
public List<ProductInfo> ProductData = new List<ProductInfo>
{
new ProductInfo { Product = "Laptop", Units = 120 },
new ProductInfo { Product = "Phone", Units = 250 },
new ProductInfo { Product = "Tablet", Units = 95 }
};
public class ProductInfo
{
public string Product { get; set; }
public double Units { get; set; }
}
}---
Internationalization (i18n)
Locale Configuration
Configure chart to use specific locales for formatting.
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Charts
@using System.Globalization
<SfChart Title="International Sales" Locale="de-DE">
<ChartPrimaryXAxis Title="Monat" ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
<ChartPrimaryYAxis Title="Verkäufe" LabelFormat="c2" />
<ChartTooltipSettings Enable="true" Format="${point.x}: ${point.y}" />
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line" Name="Verkäufe" />
</ChartSeriesCollection>
</SfChart>
@code {
protected override void OnInitialized()
{
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("de-DE");
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("de-DE");
}
public List<MonthlySales> SalesData = new List<MonthlySales>
{
new MonthlySales { Month = "Januar", Sales = 12500.50 },
new MonthlySales { Month = "Februar", Sales = 15300.75 },
new MonthlySales { Month = "März", Sales = 18200.25 }
};
public class MonthlySales
{
public string Month { get; set; }
public double Sales { get; set; }
}
}Number Formatting
Apply culture-specific number formatting.
@using Syncfusion.Blazor.Charts
@using System.Globalization
<SfChart Title="Number Formatting Examples">
<ChartPrimaryXAxis Title="Region" ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
<ChartPrimaryYAxis Title="Population" LabelFormat="n0" />
<ChartSeriesCollection>
<ChartSeries DataSource="@PopulationData" XName="Region" YName="Population"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Population">
<ChartMarker>
<ChartDataLabel Visible="true" Position="LabelPosition.Top">
<ChartDataLabelFont Size="10px" />
</ChartDataLabel>
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<RegionData> PopulationData = new List<RegionData>
{
new RegionData { Region = "Asia", Population = 4641054775 },
new RegionData { Region = "Africa", Population = 1340598147 },
new RegionData { Region = "Europe", Population = 747636026 }
};
public class RegionData
{
public string Region { get; set; }
public double Population { get; set; }
}
}Date Formatting
Format dates according to locale conventions.
@using Syncfusion.Blazor.Charts
<SfChart Title="Date Time Formatting">
<ChartPrimaryXAxis Title="Timeline" ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"
LabelFormat="MMM dd, yyyy" IntervalType="IntervalType.Months" />
<ChartPrimaryYAxis Title="Temperature (°C)" LabelFormat="n1" />
<ChartTooltipSettings Enable="true" Format="${point.x}: ${point.y}°C" />
<ChartSeriesCollection>
<ChartSeries DataSource="@TemperatureData" XName="Date" YName="Temp"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Spline" Name="Temperature">
<ChartMarker Visible="true" Height="7" Width="7" />
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<TempData> TemperatureData = new List<TempData>
{
new TempData { Date = new DateTime(2024, 1, 1), Temp = 15.5 },
new TempData { Date = new DateTime(2024, 2, 1), Temp = 18.2 },
new TempData { Date = new DateTime(2024, 3, 1), Temp = 22.8 },
new TempData { Date = new DateTime(2024, 4, 1), Temp = 25.3 }
};
public class TempData
{
public DateTime Date { get; set; }
public double Temp { get; set; }
}
}Currency Symbols
Display currency using locale-specific symbols.
@using Syncfusion.Blazor.Charts
@using System.Globalization
<SfChart Title="Multi-Currency Revenue">
<ChartPrimaryXAxis Title="Quarter" ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
<ChartPrimaryYAxis Title="Revenue" LabelFormat="c0" />
<ChartTooltipSettings Enable="true" Format="${series.name}<br/>${point.x}: ${point.y}" />
<ChartSeriesCollection>
<ChartSeries DataSource="@UsdRevenue" XName="Quarter" YName="Amount"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="USD Revenue" />
<ChartSeries DataSource="@EurRevenue" XName="Quarter" YName="Amount"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="EUR Revenue" />
</ChartSeriesCollection>
</SfChart>
@code {
public List<CurrencyData> UsdRevenue = new List<CurrencyData>
{
new CurrencyData { Quarter = "Q1", Amount = 125000 },
new CurrencyData { Quarter = "Q2", Amount = 138000 }
};
public List<CurrencyData> EurRevenue = new List<CurrencyData>
{
new CurrencyData { Quarter = "Q1", Amount = 110000 },
new CurrencyData { Quarter = "Q2", Amount = 125000 }
};
public class CurrencyData
{
public string Quarter { get; set; }
public double Amount { get; set; }
}
}---
Localization (l10n)
Text Translation
Translate chart text elements for different languages.
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Charts
<SfChart Title="@GetLocalizedText("ChartTitle")">
<ChartPrimaryXAxis Title="@GetLocalizedText("XAxisTitle")" />
<ChartPrimaryYAxis Title="@GetLocalizedText("YAxisTitle")" />
<ChartLegendSettings Visible="true" />
<ChartSeriesCollection>
<ChartSeries DataSource="@LocalizedData" XName="Category" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="@GetLocalizedText("SeriesName")" />
</ChartSeriesCollection>
</SfChart>
@code {
private string CurrentLocale = "en-US";
private Dictionary<string, Dictionary<string, string>> Translations = new()
{
["en-US"] = new Dictionary<string, string>
{
["ChartTitle"] = "Sales Overview",
["XAxisTitle"] = "Products",
["YAxisTitle"] = "Sales Amount",
["SeriesName"] = "Current Year"
},
["es-ES"] = new Dictionary<string, string>
{
["ChartTitle"] = "Resumen de Ventas",
["XAxisTitle"] = "Productos",
["YAxisTitle"] = "Monto de Ventas",
["SeriesName"] = "Año Actual"
},
["fr-FR"] = new Dictionary<string, string>
{
["ChartTitle"] = "Aperçu des Ventes",
["XAxisTitle"] = "Produits",
["YAxisTitle"] = "Montant des Ventes",
["SeriesName"] = "Année en Cours"
}
};
private string GetLocalizedText(string key)
{
return Translations[CurrentLocale].ContainsKey(key)
? Translations[CurrentLocale][key]
: key;
}
public List<LocaleData> LocalizedData = new List<LocaleData>
{
new LocaleData { Category = "A", Value = 120 },
new LocaleData { Category = "B", Value = 95 },
new LocaleData { Category = "C", Value = 150 }
};
public class LocaleData
{
public string Category { get; set; }
public double Value { get; set; }
}
}RTL Support
Enable right-to-left layout for RTL languages.
@using Syncfusion.Blazor.Charts
<SfChart Title="مخطط المبيعات" EnableRtl="true">
<ChartPrimaryXAxis Title="المنتجات" />
<ChartPrimaryYAxis Title="المبيعات" LabelFormat="n0" />
<ChartLegendSettings Visible="true" Position="LegendPosition.Top" />
<ChartSeriesCollection>
<ChartSeries DataSource="@RtlData" XName="Product" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Bar" Name="المبيعات الحالية">
<ChartMarker>
<ChartDataLabel Visible="true" Position="LabelPosition.Outer" />
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<ProductSales> RtlData = new List<ProductSales>
{
new ProductSales { Product = "محمول", Sales = 85000 },
new ProductSales { Product = "هاتف", Sales = 125000 },
new ProductSales { Product = "جهاز لوحي", Sales = 65000 }
};
public class ProductSales
{
public string Product { get; set; }
public double Sales { get; set; }
}
}Custom Locales
Define custom locale settings for specialized requirements.
@using Syncfusion.Blazor.Charts
@using System.Globalization
<SfChart Title="Custom Locale Chart">
<ChartPrimaryXAxis Title="Period" />
<ChartPrimaryYAxis Title="Metric" LabelFormat="{value}K" />
<ChartSeriesCollection>
<ChartSeries DataSource="@MetricData" XName="Period" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area" Name="Performance" Opacity="0.6" />
</ChartSeriesCollection>
</SfChart>
@code {
protected override void OnInitialized()
{
var customCulture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
customCulture.NumberFormat.NumberDecimalSeparator = ",";
customCulture.NumberFormat.NumberGroupSeparator = ".";
CultureInfo.DefaultThreadCurrentCulture = customCulture;
}
public List<MetricInfo> MetricData = new List<MetricInfo>
{
new MetricInfo { Period = "Jan", Value = 25.5 },
new MetricInfo { Period = "Feb", Value = 32.8 },
new MetricInfo { Period = "Mar", Value = 28.3 }
};
public class MetricInfo
{
public string Period { get; set; }
public double Value { get; set; }
}
}Loading Locale Data
Load and apply locale data dynamically.
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Charts
<div>
<label>Select Language: </label>
<select @onchange="ChangeLocale">
<option value="en-US">English</option>
<option value="de-DE">Deutsch</option>
<option value="ja-JP">日本語</option>
</select>
</div>
<SfChart Title="@ChartTitle" Locale="@SelectedLocale">
<ChartPrimaryXAxis Title="@XAxisTitle" />
<ChartPrimaryYAxis Title="@YAxisTitle" LabelFormat="c0" />
<ChartSeriesCollection>
<ChartSeries DataSource="@ChartData" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="@SeriesName" />
</ChartSeriesCollection>
</SfChart>
@code {
private string SelectedLocale = "en-US";
private string ChartTitle = "Monthly Sales";
private string XAxisTitle = "Month";
private string YAxisTitle = "Sales";
private string SeriesName = "Revenue";
private void ChangeLocale(ChangeEventArgs e)
{
SelectedLocale = e.Value.ToString();
LoadLocaleStrings(SelectedLocale);
}
private void LoadLocaleStrings(string locale)
{
switch (locale)
{
case "de-DE":
ChartTitle = "Monatliche Verkäufe";
XAxisTitle = "Monat";
YAxisTitle = "Verkäufe";
SeriesName = "Umsatz";
break;
case "ja-JP":
ChartTitle = "月次売上";
XAxisTitle = "月";
YAxisTitle = "売上";
SeriesName = "収益";
break;
default:
ChartTitle = "Monthly Sales";
XAxisTitle = "Month";
YAxisTitle = "Sales";
SeriesName = "Revenue";
break;
}
}
public List<SalesInfo> ChartData = new List<SalesInfo>
{
new SalesInfo { Month = "Jan", Sales = 45000 },
new SalesInfo { Month = "Feb", Sales = 52000 },
new SalesInfo { Month = "Mar", Sales = 48000 }
};
public class SalesInfo
{
public string Month { get; set; }
public double Sales { get; set; }
}
}---
Color Accessibility
WCAG Compliance
Ensure color choices meet WCAG 2.2 Level AA standards.
@using Syncfusion.Blazor.Charts
<SfChart Title="WCAG Compliant Chart">
<ChartPrimaryXAxis Title="Categories" />
<ChartPrimaryYAxis Title="Values" />
<ChartPalettes>
<ChartPalette>#0066CC</ChartPalette>
<ChartPalette>#E67300</ChartPalette>
<ChartPalette>#00994D</ChartPalette>
<ChartPalette>#CC0000</ChartPalette>
</ChartPalettes>
<ChartSeriesCollection>
<ChartSeries DataSource="@ComplianceData" XName="Category" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Accessible Colors">
<ChartSeriesBorder Width="2" Color="#FFFFFF" />
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<DataPoint> ComplianceData = new List<DataPoint>
{
new DataPoint { Category = "A", Value = 45 },
new DataPoint { Category = "B", Value = 62 },
new DataPoint { Category = "C", Value = 38 },
new DataPoint { Category = "D", Value = 71 }
};
public class DataPoint
{
public string Category { get; set; }
public double Value { get; set; }
}
}Color-Blind Friendly Palettes
Use palettes designed for various types of color blindness.
@using Syncfusion.Blazor.Charts
<SfChart Title="Color-Blind Friendly Chart">
<ChartPrimaryXAxis Title="Years" />
<ChartPrimaryYAxis Title="Growth Rate %" />
<ChartPalettes>
<ChartPalette>#0173B2</ChartPalette>
<ChartPalette>#DE8F05</ChartPalette>
<ChartPalette>#029E73</ChartPalette>
<ChartPalette>#CC78BC</ChartPalette>
<ChartPalette>#CA9161</ChartPalette>
</ChartPalettes>
<ChartSeriesCollection>
<ChartSeries DataSource="@SeriesA" XName="Year" YName="Rate"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line" Name="Product A">
<ChartMarker Visible="true" Height="8" Width="8" Shape="ChartShape.Circle" />
</ChartSeries>
<ChartSeries DataSource="@SeriesB" XName="Year" YName="Rate"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line" Name="Product B">
<ChartMarker Visible="true" Height="8" Width="8" Shape="ChartShape.Triangle" />
</ChartSeries>
<ChartSeries DataSource="@SeriesC" XName="Year" YName="Rate"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line" Name="Product C">
<ChartMarker Visible="true" Height="8" Width="8" Shape="ChartShape.Diamond" />
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<RateData> SeriesA = new List<RateData>
{
new RateData { Year = 2021, Rate = 5.2 },
new RateData { Year = 2022, Rate = 6.5 },
new RateData { Year = 2023, Rate = 7.8 }
};
public List<RateData> SeriesB = new List<RateData>
{
new RateData { Year = 2021, Rate = 4.8 },
new RateData { Year = 2022, Rate = 5.9 },
new RateData { Year = 2023, Rate = 6.2 }
};
public List<RateData> SeriesC = new List<RateData>
{
new RateData { Year = 2021, Rate = 6.1 },
new RateData { Year = 2022, Rate = 7.3 },
new RateData { Year = 2023, Rate = 8.5 }
};
public class RateData
{
public int Year { get; set; }
public double Rate { get; set; }
}
}Contrast Ratios
Maintain proper contrast ratios between chart elements.
@using Syncfusion.Blazor.Charts
<SfChart Title="High Contrast Chart" Background="#FFFFFF">
<ChartPrimaryXAxis Title="Months">
<ChartAxisMajorGridLines Color="#CCCCCC" />
<ChartAxisMinorGridLines Color="#EEEEEE" />
</ChartPrimaryXAxis>
<ChartPrimaryYAxis Title="Revenue">
<ChartAxisMajorGridLines Color="#CCCCCC" />
</ChartPrimaryYAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@ContrastData" XName="Month" YName="Revenue"
Fill="#0066CC" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Revenue">
<ChartSeriesBorder Width="2" Color="#003366" />
<ChartMarker>
<ChartDataLabel Visible="true" Position="LabelPosition.Top">
<ChartDataLabelFont Color="#000000" FontWeight="600" />
</ChartDataLabel>
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<MonthlyRevenue> ContrastData = new List<MonthlyRevenue>
{
new MonthlyRevenue { Month = "Jan", Revenue = 32000 },
new MonthlyRevenue { Month = "Feb", Revenue = 28000 },
new MonthlyRevenue { Month = "Mar", Revenue = 35000 }
};
public class MonthlyRevenue
{
public string Month { get; set; }
public double Revenue { get; set; }
}
}Pattern Alternatives
Provide pattern fills as alternatives to color coding.
@using Syncfusion.Blazor.Charts
<SfChart Title="Pattern-Based Chart">
<ChartPrimaryXAxis Title="Segments" />
<ChartPrimaryYAxis Title="Market Share %" />
<ChartSeriesCollection>
<ChartSeries DataSource="@PatternData" XName="Segment" YName="Share"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Market Share">
<ChartSeriesBorder Width="2" Color="#000000" />
</ChartSeries>
</ChartSeriesCollection>
<ChartSelectionSettings Enable="true">
<ChartSelectionPattern>
<ChartSelectionPattern Type="SelectionPattern.Dots" />
<ChartSelectionPattern Type="SelectionPattern.DiagonalForward" />
<ChartSelectionPattern Type="SelectionPattern.Crosshatch" />
</ChartSelectionPattern>
</ChartSelectionSettings>
</SfChart>
@code {
public List<MarketData> PatternData = new List<MarketData>
{
new MarketData { Segment = "Segment A", Share = 35.5 },
new MarketData { Segment = "Segment B", Share = 28.2 },
new MarketData { Segment = "Segment C", Share = 36.3 }
};
public class MarketData
{
public string Segment { get; set; }
public double Share { get; set; }
}
}---
Responsive Accessibility
Touch Target Sizing
Ensure touch targets meet minimum size requirements (44x44 pixels).
@using Syncfusion.Blazor.Charts
<SfChart Title="Touch-Optimized Chart">
<ChartPrimaryXAxis Title="Products" />
<ChartPrimaryYAxis Title="Sales" />
<ChartLegendSettings Visible="true" Height="50" Width="150"
Padding="10" ShapeHeight="15" ShapeWidth="15" />
<ChartSeriesCollection>
<ChartSeries DataSource="@TouchData" XName="Product" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Q1 Sales">
<ChartMarker Visible="true" Height="12" Width="12"
Shape="ChartShape.Circle" />
</ChartSeries>
</ChartSeriesCollection>
<ChartTooltipSettings Enable="true" />
</SfChart>
@code {
public List<TouchDataPoint> TouchData = new List<TouchDataPoint>
{
new TouchDataPoint { Product = "A", Sales = 120 },
new TouchDataPoint { Product = "B", Sales = 95 },
new TouchDataPoint { Product = "C", Sales = 145 }
};
public class TouchDataPoint
{
public string Product { get; set; }
public double Sales { get; set; }
}
}Mobile Accessibility
Optimize charts for mobile devices and touch interactions.
@using Syncfusion.Blazor.Charts
<SfChart Title="Mobile Accessible Chart" Height="400px">
<ChartPrimaryXAxis Title="Months" />
<ChartPrimaryYAxis Title="Revenue" />
<ChartZoomSettings EnablePinchZooming="true"
EnableSelectionZooming="false">
</ChartZoomSettings>
<ChartTooltipSettings Enable="true" EnableAnimation="true" />
<ChartSeriesCollection>
<ChartSeries DataSource="@MobileData" XName="Month" YName="Revenue"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area" Opacity="0.6" Name="Revenue">
<ChartMarker Visible="true" Height="10" Width="10" />
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public List<MobileDataPoint> MobileData = new List<MobileDataPoint>
{
new MobileDataPoint { Month = "Jan", Revenue = 28 },
new MobileDataPoint { Month = "Feb", Revenue = 35 },
new MobileDataPoint { Month = "Mar", Revenue = 42 }
};
public class MobileDataPoint
{
public string Month { get; set; }
public double Revenue { get; set; }
}
}Adaptive Features
Implement features that adapt to different screen sizes and orientations.
@using Syncfusion.Blazor.Charts
<SfChart Title="Adaptive Layout Chart" Height="@ChartHeight">
<ChartPrimaryXAxis Title="Categories" />
<ChartPrimaryYAxis Title="Values" />
<ChartLegendSettings Visible="true"
Position="@(IsSmallScreen ? LegendPosition.Bottom : LegendPosition.Right)" />
<ChartSeriesCollection>
<ChartSeries DataSource="@AdaptiveData" XName="Category" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Data Series" />
</ChartSeriesCollection>
</SfChart>
@code {
private bool IsSmallScreen = false;
private string ChartHeight = "400px";
protected override void OnInitialized()
{
// Simulate responsive behavior
IsSmallScreen = true; // Set based on actual screen detection
ChartHeight = IsSmallScreen ? "300px" : "500px";
}
public List<AdaptiveDataPoint> AdaptiveData = new List<AdaptiveDataPoint>
{
new AdaptiveDataPoint { Category = "A", Value = 65 },
new AdaptiveDataPoint { Category = "B", Value = 78 },
new AdaptiveDataPoint { Category = "C", Value = 55 }
};
public class AdaptiveDataPoint
{
public string Category { get; set; }
public double Value { get; set; }
}
}---
Testing and Validation
Accessibility Testing Tools
Recommended tools for validating chart accessibility:
- axe DevTools: Browser extension for WCAG compliance checking
- WAVE: Web accessibility evaluation tool
- NVDA/JAWS: Screen reader testing
- Lighthouse: Chrome DevTools accessibility audit
- Pa11y: Automated accessibility testing
Compliance Checklists
WCAG 2.2 Level AA Checklist
- [ ] All images have alt text
- [ ] Color contrast ratio ≥ 4.5:1 for normal text
- [ ] Color contrast ratio ≥ 3:1 for large text
- [ ] Information not conveyed by color alone
- [ ] Keyboard navigation fully functional
- [ ] Focus indicators visible
- [ ] Touch targets ≥ 44x44 pixels
- [ ] Content readable at 200% zoom
- [ ] Screen reader announces all elements
- [ ] RTL support for applicable languages
Common Issues and Fixes
Issue 1: Low Contrast Data Labels
<!-- Fix: Use high contrast colors for data labels -->
<ChartMarker>
<ChartDataLabel Visible="true">
<ChartDataLabelFont Color="#000000" FontWeight="600" />
<ChartDataLabelBorder Width="1" Color="#FFFFFF" />
</ChartDataLabel>
</ChartMarker>Issue 2: Missing ARIA Labels
<!-- Fix: Add descriptive titles and labels -->
<SfChart Title="Quarterly Sales Report"
Description="Column chart showing sales data for each quarter">
<ChartPrimaryXAxis Title="Quarter" />
<ChartPrimaryYAxis Title="Sales in USD" />
</SfChart>Issue 3: Small Touch Targets
<!-- Fix: Increase marker and legend sizes -->
<ChartLegendSettings Visible="true" ShapeHeight="15" ShapeWidth="15" />
<ChartMarker Visible="true" Height="12" Width="12" />Issue 4: Poor Keyboard Navigation
<!-- Fix: Enable proper selection and zoom features -->
<ChartSelectionSettings Enable="true" Mode="Syncfusion.Blazor.Charts.SelectionMode.Point" />
<ChartZoomSettings EnableSelectionZooming="true" />Best Practices Summary
1. Always provide text alternatives for visual information 2. Use sufficient color contrast (minimum 4.5:1) 3. Support keyboard navigation for all interactive elements 4. Test with screen readers regularly 5. Implement RTL support for applicable locales 6. Ensure touch targets meet minimum size requirements 7. Provide pattern alternatives to color coding 8. Use semantic HTML and proper ARIA attributes 9. Test across multiple devices and browsers 10. Validate with automated accessibility tools
---
Compliance Standards Met:
- WCAG 2.2 Level AA
- Section 508
- ADA (Americans with Disabilities Act)
- EN 301 549 (European Standard)
- ARIA 1.2 Specification
Advanced Features Reference - Syncfusion Blazor Charts
This comprehensive reference covers advanced features for implementing sophisticated chart visualizations in Blazor applications using Syncfusion Charts.
Table of Contents
- Multiple Panes
- When to Use
- Creating Rows (Horizontal Division)
- Creating Columns (Vertical Division)
- Configuration Options
- Technical Indicators
- When to Use
- Moving Average (SMA, EMA, TMA)
- RSI (Relative Strength Index)
- Bollinger Bands
- MACD (Moving Average Convergence Divergence)
- Available Indicators
- Trend Lines
- When to Use
- Linear Trend Line
- Polynomial Trend Line
- Exponential Trend Line
- Logarithmic Trend Line
- Moving Average Trend Line
- Forecasting with Trend Lines
- Configuration Options
- Strip Lines
- When to Use
- Horizontal Strip Lines
- Vertical Strip Lines
- Segmented Strip Lines
- Strip Line with Custom Text
- Strip Line with Tooltip
- Configuration Options
- Multiple Axes
- When to Use
- Dual Y-Axes
- Multiple X and Y Axes
- Configuration Options
- Data Editing
- When to Use
- Basic Data Editing
- Configuration Options
- Empty Points
- When to Use
- Empty Point Modes
- Empty Point Modes Explained
- Chart Export
- When to Use
- Export to Image Formats
- Export to PDF
- Export to Excel (XLSX/CSV)
- Export as Base64 String
- Customize Export with Events
- Export Multiple Charts
- Supported Export Formats
- When to Use
- Basic Printing
- Print Multiple Charts
- Print-Specific Styling
- RTL Support
- When to Use
- Enabling RTL Mode
- RTL with Localization
- RTL Configuration
- Implementation Patterns
- Pattern 1: Financial Dashboard
- Pattern 2: Performance Monitoring
- Pattern 3: Comparative Analysis
- Best Practices
- Common Use Cases Summary
- Reference Links
Multiple Panes
Multiple panes allow you to divide the chart area into separate plotting regions, ideal for comparing different data series or displaying related metrics with different scales.
When to Use
- Comparing series with vastly different value ranges
- Creating dashboard-style layouts with multiple related charts
- Financial charts showing price and volume data
- Weather charts displaying temperature and humidity
Creating Rows (Horizontal Division)
<SfChart Title="Weather Comparison">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
<ChartPrimaryYAxis Title="Temperature (°F)" LabelFormat="{value}°F"
Minimum="0" Maximum="90" Interval="20"/>
<ChartRows>
<ChartRow Height="50%"/>
<ChartRow Height="50%"/>
</ChartRows>
<ChartAxes>
<ChartAxis Minimum="24" Maximum="36" Interval="2" OpposedPosition="true"
RowIndex="1" Name="YAxis" LabelFormat="{value}°C"/>
</ChartAxes>
<ChartSeriesCollection>
<ChartSeries DataSource="@WeatherData" XName="Month" YName="TempF"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"/>
<ChartSeries DataSource="@WeatherData" XName="Month" YName="TempC"
YAxisName="YAxis" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"/>
</ChartSeriesCollection>
</SfChart>Creating Columns (Vertical Division)
<SfChart Title="Sales Analysis">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
<ChartPrimaryYAxis Title="Sales ($)"/>
<ChartColumns>
<ChartColumn Width="50%"/>
<ChartColumn Width="50%"/>
</ChartColumns>
<ChartAxes>
<ChartAxis OpposedPosition="true" ColumnIndex="1" Name="XAxis2"
ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
</ChartAxes>
<ChartSeriesCollection>
<ChartSeries DataSource="@RegionData" XName="Quarter" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"/>
<ChartSeries DataSource="@ProductData" XName="Quarter" YName="Revenue"
XAxisName="XAxis2" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area"/>
</ChartSeriesCollection>
</SfChart>Configuration Options
Height/Width: Set pane dimensions (percentage or pixels)RowIndex/ColumnIndex: Bind axis to specific paneSpan: Span axis across multiple panesBorder: Customize pane boundaries
---
Technical Indicators
Technical indicators are mathematical calculations based on historical price, volume, or open interest data, used primarily in financial chart analysis.
When to Use
- Stock market analysis and trading platforms
- Financial forecasting applications
- Technical analysis dashboards
- Real-time market monitoring
Moving Average (SMA, EMA, TMA)
<SfChart Title="Stock Price with Moving Averages">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"
IntervalType="IntervalType.Months"/>
<ChartSeriesCollection>
<ChartSeries DataSource="@StockData" XName="Date" High="High" Low="Low"
Open="Open" Close="Close" Volume="Volume"
Name="Stock" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Candle"/>
</ChartSeriesCollection>
<ChartIndicators>
<ChartIndicator Type="TechnicalIndicators.Sma" Field="FinancialDataFields.Close"
SeriesName="Stock" Fill="#FF6B6B" Period="14"/>
<ChartIndicator Type="TechnicalIndicators.Ema" Field="FinancialDataFields.Close"
SeriesName="Stock" Fill="#4ECDC4" Period="14"/>
</ChartIndicators>
</SfChart>RSI (Relative Strength Index)
<SfChart>
<ChartPrimaryYAxis RowIndex="1" OpposedPosition="true"/>
<ChartAxes>
<ChartAxis Name="secondary" OpposedPosition="true" RowIndex="0"
Minimum="0" Maximum="120" Title="RSI">
</ChartAxis>
</ChartAxes>
<ChartRows>
<ChartRow Height="40%"/>
<ChartRow Height="60%"/>
</ChartRows>
<ChartSeriesCollection>
<ChartSeries DataSource="@StockData" XName="Date" High="High" Low="Low"
Close="Close" Open="Open" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Candle"/>
</ChartSeriesCollection>
<ChartIndicators>
<ChartIndicator Type="TechnicalIndicators.Rsi" Field="FinancialDataFields.Close"
YAxisName="secondary" Period="14" OverBought="70" OverSold="30"
ShowZones="true">
<ChartIndicatorUpperLine Color="#FF4560"/>
<ChartIndicatorLowerLine Color="#00E396"/>
</ChartIndicator>
</ChartIndicators>
</SfChart>Bollinger Bands
<ChartIndicators>
<ChartIndicator Type="TechnicalIndicators.BollingerBands"
Field="FinancialDataFields.Close"
SeriesName="Stock" Period="14" StandardDeviation="2">
<ChartIndicatorUpperLine Color="#FF6B6B" Width="2"/>
<ChartIndicatorLowerLine Color="#4ECDC4" Width="2"/>
</ChartIndicator>
</ChartIndicators>MACD (Moving Average Convergence Divergence)
<ChartIndicators>
<ChartIndicator Type="TechnicalIndicators.Macd" SeriesName="Stock"
MacdType="MacdType.Both" FastPeriod="12" SlowPeriod="26"
Period="9" MacdPositiveColor="#26A69A" MacdNegativeColor="#EF5350">
<ChartIndicatorMacdLine Color="#FF6D00" Width="2"/>
</ChartIndicator>
</ChartIndicators>Available Indicators
- SMA: Simple Moving Average
- EMA: Exponential Moving Average
- TMA: Triangular Moving Average
- RSI: Relative Strength Index
- MACD: Moving Average Convergence Divergence
- Bollinger Bands: Volatility indicator
- ATR: Average True Range
- Stochastic: Momentum indicator
- Momentum: Rate of price change
- Accumulation Distribution: Volume flow indicator
---
Trend Lines
Trend lines visualize the direction and pace of data trends using mathematical regression models.
When to Use
- Forecasting future data points
- Identifying data patterns and correlations
- Scientific data analysis
- Business intelligence dashboards
Linear Trend Line
<ChartSeries DataSource="@SalesData" XName="Year" YName="Revenue"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Scatter">
<ChartMarker Visible="true" Width="10" Height="10"/>
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Linear" Width="3"
Name="Linear Trend" Fill="#FF6B6B"/>
</ChartTrendlines>
</ChartSeries>Polynomial Trend Line
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Polynomial" Width="3"
Name="Polynomial" Fill="#4ECDC4" PolynomialOrder="3"/>
</ChartTrendlines>Exponential Trend Line
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Exponential" Width="3"
Name="Growth Trend" Fill="#95E1D3"/>
</ChartTrendlines>Logarithmic Trend Line
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Logarithmic" Width="3"
Name="Log Trend" Fill="#F38181"/>
</ChartTrendlines>Moving Average Trend Line
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.MovingAverage" Width="3"
Period="5" Name="5-Day MA" Fill="#AA96DA"/>
</ChartTrendlines>Forecasting with Trend Lines
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Linear" Width="3"
ForwardForecast="5" BackwardForecast="3"
Name="Forecast" Fill="#FFB6B9"/>
</ChartTrendlines>Configuration Options
Type: Linear, Exponential, Logarithmic, Polynomial, Power, MovingAverageWidth: Line thicknessFill: Trend line colorForwardForecast: Predict future pointsBackwardForecast: Show historical trendPeriod: Moving average calculation periodPolynomialOrder: Degree for polynomial trends
---
Strip Lines
Strip lines are horizontal or vertical bands that highlight specific ranges or thresholds in the chart.
When to Use
- Highlighting target ranges or thresholds
- Marking acceptable/warning/critical zones
- Showing business hours or time periods
- Indicating baseline or benchmark values
Horizontal Strip Lines
<ChartPrimaryYAxis Title="Performance %">
<ChartStriplines>
<!-- Excellent Zone -->
<ChartStripline Start="80" End="100" Color="#C6F6D5"
Text="Excellent" ZIndex="ZIndex.Behind"/>
<!-- Good Zone -->
<ChartStripline Start="60" End="80" Color="#FED7D7"
Text="Good" ZIndex="ZIndex.Behind"/>
<!-- Warning Zone -->
<ChartStripline Start="40" End="60" Color="#FEF3C7"
Text="Warning" ZIndex="ZIndex.Behind"/>
</ChartStriplines>
</ChartPrimaryYAxis>Vertical Strip Lines
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime">
<ChartStriplines>
<!-- Business Hours -->
<ChartStripline Start="new DateTime(2024, 01, 01, 09, 0, 0)"
End="new DateTime(2024, 01, 01, 17, 0, 0)"
Color="#E8F5E9" Text="Business Hours" Opacity="0.5"/>
</ChartStriplines>
</ChartPrimaryXAxis>Segmented Strip Lines
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime">
<ChartStriplines>
<ChartStripline Start="new DateTime(2024, 01, 01, 08, 0, 0)"
End="new DateTime(2024, 01, 01, 10, 0, 0)"
IsSegmented="true" SegmentStart="50" SegmentEnd="75"
SegmentAxisName="YAxis" Color="#FFE0B2"/>
</ChartStriplines>
</ChartPrimaryXAxis>Strip Line with Custom Text
<ChartStripline Start="75" End="100" Color="#C8E6C9"
Text="Target Achieved" HorizontalAlignment="Anchor.Middle"
VerticalAlignment="Anchor.Middle" Rotation="90">
<ChartStriplineTextStyle Size="14px" Color="#2E7D32" FontWeight="600"/>
<ChartStriplineBorder Width="2" Color="#388E3C"/>
</ChartStripline>Strip Line with Tooltip
<ChartStripline Start="new DateTime(2024, 01, 01, 07, 00, 00)"
End="new DateTime(2024, 01, 01, 09, 00, 00)"
Text="Rush Hour" Color="#FFED4A" Visible="true">
<ChartStriplineTooltip Enable="true" Header="Peak Traffic"
Content="Range: ${stripline.start} - ${stripline.end}"
Fill="#F43F5E" Opacity="0.95">
<ChartStriplineTooltipTextStyle Size="14px" Color="#FFFFFF"/>
</ChartStriplineTooltip>
</ChartStripline>Configuration Options
Start/End: Define strip line boundariesColor: Background colorOpacity: Transparency levelZIndex: Drawing order (Behind/Over)IsSegmented: Create partial strip linesSize: Alternative to End for fixed widthStartFromAxis: Begin from axis origin
---
Multiple Axes
Multiple axes enable displaying series with different scales or units on the same chart.
When to Use
- Comparing metrics with different units (e.g., temperature and rainfall)
- Financial charts with price and volume
- Dual-scale dashboards
- Correlation analysis
Dual Y-Axes
<SfChart Title="Sales vs. Profit Analysis">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
<ChartPrimaryYAxis Title="Sales (Units)" LabelFormat="{value}K"
Minimum="0" Maximum="100"/>
<ChartAxes>
<ChartAxis Name="SecondaryY" OpposedPosition="true"
Title="Profit (%)" LabelFormat="{value}%"
Minimum="0" Maximum="50"/>
</ChartAxes>
<ChartSeriesCollection>
<ChartSeries DataSource="@BusinessData" XName="Product" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Sales"/>
<ChartSeries DataSource="@BusinessData" XName="Product" YName="Profit"
YAxisName="SecondaryY" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"
Name="Profit Margin">
<ChartMarker Visible="true" Height="10" Width="10"/>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Multiple X and Y Axes
<SfChart>
<ChartPrimaryXAxis Name="XAxis1" ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
<ChartPrimaryYAxis Name="YAxis1" Title="Temperature (°C)"/>
<ChartAxes>
<ChartAxis Name="XAxis2" OpposedPosition="true"
ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
<ChartAxis Name="YAxis2" OpposedPosition="true"
Title="Humidity (%)"/>
</ChartAxes>
<ChartSeriesCollection>
<ChartSeries DataSource="@WeatherData" XName="Month" YName="Temp"
XAxisName="XAxis1" YAxisName="YAxis1"/>
<ChartSeries DataSource="@WeatherData" XName="Month" YName="Humidity"
XAxisName="XAxis2" YAxisName="YAxis2"/>
</ChartSeriesCollection>
</SfChart>Configuration Options
Name: Unique identifier for axisOpposedPosition: Place on opposite sideRowIndex/ColumnIndex: Position in multi-pane layoutSpan: Span across multiple panes- All standard axis properties (min, max, interval, etc.)
---
Data Editing
Data editing allows users to interactively drag and modify data points at runtime.
When to Use
- Interactive data entry applications
- Manual data adjustment tools
- What-if analysis scenarios
- Training and simulation applications
Basic Data Editing
<SfChart Title="Interactive Sales Forecast">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"/>
<ChartPrimaryYAxis LabelFormat="${value}K" Minimum="0" Maximum="100"/>
<ChartTooltipSettings Enable="true"/>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData" XName="Date" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
<ChartMarker Visible="true" Width="10" Height="10"/>
<ChartDataEditSettings Enable="true" Fill="#FF6B6B"
MinY="0" MaxY="100"/>
</ChartSeries>
<ChartSeries DataSource="@ForecastData" XName="Date" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line">
<ChartMarker Visible="true" Width="10" Height="10"/>
<ChartDataEditSettings Enable="true" Fill="#4ECDC4"
MinY="0" MaxY="100"/>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Configuration Options
Enable: Enable/disable data editingFill: Color for edited pointsMinY/MaxY: Restrict editing range
---
Empty Points
Handle missing or null data points with various rendering modes.
When to Use
- Datasets with incomplete information
- Time series with gaps
- Sensor data with occasional failures
- Survey results with non-responses
Empty Point Modes
<SfChart Title="Sales Data with Gaps">
<ChartSeriesCollection>
<!-- Zero Mode: Shows null as zero -->
<ChartSeries DataSource="@DataWithNulls" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" Name="Zero Mode">
<ChartEmptyPointSettings Mode="EmptyPointMode.Zero" Fill="#E0E0E0"/>
</ChartSeries>
<!-- Average Mode: Interpolates with average -->
<ChartSeries DataSource="@DataWithNulls" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line" Name="Average Mode">
<ChartEmptyPointSettings Mode="EmptyPointMode.Average" Fill="#FFB6B9"/>
<ChartMarker Visible="true"/>
</ChartSeries>
<!-- Gap Mode: Shows discontinuity -->
<ChartSeries DataSource="@DataWithNulls" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.SplineArea" Name="Gap Mode">
<ChartEmptyPointSettings Mode="EmptyPointMode.Gap"/>
</ChartSeries>
<!-- Drop Mode: Excludes empty points -->
<ChartSeries DataSource="@DataWithNulls" XName="Month" YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Scatter" Name="Drop Mode">
<ChartEmptyPointSettings Mode="EmptyPointMode.Drop"/>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Empty Point Modes Explained
- Zero: Treats null/undefined as zero value
- Average: Calculates average of adjacent points
- Gap: Shows break in continuity (line/area charts)
- Drop: Completely ignores the point
---
Chart Export
Export rendered charts to various formats for reporting and sharing.
When to Use
- Generating reports and presentations
- Saving charts for offline viewing
- Email attachments and documentation
- Archiving visualizations
Export to Image Formats
@using Syncfusion.Blazor.Charts
@using Syncfusion.Blazor.Buttons
<SfChart @ref="ChartRef" Title="Annual Report">
<ChartSeriesCollection>
<ChartSeries DataSource="@ReportData" XName="Category" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"/>
</ChartSeriesCollection>
</SfChart>
<div class="button-group">
<SfButton Content="Export PNG" @onclick="ExportPNG" IsPrimary="true"/>
<SfButton Content="Export JPEG" @onclick="ExportJPEG"/>
<SfButton Content="Export SVG" @onclick="ExportSVG"/>
</div>
@code {
SfChart ChartRef;
private async Task ExportPNG() =>
await ChartRef.ExportAsync(ExportType.PNG, "chart");
private async Task ExportJPEG() =>
await ChartRef.ExportAsync(ExportType.JPEG, "chart");
private async Task ExportSVG() =>
await ChartRef.ExportAsync(ExportType.SVG, "chart");
}Export to PDF
<SfButton Content="Export PDF" @onclick="ExportPDF"/>
@code {
private async Task ExportPDF()
{
await ChartRef.ExportAsync(ExportType.PDF, "report",
PdfPageOrientation.Landscape);
}
}Export to Excel (XLSX/CSV)
<SfButton Content="Export Excel" @onclick="ExportExcel"/>
<SfButton Content="Export CSV" @onclick="ExportCSV"/>
@code {
private async Task ExportExcel() =>
await ChartRef.ExportAsync(ExportType.XLSX, "data");
private async Task ExportCSV() =>
await ChartRef.ExportAsync(ExportType.CSV, "data");
}Export as Base64 String
<ChartEvents OnExportComplete="ExportComplete"/>
@code {
private async Task ExportBase64()
{
await ChartRef.ExportAsync(ExportType.PDF, "chart",
PdfPageOrientation.Portrait, allowDownload: false, isBase64: true);
}
private void ExportComplete(ExportEventArgs args)
{
string base64String = args.Base64;
// Use base64 string for custom operations
}
}Customize Export with Events
<ChartEvents Exporting="BeforeExport"/>
@code {
private void BeforeExport(ChartExportEventArgs args)
{
// Customize dimensions
args.Width = 1200;
args.Height = 800;
// For Excel exports, customize workbook
if (args.Workbook != null)
{
var sheet = args.Workbook.Worksheets.First();
sheet.Rows[0].Cells[0].CellStyle.BackColor = "#4472C4";
sheet.Rows[0].Cells[0].CellStyle.Bold = true;
}
}
}Export Multiple Charts
<div @ref="ChartContainer">
<SfChart Title="Chart 1">...</SfChart>
<SfChart Title="Chart 2">...</SfChart>
</div>
<SfButton Content="Export All" @onclick="ExportAll"/>
@code {
ElementReference ChartContainer;
SfChart Chart1;
private async Task ExportAll() =>
await Chart1.PrintAsync(ChartContainer);
}Supported Export Formats
- PNG: Raster image format
- JPEG: Compressed image format
- SVG: Vector graphics format
- PDF: Portable document format
- XLSX: Excel workbook
- CSV: Comma-separated values
---
Print charts directly from the browser with customization options.
When to Use
- Creating hard copies for meetings
- Generating physical reports
- Archiving visualizations
- Presentation materials
Basic Printing
<SfChart @ref="ChartRef" Title="Sales Report">
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData" XName="Month" YName="Sales"/>
</ChartSeriesCollection>
</SfChart>
<SfButton Content="Print Chart" @onclick="PrintChart" IsPrimary="true"/>
@code {
SfChart ChartRef;
private async Task PrintChart() => await ChartRef.PrintAsync();
}Print Multiple Charts
<div @ref="PrintContainer" class="print-area">
<SfChart @ref="Chart1" Title="Revenue">...</SfChart>
<SfChart Title="Expenses">...</SfChart>
<SfChart Title="Profit">...</SfChart>
</div>
<SfButton Content="Print Dashboard" @onclick="PrintAll"/>
@code {
ElementReference PrintContainer;
SfChart Chart1;
private async Task PrintAll() =>
await Chart1.PrintAsync(PrintContainer);
}Print-Specific Styling
<style>
@@media print {
.no-print { display: none; }
.print-area { page-break-inside: avoid; }
.chart-container { width: 100%; }
}
</style>---
RTL Support
Right-to-left (RTL) rendering for internationalization in languages like Arabic and Hebrew.
When to Use
- Applications supporting RTL languages
- Multi-language dashboard applications
- Internationalized reporting tools
- Global market applications
Enabling RTL Mode
<SfChart EnableRtl="true" Title="مخطط المبيعات">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
<ChartPrimaryYAxis Title="القيمة"/>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData" XName="Category" YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"/>
</ChartSeriesCollection>
</SfChart>RTL with Localization
<SfChart EnableRtl="true" Locale="ar-AE">
<ChartPrimaryXAxis Title="الفئات"/>
<ChartPrimaryYAxis Title="القيمة" LabelFormat="{value} ر.س"/>
<ChartTooltipSettings Enable="true" Header="التفاصيل"/>
<ChartLegendSettings Position="LegendPosition.Right"/>
<ChartSeriesCollection>
<ChartSeries DataSource="@Data" XName="Category" YName="Value"/>
</ChartSeriesCollection>
</SfChart>RTL Configuration
EnableRtl: Enable right-to-left renderingLocale: Set culture-specific formatting- Automatically mirrors: legends, tooltips, data labels
- Reverses: axis direction, series rendering order
---
Implementation Patterns
Pattern 1: Financial Dashboard
<SfChart Title="Stock Analysis Dashboard" Theme="Syncfusion.Blazor.Theme.Material">
<ChartRows>
<ChartRow Height="70%"/>
<ChartRow Height="30%"/>
</ChartRows>
<ChartAxes>
<ChartAxis Name="VolumeAxis" RowIndex="1" OpposedPosition="true"/>
</ChartAxes>
<ChartSeriesCollection>
<ChartSeries DataSource="@StockData" XName="Date"
High="High" Low="Low" Open="Open" Close="Close"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Candle"/>
<ChartSeries DataSource="@StockData" XName="Date" YName="Volume"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" YAxisName="VolumeAxis"/>
</ChartSeriesCollection>
<ChartIndicators>
<ChartIndicator Type="TechnicalIndicators.BollingerBands"
Period="14" StandardDeviation="2"/>
<ChartIndicator Type="TechnicalIndicators.Macd" MacdType="MacdType.Both"/>
</ChartIndicators>
</SfChart>Pattern 2: Performance Monitoring
<SfChart Title="System Performance Monitor">
<ChartPrimaryYAxis Title="Usage (%)" Minimum="0" Maximum="100">
<ChartStriplines>
<ChartStripline Start="0" End="60" Color="#C6F6D5" Text="Normal"/>
<ChartStripline Start="60" End="80" Color="#FEF3C7" Text="Warning"/>
<ChartStripline Start="80" End="100" Color="#FED7D7" Text="Critical"/>
</ChartStriplines>
</ChartPrimaryYAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@PerformanceData" XName="Time" YName="CPU"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.SplineArea" Name="CPU">
<ChartDataEditSettings Enable="true"/>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Pattern 3: Comparative Analysis
<SfChart Title="Regional Comparison">
<ChartColumns>
<ChartColumn Width="50%"/>
<ChartColumn Width="50%"/>
</ChartColumns>
<ChartAxes>
<ChartAxis Name="SecondaryX" ColumnIndex="1"
ValueType="Syncfusion.Blazor.Charts.ValueType.Category"/>
</ChartAxes>
<ChartSeriesCollection>
<ChartSeries DataSource="@RegionA" XName="Category" YName="Value">
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Linear" ForwardForecast="3"/>
</ChartTrendlines>
</ChartSeries>
<ChartSeries DataSource="@RegionB" XName="Category" YName="Value"
XAxisName="SecondaryX">
<ChartTrendlines>
<ChartTrendline Type="TrendlineTypes.Linear" ForwardForecast="3"/>
</ChartTrendlines>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>---
Best Practices
1. Performance Optimization
- Limit number of technical indicators (use max 3-4)
- Use data editing judiciously for large datasets
- Consider data aggregation for trend lines on large datasets
2. User Experience
- Provide clear labels for multiple axes
- Use contrasting colors for strip lines
- Include legends when using multiple indicators
- Add tooltips for interactive features
3. Accessibility
- Use sufficient color contrast for strip lines
- Provide text alternatives for visual indicators
- Enable keyboard navigation for data editing
- Support screen readers with proper ARIA labels
4. Export Optimization
- Set appropriate dimensions before export
- Use vector formats (SVG, PDF) for scalable output
- Optimize image quality vs. file size for raster formats
- Include chart title and legends in exports
5. RTL Considerations
- Test thoroughly with actual RTL content
- Ensure custom styling respects RTL mode
- Verify numeric formatting in RTL cultures
- Check tooltip and legend positioning
---
Common Use Cases Summary
| Feature | Primary Use Case | Best Chart Types |
|---|---|---|
| Multiple Panes | Financial analysis, Multi-metric dashboards | Candle, Line, Column |
| Technical Indicators | Stock trading, Market analysis | Candle, Line, OHLC |
| Trend Lines | Forecasting, Pattern recognition | Scatter, Line, Area |
| Strip Lines | Threshold monitoring, Range highlighting | All types |
| Multiple Axes | Dual-scale comparison | Line, Column, Area |
| Data Editing | Interactive forecasting, Manual adjustment | Column, Line, Scatter |
| Empty Points | Incomplete data handling | Line, Area, Spline |
| Export | Reporting, Documentation | All types |
| Hard copy generation | All types | |
| RTL | International applications | All types |
---
Reference Links
- Syncfusion Blazor Charts Documentation: https://blazor.syncfusion.com/documentation/chart/getting-started
- API Reference: https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts.html
- Live Demos: https://blazor.syncfusion.com/demos/chart/line
---
This reference is self-contained and requires no external dependencies beyond Syncfusion.Blazor.Charts package.
Syncfusion Blazor Charts - Complete API Reference
Table of Contents
- Overview
- SfChart Component
- Public Methods
- Enumerations
- ChartSeriesType
- ValueType
- SelectionMode
- HighlightMode
- SelectionPattern
- ExportType
- LegendPosition
- EmptyPointMode
- LabelPlacement
- EdgeLabelPlacement
- LabelIntersectAction
- ChartShape
- TrendlineTypes
- TechnicalIndicators
- ZoomMode
- ToolbarItems
- Theme
- Key Classes and Components
- ChartSeries
- ChartPrimaryXAxis / ChartPrimaryYAxis
- ChartTooltipSettings
- ChartLegendSettings
- ChartZoomSettings
- Important Notes
- Common Patterns
- Basic Chart with Data
- Chart with Multiple Series
- Chart with Zooming
Overview
This document provides the complete and accurate API reference for Syncfusion Blazor Charts based on the official Syncfusion API documentation. Use this as the authoritative source for all enum values, method signatures, and property names.
---
SfChart Component
Public Methods
The SfChart component provides the following public methods for programmatic control:
RefreshAsync(bool shouldAnimate = true)
Re-renders the chart with optional animation.
public Task RefreshAsync(bool shouldAnimate = true)Parameters:
shouldAnimate- Specifies whether the chart should animate during refresh (default: true)
Returns: Task
Example:
<SfChart @ref="ChartRef">
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
async Task UpdateChart()
{
await ChartRef.RefreshAsync(true);
}
}---
ExportAsync(ExportType type, string fileName, PdfPageOrientation? orientation = null, bool allowDownload = true, bool isBase64 = false)
Exports the chart to various formats (PDF, PNG, JPEG, SVG).
public Task ExportAsync(ExportType type, string fileName, PdfPageOrientation? orientation = null, bool allowDownload = true, bool isBase64 = false)Parameters:
type- The export format (ExportTypeenum)fileName- The name of the exported fileorientation- PDF page orientation (Portrait/Landscape)allowDownload- Whether to download the fileisBase64- Whether to return as base64 string
Returns: Task
Example:
<SfChart @ref="ChartRef">
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
async Task ExportChart()
{
await ChartRef.ExportAsync(ExportType.PNG, "SalesChart");
}
}---
PrintAsync(ElementReference elementRef = default)
Prints the chart.
public Task PrintAsync(ElementReference elementRef = default)Parameters:
elementRef- Optional reference to the chart element
Returns: Task
Example:
<SfChart @ref="ChartRef">
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
async Task PrintChart()
{
await ChartRef.PrintAsync();
}
}---
ShowTooltip(object x, double y, bool isPoint = true)
Displays tooltip at specified coordinates or data points.
public void ShowTooltip(object x, double y, bool isPoint = true)Parameters:
x- X-value of the point or x-coordinatey- Y-value of the point or y-coordinateisPoint- Whether x and y are data points (true) or coordinates (false)
Example:
<SfChart @ref="ChartRef">
<ChartTooltipSettings Enable="true" />
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
void DisplayTooltip()
{
ChartRef.ShowTooltip("January", 35);
}
}---
HideTooltip()
Hides the currently displayed tooltip.
public void HideTooltip()Example:
@code {
SfChart ChartRef;
void HideChartTooltip()
{
ChartRef.HideTooltip();
}
}---
ShowCrosshair(double x, double y)
Displays crosshair at specified coordinates.
public void ShowCrosshair(double x, double y)Parameters:
x- X-coordinate on the charty- Y-coordinate on the chart
Example:
<SfChart @ref="ChartRef">
<ChartCrosshairSettings Enable="true" />
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
void DisplayCrosshair()
{
ChartRef.ShowCrosshair(100, 50);
}
}---
HideCrosshair()
Hides the currently displayed crosshair.
public void HideCrosshair()Example:
@code {
SfChart ChartRef;
void HideChartCrosshair()
{
ChartRef.HideCrosshair();
}
}---
ClearSelection()
Clears all selections in the chart.
public void ClearSelection()Example:
<SfChart @ref="ChartRef" SelectionMode="SelectionMode.Point">
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
void ClearAllSelections()
{
ChartRef.ClearSelection();
}
}---
Sort(string propertyName, ListSortDirection direction)
Sorts chart data by property name and direction.
public void Sort(string propertyName, ListSortDirection direction)Parameters:
propertyName- Property name to sort bydirection- Sort direction (AscendingorDescending)
Example:
<SfChart @ref="ChartRef" DataSource="@SalesData">
<ChartSorting PropertyName="X" Direction="ListSortDirection.Ascending" />
<!-- Chart configuration -->
</SfChart>
@code {
SfChart ChartRef;
void SortByValue()
{
ChartRef.Sort("Y", ListSortDirection.Descending);
}
}---
ClearSort()
Clears the sorting applied to the chart.
public void ClearSort()Example:
@code {
SfChart ChartRef;
void RemoveSorting()
{
ChartRef.ClearSort();
}
}---
PreventRender(bool preventRender = true)
Prevents or allows chart rendering.
public void PreventRender(bool preventRender = true)Parameters:
preventRender- If true, prevents rendering; if false, allows rendering
Example:
@code {
SfChart ChartRef;
void StopRendering()
{
ChartRef.PreventRender(true);
// Perform batch updates
ChartRef.PreventRender(false); // Resume rendering
}
}---
Enumerations
ChartSeriesType
Specifies the type of chart series.
public enum ChartSeriesType
{
Line,
Column,
Area,
Bar,
Histogram,
StackingColumn,
StackingArea,
StackingBar,
StepLine,
StepArea,
SplineArea,
Scatter,
Spline,
StackingColumn100,
StackingBar100,
StackingArea100,
RangeColumn,
RangeArea,
RangeStepArea,
Bubble,
Candle,
Polar,
Radar,
Hilo,
HiloOpenClose,
Waterfall,
BoxAndWhisker,
StackingLine,
StackingLine100,
MultiColoredLine,
MultiColoredArea,
Pareto
}Common Values:
Line- Line chartColumn- Vertical column chartArea- Area chartBar- Horizontal bar chartSpline- Smooth line chartScatter- Scatter plotBubble- Bubble chartCandle- Candlestick chart (financial)StackingColumn- Stacked column chartStackingColumn100- 100% stacked column chart
---
ValueType
Specifies the type of axis.
public enum ValueType
{
Double,
DateTime,
Category,
Logarithmic,
DateTimeCategory
}Values:
Double- Numeric axisDateTime- DateTime axisCategory- Category axisLogarithmic- Logarithmic axisDateTimeCategory- DateTime category axis
---
SelectionMode
Specifies the selection mode.
public enum SelectionMode
{
None,
Series,
Point,
Cluster,
DragXY,
DragX,
DragY,
Lasso
}Values:
None- No selectionSeries- Select entire seriesPoint- Select individual pointCluster- Select cluster of pointsDragXY- Drag to select in both directionsDragX- Drag to select horizontallyDragY- Drag to select verticallyLasso- Lasso selection
---
HighlightMode
Specifies the highlight mode.
public enum HighlightMode
{
None,
Series,
Point,
Cluster
}Values:
None- No highlightingSeries- Highlight entire seriesPoint- Highlight individual pointCluster- Highlight cluster of points
---
SelectionPattern
Specifies selection/highlight patterns.
public enum SelectionPattern
{
None,
DiagonalForward,
DiagonalBackward,
Crosshatch,
Dots,
Chessboard,
Grid,
Turquoise,
Star,
Triangle,
Circle,
Tile,
HorizontalDash,
VerticalDash,
Rectangle,
Box,
VerticalStripe,
HorizontalStripe,
Bubble
}---
ExportType
Specifies export types.
public enum ExportType
{
PNG,
JPEG,
SVG,
PDF
}Values:
PNG- Export as PNG imageJPEG- Export as JPEG imageSVG- Export as SVG vectorPDF- Export as PDF document
---
LegendPosition
Specifies legend position.
public enum LegendPosition
{
Auto,
Top,
Left,
Bottom,
Right,
Custom
}Values:
Auto- Automatically positions legendTop- Position at topLeft- Position at leftBottom- Position at bottomRight- Position at rightCustom- Custom position using X and Y coordinates
---
EmptyPointMode
Specifies how to handle empty points.
public enum EmptyPointMode
{
Gap,
Zero,
Drop,
Average
}Values:
Gap- Leave gap at empty pointZero- Treat as zeroDrop- Drop the empty pointAverage- Use average of surrounding points
---
LabelPlacement
Specifies label placement for category axis.
public enum LabelPlacement
{
BetweenTicks,
OnTicks
}Values:
BetweenTicks- Place labels between ticksOnTicks- Place labels on ticks
---
EdgeLabelPlacement
Specifies edge label placement.
public enum EdgeLabelPlacement
{
None,
Hide,
Shift
}Values:
None- No special treatmentHide- Hide edge labelsShift- Shift edge labels inside
---
LabelIntersectAction
Specifies action for intersecting labels.
public enum LabelIntersectAction
{
None,
Hide,
Trim,
Wrap,
MultipleRows,
Rotate45,
Rotate90
}Values:
None- No actionHide- Hide intersecting labelsTrim- Trim labels with ellipsisWrap- Wrap label textMultipleRows- Display in multiple rowsRotate45- Rotate labels 45 degreesRotate90- Rotate labels 90 degrees
---
ChartShape
Specifies marker shapes.
public enum ChartShape
{
Circle,
Rectangle,
Triangle,
Diamond,
Pentagon,
Cross,
HorizontalLine,
VerticalLine,
InvertedTriangle,
Image
}---
TrendlineTypes
Specifies trendline types.
public enum TrendlineTypes
{
Linear,
Exponential,
Logarithmic,
Polynomial,
Power,
MovingAverage
}Values:
Linear- Linear trendlineExponential- Exponential trendlineLogarithmic- Logarithmic trendlinePolynomial- Polynomial trendlinePower- Power trendlineMovingAverage- Moving average trendline
---
TechnicalIndicators
Specifies technical indicator types.
public enum TechnicalIndicators
{
Sma,
Ema,
Tma,
Momentum,
Atr,
AccumulationDistribution,
Bollinger,
Macd,
Stochastic,
Rsi
}Common Values:
Sma- Simple Moving AverageEma- Exponential Moving AverageTma- Triangular Moving AverageMomentum- Momentum indicatorRsi- Relative Strength IndexMacd- Moving Average Convergence DivergenceBollinger- Bollinger BandsAtr- Average True RangeStochastic- Stochastic oscillator
---
ZoomMode
Specifies zooming mode.
public enum ZoomMode
{
X,
Y,
XY
}Values:
X- Zoom horizontally onlyY- Zoom vertically onlyXY- Zoom in both directions
---
ToolbarItems
Specifies zooming toolbar items.
public enum ToolbarItems
{
Zoom,
ZoomIn,
ZoomOut,
Pan,
Reset
}---
Theme
Specifies chart themes. Use Syncfusion.Blazor.Theme enum for setting the Theme property of SfChart.
IMPORTANT: The enum name is Theme, not ChartTheme. Use it as Theme="Syncfusion.Blazor.Theme.Material" or Theme="Theme.Material" (with proper using directive).
public enum Theme
{
Material,
Fabric,
Bootstrap,
Bootstrap4,
HighContrastLight,
MaterialDark,
FabricDark,
BootstrapDark,
Bootstrap4Dark,
HighContrast,
Tailwind,
TailwindDark,
Bootstrap5,
Bootstrap5Dark,
Fluent,
FluentDark,
Material3,
Material3Dark
}Usage Example:
<SfChart Title="Sales Chart" Theme="Syncfusion.Blazor.Theme.Bootstrap5">
<!-- chart content -->
</SfChart>---
Key Classes and Components
ChartSeries
Represents a chart series with its data and configuration.
Key Properties:
public string DataSource { get; set; }
public string XName { get; set; }
public string YName { get; set; }
public ChartSeriesType Type { get; set; }
public string Name { get; set; }
public string Fill { get; set; }
public double Width { get; set; }
public string DashArray { get; set; }
public double Opacity { get; set; }---
ChartPrimaryXAxis / ChartPrimaryYAxis
Configures the primary axes.
Key Properties:
public ValueType ValueType { get; set; }
public string Title { get; set; }
public object Minimum { get; set; }
public object Maximum { get; set; }
public double Interval { get; set; }
public string LabelFormat { get; set; }
public EdgeLabelPlacement EdgeLabelPlacement { get; set; }
public LabelIntersectAction LabelIntersectAction { get; set; }---
ChartTooltipSettings
Configures tooltip behavior.
Key Properties:
public bool Enable { get; set; }
public string Format { get; set; }
public bool Shared { get; set; }
public string Fill { get; set; }
public string TextStyle { get; set; }
public RenderFragment<object> Template { get; set; }---
ChartLegendSettings
Configures legend appearance and behavior.
Key Properties:
public bool Visible { get; set; }
public LegendPosition Position { get; set; }
public Alignment Alignment { get; set; }
public LegendShape Shape { get; set; }
public RenderFragment<object> Template { get; set; }---
ChartZoomSettings
Configures zooming behavior.
Key Properties:
public bool EnableSelectionZooming { get; set; }
public bool EnablePinchZooming { get; set; }
public bool EnableMouseWheelZooming { get; set; }
public bool EnableScrollbar { get; set; }
public bool EnablePan { get; set; }
public ZoomMode Mode { get; set; }
public ToolbarItems[] ToolbarItems { get; set; }---
Important Notes
1. Correct Enum Usage: Always use the fully qualified enum name:
Type="ChartSeriesType.Column" <!-- Correct -->
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column" <!-- Also correct -->2. Method Naming: All public methods use proper C# naming conventions:
RefreshAsync()- NOTRefresh()ExportAsync()- NOTExport()ShowTooltip()- NOTShow_Tooltip()
3. Namespace: Always include the namespace import:
@using Syncfusion.Blazor.Charts4. Component Reference: To call methods, use @ref:
<SfChart @ref="ChartRef">
</SfChart>
@code {
SfChart ChartRef;
}---
Common Patterns
Basic Chart with Data
@using Syncfusion.Blazor.Charts
<SfChart>
<ChartPrimaryXAxis ValueType="ValueType.Category" />
<ChartPrimaryYAxis Title="Sales" />
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@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 = 35 },
new SalesInfo { Month = "Feb", Sales = 28 },
new SalesInfo { Month = "Mar", Sales = 34 }
};
}Chart with Multiple Series
<SfChart>
<ChartPrimaryXAxis ValueType="ValueType.Category" />
<ChartLegendSettings Visible="true" />
<ChartSeriesCollection>
<ChartSeries DataSource="@Data1"
Name="Product A"
XName="X"
YName="Y"
Type="ChartSeriesType.Column">
</ChartSeries>
<ChartSeries DataSource="@Data2"
Name="Product B"
XName="X"
YName="Y"
Type="ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Chart with Zooming
<SfChart>
<ChartZoomSettings EnableSelectionZooming="true"
EnableMouseWheelZooming="true"
EnablePan="true"
Mode="ZoomMode.XY">
</ChartZoomSettings>
<ChartSeriesCollection>
<!-- Series configuration -->
</ChartSeriesCollection>
</SfChart>---
This API reference document provides accurate information based on the official Syncfusion Blazor Charts API. Always refer to this document when generating code samples or providing API guidance.
Common Chart Types
Table of Contents
- Overview
- Line Chart
- Description
- Basic Implementation
- Customization
- Multicolored Line
- Area Chart
- Description
- Basic Implementation
- Customization
- Multicolored Area
- Column Chart
- Description
- Basic Implementation
- Customization
- Rounded Corners
- Grouped Columns
- Bar Chart
- Description
- Basic Implementation
- Customization
- Spline Chart
- Description
- Basic Implementation
- Customization
- Spline Area Chart
- Description
- Basic Implementation
- Customization
- Step Line Chart
- Description
- Basic Implementation
- Step Area Chart
- Description
- Basic Implementation
- When to Use Each Type
- Empty Point Handling
- Common Series Properties
- Fill
- Opacity
- Width
- DashArray
- Name
- Series Events
- OnSeriesRender
- OnPointRender
- Multi-Series Example
- Performance Tips
- Troubleshooting
- Related Features
Overview
This guide covers the most frequently-used chart types in Syncfusion Blazor Charts. These chart types are ideal for everyday data visualization needs including trends, comparisons, and distributions.
All chart types share common features:
- Data binding with
DataSource,XName, andYNameproperties - Customization via
Fill,Opacity,Width, andDashArray - Empty point handling
- Series and point render events
- Support for multiple series
Line Chart
Description
Line charts visualize time-dependent data by connecting data points with lines, showing trends at equal intervals. Ideal for displaying continuous data and identifying patterns over time.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public class ChartData
{
public string Month { get; set; }
public double Sales { get; set; }
}
public List<ChartData> SalesData = new List<ChartData>
{
new ChartData { Month = "Jan", Sales = 35 },
new ChartData { Month = "Feb", Sales = 28 },
new ChartData { Month = "Mar", Sales = 34 },
new ChartData { Month = "Apr", Sales = 32 },
new ChartData { Month = "May", Sales = 40 }
};
}Customization
Line Color and Width:
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"
Fill="blue"
Width="3">
</ChartSeries>Dashed Line:
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"
DashArray="5,5"
Width="2">
</ChartSeries>Gradient Line:
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"
Fill="url(#lineGradient)">
</ChartSeries>
<svg style="height: 0">
<defs>
<linearGradient id="lineGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:orange;stop-opacity:1" />
<stop offset="100%" style="stop-color:red;stop-opacity:1" />
</linearGradient>
</defs>
</svg>Multicolored Line
Display different colors for each line segment:
<ChartSeries DataSource="@ColoredData"
XName="Month"
YName="Value"
PointColorMapping="Color"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.MultiColoredLine">
</ChartSeries>
@code {
public class ColoredChartData
{
public string Month { get; set; }
public double Value { get; set; }
public string Color { get; set; }
}
public List<ColoredChartData> ColoredData = new List<ColoredChartData>
{
new ColoredChartData { Month = "Jan", Value = 35, Color = "#1f77b4" },
new ColoredChartData { Month = "Feb", Value = 28, Color = "#ff7f0e" },
new ColoredChartData { Month = "Mar", Value = 34, Color = "#2ca02c" }
};
}---
Area Chart
Description
Area charts fill the region below the line, emphasizing magnitude and trends over time. Useful for showing cumulative totals or comparing multiple datasets.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis Minimum="1900" Maximum="2000" EdgeLabelPlacement="EdgeLabelPlacement.Shift"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@PopulationData"
XName="Year"
YName="Population"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Customization
Fill Color:
<ChartSeries DataSource="@PopulationData"
XName="Year"
YName="Population"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area"
Fill="#0066CC"
Opacity="0.5">
</ChartSeries>Border:
<ChartSeries DataSource="@PopulationData"
XName="Year"
YName="Population"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area">
<ChartSeriesBorder Width="2" Color="#0066CC"></ChartSeriesBorder>
</ChartSeries>Gradient Fill:
<ChartSeries DataSource="@PopulationData"
XName="Year"
YName="Population"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Area"
Fill="url(#areaGradient)">
</ChartSeries>
<svg style="height: 0">
<defs>
<linearGradient id="areaGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:lightblue;stop-opacity:0.8" />
<stop offset="100%" style="stop-color:darkblue;stop-opacity:0.3" />
</linearGradient>
</defs>
</svg>Multicolored Area
<ChartSeries DataSource="@SegmentData"
XName="Year"
YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.MultiColoredArea">
<ChartSegments>
<ChartSegment Value="2007" Color="blue" />
<ChartSegment Value="2009" Color="red" />
<ChartSegment Color="green"></ChartSegment>
</ChartSegments>
</ChartSeries>---
Column Chart
Description
Column charts compare values across categories using vertical bars. Most common chart type for frequency, count, total, or average comparisons.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Customization
Column Color:
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"
Fill="#FF6347">
</ChartSeries>Column Spacing and Width:
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"
ColumnSpacing="0.2"
ColumnWidth="0.5">
</ChartSeries>Column Width in Pixels:
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"
ColumnWidthInPixel="50">
</ChartSeries>Rounded Corners
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
<ChartCornerRadius TopLeft="10" TopRight="10"></ChartCornerRadius>
</ChartSeries>Dynamic Corner Radius:
<SfChart>
<ChartEvents OnPointRender="PointRender"></ChartEvents>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public void PointRender(PointRenderEventArgs args)
{
if ((args.Point.X as string) == "Jan" || (args.Point.X as string) == "May")
{
args.CornerRadius.TopLeft = 10;
args.CornerRadius.TopRight = 10;
}
}
}Grouped Columns
Compare multiple series side-by-side:
<ChartSeriesCollection>
<ChartSeries DataSource="@Product1Data"
XName="Quarter"
YName="Sales"
Name="Product A"
GroupName="Group1"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
<ChartSeries DataSource="@Product2Data"
XName="Quarter"
YName="Sales"
Name="Product B"
GroupName="Group1"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>---
Bar Chart
Description
Bar charts display horizontal bars for comparing categories. Ideal when category names are long or when emphasizing ranking.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@SalesData"
XName="Product"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Bar">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Customization
Bar charts support the same customization options as column charts, including:
- Fill color and gradients
- Spacing and width (
ColumnSpacing,ColumnWidth,ColumnWidthInPixel) - Rounded corners (
ChartCornerRadius) - Grouping (
GroupName)
Horizontal Bars with Rounded Corners:
<ChartSeries DataSource="@SalesData"
XName="Product"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Bar">
<ChartCornerRadius TopRight="5" BottomRight="5"></ChartCornerRadius>
</ChartSeries>---
Spline Chart
Description
Spline charts draw smooth curves through data points using cubic spline interpolation. Better for showing trends without sharp angles.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@TemperatureData"
XName="Month"
YName="Temperature"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Spline">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Customization
Spline charts support the same customization as line charts:
- Line color (
Fill) - Line width (
Width) - Dash patterns (
DashArray) - Opacity
<ChartSeries DataSource="@TemperatureData"
XName="Month"
YName="Temperature"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Spline"
Fill="#FF6347"
Width="3">
</ChartSeries>---
Spline Area Chart
Description
Combines smooth curves of spline charts with filled areas. Shows trends with smooth transitions while emphasizing magnitude.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@Data"
XName="Month"
YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.SplineArea">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>Customization
Supports area chart customizations:
- Fill color and opacity
- Border styling
- Gradient fills
---
Step Line Chart
Description
Step line charts display data as a series of horizontal and vertical line segments, creating a stepped appearance. Ideal for showing data that changes at specific intervals.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@StockData"
XName="Date"
YName="Price"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.StepLine">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>---
Step Area Chart
Description
Step area charts combine stepped lines with filled areas below. Shows discrete changes in values with magnitude emphasis.
Basic Implementation
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@Data"
XName="Category"
YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.StepArea">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>---
When to Use Each Type
| Chart Type | Best For | Use Case Examples |
|---|---|---|
| Line | Continuous data trends over time | Stock prices, temperature changes, website traffic |
| Area | Magnitude and cumulative totals | Revenue over time, resource usage, market share |
| Column | Categorical comparisons | Monthly sales, survey results, product comparisons |
| Bar | Long category names, rankings | Top products, employee performance, country data |
| Spline | Smooth trends without noise | Projected growth, averaged data, forecasts |
| Spline Area | Smooth magnitude visualization | Smooth cumulative data, overlapping datasets |
| Step Line | Discrete interval changes | Inventory levels, rate changes, step functions |
| Step Area | Discrete changes with magnitude | Pricing tiers, capacity levels, state transitions |
---
Empty Point Handling
All chart types support empty point handling for null, double.NaN, or undefined values:
<ChartSeries DataSource="@DataWithGaps"
XName="Month"
YName="Value"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line">
<ChartEmptyPointSettings Mode="EmptyPointMode.Average"
Fill="red">
<ChartEmptyPointBorder Color="green" Width="2"></ChartEmptyPointBorder>
</ChartEmptyPointSettings>
<ChartMarker Visible="true" Width="7" Height="7"></ChartMarker>
</ChartSeries>Empty Point Modes:
Gap(default) - Leave gap in seriesZero- Plot as zero valueAverage- Use average of adjacent pointsDrop- Drop the point entirely
---
Common Series Properties
These properties apply to all common chart types:
Fill
Sets the series color:
Fill="blue"
Fill="url(#gradientId)"
Fill="#FF6347"Opacity
Controls transparency (0 to 1):
Opacity="0.5"Width
Line/border thickness (for line-based charts):
Width="3"DashArray
Dash pattern for lines:
DashArray="5,5" <!-- 5px dash, 5px gap -->
DashArray="10,5,2" <!-- Complex pattern -->Name
Legend label:
Name="Sales 2024"---
Series Events
OnSeriesRender
Customize series before rendering:
<ChartEvents OnSeriesRender="SeriesRender"></ChartEvents>
@code {
public void SeriesRender(SeriesRenderEventArgs args)
{
args.Fill = "#FF4081";
}
}OnPointRender
Customize individual points:
<ChartEvents OnPointRender="PointRender"></ChartEvents>
@code {
public void PointRender(PointRenderEventArgs args)
{
// Alternate colors
args.Fill = (args.Point.Index % 2 == 0) ? "#009cb8" : "#ff6347";
}
}---
Multi-Series Example
Display multiple chart types together:
<SfChart Title="Sales Comparison">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartLegendSettings Visible="true"></ChartLegendSettings>
<ChartTooltipSettings Enable="true"></ChartTooltipSettings>
<ChartSeriesCollection>
<ChartSeries DataSource="@ActualSales"
Name="Actual"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column">
</ChartSeries>
<ChartSeries DataSource="@TargetSales"
Name="Target"
XName="Month"
YName="Sales"
Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"
Width="3">
<ChartMarker Visible="true" Width="10" Height="10"></ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>---
Performance Tips
1. Limit Data Points: For line/spline charts, downsample data beyond 1000 points 2. Use Column Width in Pixels: For fixed-width columns with many categories 3. Optimize Empty Points: Use Mode="Gap" for better performance with sparse data 4. Batch Updates: Update data source once rather than per-point modifications
---
Troubleshooting
Chart not displaying:
- Verify
Typeproperty is set correctly - Check
DataSourceis populated - Ensure
XNameandYNamematch data model properties (case-sensitive)
Lines/columns not visible:
- Check
Fillcolor isn't transparent - Verify
Opacityisn't set to 0 - Ensure data values aren't all zeros or nulls
Spacing issues:
- Adjust
ColumnSpacing(0 to 1 range) - Use
ColumnWidthorColumnWidthInPixelfor sizing
---
Related Features
- Add data markers for point visualization
- Enable data labels to show values
- Configure tooltips for interactivity
- Apply themes for consistent styling
- Use zooming/panning for large datasets