Hi,
I am using QwtPlotPicker::trackertex for showing labels on points. I have setTrackerMode(AlwaysOn); I can easily display x and y values but what I am looking for, is to display special label for each point.
what I am trying to do in following code is...after getting x axis and y axis I wants to search for xaxis value in vector of x values and yaxis value in vector of y values and if the xaxis value and yaxis value matches any value in vector x and vector y then I will use index to retrieve the label for that position from another vector.
Its not giving me any error with this code but also not showing me desired labels.
#define EPS 1.0e-6 //tolerance for comparing double values
xaxis=pos1.x();
yaxis=pos1.y();
int size=vec_xaxisvalues.size();
for(int index=0;index<size;index++)
{
if ((vec_xaxisvalues[index]-xaxis)<EPS && (vec_yaxisvalues[index]-yaxis)<EPS)
{
//QwtText text( QwtPlotPicker::trackerText(pos1));
text.setText("good");
return text;
}
else
{
}
}
#define EPS 1.0e-6 //tolerance for comparing double values
xaxis=pos1.x();
yaxis=pos1.y();
int size=vec_xaxisvalues.size();
for(int index=0;index<size;index++)
{
if ((vec_xaxisvalues[index]-xaxis)<EPS && (vec_yaxisvalues[index]-yaxis)<EPS)
{
//QwtText text( QwtPlotPicker::trackerText(pos1));
text.setText("good");
return text;
}
else
{
return QwtText();
}
}
To copy to clipboard, switch view to plain text mode
Thanks in advance.
Cheers,
Bookmarks