0
我正在使用syncfusion爲我的應用程序顯示圖表,並且我使用this文檔來創建演示頁面。與ASP.NET MVC集成syncfusion圖表
頁面沒有任何錯誤,但圖表不顯示在頁面上。
正如我所做的檢查有一個可用的代碼,但不顯示在頁面上。
我附上了屏幕截圖,請仔細閱讀。
代碼:
控制器側:
public class HomeController : Controller
{
public ActionResult Index()
{
//// Create dataSource to chart
List<ChartData> data = new List<ChartData>();
data.Add(new ChartData("Jan", 35));
data.Add(new ChartData("Feb", 28));
data.Add(new ChartData("Mar", 34));
data.Add(new ChartData("Apr", 32));
data.Add(new ChartData("May", 40));
data.Add(new ChartData("Jun", 32));
data.Add(new ChartData("Jul", 35));
data.Add(new ChartData("Aug", 55));
data.Add(new ChartData("Sep", 38));
data.Add(new ChartData("Oct", 30));
data.Add(new ChartData("Nov", 25));
data.Add(new ChartData("Dec", 32));
///...
ViewBag.ChartData = data;
return View();
}
}
public class ChartData {
public string Month;
public double Sales;
public ChartData(string month, double sales)
{
this.Month = month;
this.Sales = sales;
}
}
CSHTML:
@using Syncfusion.JavaScript.DataVisualization
<!-- jquery script -->
<script src="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></script>
<!-- Essential JS UI widget -->
<script src="http://cdn.syncfusion.com/13.1.0.21/js/web/ej.web.all.min.js"></script>
<!--Add Syncfusion Script Manager -->
@Html.EJ().ScriptManager()
<div>
@(Html.EJ().Chart("chartContainer")
.Series(sr =>
{
//Change series type
sr.Type(SeriesType.Line).Add();
})
)
</div>
感謝答覆D. Dharanidharan,但我已經解決了上述問題。你能解決我的[這](http://stackoverflow.com/questions/41220815/use-hidden-field-in-syncfusion-column-chart-series)問題。 –