diff options
Diffstat (limited to 'examples/charts/stackedbarchartdrilldown/main.cpp')
-rw-r--r-- | examples/charts/stackedbarchartdrilldown/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/charts/stackedbarchartdrilldown/main.cpp b/examples/charts/stackedbarchartdrilldown/main.cpp index c3e03505..f4bbc3f0 100644 --- a/examples/charts/stackedbarchartdrilldown/main.cpp +++ b/examples/charts/stackedbarchartdrilldown/main.cpp @@ -29,6 +29,7 @@ #include <QtWidgets/QApplication> #include <QtWidgets/QMainWindow> +#include <QtCore/QRandomGenerator> #include <QtCharts/QChartView> #include <QtCharts/QBarSet> #include <QtCharts/QLegend> @@ -90,7 +91,7 @@ int main(int argc, char *argv[]) for (int month = 0; month < months.count(); month++) { QBarSet *weeklyCrop = new QBarSet(plant); for (int week = 0; week < weeks.count(); week++) - *weeklyCrop << (qrand() % 20); + *weeklyCrop << QRandomGenerator::bounded(20); // Get the drilldown series from season series and add crop to it. seasonSeries->drilldownSeries(month)->append(weeklyCrop); *monthlyCrop << weeklyCrop->sum(); |