Plasma
signalplotter.cpp
Go to the documentation of this file.
573 uint horizontalStep = (uint)((1.0 * w / size().width()) + 0.5); // get the closest integer horizontal step
623 uint top = p->pen().width() / 2; // The y position of the top of the graph. Basically this is one more than the height of the top bar
629 bool showTopBar = d->showTopBar && h > (fontheight/*top bar size*/ +5/*smallest reasonable size for a graph*/);
631 top += fontheight; // The top bar has the same height as fontheight. Thus the top of the graph is at fontheight
923 int offset = 0; // Our line is 2 pixels thick. This means that when we draw the area, we need to offset
928 // If we use autorange, then we need to prepare the min and max values for _next_ time we paint.
1058 top + (y * (h - 1)) / (d->horizontalLinesCount + 1); // Make sure it's y*h first to avoid rounding bugs
1081 // note that the y_coord starts from 0. so we draw from pixel number 0 to h-1. Thus the -1 in the y_coord
1082 int y_coord = top + (y * (h - 1)) / (d->horizontalLinesCount + 1); // Make sure it's y*h first to avoid rounding bugs
Q_INVOKABLE void reorderPlots(const QList< uint > &newOrder)
Reorder the plots into the order given.
Definition: signalplotter.cpp:222
void drawAxisText(QPainter *p, int top, int h)
Definition: signalplotter.cpp:1038
void setShowTopBar(bool value)
Whether to show the title etc at the top.
Definition: signalplotter.cpp:467
QList< PlotColor > & plotColors()
Return the list of plot colors, in the order that the plots were added (or later reordered).
Definition: signalplotter.cpp:258
Definition: signalplotter.h:35
QPixmap getSnapshotImage(uint width, uint height)
Render the graph to the specified width and height, and return it as an image.
Definition: signalplotter.cpp:571
double verticalMaxValue() const
Get the max value of the vertical axis.
Definition: signalplotter.cpp:323
void setUseAutoRange(bool value)
Set the minimum and maximum values on the vertical axis automatically from the data available.
Definition: signalplotter.cpp:306
QString lastValueAsString(uint i) const
Return a translated string like: "34 %" or "100 KB" for plot i.
Definition: signalplotter.cpp:1095
void setShowLabels(bool value)
Whether to show the vertical axis labels.
Definition: signalplotter.cpp:453
void setThinFrame(bool set)
Whether to show a white line on the left and bottom of the widget, for a 3D effect.
Definition: signalplotter.cpp:533
SignalPlotter(QGraphicsItem *parent=0)
Definition: signalplotter.cpp:116
Q_INVOKABLE void addPlot(const QColor &color)
Add a new line to the graph plotter, with the specified color.
Definition: signalplotter.cpp:169
void drawVerticalLines(QPainter *p, int top, int w, int h)
Definition: signalplotter.cpp:799
void setHorizontalScale(uint scale)
Set the number of pixels horizontally between data points.
Definition: signalplotter.cpp:328
void drawHorizontalLines(QPainter *p, int top, int w, int h)
Definition: signalplotter.cpp:1077
Q_INVOKABLE void addSample(const QList< double > &samples)
Add data to the graph, and advance the graph by one time period.
Definition: signalplotter.cpp:182
virtual void setGeometry(const QRectF &geometry)
Overwritten to be notified of size changes.
Definition: signalplotter.cpp:582
QColor horizontalLinesColor
Definition: signalplotter.h:58
void drawBackground(QPainter *p, int w, int h)
Definition: signalplotter.cpp:699
void setShowHorizontalLines(bool value)
Whether to draw the horizontal grid lines.
Definition: signalplotter.cpp:400
Q_INVOKABLE void removePlot(uint pos)
Removes the plot at the specified index.
Definition: signalplotter.cpp:263
void setVerticalLinesColor(const QColor &color)
The color of the vertical grid lines.
Definition: signalplotter.cpp:358
void drawTopBarFrame(QPainter *p, int separatorX, int height)
Definition: signalplotter.cpp:756
void drawTopBarContents(QPainter *p, int x, int width, int height)
Definition: signalplotter.cpp:768
void setVerticalLinesDistance(uint distance)
The horizontal distance between the vertical grid lines.
Definition: signalplotter.cpp:372
void setVerticalLinesScroll(bool value)
Whether the vertical lines move with the data.
Definition: signalplotter.cpp:386
Q_INVOKABLE QColor color(ColorRole role) const
Returns the text color to be used by items resting on the background.
Definition: theme.cpp:918
void drawThinFrame(QPainter *p, int w, int h)
Definition: signalplotter.cpp:709
void setFontColor(const QColor &color)
The color of the font used for the axis.
Definition: signalplotter.cpp:414
void setBackgroundColor(const QColor &color)
The color to set the background.
Definition: signalplotter.cpp:519
void setSvgBackground(const QString &filename)
The filename of the svg background.
Definition: signalplotter.cpp:497
void setStackPlots(bool stack)
Whether to stack the plots on top of each other.
Definition: signalplotter.cpp:547
void drawPlots(QPainter *p, int top, int w, int h, int horizontalScale)
Definition: signalplotter.cpp:807
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: signalplotter.cpp:589
void setHorizontalLinesColor(const QColor &color)
The color of the horizontal grid lines.
Definition: signalplotter.cpp:424
double lastValue(uint i) const
Return the last value that we have for plot i.
Definition: signalplotter.cpp:1087
void setShowVerticalLines(bool value)
Whether to draw the vertical grid lines.
Definition: signalplotter.cpp:344
void setHorizontalLinesCount(uint count)
The number of horizontal lines to draw.
Definition: signalplotter.cpp:438
uint verticalLinesDistance
Definition: signalplotter.h:55
double verticalMinValue() const
Get the min value of the vertical axis.
Definition: signalplotter.cpp:318
void drawWidget(QPainter *p, uint w, uint height, int horizontalScale)
Definition: signalplotter.cpp:606
void setVerticalRange(double min, double max)
Change the minimum and maximum values drawn on the graph.
Definition: signalplotter.cpp:251
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.