Shopify / polaris-viz

A collection of React and React native components that compose Shopify's data visualization system
https://polaris-viz.shopify.dev
Other
330 stars 25 forks source link

Add Ability To Show Last X-Axis Label On Line Charts #1452

Open donovangini opened 1 year ago

donovangini commented 1 year ago

Feature request summary

I would like to be able to show the last x-axis label on a line chart when there is enough space. Currently it is always hidden (see attached image)

Screenshot 2022-12-14 at 11 01 58 PM

Rationale

I am trying to display a line chart with the data from the last 7 days. It is confusing from a glance to not have the last day show in the x-axis. If there is enough space, I think this should be an option. Let me know if you have any questions!

envex commented 1 year ago

Hey @donovangini! The reason we drop the last label is because it could bleed outside the chart. It's also dependant on the size of the chart because we drop labels based on the amount of room we have. We can't guarantee that a visible last label wouldn't bleed outside the chart.

@mirualves @adamperron What do you think about making this an option?