Created
October 3, 2020 19:31
-
-
Save blackode/fb452f1984feb40ff21b6771dd502d94 to your computer and use it in GitHub Desktop.
A template to render the linecharr.js with dynamic data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<hr> | |
<h2> The Line Graph on Revenues & Years </h2> | |
<hr> | |
<div> | |
<canvas id="lineChart" width="100%" height="100%"></canvas> | |
</div> | |
<script type="text/javascript"> | |
window.chart_data = <%= raw(Jason.encode!(fetch_chart_data @revenues)) %> | |
window.chart_labels = <%= raw(Jason.encode!(fetch_chart_labels @revenues)) %> | |
</script> | |
<script src='<%= Routes.static_path(@conn, "/js/linechart.js") %>' type="text/javascript"></script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment