I need to create a graph in HTML page with Flask.
I've used this tutorial: http://blog.ruanbekker.com/blog/2017/12/14/graphing-pretty-charts-with-python-flask-and-chartjs/
My app has to run in offline mode eventually, so instead of using:
<script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js'></script>
in my HTML file, i've copied the code in Chart.min.js to my computer and replaced the code line with:
<script src="/static/Chart.min.js"> </script>
There is no path error. The path /static/Chart.min.js exists.
In the first case (online mode) the graph works perfectly, on the second case (offline) the graph isn't displayed.
What's the problem?
Thanks!
Write the src tag for calling the js file as
<script src="../static/Chart.min.js"> </script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With