File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -491,9 +491,17 @@ export class DualKpi implements IVisual {
491491 this . eventService . renderingStarted ( options )
492492 try {
493493 const dataView : DataView = this . dataView = options . dataViews && options . dataViews [ 0 ] ;
494+
495+ const hasAxis = dataView ?. categorical ?. categories ?. some ( category => category . source . roles [ "axis" ] ) ;
496+ const hasTopValues = dataView ?. categorical ?. values ?. some ( value => value . source . roles [ "topvalues" ] ) ;
497+ const hasBottomValues = dataView ?. categorical ?. values ?. some ( value => value . source . roles [ "bottomvalues" ] ) ;
498+
494499 if ( ! dataView ||
495500 ! dataView . metadata ||
496- ! dataView . metadata . columns ) {
501+ ! dataView . metadata . columns ||
502+ ( ! hasBottomValues && ! hasTopValues ) ||
503+ ! hasAxis
504+ ) {
497505
498506 this . displayRootElement ( false ) ;
499507
@@ -534,7 +542,7 @@ export class DualKpi implements IVisual {
534542 this . eventService . renderingFinished ( options )
535543 } catch ( error ) {
536544 this . eventService . renderingFailed ( options , error ) ;
537- console . error ( error ) ;
545+ console . error ( "Rendering error" , error ) ;
538546 }
539547 }
540548
You can’t perform that action at this time.
0 commit comments