File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
sandboxes/custom/src/components Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,16 @@ import { createTypedChart } from 'vue-chartjs'
2
2
import { LineController } from 'chart.js'
3
3
4
4
class LineWithLineController extends LineController {
5
+ static override id = 'line-with-line'
6
+
5
7
public override draw ( ) {
6
8
super . draw ( )
7
9
8
- console . log ( this . chart ?. tooltip ?. active )
9
-
10
- if ( this . chart ?. tooltip ?. active ) {
10
+ if ( this . chart ?. tooltip && this . chart . tooltip . opacity > 0 ) {
11
11
const ctx = this . chart . ctx
12
12
const x = this . chart . tooltip . x
13
- const topY = this . chart . scales [ 'y-axis-0' ] . top
14
- const bottomY = this . chart . scales [ 'y-axis-0' ] . bottom
13
+ const topY = this . chart . scales . y . top
14
+ const bottomY = this . chart . scales . y . bottom
15
15
16
16
// draw line
17
17
ctx . save ( )
@@ -26,6 +26,9 @@ class LineWithLineController extends LineController {
26
26
}
27
27
}
28
28
29
- const LineWithLineChart = createTypedChart ( 'line' , LineWithLineController )
29
+ const LineWithLineChart = createTypedChart (
30
+ 'line-with-line' as 'line' ,
31
+ LineWithLineController
32
+ )
30
33
31
34
export default LineWithLineChart
You can’t perform that action at this time.
0 commit comments