mcwolf2000
路人甲
路人甲
  • 注册日期2008-02-17
  • 发帖数2
  • QQ
  • 铜币112枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1106回复:0

求救:mapxtreme2005 自定义范围主题图例问题

楼主#
更多 发布于:2008-06-02 10:57
<P>我用自定义范围主题图的图例怎么也不太对,没有标题和副标题,而且尺寸也是不太正确<BR>那位兄弟知道是什么问题?</P>
<P>根据自动生成的图例如图1,样式还是不错的<BR>根据配置生成的图例如图2,颜色和描述都对了,但就是没有标题和副标题,而且尺寸也是不太正确</P>
<P>                                bincount = objbins.Count;<BR>                                thm = new RangedTheme(lyr, themetype, "PMTheme", bincount, </P>
<P>DistributionMethod.CustomRanges);<BR>                                MapInfo.Mapping.Legends.CustomLegendFrameRow[] rw = new CustomLegendFrameRow</P>
<P>[bincount];</P>
<P>                                for (int i = 0; i < bincount; i++)<BR>                                {<BR>                                    thm.Bins.Min = objbins.Attributes["Min"].Value;<BR>                                    thm.Bins.Max = objbins.Attributes["Max"].Value;<BR>                                    string desc = objbins.Attributes["description"].Value;</P>
<P>                                    string color = objbins.Attributes["color"].Value; <BR>                                    SimpleInterior si = new SimpleInterior();<BR>                                    si.ForeColor = GetColor(color);<BR>                                    thm.Bins.Style.AreaStyle.Interior = si;</P>
<P>                                    rw = new MapInfo.Mapping.Legends.CustomLegendFrameRow(new </P>
<P>MapInfo.Styles.CompositeStyle(thm.Bins.Style.AreaStyle), desc + "(" + thm.Bins.Min + "-" + thm.Bins.Max+ </P>
<P>")");<BR>                                }<BR>                           <BR>                            // Set bins,没有值他不会显示<BR>                            thm.Recompute(); //自定义范围必须?</P>
<P>                            //thm.AllowEmptyRanges = true;<BR>                            lyr.Modifiers.Append(thm);</P>
<P>                            //图例部分设置<BR>                            Legend lgd = curmap.Legends.CreateLegend(new Size(240, 180));<BR>                            lgd.Border = true;</P>
<P>                            //lgd.Format = new LegendFormat();<BR>                            //lgd.Format.AutoPositionFrames = true;<BR>                            //lgd.Format.AutoSizeLegend = true;</P>
<P>                            //LegendFrame thmFrame = LegendFrameFactory.CreateThemeLegendFrame(thm);<BR>                             LegendFrame thmFrame = LegendFrameFactory.CreateCustomLegendFrame("name","alias",rw);</P>
<P>                            lgd.Frames.Append(thmFrame);<BR>                            thmFrame.Border = LegendFrameBorder.On;</P>
<P>                            thmFrame.Title = "性能指标:";<BR>                            thmFrame.SubTitle = objthemetitle.InnerText;</P>
<P>                            MapInfo.Styles.Font titleFont1 = new MapInfo.Styles.Font("Arial", 8);<BR>                            titleFont1.ForeColor = Color.DarkBlue;<BR>                            titleFont1.FontWeight = FontWeight.Bold;</P>
<P>                            thmFrame.TitleStyle = titleFont1;<BR>                            thmFrame.SubTitleStyle = titleFont1;</P>
<P>                            MapInfo.Styles.Font rowTextStyle1 = new MapInfo.Styles.Font("Arial", 6);<BR>                            rowTextStyle1.FontWeight = FontWeight.Bold;</P>
<P>                            thmFrame.RowTextStyle = rowTextStyle1;<BR>                            thmFrame.Top = 10;</P>
<P>                            lgd.Size = new Size(200,120);</P>
喜欢0 评分0
游客

返回顶部