JamesKDouglas / WelyApp

App for monitoring and sharing data from the Wely wireless lysimeter.
https://wely-app.vercel.app
0 stars 0 forks source link

Error Bars for the Chart #5

Open JamesKDouglas opened 2 years ago

JamesKDouglas commented 2 years ago

The chart needs error bars. Although dashboards often omit them, every undergraduate science student know you should have them.

Chart.js can hand that, so it should be implemented here. For example, https://handsondataviz.org/chartjs-error-bars.html

JamesKDouglas commented 1 year ago

I was able to implement error bars with the library above. The main challenge was just importing the library, which I ended up doing with a script tag.

But it looks horrible. The bars are too wide and most of the time the error is quite small so there is little point in showing them.

Instead, I suggest that the diameter of the circle marker indicate error range. The fact of the matter is that there is hysteresis in the signal from temperature change. The load cell and temperature sensor change temperature at different speeds. So if the temperature changes quickly then the temperature reading cannot be accurately used to compensate for temperature related drift.

What that literally means is that the error range changes based on the speed of the temperature change. Is it possible to show that on the chart? Well, yes because the library computes an error range for each point. I suggest a conditional to detect rapid temperature changes, and show the error bar only if it is above a certain value.