gsoft-inc / ov-igloo-ui

Officevibe design system
https://igloo.officevibe.design
Apache License 2.0
19 stars 6 forks source link

[Bug]: Some inconsistencies in x and y axis labels displayed (AreaChart) #304

Closed Ignotos closed 1 year ago

Ignotos commented 1 year ago

Contact Details

michael.ignoto@gsoft.com

What happened?

example screenshot for reference: image

  1. For x-axis labels, it would be preferable to show as many dates as we can allow. In the example, we have the last 7 days + the current day (8 days total), there is room to show all days but some are skipped (Jan 1, Jan 3, Jan 5).

  2. For the y-axis labels, in some instances not all numbers in the range are included, in the example I would expect all numbers 0 - 5 to be shown but only 0, 2, and 5 are shown. the range provided is min: 0 max: 5. Most of the time the y-axis labels are fine, but in this case with little data and a small range it doesn't behave like I would expect.

Component

AreaChart

Component Version

2.0.0

Which browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

Mobile Device

No response

Relevant log output

No response

vicky-comeau commented 1 year ago

Hi, can you provide what you put for the dataSet and dateRange please, thanks.

franckgaudin commented 1 year ago

For x-axis labels, it would be preferable to show as many dates as we can allow. In the example, we have the last 7 days + the current day (8 days total), there is room to show all days but some are skipped (Jan 1, Jan 3, Jan 5).

The component is configured to divide the number of elements by 7 and it automatically calculates which element to display. To fix the rendering we can add a property that allows to change this value for example in our case 8 which corresponds to the desired display.

Capture d’écran, le 2023-01-16 à 14 14 05

For the y-axis labels, in some instances not all numbers in the range are included, in the example I would expect all numbers 0 - 5 to be shown but only 0, 2, and 5 are shown. the range provided is min: 0 max: 5. Most of the time the y-axis labels are fine, but in this case with little data and a small range it doesn't behave like I would expect.

The calculation of the Y axis is similar to the X axis for a better result we can choose a range of 0-6 ou 0-4 to divide the elements by 2.

Capture d’écran, le 2023-01-16 à 14 17 43

Another option is to leave the props range empty so that the component calculates the spacing itself. It all depends on the desired result.

Capture d’écran, le 2023-01-16 à 14 19 18
Ignotos commented 1 year ago

I think allowing us to specify the number of elements on the x-axis could be a good solution to this. As long as the chart remains responsive, so if the labels don't all fit on a mobile screen only a subset are shown so that there is no overlap between labels.

Also one more small thing related to this that I forgot to mention, seems the design team would like to have a specific date standard across all of OV, they seem correct for the French labels but for the English labels they are missing a period when the name is abbreviated, here is what the standard is:

english (example "Jan. 1" instead of "Jan 1"): image

french (seems correct already): image