victory icon indicating copy to clipboard operation
victory copied to clipboard

Empty array for tickValues is not possible

Open sebimarkgraf opened this issue 5 years ago • 2 comments

Bugs and Questions

Checklist

  • [X] This is not a victory-native specific issue. (Issues that only appear in victory-native should be opened here)

  • [X] I have read through the FAQ and Guides before asking a question

  • [X] I am using the latest version of Victory

  • [X] I've searched open issues to make sure I'm not opening a duplicate issue

The Problem

Passing in a empty array for the tickValues attribute of a axis leads to victory calculating ticks and displaying ticks. Expected behavior: Do not display any ticks

This leads to problems where I want to render just full minutes on a time scale and the user decides to zoom between minutes.

Reproduction

https://codesandbox.io/embed/7jx36xwlmx

Zoom in between 0:00 and 0:01 until both are out of the chart. Then victory renders 0:00 labels which are not given through the tickValues.

sebimarkgraf avatar Apr 29 '19 11:04 sebimarkgraf

@Sintifo you're right. This should be allowed. As a work around, you can use tickValues={[null]} and VictoryAxis will not render any ticks.

boygirl avatar May 06 '19 20:05 boygirl

@boygirl Thank you for the workaround!

sebimarkgraf avatar May 08 '19 13:05 sebimarkgraf