PDA

View Full Version : Chart save as PNG throws error



tdobberphul
12 Jun 2015, 9:42 AM
Hi guys,

I simply try to save a chart as png or jpeg. But the code throws an js-error:


Uncaught TypeError: l[I.type] is not a function



onTerminplanButtonSaveChartClick: function(button, e, eOpts) {
this.getTerminplanEintragBaufortschrittChart().save({
type: 'image/jpeg'
});
},


Does someone has an idea?

Thanks and best regards,
Tobias

Gary Schlosberg
12 Jun 2015, 2:12 PM
From the docs for the save() method.


Important: By default, chart data is sent to a server operated by Sencha to do data processing. You may change this default by setting the defaultUrl of the Ext.draw.engine.ImageExporter class. In addition, please note that this service only creates PNG images.

http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.chart.Chart-method-save

I don't believe that this service is still running, but if it is, you'll need to specify a PNG as that is the only type supported. More likely you're going to have to provide your own defaultUrl as described.