How to generate charts from the database
To create a chart, simply go to your Dashboard > Visualizer > Add New Chart, and select the type of chart you want to create.
By default, the chart comes with some sample content that you can change, by either adding manual data or by importing it from a different source.
In this doc, we'll follow the Import from database method, which allows you to use our query editor to get data from any table and database you want (your own or an external database).
Note: This is part of the premium version of Visualizer. This feature is available with Plus and Infinite plans and also includes periodical synchronization: 10 min/Each hour/12 hours/day/3 days/
1. Get data from your own database
STEP 1
Select the Import from database panel. There you can select how often the import should take place ( One-time/10 minutes/Each hour/12 hours/day/3 days ). After that, click on Create Query to open our query editor.
STEP 2
In the query editor, you need to enter the query of your choice. Here you can find some sample queries. It's also possible to use PHP variables in the DB queries, an example here.
STEP 3
After entering the query, click on Show Results.
STEP 4
Here you will see the results of your query. At this point, if everything is ok with the query you can click on Save Schedule and Show Chart to see the chart. After that, click on Save Chart.
2. Get data from an external database
If you have an external database from which you want to pull the data, you need to make an extra step. Just before entering the query, make sure you click on the SELECT ANOTHER/EXTERNAL DATABASE which we'll open some new fields.
Select MySQL and enter the Server Name/IP, Database Name, Username and Password of the external database and click on Test Connection. If everything went well, you will see a successful connection message and you will be able to enter your query and generate your chart.
The plugin is compatible with the following types of external databases: WordPress DB, MySQL, SQLite3, IBM DB2, MS SQL, Oracle, PostgreSQL.