The quick start guides you through the steps of adding a Sunburst chart to your MVC web application and add data to it.
To accomplish this, follow these steps:
Create a new MVC application using the ComponentOne or VisualStudio templates. For more information about creating an MVC application, see Configuring your MVC Application topic.
HierarchicalData.cs
). See Adding controls to know how to add a new model.Complete the following steps to initialize a Sunburst chart.
Add a new Controller
SunburstController
).C# |
Copy Code
|
---|---|
using C1.Web.Mvc; using C1.Web.Mvc.Serializition; using C1.Web.Mvc.Chart; |
SunburstController.
Index()
.Razor |
Copy Code
|
---|---|
@(Html.C1().Sunburst<HierarchicalData>() .Bind("Year", "Value", Model) .DataLabel(dl => dl.Content("{name}:{value}").Position(PieLabelPosition.Center)) .Header("2015, 2016, 2017") .BindingName("Year", "Quarter", "Month") .Width(500).Height(500)) |