2016-12-20 16 views
1

このsvgは期待通りに機能しますが、viewBoxを使用してサイズを変更すると、結果は最適化されませんでした。 svgはdivの上にあるレイヤーのように見えますが、divの中に入れようとしています。 https://plnkr.co/edit/3quWHAs1EpMQAv7P4dZC?p=previewブートストラップパネル内でsvgを拡大/縮小する方法

わからない私は、正しくない、または不正なブートストラップD3のJSを持っている場合は:...

Plnkr目標は、これらのブートストラップのパネル内の複数のゲージを持っていることですが、私は最初を過ぎて持っていません両方の組み合わせ..

var svg = d3.select("#g1") 
    .append("svg") 
    .classed("svg-container", true) 
    //responsive SVG needs these 2 attributes and no width and height attr 
    .attr("preserveAspectRatio", "xMinYMin meet") 
    .attr("viewBox", "0 0 400 400") 
    // class to make it responsive 
    .attr('class', 'svg-content-responsive'); 

答えて

関連する問題