【发布时间】:2015-09-16 17:19:14
【问题描述】:
我的 d3 代码几乎像 this example,在这个例子中,画笔功能工作得很好。
但是,当我将上述示例的 <script>...</script> 部分复制并粘贴到我的 index.js 文件中时,如下所示:
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<title>Hello world!</title>
<base href='/'>
<link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="libs/d3/d3.min.js"></script>
<!--some more script here-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="pragma" content="no-cache"/>
</head>
<body ng-controller="MainController as mainCtrl">
<nav class="navbar navbar-default">
<!--navbar here-->
</nav>
<div ng-view> </div>
</body>
</html>
<script>
// exactly the same code in the above d3 brush example
</script>
d3 画笔功能的工作原理如下,即线条超出轴区域。我的 css 文件与上面示例中的相同。我猜它与angularjs或bootstrap有关?
请指教,非常感谢。
【问题讨论】:
标签: javascript css angularjs twitter-bootstrap d3.js