using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using FusionCharts.Visualization;
using FusionCharts.DataEngine;
namespace FusionChartsSamples
public class HomeController : Controller
public ActionResult Index()
DataTable ChartData = new DataTable();
ChartData.Columns.Add("Quarter", typeof(System.String));
ChartData.Columns.Add("Food Products", typeof(System.Double));
ChartData.Columns.Add("Non-Food Products", typeof(System.Double));
ChartData.Rows.Add("Q1", 11000, 11400);
ChartData.Rows.Add("Q2", 15000, 14800);
ChartData.Rows.Add("Q3", 13500, 8300);
ChartData.Rows.Add("Q4", 15000, 11800);
StaticSource source = new StaticSource(ChartData);
DataModel model = new DataModel();
model.DataSources.Add(source);
Charts.StackedChart stack = new Charts.StackedChart("stacked_chart_db");
stack.Caption.Text = "Revenue split by product aategory";
stack.Caption.Bold = true;
stack.SubCaption.Text = "for current year";
stack.XAxis.Text = "Quarter";
stack.YAxis.Text = "Revenue";
stack.Data.Source = model;
stack.ThemeName = FusionChartsTheme.ThemeName.FUSION;
ViewData["Chart"] = stack.Render();