Profile Picture

WPF HitTesting on Stock Candle/Bar Data?

Posted By 3 Years Ago
Author
Message
Question Posted 3 Years 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: 2 Years Ago
Posts: 0, Visits: 78
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 3 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746

  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