Chart DataPerformance !!!Bar and Column ChartsLine and Area ChartsPie and Funnel ChartsScatter and Bubble ChartsRadar and Polar ChartsFinancial ChartsGantt ChartsCombinational ChartsDynamic ChartsWorking with Chart AxesChart FeaturesCustomizing ChartClient-Side Events |
This sample demonstrates the Area chart type.
For detailed implementation, please take a look at the Aspx, Razor and Controller code tabs. <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SamplesBrowser.Models.ThreeSeriesChartData>>" %> <%@ Import Namespace="JQChart.Web.Mvc" %> <!DOCTYPE html> <html> <head runat="server"> <title></title> <link rel="stylesheet" type="text/css" href="~/Content/jquery.jqChart.css" /> <link rel="stylesheet" type="text/css" href="~/Content/themes/le-frog/jquery-ui-1.8.20.css" /> <script src="<%: Url.Content("~/Scripts/jquery-1.11.1.min.js") %>" type="text/javascript"></script> <script src="<%: Url.Content("~/Scripts/jquery.jqChart.min.js") %>" type="text/javascript"></script> <body> <div> <%= Html.JQChart() .Chart(Model) .ID("jqChart") .Width(500) .Height(300) .Title("Three Area Series") .Animation(TimeSpan.FromSeconds(1)) .Shadows(true) .Series(series => { series.Area() .Title("Area 1") .FillStyle("#418CF0") .XValues(el => el.ValueX1) .YValues(el => el.ValueY1); series.Area() .Title("Area 2") .FillStyle("#FCB441") .XValues(el => el.ValueX2) .YValues(el => el.ValueY2); series.Area() .Title("Area 3") .FillStyle("#E0400A") .XValues(el => el.ValueX3) .YValues(el => el.ValueY3); } ) .Render()%> </div> </body> </html> @model IEnumerable<SamplesBrowser.Models.ThreeSeriesChartData> @using JQChart.Web.Mvc <!DOCTYPE html> <html> <head runat="server"> <title></title> <link rel="stylesheet" type="text/css" href="~/Content/jquery.jqChart.css" /> <link rel="stylesheet" type="text/css" href="~/Content/themes/le-frog/jquery-ui-1.8.20.css" /> <script src="@Url.Content("~/Scripts/jquery-1.11.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.jqChart.min.js")" type="text/javascript"></script> <body> <div> @(Html.JQChart() .Chart(Model) .ID("jqChart") .Width(500) .Height(300) .Title("Three Area Series") .Animation(TimeSpan.FromSeconds(1)) .Shadows(true) .Series(series => { series.Area() .Title("Area 1") .FillStyle("#418CF0") .XValues(el => el.ValueX1) .YValues(el => el.ValueY1); series.Area() .Title("Area 2") .FillStyle("#FCB441") .XValues(el => el.ValueX2) .YValues(el => el.ValueY2); series.Area() .Title("Area 3") .FillStyle("#E0400A") .XValues(el => el.ValueX3) .YValues(el => el.ValueY3); } ) .Render() ) </div> </body> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace SamplesBrowser.Models { public class EmptyChartModel { } } using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using SamplesBrowser.Models; namespace SamplesBrowser.Controllers { public class ChartController : Controller { public ActionResult ThreeSeries() { return View(ThreeSeriesChartData.GetData()); } } } |