highcharts / highcharts-editor

https://www.highcharts.com/products/highcharts-editor
Other
250 stars 96 forks source link

Chart exported as html has script with external files #121

Closed Saonela closed 7 years ago

Saonela commented 7 years ago

As the title says, when you create chart with editor and export it as html (chart.export.html) , it becomes exported with additional script, which contains couple hardcoded libraries. This causes some unexpected behaviour and conflicts between existing files. screenshot from 2017-01-25 13 26 39

cvasseng commented 7 years ago

As of commit 9203c5c you can set highed.option('includeCDNInExport', false); to not include CDN scripts in the export.

This needs to be done somewhere on the page in which you include the editor.

sbt2486 commented 6 years ago

@cvasseng @Saonela can someone of you please create a jsfiddle or so where you demonstrate using highed.option('includeCDNInExport', false); to disable the CDN JS script include? I can't seem to make this work in my setup with the latest version of highcharts-editor 2.0

cvasseng commented 6 years ago

@sbt2486: there's a bug in 2.x with setting it with two arguments, but the first argument to highed.option can also be an object, so you could try doing highed.option({'includeCDNInExport': false}); before you initialize your editor instance.

E.g.

    highed.ready(function () {
        highed.option({includeCDInExport: false});
        highed.DrawerEditor(document.body);
    });
sbt2486 commented 6 years ago

@cvasseng cheers man, it works when passing in an object.