how to import JSON data into highstocks candlestick type graph? -



how to import JSON data into highstocks candlestick type graph? -

i working on stock analyzer project ,i ve got stock quotes yahoo finance,and want create dynamic graphs of them.i m using highstock-candlestick highcharts.com ...i have 0 info regarding json. ve seen there's 1 code import info chart.i ve got stock quotes using stock analyzer tutorials of "thenewboston"..i jst need know how link info highstock..

this sample data...how can add together real info yahoo finance website??? plz help

$.getjson('http://www.highcharts.com/samples/data/jsonp.php?a=e&filename=aapl-ohlc.json&callback=?', function (data) <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>highstock example</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <style type="text/css"> ${demo.css} </style> <script type="text/javascript"> $(function () { $.getjson('http://www.highcharts.com/samples/data/jsonp.php?a=e&filename=aapl-ohlc.json&callback=?', function (data) { // create chart $('#container').highcharts('stockchart', { rangeselector : { inputenabled: $('#container').width() > 480, selected : 1 }, title : { text : 'aapl stock price' }, series : [{ type : 'candlestick', name : 'aapl stock price', info : data, datagrouping : { units : [ [ 'week', // unit name [1] // allowed multiples ], [ 'month', [1, 2, 3, 4, 6] ] ] } }] }); }); }); </script> </head> <body>

although little late, thought might useful looking similar solution. jsfiddle example shows stock cost of goog yahoo fiance using yql

$(function () { $.getjson("https://query.yahooapis.com/v1/public/yql?q=" + encodeuricomponent("select date, open, high, low, close csv url='http://real-chart.finance.yahoo.com/table.csv?s=goog&d=2&e=4&f=2015&g=d&a=2&b=27&c=2014&ignore=.csv' , columns='date,open,high,low,close,volume,adj close'") + "&format=json&callback=?", function (data) { //console.log(data.query.results); var info = data.query.results.row; info = data.splice(1, data.length); //console.log(data); var processeddata = []; $(data).each(function(index, value) { //console.log(date.parse(value.date).gettime()); //console.log(date.parse(value.date)); processeddata.push([date.parse(value.date), parsefloat(value.open), parsefloat(value.high), parsefloat(value.low), parsefloat(value.close)]); }); processeddata = processeddata.reverse(); //console.log(processeddata); // create chart $('#container').highcharts('stockchart', { rangeselector : { selected : 1 }, title : { text : 'goog stock price' }, series : [{ type : 'candlestick', name : 'goog stock price', info : processeddata, tooltip: { valuedecimals: 2 } }] }); });

});

json highstock yahoo-finance

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -