private void Form1_Load(object sender, EventArgs e)
{
SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Line;
sList.AxisFactor.YAxis.ExtraTicks.Add(new AxisTick());
Random r = new Random();
for(int i = 0; i < 1; i++)
{
Series sr = new Series();
sr.Line.LineWidth = 2;
sr.Points.Width = 15;
sr.Points.PointType = PointType.FillCircle;
for(int x = 0; x < 5; 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();
}
private void hHippoChart1_ChartMouseMove(object sender, MouseEventArgs e)
{
if (this.hHippoChart1.SeriesListDictionary.Count > 0)
{
double zeroY = this.hHippoChart1.SeriesListDictionary[0].AxisFactor.Zero.Y;
float cY = (float)(zeroY - (e.Y));
// 가로 선
this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.ExtraTicks[0].Value = cY * this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.Interval / this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.UnitPixel;
this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.ExtraTicks[0].BackColor = System.Drawing.Color.Yellow;
this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.ExtraTicks[0].Label.ForeColor = System.Drawing.Color.Black;
double mousrVal = this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.ExtraTicks[0].Value;
this.hHippoChart1.SeriesListDictionary[0].AxisFactor.YAxis.ExtraTicks[0].Label.Text = mousrVal.ToString("n0");
this.hHippoChart1.DrawChart();
}
}
Private Sub Form1_Load(sender As Object, e As EventArgs)
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Line
sList.AxisFactor.YAxis.ExtraTicks.Add(New AxisTick())
Dim r As New. Random()
For i As Integer = 0 To 0
Dim sr As New. Series()
sr.Line.LineWidth = 2
sr.Points.Width = 15
sr.Points.PointType = PointType.FillCircle
For x As Integer = 0 To 4
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()
End Sub
Private Sub hHippoChart1_ChartMouseMove(sender As Object, e As MouseEventArgs)
If Me.hHippoChart1.SeriesListDictionary.Count > 0 Then
Dim zeroY As Double = Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.Zero.Y
Dim cY As Single = CSng(zeroY - (e.Y))
` 가로 선
Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.ExtraTicks(0).Value = cY * Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.Interval / Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.UnitPixel
Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.ExtraTicks(0).BackColor = System.Drawing.Color.Yellow
Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.ExtraTicks(0).Label.ForeColor = System.Drawing.Color.Black
Dim mousrVal As Double = Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.ExtraTicks(0).Value
Me.hHippoChart1.SeriesListDictionary(0).AxisFactor.YAxis.ExtraTicks(0).Label.Text = mousrVal.ToString("n0")
Me.hHippoChart1.DrawChart()
End If
End Sub