Ahh, thanks, I'll check that out.
The problem with the stuff in queens-charts is that Ben checked in the
wrong thing last fall, so it wasn't actually the most up-to-date version
of charting and had dozens of flaws and didn't fully work. Mamye tried
correcting some of the issues by trying to check in a somewhat more
recent changeset that was floating around, but she said she wasn't able
to fully work it out, and I think that one may have still had a couple
dozen issues that Phil pointed out that I subsequently fixed.
So what I'm doing now is, I'm updating everything from the "last known
working" version from last fall, to make sure we're starting with code
that worked in the first place (which was almost approved, but then got
lost in the shuffle) and bringing it up to snuff with our current ways
of doing things. It's going well so far, but I just wasn't sure how to
deal with this particular situation. Anyway, I'll port over your change.
Thanks!
-J
André Bargull wrote:
I've already converted all "applyConstraint" to
"applyConstraintMethod" for the queens-charts (at least in trunk).
So, I'm working on bringing all the charting stuff up to speed so
that we can finally get that checked in appropriately, and I have a
bunch of instances of applyConstraint() that need to be changed. So
what I did was, I took the functions and made methods out of them,
but I'm not sure exactly what to feed into applyConstraintMethod() to
get it to work the same way. For instance, part of my code block
looks like:
if(this.charttype == "bar"){
if(this.drawaxis == 'x'){
var f =
function(ignore=null){ this.setAttribute("x",
this.barlink.x + (this.barlink.width / 2) -
(this.width / 2)); }
var d = [this.barlink, "x"];
this.applyConstraint("x", f, d);
var ff = function(ignore=null){
this.setAttribute("y", this.barlink.y -
this.height - 4);
}
var dd = [this.barlink, "y"];
this.applyConstraint("y", ff, dd);
if(this.fadein == true){
this.fader.doStart();
}
}
So what I did was, I made methods for these:
<method name="constrainBarDrawXX" args="ignore=null">
this.setAttribute('x', this.barlink.x + (this.barlink.width
/ 2) - (this.width / 2));
</method>
<method name="constrainBarDrawXY" args="ignore=null">
this.setAttribute('y', this.barlink.y - this.height - 4);
</method>
...and changed the script to:
if(this.charttype == "bar"){
if(this.drawaxis == 'x'){
this.applyConstraintMethod("constrainBarDrawXX",
[this.barlink, x, this, x]);
this.applyConstraintMethod("constrainBarDrawXY",
[this.barlink, y, this, y]);
if(this.fadein == true){
this.fader.doStart();
}
However, the labels now don't exhibit the same behavior as when they
were using applyConstraint(). What am I doing wrong?
Thanks!
Josh