New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chart not displaying results if I use the number 0 but will if I use number 0.0 ... possible bug ? #97
Comments
If you need any more help. please let me know Thanks |
What would help most would be a reproducible CTE. If that is not possible, then a sample database and query could also help. RIght now it is very hard to debug the issue without any data or query. |
Hi Sergej, Thanks for getting back to me, let me first state I am very new to using SQLIte with JSON and also Grafana, so I may be doing something wrong ? I have added my working database and if you can look at the image you will see my comments. Grafana & SQLIte JSON & number zero problem.zip Thanks Gaz |
When I use your query everything looks fine to me (regardless of the first value). In the screenshot in your first message I also see your time range is different. Are you sure that your issue is not simply one of filtering for the right time frame? If your issue persists, could you maybe export the dashbaord from Grafana (that would include your visualization settings). |
I opened this chart and removed the " >= 0 " from the query. While the chart obviously changes due to this it does not become a flat line. How can I reproduce your issue? Also for time series visualization ordering by time is crucial and should be done in every query. |
The image you showed selected the time but you are missing an "order by time ascending" clause, which is integral for a valid time series. Could you let me know if you still see the same issues after also sorting by time? Because right now it looks to be a Grafana chart scaling "problem", which of course heavily depends on the shown values, which might be out of order. |
Hi Sergej, Would it be possible to change my query for me and post it on here ? Thanks Gaz |
Hi I finally have had some time to come back to this, as I have been very busy lately. This is my new query, which seems correct referencing your previous comment.
The chart still does not work if the 1st line is a 0 in my database. Any ideas ? Thanks Gaz |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi, Did you ever find a solution to this ? Thank you Gaz |
Not really. If you could provide a sample query with the data in a CTE or subquery to reproduce the issue that would be most helpful. But I'll try to take another look eventually. |
Hi, I have added a zip file with a video & database & query & Grafana export dashboard, hope this explains the problem. Thanks Gaz |
Can you try to pin the problem down to a simpler query? A CTE looks like this with cte(timestamp, sensor_name, value)
as (VALUES ('2022-10-30T01:50:00.000+01:00', 'Inlet Pipe', 1),
('2022-10-30T01:59:00.000+01:00', 'Inlet Pipe', 5),
('2022-10-30T01:10:00.000+00:00', 'Inlet Pipe', 10),
('2022-10-30T01:20:00.000+00:00', 'Barrel Lid', 15))
select unixepoch(timestamp) AS ts, value from cte
order by 1 asc Could you provide me such a query (not in a zip file but just here as text) that causes the issue? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The problem is I use Grafana for my chart and if the very 1st number of row 1 is a 0 .... I get no graph.
Although data is there !
If I manually change the database first row number to 0.0 from 0 the graph works perfectly.
It seems that grafana needs to see the number with a decimal to set up the graph ?
My SQLite JSON database setup
Thanks
The text was updated successfully, but these errors were encountered: