How to remove margin from QChartView or QChart
<p>All <a href="https://doc.qt.io/qt-5/qtcharts-index.html" rel="noreferrer">Qt Charts</a> seem to have a margin and rounded corners.</p>

<p><a href="https://i.stack.imgur.com/884Q7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/884Q7.png" alt="Example image with red marked border"></a></p>

<p><strong>How to remove both?</strong></p>

<p>I want the white area to fill the entire dialog. I cannot find any informations in the Qt documentations. I found a screenshot of <a href="https://doc.qt.io/qt-5/qtcharts-callout-example.html" rel="noreferrer">one Example</a> that does not have this spacing. But I cannot find the code that disables it.</p>

<p>My initialization code looks like this:</p>

<pre><code>QPieSeries *series = new QPieSeries();
series-&gt;append("Jane", 1);
series-&gt;append("Joe", 2);
series-&gt;append("Andy", 3);
series-&gt;append("Barbara", 4);
series-&gt;append("Axel", 5);

QChart *chart = new QChart();
chart-&gt;addSeries(series);

QChartView *chartView = new QChartView(chart);
chartView-&gt;setBackgroundBrush(Qt::red);
chartView-&gt;setRenderHint(QPainter::Antialiasing);

QMainWindow window;
window.setCentralWidget(chartView);
window.resize(400, 300);
window.show();
</code></pre>