SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Gantt;
sList.IsShow3D = true;
Random r = new Random();
for(int i = 0; i < 2; i++)
{
Series sr = new Series();
for(int x = 0; x < 5; x++)
{
SeriesItem item = new SeriesItem();
item.Name = "plan" + x.ToString();
if (i == 0)
{
if (x > 2)
{
item.YValue = r.Next(60, 400);
item.YStartValue = r.Next(0, 50);
}
else
{
item.YValue = r.Next(60, 100);
item.YStartValue = r.Next(0, 50);
}
}
else
{
if (x > 2)
{
break;
}
item.YValue = r.Next(170, 350);
item.YStartValue = r.Next(100, 150);
}
sr.items.Add(item);
}
sList.SeriesCollection.Add(sr);
}
this.hHippoChart1.SeriesListDictionary.Add(sList);
this.hHippoChart1.DrawChart();
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Gantt
sList.IsShow3D = True
Dim r As New. Random()
For i As Integer = 0 To 1
Dim sr As New. Series()
For x As Integer = 0 To 4
Dim item As New. SeriesItem()
item.Name = "plan" & x.ToString()
If i = 0 Then
If x > 2 Then
item.YValue = r.[Next](60, 400)
item.YStartValue = r.[Next](0, 50)
Else
item.YValue = r.[Next](60, 100)
item.YStartValue = r.[Next](0, 50)
End If
Else
If x > 2 Then
Exit For
End If
item.YValue = r.[Next](170, 350)
item.YStartValue = r.[Next](100, 150)
End If
sr.items.Add(item)
Next
sList.SeriesCollection.Add(sr)
Next
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.DrawChart()