Leaf charting operational
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user