-
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.
fix: radar clashing axis titles (#618)
* fix: add textAlign for radar X axis title * refactor: use default as base for radar
- Loading branch information
1 parent
888bf49
commit c875950
Showing
2 changed files
with
20 additions
and
2 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
13 changes: 13 additions & 0 deletions
13
src/visualizations/config/adapters/dhis_highcharts/xAxis/radar.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,13 @@ | ||
import isString from 'd2-utilizr/lib/isString' | ||
import { FONT_STYLE_HORIZONTAL_AXIS_TITLE, FONT_STYLE_OPTION_TEXT_ALIGN, TEXT_ALIGN_CENTER } from '../../../../../modules/fontStyle' | ||
import { getDefault } from './' | ||
|
||
export default (store, layout) => { | ||
const config = getDefault(store, layout) | ||
|
||
if (isString(layout.domainAxisLabel) && config.title && layout.fontStyle[FONT_STYLE_HORIZONTAL_AXIS_TITLE][FONT_STYLE_OPTION_TEXT_ALIGN] === TEXT_ALIGN_CENTER) { | ||
config.title.textAlign = 'right' | ||
} | ||
|
||
return config | ||
} |