【发布时间】:2015-10-24 07:57:48
【问题描述】:
我在 bootstrap 3.0 中使用了 NVD3 (http://krispo.github.io/angular-nvd3/#/multiBarChart) 库。 我有两个 class="col-md-6 col-sm-12" 的 div 彼此相邻对齐。 我想在两个 div 中显示图表。 正确显示图表我需要为 angular-nvd3 库设置高度和宽度选项。 它适用于桌面版本。但是当我缩小窗口大小时,它会失去响应能力。
我再次不能以百分比设置宽度选项;如果我这样做,它不会显示图表。
// chart options
$scope.options = {
chart: {
type: 'multiBarChart',
height: 250,
width: 600,
staggerLabels: false,
transitionDuration: 1000,
tooltips: true,
tooltipContent: function(key, x, y, e, graph) {
return '<p>' + key + ': ' + y + '</p>';
},
stacked: false,
showControls: false,
xAxis: {
showMaxMin: false,
axisLabel: 'MockTests',
axisLabelDistance: -30
},
yAxis: {
axisLabel: 'Marks Comparison',
axisLabelDistance: 40,
ticks: 5,
tickFormat: function(d) {
return d3.format(',.f')(d);
}
}
}
};
请帮忙。
【问题讨论】:
标签: javascript html css angularjs twitter-bootstrap