blob: c90ccb449d8dc2285ae916edec1548e3ce592cdd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
|