Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

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

Danh11
Shopify Partner
87 2 41

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
519 58 113

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
87 2 41

Ah interesting. thanks!