axis breaks
This chart visualizes a small dataset of seven numeric values as bars, but the y-axis scale has a deliberate break between 5 and 20. The diagram uses the `fc.scaleDiscontinuous` API from the d3fc library to remove that range, compressing the visual gap and making the larger values (22 and 25) easier to compare with the smaller ones. A dashed red annotation line, created with `fc.annotationSvgLine`, marks the location of the break. The chart is implemented with d3 v5 and the d3fc `fc.chartCartesian` function, with data hard-coded in the script.
AI-generated descriptionThis example demonstrates how the d3fc discontinuous scale can be used to create a 'break' in a scale, in this case the range 5-20 is removed in order to allow data which spans a large range, to be more easiy visualised.
A line annotation is used to highlight the location of the break.
(Note, the axis ticks are not ideal, as highlighted in this issue).