Get histo range clicked in QwtPlotMultiBarChart
Brought to you by:
rathmann
|
From: Younes K. <kha...@gm...> - 2019-02-06 16:52:25
|
Hello,
I have a QwtPlotMultiBarChart where each bar corresponds to a range of
values.
I would like to have a tracker that gives the range of the clicked point.
I overloaded trackerText like this:
virtual QwtText trackerText(const QPoint &pos) const
{
QwtText text;
const QwtScaleMap xMap = this->plot()->canvasMap(this->xAxis());
const double xPos = xMap.transform( pos.x() );
for (int i=0; i < histo_nb; i++){
if (pos.x() <= histo_bound[i][0] && pos.x() >= histo_bound[i][1])
text.setText("Here");
}
return text;
}
Is there a way to map xPos to the corresponding X label ?
Best regards,
--
Younes Khadraoui, PhD
*Co-Founder at Ostadhi.com | Research Engineer | Data Scientist |
Enterpreneur*
|