Chart Data

Performance !!!

Bar and Column Charts

Line and Area Charts

Pie and Funnel Charts

Scatter and Bubble Charts

Radar and Polar Charts

Financial Charts

Gantt Charts

Combinational Charts

Working with Chart Axes

Chart Features

Customizing Chart

Client-Side Events


This sample demonstrates the Stacked Area chart type.

For detailed implementation, please take a look at the Aspx code tab.
 
<%@ Page  Language="C#"  %>

<%@ Register assembly="JQChart.Web" namespace="JQChart.Web.UI.WebControls" tagprefix="jqChart" %>

<!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="<% = ResolveUrl("~/Scripts/jquery-1.11.1.min.js") %>" type="text/javascript"></script>
    <script src="<% = ResolveUrl("~/Scripts/jquery.jqChart.min.js") %>" type="text/javascript"></script>
</head>
<body>
    <form runat="server">
    <asp:ObjectDataSource ID="ObjectDataSource1"
        runat="server"
        SelectMethod="GetData"
        TypeName="SamplesBrowser.Models.StackedChartData"></asp:ObjectDataSource>
    <jqChart:Chart ID="Chart2" Width="500px" Height="300px" runat="server" DataSourceID="ObjectDataSource1">
        <Title Text="Stacked Area Chart"></Title>
        <Animation Enabled="True" Duration="00:00:01" />
        <Shadows Enabled="true" />
        <Axes>
            <jqChart:CategoryAxis Location="Bottom" CategoriesField="Label">
            </jqChart:CategoryAxis>
        </Axes>
        <Series>
            <jqChart:StackedAreaSeries Title="Stacked 1" YValuesField="Value1">
                <Labels Font="12px sans-serif" Visible="True">
                </Labels>
            </jqChart:StackedAreaSeries>
            <jqChart:StackedAreaSeries Title="Stacked 2" YValuesField="Value2">
                <Labels Font="12px sans-serif" Visible="True">
                </Labels>
            </jqChart:StackedAreaSeries>
            <jqChart:StackedAreaSeries Title="Stacked 3" YValuesField="Value3">
                <Labels Font="12px sans-serif" Visible="True">
                </Labels>
            </jqChart:StackedAreaSeries>
        </Series>
    </jqChart:Chart>
</form>
</body>
</html>

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

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

            data.Add(new StackedChartData("A", 62, 56, 33));
            data.Add(new StackedChartData("B", 70, 30, 42));
            data.Add(new StackedChartData("C", 68, 62, 54));
            data.Add(new StackedChartData("D", 58, 65, 23));
            data.Add(new StackedChartData("E", 52, 40, 54));
            data.Add(new StackedChartData("F", 60, 36, 47));
            data.Add(new StackedChartData("G", 48, 70, 61));

            return data;
        }

        public static List<StackedChartData> GetGroupData()
        {
            var data = new List<StackedChartData>();

            data.Add(new StackedChartData("2000", 62, 56, 33, 43));
            data.Add(new StackedChartData("2001", 70, 30, 42, 52));
            data.Add(new StackedChartData("2002", 68, 62, 54, 64));
            data.Add(new StackedChartData("2003", 58, 65, 23, 33));

            return data;
        }

        public StackedChartData(string label, double value1, double value2, double value3)
        {
            this.Label = label;
            this.Value1 = value1;
            this.Value2 = value2;
            this.Value3 = value3;
        }

        public StackedChartData(string label, double value1, double value2, double value3, double value4)
        {
            this.Label = label;
            this.Value1 = value1;
            this.Value2 = value2;
            this.Value3 = value3;
            this.Value4 = value4;
        }

        public string Label { get; set; }
        public double Value1 { get; set; }
        public double Value2 { get; set; }
        public double Value3 { get; set; }
        public double Value4 { get; set; }
    }
}