1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: MIT
3
4import { Page } from "page.slint";
5import { GroupBox, BalanceChart } from "../widgets/widgets.slint";
6
7export global BalanceAdapter {
8 in property <string> title: "Balance";
9 in property <[string]> x-axis-model: [
10 "12:00",
11 "",
12 "",
13 "16:00",
14 "",
15 "",
16 "20:00"
17 ];
18 in property <[int]> y-axis-model: [
19 1.0,
20 0,
21 -2,
22 -4,
23 -6
24 ];
25 in property <[float]> model: [ 0.2, 0.5, -1.7, -2.0, -4.0, -5.0, -5.5, -6.0, -6.2, -6.4, -4.5, -3.0, 0.25, 0.5 ];
26 in property <float> min: -7.8;
27 in property <float> max: 2;
28 in property <string> y-unit: "K";
29}
30
31export component Balance inherits Page {
32 in property <[string]> x-axis-model <=> BalanceAdapter.x-axis-model;
33 in property <[int]> y-axis-model <=> BalanceAdapter.y-axis-model;
34 in property <[float]> model <=> BalanceAdapter.model;
35 in property <float> min <=> BalanceAdapter.min;
36 in property <float> max <=> BalanceAdapter.max;
37 in property <string> y-unit <=> BalanceAdapter.y-unit;
38 in property <string> title <=> BalanceAdapter.title;
39
40 GroupBox {
41 title: root.title;
42
43 BalanceChart {
44 x-axis-model: root.x-axis-model;
45 y-axis-model: root.y-axis-model;
46 model: root.model;
47 min: root.min;
48 max: root.max;
49 y-unit: root.y-unit;
50 active: root.active;
51 }
52 }
53}