private void draw4()
{
this.hHippoChart1.SeriesListDictionary.Clear();
SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Column;
Random r = new Random();
for(int i = 0; i < 1; i++)
{
Series sr = new Series();
sr.Line.LineWidth = 4;
sr.Points.Width = 10;
sr.Points.PointType = PointType.FillCircle;
sr.IsLineShadowEffect = true;
for(int x = 0; x < 5; x++)
{
SeriesItem item = new SeriesItem();
item.Name = "item" + x.ToString();
item.YValue = r.Next(9000);
item.Balloon = new Balloon();
item.Balloon.Label.Text = item.YValue.ToString();
item.Balloon.Visible = false;
sr.items.Add(item);
}
sList.SeriesCollection.Add(sr);
}
this.hHippoChart1.SeriesListDictionary.Add(sList);
this.hHippoChart1.DrawChart();
}
private void hHippoChart1_ChartMouseMove(object sender, MouseEventArgs e)
{
for(int i = 0; i < this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items.Count; i++)
{
PointF firstpoint = this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].FigurePoint;
float lastPoX = (float)(firstpoint.X + this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].Column.Width);
float lastPoY = (float)(firstpoint.Y + this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.UnitPixel * this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].YValue);
PointF lastPoint = new PointF(lastPoX, lastPoY);
if (e.X >= firstpoint.X && e.X <= lastPoint.X && e.Y >= firstpoint.Y && e.Y <= lastPoint.Y)
{
this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].Balloon.Visible = true;
this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].ItemColor = Color.YellowGreen;
}
else
{
this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].Balloon.Visible = false;
this.hHippoChart1.SeriesListDictionary[0].SeriesCollection[0].items[i].ItemColor = Color.Empty;
}
}
this.hHippoChart1.DrawChart();
}
Private Sub draw4()
Me.hHippoChart1.SeriesListDictionary.Clear()
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Column
Dim r As New. Random()
For i As Integer = 0 To 0
Dim sr As New. Series()
sr.Line.LineWidth = 4
sr.Points.Width = 10
sr.Points.PointType = PointType.FillCircle
sr.IsLineShadowEffect = True
For x As Integer = 0 To 4
Dim item As New. SeriesItem()
item.Name = "item" & x.ToString()
item.YValue = r.[Next](9000)
item.Balloon = New Balloon()
item.Balloon.Label.Text = item.YValue.ToString()
item.Balloon.Visible = False
sr.items.Add(item)
Next
sList.SeriesCollection.Add(sr)
Next
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.DrawChart()
End Sub
Private Sub hHippoChart1_ChartMouseMove(sender As Object, e As MouseEventArgs)
For i As Integer = 0 To Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items.Count - 1
Dim firstpoint As PointF = Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).FigurePoint
Dim lastPoX As Single = CSng(firstpoint.X + Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).Column.Width)
Dim lastPoY As Single = CSng(firstpoint.Y + Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.UnitPixel * Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).YValue)
Dim lastPoint As New. PointF(lastPoX, lastPoY)
If e.X >= firstpoint.X AndAlso e.X <= lastPoint.X AndAlso e.Y >= firstpoint.Y AndAlso e.Y <= lastPoint.Y Then
Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).Balloon.Visible = True
Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).ItemColor = Color.YellowGreen
Else
Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).Balloon.Visible = False
Me.hHippoChart1.SeriesListDictionary(0).SeriesCollection(0).items(i).ItemColor = Color.Empty
End If
Next
Me.hHippoChart1.DrawChart()
End Sub