Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bb1388

Browse files
committed
make tickons:'boundaries' the dflt on multicategory axes
1 parent e313064 commit 2bb1388

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/plots/cartesian/axis_defaults.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,18 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
9090

9191
if(options.automargin) coerce('automargin');
9292

93+
var isMultiCategory = containerOut.type === 'multicategory';
94+
9395
if(!options.noTickson &&
94-
(containerOut.type === 'category' || containerOut.type === 'multicategory') &&
96+
(containerOut.type === 'category' || isMultiCategory) &&
9597
(containerOut.ticks || containerOut.showgrid)
9698
) {
97-
coerce('tickson');
99+
var ticksonDflt;
100+
if(isMultiCategory) ticksonDflt = 'boundaries';
101+
coerce('tickson', ticksonDflt);
98102
}
99103

100-
if(containerOut.type === 'multicategory') {
104+
if(isMultiCategory) {
101105
var showDividers = coerce('showdividers');
102106
if(showDividers) {
103107
coerce('dividercolor');
312 Bytes
Loading
-99 Bytes
Loading

test/image/mocks/multicategory.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"xaxis": {
2222
"title": "MULTI-CATEGORY",
2323
"tickfont": {"size": 16},
24-
"ticks": "outside",
25-
"tickson": "boundaries"
24+
"ticks": "outside"
2625
}
2726
}
2827
}

test/image/mocks/multicategory2.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"xaxis": {
2828
"title": "MULTI-CATEGORY ON TOP",
2929
"side": "top",
30-
"automargin": true
30+
"automargin": true,
31+
"tickson": "labels"
3132
},
3233
"showlegend": false,
3334
"width": 400,

0 commit comments

Comments
 (0)