Can anyone shed light on how to use the useYScale hook from the Polaris Viz library?

Danh11
Shopify Partner
77 2 31

I would like to display integers only on my linechart and I figure the useYScale hook would let me accomplish this based on the fact there is a property named `integersOnly` that takes a boolean.

 

Although the documentation is very sparse and doesn't explain in any detail about how to use it. The `useYScale` hook isn't available when importing it from `@Shopify/polaris-viz`

 

Has anyone had any luck with it or know how to implement it?

 

I'd just like to use it with the LineChart component in my remix/react app.

(chose Online Store and Theme Development because there is no App Development board)

Replies 2 (2)

SomeUsernameHe
Shopify Partner
455 49 83

They have been doing a bunch of stuff with it, I would check github. Here is just one thing: https://github.com/Shopify/polaris-viz/pull/1026

If you still cannot find the information you need, consider opening an issue in the Polaris Viz GitHub repository to ask the maintainers directly about the current state and usage of the useYScale hook.

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
Danh11
Shopify Partner
77 2 31

Ah interesting. thanks!