Skip to content

feat(chart): Legends won't be "NaN" when data has `NaN` values

Miguel Rincon requested to merge 220760-allow-empty-points into master

Background

Part of gitlab#220760 (closed), makes gitlab!35086 (merged) possible.

Not all data is perfect. 🤷

When we pass data to our charts, we ensure to validate the data has no NaN values before getting the charts to display, however, missing points (like NaN) are also valuable information for users, as missing data can convey that an issue must be addressed.

echarts provides a way to display missing data points in a line, and we should do the same, so our charts are more powerful in representing problems in the data displayed:

Screen_Shot_2020-06-23_at_6.20.05_PM

What does this MR do?

This MR removed NaN values from Avg, Max, Min, Last, calculations so data is correct even when some data is "missing".

Does this MR meet the acceptance criteria?

Conformity

  • Code review guidelines.
  • GitLab UI's contributing guidlines.
  • [-] If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer.
  • [-] If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
  • [-] If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui package can be upgraded quickly after the changes are released:
  • Added the ~"component:*" label(s) if applicable.
Edited by 🤖 GitLab Bot 🤖

Merge request reports