/// <summary> /// Layouts and calculates the space used by the column chart. /// </summary> internal override void Format() { ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); lr.Format(); // axes AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); xar.Format(); AxisRenderer yar = GetYAxisRenderer(); yar.Format(); // Calculate rects and positions. CalcLayout(); // Calculated remaining plot area, now it's safe to format. PlotAreaRenderer renderer = GetPlotAreaRenderer(); renderer.Format(); DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); dlr.Format(); }
/// <summary> /// Layouts and calculates the space used by the pie chart. /// </summary> internal override void Format() { ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; LegendRenderer lr = new PieLegendRenderer(_rendererParms); lr.Format(); // Calculate rects and positions. XRect chartRect = LayoutLegend(); cri.plotAreaRendererInfo.Rect = chartRect; double edge = Math.Min(chartRect.Width, chartRect.Height); cri.plotAreaRendererInfo.X += (chartRect.Width - edge) / 2; cri.plotAreaRendererInfo.Y += (chartRect.Height - edge) / 2; cri.plotAreaRendererInfo.Width = edge; cri.plotAreaRendererInfo.Height = edge; DataLabelRenderer dlr = new PieDataLabelRenderer(_rendererParms); dlr.Format(); // Calculated remaining plot area, now it's safe to format. PlotAreaRenderer renderer = GetPlotAreaRenderer(); renderer.Format(); dlr.CalcPositions(); }
/// <summary> /// Layouts and calculates the space used by the column chart. /// </summary> internal override void Format() { ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; LegendRenderer lr = GetLegendRenderer(); lr.Format(); // axes AxisRenderer xar = new VerticalXAxisRenderer(_rendererParms); xar.Format(); AxisRenderer yar = GetYAxisRenderer(); yar.Format(); // Calculate rects and positions. XRect chartRect = LayoutLegend(); cri.xAxisRendererInfo.X = chartRect.Left; cri.xAxisRendererInfo.Y = chartRect.Top; cri.xAxisRendererInfo.Height = chartRect.Height - cri.yAxisRendererInfo.Height; cri.yAxisRendererInfo.X = chartRect.Left + cri.xAxisRendererInfo.Width; cri.yAxisRendererInfo.Y = chartRect.Bottom - cri.yAxisRendererInfo.Height; cri.yAxisRendererInfo.Width = chartRect.Width - cri.xAxisRendererInfo.Width; cri.plotAreaRendererInfo.X = cri.yAxisRendererInfo.X; cri.plotAreaRendererInfo.Y = cri.xAxisRendererInfo.Y; cri.plotAreaRendererInfo.Width = cri.yAxisRendererInfo.InnerRect.Width; cri.plotAreaRendererInfo.Height = cri.xAxisRendererInfo.Height; // Calculated remaining plot area, now it's safe to format. PlotAreaRenderer renderer = GetPlotAreaRenderer(); renderer.Format(); DataLabelRenderer dlr = new BarDataLabelRenderer(_rendererParms); dlr.Format(); }