diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/charts/Chart.cpp |
Diffstat (limited to 'src/charts/Chart.cpp')
-rw-r--r-- | src/charts/Chart.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/charts/Chart.cpp b/src/charts/Chart.cpp new file mode 100644 index 0000000..f50911a --- /dev/null +++ b/src/charts/Chart.cpp @@ -0,0 +1,23 @@ +#include "Chart.h" +#include "ChartScene.h" +#include "ChartView.h" + +Chart::Chart(): + scene(new ChartScene(this)) +{ + createChartView(); +} + +void Chart::createChartView() +{ + view = new ChartView(scene); + QVBoxLayout* mainLt = new QVBoxLayout; + mainLt->addWidget(view); + mainLt->setContentsMargins(QMargins()); + setLayout(mainLt); +} + +void Chart::setDataSet(const QList<DataPoint>& dataSet) +{ + scene->setDataSet(dataSet, 1); +} |