Integrating D3 with Angular can be very simple. In this lesson, you will learn basic integration as well as how to create D3 charts that can be packaged as AngularJS directives.

<!DOCTYPE html>
<html ng-app="app">
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body> <div ng-view></div> <!-- AngularJS Partial Template Start -->
<script type="text/ng-template" id="chartTpl">
<button ng-click="setSubject('math')">Math</button>
<button ng-click="setSubject('science')">Science</button>
<button ng-click="setSubject('reading')">Reading</button> <div area-chart class="area-chart" chart-data="chartData"></div>
</script>
<!-- AngularJS Partial Template End --> <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-route.min.js"></script> </body>
</html>

[D3 + AngularJS] 15. Create a D3 Chart as an Angular Directive的更多相关文章

  1. [D3] 10. Creating Axes with D3

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  2. [D3] 12. Basic Transitions with D3

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  3. 使用 angular directive 和 json 数据 D3 随着标签 donut chart演示样本

    使用angular resource载入中priorityData.json中间json数据,结合D3绘制甜甜圈图.执行index.html其结果见于图.: priorityData.json中jso ...

  4. AngularJS in Action读书笔记5(实战篇)——在directive中引入D3饼状图显示

    前言: "宁肯像种子一样等待  也不愿像疲惫的陀螺  旋转得那样勉强" 这是前几天在查资料无意间看到的一位园友的签名,看完后又读了两遍,觉得很有味道.后来一寻根究底才知这是出资大诗 ...

  5. d3可视化实战00:d3的使用心得和学习资料汇总

    最近以来,我使用d3进行我的可视化工具的开发已经3个月了,同时也兼用其他一些图表类库,自我感觉稍微有点心得.之前我也写过相关文章,我涉及的数据可视化的实现技术和工具,但是那篇文章对于项目开发而言太浅了 ...

  6. [D3] Select DOM Elements with D3 v4

    Before you can create dazzling data driven documents, you need to know how D3 accesses the DOM. This ...

  7. [D3] Modify DOM Elements with D3 v4

    Once you can get hold of DOM elements you’re ready to start changing them. Whether it’s changing col ...

  8. 夺命雷公狗—angularjs—15—内置封装好的计时器$interval和$timeout

    这里其实和js源生的效果是一样的,但是源生的在angularjs里面不能直接正常执行代码如下所示: <!DOCTYPE html> <html lang="en" ...

  9. AngularJS(15)-依赖注入

    AngularJS 依赖注入 什么是依赖注入 wiki 上的解释是:依赖注入(Dependency Injection,简称DI)是一种软件设计模式,在这种模式下,一个或更多的依赖(或服务)被注入(或 ...

随机推荐

  1. 关于keil中data,idata,xdata,pdata,code的问题

    转自关于keil中data,idata,xdata,pdata,code的问题 ‍从数据存储类型来说,8051系列有片内.片外程序存储器,片内.片外数据存储器,片内程序存储器还分直接寻址区和间接寻址类 ...

  2. Security 可视化

    http://web.cs.ucdavis.edu/~ma/SecVis/ http://research.dbvis.de/security/tools/clockview/ http://raff ...

  3. Spring 使用外部部署文件

    1.导入属性文件: <context:property-placeholder location="classpath:db.properties"/> 2.使用外部化 ...

  4. SPRING IN ACTION 第4版笔记-第二章WIRING BEANS-006-当构造函数有集合时的注入

    一.当构造函数有集合时,只能用<CONSTRUCTOR-ARG>,不能用C-NAMESPACE 二. 1. package soundsystem.collections; import ...

  5. ANDROID_MARS学习笔记_S04_003_用HttpClent发http请求

    一.代码 1.xml(1)activity_main.xml <TextView android:layout_width="wrap_content" android:la ...

  6. 值得推荐的C/C++框架和库 very good

    [本文系外部转贴,原文地址:http://coolshell.info/c/c++/2014/12/13/c-open-project.htm]留作存档 下次造轮子前先看看现有的轮子吧 值得学习的C语 ...

  7. [cocos2d demo]认字小游戏

    2013.9.5更新第二版 游戏分三个场景,分别为主场景,加载场景以及游戏场景,游戏场景分为背景层,逻辑层以及UI层 1.背景:旋转太阳,移动波浪,漂浮的云 2.UI层:随机生成字附带在帆船上移动,当 ...

  8. Android学习笔记12:图像渲染(Shader)

    在Android中,提供了Shader类专门用来渲染图像以及一些几何图形. Shader类包括了5个直接子类,分别为:BitmapShader.ComposeShader.LinearGradient ...

  9. Learning WCF Chapter1 Hosting a Service in IIS

    How messages reach a service endpoint is a matter of protocols and hosting. IIS can host services ov ...

  10. 无法使用以下搜索标准找到 X.509 证书: StoreName“My”、StoreLocation“LocalMachine”、FindType“FindBySubjectName”、FindValue“MyWebSite”。

    http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti 需要制作证书 ...