blob: 0637823402f760f66d63eb7be1729cfd29047c41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}
|