LibEngsas
|
Base class for ECharts.To add values, call addDataSet(). How the values are treated or how many data sets you can add, depensd on the specific implementation. More...
#include <echartbase.h>
Public Slots | |
void | exportChart () |
void | exportChart (QPainter *painter, QRect boundingRect) |
void | clear () |
![]() | |
virtual EngSaS::AvailableActions | enableActions () |
Will be called by EMainWindow::setCentralWidget() to enable and disable standard actions. | |
virtual QString | fileFilters (EngSaS::FileFilter reason) |
virtual bool | load (QFile *file, QString &error) |
virtual bool | save (QFile *file, QString &error) |
virtual bool | fileNew (QString &error) |
virtual bool | print (QString &error) |
virtual bool | undo (QString &error) |
virtual bool | redo (QString &error) |
virtual bool | cut (QString &error) |
virtual bool | copy (QString &error) |
virtual bool | paste (QString &error) |
virtual bool | reload (QString &error) |
virtual void | reloadSettings () |
Used to reload settings the settings. |
Public Member Functions | |
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 |
EAction * | exportAction () const |
![]() | |
EWidget (QWidget *parent=0, Qt::WindowFlags flags=0) | |
virtual | ~EWidget () |
void | setWindowTitle (const QString &title) |
void | connectByPass (QObject *object) |
Connects all standard signals. |
Protected Slots | |
virtual void | contextMenu (QPoint pos) const |
This slot is called, if the context menu of this chart should be shown. | |
![]() | |
virtual void | errorByPass (const QString &message) |
virtual void | warningByPass (const QString &message) |
virtual void | informationByPass (const QString &message) |
virtual void | reloadEnableActionsByPass () |
virtual void | addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString()) |
virtual void | addActionByPass (QAction *newAction, const QString &parent, QString before=QString()) |
virtual void | addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea) |
virtual void | addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area) |
virtual void | setCentralWidgetByPass (QWidget *centralWidget) |
virtual void | showSettingsByPass () |
virtual void | showHelpByPass (const QString &page) |
virtual void | showStatusWidgetByPass (QWidget *widget) |
virtual void | reloadSettingsRequestByPass () |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) |
virtual void | drawChart (QPainter *painter, QRect viewPort)=0 |
Function to draw the chart. | |
![]() | |
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. |
Protected Attributes | |
int | marginHorizontal |
int | marginVertical |
QRect | viewPort |
QStringList | colorNames |
QList< void(*)(QPainter *, QPoint)> | markers |
QMap< QString, EChartValues > | dataSets |
QMap< QString, QColor > | dataSetsColors |
QMap< QString, void(*)(QPainter *, QPoint)> | dataSetsMarkers |
Properties | |
QString | chartTitle |
int | numberPrecision |
char | numberFormat |
QFont | titleFont |
QFont | labelFont |
Private Member Functions | |
void | legend (QPointF origin, QPainter *painter) |
Draws the default legend on the right side of the chart. | |
QRect | createViewPort (QPainter *painter, QRect boundingRect) |
Calculates the view port, paints it and returns it's size. |
Private Attributes | |
char | myNumberFormat |
int | myNumberPrecision |
QString | myChartTitle |
QFont | myTitleFont |
QFont | myLabelFont |
int | legendMarkersMargin |
Additional Inherited Members | |
![]() | |
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. |
Base class for ECharts.
To add values, call addDataSet(). How the values are treated or how many data sets you can add, depensd on the specific implementation.
Your chart should be drawn in your implementation of drawChart(). This function is called by paintEvent() and also by exportChart() to paint the chart on an image. Therefore, you should only use the given view port size within this function.
To add an export action to your context menu or something else, just call exportAction() to create the action.
If you must draw text within your subclass, use labelFont or may be titleFont.
EChartBase::EChartBase | ( | QWidget * | parent = NULL | ) |
void EChartBase::addDataSet | ( | EChartValues | dataSet, |
const QString | label, | ||
QColor | color = QColor() |
||
) |
Adds a new line to the graph.
If x-ticks and y-ticks are not numeric, x- and y-values can only contain values from x-ticks and y-ticks.
If color
is empty, a default order is used.
|
inline |
|
slot |
|
protectedvirtualslot |
This slot is called, if the context menu of this chart should be shown.
You may reimplement this function, if you need another menu than the default one.
|
private |
Calculates the view port, paints it and returns it's size.
Is called by paintEvent() before drawChart().
|
protectedpure virtual |
Function to draw the chart.
It is called by the overladed paintEvent() function and also used to export the chart into an image.
Implemented in EChartLine, and EChartPie.
EAction * EChartBase::exportAction | ( | ) | const |
|
slot |
|
slot |
QFont EChartBase::labelFont | ( | ) | const |
|
private |
Draws the default legend on the right side of the chart.
Is called by paintEvent() after drawChart().
|
inline |
|
inline |
|
protected |
bool EChartBase::removeDataSet | ( | const QString | label | ) |
void EChartBase::setChartTitle | ( | QString | chartTitle | ) |
void EChartBase::setLabelFont | ( | QFont | font | ) |
void EChartBase::setNumberFormat | ( | char | format | ) |
void EChartBase::setNumberPrecision | ( | int | precision | ) |
void EChartBase::setTitleFont | ( | QFont | font | ) |
QFont EChartBase::titleFont | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |