Last active
August 29, 2015 14:21
-
-
Save nkabir/e1fefb03f545ab39c770 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<script type="text/javascript" src="http:cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/highstock/1.3.7/highstock.js"></script> | |
<script type="text/javascript" src="http://www.highcharts.com/samples/data/usdeur.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.18/mithril.min.js"></script> | |
<script type="text/javascript"> | |
var app = {}; | |
app.App = function(data){ | |
this.plotCfg = { | |
chart: { | |
renderTo: "plot" | |
}, | |
series: [{ | |
name: 'USD to EUR', | |
data: usdeur | |
}] | |
}; | |
}; | |
app.controller = function(){ | |
this.apk = new app.App(); | |
this.cfg = this.apk.plotCfg; | |
}; | |
app.plotter = function(ctrl) { | |
return function(elem,isin) { | |
if(!isin) { | |
m.startComputation(); | |
var chart = Highcharts.StockChart(ctrl.cfg); | |
m.endComputation(); | |
} | |
}; | |
}; | |
app.view = function(ctrl) { | |
return m("html", [ m("body", [ | |
m("#plot[style=height:400px]", {config: app.plotter(ctrl)}), | |
//when I set breakpoint here I can see plot for a moment. It disappears when I resume normal script flow | |
m("p", "some text after plot"), | |
]), | |
]) | |
}; | |
m.module(document, app); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment