@@ -245,6 +245,11 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
245
245
. innerRadius ( innerRadius ) . outerRadius ( radius )
246
246
. startAngle ( - theta ) ;
247
247
248
+ var valueArcPath = d3 . svg . arc ( )
249
+ . innerRadius ( ( innerRadius + radius ) / 2 - cn . valueHeight / 2 * ( radius - innerRadius ) )
250
+ . outerRadius ( ( innerRadius + radius ) / 2 + cn . valueHeight / 2 * ( radius - innerRadius ) )
251
+ . startAngle ( - theta ) ;
252
+
248
253
// TODO: DRY up the following code to draw the different arcs
249
254
// Draw background
250
255
var bgArc = gauge . selectAll ( 'g.bgArc' ) . data ( cd ) ;
@@ -278,10 +283,10 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
278
283
. ease ( transitionOpts . easing )
279
284
. each ( 'end' , function ( ) { onComplete && onComplete ( ) ; } )
280
285
. each ( 'interrupt' , function ( ) { onComplete && onComplete ( ) ; } )
281
- . attrTween ( 'd' , arcTween ( arcPath , valueToAngle ( cd [ 0 ] . lastY ) , valueToAngle ( cd [ 0 ] . y ) ) ) ;
286
+ . attrTween ( 'd' , arcTween ( valueArcPath , valueToAngle ( cd [ 0 ] . lastY ) , valueToAngle ( cd [ 0 ] . y ) ) ) ;
282
287
} else {
283
288
fgArcPath
284
- . attr ( 'd' , arcPath . endAngle ( valueToAngle ( cd [ 0 ] . y ) ) ) ;
289
+ . attr ( 'd' , valueArcPath . endAngle ( valueToAngle ( cd [ 0 ] . y ) ) ) ;
285
290
}
286
291
fgArcPath
287
292
. style ( 'fill' , trace . gauge . value . color )
@@ -376,8 +381,8 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
376
381
// Axes.drawOne(gd, xa);
377
382
// Axes.drawOne(gd, ya);
378
383
// }
379
- var bulletHeight = 35 ;
380
- var innerBulletHeight = 0.6 * bulletHeight ;
384
+ var bulletHeight = cn . bulletHeight ;
385
+ var innerBulletHeight = cn . valueHeight * bulletHeight ;
381
386
var bulletVerticalMargin = bignumberVerticalMargin - bulletHeight / 2 ;
382
387
var bullet = d3 . select ( this ) . selectAll ( 'g.bullet' ) . data ( data ) ;
383
388
bullet . enter ( ) . append ( 'g' ) . classed ( 'bullet' , true ) ;
0 commit comments