nightcharts.h
Go to the documentation of this file.
1/*
2 * NightCharts
3 * Copyright (C) 2010 by Alexander A. Avdonin, Artem N. Ivanov / ITGears Co.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Please contact gordos.kund@gmail.com with any questions on this license.
19 */
20#ifndef NIGHTCHARTS_H
21#define NIGHTCHARTS_H
22#define PerConst = 3.6;
23#include <QObject>
24#include <QPainter>
25#include <QVector>
26#include <QDebug>
27#include <QLinearGradient>
28#include <math.h>
29
31{
32public:
33 explicit pieceNC();
34 void addName(QString name);
35 void setColor(Qt::GlobalColor);
36 void setColor(QColor color);
37 void setPerc(float Percentage);
38
39 QString pname;
40 QColor rgbColor;
41 float pPerc;
42
43private:
44
45};
46
48{
49public:
50
51 explicit Nightcharts();
53 enum type { Histogramm , Pie, Dpie };
54 enum legend_type{ /*Horizontal,*/ Vertical, Round };
55 int addPiece(QString name,Qt::GlobalColor,float Percentage);
56 int addPiece(QString name,QColor, float Percentage);
57 int setCords(double x, double y, double w, double h);
58 int setLegendCords(double x, double y);
61 int setShadows(bool ok = true);
62 int setFont(QFont f);
63 int draw(QPainter *painter);
64 void drawLegend(QPainter *painter);
65 int pieceCount() const;
66 void setTextColor(const QColor& color);
67 double palpha;
68
69private:
70 double cX,cY,cW,cH,pW,lX,lY;
71 int nPiece;
72 bool shadows;
73 QVector<pieceNC> pieces;
74 int ctype, cltype;
75 QFont font;
76 QColor textColor;
77 //QPainter *cpainter;
78 QPointF GetPoint(double angle, double R1 = 0, double R2 = 0);
79 int GetQuater(double angle);
80 double Angle360(double angle);
81
82
83signals:
84
85public slots:
86
87};
88
89
90#endif // NIGHTCHARTS_H
const char *const name
Definition: cJSON.h:258
Definition: nightcharts.h:48
void drawLegend(QPainter *painter)
int pieceCount() const
type
Definition: nightcharts.h:53
@ Dpie
Definition: nightcharts.h:53
@ Pie
Definition: nightcharts.h:53
@ Histogramm
Definition: nightcharts.h:53
int setShadows(bool ok=true)
legend_type
Definition: nightcharts.h:54
@ Vertical
Definition: nightcharts.h:54
@ Round
Definition: nightcharts.h:54
int draw(QPainter *painter)
void setTextColor(const QColor &color)
int setFont(QFont f)
int setLegendCords(double x, double y)
int setCords(double x, double y, double w, double h)
double palpha
Definition: nightcharts.h:67
int addPiece(QString name, Qt::GlobalColor, float Percentage)
int setLegendType(Nightcharts::legend_type t)
int addPiece(QString name, QColor, float Percentage)
int setType(Nightcharts::type t)
Definition: nightcharts.h:31
QColor rgbColor
Definition: nightcharts.h:40
void setPerc(float Percentage)
float pPerc
Definition: nightcharts.h:41
void setColor(QColor color)
void addName(QString name)
QString pname
Definition: nightcharts.h:39
void setColor(Qt::GlobalColor)
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t t(t+t)") define_sfop3(16
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)