Highcharts 饼图:导出切割标签的图像
我使用的是Highcharts 3饼图,当我导出到图像时,生成的图表会丢失一些数据标签。我如何解决这个问题 ps:使用highcharts服务器:export.hightcart.com 问候 [更新] 生成的图像png文件上的小值被截断。但是,在打印预览中可以Highcharts 饼图:导出切割标签的图像,highcharts,Highcharts,我使用的是Highcharts 3饼图,当我导出到图像时,生成的图表会丢失一些数据标签。我如何解决这个问题 ps:使用highcharts服务器:export.hightcart.com 问候 [更新] 生成的图像png文件上的小值被截断。但是,在打印预览中可以 new Highcharts.Chart({ chart: { renderTo: 'chart', type: 'pie' }, title: { text:
new Highcharts.Chart({
chart: {
renderTo: 'chart',
type: 'pie'
},
title: {
text: 'My Chart title'
},
plotOptions: {
pie: {
showInLegend: true,
dataLabels: {
enabled: true,
formatter: function() {
return '<b>' + this.point.name + '</b>: ' + Math.round(this.point.total * this.point.percentage / 100);
}
}
}
},
series: [{
type: 'pie',
name: 'Series name',
data: [
["Lorem", 88],
["Lorem ipsum", 4],
["Praesent nibh nulla", 12],
["Lorem ipsum dolor sit amet", 66],
["Praesent fringilla suscipit molestie", 30],
["Donec at lectus at nulla viverra lobortis", 11],
["Class aptent taciti sociosqu ad litora", 87],
["Mauris vulputate sem id arcu volutpat fermentum", 149],
["Vestibulum faucibus lectus", 113],
["Pellentesque habitant morbi tristique", 7],
["Etiam lacinia mi suscipit", 92],
["Proin semper risus in lacus semper", 9],
["Fusce id faucibus massa", 99],
["Suspendisse", 4],
["Quisque quis lectus et turpis laoreet", 101]
]
}],
exporting: {
enabled: true
}
});
jsIDLE:这是因为Highcharts没有检测到容器的宽度 您可以通过在导出选项中添加选项sourceWidth来解决此问题: 似乎sourceWidth采用初始宽度,因此,如果图表在页面加载时有一点被截断,则在导出时它将是相同的,除非您在选项中指定它
我更新了JSFIDLE,为您提供了一个这样的工作示例:这是因为Highcharts没有检测到容器的宽度 您可以通过在导出选项中添加选项sourceWidth来解决此问题: 似乎sourceWidth采用初始宽度,因此,如果图表在页面加载时有一点被截断,则在导出时它将是相同的,除非您在选项中指定它
我更新了JSFIDLE,为您提供了一个工作示例:请在JSFIDLE上重现问题。请在JSFIDLE上重现问题。
exporting: {
enabled: true,
sourceWidth: 900
}