Example #1
0
        /// <summary>
        /// Returns an initialized and renderer specific rendererInfo.
        /// </summary>
        internal override RendererInfo Init()
        {
            ChartRendererInfo cri = new ChartRendererInfo();

            cri.chart = (Chart)this.rendererParms.DrawingItem;
            this.rendererParms.RendererInfo = cri;

            InitSeriesRendererInfo();

            LegendRenderer lr = GetLegendRenderer();

            cri.legendRendererInfo = (LegendRendererInfo)lr.Init();

            AxisRenderer xar = new VerticalXAxisRenderer(this.rendererParms);

            cri.xAxisRendererInfo = (AxisRendererInfo)xar.Init();

            AxisRenderer yar = GetYAxisRenderer();

            cri.yAxisRendererInfo = (AxisRendererInfo)yar.Init();

            PlotArea         plotArea = cri.chart.PlotArea;
            PlotAreaRenderer renderer = GetPlotAreaRenderer();

            cri.plotAreaRendererInfo = (PlotAreaRendererInfo)renderer.Init();

            DataLabelRenderer dlr = new BarDataLabelRenderer(this.rendererParms);

            dlr.Init();

            return(cri);
        }
Example #2
0
        /// <summary>
        /// Layouts and calculates the space used by the pie chart.
        /// </summary>
        internal override void Format()
        {
            ChartRendererInfo cri = (ChartRendererInfo)this.rendererParms.RendererInfo;

            LegendRenderer lr = new PieLegendRenderer(this.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(this.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)this.rendererParms.RendererInfo;

            LegendRenderer lr = new ColumnLikeLegendRenderer(this.rendererParms);

            lr.Format();

            // axes
            AxisRenderer xar = new HorizontalXAxisRenderer(this.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(this.rendererParms);

            dlr.Format();
        }
Example #4
0
        /// <summary>
        /// Layouts and calculates the space used by the column chart.
        /// </summary>
        internal override void Format()
        {
            ChartRendererInfo cri = (ChartRendererInfo)this.rendererParms.RendererInfo;

            LegendRenderer lr = GetLegendRenderer();

            lr.Format();

            // axes
            AxisRenderer xar = new VerticalXAxisRenderer(this.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(this.rendererParms);

            dlr.Format();
        }
Example #5
0
        /// <summary>
        /// Draws the column chart.
        /// </summary>
        internal override void Draw()
        {
            ChartRendererInfo cri = (ChartRendererInfo)this.rendererParms.RendererInfo;

            LegendRenderer lr = GetLegendRenderer();

            lr.Draw();

            WallRenderer wr = new WallRenderer(this.rendererParms);

            wr.Draw();

            GridlinesRenderer glr = new BarGridlinesRenderer(this.rendererParms);

            glr.Draw();

            PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(this.rendererParms);

            pabr.Draw();

            PlotAreaRenderer renderer = GetPlotAreaRenderer();

            renderer.Draw();

            DataLabelRenderer dlr = new BarDataLabelRenderer(this.rendererParms);

            dlr.Draw();

            if (cri.xAxisRendererInfo.axis != null)
            {
                AxisRenderer xar = new VerticalXAxisRenderer(this.rendererParms);
                xar.Draw();
            }

            if (cri.yAxisRendererInfo.axis != null)
            {
                AxisRenderer yar = GetYAxisRenderer();
                yar.Draw();
            }
        }
Example #6
0
        /// <summary>
        /// Draws the pie chart.
        /// </summary>
        internal override void Draw()
        {
            LegendRenderer lr = new PieLegendRenderer(this.rendererParms);

            lr.Draw();

            WallRenderer wr = new WallRenderer(this.rendererParms);

            wr.Draw();

            PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(this.rendererParms);

            pabr.Draw();

            PlotAreaRenderer renderer = GetPlotAreaRenderer();

            renderer.Draw();

            DataLabelRenderer dlr = new PieDataLabelRenderer(this.rendererParms);

            dlr.Draw();
        }
Example #7
0
        /// <summary>
        /// Returns an initialized and renderer specific rendererInfo.
        /// </summary>
        internal override RendererInfo Init()
        {
            ChartRendererInfo cri = new ChartRendererInfo();

            cri.chart = (Chart)this.rendererParms.DrawingItem;
            this.rendererParms.RendererInfo = cri;

            InitSeries(cri);

            LegendRenderer lr = new PieLegendRenderer(this.rendererParms);

            cri.legendRendererInfo = (LegendRendererInfo)lr.Init();

            PlotArea         plotArea = cri.chart.PlotArea;
            PlotAreaRenderer renderer = GetPlotAreaRenderer();

            cri.plotAreaRendererInfo = (PlotAreaRendererInfo)renderer.Init();

            DataLabelRenderer dlr = new PieDataLabelRenderer(this.rendererParms);

            dlr.Init();

            return(cri);
        }