From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/charts/ChartDataLine.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/charts/ChartDataLine.h (limited to 'src/charts/ChartDataLine.h') 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 +#include + +#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 -- cgit