2 |
3 |
4 |
5 |
6 |
7 | Graph with axis labels
8 | Basic line, area and bar charts can be composed together in the same chart.
9 |
10 |
18 |
19 |
20 |
21 |
22 | Basic Graphs
23 | Basic line, area and bar charts can be composed together in the same chart.
24 |
25 |
41 |
42 |
43 |
44 |
45 | Stacked Areas
46 | Area charts can be stacked by specifying multiple y propeties
47 |
48 |
57 |
58 |
59 |
60 |
61 | Pie and Donut Charts
62 |
63 |
64 |
67 |
68 |
69 |
72 |
73 |
74 |
75 |
76 |
77 | Gear Chart
78 |
79 |
84 |
85 |
86 |
87 |
92 |
93 |
94 |
99 |
100 |
101 |
102 |
103 |
104 | Arc Charts
105 |
106 |
107 |
110 |
111 |
112 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/src/angularD3/directives/pie.ts:
--------------------------------------------------------------------------------
1 | import { Input, Optional, Directive, ElementRef } from '@angular/core';
2 | import { D3ChartDirective, D3Element, D3MarginDirective } from './chart';
3 | import * as d3 from 'd3';
4 |
5 | export class D3PieBase extends D3Element {
6 | innerRadius = 0;
7 | labelRadius = 0.7;
8 | radiusAttr: string;
9 |
10 | get radius() {
11 | if (this.radiusAttr === 'height') {
12 | return (this.height - this.verticalPadding) / 2;
13 | } else {
14 | return (this.width - this.horizontalPadding) / 2;
15 | }
16 | }
17 |
18 | createArc(radius: number) {
19 | return d3.svg.arc