Browse Source

Add onrendered callback - #880

pull/938/head
Masayuki Tanaka 10 years ago
parent
commit
f71ba1519e
  1. 13
      c3.js
  2. 6
      c3.min.js
  3. 1
      src/config.js
  4. 12
      src/core.js

13
c3.js

@ -641,8 +641,12 @@
});
})
.call(waitForDraw, function () {
if (flow) { flow(); }
// onrendered callback
if (flow) {
flow();
}
if (config.onrendered) {
config.onrendered.call($$);
}
});
}
else {
@ -650,7 +654,9 @@
$$.redrawLine(drawLine);
$$.redrawArea(drawArea);
$$.redrawCircle(cx, cy);
// onrendered callback
if (config.onrendered) {
config.onrendered.call($$);
}
}
// update fadein condition
@ -968,6 +974,7 @@
onresize: function () {},
onresized: function () {},
oninit: function () {},
onrendered: function () {},
transition_duration: 350,
data_x: undefined,
data_xs: {},

6
c3.min.js vendored

File diff suppressed because one or more lines are too long

1
src/config.js

@ -20,6 +20,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
onresize: function () {},
onresized: function () {},
oninit: function () {},
onrendered: function () {},
transition_duration: 350,
data_x: undefined,
data_xs: {},

12
src/core.js

@ -636,8 +636,12 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
});
})
.call(waitForDraw, function () {
if (flow) { flow(); }
// onrendered callback
if (flow) {
flow();
}
if (config.onrendered) {
config.onrendered.call($$);
}
});
}
else {
@ -645,7 +649,9 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
$$.redrawLine(drawLine);
$$.redrawArea(drawArea);
$$.redrawCircle(cx, cy);
// onrendered callback
if (config.onrendered) {
config.onrendered.call($$);
}
}
// update fadein condition

Loading…
Cancel
Save