This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change the Tick Label Value of X Axis in Java FX

 
alex antony
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have tried out some samples with Java FX and it is exciting.I have been trying to generate a dynamic Graph using JavaFX .It Worked out Well and i was able to see the Graph Moving .But as the Graph Moves i Would also like to see my x-axis labels moving.But i dont know how to do it .

I am posting my code here.






These are the two classes that i am using main.fx and AnimatedLineChart.fx In the Main .fx i have created a timer thread for one second and it calls the AnimatedLineChart.fx and deletes the rightmost value and adds the new Value to the left hand side which creates a moving impression.But the concern is the X-Axis Labels dont change.How to do that


Any Help is highly Appreciated
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am just guessing- Did you try overriding the formatTickLabel variable for xAxis- Like the way you have implemented for yAxis?
 
alex antony
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

The Thing is The Tick Values for Y Axis will remain Constant but for the X-Axis it will change as the thread runs.

Thats why i dint override the formatticklabel method in the normal way that i did for y axis.

The Function addvalue is called by the thread each second and the actual value of the graph is updated through this function data.xVValue=data.XValue-1 ;So I would need a method that i call which can update the xAxis tick label value

I Tried this inside the for loop xAxis.formatTickLabel function (value) {} but doesnt seem to work

Any Suggestions !
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have a look at tickMarks variable which accepts an array of TickMark. May be you can bind the tickMarks variable with some constant TickMark[] and keep changing the variables of the TickMark instances in the TickMark[].
 
alex antony
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds Great !.I Will try that and get to you back in case i hang still
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic