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

Skip to content

Commit b12a125

Browse files
committed
fix bullet
1 parent aa77697 commit b12a125

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/traces/indicator/plot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
121121
gaugeFontSize = Math.max(0.25 * mainFontSize, (radius - innerRadius) / 4);
122122
labelFontSize = gaugeFontSize;
123123
tickerVerticalMargin = bignumberVerticalMargin + tickerFontSize;
124+
if(!isBigNumber) tickerBaseline = 'bottom';
124125
}
125126
if(isBullet) {
126127
// Center the text
@@ -136,7 +137,6 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
136137
if(!isBigNumber) {
137138
tickerFontSize = 0.75 * mainFontSize;
138139
tickerVerticalMargin = bignumberVerticalMargin;
139-
tickerBaseline = 'bottom';
140140
}
141141
}
142142

@@ -381,7 +381,7 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
381381
bullet.enter().append('g').classed('bullet', true);
382382
bullet.attr('transform', 'translate(' + size.l + ',' + bulletVerticalMargin + ')');
383383

384-
var scale = d3.scale.linear().domain([trace.min, trace.max]).range([0, 0.75 * size.w]);
384+
var scale = d3.scale.linear().domain([trace.min, trace.max]).range([0, ((isBigNumber || hasTicker) ? 0.75 : 1.0) * size.w]);
385385

386386
var bgBullet = bullet.selectAll('g.bgBullet').data(cd);
387387
bgBullet.enter().append('g').classed('bgBullet', true).append('rect');

0 commit comments

Comments
 (0)