Chartjs-How to get dataset from MySQL using Flask?

0👍

Maybe this can help pass the data from flask to js: How can I pass data from Flask to JavaScript in a template?

Quote:
” You can use {{ variable }} anywhere in your template, not just in the HTML part. So this should work:

<html>
        <head>
          <script>
            var someJavaScriptVar = '{{ geocode[1] }}';
      </script>
    </head>
    <body>
      <p>Hello World</p>
      <button onclick="alert('Geocode: {{ geocode[0] }} ' + someJavaScriptVar)" />
    </body>
</html>

Leave a comment