Home 소개       다운로드       온라인 설명서      주식/코인 차트    Q & A     Blog    

Gantt chart







라인마커, 영역마커, 틱 등을 이용해 일정에 대해 설명해 놓은 간트차트




Gantt chart  Gantt chart - multi series  Gantt chart - arrow, process, peoples  간트차트 - 시간/분 스케일  히포차트 4.1 - 간트차트 (마일스톤, 그룹화)  간트차트 좀 더 자세한 설정  히포차트 4.3 - 날짜형 축을 이용한 간트차트 (월별)  히포차트 4.3 - 간트차트(Gantt chart) 마우스 이동하여 날짜 변경하기  


C#
 
SeriesList sList = new SeriesList();
sList.SeriesCollection.Add(new Series());
sList.ChartType = ChartType.Gantt;
sList.AxisFactor.YAxis.DataType = AxisDataType.DateTime;

sList.Gantt.Suffix = "일";

sList.AxisFactor.YAxis.Interval = 10;
sList.AxisFactor.Orientation = AxisOrientation.TopLeft;

AxisMarker mks = new AxisMarker("Start", new DateTime(2009, 1, 10));
mks.Label.Font = new Font("tahoma", 8, FontStyle.Bold);
mks.Label.ForeColor = Color.Black;
mks.Line.LineColor = Color.Transparent;
mks.BringToFront = true;
mks.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical;
mks.TextFormat.LineAlignment = StringAlignment.Near;
mks.TextFormat.Alignment = StringAlignment.Near;
sList.AxisFactor.YAxis.Markers.Add(mks);

AxisMarker mk = new AxisMarker("dead line", new DateTime(2009, 2, 10));
mk.BringToFront = true;
mk.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical;
mk.TextFormat.LineAlignment = StringAlignment.Near;
mk.TextFormat.Alignment = StringAlignment.Near;
sList.AxisFactor.YAxis.Markers.Add(mk);

AxisMarker mk2 = new AxisMarker("Today", DateTime.Now);
mk2.BringToFront = true;
mk2.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical;
mk2.TextFormat.LineAlignment = StringAlignment.Near;
mk2.TextFormat.Alignment = StringAlignment.Near;
mk2.Line.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
mk2.Line.LineColor = Color.Blue;
mk2.Line.LineWidth = 2;
mk2.Label.ForeColor = Color.Blue;
sList.AxisFactor.YAxis.Markers.Add(mk2);

AxisArea are = new AxisArea("집중\r\n개발\r\n기간", new DateTime(2009, 1, 20), new DateTime(2009, 2, 5));
are.BackColor = Color.FromArgb(50, Color.Yellow);
are.BringToFront = true;
are.TextFormat.FormatFlags = StringFormatFlags.DisplayFormatControl;
are.TextFormat.LineAlignment = StringAlignment.Center;
are.TextFormat.Alignment = StringAlignment.Center;
are.Label.Font = new Font("굴림", 11, FontStyle.Bold);
sList.AxisFactor.YAxis.Areas.Add(are);

AxisTick extk = new AxisTick();
extk.DateTimeValue = new DateTime(2009, 2, 10);
extk.Label.Text = "↓";

sList.AxisFactor.YAxis.ExtraTicks.Add(extk);

for(int i = 0; i < 5; i++)
{
sList.SeriesCollection[0].items.Add(new SeriesItem());
sList.SeriesCollection[0].items[i].IsShowFigureText = true;
}

sList.SeriesCollection[0].items[0].YStartDateTimeValue = new DateTime(2009, 1, 10);
sList.SeriesCollection[0].items[0].YDateTimeValue = new DateTime(2009, 1, 17);

sList.SeriesCollection[0].items[1].YStartDateTimeValue = new DateTime(2009, 1, 15);
sList.SeriesCollection[0].items[1].YDateTimeValue = new DateTime(2009, 1, 25);

sList.SeriesCollection[0].items[2].YStartDateTimeValue = new DateTime(2009, 1, 17);
sList.SeriesCollection[0].items[2].YDateTimeValue = new DateTime(2009, 2, 10);

sList.SeriesCollection[0].items[3].YStartDateTimeValue = new DateTime(2009, 2, 10);
sList.SeriesCollection[0].items[3].YDateTimeValue = new DateTime(2009, 2, 18);

sList.SeriesCollection[0].items[4].YStartDateTimeValue = new DateTime(2009, 2, 19);
sList.SeriesCollection[0].items[4].YDateTimeValue = new DateTime(2009, 2, 27);

sList.SeriesCollection[0].items[0].Name = "프로젝트 제안";
sList.SeriesCollection[0].items[1].Name = "DB 및 Framework 설계";
sList.SeriesCollection[0].items[2].Name = "개발 기간";
sList.SeriesCollection[0].items[3].Name = "1차 검수기간";
sList.SeriesCollection[0].items[4].Name = "유지 보수";

Palette p = new Palette();

sList.SeriesCollection[0].items[0].ItemColor = p.DefaultColor1;
sList.SeriesCollection[0].items[1].ItemColor = p.DefaultColor2;
sList.SeriesCollection[0].items[2].ItemColor = p.DefaultColor3;
sList.SeriesCollection[0].items[3].ItemColor = p.DefaultColor4;
sList.SeriesCollection[0].items[4].ItemColor = p.DefaultColor5;

sList.SeriesCollection[0].Column.DesignType = AreaDesignType.Gradation;
sList.SeriesCollection[0].Column.WidthType = ColumnWidthType.Dynamic;

this.hHippoChart1.SeriesListDictionary.Add(sList);
this.hHippoChart1.LegendBox.Visible = false;
this.hHippoChart1.DrawChart();


VB
 
Dim sList As New. SeriesList()
sList.SeriesCollection.Add(New Series())
sList.ChartType = ChartType.Gantt
sList.AxisFactor.YAxis.DataType = AxisDataType.DateTime

sList.Gantt.Suffix = "일"

sList.AxisFactor.YAxis.Interval = 10
sList.AxisFactor.Orientation = AxisOrientation.TopLeft

Dim mks As New. AxisMarker("Start", New DateTime(2009, 1, 10))
mks.Label.Font = New Font("tahoma", 8, FontStyle.Bold)
mks.Label.ForeColor = Color.Black
mks.Line.LineColor = Color.Transparent
mks.BringToFront = True
mks.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical
mks.TextFormat.LineAlignment = StringAlignment.Near
mks.TextFormat.Alignment = StringAlignment.Near
sList.AxisFactor.YAxis.Markers.Add(mks)

Dim mk As New. AxisMarker("dead line", New DateTime(2009, 2, 10))
mk.BringToFront = True
mk.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical
mk.TextFormat.LineAlignment = StringAlignment.Near
mk.TextFormat.Alignment = StringAlignment.Near
sList.AxisFactor.YAxis.Markers.Add(mk)

Dim mk2 As New. AxisMarker("Today", DateTime.Now)
mk2.BringToFront = True
mk2.TextFormat.FormatFlags = StringFormatFlags.DirectionVertical
mk2.TextFormat.LineAlignment = StringAlignment.Near
mk2.TextFormat.Alignment = StringAlignment.Near
mk2.Line.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash
mk2.Line.LineColor = Color.Blue
mk2.Line.LineWidth = 2
mk2.Label.ForeColor = Color.Blue
sList.AxisFactor.YAxis.Markers.Add(mk2)

Dim are As New. AxisArea("집중" & vbCr & vbLf & "개발" & vbCr & vbLf & "기간", New DateTime(2009, 1, 20), New DateTime(2009, 2, 5))
are.BackColor = Color.FromArgb(50, Color.Yellow)
are.BringToFront = True
are.TextFormat.FormatFlags = StringFormatFlags.DisplayFormatControl
are.TextFormat.LineAlignment = StringAlignment.Center
are.TextFormat.Alignment = StringAlignment.Center
are.Label.Font = New Font("굴림", 11, FontStyle.Bold)
sList.AxisFactor.YAxis.Areas.Add(are)

Dim extk As New. AxisTick()
extk.DateTimeValue = New DateTime(2009, 2, 10)
extk.Label.Text = "↓"

sList.AxisFactor.YAxis.ExtraTicks.Add(extk)

For i As Integer = 0 To 4
sList.SeriesCollection(0).items.Add(New SeriesItem())
sList.SeriesCollection(0).items(i).IsShowFigureText = True
Next

sList.SeriesCollection(0).items(0).YStartDateTimeValue = New DateTime(2009, 1, 10)
sList.SeriesCollection(0).items(0).YDateTimeValue = New DateTime(2009, 1, 17)

sList.SeriesCollection(0).items(1).YStartDateTimeValue = New DateTime(2009, 1, 15)
sList.SeriesCollection(0).items(1).YDateTimeValue = New DateTime(2009, 1, 25)

sList.SeriesCollection(0).items(2).YStartDateTimeValue = New DateTime(2009, 1, 17)
sList.SeriesCollection(0).items(2).YDateTimeValue = New DateTime(2009, 2, 10)

sList.SeriesCollection(0).items(3).YStartDateTimeValue = New DateTime(2009, 2, 10)
sList.SeriesCollection(0).items(3).YDateTimeValue = New DateTime(2009, 2, 18)

sList.SeriesCollection(0).items(4).YStartDateTimeValue = New DateTime(2009, 2, 19)
sList.SeriesCollection(0).items(4).YDateTimeValue = New DateTime(2009, 2, 27)

sList.SeriesCollection(0).items(0).Name = "프로젝트 제안"
sList.SeriesCollection(0).items(1).Name = "DB 및 Framework 설계"
sList.SeriesCollection(0).items(2).Name = "개발 기간"
sList.SeriesCollection(0).items(3).Name = "1차 검수기간"
sList.SeriesCollection(0).items(4).Name = "유지 보수"

Dim p As New. Palette()

sList.SeriesCollection(0).items(0).ItemColor = p.DefaultColor1
sList.SeriesCollection(0).items(1).ItemColor = p.DefaultColor2
sList.SeriesCollection(0).items(2).ItemColor = p.DefaultColor3
sList.SeriesCollection(0).items(3).ItemColor = p.DefaultColor4
sList.SeriesCollection(0).items(4).ItemColor = p.DefaultColor5

sList.SeriesCollection(0).Column.DesignType = AreaDesignType.Gradation
sList.SeriesCollection(0).Column.WidthType = ColumnWidthType.Dynamic

Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.LegendBox.Visible = False
Me.hHippoChart1.DrawChart()



※ 히포차트 샘플 코드는 버전별로 상이한 결과를 나타낼 수 있습니다.

이 코드 관련 문의 사항은 페이스북 리플을 달아주시거나 아래 이메일로 이 페이지 주소와 함께 문의주세요.

helpdesk@hippochart.com





Copyright © 2009-2016, HippoChart. Inc.  All Rights Reserved.