只需要1步
View 注意红色部分
@{
var chart = new Chart(width:450,height:300)
.AddTitle("数据分析")
.AddTitle(name:"X",xValue:new[]{"2","3","4"})
.AddTitle(name:"Y",yValue:new[]{"2","3","4"})
.Save("~/Content/Images/tem.png");
}
<image src="../Content/Images/tem.png" />
用Action类似
var imageStream = new MemoryStream();
var chart = new Chart(width:450,height:300)
.AddTitle("数据分析")
.AddTitle(name:"X",xValue:new[]{"2","3","4"})
.AddTitle(name:"Y",yValue:new[]{"2","3","4"})
.Save("~/Content/Images/tem.png");
retrun FIleStream(imageStream ,"../Content/Images/tem.png");
对应的view
<image src="../Content/Images/tem.png" />