This is working perfectly fine with my own data, but I have set of buttons that will send an AJAX request to a data file and get a response that should update the charts, but it does not seem to update properly.
The chart code is more or less exactly the same as your example (I am just testing things to see if it works before I put time into it)
The below code is what happens when the one of the buttons are pressed (jquery)
function data_send(var1,event)
{
event.preventDefault();
$.post("graph_data.php", {
company: var1,
dataType : "json",
})
.done(function(result) {
if(!result) {
return;
}
ChartWhole.setDataSource(result.d);
ChartWhole.getDataSourceSettings().reloadData();
ChartDetail.setDataSource(result.d);
ChartDetail.getDataSourceSettings().reloadData();
});
};
I tried using many variations of the bold code, but the charts do not want to update, the response from the request comes through (checks out with FireBug)
In a format like this, which is exactly the same format (not exactly the same values, it is the correct values) that shows on page load.
The above data does not seem to then be loaded into the two charts properly, first I did not use the reloadData() at all, but then when using setDataSource() did not work I looked for other things that I might have to do so I added the reloadData() into the mix, though its still not doing anything, I have also tried using both setDataSource(result.d) and setDataSource(result)
I would be very appriciative of a solution to this issue.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Tinman
I am using the code from here: http://www.jchartfx.com/demo/64983802-edb8-e211-84a5-0019b9e6b500
This is working perfectly fine with my own data, but I have set of buttons that will send an AJAX request to a data file and get a response that should update the charts, but it does not seem to update properly.
The chart code is more or less exactly the same as your example (I am just testing things to see if it works before I put time into it)
The below code is what happens when the one of the buttons are pressed (jquery)
function data_send(var1,event)
{
event.preventDefault();
$.post("graph_data.php", {
company: var1,
dataType : "json",
})
.done(function(result) {
if(!result) {
return;
}
ChartWhole.setDataSource(result.d);
ChartWhole.getDataSourceSettings().reloadData();
ChartDetail.setDataSource(result.d);
ChartDetail.getDataSourceSettings().reloadData();
});
};
I tried using many variations of the bold code, but the charts do not want to update, the response from the request comes through (checks out with FireBug)
In a format like this, which is exactly the same format (not exactly the same values, it is the correct values) that shows on page load.
[{"Open":167,"Date":"2013-10-02T16:45:05.000Z"},{"Open":163,"Date":"2013-10-03T23:30:05.000Z"},{"Open"
:157,"Date":"2013-10-04T22:45:05.000Z"}
The above data does not seem to then be loaded into the two charts properly, first I did not use the reloadData() at all, but then when using setDataSource() did not work I looked for other things that I might have to do so I added the reloadData() into the mix, though its still not doing anything, I have also tried using both setDataSource(result.d) and setDataSource(result)
I would be very appriciative of a solution to this issue.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.