jtblin / angular-chart.js

Reactive, responsive, beautiful charts for AngularJS using Chart.js: http://jtblin.github.io/angular-chart.js
Other
2.67k stars 761 forks source link

Updating labels without redrawing the whole chart #266

Open stibay opened 8 years ago

stibay commented 8 years ago

I am currently testing this with a line chart. When im adding or updating data the chart updates dynamicly. But if I want to update the label series aswell by either adding and splicing or just updating the array the whole chart is beeing redrawn. Is it possible to fix this so you can avoid the "bouncing" effect every time the chart updates?

jtblin commented 8 years ago

No unfortunately Chart.js only supports update of the data, so when labels etc. change we have to delete and re-create the chart. If you want to remove the bouncing effect, you can disable animations.

stibay commented 8 years ago

This worked perfect when I tested it the origianl chart.js though. Didn't thought the angular version would be slightly "worse" than jquery? :O

jtblin commented 8 years ago

I might be wrong but I'm pretty sure I tried and it didn't work hence it is like this today. If it isn't the case feel free to submit a PR instead of trolling.

On Thu, Dec 10, 2015 at 6:53 PM, stibay notifications@github.com wrote:

This worked perfect when I tested it the origianl chart.js though. Didn't thought the angular version would be slightly "worse" than jquery? :O

— Reply to this email directly or view it on GitHub https://github.com/jtblin/angular-chart.js/issues/266#issuecomment-163527101 .

stibay commented 8 years ago

Don't get what you mean by trolling? Created this plunkr to try to illustrate the issue. http://plnkr.co/edit/jmPNTqlK2N0B6MmUDDMO?p=preview

jtblin commented 8 years ago

Didn't thought the angular version would be slightly "worse" than jquery? :O

Snarky comments == trolling to me. Bu maybe you don't even realise...

Moreover as I said before, just updating the labels is not possible in Chart.js as per https://github.com/nnnick/Chart.js/issues/593. Maybe it will be possible in 2.0 but it's unsure yet. So you really don't know what you're talking about.

It's this kind of comments and attitude that makes open source depressing sometimes.

stibay commented 8 years ago

Was definetly not ment as beeing snarky/trolling and I apologize if you took it offensive. I was more sure I was doing something wrong since everything else with updating and viewing the chart worked a lot better than the Jquery version. Even showed it off to a couple of colleagues and friends ;)

This is not even that big of an issue since our chart will not update very frequently so you will rarely notice this at all, but me beeing a perfectionist I probably responded abit too quick and I just translated from "spoken Norwegian" to English which wasn't offensive ment. I see now how it could be percieved as abit offensive and I sincerely apologizefor that.

Keep up the awesome work ;)

jtblin commented 8 years ago

Ok no worries. English isn't my first language either so there's that as well. As I said originally, you can disable the bouncing effect by setting the animation option to false.

Cheers :)

imdoge commented 8 years ago

excuse, I have the same problem, except set animate: {duration: 0}, can it be updated but not seems to redraw the whole chart resolve in angular-chart? I see sample in chart.js can do that, what cause the result different? seems angular-chart base on chart.js...Ummmm

jtblin commented 8 years ago

All chart.js options can be set via angular-chart. See this example to disable animation.

animation: {
  duration: 0
},
mlubavin commented 7 years ago

@jtblin it looks like 2.x of chart.js now allows changing labels on the fly, am I reading the last comment on https://github.com/chartjs/Chart.js/issues/593 right?

Iqwertz commented 4 years ago

Are there any updates on this topic? Is it now possible with 2.x?