The quick start guides you through the steps of adding a FlexPie control to your MVC web application and add data to it.
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.
FlexPieDataSource.cs
). See Adding controls to know how to add a new model.Complete the following steps to initialize a FlexPie control.
Add a new Controller
Default1Controller
).C# |
Copy Code
|
---|---|
using C1.Web.Mvc; using C1.Web.Mvc.Serializition; using C1.Web.Mvc.Chart; |
Index()
with the following method.
Add a View for the Controller
QuickStartController
to open it.QuickStart()
.Index.cshtml |
Copy Code
|
---|---|
@using MvcApplication1.Models @model IEnumerable<FlexPieDataSource> @(Html.C1().FlexPie<FlexPieDataSource>() .Bind("Country", "Sales", Model) ) |
Index.vbhtml |
Copy Code
|
---|---|
@ModelType IEnumerable(Of FlexPieDataSource) @(Html.C1().FlexPie(Of FlexPieDataSource) _ .Bind("Country", "Sales", Model) _ .Height("300px")) |