private void draw4()
{
this.hHippoChart1.SeriesListDictionary.Clear();
SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Column;
Random r = new Random();
for(int i = 0; i < 5; i++)
{
Series sr = new Series();
for(int x = 0; x < 5; x++)
{
SeriesItem item = new SeriesItem();
item.Name = x.ToString();
item.YValue = r.Next(10, 70);
sr.items.Add(item);
}
sList.SeriesCollection.Add(sr);
}
this.hHippoChart1.DesignType = ChartDesignType.None;
this.hHippoChart1.PaletteType = PaletteType.Bright;
this.hHippoChart1.LegendBox.Visible = false;
this.hHippoChart1.SeriesListDictionary.Add(sList);
this.hHippoChart1.DrawChart();
this.hHippoChart1.SetThemeSeries(Color.Black);
}
bool isDrag = false;
Point startPoint = new Point();
Rectangle theRectangle = new Rectangle();
private void hHippoChart1_ChartMouseMove(object sender, MouseEventArgs e)
{
if (isDrag)
{
ControlPaint.DrawReversibleFrame(theRectangle,
this.BackColor, FrameStyle.Dashed);
Point endPoint = ((Control)sender).PointToScreen(new Point(e.X, e.Y));
int width = endPoint.X - startPoint.X;
int height = endPoint.Y - startPoint.Y;
theRectangle = new Rectangle(startPoint.X,
startPoint.Y, width, height);
ControlPaint.DrawReversibleFrame(theRectangle,
this.BackColor, FrameStyle.Dashed);
}
}
private void hHippoChart1_ChartMouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isDrag = true;
}
Control control = (Control)sender;
startPoint = control.PointToScreen(new Point(e.X, e.Y));
}
private void hHippoChart1_ChartMouseUp(object sender, MouseEventArgs e)
{
isDrag = false;
ControlPaint.DrawReversibleFrame(theRectangle,
this.BackColor, FrameStyle.Dashed);
Rectangle controlRectangle;
for(int i = 0; i < Controls.Count; i++)
{
controlRectangle = Controls[i].RectangleToScreen
(Controls[i].ClientRectangle);
if (controlRectangle.IntersectsWith(theRectangle))
{
Controls[i].BackColor = Color.BurlyWood;
}
}
theRectangle = new Rectangle(0, 0, 0, 0);
}
Private Sub draw4()
Me.hHippoChart1.SeriesListDictionary.Clear()
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Column
Dim r As New. Random()
Dim i As Integer = 0
While i < 5
Dim sr As New. Series()
Dim x As Integer = 0
While x < 5
Dim item As New. SeriesItem()
item.Name = x.ToString()
item.YValue = r.[Next](10, 70)
sr.items.Add(item)
System.Math.Max(System.Threading.Interlocked.Increment(x),x - 1)
End While
sList.SeriesCollection.Add(sr)
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
Me.hHippoChart1.DesignType = ChartDesignType.None
Me.hHippoChart1.PaletteType = PaletteType.Bright
Me.hHippoChart1.LegendBox.Visible = False
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.DrawChart()
Me.hHippoChart1.SetThemeSeries(Color.Black)
End Sub
Private isDrag As Boolean = False
Private startPoint As New. Point()
Private theRectangle As New. Rectangle()
Private Sub hHippoChart1_ChartMouseMove(sender As Object, e As MouseEventArgs)
If isDrag Then
ControlPaint.DrawReversibleFrame(theRectangle, Me.BackColor, FrameStyle.Dashed)
Dim endPoint As Point = (DirectCast(sender, Control)).PointToScreen(New Point(e.X, e.Y))
Dim width As Integer = endPoint.X - startPoint.X
Dim height As Integer = endPoint.Y - startPoint.Y
theRectangle = New Rectangle(startPoint.X, startPoint.Y, width, height)
ControlPaint.DrawReversibleFrame(theRectangle, Me.BackColor, FrameStyle.Dashed)
End If
End Sub
Private Sub hHippoChart1_ChartMouseDown(sender As Object, e As MouseEventArgs)
If e.Button = MouseButtons.Left Then
isDrag = True
End If
Dim control As Control = DirectCast(sender, Control)
startPoint = control.PointToScreen(New Point(e.X, e.Y))
End Sub
Private Sub hHippoChart1_ChartMouseUp(sender As Object, e As MouseEventArgs)
isDrag = False
ControlPaint.DrawReversibleFrame(theRectangle, Me.BackColor, FrameStyle.Dashed)
Dim controlRectangle As Rectangle
Dim i As Integer = 0
While i < Controls.Count
controlRectangle = Controls(i).RectangleToScreen(Controls(i).ClientRectangle)
If controlRectangle.IntersectsWith(theRectangle) Then
Controls(i).BackColor = Color.BurlyWood
End If
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
theRectangle = New Rectangle(0, 0, 0, 0)
End Sub