-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineChart.example.yaml
More file actions
123 lines (123 loc) · 3.25 KB
/
LineChart.example.yaml
File metadata and controls
123 lines (123 loc) · 3.25 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Empty lines
# Target: rendering fallback UI when no data is provided.
# Expected behavior: displays <Empty /> placeholder since "lines" is null.
kind: LineChart
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-linechart-empty
namespace: krateo-system
spec:
widgetData:
lines: []
---
# Single line
# Target: rendering a single smooth line with valid coords.
# Expected behavior: one line appears with correct color and legend entry.
kind: LineChart
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-linechart-single
namespace: krateo-system
spec:
widgetData:
lines:
- name: "CPU Usage"
color: "blue"
coords:
- xAxis: "00:00"
yAxis: "20"
- xAxis: "01:00"
yAxis: "45"
- xAxis: "02:00"
yAxis: "30"
- xAxis: "03:00"
yAxis: "50"
xAxisName: "Time"
yAxisName: "CPU (%)"
---
# Multiple lines
# Target: rendering multiple data series in a single chart.
# Expected behavior: all lines appear together with distinct colors and shared x-axis.
kind: LineChart
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-linechart-multi
namespace: krateo-system
spec:
widgetData:
lines:
- name: "Temperature"
color: "red"
coords:
- xAxis: "00:00"
yAxis: "22"
- xAxis: "01:00"
yAxis: "24"
- xAxis: "02:00"
yAxis: "21"
- xAxis: "03:00"
yAxis: "26"
- name: "Humidity"
color: "blue"
coords:
- xAxis: "00:00"
yAxis: "45"
- xAxis: "01:00"
yAxis: "48"
- xAxis: "02:00"
yAxis: "50"
- xAxis: "03:00"
yAxis: "52"
xAxisName: "Time"
yAxisName: "Value"
---
# Missing coords
# Target: handling lines with empty or missing coordinate arrays.
# Expected behavior: line with no coords is skipped; chart renders remaining valid lines.
kind: LineChart
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-linechart-missing-coords
namespace: krateo-system
spec:
widgetData:
lines:
- name: "Line A"
color: "green"
coords: []
- name: "Line B"
color: "orange"
coords:
- xAxis: "1"
yAxis: "10"
- xAxis: "2"
yAxis: "20"
- xAxis: "3"
yAxis: "15"
xAxisName: "Index"
yAxisName: "Value"
---
# Non-numeric values
# Target: ensuring chart stability when encountering string or malformed yAxis values.
# Expected behavior: invalid values are treated as NaN; chart shows disconnected points (no connecting line) for valid ones, no crash occurs.
kind: LineChart
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-linechart-invalid-values
namespace: krateo-system
spec:
widgetData:
lines:
- name: "Temperature"
color: "red"
coords:
- xAxis: "00:00"
yAxis: "25"
- xAxis: "01:00"
yAxis: "twenty-eight" # invalid numeric value
- xAxis: "02:00"
yAxis: "29"
- xAxis: "03:00"
yAxis: "thirty" # invalid numeric value
xAxisName: "Time"
yAxisName: "°C"