Esempio n. 1
0
        public LJJSPoint LegendAreaBuild()
        {
            LJJSPoint     ptStart;
            List <string> tmplengendlist = new List <string>();

            double    xstart   = DrawCommonData.xStart;
            double    ystart   = DrawCommonData.yStart;
            LJJSPoint returnpt = new LJJSPoint(xstart, ystart + DrawCommonData.DirectionUp * FrameDesign.LineRoadTitleBarHeigh);

            if (FrameDesign.IfAddLegend)
            {
                LegendDrawStyle drawstyle = EnumUtil.GetEnumByStr(FrameDesign.LegendStyle, LegendDrawStyle.NoOutFrame);
                LegendPosStyle  drawpos   = EnumUtil.GetEnumByStr(FrameDesign.LegendPos, LegendPosStyle.BottomPos);

                int    colcount        = FrameDesign.LegendColumnNum;
                double legendunitheigh = FrameDesign.LegendUnitHeigh;
                if (drawpos == LegendPosStyle.TopPos)
                {
                    ptStart = new LJJSPoint(xstart, ystart + DrawCommonData.DirectionUp * FrameDesign.LineRoadTitleBarHeigh);
                }
                else
                {
                    ptStart = new LJJSPoint(xstart, ystart + DrawCommonData.DirectionDown * FrameDrawImpl.FrameHeight);
                }
                SetLegendList();

                foreach (string symbolstr in legendLst)
                {
                    if (FillSymbolCode.SymbolCodeClassHt.Contains(symbolstr))
                    {
                        tmplengendlist.Add(symbolstr);
                    }
                }
                legendLst.Clear();
                foreach (string tmpsymbolstr in tmplengendlist)
                {
                    legendLst.Add(tmpsymbolstr);
                }

                if (legendLst.Count > 0)
                {
                    LegendDrawing legenddraw = new LegendDrawing(ptStart, legendLst, colcount, legendunitheigh, drawpos, drawstyle, FrameDrawImpl.FrameWidth);
                    legenddraw.AddLegendToFigure();
                    if (drawpos == LegendPosStyle.TopPos)
                    {
                        returnpt = legenddraw.ptStart;
                    }
                }
            }



            return(returnpt);
        }
Esempio n. 2
0
 public LegendDrawing(LJJSPoint ptStart, List <string> legendList, int legendColumn, double legendUnitHeigh, LegendPosStyle legendPos, LegendDrawStyle legendDrawStyle, double outFrameWidth)
 {
     _ptstart    = ptStart;
     _legendlist = legendList;
     _legendpos  = legendPos;
     if (legendUnitHeigh > 0)
     {
         _legendunitheigh = legendUnitHeigh;
     }
     _legendcolumn    = legendColumn;
     _legenddrawstyle = legendDrawStyle;
     _outframewidth   = outFrameWidth;
     symbolOperHt     = GetSymbolOperHt(_legendlist);
     legendrownum     = GetLegendRowsCount(_legendcolumn);
     if (_legendcolumn > 0)
     {
         legendunitwidth = _outframewidth / _legendcolumn;
     }
 }
Esempio n. 3
0
        private LJJSPoint GetLegendptStart(double xstart, double ystart, LegendPosStyle legendPos, LegendDrawStyle legendDrawStyle)
        {
            LJJSPoint ptstart;

            if (legendDrawStyle == LegendDrawStyle.HaveOutFrame)
            {
                if (legendPos == LegendPosStyle.BottomPos)
                {
                    ptstart = new LJJSPoint(xstart, ystart);
                }
                else
                {
                    ptstart = new LJJSPoint(xstart, ystart + (legendrownum * _legendunitheigh) * 2);
                }
            }
            else
            {
                legmaxwidth = GetLegendMaxWidth(symbolOperHt);
                double legoutframewidth = (noframecolspace + legmaxwidth + noframelegtxtwidth + noframetxtvslegspace) * _legendcolumn - noframecolspace;
                double ptstartX         = xstart + (_outframewidth - legoutframewidth) / 2;
                if (legendPos == LegendPosStyle.TopPos)
                {
                    ptstart = new LJJSPoint(ptstartX, ystart + legendrownum * _legendunitheigh + _NoframeLegendVSTitleHeigh);
                }
                else
                {
                    ptstart = new LJJSPoint(ptstartX, ystart - _NoframeLegendVSTitleHeigh);
                }
            }
            return(ptstart);
        }