Exemplo n.º 1
0
    /// <summary>
    /// Initializes all necessary data to draw all series for a column chart.
    /// </summary>
    private void InitSeriesRendererInfo()
    {
      ChartRendererInfo cri = (ChartRendererInfo)this.rendererParms.RendererInfo;

      SeriesCollection seriesColl = cri.chart.SeriesCollection;
      cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count];
      // Lowest series is the first, like in Excel 
      for (int idx = 0; idx < seriesColl.Count; ++idx)
      {
        SeriesRendererInfo sri = new SeriesRendererInfo();
        sri.series = seriesColl[idx];
        cri.seriesRendererInfos[idx] = sri;
      }

      InitSeries();
    }
Exemplo n.º 2
0
 /// <summary>
 /// Draws all markers given in rendererInfo at the positions specified by points.
 /// </summary>
 void DrawMarker(XGraphics graphics, XPoint[] points, SeriesRendererInfo rendererInfo)
 {
     foreach (XPoint pos in points)
         MarkerRenderer.Draw(graphics, pos, rendererInfo._markerRendererInfo);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes all necessary data to draw series for a combination chart.
 /// </summary>
 private void InitSeriesRendererInfo()
 {
     CombinationRendererInfo cri = (CombinationRendererInfo)_rendererParms.RendererInfo;
     SeriesCollection seriesColl = cri._chart.SeriesCollection;
     cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count];
     for (int idx = 0; idx < seriesColl.Count; ++idx)
     {
         SeriesRendererInfo sri = new SeriesRendererInfo();
         sri._series = seriesColl[idx];
         cri.seriesRendererInfos[idx] = sri;
     }
 }
Exemplo n.º 4
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;
                }
            }
        }