The following logic runs onload of the web page and calls a partial view to display data in the chart:
<img src='@Url.Action("_GetChartDetails", "Chart", new { chartType = "Won" })' id="chartid" />
this works.
but when I do it from javascript the image is blank. Could anyone advice what I could be doing wrong?
$http.get("http://localhost:51666/Chart/_GetChartDetails?chartType=Loss")
.success(function (response) {
alert(response);
//$("#chartid").attr("src", "data:image/png;base64," + response);
document.getElementById("chartid").src = response;
}).error(function (data, status, headers, config) {
alert(data);
});
