I would like to create a bubbleChart
using dc.js with two ordinal axis. When I try it, all my bubbles end up at the top of the Y-axis and the Y-axis does not seem top be ordinal.
Is there a way to do that properly ?
Here is my configuration for the bubbleChart
:
.dimension(dims.currencyinstrument)
.group(groups.currencyinstrument.pnlSum)
.keyAccessor(function(d) {
return d.key.split("~")[0]
})
.valueAccessor(function(d) {
return d.key.split("~")[1]
})
.radiusValueAccessor(function(d) {
return Math.abs(d.value)
})
.x(d3.scale.ordinal().domain(groups.currencyinstrument.pnlSum.all().map(function(d) {return(d.key.split("~")[0])}).unshift("")))
.y(d3.scale.ordinal().domain(groups.currencyinstrument.pnlSum.all().map(function(d) {return(d.key.split("~")[1])}).unshift("")))
.r(d3.scale.linear().domain([0,groups.currencyinstrument.pnlSum.all().map(function(d) {return(Math.abs(d.value))}).sort(function(a,b){return(b-a)})[0]]))
EDIT : here is the fiddle. The data takes a while (~1min) to load from GitHub but it's all worth it !