0

時系列とズームを含むグラフがあります。グラフを pdf または画像にエクスポートするときに、サブタイトル (「プロット エリアをクリック アンド ドラッグしてズームイン」) が表示されないようにすることをお勧めします。

なので、隠す方法はないか考え中です。

4

2 に答える 2

5

これは、あなたが求めていることを行う方法の例です。字幕操作を行う部分は次のとおりです。

exporting: {
   buttons: {
      exportButton: {
         menuItems: null,
         onclick: function() {
            chart.exportChart(null, {subtitle: {text:''}});
         }  
      },
      printButton: {
         onclick: function() {
            chart.setTitle(null, { text: ' ' });
            chart.print();
            chart.setTitle(null, { text: 'Click and drag in the plot area to zoom in' });
         }
      }
   }
},

編集:

セドンダリーオプション

ハイチャートで生成された印刷およびエクスポート ボタンを削除できます。次に、エクスポート タイプを選択するためのドロップダウンとともに、独自の印刷ボタンとエクスポート ボタンを作成します。次に、エクスポートボタンをクリックすると、タイプを確認し、サブタイトルなしでタイプとしてエクスポートします。ここにがあります。エクスポートおよび印刷ボタンのクリックを処理するコードは次のとおりです。

$('#buttonExport').click(function() {
    var e = document.getElementById("ExportOption");
    var ExportAs = e.options[e.selectedIndex].value;   

    if(ExportAs == 'PNG')
    {
        chart.exportChart({type: 'image/png', filename: 'my-png'}, {subtitle: {text:''}});
    }
    if(ExportAs == 'JPEG')
    {
        chart.exportChart({type: 'image/jpeg', filename: 'my-jpg'}, {subtitle: {text:''}});
    }
    if(ExportAs == 'PDF')
    {
        chart.exportChart({type: 'application/pdf', filename: 'my-pdf'}, {subtitle: {text:''}});
    }
    if(ExportAs == 'SVG')
    {
        chart.exportChart({type: 'image/svg+xml', filename: 'my-svg'}, {subtitle: {text:''}});
    }
}); 

$('#buttonPrint').click(function() {
     chart.setTitle(null, { text: ' ' });
     chart.print();
     chart.setTitle(null, { text: 'Click and drag in the plot area to zoom in' });
});
于 2012-10-18T14:58:19.393 に答える