File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ export default function annotations(options: { owner: Chart }) {
4141 return [ [ [ xRange [ 0 ] , 0 ] , [ xRange [ 1 ] , 0 ] ] ]
4242 }
4343 } )
44+ const pathEnter = path . enter ( ) . append ( 'path' )
4445 path
45- . enter ( )
46- . append ( 'path' )
46+ . merge ( pathEnter )
4747 . attr ( 'stroke' , '#eee' )
4848 . attr ( 'd' , line as any )
4949 path . exit ( ) . remove ( )
@@ -61,9 +61,13 @@ export default function annotations(options: { owner: Chart }) {
6161 }
6262 ]
6363 } )
64+ const textEnter = text . enter ( ) . append ( 'text' )
65+
6466 text
65- . enter ( )
66- . append ( 'text' )
67+ . merge ( textEnter )
68+ . text ( function ( d ) {
69+ return d . text
70+ } )
6771 . attr ( 'y' , function ( d ) {
6872 return d . hasX ? 3 : 0
6973 } )
@@ -79,9 +83,6 @@ export default function annotations(options: { owner: Chart }) {
7983 . attr ( 'transform' , function ( d ) {
8084 return d . hasX ? 'rotate(-90)' : ''
8185 } )
82- . text ( function ( d ) {
83- return d . text
84- } )
8586 text . exit ( ) . remove ( )
8687
8788 // enter + update
You can’t perform that action at this time.
0 commit comments