naver / billboard.js

📊 Re-usable, easy interface JavaScript chart library based on D3.js
https://naver.github.io/billboard.js/
MIT License
5.77k stars 345 forks source link

Enhance bar.width callback #3820

Closed netil closed 4 days ago

netil commented 1 week ago

Description

Currently bar.width can be specified an absolute value or in ratio. To make straight forward, provide an callback option to adjust width value based on chart's width or from user needs.

bar: {
    // d: data
   // width: chart's width
    width: function(d, width) {
           return width / 10;
    }
}