@@ -18,6 +18,25 QString formatValue(double value, const QCPAxis &axis) | |||
|
18 | 18 | ? QCPAxisTickerDateTime::keyToDateTime(value).toString(DATETIME_FORMAT) |
|
19 | 19 | : QString::number(value); |
|
20 | 20 | } |
|
21 | ||
|
22 | void initPointTracerStyle(QCPItemTracer &tracer) noexcept | |
|
23 | { | |
|
24 | tracer.setInterpolating(false); | |
|
25 | tracer.setStyle(QCPItemTracer::tsPlus); | |
|
26 | tracer.setPen(QPen(Qt::black)); | |
|
27 | tracer.setBrush(Qt::black); | |
|
28 | tracer.setSize(10); | |
|
29 | } | |
|
30 | ||
|
31 | void initTextTracerStyle(QCPItemText &tracer) noexcept | |
|
32 | { | |
|
33 | tracer.setPen(QPen{Qt::gray}); | |
|
34 | tracer.setBrush(Qt::white); | |
|
35 | tracer.setPadding(QMargins{6, 6, 6, 6}); | |
|
36 | tracer.setPositionAlignment(Qt::AlignTop | Qt::AlignLeft); | |
|
37 | tracer.setTextAlignment(Qt::AlignLeft); | |
|
38 | } | |
|
39 | ||
|
21 | 40 | } // namespace |
|
22 | 41 | |
|
23 | 42 | struct VisualizationGraphRenderingDelegate::VisualizationGraphRenderingDelegatePrivate { |
@@ -27,6 +46,8 struct VisualizationGraphRenderingDelegate::VisualizationGraphRenderingDelegateP | |||
|
27 | 46 | m_TextTracer{new QCPItemText{&plot}}, |
|
28 | 47 | m_TracerTimer{} |
|
29 | 48 | { |
|
49 | initPointTracerStyle(*m_PointTracer); | |
|
50 | initTextTracerStyle(*m_TextTracer); | |
|
30 | 51 | |
|
31 | 52 | m_TracerTimer.setInterval(TRACER_TIMEOUT); |
|
32 | 53 | m_TracerTimer.setSingleShot(true); |
General Comments 0
You need to be logged in to leave comments.
Login now