-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing data in a graph after initial creation #23
Comments
The examples are all pulling in external JSON, so we haven't really spent a lot of time working with live updates yet. We've structured the directives so they should be taking advantage of Angulars $scope bindings, and if the scope changes it should just redraw the chart. Do you have some sample code I can take a look at that demonstrates the problem? |
Index.html
app.js
The problem is exhibited on my machine (MacOS running Chrome) - basically the data draws as expected but it doesn't remove the old stuff and generates new axes on the wrong side of the graph (subsequent data draws the axes over the second axes location). I looked through the code and it seems to be simply reassigning the data object internally so I don't understand why it isn't working (as doing this in vanilla dimple appears to work). Thanks for looking into this. |
Thanks @filtoid. @paulcpederson and figured out what was going on. Right now we're binding data to the series rather than the graph - so calling chart.draw() just redraws the entire chart (including axis and legend) with the new data in the series, rather than redrawing the chart with all existing bits and pieces with new data. We're going to re-architect the directive to make the charts behave as expected - what you want it to be doing is exactly what we would expect it to do. So uh ... thanks for the heads up that it don't. We'll try to get it today or tomorrow - but PR's welcome if you want to crack into it yourself. |
Okay! This is fixed in #26. I used your random data controller (which is awesome) and built a demo. http://nikolaswise.github.io/angular-dimple/examples/#/animation-test |
Perfect thanks for that :) |
It's not clear from the documentation how to update an existing graph. I've tried simply assigning a new set of data to the scope variable but this seems to add data and then draw new data over the top - creating new Y axes as well. Is this even possible or is it a 'write once' object with updates requiring a page refresh.
The text was updated successfully, but these errors were encountered: