esnet / react-timeseries-charts

Declarative and modular timeseries charting components for React
http://software.es.net/react-timeseries-charts
Other
859 stars 283 forks source link

Center the legend #425

Open LucasVandroux opened 4 years ago

LucasVandroux commented 4 years ago

🌈Feature request

What is this feature? Have the ability to center the legend. This would be particularly useful when the legend is placed independently of the chart.

How should the feature work? Having a center option in the align props of the Legend component's API: https://software.es.net/react-timeseries-charts/#/api/charts/Legend

Do you have examples or an idea of how it can be implemented? Modifying the line where the alignment strategy is chosen for the legend should be sufficient: https://github.com/esnet/react-timeseries-charts/blob/21a6c32ea8b34de35767eb0ec5e7d8b676106e48/src/components/Legend.js#L386

Additional context I am particularly interested in this feature as I am trying to achieve the following presentation for the legend of this chart: Screenshot 2019-11-06 at 18 26 49