Highcharts-饼图不显示切片
奇怪的一个。我正在调用我的饼图,当我使用灰色背景时,数据管道连接器和带有数字的悬停数据都会在背景上显示良好。但是没有派片会出现 但是,如果我打印出图表,它会在我保存图表并返回页面后显示切片。或者,如果我在Chrome中检查元素,它将在我调整inspector窗口的大小后显示图表。如果我采取任何行动,就像是在重新绘制图表,但不是一开始就绘制 它在所有浏览器中都以相同的方式工作。不会抛出任何javascript错误 有什么想法吗 这是我的代码:Highcharts-饼图不显示切片,charts,highcharts,pie-chart,Charts,Highcharts,Pie Chart,奇怪的一个。我正在调用我的饼图,当我使用灰色背景时,数据管道连接器和带有数字的悬停数据都会在背景上显示良好。但是没有派片会出现 但是,如果我打印出图表,它会在我保存图表并返回页面后显示切片。或者,如果我在Chrome中检查元素,它将在我调整inspector窗口的大小后显示图表。如果我采取任何行动,就像是在重新绘制图表,但不是一开始就绘制 它在所有浏览器中都以相同的方式工作。不会抛出任何javascript错误 有什么想法吗 这是我的代码: <script type="text/javas
<script type="text/javascript">
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'pie1',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'application usage'
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.y +'';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#FFFFFF',
connectorColor: '#FFFFFF',
formatter: function() {
return '<b>'+ this.point.name +'</b><br> '+ this.y +' ('+ Math.round(this.percentage) +'%)';
}
}
}
},
series: [{
type: 'pie',
name: 'percentage of application usage',
data: [{
name: 'Lessons', y: 25}, {name: 'Discussion', y: 65}, {name: 'Tests', y: 85}, {name: 'Dropbox', y: 92}, {name: 'Surveys', y: 105
}]
}]
});
});
</script>
<div id='pie1' class='chart_container'></div>
var图;
$(文档).ready(函数(){
图表=新的高点图表。图表({
图表:{
renderTo:‘pie1’,
plotBackgroundColor:null,
plotBorderWidth:null,
plotShadow:false
},
标题:{
文本:“应用程序使用”
},
工具提示:{
格式化程序:函数(){
返回“+this.point.name+”:“+this.y+”;
}
},
打印选项:{
馅饼:{
allowPointSelect:true,
光标:“指针”,
数据标签:{
启用:对,
颜色:“#FFFFFF”,
接头颜色:“#FFFFFF”,
格式化程序:函数(){
返回“+this.point.name+”
“+this.y+”(“+Math.round(this.percentage)+“%”);
}
}
}
},
系列:[{
键入“pie”,
名称:“应用程序使用百分比”,
数据:[{
名称:'Lessons',y:25},{name:'Discussion',y:65},{name:'Tests',y:85},{name:'Dropbox',y:92},{name:'Surveys',y:105
}]
}]
});
});
highcharts的旧版本与jquery的新版本一起使用。在将正确的jquery与正确的highcharts匹配之后,它现在可以工作了。