internal override void Format(Area area, FormatInfo previousFormatInfo) { ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; TextArea textArea = (TextArea)_chart.GetValue("HeaderArea", GV.ReadOnly); formatInfo.FormattedHeader = GetFormattedTextArea(textArea, _chart.Width.Point); textArea = (TextArea)_chart.GetValue("FooterArea", GV.ReadOnly); formatInfo.FormattedFooter = GetFormattedTextArea(textArea, _chart.Width.Point); textArea = (TextArea)_chart.GetValue("LeftArea", GV.ReadOnly); formatInfo.FormattedLeft = GetFormattedTextArea(textArea); textArea = (TextArea)_chart.GetValue("RightArea", GV.ReadOnly); formatInfo.FormattedRight = GetFormattedTextArea(textArea); textArea = (TextArea)_chart.GetValue("TopArea", GV.ReadOnly); formatInfo.FormattedTop = GetFormattedTextArea(textArea, GetTopBottomWidth()); textArea = (TextArea)_chart.GetValue("BottomArea", GV.ReadOnly); formatInfo.FormattedBottom = GetFormattedTextArea(textArea, GetTopBottomWidth()); base.Format(area, previousFormatInfo); formatInfo.ChartFrame = ChartMapper.ChartMapper.Map(_chart); }
Rectangle GetFooterRect() { Area contentArea = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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)); }
Rectangle GetHeaderRect() { Area contentArea = this.renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)this.renderInfo.FormatInfo; XUnit left = contentArea.X; XUnit top = contentArea.Y; XUnit width = contentArea.Width; XUnit height = formatInfo.formattedHeader.InnerHeight; return(new Rectangle(left, top, width, height)); }
Rectangle GetRightRect() { Area contentArea = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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)); }
/// <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)_renderInfo.FormatInfo; XUnit width = _chart.Width.Point; if (formatInfo.FormattedRight != null) { width -= formatInfo.FormattedRight.InnerWidth; } if (formatInfo.FormattedLeft != null) { width -= formatInfo.FormattedLeft.InnerWidth; } return(width); }
internal override void Render() { RenderFilling(); Area contentArea = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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)_chart.GetValue("PlotArea", GV.ReadOnly); if (plotArea != null) { RenderPlotArea(plotArea, GetPlotRect()); } RenderLine(); }
/// <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 = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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; } }
Rectangle GetPlotRect() { Area contentArea = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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)); }
void GetLeftRightVerticalPosition(out XUnit top, out XUnit bottom) { //REM: Line width is still ignored while layouting charts. Area contentArea = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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; } }
Rectangle GetBottomRect() { Area contentArea = _renderInfo.LayoutInfo.ContentArea; ChartFormatInfo formatInfo = (ChartFormatInfo)_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)); }
Rectangle GetTopRect() { 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; if (formatInfo.formattedHeader != null) { top += formatInfo.formattedHeader.InnerHeight; } XUnit height = formatInfo.formattedTop.InnerHeight; return(new Rectangle(left, top, right - left, height)); }