score:7
Could you show us some code ?
In the past I have done that this way for a row chart :
var topRowChart = dc.rowChart("#chart-top-dest");
topRowChart
.height(400)
.width(400)
.dimension(destination, "destination")
.group(calls,"calls")
.ordering(function(t){return t.calls;})
.label(function(d){ return d.key + " : " + d.value + " calls" ;})
.cap(10);
The important bits are :
.ordering(function(t){return t.calls;})
.cap(10);
You have to pass a function to ordering() that returns the dimension/group that will be used for sorting.
Surprisingly removing cap() cancels the sorting.
Source: stackoverflow.com
Related Query
- Sorting the bars in a bar chart with dc.js
- Create a bar chart with local storage data (drawing the bars doesn't work)
- Sorting the bars and getting the group data in a grouped bar chart
- Make simple bar chart using C3 with separate columns on the x axis
- d3.js bar chart sorting: can't figure out how to sort x-axis labels along with bars
- Adding Error Bars to Grouped Bar Chart with D3.js
- Need help lining up x axis ticks with bars in D3.js bar chart
- d3.js bar chart with pos & neg bars (win/loss) for each record
- Transitioning a bar chart with negative values for the width
- Calculating the number of bars in a bar chart in dc.js
- D3.js bar chart 'enter' appears to draw the new bars in wrong position
- Bars are going beyond the chart range in d3 bar chart
- How to draw multiple bars in a row in a bar chart with spaces in between with d3v5?
- Values are not reflecting Dynamically in D3 Bar Chart using. Overlapping occur with the existing Graph.
- Sorting function issue with grouped bar chart
- Changing the colors of each of the Stacked Bar chart with different Color in D3
- DC.js bar chart x-axis labels not aligned with bars
- nvd3 multibar chart with stacked option the bars are not appearing properly
- How do I make my chart bars align with the chart axis?
- dc.js - Chart not rendering (single row bar chart - horizontal row), with the exception of legend, axes and tick marks/values (which do render)
- Starting point of x-axis in d3.js bar chart is not aligned with the y-intercept
- d3 bar chart labels not getting updated on updating the chart with the new data
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- Why does removing, then re-adding bars to my stack bar chart change the position of the bars?
- Finding the mean of bars in bar chart - d3
- Varying the gaps between specific bars in a D3 bar chart
- c3 bar chart chart - client want numbers above the bars
- How to align ticks with bars in horizontal bar chart / row chart
- Is it possible to select multiple bars on bar chart in d3.js with mouse
- How to place the bars of a bar chart in the right positions of the xAxis using d3.js?
More Query from same tag
- How can I remove Decimals in nvd3.js graphs?
- Programmatically control brush and pass relevant information
- Always Show Tooltip Regardless of Mouseover
- D3.js color the node circles with a function using spectrum.js
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- D3 responsive line chart display no lines
- D3.js: How to Center svg map after Drag, Zoom, or MouseMove Events
- Append groups mess up everything in d3 force layout
- d3.js to show a popup window with a form on click of image
- D3 Javascript loop doesn't render
- dc.js render bar chart
- Add horizontal crosshair to d3.js chart
- Can I create a flow chart (no tree chart) using D3.js
- Server side pagination in ASP.NET Core
- d3js - the path is not drawing full values while using `defined`
- D3 canvas force directed layout bottom issue
- Rerender D3 Force directed Layout with new data
- Links not rendering when using font awesome in D3
- change bootstrap button text before rendering d3 svg object
- Javascript error "Unexpected strict mode reserved word" while using d3.js with apache codrova
- CSS basic Multipanel Graph layout D3.js
- AngularJS and D3.js V4, d3.json issue
- How can I fill an area with different colors based on conditions?
- D3.js multiple line graph transitions
- Wrap text in a circle with D3 v4 and D3plus
- All elements take the same values
- How do you create a treemap in D3 with custome colors
- D3 Coordinates of mousedover circle
- Can d3 build shapes within a shape?
- d3 line smoothing (stronger than monotone)