Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I force a NumberAxis to update?

 
Chris R Olsen
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Experienced programmer but FX newbie here --

I am writing a statistics program and want to make a scatterplot. I am using the FX 8 ScatterChart class.

What I want to do is click and drag on one end of the xAxis (a NumberAxis) to reset the upper end of the xAxis scale. My xAxis scale is reacting to the clicks and drags, and knows where I'm clicking and dragging on the xAxis. However, I am running up against a so-far intractable problem. I have correctly recalculated the scale value (newMax, a double) that I want to be the upper end of the xAxis, and then do this:

xAxis.setUpperBound(newMax);

It seems to me that this should cause the xAxis to update, but sadly this is not the case. I have found something called "requestLayout" but that doesn't seem to work, or I may not be understanding how or when to make such a request. My thinking now is that perhaps I need to make the whole ScatterChart update, since changing the xAxis will move the points in the scatterplot as well. Unfortunately, I have not found a strategy for making this happen either.

So my question is, how to I make the ScatterChart update? Are there factors such as my Pane choice relevant (I'm using a StackPane at present.)

Thanks in advance!

-- Chris Olsen

 
Chris R Olsen
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha! I have answered my own question, after about 24 hours of frustration -- no doubt the answer came b/c of the inspiration of this community.

It turns out that one must set the autoranging to false before attempting to change the axis.

Hope this answer helps others!

-- Chris Olsen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic