javascript - 从导出菜单打印高图时隐藏滚动条
问题描述
有什么办法可以在printing chart
while时隐藏滚动条exporting
。我可以scrollbar
在导出时image & pdf
隐藏,但在选择print chart
选项时无法隐藏。
我已经尝试过exporting.chartOptions
如下配置
chart_options.exporting.chartOptions = {
xAxis : [{
categories: timeline,
min: 0,
minRange: timeline.length-1,
max: timeline.length-1
}],
scrollbar:{
enabled: false
}
它可以与其他导出选项一起正常工作,但不能在print chart
选项中使用。
https://jsfiddle.net/harishk3499/gdv7oz9w/
请帮忙!
解决方案
您可以使用beforePrint
和afterPrint
事件来更改图表:
chart: {
events: {
beforePrint: function() {
this.update({
scrollbar: {
enabled: false
}
});
},
afterPrint: function() {
this.update({
scrollbar: {
enabled: true
}
});
}
}
}
现场演示:http: //jsfiddle.net/BlackLabel/ae905yfx/
API参考:
https://api.highcharts.com/highcharts/chart.events.afterPrint
https://api.highcharts.com/highcharts/chart.events.beforePrint
推荐阅读
- mysql - mysql:大表上的唯一约束
- python - Conda 发现与不相关的软件包有冲突
- angular - TypeScript 控制台日志打印来自同一对象的不同值
- android - “com.android.build.gradle.AppPlugin@27e0e84c”的“未指定”的错误“插件版本”不是有效的版本号
- wordpress - 我无法修改 wordpress post slug
- android - 获取新数据时如何阻止 RecyclerView 移动到顶部?
- xpages - 在 XPage 中存储和检索长字符串
- javascript - 由于异步调用,状态未正确刷新
- atmega - #asm #endasm 是什么意思?
- python - 使用 OpenCV 为图像添加老化/风化效果