Skip to content

Commit 0c71e7f

Browse files
committed
fix axes names during creation
1 parent a0317b5 commit 0c71e7f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib/getAllAxes.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,16 @@ function getSubplotNumber(axis) {
7575
const splitSubplot = axis._subplot
7676
? axis._subplot.split(axis._axisGroup)
7777
: [];
78-
return splitSubplot[1] ? Number(splitSubplot[1]) : 0;
78+
return splitSubplot[1]
79+
? Number(splitSubplot[1])
80+
: axis._name.split('axis')[1];
7981
}
8082

8183
export function getAxisTitle(axis) {
8284
const axisType = capitalize(axis._name.split('axis')[0]);
83-
const subplotNb = getSubplotNumber(axis);
85+
const subplotNb = getSubplotNumber(axis) || 1;
8486

8587
return axis._input && axis._input.title
8688
? striptags(`${axisType}: ${axis._input.title}`)
87-
: striptags(`${axisType} ${subplotNb === 0 ? 1 : subplotNb}`);
89+
: striptags(`${axisType} ${subplotNb}`);
8890
}

0 commit comments

Comments
 (0)