New conversion complete
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.UI.DataVisualization.Charting;
|
||||
using System.Web.UI.WebControls;
|
||||
using LeafWeb.Core.Charter;
|
||||
using LeafWeb.Core.CharterOld;
|
||||
using LeafWeb.Core.Models;
|
||||
using LeafWeb.Core.Parsers;
|
||||
using LeafWeb.Web.Charter;
|
||||
|
||||
namespace LeafWeb.Web.Controllers
|
||||
@@ -20,6 +21,27 @@ namespace LeafWeb.Web.Controllers
|
||||
}
|
||||
|
||||
public ActionResult LeafCharts(int number)
|
||||
{
|
||||
var fileInfo = new FileInfo(@"C:\Users\poprhythm\Documents\code\LeafWeb\Core.Tests\Parsers\LeafOutputData\cntrlcomparison_Wild Capsicum.csv");
|
||||
|
||||
CntrlComparison[] cntrlComparison;
|
||||
using (var parser = new CntrlComparisonParser(fileInfo))
|
||||
cntrlComparison = parser.Parse();
|
||||
|
||||
var curveData = CurveDataConverter.Convert(cntrlComparison).ToArray();
|
||||
|
||||
var charts = LeafWebCharter.ProduceCharts(curveData[1]);
|
||||
|
||||
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 LeafChartsOld(int number)
|
||||
{
|
||||
var fileInfo = new FileInfo(@"C:\Users\poprhythm\Documents\code\LeafWeb\Core.Tests\Parsers\LeafOutputData\cntrlcomparison_Wild Capsicum.csv");
|
||||
var curveDataList = new CurveDataList();
|
||||
@@ -27,7 +49,7 @@ namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
curveDataList.ReadFromStream(reader);
|
||||
}
|
||||
var charts = LeafWebCharter.ProduceCharts(curveDataList.CurveData);
|
||||
var charts = LeafWebCharterOld.ProduceCharts(curveDataList.CurveData[1]);
|
||||
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user