Lee
Lee

Reputation: 77

libURL not working if using {symbol:'url(...)'} in highcharts exporting

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>

without using the image button

exporting : {  
  libURL:contextPathGlobal+'/scripts/lib/highcharts/',
  enabled: true,
  buttons: {customButton: {symbol: 'round'})
}

while downloading .pdf format using the above snipet ,

jspdf and svg2pdf are fetch from defined path in libURL and .pdf format download successfully in client side serverexport

using the url in buttons {customButton:{symbol:'url'}}

exporting : {  
  libURL:contextPathGlobal+'/scripts/lib/highcharts/',
  enabled: true,
  buttons: {customButton: {symbol: 'url(https://cdn2.iconfinder.com/data/icons/inverticons-stroke-vol-3/32/share_export-16.png)})
}

but using the url in custom button it may leads to highcharts server for exporting pdf format

Want to export pdf format in client side exporting while using url in symbol

Upvotes: 0

Views: 802

Answers (1)

Sebastian Bochan
Sebastian Bochan

Reputation: 37578

The issue is already reported to our developers here:

Workaround

// Override to always force basic local export
Highcharts.Chart.prototype.exportChartLocal = function(exportingOptions, chartOptions) {
  var chart = this,
    options = Highcharts.merge(chart.options.exporting, exportingOptions);

  chart.getSVGForLocalExport(
    options,
    chartOptions,
    function() {
      console.error("Something went wrong");
    },
    function(svg) {
      Highcharts.downloadSVGLocal(
        svg,
        options,
        function() {
          console.error("Something went wrong");
        }
      );
    }
  );
};

Demo:

Upvotes: 0

Related Questions