ThinkGeo.com    |     Documentation    |     Premium Support

Can't set Legend height

Hi,

In v14, I can’t seem to set the height of the legend I am building. Regardless of how much I change the height, it always stops at exactly the end of the scale as shown below. I have tried changing ContentResizeMode without any difference observed.

image

The legend height is calculated by the items within it. You can set the Footer to add some space at the bottom, and for each item (including Header and Foot), You can set its height, or you can set TopPadding and BottomPadding to have some space between.

I have found that you must set footer to a new LegendItem and if you try and do it before adding other legend items you get a null reference. I think this is a bug. You should have a footer by default and you should not have to initialize it. In fact the default footer height is 25 which was sufficient.

I am happy though that height is set automatically. I can now remove a lot of code where I was doing this manually.

image