Esempio n. 1
0
        internal override void Format(Area area, FormatInfo previousFormatInfo)
        {
            ChartFormatInfo formatInfo = (ChartFormatInfo)this.renderInfo.FormatInfo;

            TextArea textArea = (TextArea)this.chart.GetValue("HeaderArea", GV.ReadOnly);

            formatInfo.formattedHeader = GetFormattedTextArea(textArea, this.chart.Width.Point);

            textArea = (TextArea)this.chart.GetValue("FooterArea", GV.ReadOnly);
            formatInfo.formattedFooter = GetFormattedTextArea(textArea, this.chart.Width.Point);

            textArea = (TextArea)this.chart.GetValue("LeftArea", GV.ReadOnly);
            formatInfo.formattedLeft = GetFormattedTextArea(textArea);

            textArea = (TextArea)this.chart.GetValue("RightArea", GV.ReadOnly);
            formatInfo.formattedRight = GetFormattedTextArea(textArea);

            textArea = (TextArea)this.chart.GetValue("TopArea", GV.ReadOnly);
            formatInfo.formattedTop = GetFormattedTextArea(textArea, GetTopBottomWidth());

            textArea = (TextArea)this.chart.GetValue("BottomArea", GV.ReadOnly);
            formatInfo.formattedBottom = GetFormattedTextArea(textArea, GetTopBottomWidth());

            base.Format(area, previousFormatInfo);
            formatInfo.chartFrame = ChartMapper.ChartMapper.Map(this.chart);
        }
Esempio n. 2
0
        Rectangle GetFooterRect()
        {
            Area            contentArea = this.renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo  = (ChartFormatInfo)this.renderInfo.FormatInfo;

            XUnit left   = contentArea.X;
            XUnit top    = contentArea.Y + contentArea.Height - formatInfo.formattedFooter.InnerHeight;
            XUnit width  = contentArea.Width;
            XUnit height = formatInfo.formattedFooter.InnerHeight;

            return(new Rectangle(left, top, width, height));
        }
Esempio n. 3
0
        Rectangle GetRightRect()
        {
            Area            contentArea = this.renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo  = (ChartFormatInfo)this.renderInfo.FormatInfo;
            XUnit           top;
            XUnit           bottom;

            GetLeftRightVerticalPosition(out top, out bottom);

            XUnit left  = contentArea.X + contentArea.Width - formatInfo.formattedRight.InnerWidth;
            XUnit width = formatInfo.formattedRight.InnerWidth;

            return(new Rectangle(left, top, width, bottom - top));
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the width of the top and bottom area.
        /// Used while formatting.
        /// </summary>
        /// <returns>The width of the top and bottom area</returns>
        private XUnit GetTopBottomWidth()
        {
            ChartFormatInfo formatInfo = (ChartFormatInfo)this.renderInfo.FormatInfo;
            XUnit           width      = this.chart.Width.Point;

            if (formatInfo.formattedRight != null)
            {
                width -= formatInfo.formattedRight.InnerWidth;
            }
            if (formatInfo.formattedLeft != null)
            {
                width -= formatInfo.formattedLeft.InnerWidth;
            }
            return(width);
        }
Esempio n. 5
0
        internal override void Render()
        {
            RenderFilling();
            Area contentArea = this.renderInfo.LayoutInfo.ContentArea;

            ChartFormatInfo formatInfo = (ChartFormatInfo)this.renderInfo.FormatInfo;

            if (formatInfo.formattedHeader != null)
            {
                RenderArea(formatInfo.formattedHeader, GetHeaderRect());
            }

            if (formatInfo.formattedFooter != null)
            {
                RenderArea(formatInfo.formattedFooter, GetFooterRect());
            }

            if (formatInfo.formattedTop != null)
            {
                RenderArea(formatInfo.formattedTop, GetTopRect());
            }

            if (formatInfo.formattedBottom != null)
            {
                RenderArea(formatInfo.formattedBottom, GetBottomRect());
            }

            if (formatInfo.formattedLeft != null)
            {
                RenderArea(formatInfo.formattedLeft, GetLeftRect());
            }

            if (formatInfo.formattedRight != null)
            {
                RenderArea(formatInfo.formattedRight, GetRightRect());
            }

            PlotArea plotArea = (PlotArea)this.chart.GetValue("PlotArea", GV.ReadOnly);

            if (plotArea != null)
            {
                RenderPlotArea(plotArea, GetPlotRect());
            }

            RenderLine();
        }
Esempio n. 6
0
        /// <summary>
        /// Gets the horizontal boundaries of the top and bottom area.
        /// Used while rendering.
        /// </summary>
        /// <param name="left">The left boundary of the top and bottom area</param>
        /// <param name="right">The right boundary of the top and bottom area</param>
        private void GetTopBottomHorizontalPosition(out XUnit left, out XUnit right)
        {
            Area            contentArea = this.renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo  = (ChartFormatInfo)this.renderInfo.FormatInfo;

            left  = contentArea.X;
            right = contentArea.X + contentArea.Width;

            if (formatInfo.formattedRight != null)
            {
                right -= formatInfo.formattedRight.InnerWidth;
            }
            if (formatInfo.formattedLeft != null)
            {
                left += formatInfo.formattedLeft.InnerWidth;
            }
        }
Esempio n. 7
0
        Rectangle GetPlotRect()
        {
            Area            contentArea = this.renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo  = (ChartFormatInfo)this.renderInfo.FormatInfo;
            XUnit           top         = contentArea.Y;

            if (formatInfo.formattedHeader != null)
            {
                top += formatInfo.formattedHeader.InnerHeight;
            }

            if (formatInfo.formattedTop != null)
            {
                top += formatInfo.formattedTop.InnerHeight;
            }

            XUnit bottom = contentArea.Y + contentArea.Height;

            if (formatInfo.formattedFooter != null)
            {
                bottom -= formatInfo.formattedFooter.InnerHeight;
            }

            if (formatInfo.formattedBottom != null)
            {
                bottom -= formatInfo.formattedBottom.InnerHeight;
            }

            XUnit left = contentArea.X;

            if (formatInfo.formattedLeft != null)
            {
                left += formatInfo.formattedLeft.InnerWidth;
            }

            XUnit right = contentArea.X + contentArea.Width;

            if (formatInfo.formattedRight != null)
            {
                right -= formatInfo.formattedRight.InnerWidth;
            }

            return(new Rectangle(left, top, right - left, bottom - top));
        }
Esempio n. 8
0
        void GetLeftRightVerticalPosition(out XUnit top, out XUnit bottom)
        {
            //REM: Line width is still ignored while layouting charts.
            Area            contentArea = this.renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo  = (ChartFormatInfo)this.renderInfo.FormatInfo;

            top = contentArea.Y;

            if (formatInfo.formattedHeader != null)
            {
                top += formatInfo.formattedHeader.InnerHeight;
            }

            bottom = contentArea.Y + contentArea.Height;
            if (formatInfo.formattedFooter != null)
            {
                bottom -= formatInfo.formattedFooter.InnerHeight;
            }
        }
Esempio n. 9
0
        Rectangle GetBottomRect()
        {
            Area            contentArea = this.renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo  = (ChartFormatInfo)this.renderInfo.FormatInfo;

            XUnit left;
            XUnit right;

            GetTopBottomHorizontalPosition(out left, out right);

            XUnit top = contentArea.Y + contentArea.Height - formatInfo.formattedBottom.InnerHeight;

            if (formatInfo.formattedFooter != null)
            {
                top -= formatInfo.formattedFooter.InnerHeight;
            }

            XUnit height = formatInfo.formattedBottom.InnerHeight;

            return(new Rectangle(left, top, right - left, height));
        }