amcharts3-angular2 icon indicating copy to clipboard operation
amcharts3-angular2 copied to clipboard

AmChartsService not showing amcharts for angular 6

Open DivyaArora-24 opened this issue 6 years ago • 4 comments

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.

DivyaArora-24 avatar Oct 23 '18 11:10 DivyaArora-24

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?

RobbiesCode avatar Oct 24 '18 14:10 RobbiesCode

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.

DivyaArora-24 avatar Oct 25 '18 05:10 DivyaArora-24

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>

zuice32 avatar Nov 11 '18 07:11 zuice32

+1 seems to be a timing issue

notsure avatar Apr 09 '20 14:04 notsure