0
ハイチャートの設定オブジェクトを利用して、エクスポート機能を使用せずにカスタムボタンを作成する方法はありますか?ハイチャートは設定でカスタムボタンを作成します
以下のメソッドは、プログラムの最後の数行のコードを(return文の前に)追加しますが、設定でこれを処理したいだけです。
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;