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 HippoGraphicsSample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Graphics g;
private void Form1_Load(object sender, EventArgs e)
{
SeriesList sList = new SeriesList();
sList.AxisFactor.BackColor = Color.Lime;
Random r = new Random();
for(int i = 0; i < 1; i++)
{
Series sr = new Series();
sr.Line.LineWidth = 5;
for(int x = 0; x < 9; x++)
{
SeriesItem item = new SeriesItem();
item.Name = x.ToString();
item.YValue = r.Next(90);
sr.items.Add(item);
}
sList.SeriesCollection.Add(sr);
}
this.hHippoChart1.SeriesListDictionary.Add(sList);
this.hHippoChart1.DrawChart();
// 차트 이미지로 그래픽 객체 생성
g = Graphics.FromImage(this.hHippoChart1.ChartImage);
if (g != null)
{
g.DrawString(
"테스트 글자",
new Font("굴림", 20, FontStyle.Italic),
new SolidBrush(Color.Red),
new PointF(this.hHippoChart1.SeriesListDictionary[0].AxisFactor.CoordinateRectangle.Left + 50, this.hHippoChart1.SeriesListDictionary[0].AxisFactor.CoordinateRectangle.Top + 40)
);
g.DrawEllipse(Pens.Red, new Rectangle(300, 150, 80, 80));
this.hHippoChart1.Refresh();
}
}
}
}
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports Hippo
Namespace HippoGraphicsSample
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private g As Graphics
Private Sub Form1_Load(sender As Object, e As EventArgs)
Dim sList As New. SeriesList()
sList.AxisFactor.BackColor = Color.Lime
Dim r As New. Random()
For i As Integer = 0 To 0
Dim sr As New. Series()
sr.Line.LineWidth = 5
For x As Integer = 0 To 8
Dim item As New. SeriesItem()
item.Name = x.ToString()
item.YValue = r.[Next](90)
sr.items.Add(item)
Next
sList.SeriesCollection.Add(sr)
Next
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.DrawChart()
` 차트 이미지로 그래픽 객체 생성
g = Graphics.FromImage(Me.hHippoChart1.ChartImage)
If g IsNot Nothing Then
g.DrawString("테스트 글자", New Font("굴림", 20, FontStyle.Italic), New SolidBrush(Color.Red), New PointF(Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.CoordinateRectangle.Left + 50, Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.CoordinateRectangle.Top + 40))
g.DrawEllipse(Pens.Red, New Rectangle(300, 150, 80, 80))
Me.hHippoChart1.Refresh()
End If
End Sub
End Class
End Namespace