DotNet.Highcharts ChartTypes参考?

时间:2014-01-16 16:07:51

标签: c# asp.net asp.net-mvc asp.net-mvc-4 highcharts

我正在尝试添加到我的Web应用程序Highcharts。在我的控制器中我有

using DotNet.Highcharts;
using DotNet.Highcharts.Helpers;
using DotNet.Highcharts.Options;

和行动

public ActionResult Chart()
    {
        DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts("chart").SetTitle(new Title()
        {
            Text = "Porównanie prędkości poszczególnych technologii"
        }).SetXAxis(new XAxis
        {
            Categories = new[] { "GPRS", "EDGE", "UMTS", "CDMA", "HSPA", "HSPA+", "LTE" }
        }).SetSeries(new Series
        {
            Type = ChartTypes.Column, Name = "Prędkość", Data = new Data(new object[] { 0.08, 0.3, 2, 9.3, 14.4, 42, 150 })
        });

        return View(chart);
    }

但是我有错误,它告诉我ChartTypes在当前上下文中不存在。我该怎么办?我错过了一些参考资料吗?

1 个答案:

答案 0 :(得分:1)

您需要添加此引用:

using DotNet.Highcharts.Enums;

或使用完全限定名称:

DotNet.Highcharts.Enums.ChartTypes.Column