We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordering works fine for row charts, but doesn't work on my bar chart version of same data. I can work around this
Here is bar chart code which doesn't do ordering - everything else works OK eg title;
sitecostchart.width(450) .height(340) .outerPadding(0) .gap(1) .margins({top: 0, right: 30, bottom: 50, left: 45}) .on("postRender", function( chart ){ adjustBarChartLabels(chart); }) .x(d3.scale.ordinal()) .xUnits(dc.units.ordinal) .brushOn(false) .elasticY(true) .ordering(function(d) {return -d.value }) .yAxisLabel("Cost £") .title(function(d) {return d.key + " £" + currFormat(d3.round(d.value)) + " (" + d3.round((d.value / d3.sum(sitecostsum.all(), function(d){ return d.value;}))*100,1) +"%)";}) .dimension(sitecost) .group(sitecostsum);
Here is row chart code for same data where ordering works fine;
sitecostchart.width(350) .height(400) .margins({top: 10, right: 0, bottom: 20, left: 0}) .dimension(sitecost) .group(sitecostsum) .title(function(d) {return d.key + " £" + currFormat(d3.round(d.value)) + " (" + d3.round((d.value / d3.sum(sitecostsum.all(), function(d){ return d.value;}))*100,1) +"%)";}) .transitionDuration(500) .elasticX(true) .ordering(function(d) {return -d.value }) .xAxis().ticks(5);
The text was updated successfully, but these errors were encountered:
Confirmed - although coordinateGridMixin defines ordinalXDomain, this is immediately overridden by the stackMixin and never gets called for bar charts or line charts.
Looks like this might have been broken by 824b139. Will take more investigation to understand what was intended there.
Sorry, something went wrong.
@lbk3918 Could you please provide your workaround?
c28302a
No branches or pull requests
Ordering works fine for row charts, but doesn't work on my bar chart version of same data.
I can work around this
Here is bar chart code which doesn't do ordering - everything else works OK eg title;
sitecostchart.width(450)
.height(340)
.outerPadding(0)
.gap(1)
.margins({top: 0, right: 30, bottom: 50, left: 45})
.on("postRender", function( chart ){
adjustBarChartLabels(chart);
})
.x(d3.scale.ordinal())
.xUnits(dc.units.ordinal)
.brushOn(false)
.elasticY(true)
.ordering(function(d) {return -d.value })
.yAxisLabel("Cost £")
.title(function(d) {return d.key +
" £" + currFormat(d3.round(d.value)) +
" (" + d3.round((d.value / d3.sum(sitecostsum.all(),
function(d){ return d.value;}))*100,1) +"%)";})
.dimension(sitecost)
.group(sitecostsum);
Here is row chart code for same data where ordering works fine;
sitecostchart.width(350)
.height(400)
.margins({top: 10, right: 0, bottom: 20, left: 0})
.dimension(sitecost)
.group(sitecostsum)
.title(function(d) {return d.key +
" £" + currFormat(d3.round(d.value)) +
" (" + d3.round((d.value / d3.sum(sitecostsum.all(),
function(d){ return d.value;}))*100,1) +"%)";})
.transitionDuration(500)
.elasticX(true)
.ordering(function(d) {return -d.value })
.xAxis().ticks(5);
The text was updated successfully, but these errors were encountered: