amcharts / amcharts3-angular2

Official Angular 2 plugin for amCharts V3
99 stars 35 forks source link

AmChartsService not showing amcharts for angular 6 #94

Open DivyaArora-24 opened 6 years ago

DivyaArora-24 commented 6 years ago

I tried using the AMcharts in angular 6 and followed the same steps as mentioned in the documentation 👍 https://github.com/amcharts/amcharts3-angular2 The code does not show the AMcharts.

this.chart = this.AmCharts.makeChart('chartdiv', { 'type': 'pie', 'theme': 'light', 'dataProvider': this.makeRandomDataProvider() });

I downloaded the code as well and it did not showed the charts.

Using the older method : const chart = AmCharts.makeChart() works fine.

Please let me know if any changes needs to be done specific to angular 6 and above.

RobbiesCode commented 6 years ago

Hi,

I am not sure what could be wrong with your setup. I have just tried setting up a angular-cli project (Angular 7) according to our Readme, and I have no troubles. Do you get any error messages at all?

DivyaArora-24 commented 6 years ago

No, I did not got any error. The code compiled successfully. But it just displays a text "JS chart by amCharts". No chart is displayed. Even the code that I downloaded from github behaved in the same way.

zuice32 commented 6 years ago

My solution I posted here might help: https://github.com/amcharts/amcharts3-angular2/issues/12

Don't forget to include this in the head of the index.html:


  <script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
  <script src="https://www.amcharts.com/lib/3/serial.js"></script>
  <script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
  <script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
notsure commented 4 years ago

+1 seems to be a timing issue