オプション:
size: {
height: 100,
width: 100
}
は100px
代わりの100%
にsvg
要素の高さと幅を設定している私は正常100%
にwidth
を設定します
size: {
height: '100%',
width: '100%'
}
を試してみましたどういうわけかheight
は320px
に設定されます
ですから、あなたのCSSにこれを追加した場合:
.c3 svg {
width: 100%;
height: 100%;
}
あなたのサイジングの問題を解決すること。
EDIT
初期サイズとサイズ変更のあなたのコントローラに追加いくつかのコメントを設定するには、ほんの少しの変更 - あなたがに基づいて、あなたのチャートの一部サイズ変更を追加する必要がありますイベントハンドラを、停止新しいサイズ。 C3プラグインはまた、これがスムーズにgridsterで動作するようSee it here
resizable: {
enabled: true,
handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],
// optional callback fired when resize is started
start: function(event, $element, widget) {},
// optional callback fired when item is resized,
resize: function(event, $element, widget) {},
// optional callback fired when item is finished resizing
stop: function(event, $element, widget) {
// here should update the size according to the widget size
// widget.sizeX (* 160px) and widget.sizeY (* 160px)
// and further adjustments
}
},
以下のリンクをご覧ください。 https:// css-tricks。com/scale-svg/ – Ashugeo