this.hHippoChart3.SeriesListDictionary.Clear();
SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Column;
Random r = new Random();
Series sr = new Series();
sr.ColumnRangeType = ColumnRangeType.Range;
sr.Column.WidthType = ColumnWidthType.Tight;
double preVal = 17890;
for(int x = 0; x < 50; x++)
{
SeriesItem item = new SeriesItem();
item.Name = x.ToString();
// 가격 증감 폭을 표현
double plusminus = r.Next(1000, 2000);
int pm = 1;
// 가격 증감을 표현
if((x > 17 && x < 32) || x > 43)
{
pm = -1;
}
else
{
pm = 1;
}
int boxsize = 2000;
// 오늘의 종가 결정
double todayEndVal = (preVal + boxsize * pm);
if(pm > 0)
{
if (plusminus >= preVal * 2 / 100)
{
item.YValue = todayEndVal;
item.YStartValue = item.YValue - boxsize;
item.ItemColor = Color.Green;
}
else
{
item.ItemColor = Color.Empty;
}
}
else
{
item.YValue = todayEndVal;
item.YStartValue = item.YValue + boxsize;
item.ItemColor = Color.Red;
}
sr.items.Add(item);
preVal = todayEndVal;
}
sList.SeriesCollection.Add(sr);
this.hHippoChart3.LegendBox.Visible = false;
this.hHippoChart3.SeriesListDictionary.Add(sList);
this.hHippoChart3.DrawChart();
Me.hHippoChart3.SeriesListDictionary.Clear()
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Column
Dim r As New. Random()
Dim sr As New. Series()
sr.ColumnRangeType = ColumnRangeType.Range
sr.Column.WidthType = ColumnWidthType.Tight
Dim preVal As Double = 17890
For x As Integer = 0 To 49
Dim item As New. SeriesItem()
item.Name = x.ToString()
` 가격 증감 폭을 표현
Dim plusminus As Double = r.[Next](1000, 2000)
Dim pm As Integer = 1
` 가격 증감을 표현
If (x > 17 AndAlso x < 32) OrElse x > 43 Then
pm = -1
Else
pm = 1
End If
Dim boxsize As Integer = 2000
` 오늘의 종가 결정
Dim todayEndVal As Double = (preVal + boxsize * pm)
If pm > 0 Then
If plusminus >= preVal * 2 / 100 Then
item.YValue = todayEndVal
item.YStartValue = item.YValue - boxsize
item.ItemColor = Color.Green
Else
item.ItemColor = Color.Empty
End If
Else
item.YValue = todayEndVal
item.YStartValue = item.YValue + boxsize
item.ItemColor = Color.Red
End If
sr.items.Add(item)
preVal = todayEndVal
Next
sList.SeriesCollection.Add(sr)
Me.hHippoChart3.LegendBox.Visible = False
Me.hHippoChart3.SeriesListDictionary.Add(sList)
Me.hHippoChart3.DrawChart()