diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/charts/ChartDataLine.h |
Diffstat (limited to 'src/charts/ChartDataLine.h')
-rw-r--r-- | src/charts/ChartDataLine.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/charts/ChartDataLine.h b/src/charts/ChartDataLine.h new file mode 100644 index 0000000..c90ccb4 --- /dev/null +++ b/src/charts/ChartDataLine.h @@ -0,0 +1,37 @@ +#ifndef CHART_DATA_SET_H +#define CHART_DATA_SET_H + +#include <QtCore> +#include <QtWidgets> + +#include "DataPoint.h" + +class ChartScene; + +class ChartDataLine +{ +public: + ChartDataLine(ChartScene* scene); + void paint(); + +private: + QPointF getDataSetOrigin() const; + QPainterPath createLinePath(); + QPointF getDataPos(int index, int yValue); + void addLinePath(const QPainterPath& path); + void addLineSegment(QPainterPath& path, int i); + void addAreaPath(const QPainterPath& linePath); + QString createToolTipText(const DataPoint& dataPoint) const; + +private: + static const int MarkerRadius = 2; + static const QColor MarkerColor; + static const QColor FillColor; + +private: + ChartScene* scene; + QPointF origin; + qreal xSpacing; +}; + +#endif |