Jump to content
Software FX Community

Hit test


dotnetclassic

Recommended Posts

On Mouse Move e.value is always Zero please help

  Chart1.Data.Clear()
  Chart1.DataSourceSettings.Fields.Clear()
  Chart1.Gallery = Gallery.Candlestick
  Chart1.DataSourceSettings.Fields.Add(New FieldMap("Date", FieldUsage.XValue))
  Chart1.DataSourceSettings.Fields.Add(New FieldMap("Low", FieldUsage.Value))
  Chart1.DataSourceSettings.Fields.Add(New FieldMap("Open", FieldUsage.Value))
  Chart1.DataSourceSettings.Fields.Add(New FieldMap("Close", FieldUsage.Value))
  Chart1.DataSourceSettings.Fields.Add(New FieldMap("High", FieldUsage.Value))
  Chart1.DataSourceSettings.Fields.Add(New FieldMap("Volume", FieldUsage.NotUsed))
  Chart1.DataSource = dw

 

 Private Sub Chart1_MouseMove(ByVal sender As Object, ByVal e As ChartFX.WinForms.HitTestEventArgs) Handles Chart1.MouseMove
 
  ToolStripStatusLabel1.Text = e.Value.ToString
 
  End Sub
 

Link to comment
Share on other sites

Hi, 

In order to obtain the value during mouse move, we would have to perform a HitTest call every time the mouse is moved, which can add substantial overhead and affect performance. For that reason it was not enabled by default. If you need it, all you need ot do is place the call yourself inside the event handler:

void chart1_MouseMove(object sender, ChartFX.WinForms.HitTestEventArgs e)

{

ChartFX.WinForms.HitTestEventArgs hit = chart1.HitTest(e.X, e.Y);double myValue = hit.Value;

}

 

Hope this helps.

 

TT

CFX7_RealTimeWebSample.zip

Link to comment
Share on other sites

 thanx to reply

its working gr8 but on mouse move index is not returning correctly some time.

Some time index on correct index and some time its near index value

 DirectCast(DirectCast(Chart1.DataSource, DataView)(currentPoint)("Volume"), Integer)

like records are

1.value1 date:1/1/2008

2.value2 date:1/2/2008

3.value3 date:1/3/2008

If mouse on 1/2/2008  then some time its return correct value and some time its return value of 1/1/2008

any help????

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...