Adding Auto Zoom Reset Option to BKit Graphs
A few days ago a developer stopped by to ask me if I could make a change to the BKit graphs as he had heard from the users that they didn't like the default behavior - bug is what he used, but it really wasn't.
Basically, if you pull up any graph, and then zoom in on a section of it with the mouse, and then change the axes the zoom remains in effect until you tell it to reset by clicking on it with the mouse. It's an orthogonal control set - zoom is one thing - axis control another. Seems simple to me. Sigh... not so to others.
He said they wanted to have the zoom reset (zoomed out) all the way when the axes were changed. I can see this. But I can also see the default behavior. He agreed that there were two ways of looking at it - but I'm guessing that he was only interested in saying what would get me to put in the feature he wanted. So be it.
So we settled on an option that can be given to the graphs, or set in the applet PARAM tags that will tell the graph when it changes the data sets to reset the zoom all the way out. The problem came in when I tried to find out how to do this in VantagePoint. It wasn't obvious, I tell you that. This was made for the mouse actions and not programmatically. So I had to send off an email to their tech support and see what I was missing.
Turns out, the tech support agrees with me that this wasn't easy to find, and the code to do it wasn't obvious either. But with two calls you can reset an axis, and given that we have two, and sometimes three, axes to deal with. I put the code into resetZoomOnGraph() and then added an ivar to see if we needed to call this on changes to the graph. If so, then call it, if not, no biggie. Either way, there's a way to do it manually now, which is nice.
I've got all the code ready to go, and as soon as I get the fix for the other VantagePoint bug I've got pending with them, I'll check it all in and then let the guys know that the new applet tag is there for their use and they can have it anyway they want.