victory icon indicating copy to clipboard operation
victory copied to clipboard

Option to disable VictoryPie label

Open peterhadlaw opened this issue 9 years ago • 5 comments

I'm using the new VictoryLegend and I was wondering if there is a proper way to disable the rendering of labels via the labelComponent on VictoryPie. Using labelComponent={null} causes a fatal error

peterhadlaw avatar Mar 16 '17 21:03 peterhadlaw

@peterhadlaw try labels={() => null} instead

boygirl avatar Mar 20 '17 21:03 boygirl

It's not working in case of <VictoryLine>

ShaikhKabeer avatar Mar 05 '18 09:03 ShaikhKabeer

@ShaikhKabeer I guess you can always style it, right? style={{ labels: { display: "none" } }}

andion avatar Apr 05 '18 16:04 andion

@ShaikhKabeer I was having trouble with the as well, and applying a style like @andion suggested didn't work for me. I was able to fix this (not as cleanly as I would've liked) by adding my own CSS overrides, but I think this is still an open issue. .VictoryContainer svg text {display: none;} //Removes the labels .VictoryContainer svg g text {display: block} //Preserves the axis information, if needed.

dcorrea80 avatar Apr 09 '18 22:04 dcorrea80

Well, I found multiple solutions to this:

Solution 1: labelComponent = { <span></span> }

Solution 2: style={{ labels: { display: "none" } }}

Still a hack and would like a better solution like the following:

<VictoryLabel active={false}/>

SushanRajShakya avatar Apr 01 '21 08:04 SushanRajShakya