iLegendCount: Integer): Boolean;
//参数依次为 图形,该图层的某一个字段名称,前景色,背景色,图例分级数量
pGeoLayer: IGeoFeatureLayer;
pTable: ITable;
iFieldIndex: Integer;
pRenderer: IProportionalSymbolRenderer;
pQueryFilter: IQueryFilter;
pCursor: ICursor;
pRow: IRow;
pColor: IColor;
pDataStatics: IDataStatistics;
pStaticsResults: IStatisticsResults;
pFillSymbol: ISimpleFillSymbol;
pMarkerSymbol: ISimpleMarkerSymbol;
pSymbol: ISymbol;
sValue: string;
begin
pGeoLayer := pLayer as IGeoFeatureLayer;
pTable := pLayer as ITable;
pRenderer := CoProportionalSymbolRenderer.Create as IProportionalSymbolRenderer;
pQueryFilter := CoQueryFilter.Create as IQueryFilter;
pQueryFilter.AddField(sField);
pCursor := pTable.Search(pQueryFilter, True);
pDataStatics := CoDataStatistics.Create as IDataStatistics;
pDataStatics.Cursor := pCursor;
pDataStatics.Field := sField;
pStaticsResults := pDataStatics.Statistics;
//创建符号
pFillSymbol := CoSimpleFillSymbol.Create as ISimpleFillSymbol;
pFillSymbol.Color := pBackColor;
pMarkerSymbol := CoSimpleMarkerSymbol.Create as ISimpleMarkerSymbol;
pMarkerSymbol.Color := pFrontColor;
pMarkerSymbol.Size := 3;
pMarkerSymbol.Style := esriSMSDiamond;
pRenderer.ValueUnit := esriUnknownUnits;
pRenderer.Field := sField;
pRenderer.MinDataValue := pStaticsResults.Minimum;
pRenderer.MaxDataValue := pStaticsResults.Maximum;
pRenderer.BackgroundSymbol := pFillSymbol;
pRenderer.MinSymbol := pMarkerSymbol as ISymbol;
pRenderer.LegendSymbolCount:= iLegendCount;
pRenderer.CreateLegendSymbols;
pGeoLayer.Renderer := pRenderer as IFeatureRenderer;
Result := True;
end;