Add time line to X axis

Authored by alexde on Sep 16 2019, 4:37 PM.

Description

Add time line to X axis

Summary:
The current energy plot does not display any time line. This patch adds a grid and time stamps to the X axis.
It is assumed that the X axis of the plot ranges over [Now - Timespan, Now].

The timestamps for the timespans greater than "1 hour" are aligned to either half hours or full hours.
The resolution respectively the divisions count or number of ticks is made dependend on the timespan.
Dates are only shown if the date changes in the timespan.

If there are more or equal 10 divisions, only every second grid line gets a label to avoid that
the labels pile up, when the window size becomes small.

This patch may be only of temporary nature until kf5quickcharts becomes production ready.

BUG: 376940
FIXED-IN: 5.17.0

As QML was absolutely new to me, I am looking forward to your review.

Test Plan:



Reviewers: VDG, ngraham, Plasma

Reviewed By: VDG, ngraham

Subscribers: meven, bcooksley, plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D23520

Details

Committed
ngrahamSep 16 2019, 5:06 PM
Reviewer
VDG
Differential Revision
D23520: Add time line to X axis
Parents
R102:dd9bc6a3cb01: Set a minimum window size to reasonable 800x600 px
Branches
Unknown
Tags
Unknown