I'm trying to show a chart in Asp.Net MVC but it always open in another window. I want to show it without opened another window, in the same window.
How could I do it ?
_GraficoPerformance
@model ResumoMovtoTrades
<div class="text-center">
<p>
@{
var macChart = new Chart(200,200)
.AddTitle("Performance")
.AddSeries(
name: "Performance",
chartType: "Pie",
legend: "Performance",
xValue: new[] { "Gain", "Loss" },
yValues: new[] { Model.qtdGain, Model.qtdLoss })
.Write();
}
</p>
</div>
Show _PartialView
<div class="panel panel-blue">
<div class="panel-heading bg-blue">Gráfico de Performance</div>
<div class="panel-body">
<img src="@Html.Partial("_GraficoPerformance", @Model.resumoMovtos)"/>
</div>
</div><!--/panelchart-->
I decided to use a jquery library to show the graphic and it works well.
I used this: https://www.chartjs.org/docs/latest/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.