Graduated Symbols

2661
6
11-15-2012 08:44 AM
MichaelFaulcon1
New Contributor
How do you created an IClassBreaksRenderer that uses "Graduated Symbols"?

I have been able to create one for "Graduated Colors" but have not found the way to programmatically modify this setting.

Thanks
Mike
0 Kudos
6 Replies
RichWawrzonek
Occasional Contributor
If you can succesfully implement a graduated colors renderer then you are almost there. In the IClassBreaksRenderer there is a property for Symbol. Just pass a symbol (which contains the size) into this property for each break index.
0 Kudos
MichaelFaulcon1
New Contributor
I am already setting the size as you have described...

When I open the MXD and look at the layer symbology properties, the "Quantities" Value (Box) shows Graduated Colors.
I am trying the set this to Graduated Symbols.

When I set it in ArcMap, I get the rendering effect that I am looking for.
0 Kudos
RichWawrzonek
Occasional Contributor
Cast your feature layer to the IGeoFeatureLayer interface and set the RendererPropertyPageClassID property to the desired property page.

Example:
//MAKE SURE ARCMAP DISPLAYS THE CORRECT PROPERTY PAGE
            ESRI.ArcGIS.esriSystem.UID pUID = new ESRI.ArcGIS.esriSystem.UIDClass();
            pUID.Value = "esriCarto.GraduatedSymbolPropertyPage";
            <YourGeoFeatureLayer>.RendererPropertyPageClassID = pUID;
0 Kudos
MichaelFaulcon1
New Contributor
The layer symbology properties dialog now opens with the Graduated Symbols item selected.

Only the settings that show when Graduated Colors is selected are being honored (map, toc, legend).

Also, when I alternate clicking between the two options, Graduated Colors shows the symbols that I set thru ArcObjects.
Graduated Symbols is randomly picking a color each time i click on it.

Basically, the sizes and symbols are only being applied to the Graduated Colors configuration.
0 Kudos
MichaelFaulcon1
New Contributor
Adding the following seemed to have fixed my issue ...

IClassBreaksRenderer renderer = new ClassBreaksRendererClass();
ILegendInfo li = (ILegendInfo)renderer;
li.SymbolsAreGraduated = true;

Thanks Rich.
You helped me out a lot.

Mike
0 Kudos
RichWawrzonek
Occasional Contributor
Glad you got it working. That ILegendInfo class can be confusing because it controls the appearance of layers in the TOC and their renderer in the symbology tab. Don't forget to mark this thread as answered.
0 Kudos