-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: hide no-data text by clearing string instead of setting opa…
…city to 0
- Loading branch information
1 parent
3065022
commit fa6f221
Showing
3 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/visualizations/config/adapters/dhis_highcharts/lang.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { VIS_TYPE_SINGLE_VALUE } from '../../../../modules/visTypes.js' | ||
|
||
export default function getLang(visType, extraOptions) { | ||
return { | ||
/* The SingleValue visualization consists of some custom SVG elements | ||
* rendered on an empty chart. Since the chart is empty, there is never | ||
* any data and Highcharts will show the noData text. To avoid this we | ||
* clear the text here. */ | ||
noData: | ||
visType === VIS_TYPE_SINGLE_VALUE | ||
? undefined | ||
: extraOptions.noData.text, | ||
resetZoom: extraOptions.resetZoom.text, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import { VIS_TYPE_SINGLE_VALUE } from '../../../../modules/visTypes.js' | ||
|
||
export default function (visualizationType) { | ||
export default function () { | ||
return { | ||
style: { | ||
fontSize: '13px', | ||
fontWeight: 'normal', | ||
/* Hide no data label for single value visualizations because | ||
* the data is always missing. */ | ||
opacity: visualizationType === VIS_TYPE_SINGLE_VALUE ? 0 : 1, | ||
}, | ||
} | ||
} |