Select to view content in your preferred language

Turning off Legend Label Wrapping in the CIM

278
1
02-17-2026 10:33 AM
MaggieT
Emerging Contributor

There is an issue of white space in legends to the right of the labels. I've found elsewhere on a forum that turning wrapping off is the best solution, but the post only involved doing that by hand. Does anyone know if that can be done by working in Python with the CIM? I've been investigating a legend object I made and it seems impossible. There's a way to set an absolute width, but obviously I need the width to be determined by the length of the labels.

0 Kudos
1 Reply
MaggieT
Emerging Contributor

I just ended up finding the length of the longest expected legend item text and multiplying it by a number based on the font size and setting the labelWidth to that. But it's a little jenky and I'd still like to know if there's another way.

0 Kudos