Sha256: 3eaf3c5c2621811dae188b19f91eb0399fce478554674655acfb2292b995f77b
Contents?: true
Size: 912 Bytes
Versions: 6
Compression:
Stored size: 912 Bytes
Contents
//= require ./ajax AmCharts.RB.RemoteJSONProvider = AmCharts.RB.Util.Class.create(function() { function state_changed() { var response = this.request.response; if (response.ready_state() == 4) { if (response.status() == 200) { this.data = response.get_json(); this.chart.load_data(this.data); } else { this.chart.failed("Error loading chart data: " + this.url); } } } return { request: null, initialize: function(chart, url, params, method) { this.url = url; this.params = params; this.method = method || 'GET'; this.chart = new AmCharts.RB.Chart(chart); }, load: function(defer) { setTimeout(function(){ this.request = new AmCharts.RB.Ajax.Request(this.url, this.params, this.method, state_changed.bind(this)); }.bind(this), defer || 0) } } }());
Version data entries
6 entries across 6 versions & 1 rubygems