Legend display configuration is ignored in v2.5.1
See original GitHub issueI believe that due to #158, legend display configuration is ignored in charts. I am working on a single page application and after navigating from the route where I have a line chart set to not display the legend to another route and then back, the legend is rendered. This behavior was not present in v2.4.1. In addition, the global defaults.legend.display
setting is completely ignored.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
Legends - Vega & Vega-Lite
Property Type Description
fill String The name of a scale that maps to a fill color.
opacity String The name of a scale that maps...
Read more >Changelog - Apache ECharts
Data transform is a new set of configurations and APIs to enable data ... Add invisible and ignore to enable show and hide...
Read more >Configure Grafana | Grafana documentation
Set to true to attempt login with OAuth automatically, skipping the login screen. This setting is ignored if multiple OAuth providers are configured....
Read more >Advanced Settings | Kibana Guide [8.5] - Elastic
This setting must contain from and to values (see accepted formats). It is ignored unless ml:anomalyDetection:results:enableTimeDefaults is enabled.
Read more >How to disable chartjs legendclick - javascript - Stack Overflow
According to the docs there is a onClick handler for the legend exposing the event object. If you stopPropagation it stops the data...
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
Hey all I just release 2.5.3 which adds the ability to either use legend configurations through options or the legend prop. Your choice!
https://github.com/jerairrest/react-chartjs-2/releases/tag/2.5.3
I was just about to bang my head to the wall, luckily I found this post. As a quick fix, just pass the legend as prop again like this
legend={chartOptions.legend}
, then you can still write all your options in one place.If ultimately need to favour the props way, one suggestion is that, you can add a little console output to remind people to use the “legend” prop. Like how React handle moving “PropTypes” to separate npm package.