This sample shows how to embed sparkline charts in Pivot Table cells to visually highlight trends and comparisons in sales data. You can choose different sparkline types Line, Column, Area, or WinLoss directly from the grand total header cell to analyze performance metrics at a glance.
This sample demonstrates how to embed Sparkline charts within the Pivot Table's grand total cells to visually summarize yearly sales performance across different regions. The charts are rendered by capturing relevant cell values during the queryCellInfo event and inserting the sparklines after the Pivot Table is fully rendered via the dataBound event. A built-in dropdown in the grand total column header allows dynamic switching between Sparkline types at runtime: Line - Displays trends with a continuous line. Column - Shows values as vertical bars for easy comparison. Area - Highlights magnitude with a filled line chart. WinLoss - Visualizes binary outcomes without exposing exact values. Embedding the chart-type selector within the header keeps the interface compact and intuitive, enabling seamless visual analysis with minimal performance overhead. More information on queryCellInfo can be found in this documentation section.