0
你好,我正在努力做一个散点图与nvd3.js库。现在的事情是我想要两个轴的宽度/高度相同。但即使代码中的css的高度和宽度都设置为相同的高度,y轴的高度也会更长。NVD3.js scatter
JS:
var chart = nv.models.scatterChart()
.width(300)
.height(300)
.showXAxis(true)
.showYAxis(true)
.forceX([-100,100])
.forceY([-100,100])
.tooltips(true)
.showLegend(false)
.tooltipContent(function(){
return 'clock';
});
CSS:
#main-chart {
width: 300px;
height: 300px;
margin: 0 auto;
}
HTML:
<div class="container" ng-controller="film_factor_controller">
<svg bubble-chart id="main-chart"></svg>
希望有人能帮助我
可能重复[如何设置nvd3图表的高度和宽度](http://stackoverflow.com/questions/16474988/how-to-set-height-and-width-of-nvd3-chart) – shabeer90