프로젝트간트차트샘플.xlsx

 

 

c# Code

 

 Hippo.HippoEngine en = new HippoEngine();
            en.DataType = DataSourceType.Excel;
            en.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\Users\neohippo\Dropbox\Projects\_Hippochart\Hippo 4.1\Hippo Chart 2010 4\HippoChartBeta\WindowsHippoTest\프로젝트간트차트샘플.xlsx';Extended Properties='Excel 12.0;HDR=YES'";
            en.Query = "select * from [Sheet1$]";

            SeriesList sList = en.GetSeriesListOfGantt(AxisDataType.DateTime, "항목", "시작일자", "종료일자");

            sList.ChartType = ChartType.Gantt;
            sList.AxisFactor.YAxis.DataType = AxisDataType.DateTime;
            sList.AxisFactor.YAxis.SetAxisStep(DateTime.Parse("2012-03-01"), DateTime.Parse("2012-09-30"), 15);
            sList.AxisFactor.YAxis.DateTimeFormat = "MM-dd";

            sList.AxisFactor.XAxis.Interval = 1;
            sList.AxisFactor.XAxis.LabelFormat = new StringFormat();
            sList.AxisFactor.XAxis.LabelFormat.LineAlignment = StringAlignment.Center;
            sList.AxisFactor.XAxis.LabelFormat.Alignment = StringAlignment.Near;
            sList.AxisFactor.XAxis.IsShowTick = false;
            sList.AxisFactor.XAxis.Font = new Font("굴림", 9, FontStyle.Regular);

            AxisMarker mk = new AxisMarker("Start Project", DateTime.Parse("2012-04-01"));
            mk.BringToFront = true;
            mk.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical;
            mk.TextFormat.LineAlignment = StringAlignment.Near;
            mk.TextFormat.Alignment = StringAlignment.Far;
            mk.Line.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            mk.Line.LineColor = Color.Red;
            mk.Line.LineWidth = 1;
            mk.Label.ForeColor = Color.Red;
            sList.AxisFactor.YAxis.Markers.Add(mk);

            AxisMarker mk2 = new AxisMarker("Today", DateTime.Parse("2012-07-11"));
            mk2.BringToFront = true;
            mk2.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical;
            mk2.TextFormat.LineAlignment = StringAlignment.Near;
            mk2.TextFormat.Alignment = StringAlignment.Far;
            mk2.Line.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
            mk2.Line.LineColor = Color.Blue;
            mk2.Line.LineWidth = 1;
            mk2.Label.ForeColor = Color.Blue;
            sList.AxisFactor.YAxis.Markers.Add(mk2);

            sList.SeriesCollection[0].items[0].IsMilestone = true;
            sList.SeriesCollection[0].items[9].IsMilestone = true;
            sList.SeriesCollection[0].items[15].IsMilestone = true;

            sList.SeriesCollection[0].items[2].IsGroupBoss = true;
            sList.SeriesCollection[0].items[5].IsGroupBoss = true;
            sList.SeriesCollection[0].items[11].IsGroupBoss = true;

            //sList.SeriesCollection[0].items[1].ItemColor = Color.Red;

            //sList.SeriesCollection[0].items[2].ItemColor = Color.FromArgb(107, 202, 102);
            //sList.SeriesCollection[0].items[3].ItemColor = Color.FromArgb(107, 202, 102);
            //sList.SeriesCollection[0].items[4].ItemColor = Color.FromArgb(107, 202, 102);

            //sList.SeriesCollection[0].items[5].ItemColor = Color.FromArgb(74, 126, 225);
            //sList.SeriesCollection[0].items[6].ItemColor = Color.FromArgb(74, 126, 225);
            //sList.SeriesCollection[0].items[7].ItemColor = Color.FromArgb(74, 126, 225);
            //sList.SeriesCollection[0].items[8].ItemColor = Color.FromArgb(74, 126, 225);
            //sList.SeriesCollection[0].items[10].ItemColor = Color.FromArgb(74, 126, 225);

            //sList.SeriesCollection[0].items[11].ItemColor = Color.FromArgb(140, 202, 249);
            //sList.SeriesCollection[0].items[12].ItemColor = Color.FromArgb(140, 202, 249);
            //sList.SeriesCollection[0].items[13].ItemColor = Color.FromArgb(140, 202, 249);

            //sList.SeriesCollection[0].items[14].ItemColor = Color.Yellow;
            //sList.SeriesCollection[0].items[15].ItemColor = Color.Red;

            sList.SeriesCollection[0].Column.WidthType = ColumnWidthType.Custom;
            sList.SeriesCollection[0].Column.Width = 15;

            sList.SeriesCollection[0].items[2].ParentIndex = 8;
            sList.SeriesCollection[0].items[4].ParentIndex = 5;
            sList.SeriesCollection[0].items[5].ParentIndex = 13;

            sList.SeriesCollection[0].items[6].ParentIndex = 9;
            sList.SeriesCollection[0].items[7].ParentIndex = 9;
            sList.SeriesCollection[0].items[8].ParentIndex = 9;
            sList.SeriesCollection[0].items[9].ParentIndex = 10;

            sList.SeriesCollection[0].items[14].ParentIndex = 15;
 
            sList.SeriesCollection[0].items[2].GanttName.Text = "배용준 장근석";
            sList.SeriesCollection[0].items[5].GanttName.Text = "장동건 정우성 전지현 김창준";
            sList.SeriesCollection[0].items[11].GanttName.Text = "김태희 한석규 ";
 
            sList.SeriesCollection[0].items[2].GanttProcess.TextLocation = StringAlignment.Far;
            sList.SeriesCollection[0].items[5].GanttProcess.TextLocation = StringAlignment.Far;
            sList.SeriesCollection[0].items[11].GanttProcess.TextLocation = StringAlignment.Far;

            sList.SeriesCollection[0].items[4].GanttProcess.Percent = 1;

            sList.SeriesCollection[0].items[5].GanttProcess.Percent = (1 + 0.79 + 0.8 + 0.23) / 4;
            sList.SeriesCollection[0].items[6].GanttProcess.Percent = 1;
            sList.SeriesCollection[0].items[7].GanttProcess.Percent = 0.79;
            sList.SeriesCollection[0].items[8].GanttProcess.Percent = 0.8;
            sList.SeriesCollection[0].items[10].GanttProcess.Percent = 0.23;

            //sList.SeriesCollection[0].items[0].GanttProcess.ProcessColor = Color.FromArgb(140, 202, 249);
            //sList.SeriesCollection[0].items[1].GanttProcess.ProcessColor = Color.FromArgb(107, 202, 102);
            //sList.SeriesCollection[0].items[3].GanttProcess.ProcessColor = Color.Red;

            sList.SeriesCollection[0].ArrowLine.LineWidth = 1;
            sList.SeriesCollection[0].ArrowLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
            sList.SeriesCollection[0].ArrowLine.LineColor = Color.Black;

            sList.AxisFactor.Orientation = AxisOrientation.TopLeft;


            this.hHippoChart1.Titles.Label.Text = "HIPPOCHART PROJECT SCHEDULES";
            this.hHippoChart1.SeriesListDictionary.Add(sList);
            this.hHippoChart1.LegendBox.Visible = false;
            this.hHippoChart1.DrawChart();

 

사업자 정보 표시
히포차트 | 하영대 | 경기도 성남시 수정구 복정동 631-5 401 | 사업자 등록번호 : 129-34-55719 | TEL : 031-751-6673 | Mail : hippochart@gmail.com | 통신판매신고번호 : 제 2010-경기성남-1203호 | 사이버몰의 이용약관 바로가기

Posted by 리바이 병장
,


/* 다음 웹인사이드 로그 분석*/