0

我正在尝试在我的布局上显示图表。该图表位于局部视图内。但我得到这个错误:::

子请求的执行失败。请检查 InnerException 以获取更多信息

找不到路径“/”的控制器或未实现 IController。

新错误:{“执行处理程序'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'的子请求时出错。”}

这是我的 OfficeStatisticNKI 控制器:控制器

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");

我想做的就是显示这个图表我做错了什么?

提前致谢

4

1 回答 1

0

您在此处显示的操作方法确定包含在OfficeStatisticNKI控制器中吗?您的控制器是否继承自Controller类?

于 2012-05-18T10:56:50.470 回答