Sign in to follow this  
mesler

Can't manipulate Angular graph from client in JS

Recommended Posts

Hello all,

 

 

 

I am trying to create a password strength meter using an Anguar chart.

 

 

 

So far, I'm unsuccessful, and I've conceded that I don't understand what is happening with FC. ;)

 

 

 

I have a password field, and with each keystroke the user types, it submits that input to a javascript function that returns an integer value representing the password strength.

 

 

 

I then want to take that integer, and pass it to the dial in my Angular chart.

 

 

 

I though this would be very simple, but it turns out it isn't, at least for me.

 

 

 

It seemed that feedData would do the trick, but I get the infamous no such function error equivalent when I try to call it from within an onKeyUp event.

 

 

 

I do have the flag set to expose the chart to JavaScript.

 

 

 

I understand that the FC_ functions are called when the chart is rendered, updated, etc. However, when a user types in a character into a password field, this does not trigger the FC_ events. So I guess my question is, how do I get a handle to my chart in this password field's onKeyUp event?

 

 

 

An alternative that I was able to accomplish was to make it re-read the source data URL each time the user types a key, but this is terribly slow and ugly. I would like only the dial value to be changed with each keystroke.

 

 

 

Thanks for any help.

Edited by Guest

Share this post


Link to post
Share on other sites

Arindam,

 

 

 

Thank you for the quick response.

 

 

 

It's not clear to me how I can do setData.

 

 

 

Here a link to the relevant parts of my code:

 

 

 

http://pastebin.com/m1d5fc36f

 

 

 

I suspect that my problem is that myChart, which is what I'm using to setDataURL() and render(), is not the same object that I need access to in my onKeyUp event that would allow me to setData. If that is true, how do I get access to the right object in my onKeyUp event?

 

 

 

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this