@@ -180,8 +180,8 @@ const getTitleProps = (props, borderProps) => {
180
180
181
181
const getBorderProps = ( props , contentHeight , contentWidth ) => {
182
182
const { x, y, borderPadding, style } = props ;
183
- const height = contentHeight + borderPadding . top + borderPadding . bottom ;
184
- const width = contentWidth + borderPadding . left + borderPadding . right ;
183
+ const height = ( contentHeight || 0 ) + borderPadding . top + borderPadding . bottom ;
184
+ const width = ( contentWidth || 0 ) + borderPadding . left + borderPadding . right ;
185
185
return { x, y, height, width, style : assign ( { fill : "none" } , style . border ) } ;
186
186
} ;
187
187
@@ -225,16 +225,17 @@ const getBaseProps = (props, fallbackProps) => {
225
225
y : rowGutter && typeof rowGutter === "object" ? rowGutter . top || 0 : 0
226
226
} ;
227
227
const { height, width } = getDimensions ( props , fallbackProps ) ;
228
+ const borderProps = getBorderProps ( props , height , width ) ;
229
+ const titleProps = getTitleProps ( props , borderProps ) ;
228
230
const initialProps = {
229
231
parent : {
230
232
data, standalone, theme, padding, name,
231
233
height : props . height ,
232
234
width : props . width ,
233
235
style : style . parent
234
- }
236
+ } ,
237
+ all : { border : borderProps , title : titleProps }
235
238
} ;
236
- const borderProps = getBorderProps ( props , height , width ) ;
237
- const titleProps = getTitleProps ( props , borderProps ) ;
238
239
return groupedData . reduce ( ( childProps , datum , i ) => {
239
240
const color = colorScale [ i % colorScale . length ] ;
240
241
const dataStyle = defaults ( { } , datum . symbol , style . data , { fill : color } ) ;
@@ -259,9 +260,7 @@ const getBaseProps = (props, fallbackProps) => {
259
260
y : dataProps . y ,
260
261
x : dataProps . x + datum . symbolSpacer + ( datum . size / 2 )
261
262
} ;
262
- childProps [ eventKey ] = eventKey === 0 ?
263
- { data : dataProps , labels : labelProps , border : borderProps , title : titleProps } :
264
- { data : dataProps , labels : labelProps } ;
263
+ childProps [ eventKey ] = { data : dataProps , labels : labelProps } ;
265
264
266
265
return childProps ;
267
266
} , initialProps ) ;
0 commit comments