Commit aef885af authored by Masayuki Tanaka's avatar Masayuki Tanaka

Add oninit option - #502

parent a0833777
...@@ -264,6 +264,7 @@ ...@@ -264,6 +264,7 @@
// Draw with targets // Draw with targets
if (binding) { if (binding) {
$$.updateDimension(); $$.updateDimension();
$$.config.oninit.call($$);
$$.redraw({ $$.redraw({
withTransform: true, withTransform: true,
withUpdateXDomain: true, withUpdateXDomain: true,
...@@ -778,6 +779,7 @@ ...@@ -778,6 +779,7 @@
if (selection.node().parentNode) { if (selection.node().parentNode) {
window.clearInterval(interval); window.clearInterval(interval);
$$.updateDimension(); $$.updateDimension();
$$.config.oninit.call($$);
$$.redraw({ $$.redraw({
withTransform: true, withTransform: true,
withUpdateXDomain: true, withUpdateXDomain: true,
...@@ -878,6 +880,7 @@ ...@@ -878,6 +880,7 @@
onmouseout: function () {}, onmouseout: function () {},
onresize: function () {}, onresize: function () {},
onresized: function () {}, onresized: function () {},
oninit: function () {},
transition_duration: 350, transition_duration: 350,
data_x: undefined, data_x: undefined,
data_xs: {}, data_xs: {},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -16,6 +16,7 @@ c3_chart_internal_fn.getDefaultConfig = function () { ...@@ -16,6 +16,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
onmouseout: function () {}, onmouseout: function () {},
onresize: function () {}, onresize: function () {},
onresized: function () {}, onresized: function () {},
oninit: function () {},
transition_duration: 350, transition_duration: 350,
data_x: undefined, data_x: undefined,
data_xs: {}, data_xs: {},
......
...@@ -259,6 +259,7 @@ c3_chart_internal_fn.initWithData = function (data) { ...@@ -259,6 +259,7 @@ c3_chart_internal_fn.initWithData = function (data) {
// Draw with targets // Draw with targets
if (binding) { if (binding) {
$$.updateDimension(); $$.updateDimension();
$$.config.oninit.call($$);
$$.redraw({ $$.redraw({
withTransform: true, withTransform: true,
withUpdateXDomain: true, withUpdateXDomain: true,
...@@ -773,6 +774,7 @@ c3_chart_internal_fn.observeInserted = function (selection) { ...@@ -773,6 +774,7 @@ c3_chart_internal_fn.observeInserted = function (selection) {
if (selection.node().parentNode) { if (selection.node().parentNode) {
window.clearInterval(interval); window.clearInterval(interval);
$$.updateDimension(); $$.updateDimension();
$$.config.oninit.call($$);
$$.redraw({ $$.redraw({
withTransform: true, withTransform: true,
withUpdateXDomain: true, withUpdateXDomain: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment