node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

chart-UI graphing error if X-Axis data point limit > 50% of available data points

Open 50percentDave opened this issue 1 year ago • 0 comments

Current Behavior

Charts appear to have a straight line joining the first and last datapoints if the X Axis limit value for points is more than half of the available points.

Screenshot 2024-09-11 at 19-06-20 Solar Graphs Graph above with database query returning 100 data points, and the X Axis limit set to 2 Days or 51 points.

Screenshot 2024-09-11 at 19-07-05 Solar Graphs Graph above with database query returning 100 data points, and the X Axis limit set to 2 Days or 50 points.

Screenshot 2024-09-11 at 19-05-12 Solar Graphs Graph above with database query returning 3200 data points, and the X Axis limit set to 2 Days or 1601 points.

Screenshot 2024-09-11 at 19-03-57 Solar Graphs Graph above with database query returning 3200 data points, and the X Axis limit set to 2 Days or 1600 points.

Expected Behavior

Chart should not have a straight line joining the first and last datapoints unless there are only 2 datapoints.

Steps To Reproduce

Write a query to generate some data from a database, in that query apply a limit of any figure. On the chart X axis limit, set the Or number of datapoints to be (the query limit/2) +1 OR any point limit of more than half of the datapoints available

eg

Screenshot 2024-09-11 at 19-06-20 Solar Graphs Graph above with database query returning 100 data points, and the X Axis limit set to 2 Days or 51 points.

Screenshot 2024-09-11 at 19-07-05 Solar Graphs Graph above with database query returning 100 data points, and the X Axis limit set to 2 Days or 50 points.

Screenshot 2024-09-11 at 19-05-12 Solar Graphs Graph above with database query returning 3200 data points, and the X Axis limit set to 2 Days or 1601 points.

Screenshot 2024-09-11 at 19-03-57 Solar Graphs Graph above with database query returning 3200 data points, and the X Axis limit set to 2 Days or 1600 points.

Environment

  • Dashboard version:2.0 (1.16)
  • Node-RED version:4.02
  • Node.js version: v20.17.0
  • npm version:10.8.2
  • Platform/OS: Linux/Debian
  • Browser: Firefox

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

50percentDave avatar Sep 11 '24 18:09 50percentDave