question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Legend Overflow Handling

See original GitHub issue

I have been using Chart.js 2 quite a lot recently and there is one feature I have seen suggested but has been overlooked. Adding overflow handling for the legend would help me out immensely. Currently I have some datasets that could have anywhere from 10 - 50 keys in the legend. I have seen solutions like those found here but would like to avoid having to separate my legend from the chart. Adding the ability to set the dimensions of the legend within the canvas object as well as what do when our labels go beyond those dimensions would be very beneficial to my projects.

			legend:{
				labels:{
					fontStyle: "bold",
				},
				display: true,
				position: 'right',
                                width: 100, //suggested
                                height: 200, //suggested
                                overflowX: hide, //suggested
                                overflowY: scroll, //suggested
			},

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
systemallicacommented, Sep 1, 2020

Although we can create a custom legend, having the possibility of using the provided one and modify its height, width and overflow behaviour would be certainly easier for the user.

I would like to see this feature implemented.

1reaction
benmccanncommented, Oct 2, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix chart Legends width-height with overflow scroll in ...
You can try one thing. Try to separate the legend into an different div. now you have full control of the div you...
Read more >
How is overflow handled? - Endless Legend - Games2Gether
1. Yes. setup multiple builds and swap pop between industry and something else, see the later builds go down in turns? That's because...
Read more >
Myths and Legends About Integer Overflow -
Before 1.0.0-alpha, overflow was handled by wrapping, giving the result one would expect from a two's complement representation (as most modern CPUs use)....
Read more >
Chart Legends width-height with overflow scroll in ChartJS
Chart Legends width-height with overflow scroll in ChartJS - Javascript Chart.js. Javascript examples for Chart.js:Legend.
Read more >
Legends - Carbon Design System
Legends summarize the distinguishing visual properties such as colors or texture ... When legends exceed 30 percent of the chart, overflow the content...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found