victory icon indicating copy to clipboard operation
victory copied to clipboard

VictoryGroup breaks when a VictoryBar has y={(datum)=>null} inside a victoryStack and has large X values

Open sergeykimaia opened this issue 1 year ago • 2 comments

Describe the bug VictoryChart no longer displays correct x values when what i wrote in the title happens

Victory version 36.6.0

Code Sandbox link Please include a code sandbox link or a similar reproduction if possible.

To Reproduce Steps to reproduce the behavior:

  1. go to click on the sandbox link
  2. see all the bars in the chart are aligned to the right
  3. remove y={(datum)=>null} and see it fix itself

Expected behavior one part of the group disappears while the other works normally

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: chrome
  • Version 104.0.5112.102 (Official Build) (64-bit)

sergeykimaia avatar Aug 25 '22 12:08 sergeykimaia

Try to return a number instead of null.

<VictoryBar
  y={(datum) => 0}
  ...
/>

The y prop should return type of DataGetterPropType which is string | string[] | number | number[].

vozaldi avatar Sep 10 '22 07:09 vozaldi

in the chart im using i want 0 to be a legitimate value that appears while hovered, while null to be like missing data in victoryLine

edit: this is for tooltip purposes, hover to work for 0 and not work for null

sergeykimaia avatar Sep 14 '22 07:09 sergeykimaia