File tree Expand file tree Collapse file tree
packages/layerchart/src/routes/docs/components/AnnotationLine Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8282 </div >
8383</Preview >
8484
85+ <h2 >Vertical with rotation</h2 >
86+
87+ <Preview data ={data .appleStock }>
88+ <div class =" h-[300px] p-4 border rounded-sm" >
89+ <LineChart data ={data .appleStock } x ="date" y ="value" {renderContext } {debug }>
90+ {#snippet aboveMarks ({ context })}
91+ <AnnotationLine
92+ x ={new Date (' 2010-01-01' )}
93+ label =" Start"
94+ labelXOffset ={4 }
95+ props ={{
96+ line : { class : ' [stroke-dasharray:2,2] stroke-danger' },
97+ label : {
98+ class : ' fill-danger' ,
99+ rotate : - 90 ,
100+ textAnchor : ' end' ,
101+ verticalAnchor : ' end' ,
102+ dx : - 2 ,
103+ dy : 0 ,
104+ },
105+ }}
106+ />
107+
108+ <AnnotationLine
109+ x ={new Date (' 2010-12-31' )}
110+ label =" End"
111+ labelXOffset ={4 }
112+ props ={{
113+ line : { class : ' [stroke-dasharray:2,2] stroke-danger' },
114+ label : {
115+ class : ' fill-danger' ,
116+ rotate : 90 ,
117+ verticalAnchor : ' end' ,
118+ dx : - 4 ,
119+ dy : 0 ,
120+ },
121+ }}
122+ />
123+ {/ snippet }
124+ </LineChart >
125+ </div >
126+ </Preview >
127+
85128<h2 >Horizontal</h2 >
86129
87130<Preview data ={data .appleStock }>
You can’t perform that action at this time.
0 commit comments