Hi,
i have a plot in qwt. i would like to add some overlay to show that a curve is violated from point t to t+x.
Is there a way to achieve this feature?
e.g.
https://community.dynatrace.com/comm...4014427&api=v2
Thanks,
Hi,
i have a plot in qwt. i would like to add some overlay to show that a curve is violated from point t to t+x.
Is there a way to achieve this feature?
e.g.
https://community.dynatrace.com/comm...4014427&api=v2
Thanks,
Your link doesn't work for me.
Uwe
hm....
i also upload an image, can you see it now? i refer to the red rectangle overlay indicating a violation in the graph... Screen Shot 2015-06-14 at 3.07.15 PM.jpg
Last edited by Surfman19; 14th June 2015 at 14:17.
Well this looks simply like filling some area with a red pen and a semitransparent red brush ( guess with an alpha about 100 ).
Candidates for the implementation are QwtPlotShapeItem or QwtPlotZoneItem.
Uwe
thanks for the info.
i have a problem with qwtplotshapeitem: it does not overlay with the plot, any idea?
how can i set the coordinate of the rectangle to the ymax, ymin and to the plot item x=10 till x = 100?
Qt Code:
QPainterPath path; path.addRect(20, 20, 60, 60); QwtPlotShapeItem *pitem = new QwtPlotShapeItem(); pitem->setShape(path); pitem->setPen(color); pitem->setBrush(color); pitem->attach(plot.get()); plot->replot();To copy to clipboard, switch view to plain text mode
Last edited by Surfman19; 14th June 2015 at 19:15.
i mean that the qwtplotshapeitem should be on top of my QwtPlotCurve, at the moment the qwtplotshapeitem moves the QwtPlotCurve to the bottom...
see here:
http://img.ctrlv.in/img/15/06/14/557dd35c189d0.jpg
how can i extract the x coords from my QwtPlotCurve and pass it to qwtplotshapeitem? from x=10 to x=100
ymax = top, ymin = bottom of the qwtplot.
edit: i solved the problem.... just used wrong coords for QPaintPath, addRect.... i only need to specific the region of the violation with the coordinates of .addRect...
how should the QwtPlotZoneItem be useful here? can you show an example?
does qwt use opengl in the behind the scenes per default? could you use it? do people use it to render the plot?
Last edited by Surfman19; 14th June 2015 at 20:35.
It doesn't - your rectangle simply doesn't match the y coordinates of your curve ( those are much smaller ) and in its default settings it has an effect on the autoscaler.
QwtPlotCurve inherits the API of QwtSeriesStore<QPointF>.how can i extract the x coords from my QwtPlotCurve and pass it to qwtplotshapeitem? from x=10 to x=100
ymax = top, ymin = bottom of the qwtplot.
Uwe
ok, will look into it.
how can i detach the qwtplotshapeitem after i dont need it any more? i dont want to delete the object, bc i activate the qwtplotshapeitem again later...
Last edited by Surfman19; 14th June 2015 at 20:56.
Have a look ati dont want to delete the object, bc i activate the qwtplotshapeitem again later
QwtPlotDict::detachItems(...)
Bookmarks