function is not defined amchart code example
Example: Uncaught ReferenceError: am4core is not defined
Add this to your 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>