This sample demonstrates how to create a Stacked Area Chart for U.S. Primary Energy Consumption.
The StackedAreaSeries is representing the multiple of area series are stacked vertically one above the other.
Here, we will explain about stacked area chart to visualize the energy utility consumption of Coal, PetroleumLiquid, PetroleumCoke, Conventional HydroElectric, Nuclear and NaturalGas using WinUI cartesian chart.
Primary energy utility consumption in the United States refers to the amount of energy consumed by various sectors of the economy, such as residential, commercial, industrial, and transportation, before any conversion or transformation. This energy consumption is measured in terms of the raw energy sources used, including fossil fuels (such as coal, natural gas, and petroleum), renewable sources (such as hydroelectric, solar, wind), and nuclear energy.
We can customize the tooltip value using the TooltipBehavior in the SfCartesianChart by initializing the ChartTooltipBehavior class. By using the Duration property, we can set how long the tooltip value is displayed while hovering the mouse over the series, and we can animate the tooltip value using the EnableAnimation property. Additionally, we can customize the appearance of the tooltip using the Style property in the ChartTooltipBehavior.
We can display the chart area while zoomed in by enabling panning using the EnablePanning property. To prevent pinch zooming and mouse wheel zooming actions, we can disable them using the EnablePinchZooming and EnableMouseWheelZooming properties, respectively.
For a step by step procedure, refer to the Creating a WinUI Stacked Area Chart to Visualize US Primary Energy Consumption