LibEngsas
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
EChartPie Class Reference

Class to draw pie charts.Just add one data set per piece (with one x-value). The x-Values should be the values used to calculate the pie or call addPie(). If the x-values are already percents, call also setPercents(true). Otherwise EChartPie calculates the percentages automatically. More...

#include <echartpie.h>

+ Inheritance diagram for EChartPie:
+ Collaboration diagram for EChartPie:

Public Member Functions

 EChartPie (QWidget *parent=NULL)
void setPercents (bool percent)
bool percents () const
void addPie (double value, const QString label, QColor color=QColor())
- Public Member Functions inherited from EChartBase
 EChartBase (QWidget *parent=NULL)
void setChartTitle (QString chartTitle)
QString chartTitle () const
void setNumberPrecision (int precision)
int numberPrecision () const
void setNumberFormat (char format)
char numberFormat () const
void addDataSet (EChartValues dataSet, const QString label, QColor color=QColor())
 Adds a new line to the graph.
bool removeDataSet (const QString label)
void setTitleFont (QFont font)
QFont titleFont () const
void setLabelFont (QFont font)
QFont labelFont () const
EActionexportAction () const
- Public Member Functions inherited from EWidget
 EWidget (QWidget *parent=0, Qt::WindowFlags flags=0)
virtual ~EWidget ()
void setWindowTitle (const QString &title)
void connectByPass (QObject *object)
 Connects all standard signals.

Protected Member Functions

void drawChart (QPainter *painter, QRect viewPort)
- Protected Member Functions inherited from EChartBase
void paintEvent (QPaintEvent *event)
- Protected Member Functions inherited from EWidget
void addManagedDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area, QString actionLabel=QString(), QString actionParent=QString())
 Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets.

Properties

bool percents
- Properties inherited from EChartBase
QString chartTitle
int numberPrecision
char numberFormat
QFont titleFont
QFont labelFont

Private Member Functions

QString percentLabel (float percentage)

Private Attributes

bool arePercents
double PI

Additional Inherited Members

- Public Slots inherited from EChartBase
void exportChart ()
void exportChart (QPainter *painter, QRect boundingRect)
void clear ()
- Signals inherited from EWidget
void error (const QString &message)
void warning (const QString &message)
void information (const QString &message)
void reloadEnableActions ()
 Request reloading of enabled actions in EMainWindow.
void addMenu (QMenu *newMenu, const QString &parent, QString before=QString())
void addAction (QAction *newAction, const QString &parent, QString before=QString())
void addToolBar (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
void addNewDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area)
 To add managed dock widgets, use addManagedDockWidget() instead.
void setCentralWidget (QWidget *centralWidget)
void showSettings ()
void showHelp (const QString &page)
void showStatusWidget (QWidget *widget)
void reloadSettingsRequest ()
 Indicates, that a reload of the settings is needed.
void doReloadSettings ()
 Emitted to bring the reload request back to the farest child.
- Protected Slots inherited from EChartBase
virtual void contextMenu (QPoint pos) const
 This slot is called, if the context menu of this chart should be shown.
- Protected Attributes inherited from EChartBase
int marginHorizontal
int marginVertical
QRect viewPort
QStringList colorNames
QList< void(*)(QPainter *, QPoint)> markers
QMap< QString, EChartValuesdataSets
QMap< QString, QColor > dataSetsColors
QMap< QString, void(*)(QPainter
*, QPoint)> 
dataSetsMarkers

Detailed Description

Class to draw pie charts.

Just add one data set per piece (with one x-value). The x-Values should be the values used to calculate the pie or call addPie(). If the x-values are already percents, call also setPercents(true). Otherwise EChartPie calculates the percentages automatically.

To set the number format and precision, use setNumberFormat() and setNumberPrecision().

Constructor & Destructor Documentation

EChartPie::EChartPie ( QWidget *  parent = NULL)

+ Here is the call graph for this function:

Member Function Documentation

void EChartPie::addPie ( double  value,
const QString  label,
QColor  color = QColor() 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EChartPie::drawChart ( QPainter *  painter,
QRect  viewPort 
)
protectedvirtual
Todo:
Calculate percentages once and not everytime.

Implements EChartBase.

+ Here is the call graph for this function:

QString EChartPie::percentLabel ( float  percentage)
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool EChartPie::percents ( ) const
inline

+ Here is the caller graph for this function:

void EChartPie::setPercents ( bool  percent)

+ Here is the caller graph for this function:

Member Data Documentation

bool EChartPie::arePercents
private
double EChartPie::PI
private

Property Documentation

bool EChartPie::percents
readwrite

The documentation for this class was generated from the following files: