Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit abe1cf6

Browse files
authored
Merge pull request #121 from noahamac/master
adding error handling for no results in the LFG viz
2 parents 3bdf48c + 00d336f commit abe1cf6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/examples/liquid_fill_gauge/liquid_fill_gauge.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const vis: LiquidFillGaugeVisualization = {
208208
this.svg.attr('id', elementId)
209209
},
210210
// Render in response to the data or settings changing
211-
update(data, element, config, queryResponse) {
211+
update(data, element, config, queryResponse, details) {
212212
if (!handleErrors(this, queryResponse, {
213213
min_pivots: 0, max_pivots: 0,
214214
min_dimensions: 0, max_dimensions: undefined,
@@ -222,6 +222,9 @@ const vis: LiquidFillGaugeVisualization = {
222222
if (gaugeConfig.maxValue <= 0) {
223223
this.addError({ group: 'config', title: 'Max value must be greater than zero.' })
224224
return
225+
} else if (data.length === 0) {
226+
this.addError({ title: 'No results.' })
227+
return
225228
} else {
226229
this.clearErrors('config')
227230
}

0 commit comments

Comments
 (0)