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("Month", typeof(System.String));
ChartData.Columns.Add("Revenue", typeof(System.Double));
ChartData.Rows.Add("Jan 2016", 27400);
ChartData.Rows.Add("Feb 2016", 29800);
ChartData.Rows.Add("Mar 2016", 25800);
ChartData.Rows.Add("Apr 2016", 26800);
ChartData.Rows.Add("May 2016", 29600);
ChartData.Rows.Add("Jun 2016", 32600);
ChartData.Rows.Add("Jul 2016", 31800);
ChartData.Rows.Add("Aug 2016", 36700);
ChartData.Rows.Add("Sep 2016", 29700);
ChartData.Rows.Add("Oct 2016", 31900);
ChartData.Rows.Add("Nov 2016", 34800);
ChartData.Rows.Add("Dec 2016", 24800);
ChartData.Rows.Add("Jan 2017", 26300);
ChartData.Rows.Add("Feb 2017", 31800);
ChartData.Rows.Add("Mar 2017", 30900);
ChartData.Rows.Add("Apr 2017", 33000);
ChartData.Rows.Add("May 2017", 36200);
ChartData.Rows.Add("Jun 2017", 32100);
ChartData.Rows.Add("Jul 2017", 37500);
ChartData.Rows.Add("Aug 2017", 38500);
ChartData.Rows.Add("Sep 2017", 35400);
ChartData.Rows.Add("Oct 2017", 38200);
ChartData.Rows.Add("Nov 2017", 33300);
ChartData.Rows.Add("Dec 2017", 38300);
StaticSource source = new StaticSource(ChartData);
DataModel model = new DataModel();
model.DataSources.Add(source);
Charts.ColumnChart column = new Charts.ColumnChart("scroll_chart_db");
column.Scrollable = true;
column.Data.Source = model;
column.Caption.Text = "Sales Trends";
column.SubCaption.Text = "2016-2017";
column.XAxis.Text = "Month";
column.YAxis.Text = "Revenue";
column.Height.Pixel(500);
column.ThemeName = FusionChartsTheme.ThemeName.FUSION;
ViewData["Chart"] = column.Render();