0
有沒有辦法來利用Highcharts的配置對象來創建自定義按鈕W/O使用導出功能?Highcharts創建配置自定義按鈕
的方法,下面將編程添加按鈕W /代碼的最後幾行(return語句之前),但是我想簡單地照顧這在config。
var options = {
chart: {
renderTo: container,
zoomType: 'x',
spacingBottom: 20,
type: 'column'
},
legend: {
layout: 'vertical',
verticalAlign: 'top',
align: 'right'
},
tooltip: {
shared: true,
crosshairs: true,
xDateFormat: '%b %e, %l:%M %p'
},
series: [
{
"name": "Excellent",
"color": config.color.excellent,
"data": dataE,
"pointWidth": pointWidth ? pointWidth : undefined
},
{
"name": "Fair",
"color": config.color.fair,
"data": dataF,
"pointWidth": pointWidth ? pointWidth : undefined
},
{
"name": "Poor",
"color": config.color.poor,
"data": dataP,
"pointWidth": pointWidth ? pointWidth : undefined
}
],
exporting: {
enabled: false
}
}
// Adds new button below
var chart = new Highcharts.Chart(options);
var custombutton = chart.renderer.button('button', 74, 10, function(){
alert('New Button Pressed');
},null,null,null).add();
return chart;