mcpField
S
syncfusion-winforms-pivot-chart

syncfusion-winforms-pivot-chart

github.com/syncfusionData & databases277 installsUpdated 1w ago
Repository

About syncfusion-winforms-pivot-chart

An implementation skill for Windows Forms developers building Syncfusion Pivot Chart visualizations from multidimensional pivot data. It covers interactive charts, hierarchical drill operations, field grouping, data binding, and Excel export for analytical applications.

Key features

  1. 01Supports multiple chart types
  2. 02Provides hierarchical drill-down and drill-up
  3. 03Binds to IEnumerable or DataTable
  4. 04Includes a field list and drag-and-drop grouping bar
  5. 05Updates charts when data changes
  6. 06Exports charts to Excel

Use cases

  1. 01Analyze sales by product, region, and time
  2. 02Review financial data by department and period
  3. 03Compare marketing campaigns across channels and time
  4. 04Explore business metrics through hierarchical drill-down

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/winforms-ui-components-skills --skill syncfusion-winforms-pivot-chart

After installing, type/syncfusion-winforms-pivot-chartin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
appearance-customization.md
chart-types.md
data-binding.md
drill-operations.md
export.md
getting-started.md
grouping-bar.md
legend.md
pivot-axis.md
pivot-table-field-list.md
sorting.md
touch-support.md
troubleshooting.md
zooming-scrolling.md

Details

From the project README

Implementing Syncfusion Pivot Chart

A comprehensive guide for implementing the Syncfusion Pivot Chart control in Windows Forms applications. The Pivot Chart provides interactive visualization of multidimensional pivot data with drill-down capabilities, supporting 11+ chart types and advanced features like grouping bar, field list, and Excel export.

When to Use This Skill

Use this skill when you need to:

  • Visualize pivot data in graphical format with multiple chart types
  • Implement drill-down/drill-up functionality to navigate through hierarchical data levels
  • Create business intelligence dashboards with interactive pivot visualizations
  • Analyze multidimensional data from IEnumerable lists or DataTables
  • Build OLAP visualization interfaces for analytical applications
  • Add interactive data exploration with grouping bar and pivot field list
  • Export pivot charts to Excel format for reporting
  • Display hierarchical sales, financial, or analytical data in chart format
  • Implement Excel-like pivot chart functionality in Windows Forms applications
  • Create dynamic charts that update based on pivot field selections

Component Overview

The Syncfusion Pivot Chart is a lightweight, high-performance control that reads pivot information and visualizes it in graphical format. It provides:

  • 11+ Chart Types: Line, Spline, Column, Area, Spline Area, Stacking Area, Stacking Column, Stacking Area 100, Stacking Column 100, Step Line, Step Area
  • Drill Support: Navigate through inner levels of data hierarchy with drill-down/drill-up
  • Data Binding: Support for IEnumerable lists and DataTable sources
  • Pivot Table Field List: Built-in pivot schema designer similar to Microsoft Excel
  • Grouping Bar: Interactive drag-and-drop grouping of data fields
  • Legend: Color-coded series identification
  • Export: Export to Excel format
  • Zooming and Scrolling: Interactive data exploration
  • Touch Support: Touch-friendly for tablets and touch-enabled devices
  • Real-time Updates: Automatic chart updates when data changes

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Assembly deployment and dependencies
  • Adding control via designer, code, or Syncfusion Reference Manager
  • Licensing requirements (v16.2.0.x+)
  • Basic initialization and first data binding
  • ItemSource, PivotAxis, PivotLegend, and PivotCalculations setup
Data Binding

📄 Read: references/data-binding.md

  • Binding IEnumerable lists and DataTable sources
  • Configuring ItemSource property
  • Setting up PivotAxis for hierarchical data
  • Configuring PivotLegend for series categorization
  • Setting up PivotCalculations for data aggregation
  • Real-time updates with EnableUpdating
  • Performance optimization with BeginUpdate/EndUpdate
Chart Types

📄 Read: references/chart-types.md

  • Overview of 11 supported chart types
  • Line, Spline, Step Line charts
  • Column and Stacking Column charts
  • Area, Spline Area, Step Area charts
  • Stacking Area and Stacking Column (100%) charts
  • Switching chart types dynamically
  • ChartTypes enumeration
  • Choosing appropriate chart type for your data
Drill Operations

📄 Read: references/drill-operations.md

  • Enabling drill-down/drill-up functionality
  • AllowDrillDown property configuration
  • Navigating through hierarchical data levels
  • Using expanders for drill operations
  • Programmatic drill operations
  • User interactions and drill events
Grouping Bar

📄 Read: references/grouping-bar.md

  • Enabling and configuring grouping bar
  • Interactive drag-and-drop field grouping
  • Field manipulation and rearrangement
  • Visibility and customization options
  • User interactions with grouping bar
Pivot Axis Configuration

📄 Read: references/pivot-axis.md

  • Understanding PivotAxis property
  • Adding PivotItem objects to axis
  • FieldMappingName for data field binding
  • TotalHeader for aggregate displays
  • Multiple axis items for hierarchical structure
  • Axis customization options
Pivot Table Field List

📄 Read: references/pivot-table-field-list.md

  • Built-in pivot schema designer
  • Microsoft Excel-like field list interface
  • Enabling and displaying field list
  • Drag-and-drop field configuration
  • Filter setup and management
  • Calculation field configuration
  • User interactions with field list
Legend

📄 Read: references/legend.md

  • Configuring PivotLegend property
  • Color coding for series identification
  • Legend positioning and layout
  • Visibility and customization options
  • Series labels and formatting
Sorting

📄 Read: references/sorting.md

  • Sorting pivot data in charts
  • Ascending and descending sort orders
  • Multiple field sorting and Custom sort logic
  • Sort configuration options
Export

📄 Read: references/export.md

  • Exporting pivot charts to Excel
  • Export configuration and options
  • File format settings
  • Programmatic export operations
  • Customizing exported output
Zooming and Scrolling

📄 Read: references/zooming-scrolling.md

  • Interactive zoom functionality
  • Scroll support for large datasets and Mouse wheel zoom operations
  • Zoom configuration and customization
  • Scrollbar appearance and behavior
Touch Support

📄 Read: references/touch-support.md

  • Touch gesture support for tablets
  • Touch interactions (tap, swipe, pinch)
  • Optimizing for touch-enabled devices
  • Touch gesture configuration
  • Mobile and tablet considerations
Appearance and Customization

📄 Read: references/appearance-customization.md

  • Chart area customization
  • Series styling and colors and Color palette configuration
  • Print support and settings
  • Custom styling options
Troubleshooting

📄 Read: references/troubleshooting.md

  • Common issues and solutions
  • Data binding errors and fixes
  • Performance optimization tips
  • How to enable drill-down and to print the pivot chart
  • How to set custom color palettes, debugging and diagnostic tips

Quick Start Example

Minimal Pivot Chart Implementation
using System;
using System.Windows.Forms;
using Syncfusion.Windows.Forms.PivotChart;
using Syncfusion.PivotAnalysis.Base;

namespace PivotChartDemo
{
    public partial class Form1 : Form
    {
        private PivotChart pivotChart1;
        
        public Form1()
        {
            InitializeComponent();
            
            // Initialize Pivot Chart
            pivotChart1 = new PivotChart();
            pivotChart1.Dock = DockStyle.Fill;
            
            // Bind data source
            pivotChart1.ItemSource = ProductSales.GetSalesData();
            
            // Configure Pivot Axis (hierarchical structure)
            pivotChart1.PivotAxis.Add(new PivotItem 
            { 
                FieldMappingName = "Product", 
                TotalHeader = "Total" 
            });
            pivotChart1.PivotAxis.Add(new PivotItem 
            { 
                FieldMappingName = "Country", 
                TotalHeader = "Total" 
            });
            pivotChart1.PivotAxis.Add(new PivotItem 
            { 
                FieldMappingName = "State", 
                TotalHeader = "Total" 
            });
            
            // Configure Pivot Legend (series categorization)
            pivotChart1.PivotLegend.Add(new PivotItem 
            { 
                FieldMappingName = "Date", 
                TotalHeader = "Total" 
            });
            
            // Configure Calculations (data aggregation)
            pivotChart1.PivotCalculations.Add(new PivotComputationInfo 
            { 
                FieldName = "Quantity", 
                Format = "#,##0" 
            });
            
            // Set chart type
            pivotChart1.ChartTypes = PivotChartTypes.Column;
            
            // Enable drill-down
            pivotChart1.AllowDrillDown = true;
            
            // Add to form
            this.Controls.Add(pivotChart1);
        }
    }
}

Common Patterns

Pattern 1: Binding to IEnumerable Collection
using System.Collections.Generic;

// Data model
public class SalesData
{
    public string Product { get; set; }
    public string Region { get; set; }
    public string Quarter { get; set; }
    public int Quantity { get; set; }
    public decimal Amount { get; set; }
}

// Create and bind data
private void BindPivotChart()
{
    List<SalesData> salesList = new List<SalesData>
    {
        new SalesData { Product = "Laptop", Region = "North", Quarter = "Q1", Quantity = 50, Amount = 50000 },
        new SalesData { Product = "Laptop", Region = "South", Quarter = "Q1", Quantity = 40, Amount = 40000 },
        new SalesData { Product = "Mouse", Region = "North", Quarter = "Q1", Quantity = 200, Amount = 6000 },
        // Add more data...
    };
    
    pivotChart1.ItemSource = salesList;
    
    // Configure fields
    pivotChart1.PivotAxis.Add(new PivotItem { FieldMappingName = "Product", TotalHeader = "Total" });
    pivotChart1.PivotLegend.Add(new PivotItem { FieldMappingName = "Quarter", TotalHeader = "Total" });
    pivotChart1.PivotCalculations.Add(new PivotComputationInfo 
    { 
        FieldName = "Amount", 
        Format = "C",
        SummaryType = SummaryType.DoubleTotalSum 
    });
}
Pattern 2: Switching Chart Types Dynamically
// Add buttons or menu items to switch chart types
private void btnLineChart_Click(object sender, EventArgs e)
{
    pivotChart1.ChartTypes = PivotChartTypes.Line;
}

private void btnColumnChart_Click(object sender, EventArgs e)
{
    pivotChart1.ChartTypes = PivotChartTypes.Column;
}

private void btnAreaChart_Click(object sender, EventArgs e)
{
    pivotChart1.ChartTypes = PivotChartTypes.Area;
}

private void btnStackingColumn_Click(object sender, EventArgs e)
{
    pivotChart1.ChartTypes = PivotChartTypes.StackingColumn;
}
Pattern 3: Hierarchical Drill-Down Configuration
// Enable drill-down with multiple hierarchy levels
private void ConfigureDrillDown()
{
    pivotChart1.AllowDrillDown = true;
    
    // Define hierarchy: Category → Product → Region → State
    pivotChart1.PivotAxis.Clear();
    pivotChart1.PivotAxis.Add(new PivotItem 
    { 
        FieldMappingName = "Category", 
        TotalHeader = "All Categories" 
    });
    pivotChart1.PivotAxis.Add(new PivotItem 
    { 
        FieldMappingName = "Product", 
        TotalHeader = "All Products" 
    });
    pivotChart1.PivotAxis.Add(new PivotItem 
    { 
        FieldMappingName = "Region", 
        TotalHeader = "All Regions" 
    });
    pivotChart1.PivotAxis.Add(new PivotItem 
    { 
        FieldMappingName = "State", 
        TotalHeader = "All States" 
    });
}
Pattern 4: Real-Time Data Updates
// Enable automatic updates when data changes
private void ConfigureRealTimeUpdates()
{
    // Enable automatic chart updates
    pivotChart1.EnableUpdating = true;
    
    // Bind to observable collection or implement INotifyPropertyChanged
    var salesData = new BindingList<SalesData>(GetSalesData());
    pivotChart1.ItemSource = salesData;
    
    // Now any changes to salesData will automatically update the chart
}

// For bulk updates, use BeginUpdate/EndUpdate
private void BulkDataUpdate()
{
    pivotChart1.BeginUpdate();
    
    try
    {
        // Perform multiple data operations
        var data = (BindingList<SalesData>)pivotChart1.ItemSource;
        for (int i = 0; i < 100; i++)
        {
            data.Add(new SalesData { /* ... */ });
        }
    }
    finally
    {
        pivotChart1.EndUpdate(); // Chart updates once after all changes
    }
}
Pattern 5: Multiple Calculations with Formatting
// Display multiple aggregated values with custom formatting
private void ConfigureMultipleCalculations()
{
    pivotChart1.PivotCalculations.Clear();
    
    // Total quantity
    pivotChart1.PivotCalculations.Add(new PivotComputationInfo
    {
        FieldName = "Quantity",
        Format = "#,##0",
        SummaryType = SummaryType.DoubleTotalSum,
        FieldHeader = "Total Qty"
    });
    
    // Total amount (currency)
    pivotChart1.PivotCalculations.Add(new PivotComputationInfo
    {
        FieldName = "Amount",
        Format = "C2",
        SummaryType = SummaryType.DoubleTotalSum,
        FieldHeader = "Total Amount"
    });
    
    // Average price
    pivotChart1.PivotCalculations.Add(new PivotComputationInfo
    {
        FieldName = "UnitPrice",
        Format = "C2",
        SummaryType = SummaryType.DoubleAverage,
        FieldHeader = "Avg Price"
    });
}

Key Properties and Methods

Core Properties
PropertyTypeDescription
ItemSourceobjectData source (IEnumerable or DataTable)
PivotAxisPivotItemCollectionFields for chart axis (hierarchical)
PivotLegendPivotItemCollectionFields for legend/series
PivotCalculationsPivotComputationInfoCollectionCalculation/aggregation fields
ChartTypesPivotChartTypesChart type (Line, Column, Area, etc.)
AllowDrillDownboolEnable drill-down/drill-up operations
EnableUpdatingboolAuto-update when data changes
PivotItem Properties
PropertyTypeDescription
FieldMappingNamestringName of data field to bind
TotalHeaderstringHeader text for total/aggregate row
FieldHeaderstringDisplay header for the field
PivotComputationInfo Properties
PropertyTypeDescription
FieldNamestringName of field to calculate
FormatstringNumber format string
SummaryTypeSummaryTypeAggregation type (Sum, Average, Count, etc.)
FieldHeaderstringDisplay name for calculation
Key Methods
MethodDescription
BeginUpdate()Suspend chart updates for bulk operations
EndUpdate()Resume chart updates and refresh
Refresh()Manually refresh the chart

Common Use Cases

Business Intelligence Dashboard
  • Visualize sales data by product, region, and time period
  • Drill down from yearly to quarterly to monthly views
  • Compare multiple metrics (quantity, revenue, profit)
Financial Analysis
  • Display financial data across departments, periods, and categories
  • Analyze budget vs. actual spending with hierarchical drill-down
  • Visualize profit/loss trends across business units
Marketing Analytics
  • Analyze campaign performance by channel, region, and time period
  • Compare multiple KPIs (impressions, clicks, conversions)
  • Drill down from campaign level to ad group level

Performance Considerations

  1. Use BeginUpdate/EndUpdate for bulk data operations to prevent multiple redraws
  2. Limit hierarchy depth - 3-4 levels is optimal for performance and usability
  3. Filter data before binding rather than binding entire dataset
  4. Consider data volume - for very large datasets (100k+ rows), pre-aggregate data

Best Practices

  1. Always register license key before creating pivot chart control
  2. Define clear hierarchy in PivotAxis for intuitive drill-down
  3. Use descriptive TotalHeader values for better user understanding
  4. Format calculations appropriately (currency, percentages, numbers)
  5. Enable drill-down only if data has meaningful hierarchical structure
  6. Use grouping bar or field list for interactive user exploration

Comments

Markdown supported