Updating Chart Data via Ajax?
See original GitHub issueHi,
I have an ajax on the setinterval timer and would load the line chart data (the data loads nicely, formatted in json) but It error out update() function. Can someone point me the right direction?. Thank you.
$(function() { $(document).ready(function(){
var get_data = setInterval(function(){
var ajaxrequest;
ajaxrequest = $.ajax({
type:"post",
datatype:"Json",
url:"index.php?r=site%2FChartdata",
data: (typeof data ==="string"? data:null),
success: function(data) {
var mychart //= $('#LineChart .ct-chart');
mychart.data = data;
mychart.update(); //<-- Error on this, Function not found.
},
});
},3000);
});
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
HOWTO: Update your charts dynamically with AJAX
To update your charts using AJAX requires you to understand that the page you're requesting via AJAX doesn't generate the chart. It only...
Read more >Chart.js - Dynamically Update Chart Via Ajax Requests
You can use the CSS from another Pen by using its URL and the proper URL extension.
Read more >Refresh the Bar Char in ChartJS (v2.6.0) Using Ajax ...
And update the data to what you get from your ajax call, and use the chart.update() method, so you can keep using the...
Read more >Live Updating JavaScript Charts from JSON API & AJAX
A tutorial on creating Live Updating JavaScript Charts with Data coming from an external JSON API using AJAX.
Read more >Update Charts from JSON API & AJAX
A guide on how to update the charts from JSON API & AJAX. In many cases, you might not have the data available...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you don’t have the original chart object that was returned during instanciation in this context, then try this:
Hello, i am using Chartist JS. and i want to change it when click on date means i want to send date value by ajax and then according to date, chart series value fetch from data base and according to value chart should be change. please any one help me…