diff options
author | Ninette Adhikari <ninette@thehoodiefirm.com> | 2024-05-03 16:43:40 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-15 16:39:19 +0100 |
commit | cf0c866b51cc7d64b7a24fab21c8acd6324f9c1f (patch) | |
tree | 47ed55e044daccc95741e0b8a4c636234c976763 /scripts/lib/build_perf/html/measurement_chart.html | |
parent | 20fafa08540b089f1b100e00108939c3c59bd448 (diff) | |
download | poky-cf0c866b51cc7d64b7a24fab21c8acd6324f9c1f.tar.gz |
oe-build-perf-report: Add dark mode
Update css to add dark mode when window prefers-color-scheme is dark.
(From OE-Core rev: ed02a235d42202279ad5e4e3153247f9e5e2bba8)
Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/build_perf/html/measurement_chart.html')
-rw-r--r-- | scripts/lib/build_perf/html/measurement_chart.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html index 7982ec39c2..ad4a93ed02 100644 --- a/scripts/lib/build_perf/html/measurement_chart.html +++ b/scripts/lib/build_perf/html/measurement_chart.html | |||
@@ -81,13 +81,20 @@ | |||
81 | 81 | ||
82 | // Draw chart | 82 | // Draw chart |
83 | const chart_div = document.getElementById('{{ chart_elem_id }}'); | 83 | const chart_div = document.getElementById('{{ chart_elem_id }}'); |
84 | const measurement_chart= echarts.init(chart_div, null, { | 84 | // Set dark mode |
85 | height: 320 | 85 | let measurement_chart |
86 | }); | 86 | if (window.matchMedia('(prefers-color-scheme: dark)').matches) { |
87 | measurement_chart= echarts.init(chart_div, 'dark', { | ||
88 | height: 320 | ||
89 | }); | ||
90 | } else { | ||
91 | measurement_chart= echarts.init(chart_div, null, { | ||
92 | height: 320 | ||
93 | }); | ||
94 | } | ||
87 | // Change chart size with browser resize | 95 | // Change chart size with browser resize |
88 | window.addEventListener('resize', function() { | 96 | window.addEventListener('resize', function() { |
89 | measurement_chart.resize(); | 97 | measurement_chart.resize(); |
90 | }); | 98 | }); |
91 | measurement_chart.setOption(option); | 99 | measurement_chart.setOption(option); |
92 | </script> | 100 | </script> |
93 | |||