gpt4 book ai didi

javascript - get Kendo Chart() 在 javascript 中显示为未定义

转载 作者:行者123 更新时间:2023-12-03 10:01:06 30 4
gpt4 key购买 nike

我正在通过以下方式形成剑道图表。在 javascript 中,getKendoChart 未定义。您能否检查一下并告诉我如何解决此问题。

var rdChartBy = '@Model.paretoFilters.ReportBy';
if(rdChartBy == 'Project Submitted')
$("#rbnprojSub").prop("checked", true);
if(rdChartBy == 'FA Completed')
$("#rbnprojComp").prop("checked", true);
var paretoData = @Html.Raw(Json.Encode(@Model.paretoChartData));

var dsParetoData = new kendo.data.DataSource({
data: paretoData
});

$("#ParetoChart").kendoChart({
title: {
text: "Pareto Chart Report",
font: "bold 20px Arial,Helvetica,sans-serif",
color: "brown"
},

dataSource: dsParetoData,
series: [{
type: "column",
categoryField: "Month",
name : "No.Of Projects",
field:"No_Of_Projects"
},{
type:"line",
categoryField:"Month",
style: "rigid",
name:"Cumilative%",
field:"Cumulative"
}],

valueAxis: {
title: {
text: "No.OfProjects/Cumilative%",
font: "bold 15px Arial,Helvetica,sans-serif",
color: "brown"
}
},
chartArea: {
width: 850,
height: 400
},
categoryAxis:{
title: {
text: "Month",
font: "bold 18px Arial,Helvetica,sans-serif",
color: "brown"
},
labels: { rotation: -45 },
width:50
},

tooltip: {
visible: true,
template: "${series.name} : ${value}"
}
});

function exportChart(e)
{
debugger;

var chart = $("#ParetoChart").getKendoChart();
chart.exportImage().done(function (data) {
kendo.saveAs({
dataURI: data,
fileName: "chart.png",
proxyURL: "@Url.Action("Export_Save", "Chart_Api")"
});
});

最佳答案

尝试更换

var chart = $("#ParetoChart").getKendoChart();

var chart = $("#ParetoChart").data("kendoChart");

关于javascript - get Kendo Chart() 在 javascript 中显示为未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30596431/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com