We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Superfluous scroll bar when legend position is "right".

I'm having issues with the legend scroll bars. Specifically, when the legend position is set to "right" and the enough legend items appear that a vertical scroll bar is shown, a horizontal scroll bar will also appear even though there is plenty of space between the legend and the chart. Here's what it looks like:

Superfluous Scroll Bar
When I use the developer console to manually add 20px to the div with id="#legend_[chartdiv]Container" (where [chartdiv] is the id of the chart's parent div) then the horizontal scroll bar goes away. This, combined with the fact that the horizontal scroll bar does not typically appear when the vertical scroll bar is not present, makes me think that whatever script is generating the legend dimensions is not accounting for the vertical scroll bar width.

A related issue occurs when a legend only contains one item, and its width is sufficient to justify a horizontal scroll bar. The horizontal scroll bar then overlaps the legend item - again as if the scroll bar were not taken into account when the legend dimensions were calculated. Here's what that looks like:
Horizontal Scrollbar Overlap
I realize I can pre-set the legend width when creating the chart, but setting a large width looks ridiculous with a list of small legend items. Since this is a drilldown chart I don't have the luxury of knowing exactly what legend items will appear. I would like the legend to be re-sized appropriately. So ultimately, here's my question:

Is there an event I can use to tack on some custom jQuery resizing function?

I tried legendBoundsCalculate but the event does not trigger - it won't pop up an alert box or hit a breakpoint set in the Firefox javascript debugger. Most other events seem to fire before the legend is rendered, including renderComplete. I had some luck with animationComplete, but it is inconsistent. Any suggestions?

Matt, CodeASite

3 Replies

AD Alagarsamy D Syncfusion Team April 16, 2015 06:58 AM UTC

Hi Matthew,

Thank you for using Syncfusion products.

We have already logged your requirement as a feature request in our database and we will implement this feature in any of our upcoming release. We usually have an interval of at least three months between releases. We will also update you when these feature have been implemented.

Alagarsamy D.

MF Matthew Fekete April 16, 2015 08:53 PM UTC

Sorry, I'm confused. Is that a feature request for making the default legend size accommodate scroll bars, a feature request for making the legendBoundsCalculate event work, or a feature request for adding an event on legend render?


AD Alagarsamy D Syncfusion Team April 17, 2015 05:47 AM UTC

Hi Matthew,

Thanks for the update.

We would like to inform you that the feature request has been logged for making the default legend size accommodate scroll bars.

Please let us know if you have any concerns.

Alagarsamy D.

Live Chat Icon For mobile
Up arrow icon