This would require quite a bit of additional work. Here's an outline of what you would have to do.
- Create two scales, one for the lower part and one for the upper. Set domains and ranges accordingly.
- Pass values to the lower scale, capping them at the maximum domain value such that bars that are longer will reach the maximum.
- Pass values to the upper scale, filtering those that are lower than the minimum.
You basically need to create two graphs that are aligned with each other to give the impression that there's just one. If you keep that in mind, doing it shouldn't be too difficult.
Here's a quick and dirty proof of concept that uses the linear scale's
.clamp(true) to prevent the bars from becoming too long for values outside the domain.
The d3fc-discontinuous-scale component adapts any other scale (for example a d3 linear scale) and adding the concept of discontinuities. These discontinuities are determined via a 'discontinuity provider', which can be used to create one or more 'gaps' in a scale.
For example, to remove a range, you can construct a scale as follows:
var scale = scaleDiscontinuous(scaleLinear()) .discontinuityProvider(discontinuityRange([50, 75]))
Here is a complete example that shows how to use this to create a 'break' in a scale in order to render values that have large gaps in their overall range.
- How to apply horizontal break to a d3.js bar chart
- How to add a line on x-axis on a horizontal bar chart in d3
- How to make this D3 horizontal bar chart work?
- How do I set the X values for a singled stacked horizontal bar chart using d3.js?
- How to align ticks with bars in horizontal bar chart / row chart
- In NV D3 horizontal bar chart how to use Json as a data?
- how to display bar values in horizontal stacked bar chart
- d3js - Stacked Bar Chart in Horizontal Axis - How do I set x so the bars are seperated?
- How to change Horizontal bar chart to vertical bar chart in D3 v4
- How do I make the height of a horizontal bar chart flexible in order to be resized when new data has been added in?
- How to have a definite boundary on a d3.js horizontal bar chart
- How to set up a reference index on horizontal bar chart and transition control
- D3js - change Vertical bar chart to Horizontal bar chart
- How to update d3.js bar chart with new data
- d3.js How to add lines to a bar chart
- How to apply a pattern for a D3 bar chart?
- d3.js bar chart sorting: can't figure out how to sort x-axis labels along with bars
- How to animate a d3 js v4 bar chart from bottom(x axis) to up?
- c3.js - how to show hand cursor on bar chart hover
- How to use x and width in a bar chart with scaleTime?
- How to apply tooltips for dc.js chart after chart is rendered
- How to add space between bars in a grouped bar chart in a nvd3 grouped multibar chart?
- C3 / D3 bar chart with horizontal scroll
- D3: How can I change data in an existing bar chart
- How to Make a bar chart with rounded corners with extended grid in d3.js?
- How to update data in stack bar chart in D3
- How to modify axis labels in d3 for a stacked bar chart when the axis labels are mapped as part of the scale's domain
- D3 bar chart - how to display positive/negative values together?
- D3.js : How to read data from JSON in Grouped Bar Chart
- How to correctly centre text element on all bars of a nvd3 bar chart
More Query from same tag
- D3.js - Fading in data points sequentially
- Using d3.js to modify c3.js chart
- How to give same classes
- Draw area chart with d3-shape on canvas?
- Setting color of marker-end arrow in D3.js
- D3 force layout change links into paths and place arrows on node edge instead of center
- d3v5 Angular 8 production mode - ERROR TypeError: (void 0) is not a function
- Why can't I position the elements correctly on the circumference of a circle?
- D3.js brush.extent() wrong on IE10
- upgrading d3js from v3 to v4 causes zoom problems
- Export SVG with some lines of text in PDF
- How to properly assign separate colors to different lines and line series in D3 Dimple?
- Specifying Values in D3 Graph from JSON
- svg - get path coordinates of overlapping shape areas
- D3 Optional Transitions
- d3.js loading a csv throwing a TypeError in Chrome and something [native code] in Safari
- Making An HTML element inside a D3-Tip Trigger Click Event
- How do you remove the background gridlines in nvd3.js?
- update a line dynamically using d3 makes the line move back and forth
- Inputing an MPLD3 graph into Wordpress
- d3js not having the same behaviour within and outside a function
- d3 rotating wheel with fixed clip
- How do I get the browser's "back" button to to clear the previous state of a d3.js visualization?
- D3: How delete shape on click event?
- Explaining Mike Bostock's d3.js dragmove function
- Showing a list of events in a D3 map
- How do I update the tick values on my axis when zooming ?
- Unicode label is not displayed as a Fontawesome icon
- d3js/AngularJS - use d3js in angular directives
- D3 tree drawing with long labels