I have sent this question before to your email, but you asked me to enter it in this public forum, so that others would benefit from the discussion too.
We are trying to make interactive charts. Our application is simple: we need to display a sorted list of data labels in a separate view and update this sorted list as user moves cross hair cursor on the chart. The idea is to sort labels so that for each x point the minimum y label would be on top of the list.
We have studied the wt charts source and we have realized that charts are even more clever than we thought. There are two property settings:
void Wt::Chart::WCartesianChart::setCrosshairEnabled (bool crosshair = true)
void Wt::Chart::WCartesianChart::setFollowCurve (const WDataSeries * series)
and when we turn them ON, we have the cross hair cursor that follows the chart data points. By the way, this is not in examples, but this works! So most of the work is already done. Now we only need one small thing that we can not find: we need to report the data point with cross hair cursor to the server. We tried to catch MouseMove events, but they return pixel position on chart widget and it is not easy to calculate which data point we are pointing to.
We must be missing something and we need a hint.
RE: Interactive Charts - Added by Ansif PI about 1 month ago
RE: Interactive Charts - Added by Roel Standaert 8 days ago
You can use WCartesianChart::mapFromDevice to get the (x,y) position in model coordinates.