How to make the dc.js charts responsive

前端 未结 2 1900
萌比男神i
萌比男神i 2021-02-12 14:42

Is there a any way to make the dc.js charts responsive?

I\'m struggling a lot to make the charts fit the desktop size.

I\'m using Twitter Bootstrap

2条回答
  •  情深已故
    2021-02-12 14:54

    When you pass null when calling .width() and .height() methods (or not calling them at all) on the dc.js Chart instance, it will use width and height of the anchor element (which can then be styled with some evergreen responsive css classes either from bootstrap or some other responsive css framework ;)).

    For more info see: https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#dc.baseMixin+height

提交回复
热议问题