Display stock quotes from Yahoo!: Difference between revisions

From JSXGraph Wiki
(New page: This JSXGraph application fetches the live stock quotes of the German DAX Index (gdaxi) from Yahoo!. The curve is updated only once a second, so initially it needs a little patience until ...)
 
No edit summary
Line 17: Line 17:


fetchData = function() {
fetchData = function() {
     new Ajax.Request('stockquotes.php', {
     new Ajax.Request('/ajax/stockquotes.php', {
         onComplete: function(transport) {
         onComplete: function(transport) {
             if (200 == transport.status) {
             if (200 == transport.status) {
Line 45: Line 45:
                 hi = a[6]*1.001;
                 hi = a[6]*1.001;
                 lo = a[7]*0.999;
                 lo = a[7]*0.999;
                 brd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[0,hi,200,lo]});
                 brd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[0,hi,200,lo], grid:true});
                 brd.createElement('axis',[[0,lo],[1,lo]]);
                 brd.createElement('axis',[[0,lo],[1,lo]]);
                 Start();
                 Start();

Revision as of 14:06, 20 August 2009

This JSXGraph application fetches the live stock quotes of the German DAX Index (gdaxi) from Yahoo!. The curve is updated only once a second, so initially it needs a little patience until the curve is visible.