FlexPie
Selection
Features
Sample
Settings
Description
This view shows the FlexPie's selection feature.
Source
SelectionController.cs
using System.Collections.Generic; using System.Web.Mvc; using C1.Web.Mvc.Chart; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class FlexPieController : Controller { public ActionResult Selection() { ViewBag.DemoSettingsModel = new ClientSettingsModel { Settings = CreateSelectionSettings() }; return View(CustomerOrder.GetCountryGroupOrderData()); } private static IDictionary<string, object[]> CreateSelectionSettings() { var settings = new Dictionary<string, object[]> { {"SelectedItemPosition", new object[]{Position.Top, Position.Bottom, Position.Left, Position.None, Position.Right, Position.Auto}}, {"SelectedItemOffset", new object[]{0, 0.1, 0.2}}, {"IsAnimated", new object[]{true, false}} }; return settings; } } }
Selection.cshtml
@using C1.Web.Mvc.Chart @model IEnumerable<CustomerOrder> @{ ViewBag.DemoSettings = true; ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel; } @(Html.C1().FlexPie<CustomerOrder>().Id(demoSettingsModel.ControlId).Header("Sales").Bind("Country", "Count", Model) .SelectionMode(SelectionMode.Point).IsAnimated(true).SelectedItemPosition(Position.Top)) @section Description{ <p>@Html.Raw(Resources.FlexPie.Selection_Text0)</p> }
Documentation