Apply rubberband in more than one data series
Unsolved
General and Desktop
-
Hi! I'm doing a graph that shows two data series like this
First I draw the candle graph and I set the rubber band option :
chartview=QChartView(self.candlechart) chartview.setRubberBand(QChartView.HorizontalRubberBand)
After that I draw the lines over the candle graph without problems but when I zoom the graph using the rubber band...
...the candle graph are zoomed but the lines doesn' t.
Is something that I missing out? Are lines compatible with the rubber band option or I should configure some event?
Thanks!
-
Hi and welcome to devnet,
How are you painting these lines ?
-
Hi SGaist , thanks for your welcome... I'm drawing these lines like this
chartview=QChartView(self.__candlechart) chartview.setRubberBand(QChartView.HorizontalRubberBand) chartview.setRenderHint(QPainter.Antialiasing) lineserie1=QLineSeries() for i in self.times: lineserie1.append(QPointF(i,random.random())) pen = lineserie1.pen() pen.setWidth(3) pen.setBrush(QBrush(QColor(255,0,0))) lineserie1.setPen(pen) lineserie2=QLineSeries() for i in self.times: lineserie2.append(QPointF(i,random.random())) pen = lineserie2.pen() pen.setWidth(3) pen.setBrush(QBrush(QColor(0,0,255))) lineserie2.setPen(pen) self.__candlechart.addSeries(lineserie1) self.__candlechart.addSeries(lineserie2)
If I change the order (I mean add the lines before set rubber band option I got the same result.
Thanks!