[ad_1]
I am trying to get JSON from Poloniex's public API method (specifically the returnChartData method) to display chart history of cryptocurrencies against one another into a Highchart Stockchart graph (looking like the demo one here.).
This is part of my JavaScript code to use the Poloniex returnChartData callback, get the JSON from it and implement it into the 'data' segment of the chart. So far it is not working and I can't for the life of me figure out what I need to change.
var poloniexUrl = "https://poloniex.com/public?command=returnChartData¤cyPair=BTC_XMR&start=1405699200&end=9999999999&period=14400";
$.getJSON(poloniexUrl, function(data)
results = data;
);
// Creates Chart
var chart = new Highcharts.StockChart(
chart:
renderTo: 'cryptoChart',
backgroundColor: 'white'
,
title:
text: currentTitle
,
series: [
data: results,
turboThreshold: 1000
],
xAxis:
original: false
,
rangeSelector:
selected: 1
,
plotOptions:
line:
gapSize: 2
);
Would love any help!
[ad_2]
لینک منبع