Profile Picture

WPF HitTesting on Stock Candle/Bar Data?

Posted By 2 Months Ago
Author
Message
Question Posted 2 Months Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 1 days ago @ 10:51 AM
Posts: 0, Visits: 56
In my WPF code, I'm calling

var hitElement = chartControl.HitTest(mouseEvent.Location.X, mouseEvent.Location.Y);

inside a mouse click handler, and I'm getting a DataPoint hit back correctly. This is working well.

When I click on a data point in a stock series that has OHLC data displayed as a bar or stick, will I be able, through hit testing, have any way of knowing whether the Open, Close, High or Low portion of that data point was clicked?

Nevron Support
Posted 2 Months Ago
View Quick Profile
Supreme Being

Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)Supreme Being (4,088 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 2,960, Visits: 3,352

  Hi,

No unfortunately this information is not available in the hit test result. You can however perform a view to scale transformation:

NChart chart = (NChart)nChartControl1.Charts[0];
NViewToScale2DTransformation view2Scale = new NViewToScale2DTransformation(chart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY);

NVector2DD scalePoint = new NVector2DD();
view2Scale.Transform(new NPointF(e.X, e.Y), ref scalePoint);

and determine how the point is positioned relative to the OHLC range.

We hope this helps - let us know if you have any questions.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic