Settings
Chart Type: Line
Stacking: None
Start Angle: 0
Total Angle: 360
Reversed: False
Description
The example shows how to create and customize a Polar chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | using System.Collections.Generic; using System.Web.Mvc; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class FlexRadarController : Controller { private List<MapData> mapData = MapData.GetData(); public ActionResult Polar() { var settings = new ClientSettingsModel { Settings = CreateRadarSettings(), DefaultValues = GetPolarDefaultValues() }; settings.LoadRequestData(Request); ViewBag.DemoSettingsModel = settings; return View(mapData); } private static IDictionary< string , object > GetPolarDefaultValues() { var defaultValues = new Dictionary< string , object > { { "ChartType" , "Line" }, { "TotalAngle" , 360} }; return defaultValues; } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | @model IEnumerable< MapData > @using C1.Web.Mvc.Chart @ { ViewBag.DemoSettings = true ; ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel; } @ (Html.C1().FlexRadar().Id(demoSettingsModel.ControlId) .ChartType(demoSettingsModel.GetEnum( "ChartType" , C1.Web.Mvc.Chart.RadarChartType.Line)) .Stacking(demoSettingsModel.GetEnum( "Stacking" , C1.Web.Mvc.Chart.Stacking.None)) .Bind( "Longitude" , "Latitude1" , Model) .Series(ser => { ser.Add().Name( "Latitude1" ); ser.Add().Binding( "Latitude2" ).Name( "Latitude2" ); }) .Legend(Position.Top) .Width( "500px" ) .Height( "500px" ) ) @section Description{ < p > @Html .Raw(Resources.FlexRadar.Polar_Text0)</ p > } |