| 1 | import QtQuick |
| 2 | |
| 3 | // Bar-graph history, same flavour as the visualizer bars in your screenshot. |
| 4 | Item { |
| 5 | id: s |
| 6 | property var values: [] |
| 7 | property int slots: 40 |
| 8 | implicitHeight: 44 |
| 9 | |
| 10 | Row { |
| 11 | anchors.fill: parent |
| 12 | spacing: 2 |
| 13 | Repeater { |
| 14 | model: s.slots |
| 15 | delegate: Item { |
| 16 | required property int index |
| 17 | readonly property int vi: s.values.length - s.slots + index |
| 18 | readonly property real v: vi >= 0 && vi < s.values.length ? s.values[vi] : 0 |
| 19 | width: (s.width - (s.slots - 1) * 2) / s.slots |
| 20 | height: s.height |
| 21 | Rectangle { |
| 22 | anchors.bottom: parent.bottom |
| 23 | width: parent.width |
| 24 | height: Math.max(2, parent.height * parent.v) |
| 25 | gradient: Gradient { |
| 26 | GradientStop { position: 0; color: Theme.accent } |
| 27 | GradientStop { position: 1; color: Theme.accentDim } |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | } |