forked from 0TheFox0/OpenChart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqchartpiece.cpp
More file actions
36 lines (31 loc) · 720 Bytes
/
qchartpiece.cpp
File metadata and controls
36 lines (31 loc) · 720 Bytes
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
29
30
31
32
33
34
35
#include "qchartpiece.h"
QChartPiece::QChartPiece(QObject *parent) :
QObject(parent)
{
}
QChartPiece::QChartPiece(const QChartPiece & p)
{
this->i_values = p.i_values;
this->color = p.color;
this->nombre = p.nombre;
for(int i= 0; i<i_values.size();i++)
values.append(0);
}
void QChartPiece::operator =(const QChartPiece &p)
{
i_values.clear();
values.clear();
this->i_values = p.i_values;
this->color = p.color;
this->nombre = p.nombre;
for(int i= 0; i<i_values.size();i++)
values.append(0);
}
void QChartPiece::setPercent(float f)
{
for (int i = 0;i<values.size();i++)
{
float f1 = f/100.0;
values[i] = i_values.at(i)*f1;
}
}