Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How to use amCharts v5 with Metronic 8


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="
<script src="
<script src="
<script src="
<script src="
<script src="
<script src="
<pre lang="html">
<script src="
<script src="
<script src="
<script src="
</pre>


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


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.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(