amcharts / export

Apache License 2.0
56 stars 33 forks source link

amcharts annotation - Custom Path for shapes #75

Closed kevzlou7979 closed 6 years ago

kevzlou7979 commented 6 years ago

Hi there,

Good day, How can we set the custom file path for all annotation shapes.

Best Regards, Mark

martynasma commented 6 years ago

Hi Mark,

While there's currently no dedicated setting to set path for those icons, you can still work around using menuReviver:

  "export": {
    "enabled": true,
    "menuReviver": function( cfg, li ) {
      if ( cfg.action == "add" ) {
        var url = 'http://mynewurl.com/shapes/' + cfg.label;
        cfg.icon = url;
        cfg.url = url;
        li.getElementsByTagName("img")[0].src = url;
      }
      return li;
    }
  }

I hope this helps.

kevzlou7979 commented 6 years ago

Thanks for the feedback