using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Hippo;
using Hippo.WindowsForm4;
namespace RealTimeSample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Interval = 1000;
SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Line;
sList.AxisFactor.YAxis.SetAxisStep(0, 1200, 200);
// 마커
AxisMarker mk2 = new AxisMarker("상한선", 800);
mk2.TextFormat.Alignment = StringAlignment.Near;
sList.AxisFactor.YAxis.Markers.Add(mk2);
sList.SeriesCollection.Add(new Series());
sList.AxisFactor.XAxis.Interval = 1;
this.hHippoChart1.RealTimeList.Add(new HippoRealTimeAttribute());
this.hHippoChart1.SeriesListDictionary.Add(sList);
}
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
Random rr1 = new Random();
SeriesItem item = new SeriesItem(rr1.Next(999));
if (item.YValue > 800)
{
item.Balloon = new Balloon();
item.Balloon.Label.Text = "상한선 돌파!";
}
this.hHippoChart1.DrawRealTimeChart(20, item);
}
}
}
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports Hippo
Imports Hippo.WindowsForm4
Namespace RealTimeSample
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs)
Me.timer1.Interval = 1000
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Line
sList.AxisFactor.YAxis.SetAxisStep(0, 1200, 200)
` 마커
Dim mk2 As New. AxisMarker("상한선", 800)
mk2.TextFormat.Alignment = StringAlignment.Near
sList.AxisFactor.YAxis.Markers.Add(mk2)
sList.SeriesCollection.Add(New Series())
sList.AxisFactor.XAxis.Interval = 1
Me.hHippoChart1.RealTimeList.Add(New HippoRealTimeAttribute())
Me.hHippoChart1.SeriesListDictionary.Add(sList)
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
Me.timer1.Start()
End Sub
Private Sub timer1_Tick(sender As Object, e As EventArgs)
Dim rr1 As New. Random()
Dim item As New. SeriesItem(rr1.[Next](999))
If item.YValue > 800 Then
item.Balloon = New Balloon()
item.Balloon.Label.Text = "상한선 돌파!"
End If
Me.hHippoChart1.DrawRealTimeChart(20, item)
End Sub
End Class
End Namespace