laboratoriobridge / bold

https://bold.bridge.ufsc.br
MIT License
76 stars 9 forks source link

[Chart] Reference area can go to more than 100% when some points of data are missing #858

Open wagnerbsantos opened 1 month ago

wagnerbsantos commented 1 month ago

Describe the bug

When a point of data is missing for a reference area below, the current reference area covers a bigger percentage of the chart area. This can be seen in the screenshot when the X axis is at 300. The middle reference area doesn't contain data for when x = 300, this causes the green reference area to expand, thinking the yellow area doesn't exist at that point.

To Reproduce

Steps to reproduce the behavior:

  1. Create a chart with 2 referenceAreas
  2. The top reference area should have 3 points in the array, and the bottom reference area only the first and last points.
  3. This will cause the top reference area to go the described upperLimit for that point.

This also happens currently in the storybook for the ReferenceArea.

Expected behavior

All the reference areas should end at their upperLimit when it exists, and when the value doesn't exist, the value should be interpolated. As seen in the screenshot, the upperLimit for the Area 3 is 10000, but whenx = 300, it goes above 10000.

Screenshots

image

Desktop (please complete the following information):