ae基于面要素生成柱状图

Posted on 2017-11-20 14:56  云起  阅读(15)  评论(0)    收藏  举报  来源

            IFeatureLayer fl = axMapControl1.get_Layer(0) as IFeatureLayer;
            IGeoFeatureLayer pGeoFeatLyr = fl as IGeoFeatureLayer;

            //用DataStatistics对象,得到两个字段最大值的较大值(最大)
            double p1, p2, max;
            ICursor pCursor = (ICursor)pGeoFeatLyr.Search(null, true);
            IDataStatistics pDataStatistics = new DataStatisticsClass();
            pDataStatistics.Cursor = pCursor;
            pDataStatistics.Field = "POP1990";
            p1 = pDataStatistics.Statistics.Maximum;
            pCursor = (ICursor)pGeoFeatLyr.Search(null, true);
            pDataStatistics.Cursor = pCursor;
            pDataStatistics.Field = "POP2000";
            p2 = pDataStatistics.Statistics.Maximum;
            max = p1 > p2 ? p1 : p2;

            //以下生成好三个SimpleFillSymbol,留作后用
            ISimpleFillSymbol pSimpleFillSymbol = new SimpleFillSymbolClass();
        

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3