Kendo ui 图表组件未使用Kendo UI Asp.net mvc core显示

Kendo ui 图表组件未使用Kendo UI Asp.net mvc core显示,kendo-ui,kendo-asp.net-mvc,kendo-chart,Kendo Ui,Kendo Asp.net Mvc,Kendo Chart,我目前正在尝试评估剑道UI asp.NETMVC6(“asp.NETCore”)小部件。我下载了示例项目Kendo.Mvc.Examples项目,可以在这里找到: 示例项目工作得很好。现在,我尝试创建自己的骨架项目,如下所示: 使用ASP.NET 5 Web应用程序模板创建了新的Visual Studio项目 在我的项目json中添加了“Kendo.Mvc”:“2016.1.301”依赖项 添加了services.AddKendo()在Startup.ConfigureServices()中 修

我目前正在尝试评估剑道UI asp.NETMVC6(“asp.NETCore”)小部件。我下载了示例项目Kendo.Mvc.Examples项目,可以在这里找到:

示例项目工作得很好。现在,我尝试创建自己的骨架项目,如下所示:

  • 使用ASP.NET 5 Web应用程序模板创建了新的Visual Studio项目
  • 在我的项目json中添加了
    “Kendo.Mvc”:“2016.1.301”
    依赖项
  • 添加了
    services.AddKendo()
    Startup.ConfigureServices()中
  • 修改了my Index.chtml以包含剑道UI控件:

    @使用Kendo.Mvc.UI

    @{ ViewData[“Title”]=“我的东西仪表板”; }

    @ViewData[“标题”] 正在运行的东西

    @(Html.Kendo().Button()) .Name(“iconTextButton”) .HtmlAttributes(新的{type=“button”}) .图标(“解组”) .Content(“剑道UI按钮”))

    @(Html.Kendo().Chart()) .名称(“图表”) .Title(“国内生产总值增长/GDP年增长%/”) .Legend(Legend=>Legend .位置(ChartLegendPosition.底部) ) .ChartArea(ChartArea=>ChartArea .背景(“透明”) ) .SeriesDefaults(SeriesDefaults=> seriesDefaults.Area().Line(Line=>Line.Style(ChartLineStyle.Smooth)) ) .系列(系列=> { 面积(新双[]3.907、7.943、7.848、9.284、9.263、9.801、3.890、8.238、9.552、6.855}); }) .CategoryAxis(轴=>轴 .类别(“2002年”、“2003年”、“2004年”、“2005年”、“2006年”、“2007年”、“2008年”、“2009年”、“2010年”、“2011年”) .MajorGridLines(lines=>lines.Visible(false)) ) .ValueAxis(轴=>轴 .Numeric() .Labels(Labels=>Labels.Format(“{0}%”) .AxisCrossingValue(-10) .Line(Line=>Line.Visible(false)) ) .工具提示(工具提示=>工具提示 .可见(真实) .Format(“{0}%”) .Template(“#=series.name:#=value#”) ) )

  • 当我运行应用程序时,按钮显示正确,但图表不显示。但是,查看html源代码时,我可以看到正在生成图表:

    正在运行的东西

    kendoui按钮查询(function(){jQuery(#iconTextButton”).kendoButton({“icon”:“ungroup”});})

    jQuery(function(){jQuery(#chart”).kendoChart({“categoryAxis”:[{“categories”:[“2002”、“2003”、“2004”、“2005”、“2006”、“2007”、“2008”、“2009”、“2010”、“2011”],“majorGridLines”:{“visible”:false}],“chartArea”:{“background”:“transparent”},“legend”:{“position”:“bottom”},“series”:[{“name”:“India”,“type”:“area”,“data”:[3.89,8.38,8.38,8.38,9.89,8.2389,9.552,6.855 5)7,{,{,{,{,{“姓名”世界,7.907,7.907,7.907,7.907,7.907,7.907,7.907 7,7.9.9 7 7 7 7 7 7 7,,{,{,{,[姓名:,9.9.9,9.9,9,9,9.9,9.9.9,9,9,9.552.9,9.552,9,9.552,9,9.552,9.552,9,6.5,9,9,9,6.552,6.5 5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5 5,6.5 5 5 5{“文本”:“国内生产总值增长\n/GDP年增长率%/”},“工具提示”:{“格式:{0}%,“模板:{0}%,“模板:{0}%,”行:{“可见”:假},“类型:{numeric”}],”系列默认值:{“区域:{”行:{“线条:{”样式:{平滑”}}});
    

    不确定我做错了什么…感谢您的帮助!

    OK通过以下Telerik疑难解答链接解决了问题:

    在页面中的剑道ui脚本之后引用了jquery。请确保在剑道ui之前包含jquery

    <div id="chart" name="chart"></div><script>jQuery(function(){jQuery("#chart").kendoChart({"categoryAxis":[{"categories":["2002","2003","2004","2005","2006","2007","2008","2009","2010","2011"],"majorGridLines":{"visible":false}}],"chartArea":{"background":"transparent"},"legend":{"position":"bottom"},"series":[{"name":"India","type":"area","data":[3.907,7.943,7.848,9.284,9.263,9.801,3.89,8.238,9.552,6.855]},{"name":"World","type":"area","data":[1.988,2.733,3.994,3.464,4.001,3.939,1.333,-2.245,4.339,2.727]},{"name":"Haiti","type":"area","data":[-0.253,0.362,-3.519,1.799,2.252,3.343,0.843,2.877,-5.416,5.59]}],"title":{"text":"Gross domestic product growth \n /GDP annual %/"},"tooltip":{"format":"{0}%","template":"#= series.name #: #= value #","visible":true},"valueAxis":[{"axisCrossingValue":[-10],"labels":{"format":"{0}%"},"line":{"visible":false},"type":"numeric"}],"seriesDefaults":{"area":{"line":{"style":"smooth"}}}});});</script>