Sparse datasets could show exessive empty spaces in a bar chart.
The issue has been repeatedly reported on ECharts (JS) and echarts4r (R) boards.
A solution that consists of preprocessing data and creating a non-linear axis has recently surfaced.
Here we share echarty code related to the subject.
1) Original sparse bar chart
3) As a preferable R solution we offer module trimZero() - part of the paid Extras collection. It is a (couple hours) translation of the above JS code to R.
Sparse datasets could show exessive empty spaces in a bar chart. The issue has been repeatedly reported on ECharts (JS) and echarts4r (R) boards. A solution that consists of preprocessing data and creating a non-linear axis has recently surfaced. Here we share echarty code related to the subject. 1) Original sparse bar chart
2) Compressed bars with the help of a JavaScript function
3) As a preferable R solution we offer module trimZero() - part of the paid Extras collection. It is a (couple hours) translation of the above JS code to R.