Hippo.HippoEngine en = new HippoEngine();
en.DataType = DataSourceType.Excel;
en.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`파일경로`;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-04-01"), DateTime.Parse("2012-09-15"), 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;
// 넓이 조절
foreach(Series sr in sList.SeriesCollection)
{
sr.Column.WidthType = ColumnWidthType.Custom;
sr.Column.Width = 15;
}
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[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[1].GanttName.Text = "김철수, 한국진 ";
// 글자 위치 조정
sList.SeriesCollection[0].items[1].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[5].GanttProcess.Label.Font = new Font("굴림", 20, FontStyle.Bold);
sList.SeriesCollection[0].items[5].GanttProcess.Label.ForeColor = Color.SteelBlue;
// 진행율 색상 조정
sList.SeriesCollection[0].items[5].GanttProcess.ProcessColor = Color.Green;
sList.SeriesCollection[0].ArrowLine.LineWidth = 1;
sList.SeriesCollection[0].ArrowLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
sList.SeriesCollection[0].ArrowLine.LineColor = Color.Red;
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();
Dim en As Hippo.HippoEngine = New HippoEngine()
en.DataType = DataSourceType.Excel
en.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`파일경로`;Extended Properties=`Excel 12.0;HDR=YES`"
en.Query = "select * from [Sheet1$]"
Dim sList As SeriesList = en.GetSeriesListOfGantt(AxisDataType.DateTime,"항목","시작일자","종료일자")
sList.ChartType = ChartType.Gantt
sList.AxisFactor.YAxis.DataType = AxisDataType.DateTime
`스케일 조정
sList.AxisFactor.YAxis.SetAxisStep(DateTime.Parse("2012-04-01"), DateTime.Parse("2012-09-15"), 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
` 넓이 조절
Dim sr As Series
For Each sr In sList.SeriesCollection
sr.Column.WidthType = ColumnWidthType.Custom
sr.Column.Width = 15
Next
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(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(1).GanttName.Text = "김철수, 한국진 "
` 글자 위치 조정
sList.SeriesCollection(0).items(1).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(5).GanttProcess.Label.Font = New Font("굴림", 20, FontStyle.Bold)
sList.SeriesCollection(0).items(5).GanttProcess.Label.ForeColor = Color.SteelBlue
` 진행율 색상 조정
sList.SeriesCollection(0).items(5).GanttProcess.ProcessColor = Color.Green
sList.SeriesCollection(0).ArrowLine.LineWidth = 1
sList.SeriesCollection(0).ArrowLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid
sList.SeriesCollection(0).ArrowLine.LineColor = Color.Red
sList.AxisFactor.Orientation = AxisOrientation.TopLeft
Me.hHippoChart1.Titles.Label.Text = "HIPPOCHART PROJECT SCHEDULES"
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.LegendBox.Visible = False
Me.hHippoChart1.DrawChart()