Select to view content in your preferred language

ClassBreaksRenderer - Graduated Symbols

970
1
Jump to solution
06-16-2021 03:08 AM
sonj
by
Occasional Contributor

Assigning the Quantities - Graduated Symbols for one field. The TOC is showing an updated symbolize but not in the UI shown in the attached snapshot. 

IClassBreaksRenderer classBreaksRenderer = new ClassBreaksRendererClass();
classBreaksRenderer.Field = "BRNGTRUE";
classBreaksRenderer.BreakCount = classCount;
classBreaksRenderer.MinimumBreak = classBreaks[0];
classBreaksRenderer.SortClassesAscending = true;

IClassBreaksUIProperties classBreaksUIProperties = classBreaksRenderer as IClassBreaksUIProperties;
classBreaksUIProperties.Method = pClassifyGEN.ClassID;


ISymbol simpleMarkerSymbol = GetMarkerSymbol();
IFillSymbol fillSymbol = GetFillSymbol() as IFillSymbol;

classBreaksRenderer.BackgroundSymbol = fillSymbol;

//Through a loop, attach rendering symbol to all rendered levels
for (int i = 0; i < classCount; i++)
{
	////Specify the symbol for hierarchical rendering (Symbol)
	classBreaksRenderer.Symbol[i] = simpleMarkerSymbol;                    
	classBreaksRenderer.Break[i] = classBreaks[i];

	if (i == 0)
	{
		classBreaksUIProperties.LowBreak[i] = classBreaks[i];
		classBreaksRenderer.Label[i] = string.Format("{0}", classBreaks[i]);
	}
	else
	{
		classBreaksUIProperties.LowBreak[i] = classBreaks[i - 1] + 0.000001;
		classBreaksRenderer.Label[i] = string.Format("{0} - {1}", classBreaks[i - 1] + 0.000001, classBreaks[i] + 0.000000);
	}

}

 

sonj_0-1623838035582.png

 

 

0 Kudos
1 Solution

Accepted Solutions
sonj
by
Occasional Contributor

The Legend Info has to update then it will display the symbols correctly. Posting it here may help someone who is looking code snippet.

ILegendInfo legendInfo = classBreaksRenderer as ILegendInfo;
legendInfo.SymbolsAreGraduated = true;

 

View solution in original post

0 Kudos
1 Reply
sonj
by
Occasional Contributor

The Legend Info has to update then it will display the symbols correctly. Posting it here may help someone who is looking code snippet.

ILegendInfo legendInfo = classBreaksRenderer as ILegendInfo;
legendInfo.SymbolsAreGraduated = true;

 

0 Kudos