esnet / esnet/react-timeseries-charts

Center the legend

Open
#425 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
876
Forks
279
PR merge metrics
No merged PRs in 30d

Description

# 🌈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](https://user-images.githubusercontent.com/1956886/68323040-df68d180-00c4-11ea-960f-0512000c45a3.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.