@@ -223,14 +223,16 @@ export abstract class D3VisualizationBuilderService<
223
223
const isLegendVisible = this . isLegendVisible ( config ) ;
224
224
const isTopOrBottomLegend = this . isTopOrBottomLegend ( config ) ;
225
225
const isSideLegend = config . legend === LegendPosition . Right ;
226
- let legendWidth = isLegendVisible ? 0
226
+ let legendWidth = isLegendVisible
227
+ ? 0
227
228
: isSideLegend
228
229
? Math . min ( legendRect . width , this . getMaxLegendWidth ( ) )
229
230
: isTopOrBottomLegend
230
231
? outerRect . width
231
232
: 0 ;
232
233
233
- let legendHeight = isLegendVisible ? 0
234
+ let legendHeight = isLegendVisible
235
+ ? 0
234
236
: isTopOrBottomLegend
235
237
? Math . min ( legendRect . height , this . getMaxLegendHeight ( ) )
236
238
: isSideLegend
@@ -244,13 +246,13 @@ export abstract class D3VisualizationBuilderService<
244
246
let vizHeight = outerRect . height - legendHeightOffset ;
245
247
246
248
// Hide Legend if less space is available for the viz
247
- if ( vizWidth <= legendWidthOffset || legendWidth <= 60 ) {
248
- vizWidth = outerRect . width
249
+ if ( vizWidth <= legendWidthOffset || legendWidth <= 60 ) {
250
+ vizWidth = outerRect . width ;
249
251
legendWidth = 0 ;
250
252
}
251
253
252
- if ( vizHeight <= legendHeightOffset || legendHeight <= 12 ) {
253
- vizHeight = outerRect . height
254
+ if ( vizHeight <= legendHeightOffset || legendHeight <= 12 ) {
255
+ vizHeight = outerRect . height ;
254
256
legendHeight = 0 ;
255
257
}
256
258
@@ -264,7 +266,7 @@ export abstract class D3VisualizationBuilderService<
264
266
265
267
private isLegendVisible ( config : ChartConfig ) : boolean {
266
268
return config . legend === LegendPosition . None ;
267
- }
269
+ }
268
270
269
271
private isTopOrBottomLegend ( config : ChartConfig ) : boolean {
270
272
switch ( config . legend ) {
0 commit comments