-
What Grafana version and what operating system are you using?
7.5.7 -
What are you trying to achieve?
Plot the data get from mysql db with correct date time -
How are you trying to achieve it? What happened?
I’ve followed some tutorial and could plot the data to ‘Table’ from mysql db.
But I want to plot the data with ‘Graph’, then I wrote the following SQL to get the data:
SELECT
UNIX_TIMESTAMP(date) AS "time",
`total` AS "total_num",
`inform_num` AS "inform",
`extra_num` AS "extra"
FROM covid_table
If I choose to draw with ‘Table’, it seems okay:
But if I choose to draw with ‘Graph’, it seems like x-axis’s data(date) is not correct:
And the value at y-axis is wrong as well.
(Maybe because x-axis’ data is incorrect(?
-
What did you expect to happen?
Correctly show date time at x-axis -
Did you follow any online instructions? If so, what is the URL?
reference
Originally, my ‘date’ data is VARCHAR format, therefore I use functionUNIX_TIMESTAMP()
to enable my original data format run with SQL, but the value is wrong.
I stuck with this issue for a period of time, thus I decide to recreate a DB with ‘date’ data format as DATETIME, but it didn’t work either. So I’m wondering where did I do wrong…
The data format of my DB is shown below:
- date - DATETIME
- extra_num - INT
- home_inform_num - INT
- inform_num - INT
- total - INT
Any help or advice would be appreciated!