Export AM Stock Chart

Is there a way to enable export for Stockchart? I know this is possible for a normal chart, but for a stock chart, I get undefined when I try to enable export mode,

I've tried: chart.export.enabled=true;

and chart.amExport.enabled = true;

and

var amExport = new AmCharts.AmExport();
amExport.enabled = true;
chart.export=amExport;

      

but all failed. Thanks to

+3


source to share


2 answers


Try using the new amCharts init style. See my answer to a related question.
It looks like the old approach you tried no longer works. (At least my few tests didn't run)

To enable export use this in your init code:

export: {
    enabled: true,
    position: "bottom-right"
}

      

And don't forget to include the required export plugin!

The tutorial can be found here .
Take a look at this fiddle .




Update:

Ok, so this is a bit of me, but I found a way how you can export the function dynamically. (With JS or JSON initialization)
chart.export = {
    enabled: true,
    position: "bottom-right"
}
chart.initHC = false;
chart.validateNow();

      

The key must be set initHC

to false, because otherwise it will not load the handler for the plugin. Then just confirm it is correct, add some speck of dust and tadaa - it works.

+4


source


In addition to the above answer, to enable the correct plugins, make sure you are using html color codes such as "# FF0000" instead of "red" which is supported by the export versions of earlier models, if you specify your own colors in the graph (graph. useDataSetColors = false) and valueaxis.



The export works great if you are using the new JSON or the old style (I am still using the old style AmCharts.AmStockChart () and $ scope.chart.write ("chartdiv");

0


source







All Articles