0

The summer vacation just started and I wanted to learn a new programming language so I thought lets start with JavaScript. I have already some domotica system at home what logs all kind of data in a mariaDB 10 database and I wanted to visualize this on a website with graphs and all. I found chart.js is a easy way to visualize this in JavaScript. Now I run this all on my Synology DS1817+ NAS so I don't know how to install things like npm to install a MySQL driver to extract this data. Does anyone know how to realize this or should I abandon JavaScript and move to an other language with default MySQL support?

Dylan
  • 45
  • 1
  • 9

1 Answers1

0

Chart.js is a browser-side JS library.

Browsers cannot have direct access to MySQL. The NPM module you have found is for Node.js.

Typically, to get the data to the browser you would write server-side code (in whatever language you like, but Node.js is a perfectly good choice) to create a web server, which you could then access with Ajax.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335