Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VictoryLegend: how to relatively position (e.g. bottom center)

I'm using VictoryCharts, specifically the VictoryLegend component to render the legend for my chart. According to the docs it sounds like the only options for positioning the legend are absolute x and y coordinates. I'm trying to position the legend relatively, for example "at the bottom in the middle". This is the desired appearance:

legend centered at the bottom of the chart

Because the series labels in my legend are internationalized, the number of characters and thus the legend's width changes based on locale, so it isn't an option to hard-code an x coordinate to center the legend. I would also prefer not to have to calculate the y coordinate based on the height of my chart. Is there any way to relatively position the VictoryLegend below the chart and horizontally centered?

like image 571
Steve Grossi Avatar asked Mar 25 '18 01:03

Steve Grossi


1 Answers

According to the maintainer in a Gitter conversation, it appears this is not possible:

enter image description here

like image 81
Steve Grossi Avatar answered Nov 14 '22 11:11

Steve Grossi