|
|
@ -312,12 +312,12 @@ |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
function addCache (id, target) { |
|
|
|
function addCache (id, target) { |
|
|
|
cache[id] = target |
|
|
|
cache[id] = cloneTarget(target) |
|
|
|
} |
|
|
|
} |
|
|
|
function getCaches (ids) { |
|
|
|
function getCaches (ids) { |
|
|
|
var targets = [] |
|
|
|
var targets = [] |
|
|
|
for (var i = 0; i < ids.length; i++){ |
|
|
|
for (var i = 0; i < ids.length; i++){ |
|
|
|
if (ids[i] in cache) targets.push(cache[ids[i]]) |
|
|
|
if (ids[i] in cache) targets.push(cloneTarget(cache[ids[i]])) |
|
|
|
} |
|
|
|
} |
|
|
|
return targets |
|
|
|
return targets |
|
|
|
} |
|
|
|
} |
|
|
@ -376,6 +376,15 @@ |
|
|
|
|
|
|
|
|
|
|
|
return targets |
|
|
|
return targets |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function cloneTarget (target) { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
id : target.id, |
|
|
|
|
|
|
|
id_org : target.id_org, |
|
|
|
|
|
|
|
values : target.values.map(function(d){ |
|
|
|
|
|
|
|
return {x: d.x, value: d.value, id: d.id} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
function maxDataCount () { |
|
|
|
function maxDataCount () { |
|
|
|
return d3.max(c3.data.targets, function(t){ return t.values.length }) |
|
|
|
return d3.max(c3.data.targets, function(t){ return t.values.length }) |
|
|
|
} |
|
|
|
} |
|
|
|