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,
Printable View
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... Attachment 11208
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?
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();
Probably - if I would know, what is meant by "does not overlay".
If ymin/ymax simply mean top/bottom of the plot canvas, than your looking for QwtPlotZoneItem.Quote:
how can i set the coordinate of the rectangle to the ymax, ymin and to the plot item x=10 till x = 100?
Uwe
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?
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>.Quote:
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...
Have a look atQuote:
i dont want to delete the object, bc i activate the qwtplotshapeitem again later
QwtPlotDict::detachItems(...)