In case this is helpful: I interned at a company, Polychart, where we built a product similar to chart.io that is now open source and can be self-hosted: https://www.polychart.com/
Note that the IMPORT statement might be a bit misleading. The IMPORT statement only creates a "virtual table", it doesn't actually copy any data. As much of the query as possible is pushed down into MySQL/the external data source and the charts will be generated from the query result that is returned by the external data source.
I initially thought the project was a subtitute for chart.io. However, it seems like the project is about "collect and visualize data".
It is not to visual data by connecting to your own database. Rather it allows you to import data from an mysql database