Repository navigation
Expand file tree
/
Copy pathapi_flow.html
More file actions
203 lines (192 loc) · 6.22 KB
/
Copy pathapi_flow.html
File metadata and controls
203 lines (192 loc) · 6.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html class='no-js'>
<head>
<meta charset='utf-8'>
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
<meta content='D3 based reusable chart library' name='description'>
<meta content='c3js.org' name='author'>
<meta content='width=device-width' name='viewport'>
<title>C3.js | D3-based reusable chart library</title>
<link href="/css/normalize-e465cb86.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/foundation.min-978d4ce8.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/tomorrow-d7cf0921.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/c3-bbe380ed.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/style-99fb8989.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/samples/api_flow-da39a3ee.css" media="screen" rel="stylesheet" type="text/css" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42896059-3', 'c3js.org');
ga('send', 'pageview');
</script>
<script src="/js/vendor/modernizr-2.6.1.min-68fdcc99.js" type="text/javascript"></script>
</head>
<body class='antialiased'>
<div class='sticky'>
<nav class='top-bar' data-options='sticky_on: large' d
DDE7
ata-topbar>
<ul class='title-area'>
<li class='name'>
<h1>
<a href='/'>C3.js | D3-based reusable chart library</a>
</h1>
</li>
<li class='toggle-topbar menu-icon'>
<a href='#'>
<span>Menu</span>
</a>
</li>
</ul>
<section class='top-bar-section'>
<ul class='right'>
<li class='has-form'>
<a class='button' href='/gettingstarted.html'>Getting Started</a>
</li>
<li class='divider'></li>
<li>
<a href='/examples.html'>Examples</a>
</li>
<li class='divider'></li>
<li>
<a href='/reference.html'>Reference</a>
</li>
<li class='divider'></li>
<li>
<a href='https://groups.google.com/forum/#!forum/c3js' target='_blank'>Forum</a>
</li>
<li class='divider'></li>
<li>
<a href='https://github.com/c3js/c3' target='_blank'>Source</a>
</li>
</ul>
</section>
</nav>
</div>
<div class='container'>
<h1 class='title'>Flow</h1>
<div class='chart'>
<div id='chart'></div>
</div>
<div id='ace-error'></div>
<div class='sourcecode margin-medium-v margin-small-h'>
<h3># api_flow.js</h3>
<div class='c3-editor' id='javascript-editor'>
var chart = c3.generate({
data: {
x: 'x',
columns: [
['x', '2012-12-29', '2012-12-30', '2012-12-31'],
['data1', 230, 300, 330],
['data2', 190, 230, 200],
['data3', 90, 130, 180],
]
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%m/%d',
}
}
}
});
setTimeout(function () {
chart.flow({
columns: [
['x', '2013-01-11', '2013-01-21'],
['data1', 500, 200],
['data2', 100, 300],
['data3', 200, 120],
],
duration: 1500,
done: function () {
chart.flow({
columns: [
['x', '2013-02-11', '2013-02-12', '2013-02-13', '2013-02-14'],
['data1', 200, 300, 100, 250],
['data2', 100, 90, 40, 120],
['data3', 100, 100, 300, 500]
],
length: 0,
duration: 1500,
done: function () {
chart.flow({
columns: [
['x', '2013-03-01', '2013-03-02'],
['data1', 200, 300],
['data2', 150, 250],
['data3', 100, 100]
],
length: 2,
duration: 1500,
done: function () {
chart.flow({
columns: [
['x', '2013-03-21', '2013-04-01'],
['data1', 500, 200],
['data2', 100, 150],
['data3', 200, 400]
],
to: '2013-03-01',
duration: 1500,
});
}
});
}
});
},
});
}, 1000);
</div>
</div>
<footer>
<hr>
<p>© Masayuki Tanaka 2014</p>
</footer>
</div>
<script src="/js/jquery-1.11.0.min-910066fb.js" type="text/javascript"></script>
<script src="/js/foundation.min-1dfe8110.js" type="text/javascript"></script>
<script src="/js/highlight.pack-4af5004d.js" type="text/javascript"></script>
<script src="/js/d3-5.4.0.min-e9c75f0e.js" type="text/javascript"></script>
<script src="/js/c3.min-924a3b3b.js" type="text/javascript"></script>
<script>
hljs.initHighlightingOnLoad();
$(document).foundation();
</script>
<script src="/js/ace/ace.js" type="text/javascript"></script>
<script src="/js/ace/mode-javascript.js" type="text/javascript"></script>
<script src="/js/ace/theme-tomorrow.js" type="text/javascript"></script>
<script>
var editor = ace.edit('javascript-editor'),
error = document.getElementById('ace-error');
function debounce(func, wait) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
func.apply(context, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
};
editor.on('change', debounce(function(e) {
try {
eval(editor.getValue());
error.innerHTML = '';
}
catch(e) {
error.innerHTML = e;
}
}, 300));
editor.setOption("maxLines", 100);
editor.setOption("showLineNumbers", false);
editor.setOption("showGutter", false);
editor.setTheme("ace/theme/tomorrow");
editor.getSession().setMode("ace/mode/javascript");
editor.commands.removeCommand('gotoline') // Disables the override of Command-L
</script>
<script src="/js/samples/api_flow-2ba0b545.js" type="text/javascript"></script>
</body>
</html>