Commit 5f2433eb authored by Masayuki Tanaka's avatar Masayuki Tanaka Committed by masayuki

Add data.get interface

parent 13912e5b
......@@ -1612,6 +1612,15 @@
return __regions
}
c3.data.get = function (id) {
var target = c3.data.getAsTarget(id)
return typeof target !== 'undefined' ? target.values.map(function(d){ return d.value }) : undefined
}
c3.data.getAsTarget = function (id) {
var targets = getTargets(function(d){ return d.id == id })
return targets.length > 0 ? targets[0] : undefined
}
/*-- Load data and init chart with defined functions --*/
if ('url' in config.data) {
......
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