Recharts: Position Legend on the right side of a graph

Created on 7 Apr 2017  路  3Comments  路  Source: recharts/recharts

I'm wondering if it's possible to display a vertical list of Legend items on the right of a graph. I have a LineChart with a custom Legend, but it seems the only position the Legend (wrapper) can take now is top or bottom. I've checked all examples and they confirm this notion.

I can achieve my goal with ugly css positioning or other suboptimal ways, but isn't there a proper way of doing this?

Most helpful comment

for those that cut and paste, there is a typo. change vetical to vertical . :)

All 3 comments

@sortsen You can change the layout of Legend.

<Legend layout="vetical" verticalAlign="middle" align="right" />

for those that cut and paste, there is a typo. change vetical to vertical . :)

Just in case anyone is looking for more layout options I have added few here

<Legend layout="horizontal" verticalAlign="top" align="center" />
image

<Legend layout="vertical" verticalAlign="top" align="right" />

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patientplatypus picture patientplatypus  路  3Comments

alexandersoto picture alexandersoto  路  3Comments

YikaJ picture YikaJ  路  3Comments

manishjohar picture manishjohar  路  3Comments

chin-idean picture chin-idean  路  3Comments