2

Whenever I press the right-click button, it sort of zooms out a little instead I want to restore the initial position of my QChart whenever I press the Right-Click. Is there a way to do this?

1 Answers1

0

I think you should set the Rubberband to "no" for the chartView, so that it does react to your positioning, but no zoom.

setRubberBand(QChartView::NoRubberBand);
Marcel Petrick
  • 454
  • 3
  • 15
  • Thanks, Marcel for your reply. This worked but for the second part, how do I restore my initial position and zooming? I am using chart()->scroll(0,0) and chart()->zoomReset() in the MouseClickEvent() when right click is pressed but it isn't working. – Prashant Kumar Mar 07 '19 at 09:49