amcharts / amcharts3-react

Official amCharts V3 React component
Apache License 2.0
118 stars 50 forks source link

Is it possible to use amchrts3-react without online Amcharts script? #63

Closed Ashviniv closed 6 years ago

Ashviniv commented 6 years ago

While upgrading my react-app to React16, I face an error React.CreateClass is not a function, to fix this issue upgarded amcharts3-react library to 3.0.0. And remove Amcharts library. Then I got Amcharts is not defined error.

When I went through latest docs, I found that we need to include amcharts online scripts to solve this issue. But I want to use amcharts3-react through npm. How do I do it? Please help.

Pauan commented 6 years ago

@Ashviniv You must install version 3.0.3 of @amcharts/amcharts3-react from npm, and you must also add AmCharts as <script> tags to your index.html file:

<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>
Ashviniv commented 6 years ago

@Pauan My mistake, I wanted to use amCharts plugin through npm, instead of using scripts tags. And I am already using amcharts3-react through npm. so no issue with that.

This requirement is to hide Js charts by Amcharts message on the graphs, by replacing the licensed copy of Amcharts in the node_modules.

Pauan commented 6 years ago

You can use the licensed version of AmCharts with @amcharts/amcharts3-react, but you must still load it with <script> tags. You do not need to put the licensed version into node_modules

Also, since you are a paying customer, you can receive a faster reply by asking your questions on our official support site.

Ashviniv commented 6 years ago

Thanks, @Pauan for the help.