I want to use Metronic customized amCharts on Laravel Blade and pass dynamic values from Controller to the blade and charts however amCharts js files are generic with hardcoded values. How do I implement the same on my blade with dynamic values and not the ones in below?
<!--begin::Page Vendors Javascript(used by this page)-->
<script src="/metronic8/demo1/assets/plugins/custom/datatables/datatables.bundle.js"></script>
<script src="/metronic8/demo1/assets/plugins/custom/vis-timeline/vis-timeline.bundle.js"></script>
<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
<script src="https://cdn.amcharts.com/lib/5/map.js"></script>
<script src="https://cdn.amcharts.com/lib/5/geodata/worldLow.js"></script>
<script src="https://cdn.amcharts.com/lib/5/geodata/continentsLow.js"></script>
<script src="https://cdn.amcharts.com/lib/5/geodata/usaLow.js"></script>
<script src="https://cdn.amcharts.com/lib/5/geodata/worldTimeZonesLow.js"></script>
<script src="https://cdn.amcharts.com/lib/5/geodata/worldTimeZoneAreasLow.js"></script>
<pre lang="html">
Hi,
You should pass the Data from your Database in Javascript format right in the HTML as shown below:
<pre class="html">
var chartData = <?php echo json_encode($data)?>;
</pre>
In Javascript you can use this variable instead of the hardcoded demo data.
Regards.