Browse Source

Allow datum index to be passed as a third parameter to the data labels format function

pull/675/head
edcartre 10 years ago
parent
commit
6ffb1172ed
  1. 2
      c3.js
  2. 2
      c3.min.js
  3. 2
      src/text.js

2
c3.js

@ -3075,7 +3075,7 @@
.style("fill", function (d) { return $$.color(d); })
.style("fill-opacity", 0);
$$.mainText
.text(function (d) { return $$.formatByAxisId($$.getAxisId(d.id))(d.value, d.id); });
.text(function (d, i) { return $$.formatByAxisId($$.getAxisId(d.id))(d.value, d.id, i); });
$$.mainText.exit()
.transition().duration(durationForExit)
.style('fill-opacity', 0)

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/text.js

@ -32,7 +32,7 @@ c3_chart_internal_fn.redrawText = function (durationForExit) {
.style("fill", function (d) { return $$.color(d); })
.style("fill-opacity", 0);
$$.mainText
.text(function (d) { return $$.formatByAxisId($$.getAxisId(d.id))(d.value, d.id); });
.text(function (d, i) { return $$.formatByAxisId($$.getAxisId(d.id))(d.value, d.id, i); });
$$.mainText.exit()
.transition().duration(durationForExit)
.style('fill-opacity', 0)

Loading…
Cancel
Save