Solved Remove margins around chart
-
Hello again :)
I would like to remove the grey margins around the central widget. I've used setCentralWidget(chartView); to display the chart.
-
Hi,
Do you really a QMainWindow if you only want to show that chart ? A QDialog might be more suitable.
-
I don't need a MainWindow, indeed. I have now displayed the chart in a Dialog, by adding it into a layout. But the margins are still there, how could I remove them ?
-
Call the
setContentMargin
andsetSpacing
function with 0 on the layout and you should be good to go. -
I tried, but with no success. But I spent some more time searching the internet and finally found this, which solves the problem.
-
Glad you found out and thanks for sharing the solution !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)