設置標題我正在尋找一種方法:在HTML頁面結果highcharts:對出口
- 隱藏標題
- 秀上,當我導出(PDF,PNG,JPEG或highcharts圖形標題打印)
我不知道如何繼續。有人能夠幫助我嗎?
設置標題我正在尋找一種方法:在HTML頁面結果highcharts:對出口
我不知道如何繼續。有人能夠幫助我嗎?
您可以在導出中定義此參數。
http://api.highcharts.com/highcharts#exporting.chartOptions
exporting:{
chartOptions:{
title: {
text:'aaaaa'
}
}
},
把這個功能在下面的文檔準備功能是改變highcharts打印原型和公正的補丁或使其工作擺rangeSelector選項,您導出代碼並將其設置爲false,如下所述,您可以將其設置爲將來的需要
Highcharts.wrap(Highcharts.Chart.prototype, 'print', function (proceed) {
var applyMethod = function (whatToDo, margin) {
this.extraTopMargin = margin;
this.resetMargins();
this.setSize(this.container.clientWidth , this.container.clientHeight , false);
this.setTitle(null, { text: 'SET TITLE HERE' :'});
this.rangeSelector.zoomText[whatToDo]();
$.each(this.rangeSelector.buttons, function (index, button) {
button[whatToDo]();
});
};
if (this.rangeSelector) {
var extraMargin = this.extraTopMargin;
applyMethod.apply(this, ['hide', null]);
var returnValue = proceed.call(this);
applyMethod.apply(this, ['show', extraMargin]);
this.setTitle(null, { text: '' });
} else {
return proceed.call(this);
this.setTitle(null, { text: '' });
this.yAxis[0].setExtremes();
} }
});
,並在圖表選項設置此(根據您的需要更改,我只是把我的代碼爲參考 )
exporting: {
scale: 1,
sourceWidth: 1600,
sourceHeight: 900,
chartOptions: {
rangeSelector: {
enabled: false
},
}
它的工作!謝謝 ! – user2050723
這不適用於你的小提琴。圖表導出時沒有標題。 –
您使用哪個瀏覽器? –