Create a Sunburst or Stacked Bar Chart in ASP.NET MVC
Question details
Create a hierarchical chart that displays countries and their medal categories in an ASP.NET MVC application.

- Product
- ASP.NET MVC
- Device & OS
- not provided
- Scenario
- A developer wants to show countries in an inner ring and medal categories in an outer ring.
- Observed behavior
- A multi-level chart should represent the country-to-medal hierarchy, although a chart with many slices may be difficult to read.
Organize the data by country, medal category, and medal count. Check that your ASP.NET MVC charting library supports sunburst charts or nested doughnut series.
Build a Sunburst Chart in an ASP.NET MVC View
Use a sunburst chart to display countries and medal categories as hierarchical rings.
A sunburst chart uses parent-child relationships: country nodes form the inner level, and medal-category nodes form the outer level.
In your controller or view model, create a unique ID for each country and a child node for each medal category. Give each child the country ID as its parent and the medal count as its value.
In the MVC view, add a chart container and load a library that supports sunburst charts. For example, Highcharts requires its core script and sunburst module.
Pass the hierarchy from the controller to the view as JSON, then initialize the chart in a script with a sunburst series and the node data.
Set consistent colors for Gold, Silver, and other medal-category nodes. Enable data labels and, if the library supports them, outside labels or callouts; use tooltips for details that do not fit.

Use a Stacked Bar Chart to Compare Countries
Choose a stacked bar chart when many slices make a radial chart difficult to read.
Compare Medal Counts in WPS Spreadsheets
For spreadsheet-based comparisons, WPS Office is a free, lightweight alternative with a familiar interface and support for Excel files, making it easy to move existing data. It does not replace a charting library in an ASP.NET MVC application.

Frequently Asked Questions
How should I structure data for a sunburst chart?
Create a node for each country with a unique ID, then add medal-category nodes that reference the country ID as their parent. Store the medal count on each category node.
Can I use a nested doughnut chart instead of a sunburst?
Yes, if your chart library supports multiple doughnut series or nested rings. Configure the inner ring for countries and the outer ring for medal categories, ensuring the slices align with their parent countries.
What can I do if the chart has too many labels?
Use the chart library's data-label options to show outside labels or callouts where supported, and place less essential details in tooltips. A stacked bar chart can also make comparisons easier.
Does WPS Office create the chart inside my ASP.NET MVC application?
No. WPS Spreadsheets can create spreadsheet charts, but an ASP.NET MVC page needs a web charting library to render an interactive chart in the application.




