ajax - 如何在highchart中动态对齐3d饼图
问题描述
我是 highcharts 的新手,在整合我的数据时遇到问题。饼图显示准确的数据,但未设置对齐。
var user_daily=new Highcharts.chart('user_data', {
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Employee Record'
},
accessibility: {
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y}</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
format: '{point.name}',
},
}
},
series: [{
type: 'pie',
name: 'Employee Entries',
data: [
['Default', 45.0],
]
}]
});
var chart =new Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: "User's Daily Entries "
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y}</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true
},
showInLegend: false
}
},
series: [{
name: 'Entries',
colorByPoint: true,
data: [{ name:'',y:22 }
]
}]
});
关于更改功能:-
type:'post',
url:'user_daily_graph.jsp',
data:{
user_id:$('#ad_user_id').val(),
date:$('#Daily_graph_date').val(),
},
success:function(msg){
msg=msg.trim();
list=msg.split("!!");
user_daily.redraw();
while(user_daily.series.length > 0)
user_daily.series[0].remove(true);
user_daily.addSeries({
type: 'pie',
name: 'Entries'
}, false);
for(var i=1;i<list.length;i++){
if(list[i].length!=0){
temp2=list[i].split("!@")
user_daily.series[0].addPoint({
name: temp2[0],
y: parseInt(temp2[1]),
},true);
}
}
}
在页面加载时,图表停留在它应该在的位置。当我点击功能时,它显示数据但对齐出错。
解决方案
推荐阅读
- flutter - 在后台打开网站并在 Flutter 应用程序中访问其字段
- mongodb - 如何在 MongoDB 中对高度相关的数据进行建模
- amazon-web-services - AWS Athena - 如何转义引号中的“,”等字符
- c# - 下拉列表未填充 ajax C#/ASP.NET MVC
- python - 不允许操作,virtualenv
- python - 如何通过python在ansible脚本中设置变量值?
- vis.js - 在 vis-timeline 中,如何使时间轴用数字而不是日期/时间标记?
- docker - Windows 10 上的 Docker。如何将所有端口映射到相同的主机端口?
- python - 如何遍历数据框字典中的行并更改一些值 - Pandas Python
- r - R中如何读取数据文件、保存和删除