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("Programming Language", typeof(System.String));
ChartData.Columns.Add("Users", typeof(System.Double));
ChartData.Rows.Add("Java",62000);
ChartData.Rows.Add("Python",46000);
ChartData.Rows.Add("Javascript",38000);
ChartData.Rows.Add("C++",31000);
ChartData.Rows.Add("C#",27000);
ChartData.Rows.Add("PHP",14000);
ChartData.Rows.Add("Perl",14000);
StaticSource source = new StaticSource(ChartData);
DataModel model = new DataModel();
model.DataSources.Add(source);
Charts.PieChart pie = new Charts.PieChart("pie_chart");
pie.Caption.Text = "Most popular programming language";
pie.SubCaption.Text = "2017-2018";
pie.ThemeName = FusionChartsTheme.ThemeName.FUSION;
ViewData["Chart"] = pie.Render();