BubbleChart with two ordinal scales in dc.js

I would like to create bubbleChartusing dc.js with two ordinal axes. When I try to do this, all of my bubbles end at the top of the Y axis, and the Y axis does not seem to be in order from above.

Is there any way to do this right?

Here is my configuration for 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's a fiddle . Data is downloaded from GitHub (~ 1 min), but it all costs!

+3
source share
1 answer

The short answer is that the GridMixin coordinate does not currently support Y ordinal scales.

, _prepareYAxis, , :

dc.override(pnlPerCurrencyInstrumentTypebubbleChart, "_prepareYAxis", function(g) {
    this.__prepareYAxis(g);
    this.y().rangeBands([this.yAxisHeight(), 0])
});

http://jsfiddle.net/gordonwoodhull/xZFx4/10/

, . , :

https://github.com/dc-js/dc.js/issues/539

: , , , ... guess CoordinationGridMixin , .

+2

All Articles