/// <summary>
        /// Initializes all necessary data to draw all series for a column chart.
        /// </summary>
        internal void InitSeries()
        {
            ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo;

            int seriesIndex = 0;

            foreach (SeriesRendererInfo sri in cri.seriesRendererInfos)
            {
                sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, XColors.Black, DefaultSeriesLineWidth);
                sri.FillFormat = Converter.ToXBrush(sri._series._fillFormat, ColumnColors.Item(seriesIndex++));

                sri._pointRendererInfos = new ColumnRendererInfo[sri._series._seriesElements.Count];
                for (int pointIdx = 0; pointIdx < sri._pointRendererInfos.Length; ++pointIdx)
                {
                    PointRendererInfo pri   = new ColumnRendererInfo();
                    Point             point = sri._series._seriesElements[pointIdx];
                    pri.Point = point;
                    if (point != null)
                    {
                        pri.LineFormat = sri.LineFormat;
                        pri.FillFormat = sri.FillFormat;
                        if (point._lineFormat != null && !point._lineFormat._color.IsEmpty)
                        {
                            pri.LineFormat = Converter.ToXPen(point._lineFormat, sri.LineFormat);
                        }
                        if (point._fillFormat != null && !point._fillFormat._color.IsEmpty)
                        {
                            pri.FillFormat = new XSolidBrush(point._fillFormat._color);
                        }
                    }
                    sri._pointRendererInfos[pointIdx] = pri;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes all necessary data to draw a series for a pie chart.
        /// </summary>
        protected void InitSeries(ChartRendererInfo rendererInfo)
        {
            SeriesCollection seriesColl = rendererInfo._chart.SeriesCollection;

            rendererInfo.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count];
            for (int idx = 0; idx < seriesColl.Count; ++idx)
            {
                SeriesRendererInfo sri = new SeriesRendererInfo();
                rendererInfo.seriesRendererInfos[idx] = sri;
                sri._series = seriesColl[idx];

                sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, XColors.Black, ChartRenderer.DefaultSeriesLineWidth);
                sri.FillFormat = Converter.ToXBrush(sri._series._fillFormat, ColumnColors.Item(idx));

                sri._pointRendererInfos = new SectorRendererInfo[sri._series._seriesElements.Count];
                for (int pointIdx = 0; pointIdx < sri._pointRendererInfos.Length; ++pointIdx)
                {
                    PointRendererInfo pri   = new SectorRendererInfo();
                    Point             point = sri._series._seriesElements[pointIdx];
                    pri.Point = point;
                    if (point != null)
                    {
                        pri.LineFormat = sri.LineFormat;
                        if (point._lineFormat != null && !point._lineFormat._color.IsEmpty)
                        {
                            pri.LineFormat = new XPen(point._lineFormat._color);
                        }
                        if (point._fillFormat != null && !point._fillFormat._color.IsEmpty)
                        {
                            pri.FillFormat = new XSolidBrush(point._fillFormat._color);
                        }
                        else
                        {
                            pri.FillFormat = new XSolidBrush(PieColors.Item(pointIdx));
                        }
                        pri.LineFormat.LineJoin = XLineJoin.Round;
                    }
                    sri._pointRendererInfos[pointIdx] = pri;
                }
            }
        }