This Gist was automatically created by Carbide, a free online programming environment.
[You can view a live, interactive versi
var Chart = (function(window,d3) { | |
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator; | |
var breakPoint = 768; | |
d3.csv('data.csv', init); //load data, then initialize chart | |
//called once the data is loaded | |
function init(csv) { |
//insert at line 61 in: /core/server/controllers/frontend.js | |
function formatPageResponse(posts, page) { | |
// Delete email from author for frontend output | |
// TODO: do this on API level if no context is available | |
posts = _.each(posts, function (post) { | |
if (post.author) { | |
delete post.author.email; | |
} | |
return post; |
filter { | |
csv { | |
separator => "," | |
columns => ["Date","Open","High","Low","Close","Volume","Adj Close"] | |
} | |
mutate {convert => ["High", "float"]} | |
mutate {convert => ["Open", "float"]} | |
mutate {convert => ["Low", "float"]} | |
mutate {convert => ["Close", "float"]} | |
mutate {convert => ["Volume", "float"]} |
var hasMoved; | |
$(el).on('touchend touchstart touchmove', function(e) { | |
if(e.type == 'touchstart') { | |
hasMoved = false; | |
} | |
else if(e.type == 'touchmove') { | |
hasMoved = true; | |
} | |
else if(e.type == 'touchend') { |
Date | Open | High | Low | Close | Volume | Adj Close | |
---|---|---|---|---|---|---|---|
2015-04-02 | 125.03 | 125.56 | 124.19 | 125.32 | 32120700 | 125.32 | |
2015-04-01 | 124.82 | 125.12 | 123.10 | 124.25 | 40359200 | 124.25 | |
2015-03-31 | 126.09 | 126.49 | 124.36 | 124.43 | 41852400 | 124.43 | |
2015-03-30 | 124.05 | 126.40 | 124.00 | 126.37 | 46906700 | 126.37 | |
2015-03-27 | 124.57 | 124.70 | 122.91 | 123.25 | 39395000 | 123.25 | |
2015-03-26 | 122.76 | 124.88 | 122.60 | 124.24 | 47388100 | 124.24 | |
2015-03-25 | 126.54 | 126.82 | 123.38 | 123.38 | 51106600 | 123.38 | |
2015-03-24 | 127.23 | 128.04 | 126.56 | 126.69 | 32713000 | 126.69 | |
2015-03-23 | 127.12 | 127.85 | 126.52 | 127.21 | 36761000 | 127.21 |