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

Add onend callback for flow

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