Merge pull request #4149 from dataease/pr@dev@feat_fuc

feat(视图): 柱状图、折线图支持结果隐藏空数据
This commit is contained in:
Junjun 2022-12-21 13:16:33 +08:00 committed by GitHub
commit b12fd5d406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -927,7 +927,9 @@ public class ChartViewService {
PageInfo pageInfo = new PageInfo();
pageInfo.setGoPage(chartExtRequest.getGoPage());
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
pageInfo.setPageSize(Math.min(view.getResultCount() - (chartExtRequest.getGoPage() - 1) * chartExtRequest.getPageSize(), chartExtRequest.getPageSize()));
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
pageInfo.setPageSize(Math.min(view.getResultCount() - (chartExtRequest.getGoPage() - 1) * chartExtRequest.getPageSize(), chartExtRequest.getPageSize()));
}
} else {
pageInfo.setPageSize(chartExtRequest.getPageSize());
}

View File

@ -371,7 +371,7 @@ export function getTooltip(chart) {
} else {
res = param.value
}
obj.value = res
obj.value = res === null ? '' : res
return obj
}
}

View File

@ -23,6 +23,9 @@ export const formatterType = [
]
export function valueFormatter(value, formatter) {
if (value === null || value === undefined) {
return null
}
// 1.unit 2.decimal 3.thousand separator and suffix
let result
if (formatter.type === 'auto') {

View File

@ -76,11 +76,8 @@
v-model="functionForm.emptyDataStrategy"
@change="changeFunctionCfg"
>
<el-radio :label="'breakLine'">{{ chart.type.includes('bar')?$t('chart.set_zero'):$t('chart.break_line') }}</el-radio>
<el-radio
v-if="chart.type.includes('line') || chart.type.includes('area')"
:label="'setZero'"
>{{ $t('chart.set_zero') }}</el-radio>
<el-radio :label="'breakLine'">{{ $t('chart.break_line') }}</el-radio>
<el-radio :label="'setZero'">{{ $t('chart.set_zero') }}</el-radio>
<el-radio :label="'ignoreData'">{{ $t('chart.ignore_data') }}</el-radio>
</el-radio-group>
</el-form-item>