@f-lerdino if you want something like this:
[image: 4afb1704-e915-4837-a6c0-9996c7bdd402.png]
there is code:
QGuiApplication app (argc, argv);
Q3DBars bars;
bars.resize (800, 800);
// Remove the frame for a borderless window
bars.setFlags (bars.flags () ^ Qt::FramelessWindowHint);
bars.rowAxis ()->setRange (0, 4);
bars.columnAxis ()->setRange (0, 4);
QBar3DSeries* series = new QBar3DSeries;
// Set the color style for the series to ColorStyleRangeGradient
series->setColorStyle (Q3DTheme::ColorStyleRangeGradient);
// Define colors for the color style range gradient
QLinearGradient gradient;
gradient.setColorAt (0.0, Qt::green);
gradient.setColorAt (0.5, Qt::yellow);
gradient.setColorAt (1.0, Qt::red);
// Create a data proxy for the series
QBarDataProxy* dataProxy = new QBarDataProxy;
// Create data items with values
QBarDataRow* dataRow = new QBarDataRow;
for (int i = 0; i < 5; ++i) {
dataRow->append (QBarDataItem (1.0f * 0.1 * i));
}
// Assign color style range gradient to the data proxy
//dataProxy->setColorStyle (gradient);
// Add data row to the data proxy
dataProxy->addRow (dataRow);
// Set data proxy for the series
series->setDataProxy (dataProxy);
series->setBaseGradient (gradient);
bars.addSeries (series);
bars.show ();
return app.exec ();
}
the key is "series->setColorStyle (Q3DTheme::ColorStyleRangeGradient);"