How to create custom legend?
See original GitHub issueHow would one use the legendCallback
method with this wrapper? The Chart.js docs show the function returning an HTML string, which is of course not the React way.
Thank you for your assistance!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:17
- Comments:19
Top Results From Across the Web
Composing Custom Legends — Matplotlib 3.6.2 documentation
Composing custom legends piece-by-piece. Note. For more information on creating and customizing legends, see the following pages: Legend guide · Legend Demo.
Read more >Make a Custom Legend in ArcGIS Pro - Tutorial - Esri
Make a custom legend in ArcGIS Pro · 1. Return to the map. · 2. In the Create Features pane, click any of...
Read more >python - How to manually create a legend - Stack Overflow
Suppose we wanted to create a legend which has an entry for some data which is represented by a red color: import matplotlib.patches...
Read more >Modify chart legend entries - Microsoft Support
Edit legend entries in the Select Data Source dialog box · Click the chart that displays the legend entries that you want to...
Read more >Creating Customized Legends in Tableau - InterWorks
Create a legend. Show a legend. Be a legend. Tableau developers love a succinct workaround, especially when that workaround is more flexible ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve managed it by using the ref to the chart and the
generateLegend
function. Here’s my code if it helps anyone else…Here is my approach without
generateLegend
method. Thanks to this, I also do not need to use React’sdangerouslySetInnerHTML
so I have full control on my legend.I’ve used this approach to achieve
onClick
events on legend because withdangerouslySetInnerHTML
.