0
我有我的控制器創建圖表:顯示圖表
var myChart = new Chart(width: 1000, height: 600)
.AddTitle("Employee's Efficiency")
.AddSeries(
name: "Employee",
xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" },
yValues: new[] { "2", "6", "4", "5", "3" })
.Write();
myChart.Save("~/Content/chart" + pid, "jpeg");
return base.File("~/Content/chart" + pid, "jpeg");
和我的Razor視圖顯示它:
<body>
<div class="jumbotron">
<h1>Contas e Despesas <span class="glyphicon glyphicon-euro"></span></h1>
<p class="lead">Onde gastei o meu dinheiro? Controle melhor as suas despesas com o Contas e Despesas. </p>
</div>
<div>
<img src="@Url.Action("EfficiencyChart", "Home", new { pid = @Model.Id })" />
</div>
我的問題是,圖像覆蓋整個page ..我無法顯示我的jumbotron或除圖表圖像以外的任何其他內容:/
不錯,但我需要做我的控制器使用從我的DB值這裏面的邏輯..如何我可以在控制器內部做到嗎? – tiagocarvalho92 2014-09-29 15:32:41
@ user2002274 ....查看更新的答案... – 2014-09-29 15:49:40
@ user2002274..and嘗試更改較小的值更改圖表的高度和寬度.. – 2014-09-29 17:58:30