Hello,

There is a similar bug as already reported bug named: '[6.5.1 classic] Layout loop on charts using bottom/top legend on too narrow canvas'.
The new bug occurs in 6.5.1-modern, for sprite-legends that are located at the 'right', when the general chart area (surface) is too short. In this case the code enters an inifinte loop and the ui freezes completely (you have to kill the browser).

My temp solution was to override the 'performLayout' function of SpriteLegend.js, and to add the lines in red (see below), which identify the 'infinite-loop condiion' and sees to get out from the do-while loop:

Please provide a fix for it in future version.

Thanks.


from 'performLayout' code in SpriteLegend:

case 'right':
case 'left':


// surface must have a height before we can proceed to layout right/left
// docked legend. height may be 0 if we are rendered into an inactive tab.
// see https://sencha.jira.com/browse/EXTJS-22454
if (!surfaceHeight) {
return false;
}


columnSize = ln * 2;


// Split legend items into columns until the height is suitable.
do {
// Integer division by 2, plus remainder.
columnSize = (columnSize >> 1) + (columnSize % 2);


itemsWidth = 0;
itemsHeight = 0;
columnWidth = 0;
columnCount = 0;


for (i = 0; i < ln; i++) {
bbox = bboxes[i];
// itemsHeight is determined by the height of the first column.
if (!columnCount) {
itemsHeight += bbox.height;
}
if (bbox.width > columnWidth) {
columnWidth = bbox.width;
}
if ((i + 1) % columnSize === 0) {
itemsWidth += columnWidth;
columnWidth = 0;
columnCount++;
}
}
if (i % columnSize !== 0) {
itemsWidth += columnWidth;
columnCount++;
}
paddedItemsWidth = itemsWidth + (columnCount - 1) * gap;
paddedItemsHeight = itemsHeight + (columnSize - 1) * gap;
paddedBorderWidth = paddedItemsWidth + gap * 4;
paddedBorderHeight = paddedItemsHeight + gap * 4;


if ((bbox!= undefined) && (bbox.height >= surfaceHeight)){
console.log("**** in override of SpriteLegend; Notice: Legend Sprite height exceeds chart surface height. Minimum height should be: " + bbox.height + ".");
break;
}



} while (paddedItemsHeight > surfaceHeight);


break;


}