Select to view content in your preferred language

Legend items not shrinking to frame

7166
9
Jump to solution
08-22-2013 08:18 PM
BenScott1
Deactivated User
I am using flex to call the export web map task with some custom print templates.  I am finding that even when the 'shrink contents to frame' box is ticked in the legend settings, the text of the legend items never reduces in size.  Instead, if you have a fixed legend size and select too many layers for the frame they are left off the legend.

I can see that from 10.1 there is more capability within arcpy.mapping to change the style of legend items than in 10.0, but before I go down that road I wanted to check if there is something I am missing - has anyone got the 'fit contents to frame' option to work?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
HI Ben,

We have logged a new bug. See below:

Bug ID: #NIM095029
Synopsis: The "fit to frame" functionality in legend, misbehaves if a map service is added to the map document.
Status is New.
Workaround: NA.

Hope the development will address it soon. Cheers

View solution in original post

9 Replies
TanuHoque
Esri Regular Contributor
Ben,
it works.. please see attached screen shots to see that legends grows or shrinks based on the size of the legend element on the layout.
i have also attached the settings of the legend element's properties.

-Tanu
0 Kudos
BenScott1
Deactivated User
Hi Tanu,

I am, not sure why there is a difference in the results we are both getting with this.  I have attached some screen shots - as you can see my settings re fix frame appear the same, but when I reduce the size of the legend frame (or tick on more services in the map), layers  are left out of the legend.

Cheers,
Ben

Legend settings:
[ATTACH=CONFIG]26958[/ATTACH]

Mxd - larger legend:
[ATTACH=CONFIG]26959[/ATTACH]

Result in pdf - larger legend:
[ATTACH=CONFIG]26960[/ATTACH]

Mxd - smaller legend:
[ATTACH=CONFIG]26961[/ATTACH]

Result in pdf - smaller legend:
[ATTACH=CONFIG]26962[/ATTACH]
0 Kudos
TanuHoque
Esri Regular Contributor
Ben,
that is expected.
here is an excerpt from the help (http://resources.arcgis.com/en/help/main/10.2/#/Working_with_legends/00s900000023000000/):

"... It is important to remember that this means it will try to make the legend as compact as possible, not that it will try to take up the entire bounding box. Instead of resizing legend item elements to fill the frame; font size, default patch size, and gap measurement values will be used as maximum values. After the entire frame is taken up using these values, legend items will begin to drop....."
0 Kudos
BenScott1
Deactivated User
Thanks Tanu - yes I see what you mean, however, I am still confused by the help text.  The following statements seem to contradict each other:

"if the Fixed Frame option is selected, the frame size will remain fixed, and as legend items are added or removed, they will adjust to fit inside."

and

"Instead of resizing legend item elements to fill the frame; font size, default patch size, and gap measurement values will be used as maximum values. After the entire frame is taken up using these values, legend items will begin to drop."

The first implies that the items will adjust to fit inside the legend as more are added - this is what occured in the example you showed.  The second implies that the font sizes etc remain fixed, and items will drop out as more are added, which is what occurs in my example.  The help text is not clear about when each behaviour occurs.

Just experimenting with adding different layers I think the answer is that the text does not scale when a map service is added - it only scales when a standard desktop layer is added to the map. 

To test this I chose two of our map services.  I opened the two mxds used to create them and grouped the layers in each and exported them to a lyr file - so I had two desktop layers replicating the map services.

See the attached images - the first two show what happens when the desktop layers are added to the legend with fixed frame ticked on.  When the second layer is added the text and patch size is scaled down so that all items fit. 

[ATTACH=CONFIG]27073[/ATTACH]

[ATTACH=CONFIG]27074[/ATTACH]

The second two show what happens when the same thing is done for the corresponding map services.  There is no scaling and the items drop off the legend.

[ATTACH=CONFIG]27075[/ATTACH]

[ATTACH=CONFIG]27076[/ATTACH]


As far as I can see, this means that the "fixed frame" option can not be used in a web application/geoprocessing service application.
0 Kudos
CaitlinHagar
Emerging Contributor

I am having the same issues in 10.2 with getting all of my items into the legend when using "Fixed Frame".  I have tried changing the minimum font size as well but as soon as I shrink the frame, the legend expands the original size and I have to start all over.  I don't have the time to create a new legend and alter it via graphics for each project.  The dynamic legend is a must.

0 Kudos
MichaelVolz
Esteemed Contributor

Can you try making your map somewhat smaller and the legend bigger to be able to fit more items in the legend?  This is what I had to do after exhausting all options in the sizing of legend items.

How many layers are you trying to fit into the legend?

Do you have layers in the legend with multiple symbol classes that require a large amount of legend room?

0 Kudos
CaitlinHagar
Emerging Contributor

I cannot change the the dataframe size because it is US Army standardized.  There are a LOT of items.

0 Kudos
JeffMoulds
Esri Contributor
Ben,

I am trying to reproduce the problem using public map services, and the legend resizing behaviour is the same regardless of whether I am using map service or local feature classes. The last screen shots you sent were from ArcMap 10.1, correct? Can you send me a repro case using publically available map services?
0 Kudos
by Anonymous User
Not applicable
HI Ben,

We have logged a new bug. See below:

Bug ID: #NIM095029
Synopsis: The "fit to frame" functionality in legend, misbehaves if a map service is added to the map document.
Status is New.
Workaround: NA.

Hope the development will address it soon. Cheers