score:0
It's a little confusing dealing with both dc.js and d3.js features around range bands.
dc.js has its own built-in calculations for bar/line x positions, but if the x scale is ordinal, it automatically chooses .rangeBands
:
if (_chart.isOrdinal()) {
_x.rangeBands([0, _chart.xAxisLength()], _rangeBandPadding,
_chart._useOuterPadding() ? _outerRangeBandPadding : 0);
} else // ...
So I don't think your call to .rangeRoundBands
has any effect. (Should dc.js use rangeRoundBands
instead of rangeBands
? Maybe, but it doesn't weight on this question.)
It's the third parameter to rangeBands
that you want to influence, and that's controlled by chart._outerRangeBandPadding()
. (Ignore chart._useOuterPadding()
- that's a backward compatibility thing.)
So all you need here is
chart._outerRangeBandPadding(0);
Source: stackoverflow.com
Related Query
- DC JS: remove outer padding for line charts with an ordinal scale x-axis?
- Mix bar and line charts with Rickshaw (d3 based graphing library for js)
- dc.js bar chart with ordinal x axis scale doesn't render correctly
- D3.js zoom with Ordinal axis not working - Issue with setup of scale in zoom behavior?
- javascript d3 line graph with ordinal x axis
- limit number of tick marks in d3.js x axis with ordinal scale
- How to fix d3.js axis mis match when using clip paths for linear filtered line charts
- D3.JS- Format tick values with an ordinal scale axis
- D3 Line chart with ordinal scale issue
- JavaScript d3 line graph with ordinal axis and json data
- Prevent clipping of bubbles centered near boundaries in a bubble chart with log scale axis and sqrt scale for bubble size?
- Inversion with ordinal scale
- D3: Create a continuous color scale with many strings/inputs for the range and dynamically changing values of the domain
- converting numbers on y axis to string with K for thousand d3.js
- Using an ordinal scale ('d3.scale.ordinal') for the x-axis in a bar chart
- d3 time scale x axis with unix timestamp
- Creating a Text Labeled x-Axis with an Ordinal Scale in D3.js
- nvd3.js-Line Chart with View Finder: rotate axis labels and show line values when mouse over
- How to draw logarithmic line charts with nvd3
- what scale to use for representing years only on x axis in d3 js
- C3.js SVG visualization to Canvas with canvg - Line charts filled with black rectangles , "ERROR: Element 'parsererror' not yet implemented"
- nvd3 scatter plot with ordinal scale
- Horizontal pan with ordinal x axis in d3
- Create a scale for bands with different width in D3.js
- Line chart using ordinal x-axis with d3.js and nvd3.js
- Data for sunburst charts with d3.hierarchy using D3js v4
- How to check d3 js force graph for nodes with no links and remove them?
- d3js set tickValues for time scale axis
- Make a chart with area charts having both positive and negative y axis in dc or d3.js
- D3.js: Set fitExtent or fitSize (or center and scale programmatically) for map with multiple geoJSON files
More Query from same tag
- d3 function(d,i) - the meaning of i changed as data changed
- JSON instead of CSV for bubble chart
- c3.js Line Chart data label text overlaps
- How to create the circumference simultaneously by defining the radius in SVG?
- Two affectations and a test in if condition
- dc.js/crossfilter -> How to sort data in dc.js chart (like row) - Ascending x Descending
- Uncaught Error: [$injector:modulerr] - Heatmap using d3 and AngularJS
- Read CSV with d3 (v3 or v4), save data and callback
- Network Map from multiple columns?
- Increase space between rings in D3 ring chart
- Circle packing within force graph nodes in D3?
- Mouseout on element grouping fires before leaving bounding area in D3
- Nameless error using d3.js
- d3.js zoom xScale / xAxis
- use any curve to connect two certain points with certain link length using javascript of its library such as d3
- Basic AngularJS NVD3 Directives will not work and no error
- D3 filling dataset from csv failing
- Calling d3.mouse on svg.node() after a timeout
- Get width of d3.js SVG text element after it's created
- D3 chart for visualizing data by sector and overall and algo explained
- C3.js - Nested JSON objects, How to access and load data?
- Calculate grid layout based on connections?
- C3 bar chart width is not working properly
- Download C3 chart as pdf as given download option in D3 graphs
- D3.Drag Behavior with nested data
- Unexpected Data Binding Behavior
- d3.js sankey diagram: where does ".dy" and .dx" get set?
- D3.js Bar graph not displaying properly?
- D3 fade function Circle Graph
- Calling a custom function in d3