Пример #1
0
        /// <summary>
        /// Layouts and calculates the space used by the line chart.
        /// </summary>
        internal override void Format()
        {
            ChartRendererInfo cri = (ChartRendererInfo)this.rendererParms.RendererInfo;

            LegendRenderer lr = new ColumnLikeLegendRenderer(this.rendererParms);

            lr.Format();

            // axes
            AxisRenderer xar = new HorizontalXAxisRenderer(this.rendererParms);

            xar.Format();

            AxisRenderer yar = new VerticalYAxisRenderer(this.rendererParms);

            yar.Format();

            // Calculate rects and positions.
            CalcLayout();

            // Calculated remaining plot area, now it's safe to format.
            PlotAreaRenderer renderer = new AreaPlotAreaRenderer(this.rendererParms);

            renderer.Format();
        }
Пример #2
0
        /// <summary>
        /// Layouts and calculates the space used by the combination chart.
        /// </summary>
        internal override void Format()
        {
            CombinationRendererInfo cri = (CombinationRendererInfo)this.rendererParms.RendererInfo;

            cri.seriesRendererInfos = cri.commonSeriesRendererInfos;

            LegendRenderer lr = new ColumnLikeLegendRenderer(this.rendererParms);

            lr.Format();

            // axes
            AxisRenderer xar = new HorizontalXAxisRenderer(this.rendererParms);

            xar.Format();

            AxisRenderer yar = new VerticalYAxisRenderer(this.rendererParms);

            yar.Format();

            // Calculate rects and positions.
            XRect chartRect = LayoutLegend();

            cri.xAxisRendererInfo.X         = chartRect.Left + cri.yAxisRendererInfo.Width;
            cri.xAxisRendererInfo.Y         = chartRect.Bottom - cri.xAxisRendererInfo.Height;
            cri.xAxisRendererInfo.Width     = chartRect.Width - cri.yAxisRendererInfo.Width;
            cri.yAxisRendererInfo.X         = chartRect.Left;
            cri.yAxisRendererInfo.Y         = chartRect.Top;
            cri.yAxisRendererInfo.Height    = chartRect.Height - cri.xAxisRendererInfo.Height;
            cri.plotAreaRendererInfo.X      = cri.xAxisRendererInfo.X;
            cri.plotAreaRendererInfo.Y      = cri.yAxisRendererInfo.InnerRect.Y;
            cri.plotAreaRendererInfo.Width  = cri.xAxisRendererInfo.Width;
            cri.plotAreaRendererInfo.Height = cri.yAxisRendererInfo.InnerRect.Height;

            // Calculated remaining plot area, now it's safe to format.
            PlotAreaRenderer renderer;

            if (cri.areaSeriesRendererInfos != null)
            {
                cri.seriesRendererInfos = cri.areaSeriesRendererInfos;
                renderer = new AreaPlotAreaRenderer(this.rendererParms);
                renderer.Format();
            }
            if (cri.columnSeriesRendererInfos != null)
            {
                cri.seriesRendererInfos = cri.columnSeriesRendererInfos;
                //TODO Check for Clustered- or StackedPlotAreaRenderer
                renderer = new ColumnClusteredPlotAreaRenderer(this.rendererParms);
                renderer.Format();
            }
            if (cri.lineSeriesRendererInfos != null)
            {
                cri.seriesRendererInfos = cri.lineSeriesRendererInfos;
                renderer = new LinePlotAreaRenderer(this.rendererParms);
                renderer.Format();
            }

            // Draw data labels.
            if (cri.columnSeriesRendererInfos != null)
            {
                cri.seriesRendererInfos = cri.columnSeriesRendererInfos;
                DataLabelRenderer dlr = new ColumnDataLabelRenderer(this.rendererParms);
                dlr.Format();
            }
        }