summaryrefslogtreecommitdiff
path: root/src/charts/PieChart.cpp
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
commitd24f813f3f2a05c112e803e4256b53535895fc98 (patch)
tree601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/charts/PieChart.cpp
Initial mirror commitHEADmaster
Diffstat (limited to 'src/charts/PieChart.cpp')
-rw-r--r--src/charts/PieChart.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/charts/PieChart.cpp b/src/charts/PieChart.cpp
new file mode 100644
index 0000000..0637823
--- /dev/null
+++ b/src/charts/PieChart.cpp
@@ -0,0 +1,28 @@
+#include "PieChart.h"
+#include "PieChartScene.h"
+#include "ChartView.h"
+
+PieChart::PieChart():
+ scene(new PieChartScene(this))
+{
+ createChartView();
+}
+
+void PieChart::createChartView()
+{
+ view = new ChartView(scene);
+ QVBoxLayout* mainLt = new QVBoxLayout;
+ mainLt->addWidget(view);
+ mainLt->setContentsMargins(QMargins());
+ setLayout(mainLt);
+}
+
+void PieChart::setDataSet(const QList<DataPoint>& dataSet)
+{
+ scene->setDataSet(dataSet);
+}
+
+void PieChart::setColors(const QStringList& colors)
+{
+ scene->setColors(colors);
+}