|
|
@ -135,6 +135,13 @@ c3_chart_internal_fn.textForArcLabel = function (d) { |
|
|
|
return format ? format(value, ratio, id) : $$.defaultArcValueFormat(value, ratio); |
|
|
|
return format ? format(value, ratio, id) : $$.defaultArcValueFormat(value, ratio); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.textForGaugeMinMax = function (value, isMax) { |
|
|
|
|
|
|
|
var $$ = this, |
|
|
|
|
|
|
|
format = $$.getGaugeLabelExtents(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return format ? format(value, isMax) : value; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.expandArc = function (targetIds) { |
|
|
|
c3_chart_internal_fn.expandArc = function (targetIds) { |
|
|
|
var $$ = this, interval; |
|
|
|
var $$ = this, interval; |
|
|
|
|
|
|
|
|
|
|
@ -234,6 +241,11 @@ c3_chart_internal_fn.getArcLabelFormat = function () { |
|
|
|
return format; |
|
|
|
return format; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.getGaugeLabelExtents = function () { |
|
|
|
|
|
|
|
var $$ = this, config = $$.config; |
|
|
|
|
|
|
|
return config.gauge_label_extents; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.getArcTitle = function () { |
|
|
|
c3_chart_internal_fn.getArcTitle = function () { |
|
|
|
var $$ = this; |
|
|
|
var $$ = this; |
|
|
|
return $$.hasType('donut') ? $$.config.donut_title : ""; |
|
|
|
return $$.hasType('donut') ? $$.config.donut_title : ""; |
|
|
@ -405,11 +417,11 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf |
|
|
|
$$.arcs.select('.' + CLASS.chartArcsGaugeMin) |
|
|
|
$$.arcs.select('.' + CLASS.chartArcsGaugeMin) |
|
|
|
.attr("dx", -1 * ($$.innerRadius + (($$.radius - $$.innerRadius) / (config.gauge_fullCircle ? 1 : 2))) + "px") |
|
|
|
.attr("dx", -1 * ($$.innerRadius + (($$.radius - $$.innerRadius) / (config.gauge_fullCircle ? 1 : 2))) + "px") |
|
|
|
.attr("dy", "1.2em") |
|
|
|
.attr("dy", "1.2em") |
|
|
|
.text(config.gauge_label_show ? config.gauge_min : ''); |
|
|
|
.text(config.gauge_label_show ? $$.textForGaugeMinMax(config.gauge_min, false) : ''); |
|
|
|
$$.arcs.select('.' + CLASS.chartArcsGaugeMax) |
|
|
|
$$.arcs.select('.' + CLASS.chartArcsGaugeMax) |
|
|
|
.attr("dx", $$.innerRadius + (($$.radius - $$.innerRadius) / (config.gauge_fullCircle ? 1 : 2)) + "px") |
|
|
|
.attr("dx", $$.innerRadius + (($$.radius - $$.innerRadius) / (config.gauge_fullCircle ? 1 : 2)) + "px") |
|
|
|
.attr("dy", "1.2em") |
|
|
|
.attr("dy", "1.2em") |
|
|
|
.text(config.gauge_label_show ? config.gauge_max : ''); |
|
|
|
.text(config.gauge_label_show ? $$.textForGaugeMinMax(config.gauge_max, true) : ''); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.initGauge = function () { |
|
|
|
c3_chart_internal_fn.initGauge = function () { |
|
|
|