我有一种情况,我需要在 MVC3 视图中显示图表。到目前为止,我已经在我的控制器中完成了以下操作
public ActionResult MyChart()
        {
            var bytes = new Chart(width: 400, height: 200)
                .AddSeries(
                    chartType: "bar",
                    xValue: new[] {"Math", "English", "Computer", "Urdu"},
                    yValues: new[] {"60", "70", "68", "88"})
                .GetBytes("png");
            return File(bytes, "image/png");
        }
在我的 Jquery 文件中
function getChart() {
    $.ajax({
        url: ('/Home/MyChart'),
        type: 'GET',
        cache: false,
        success: function (result) {
            alert(result.length);
            $('#BottomGrid').html(result);
        },
        error: function () { alert("error"); }
    });
    }
在我看来,我只是在调用 getChart() 方法。我的视图是一个 .aspx 视图,bottomgrid 是视图上的一个 div,我需要在其中显示图表。
在 IE 中运行上面的代码会给我一个 png 标志,在 Firefox 中它会显示特殊字符。
知道我哪里出错了吗?