I have been searching but I didn’t find a simple way to draw a graph from a SQL request.
For example I have this code, and I want to make a bar chart from the result of the request :
import pymysql as sql
from dash import dcc
DB = …
HOST = …
USER = …
PASSWORD = …
connection = sql.connect(host=HOST,
with connection.cursor() as cursor:
# Read a single record
sql = ‘SELECT COUNT(*) AS count FROM table’
result = cursor.fetchone()
Also, I would like to update the chart regularly.