using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Hippo;
namespace RealTimeTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.hHippoChart1.DrawChart();
}
private void button1_Click(object sender, EventArgs e)
{
this.hHippoChart1.DrawChart();
this.timer1.Interval = 100;
SeriesList sList = new SeriesList();
// 축 수동 조절 메소드 방식 지원
sList.AxisFactor.YAxis.SetAxisStep(0, 1000, 100);
// 멀티 시리즈 실시간 차트
sList.SeriesCollection.Add(new Series());
sList.SeriesCollection.Add(new Series());
// x축 단계를 한 단계씩 표시
sList.AxisFactor.XAxis.Interval = 1;
// 두번째 시리즈는 막대차트로 설정
sList.SeriesCollection[1].ChartType = ChartType.Column;
// 실시간 차트 사용시 유지해야할 값 들의 저장소
this.hHippoChart1.RealTimeList.Add(new Hippo.ChartControl.HippoRealTimeAttribute());
this.hHippoChart1.RealTimeList.Add(new Hippo.ChartControl.HippoRealTimeAttribute());
this.hHippoChart1.SeriesListDictionary.Add(sList);
this.timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
Random rr1 = new Random();
SeriesItem item = new SeriesItem(rr1.Next(999));
item.Points = new Points();
item.Points.Width = 4;
item.Name = DateTime.Now.ToString("ss");
SeriesItem item2 = new SeriesItem(rr1.Next(222));
item2.Points = new Points();
item2.Points.Width = 4;
item2.Name = DateTime.Now.ToString("ss");
// 각각의 아이템들을 배열 형식으로 입력, 그리기
this.hHippoChart1.DrawRealTimeChart(20, item, item2);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports Hippo
Namespace RealTimeTest
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Me.hHippoChart1.DrawChart()
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.hHippoChart1.DrawChart()
Me.timer1.Interval = 100
Dim sList As New. SeriesList()
` 축 수동 조절 메소드 방식 지원
sList.AxisFactor.YAxis.SetAxisStep(0, 1000, 100)
` 멀티 시리즈 실시간 차트
sList.SeriesCollection.Add(New Series())
sList.SeriesCollection.Add(New Series())
` x축 단계를 한 단계씩 표시
sList.AxisFactor.XAxis.Interval = 1
` 두번째 시리즈는 막대차트로 설정
sList.SeriesCollection(1).ChartType = ChartType.Column
` 실시간 차트 사용시 유지해야할 값 들의 저장소
Me.hHippoChart1.RealTimeList.Add(New Hippo.ChartControl.HippoRealTimeAttribute())
Me.hHippoChart1.RealTimeList.Add(New Hippo.ChartControl.HippoRealTimeAttribute())
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.timer1.Start()
End Sub
Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
Dim rr1 As New. Random()
Dim item As New. SeriesItem(rr1.[Next](999))
item.Points = New Points()
item.Points.Width = 4
item.Name = DateTime.Now.ToString("ss")
Dim item2 As New. SeriesItem(rr1.[Next](222))
item2.Points = New Points()
item2.Points.Width = 4
item2.Name = DateTime.Now.ToString("ss")
` 각각의 아이템들을 배열 형식으로 입력, 그리기
Me.hHippoChart1.DrawRealTimeChart(20, item, item2)
End Sub
End Class
End Namespace