Commit 4bfe25de authored by Masayuki Tanaka's avatar Masayuki Tanaka

Add onend callback for flow

parent 75d9119a
......@@ -3944,6 +3944,7 @@
flowEnd = getValueOnIndex(c3.data.targets[0].values, flowIndex + flowLength),
orgDomain = x.domain(),
durationForFlow = options.flow.duration || duration,
onend = options.flow.onend || function () {},
wait = generateWait();
// remove head data after rendered
......@@ -4025,8 +4026,8 @@
.attr("width", __axis_rotated ? width : rectW)
.attr("height", __axis_rotated ? rectW : height);
// callback here?
// callback for end of flow
onend();
});
} : null);
......@@ -4778,7 +4779,8 @@
flow: {
index: c3.data.targets[0].values[0].index,
length: length,
duration: args.duration
duration: args.duration,
onend: args.onend,
},
withLegend: true
});
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -67,7 +67,16 @@
['data2', 100],
['data3', 200],
],
duration: 500
duration: 500,
onend: function () {
chart.flow({
columns: [
['data1', 200],
['data3', 100]
],
duration: 150
});
}
});
}, 1000);
......@@ -80,7 +89,7 @@
],
duration: 150
});
}, 2000);
}, 3000);
setTimeout(function () {
chart.flow({
......@@ -90,7 +99,7 @@
['data3', 400]
]
});
}, 3000);
}, 4000);
</script>
</body>
......
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