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 dccDB = …
HOST = …
USER = …
PASSWORD = …connection = sql.connect(host=HOST,
port=x,
user=USER,
password=PASSWORD,
database=DB,
cursorclass=sql.cursors.DictCursor)with connection.cursor() as cursor:
# Read a single record
sql = ‘SELECT COUNT(*) AS count FROM table’
cursor.execute(sql)
result = cursor.fetchone()
print(result)
Also, I would like to update the chart regularly.
Thank you