I would like to display a QChart in my GUI using QGraphicsScene and QGraphicsView. I tried to do it as follows:
chart = QChart()
chart.addSeries(series)
scene = QGraphicsScene()
scene.setSceneRect(MyGraphicsView.sceneRect())
scene.addItem(chart)
MyGraphicsView.setScene(scene)
The problem is that the chart is not resized to the size of the scene, but displayed in its corner. I know, that I could use the QChartView, but I already use this QGraphicsScene in many places of my application and would prefer to have it this way.
Thanks for any suggestions.
The scene takes almost the whole grey area in the middle and the chart takes only a fraction of it.