@using Trirand.Web.Mvc
@using Trirand.Web.Mvc.Chart;

<!DOCTYPE html>
<html lang="en-us">
<head>
    <meta charset="utf-8">
    <title>Chartfor ASP.NET MVC - Mixed Chart - Car Sales USA</title>
    <script type="text/javascript" src="~/Scripts/trirand/chart/corechart.min.js"></script>
</head>
<body>
    <div>
        <!--
        The Html.Trirand().CoreChart() helper has two parameters
            - the model of the chart -- all chart properties, data and settings
            - the ID of the chart -- can be used for client-side manipulation
        In this example we are using hardcoded model in the View, but you can contruct the model in
        the controller based on runtime criteria and database data and pass the model
        to the View using ViewData
        -->
        @(Html.Trirand().CoreChart(
            ViewData["CarChartModel"] as CoreChart,                       
            "Chart")
        )

        <br />
        <div>
             
        </div>
    </div>
</body>
</html>

using System.Web.Mvc;
using System.Collections.Generic;
using CoreDemo.Models;
using Trirand.Web.Mvc.Chart;
using Trirand.Web.Mvc.Chart.Series;

namespace CoreDemo.Controllers.Chart
{
    public partial class ChartController : Controller
    {
        public ActionResult CarSales()
        {
            List<string> xAxisData = new List<string> { "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016" };
            List<int> data1 = new List<int> { 1, 13, 37, 35, 15, 13, 25, 21, 6, 45, 32, 2, 4, 13, 6, 4, 11 };
            List<int> data2 = new List<int> { 209, 236, 325, 439, 507, 576, 722, 879, 938, 1364, 1806, 1851, 1931, 2198, 2349, 2460, 2735 };


            CoreChart carChartModel = new CarSales().CarChart;
            carChartModel.XAxis[0].Data = xAxisData;

            List<object> series = (List<object>)carChartModel.Series;
            Line lineSeries = (Line)series[0];
            Bar barSeries = (Bar)series[1];

            lineSeries.Data = data1;
            barSeries.Data = data2;

            ViewData["CarChartModel"] = carChartModel;

            return View("");
        }
    }
}