gpt4 book ai didi

javascript - 无法在 jsFiddle 中呈现 DevExtreme 饼图

转载 作者:太空宇宙 更新时间:2023-11-03 20:33:10 26 4
gpt4 key购买 nike

my fiddle ,我正在尝试 replicate绘制 DevExpress's DevExtreme doughnut chart :

var dataSource = [{
region: "Asia",
val: 4119626293
}, {
region: "Africa",
val: 1012956064
}, {
region: "Northern America",
val: 344124520
}, {
region: "Latin America and the Caribbean",
val: 590946440
}, {
region: "Europe",
val: 727082222
}, {
region: "Oceania",
val: 35104756
}];

$("#container").dxPieChart({
dataSource: dataSource,
title: "The Population of Continents and Regions",
tooltip: {
enabled: true,
format: "millions",
percentPrecision: 2,
customizeTooltip: function(arg) {
return {
text: arg.valueText + " - " + arg.percentText
};
}
},
legend: {
horizontalAlignment: "right",
verticalAlignment: "top",
margin: 0
},
series: [{
type: "doughnut",
argumentField: "region",
label: {
visible: true,
format: "millions",
connector: {
visible: true
}
}
}]
});
#container {
height: 440px;
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container"></div>

official codeChartJS's fiddle 工作.

由于我没有在 ASP.NET MVC 元素中执行此操作,chartjs after the DevExpress MVC scripts shall not be an issue

我在这里错过了什么?

最佳答案

检查控制台 - 它找不到 .dxPieChart 函数,因为它无法加载“不安全”的 chart.js 脚本:

“混合内容:页面位于”https://jsfiddle.net/xameeramir/51h3bmgf/ ' 通过 HTTPS 加载,但请求了不安全的脚本 ' http://cdn3.devexpress.com/jslib/15.2.10/js/dx.chartjs.js '.此请求已被阻止;内容必须通过 HTTPS 提供。”

也许您找到了库的 https CDN 链接?

关于javascript - 无法在 jsFiddle 中呈现 DevExtreme 饼图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37830842/

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