All Qt Charts seem to have a margin and rounded corners.
How to remove both?
I want the white area to fill the entire dialog. I cannot find any informations in the Qt documentations. I found a screenshot of one Example that does not have this spacing. But I cannot find the code that disables it.
My initialization code looks like this:
QPieSeries *series = new QPieSeries();
series->append("Jane", 1);
series->append("Joe", 2);
series->append("Andy", 3);
series->append("Barbara", 4);
series->append("Axel", 5);
QChart *chart = new QChart();
chart->addSeries(series);
QChartView *chartView = new QChartView(chart);
chartView->setBackgroundBrush(Qt::red);
chartView->setRenderHint(QPainter::Antialiasing);
QMainWindow window;
window.setCentralWidget(chartView);
window.resize(400, 300);
window.show();

QChartViewor part of theQChart? You could try eitherui->pieChartView->setBackgroundBrush(Qt::white)orm_pieChart->setMargins(QMargins()). - G.M.m_pieChart->layout()->setContentsMargins(0, 0, 0, 0);- Devopiam_pieChartis nowchartin the example. Your code works! But i still have rounded borders. If you also know how to remove them, I would accept your answer (if you write one). - feedc0dechart->setBackgroundRoundness(0);- Devopia