angular-morris icon indicating copy to clipboard operation
angular-morris copied to clipboard

ykeys and labels not work dynamically

Open ghost opened this issue 9 years ago • 6 comments

Hi, when I try to change Data, ykeys and labels not are changend dynamically with new data. Why? Can you add feature about "goalLineColors"? Thanks.

ghost avatar Feb 04 '16 09:02 ghost

Hi @Andrewhx

I use angular morris in tons of projects, dynamically and async with no problems =)

it could be more easiest if you try to reproduce your problem at tools like jsfiddle

the feature 'goalLineColors' already exists

Sorry but i am closing because this is not a problem with angular-morris module

stewones avatar Feb 04 '16 16:02 stewones

Hi @Andrewhx

I have added this sample to docs. Maybe it can help you.

https://jsfiddle.net/stewones/9zjasq3r/

stewones avatar Mar 20 '16 13:03 stewones

I don't understand why this issue is closed, in my honest opinion, it should be reopened.

Look at this: https://jsfiddle.net/zc34s9b4/1/ After 2 seconds, the graph should be updated with only one line.

Right now, in the code, the only watcher is set on "data", I think it should be added on other fields too. At least on colors, yKeys and labels, to be able to filter which data is shown without having to reconstruct the entire object.

Tronix117 avatar Apr 12 '16 12:04 Tronix117

Hi @Tronix117

Yes now I can sense this issue. Look how a jsFiddle makes all the difference.

but I'm no time to add this feature right now

stewones avatar Apr 12 '16 14:04 stewones

(Hi @stewones, I'm not the original poster by the way :) )

I solved this by using an empty data structure, and just at the next digest putting back the datas in place.

It's not perfect and flicker sometimes, but it's working until something better is implemented.

Like so: https://jsfiddle.net/r7v88a5y/1/

Tronix117 avatar Apr 12 '16 15:04 Tronix117

@Tronix117 yay I realized later :grin:

Also think it would be a good feature and it is not so hard to do. I'll try to hack this weekend

stewones avatar Apr 12 '16 22:04 stewones