amcharts / export

Apache License 2.0
56 stars 33 forks source link

Add export property to a created Amchart #87

Open luyendd0407 opened 5 years ago

luyendd0407 commented 5 years ago

I want to add export property to an amchart created without this property, or change enabled property from false to true. If I using console can it effect? I tried with this page: https://codepen.io/team/amcharts/pen/cd082ba201f7d7dd6b2d13f8e450debe I set the predetermine enabled value is false and change it by console: chart.export.enabled = true; I tried chart.validateData() and chart.validateNow(true,true) and both are not effect. I ask this because I want to export data from an amchart created on an website and it's export property is undefined. Sorry for my poor English :)

xorspark commented 5 years ago

The export plugin cannot be toggled on after the chart has been created. You need to recreate the chart with the export plugin enabled.

luyendd0407 commented 5 years ago

The export plugin cannot be toggled on after the chart has been created. You need to recreate the chart with the export plugin enabled.

so can I enable export plugin from a chart in a website? I see their source code contain that plugin but the amchart is not toggled on. That page is: https://moitruongthudo.vn/ image

xorspark commented 5 years ago

As I said, you have to re-create the chart. I'm not going to go into specifics on enabling the plugin on someone else's chart, but if export isn't enabled, you need to call makeChart with it enabled. The validateData/validateNow methods won't work.