22 explicit Graph(
const QPalette& palette = {});
49 void setBounds(
const QFontMetrics& fontMetrics,
const QRect& bounds);
152 } _top, _left, _right, _bottom;
ERulerOrientation
Orientation for drawing a graph ruler.
Definition Draw.h:26
@ roNone
Definition Draw.h:28
EGridOrientation
Orientation for drawing grid lines in a graph.
Definition Draw.h:62
EColor
Colors enumeration of colors in the graph. Used by setColor function.
Definition Graph.h:80
@ cRulerLine
Definition Graph.h:84
@ cGridLines
Definition Graph.h:86
@ cGraphBackground
Definition Graph.h:90
@ cGraphForeground
Definition Graph.h:92
@ cRulerText
Definition Graph.h:82
@ cRulerBackground
Definition Graph.h:88
bool _debug
Draws only area bounds contours when enabled.
Definition Graph.h:105
QVector< QColor > _colors
Holds the colors for painting the rulers en grid.
Definition Graph.h:111
Draw::ERulerOrientation _horizontal
Holds which ruler information is responsible.
Definition Graph.h:157
void paintPlotCross(QPainter &painter, const QString &text)
Paints a cross with text in the plot area. Used when a plot can not be painted.
void setRuler(Draw::ERulerOrientation ro, double start, double stop, int digits, const QString &unit)
Sets and thus enabling the ruler for the passed orientation.
const QRect & paint(QPainter &painter, const QRect &bounds, const QRegion ®ion=null_ref< QRegion >())
Paints the graph. Paints the graph passing the passed boundaries and the optional region when handlin...
QRect _plotArea
Holds the last calculated graph area rectangle.
Definition Graph.h:169
void setColor(EColor index, QColor color)
Allows setting of individual indexed colors for the graph.
RulerInfo * getRulerInfo(Draw::ERulerOrientation ro)
Gets the ruler information by orientation.
const QRect & getPlotArea() const
Gets the remaining area to plot the graph after rulers and grid have been painted.
Graph(const QPalette &palette={})
Constructor passing a palette.
void setGrid(Draw::EGridOrientation go, Draw::ERulerOrientation ro)
Enables grid painting in the graph. When painting this enables drawing grid for the passed orientatio...
void setBounds(const QFontMetrics &fontMetrics, const QRect &bounds)
Sets the bounding rectangle for the graph for painting in. Paints the graph passing the passed bounda...
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
_MISC_FUNC int digits(double value)
Returns the amount of digits which are significant for the value. When the value is 12300....
T & null_ref()
Definition pointer.h:123
Holds information on the rulers. Holds set and calculated information.
Definition Graph.h:118
int digits
Precision digits.
Definition Graph.h:134
QRect rect
Rectangle for the ticks.
Definition Graph.h:146
QString unit
unit text.
Definition Graph.h:138
bool enabled
Ruler enabled flag.
Definition Graph.h:122
QRect bounds
Bounds of the ruler area for painting value texts i.e.
Definition Graph.h:142
int size
Calculated ruler size (width/height).
Definition Graph.h:150
double start
Ruler start value.
Definition Graph.h:126
double stop
Ruler stop value.
Definition Graph.h:130