File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/portals/SysBio/views/datasetsSummary Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 6969 >
7070 <div class =" small-chart-label" >{{ item.label }}</div >
7171 <div
72+ v-if =" hasDataForSmallChart(item)"
7273 :ref =" 'small-' + fieldName + '-' + item.key"
7374 class =" small-chart-container"
7475 :class =" chartType(fieldName) === 'pie' ? 'chart-pie-container' : 'chart-bar-container'"
7576 ></div >
77+ <div v-else class =" small-chart-container small-chart-na" >N/A</div >
7678 </div >
7779 </div >
7880 </div >
@@ -194,6 +196,11 @@ export default {
194196 }
195197 return items;
196198 },
199+ /** True if the small-chart item has at least one positive count to render. */
200+ hasDataForSmallChart (item ) {
201+ if (! item || typeof item .data !== " object" ) return false ;
202+ return Object .values (item .data ).some ((v ) => Number (v) > 0 );
203+ },
197204 /** Categories in a bar field that have contributions from 2+ programs. Used for vertical breakdown charts. */
198205 getBarCategoriesWithMultiplePrograms (fieldName ) {
199206 const breakdown = this .breakdownByField ;
@@ -746,4 +753,11 @@ export default {
746753 max-width : 132px ;
747754 min-height : 60px ;
748755}
756+ .small-chart-container.small-chart-na {
757+ display : flex ;
758+ align-items : center ;
759+ justify-content : center ;
760+ color : #6c757d ;
761+ font-size : 0.875rem ;
762+ }
749763 </style >
You can’t perform that action at this time.
0 commit comments