在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>
&#13;
此official code正在使用ChartJS's fiddle。
由于我没有在ASP.NET MVC项目中执行此操作,chartjs
after the DevExpress MVC scripts shall not be an issue
我在这里缺少什么?
答案 0 :(得分:4)
检查控制台 - 它找不到.dxPieChart
函数,因为它无法加载'insecure'chart.js脚本:
'混合内容:“https://jsfiddle.net/xameeramir/51h3bmgf/”页面是通过HTTPS加载的,但请求了一个不安全的脚本“http://cdn3.devexpress.com/jslib/15.2.10/js/dx.chartjs.js”。此请求已被阻止;内容必须通过HTTPS提供。'
也许您找到了该库的https
CDN链接?
答案 1 :(得分:1)
将http cdn更改为https。 Https cdn for devextreme chartjs 13.1.5 library:https://dxjscdn2.blob.core.windows.net/jslib/13.1.5/js/dx.chartjs.js