GrantMStevens / amCharts-Angular

Angular directive for amCharts library
Apache License 2.0
63 stars 39 forks source link

Replace amChartOptions with the demo amCharts provided, some options didn't work #45

Closed Nicoleyy closed 7 years ago

Nicoleyy commented 8 years ago

I use the amCharts demos data to render my chart,the data provided link: https://www.amcharts.com/demos/date-based-data/# .And I also changed the include scripts to the the linked page, but the valueScrollbar property didn't work at all, the chartScrollbar property was not completely correct. I have no ideas why the issue happened, is this amChartsDirective problem? Thanks for any help !

andrewyager commented 8 years ago

A lot of the examples are based on a later version of amCharts which don't work in this version, so that might be part of your issue.

To add support for the exporting feature on this version, I modified my bower.js file to include the following build directives in the overrides section (we use grunt to build). With this version we also manually set the images path to one of the CDN servers.

  "overrides": {
    ...
     "amcharts": {
       "main": [
         "dist/amcharts/amcharts.js",
         "dist/amcharts/serial.js",
         "dist/amcharts/exporting/amexport.js",
         "dist/amcharts/exporting/rgbcolor.js",
         "dist/amcharts/exporting/jspdf.js",
         "dist/amcharts/exporting/jspdf.plugin.addimage.js",
         "dist/amcharts/exporting/filesaver.js",
         "dist/amcharts/exporting/canvg.js"
       ]
  }

I've actually since upgraded amCharts-Angular to use the later version of bower-amcharts (you can use this version by specifying the git repo at "amcharts-angular": "andrewyager/amCharts-Angular#rel-3.15.2") which we now are using and liking and have many of the newer features (particularly in relation to export) working exactly as we wanted.

In this version, the overrides we loaded in bower.conf to achieve the same result are:

"amcharts": {
        "main": [
          "dist/amcharts/amcharts.js",
          "dist/amcharts/serial.js",
          "dist/amcharts/plugins/export/export.js",
         "dist/amcharts/plugins/export/export.css"
        ]
Nicoleyy commented 8 years ago

Tanks for your expanded features, but in my issue, I have changed my script references to the demo page showed, and it doesn't work