I have setup 5 levels (colors) of Polygons depending on Population size, Median Income, etc. And I have an associated Legend to go with this. I've created an InMemoryFeatureLayer, and am now trying to automate the ClassBreakStyle with the following code --see below: (It doesn't work, i.e., display "any" polygons), but the code below it does work (the polygons display--but only one color).
Can anyone tell me why my classbreak code doesn't work? (TotalSelected is a column defined for each feature with the value of the Population, etc. of each zip code--InMemoryFeature) Can anyone help me?
ClassBreakStyle Breaks = new ClassBreakStyle("TotalSelected");
for (int j = 0; j < 5; j++)
{
AreaStyle aStyle = new AreaStyle(new GeoPen(GeoColor.StandardColors.Black), new GeoSolidBrush(GeoColor.FromArgb(100, legend.ScaleColors[j])));
Double nLevel = Convert.ToDouble(legend.nScale[j]);
Breaks.ClassBreaks.Add(new ClassBreak(nLevel, aStyle));
}
DetailLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(Breaks);
//But this does work to color the polygons, but their all one color of course.
AreaStyle aStyle = new AreaStyle(new GeoPen(GeoColor.StandardColors.Black), new GeoSolidBrush(GeoColor.FromArgb(100, legend.ScaleColors[3])));
DetailLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(aStyle);