我正在使用bootstrap.css,我发现还有另一个名为bootstrap-combined.min.css的 css文件,风格有什么不同吗?是否需要包含两个css文件?哪个更优选?
这是我的代码.
<div class="start">start</div>
<div>middle-1</div>
<div>middle-2</div>
<div>middle-3</div>
...................
...................
<div>middle-n</div>
<div class="end">end</div>
Run Code Online (Sandbox Code Playgroud)
当鼠标悬停在第一个div的class start时,我想将css应用于所有div.
我正在使用nvd3.js和angularjs,这是代码.
<nvd3-pie-chart data="exampleData1"
class="pie"
id="labelTypePercentExample"
x="xFunction()"
y="yFunction()"
showLabels="true"
pieLabelsOutside="true"
showLegend="true"
labelType="percent">
</nvd3-pie-chart>
Run Code Online (Sandbox Code Playgroud)
和js是.
myapp.controller('ExampleCtrl1',function($scope,$timeout){
$scope.exampleData1 = [
{ key: "Ongoing", y: 20 },
{ key: "completed", y: 0 }
];
$timeout(function() {
$scope.exampleData1 = [
{ key: "Ongoing", y: 20 },
{ key: "completed", y: 2 }
];
}, 10);
$scope.xFunction = function(){
return function(d) {
return d.key;
};
}
$scope.yFunction = function(){
return function(d) {
return d.y;
};
}
})
Run Code Online (Sandbox Code Playgroud)
并且在页面调整大小时抛出错误.
错误:属性变换的值无效="translate(NaN,5)" d3.js:590
我有一个nvd3饼图.我获取百分比值作为标签,但我想在工具提示中.这是HTML:
<nvd3-pie-chart data="Data1"id="labelTypePercentExample"
width="550"
height="350"
x="xFunction()"
y="yFunction()"
showLabels="true"
pieLabelsOutside="false"
tooltips="true"
tooltipcontent="toolTipContentFunction()"
labelType="percent"
showLegend="true">
</nvd3-pie-chart>
Run Code Online (Sandbox Code Playgroud)
数据
Data1=[{ key: "Ongoing", y: 20 },
{ key: "completed", y: 0 }];
Run Code Online (Sandbox Code Playgroud)
这是用于将键显示为工具提示数据的工具提示功能.
$scope.toolTipContentFunction = function(){
return function(key, x, y, e, graph) {
return '<h1>' + key + '</h1>'
}
}
Run Code Online (Sandbox Code Playgroud)