The following macro was developed by Lanedo in order to use LibreOffice charting capabilities with data stored in a SQL database.
After downloading the populate-spreadsheet-from-db.ods LibreOffice file:
Open the document and enter the information to connect to your SQL DB
Press the "load data" button
If the data was successfuly imported, press "create chart"
NOTE: The macros connect to a database and will do nothing if that database is not available. So you can not expect it to just work from downloading the file alone.