Leaf charting operational

This commit is contained in:
2015-12-04 22:03:13 -05:00
parent 685e8c8658
commit 5b85662bdb
7 changed files with 315 additions and 871 deletions
+21
View File
@@ -7,6 +7,8 @@ using System.Web;
using System.Web.Mvc;
using System.Web.UI.DataVisualization.Charting;
using System.Web.UI.WebControls;
using LeafWeb.Core.Charter;
using LeafWeb.Web.Charter;
namespace LeafWeb.Web.Controllers
{
@@ -17,6 +19,25 @@ namespace LeafWeb.Web.Controllers
return View();
}
public ActionResult LeafCharts(int number)
{
var fileInfo = new FileInfo(@"C:\Users\poprhythm\Documents\code\LeafWeb\Core.Tests\Parsers\LeafOutputData\cntrlcomparison_Wild Capsicum.csv");
var curveDataList = new CurveDataList();
using (var reader = fileInfo.OpenText())
{
curveDataList.ReadFromStream(reader);
}
var charts = LeafWebCharter.ProduceCharts(curveDataList.CurveData);
using (var ms = new MemoryStream())
{
charts.Skip(number).First().SaveImage(ms, ChartImageFormat.Png);
ms.Seek(0, SeekOrigin.Begin);
return File(ms.ToArray(), "image/png", "mychart.png");
}
}
public ActionResult ChartSample()
{
var chart = new Chart