Chart Data

Performance !!!

Bar and Column Charts

Line and Area Charts

Pie Charts

Scatter and Bubble Charts

Radar and Polar Charts

Financial Charts

Gantt Charts

Combinational Charts

Dynamic Charts

Working with Chart Axes

Chart Features

Customizing Chart

Client-Side Events


This sample demonstrates the Polar Line 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.PolarChartData>>" %>

<%@ 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/jquery.jqRangeSlider.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.mousewheel.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.jqChart.min.js") %>" type="text/javascript"></script>    
    <script src="<%: Url.Content("~/Scripts/jquery.jqRangeSlider.min.js") %>" type="text/javascript"></script>
    <!--[if IE]><script lang="javascript" type="text/javascript" src="<%: Url.Content("~/Scripts/excanvas.js") %>"></script><![endif]-->
</head>
<body>
    <div>
        <%= Html.JQChart()
            .Chart(Model)
            .ID("jqChart")
            .Width(500)
            .Height(300)
            .Title("Polar Line Chart")
            .Border(border => border.StrokeStyle("#6ba851"))
            .Background(background => background.LinearGradient(0, 0, 0, 1).ColorStops(stop =>
            {
                stop.Add(0, "#d2e6c9");
                stop.Add(1, "white");
            }))
            .Shadows(true)
            .Animation(TimeSpan.FromSeconds(1))
            .Axes(axis =>
                {
                    axis.LinearRadiusAxis().InnerExtent(0);
                }
            )
            .Series(series =>
                {
                    series.PolarLine()
                          .XValues(el => el.ValueX1)
                          .YValues(el => el.ValueY1)
                          .Markers(el => el.MarkerType(MarkerType.Diamond));

                    series.PolarLine()
                          .XValues(el => el.ValueX2)
                          .YValues(el => el.ValueY2)
                          .Markers(el => el.MarkerType(MarkerType.Diamond));
                }
            )
            .Render()%>
    </div>
</body>
</html>

                                        
 
@model IEnumerable<SamplesBrowser.Models.PolarChartData>
@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/jquery.jqRangeSlider.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.mousewheel.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.jqChart.min.js")" type="text/javascript"></script>    
    <script src="@Url.Content("~/Scripts/jquery.jqRangeSlider.min.js")" type="text/javascript"></script>
    <!--[if IE]><script lang="javascript" type="text/javascript" src="@Url.Content("~/Scripts/excanvas.js")"></script><![endif]-->
</head>
<body>
    <div>
          @(Html.JQChart()
            .Chart(Model)
            .ID("jqChart")
            .Width(500)
            .Height(300)
            .Title("Polar Line Chart")
            .Border(border => border.StrokeStyle("#6ba851"))
            .Background(background => background.LinearGradient(0, 0, 0, 1).ColorStops(stop =>
            {
                stop.Add(0, "#d2e6c9");
                stop.Add(1, "white");
            }))
            .Shadows(true)
            .Animation(TimeSpan.FromSeconds(1))
            .Axes(axis =>
                {
                    axis.LinearRadiusAxis().InnerExtent(0);
                }
            )
            .Series(series =>
                {
                    series.PolarLine()
                          .XValues(el => el.ValueX1)
                          .YValues(el => el.ValueY1)
                          .Markers(el => el.MarkerType(MarkerType.Diamond));

                    series.PolarLine()
                          .XValues(el => el.ValueX2)
                          .YValues(el => el.ValueY2)
                          .Markers(el => el.MarkerType(MarkerType.Diamond));
                }
            )
            .Render() 
          )
    </div>
</body>
</html>

                                        
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SamplesBrowser.Models
{
    public class PolarChartData
    {
        public static List<PolarChartData> GetData()
        {
            var data = new List<PolarChartData>();

            for (var angle = 0.0; angle <= 360.0; angle += 10.0) {
                var yValue = (1.0 + Math.Sin(angle / 180.0 * Math.PI)) * 10.0;

                yValue = Math.Round(yValue, 2);

                var x1 = angle + 90;
                var x2 = angle + 270;

                if (x1 > 360) {
                    x1 -= 360;
                }

                if (x2 > 360) {
                    x2 -= 360;
                }

                data.Add(new PolarChartData(x1, yValue, x2, yValue));
            }

            return data;
        }

        public PolarChartData(double valueX1, double valueY1, double valueX2, double valueY2)
        {
            this.ValueX1 = valueX1;
            this.ValueX2 = valueX2;
            this.ValueY1 = valueY1;
            this.ValueY2 = valueY2;
        }

        public double ValueX1 { get; set; }
        public double ValueX2 { get; set; }
        public double ValueY1 { get; set; }
        public double ValueY2 { get; set; }
    }
}
                                        
 
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 PolarLineChart()
        {
            return View(PolarChartData.GetData());
        }

    }
}