我想在我的佈局上顯示圖表。該圖表位於局部視圖內。但是,我得到這個錯誤:::在PartialVIew中顯示佈局不起作用的圖表?
Execution of the child request failed. Please examine the InnerException for more information
The controller for path '/' was not found or does not implement IController.
新的錯誤:{ 「執行處理程序進行處理 'System.Web.Mvc.HttpHandlerUtil + ServerExecuteHttpHandlerAsyncWrapper' 子請求錯誤」}
這是我OfficeStatisticNKIcontroller:控制器
public ActionResult Partialchart()
{
OfficeStatisticQueryViewModel model = new OfficeStatisticQueryViewModel();
model.StartDate = DateTime.Now.ToShortDateString();
model.EndDate = DateTime.Now.ToShortDateString();
int allcompletedNKI = OfficeStatisticRepository.AllCompletedGoalCards();
model.AllCompletedNKI = allcompletedNKI;
var averageGrades = OfficeStatisticRepository.GetAverageGradeForAllCoreValues2();
if (averageGrades.Count != 0)
{
var dataItems = (averageGrades.Select(averageGrade => averageGrade.AverageGrade).ToArray());
Data data = new Data(
dataItems.Select(y => new Point { Color = GetBarColour(y), Y = y }).ToArray());
Highcharts chart1 = new Highcharts("Chart")
.SetXAxis(new XAxis { Categories = averageGrades.Select(averageGrade => averageGrade.CoreValue.Name).ToArray() })
.SetYAxis(new YAxis { Min = 0, Max = 10, TickInterval = 1, Title = new YAxisTitle { Text = "Betygskalan" } })
.SetSeries(new Series { Data = data, Name = "Snittbetyg" })
.SetLegend(new Legend { Enabled = false })
.SetTitle(new Title { Text = "statistic" })
.InitChart(new Chart { DefaultSeriesType = ChartTypes.Column });
model.Chart = chart1;
model.message = " ";
return PartialView(model);
}
else
{
model.message = "error";
return PartialView(model);
}
}
,這是我在我的佈局代碼:
@Html.Action("Partialchart","OfficeStatisticNKI");
我所要做的就是展示這張圖表,我做錯了什麼?
在此先感謝
這是什麼內在的例外說? – CallumVass
路徑'/'的控制器未找到或未實施IController。 – Obsivus