Example #1
0
        private void GetAllSummaries(GroupInfo i_GroupInfo, ref GroupSummaryCollection summaries)
        {
            int m_Rows = i_GroupInfo.GetGroupedRows();

            if (i_GroupInfo.GroupResults != null)
            {            //sort group result
                if (!(i_GroupInfo is SectionGroupInfo))
                {
                    i_GroupInfo.GroupResults.Sort(i_GroupInfo.Sorting, i_GroupInfo.SortingBy);
                }
            }

            for (int m_row = 0; m_row < m_Rows; m_row++)                //The last row is for the total value.
            {
                GroupResult m_GroupResult = i_GroupInfo.GroupResults[m_row];

                if (m_GroupResult.Summaries != null && m_GroupResult.SubGroupInfos.Count == 0)
                {
                    foreach (GroupSummary summary in m_GroupResult.Summaries)
                    {
                        summaries.Add(summary);
                    }
                }

                if (m_GroupResult.SubGroupInfos.Count > 0)
                {
                    this.GetAllSummaries(m_GroupResult.SubGroupInfos[0], ref summaries);
                }
            }
        }
Example #2
0
        public void AddSummaries(ChartSeriesCollection series)
        {
            GroupInfo leafGroupInfo = this.GetLeafGroupInfo();

            GroupSummaryCollection summaries = series.CreateSummaies(this._StatType);

            leafGroupInfo.Summaries = summaries.CopyStructure();
        }
Example #3
0
        public GroupSummaryCollection CreateSummaies(SummaryTypes type)
        {
            GroupSummaryCollection collection = new GroupSummaryCollection();

            foreach (ChartSeries chartSeries in this)
            {
                collection.Add(chartSeries.CreateSummary(type));
            }

            return(collection);
        }
        //05-09-2008@Scott
        private void GetTotalSummaries(GroupSummaryCollection totalSummaries)
        {
            FieldGroupInfo rootGroupInfo = null;

            if (this.RootGroupInfo is SectionGroupInfo)
            {
                rootGroupInfo = this.RootGroupInfo.GroupResults[0].SubGroupInfos[0] as FieldGroupInfo;
            }
            else
            {
                rootGroupInfo = this.RootGroupInfo as FieldGroupInfo;
            }

            rootGroupInfo.GetTotalSummaries(totalSummaries, rootGroupInfo);
        }
Example #5
0
        private void DrawBars(Graphics g, Rectangle rect)
        {
            GroupSummaryCollection summaries = new GroupSummaryCollection();

            GetAllSummaries(this._RootGroupInfo, ref summaries);

            int nColumns = this.GetColumns();

            double maxValue = this.GetMaxValue();

            double ratio = rect.Height / maxValue / 1.2;

            double groupWidth = (double)rect.Width / nColumns;

            double barWidth = groupWidth / this._Series.Count * 0.8;

            double offset = 0, height = 0;

            string value = string.Empty;

            for (int i = 0; i < summaries.Count; i++)
            {
                try
                {
                    height = Convert.ToDouble(summaries[i].Value) * ratio;

                    value = summaries[i].Value.ToString();
                }
                catch
                {
                    height = 0;
                }

                int nSeriesID = summaries[i].SummaryID % this._Series.Count;

                if (nSeriesID == 0)
                {
                    offset += groupWidth * 0.1;
                }

                Brush brush = new SolidBrush(this._Series[nSeriesID].BackColor);

                Pen penBorder = new Pen(this._Series[nSeriesID].BorderColor);

                Color clrText = this._Series[nSeriesID].TextColor;

                RectangleF rectF = RectangleF.Empty;

                if (height < 0)
                {
                    rectF = new RectangleF(new PointF((float)(rect.Left + offset), rect.Bottom), new SizeF((float)barWidth, (float)(-1 * height)));
                }
                else
                {
                    rectF = new RectangleF(new PointF((float)(rect.Left + offset), rect.Bottom - (float)height), new SizeF((float)barWidth, (float)height));
                }

                g.FillRectangle(brush, rectF);                  //draw bar

                this.DrawRectangleF(g, penBorder, rectF);       //draw border

                this.SetColWithClickEvent(i + 1, rectF, summaries[i].RowIndicators);

                this.DrawBarValue(g, rectF, clrText, value);

                if (nSeriesID == this._Series.Count - 1)
                {
                    offset += groupWidth * 0.1;
                }

                offset += barWidth;
            }
        }
Example #6
0
        private void CreateClickAreaForBarChart(string areaName, IBrickGraphics graph)
        {
            //Draw Transparent Bars Brick
            WebbTableCell m_cell = null;

            TextBrick m_brick = null;

            int m_row = 0, m_col = 0;

            Rectangle rect = this.GetChartRect(new Rectangle(new Point(0, 0), new Size(this.ControlWidth, this.ControlHeight)), this.AppearanceType);

            GroupSummaryCollection summaries = new GroupSummaryCollection();

            GetAllSummaries(this._RootGroupInfo, ref summaries);

            int nColumns = this.GetColumns();

            double maxValue = this.GetMaxValue();

            double ratio = rect.Height / maxValue / 1.2;

            double groupWidth = (double)rect.Width / nColumns;

            double barWidth = groupWidth / this._Series.Count * 0.8;

            double offset = 0, height = 0;

            string value = string.Empty;

            for (m_col = 1; m_col < this.PrintingTable.GetColumns(); m_col++)
            {
                try
                {
                    height = Convert.ToDouble(summaries[m_col - 1].Value) * ratio;

                    value = summaries[m_col - 1].Value.ToString();
                }
                catch
                {
                    height = 0;
                }

                int nSeriesID = summaries[m_col - 1].SummaryID % this._Series.Count;

                if (nSeriesID == 0)
                {
                    offset += groupWidth * 0.1;
                }

                Brush brush = new SolidBrush(this._Series[nSeriesID].BackColor);

                Pen penBorder = new Pen(this._Series[nSeriesID].BorderColor);

                Color clrText = this._Series[nSeriesID].TextColor;

                RectangleF rectF = RectangleF.Empty;

                if (height < 0)
                {
                    rectF = new RectangleF(new PointF((float)(rect.Left + offset), rect.Bottom), new SizeF((float)barWidth, (float)(-1 * height)));
                }
                else
                {
                    rectF = new RectangleF(new PointF((float)(rect.Left + offset), rect.Bottom - (float)height), new SizeF((float)barWidth, (float)height));
                }

                m_cell = this.PrintingTable.GetCell(m_row, m_col) as WebbTableCell;

                m_brick = m_cell.CreateTextBrick();

                if (m_cell.ClickEventArg != null)
                {
                    m_brick.MouseDown += new MouseEventHandler(Webb.Reports.DataProvider.VideoPlayBackManager.OnBrickDown);
                    m_brick.MouseUp   += new MouseEventHandler(Webb.Reports.DataProvider.VideoPlayBackManager.OnBrickUp);
                    m_brick.OnClick   += new EventHandler(m_cell.ClickHandler);
                    m_brick.Url        = "http://www.webbelectronics.com/";
                }

                rectF.Offset(this.PrintingTable.Offset.Width, this.PrintingTable.Offset.Height);

                graph.DrawBrick(m_brick, rectF);

                if (nSeriesID == this._Series.Count - 1)
                {
                    offset += groupWidth * 0.1;
                }

                offset += barWidth;
            }
        }