Exemplo n.º 1
0
        public void createGraph2()
        {
            this.maxValue = estimatedMaxValue * 2;

            int newtotal = 0;
            DiagramPoints.Add(new Point(0,-(Y) + BarLayoutHeight));
            for (int i = 1; i < BarChart.Count; i++)
            {
                newtotal += this.chartValues[i];
                BarChart[i] = new LineBar(i * (this.BarLayoutWidth / BarChart.Count), this.Y, this.BarLayoutWidth / BarChart.Count, this.BarLayoutHeight);
                BarChart[i].valueContent = newtotal;
                double centerXItemPoint = X + i * (this.BarLayoutWidth / BarChart.Count) + (this.BarLayoutWidth / BarChart.Count) / 2;
                double centerYItemPercentPoint = (BarLayoutHeight / 100 * (getPercent(BarChart[i].valueContent)));

                DiagramPoints.Add(new Point(centerXItemPoint, -(centerYItemPercentPoint) + BarLayoutHeight));
            }
            ActualTotal = newtotal;
        }
Exemplo n.º 2
0
        /// <summary>
        /// makes the line graph
        /// </summary>
        public void createGraph()
        {
            for (int i = 0; i < BarChart.Count; i++)
            {
                BarChart[i] = new LineBar(i * (this.BarLayoutWidth / BarChart.Count), this.Y, this.BarLayoutWidth / BarChart.Count, this.BarLayoutHeight);
                BarChart[i].valueContent = this.chartValues[i];
                double centerXItemPoint = X + i * (this.BarLayoutWidth / BarChart.Count) + (this.BarLayoutWidth / BarChart.Count) / 2;
                double centerYItemPercentPoint = (BarLayoutHeight/100 * (getPercent(BarChart[i].valueContent)));

                DiagramPoints.Add(new Point(centerXItemPoint, -(centerYItemPercentPoint) + BarLayoutHeight));
            }
        }