File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
apps/web/src/common/modules/widgets/_widgets/gauge Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,10 @@ const errorMessage = computed<string|undefined>(() => {
178178/* Util */
179179const drawChart = (rawData : WidgetLoadResponse | null ) => {
180180 if (isEmpty (rawData )) return ;
181- state .chartData = rawData ?.results ?.[0 ]?.[widgetOptionsState .dataFieldInfo ?.data as string ] || 0 ;
181+ // HACK: Change the code below when the backend data is modified
182+ // state.chartData = rawData?.results?.[0]?.[widgetOptionsState.dataFieldInfo?.data as string] || 0;
183+ const _targetData = state .data ?.results ?.find ((d ) => !! d [widgetOptionsState .dataFieldInfo ?.data as string ]);
184+ state .chartData = _targetData ?.[widgetOptionsState .dataFieldInfo ?.data as string ] || 0 ;
182185};
183186const loadWidget = () => {
184187 state .runQueries = true ;
You can’t perform that action at this time.
0 commit comments