@@ -106,6 +106,8 @@ class CandlestickView extends ChartView {
106106 group . removeAll ( ) ;
107107 }
108108
109+ const transPointDim = getTransPointDimension ( seriesModel ) ;
110+
109111 data . diff ( oldData )
110112 . add ( function ( newIdx ) {
111113 if ( data . hasValue ( newIdx ) ) {
@@ -115,7 +117,7 @@ class CandlestickView extends ChartView {
115117 return ;
116118 }
117119
118- const el = createNormalBox ( itemLayout , newIdx , true ) ;
120+ const el = createNormalBox ( itemLayout , newIdx , transPointDim , true ) ;
119121 graphic . initProps ( el , { shape : { points : itemLayout . ends } } , seriesModel , newIdx ) ;
120122
121123 setBoxCommon ( el , data , newIdx , isSimpleBox ) ;
@@ -141,7 +143,7 @@ class CandlestickView extends ChartView {
141143 }
142144
143145 if ( ! el ) {
144- el = createNormalBox ( itemLayout , newIdx ) ;
146+ el = createNormalBox ( itemLayout , newIdx , transPointDim ) ;
145147 }
146148 else {
147149 graphic . updateProps ( el , {
@@ -188,10 +190,12 @@ class CandlestickView extends ChartView {
188190 const data = seriesModel . getData ( ) ;
189191 const isSimpleBox = data . getLayout ( 'isSimpleBox' ) ;
190192
193+ const transPointDim = getTransPointDimension ( seriesModel ) ;
194+
191195 let dataIndex ;
192196 while ( ( dataIndex = params . next ( ) ) != null ) {
193197 const itemLayout = data . getItemLayout ( dataIndex ) as CandlestickItemLayout ;
194- const el = createNormalBox ( itemLayout , dataIndex ) ;
198+ const el = createNormalBox ( itemLayout , dataIndex , transPointDim ) ;
195199 setBoxCommon ( el , data , dataIndex , isSimpleBox ) ;
196200
197201 el . incremental = true ;
@@ -262,12 +266,17 @@ class NormalBoxPath extends Path<NormalBoxPathProps> {
262266}
263267
264268
265- function createNormalBox ( itemLayout : CandlestickItemLayout , dataIndex : number , isInit ?: boolean ) {
269+ function createNormalBox (
270+ itemLayout : CandlestickItemLayout ,
271+ dataIndex : number ,
272+ constDim : number ,
273+ isInit ?: boolean
274+ ) {
266275 const ends = itemLayout . ends ;
267276 return new NormalBoxPath ( {
268277 shape : {
269278 points : isInit
270- ? transInit ( ends , itemLayout )
279+ ? transInit ( ends , constDim , itemLayout )
271280 : ends
272281 } ,
273282 z2 : 100
@@ -310,14 +319,18 @@ function setBoxCommon(el: NormalBoxPath, data: SeriesData, dataIndex: number, is
310319 toggleHoverEmphasis ( el , emphasisModel . get ( 'focus' ) , emphasisModel . get ( 'blurScope' ) , emphasisModel . get ( 'disabled' ) ) ;
311320}
312321
313- function transInit ( points : number [ ] [ ] , itemLayout : CandlestickItemLayout ) {
322+ function transInit ( points : number [ ] [ ] , dim : number , itemLayout : CandlestickItemLayout ) {
314323 return zrUtil . map ( points , function ( point ) {
315324 point = point . slice ( ) ;
316- point [ 1 ] = itemLayout . initBaseline ;
325+ point [ dim ] = itemLayout . initBaseline ;
317326 return point ;
318327 } ) ;
319328}
320329
330+ function getTransPointDimension ( seriesModel : CandlestickSeriesModel ) : number {
331+ return seriesModel . getWhiskerBoxesLayout ( ) === 'horizontal' ? 1 : 0 ;
332+ }
333+
321334
322335
323336class LargeBoxPathShape {
0 commit comments