-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckinsdialog.cpp
More file actions
36 lines (31 loc) · 959 Bytes
/
checkinsdialog.cpp
File metadata and controls
36 lines (31 loc) · 959 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 "checkinsdialog.h"
#include "ui_checkinsdialog.h"
#include <nightcharts.h>
CheckInsDialog::CheckInsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CheckInsDialog)
{
ui->setupUi(this);
}
CheckInsDialog::~CheckInsDialog()
{
delete ui;
}
void CheckInsDialog::paintEvent(QPaintEvent *e)
{
QWidget::paintEvent(e);
QPainter painter;
QFont font;
painter.begin(this);
Nightcharts Histogram;
Histogram.setType(Nightcharts::Histogramm);//{Histogramm,Pie,DPie};
Histogram.setLegendType(Nightcharts::Vertical);//{Round,Vertical}
Histogram.setCords(20, 20, this->width()/1.7,this->height()/1.2);
Histogram.addPiece("February",QColor(200,10,50), 34);
Histogram.addPiece("March",Qt::green, 27);
Histogram.addPiece("April",Qt::cyan, 14);
Histogram.addPiece("May",Qt::yellow, 7);
Histogram.addPiece("June",Qt::blue, 4);
Histogram.draw(&painter);
Histogram.drawLegend(&painter);
}