1 Attachment(s)
How control size of legend to prevent title truncation ?
Is there a way to control the legend size or legend margin in Qwt so that a string of a fixed length will always be visible?
I am working on a real-time scrolling history plot that adds latest data sample to the right then scrolls time to the left.
I want to append the current value to display in the legend title.
Code:
// Create the plot curve
Code:
// Update curve with latest sample and display value in legend
void plotHistory::update(double newSample)
{
data[SeriesVsource].dataHistory[0] = newSample;
data[SeriesVsource].curve->setTitle(m_formatter.sprintf("Vbattery %04.2f", newSample);
}
Thanks in advance for any direction,
-Ed
Re: How control size of legend to prevent title truncation ?
Code:
virtual QWidget *YourCurve
::legendItem() const {
w->setMinimumWidth( ... );
return w;
}
HTH,
Uwe
Re: How control size of legend to prevent title truncation ?
I much appreciate the code sample. You solution works perfectly. Thank you Uwe!
I did not realize your are the Qwt developer. Thank you so much for sharing your work! I can not imagine the amount of man hours that you must have put into developing such a fine widgets library. I kept wishing I was doing this charting application in C# .NET until I discovered your Qwt. I am looking forward to discovering more of what I can do with your Qwt widgets libraries. Thanks again!
-Ed