Browse Source

Support json and rows on flow api - #424

pull/452/head
Masayuki Tanaka 10 years ago
parent
commit
30194f6b45
  1. 16
      c3.js
  2. 2
      c3.min.js
  3. 9
      htdocs/samples/api_flow.html

16
c3.js

@ -4942,9 +4942,23 @@
};
c3.flow = function (args) {
var targets = convertDataToTargets(convertColumnsToData(args.columns), true), notfoundIds = [],
var targets, data, notfoundIds = [],
orgDataCount = getMaxDataCount(), dataCount, domain, baseTarget, baseValue, length = 0, tail = 0, diff, to;
if (args.json) {
data = convertJsonToData(args.json, args.keys);
}
else if (args.rows) {
data = convertRowsToData(args.rows);
}
else if (args.columns) {
data = convertColumnsToData(args.columns);
}
else {
return;
}
targets = convertDataToTargets(data, true);
// Update/Add data
c3.data.targets.forEach(function (t) {
var found = false, i, j;

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

9
htdocs/samples/api_flow.html

@ -61,10 +61,11 @@
setTimeout(function () {
// Load only one data
chart.flow({
columns: [
['data1', 500, 200, 100],
['data2', 100, null, 50],
['data3', 200, null, null],
rows: [
['data1', 'data2', 'data3'],
[500, 100, 200],
[200, null, null],
[100, 50, null]
],
duration: 1500,

Loading…
Cancel
Save