Jump to content
Software FX Community

Hit testing for axis values in chart tooltip


User (Legacy)

Recommended Posts

I'm using ChartFx for Windows Forms .net v6.2.1342.0 (6.2.1754.19545)

20-Oct-2004.

I would like to modify the chart tooltip when the mouse is over an axis. I

can successfully hook up an event handler on the GetTip event, and do the

hit testing to figure out if the mouse is over the axis of interest:

Protected Overrides Sub OnChartTip(ByVal sender As Object, _

ByVal e As SoftwareFX.ChartFX.GetTipEventArgs)

If e.HitType = HitType.Axis Then

Dim ax As Axis = CType(e.Object, Axis)

Dim sb As StringBuilder = New StringBuilder

sb.Append(ax.Title)

sb.Append(Environment.NewLine)

sb.AppendFormat("Is Y axis {0}", ax.YAxis)

sb.Append(Environment.NewLine)

sb.AppendFormat("Point {0}, Series {1}", e.Point, e.Series)

e.Text = sb.ToString

End If

I want to be able to figure out which label on the axis the mouse is over,

and then display additional information about this value (it's a datetime

axis, and the axis labels show just times; I want the tool tip to show the

date as well as the time, but not clutter the axis labels with both date and

time).

The problem is that the Series and Point prperties are always -1.

Please can you advise.

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...