This repository was archived by the owner on Mar 19, 2021. It is now read-only.
File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<v-card >
3
- <div id =" chart" style =" width : 100% ; height : 420px ;" ></div >
3
+ <div ref =" chart" style =" width : 100% ; height : 420px ;" ></div >
4
4
</v-card >
5
5
</template >
6
6
<script >
@@ -44,8 +44,7 @@ export default {
44
44
this .ws .close ();
45
45
},
46
46
mounted () {
47
- const el = document .getElementById (" chart" );
48
- this .chart = new timechart (el, {
47
+ this .chart = new timechart (this .$refs .chart , {
49
48
baseTime: Date .now () - performance .now (),
50
49
series: [],
51
50
xRange: { min: 0 , max: 20 * 1000 },
@@ -56,12 +55,16 @@ export default {
56
55
isDark : function () {
57
56
if (this .isDark ) {
58
57
for (var i in this .chart .options .series ) {
59
- this .chart .options .series [i].color = this .lineColors .dark [i];
58
+ this .chart .options .series [i].color = this .lineColors .dark [i];
60
59
}
60
+ this .$refs .chart .querySelector (" chart-legend" ).style .backgroundColor =
61
+ " black" ;
61
62
} else {
62
63
for (i in this .chart .options .series ) {
63
- this .chart .options .series [i].color = this .lineColors .light [i];
64
+ this .chart .options .series [i].color = this .lineColors .light [i];
64
65
}
66
+ this .$refs .chart .querySelector (" chart-legend" ).style .backgroundColor =
67
+ " white" ;
65
68
}
66
69
this .chart .update ();
67
70
}
You can’t perform that action at this time.
0 commit comments