| Author |
Change the Tick Label Value of X Axis in Java FX
|
alex antony
Greenhorn
Joined: Jan 26, 2011
Posts: 12
|
|
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
Bartender
Joined: Sep 08, 2007
Posts: 2693
|
|
|
Am just guessing- Did you try overriding the formatTickLabel variable for xAxis- Like the way you have implemented for yAxis?
|
Mohamed Sanaulla | My Blog
|
 |
alex antony
Greenhorn
Joined: Jan 26, 2011
Posts: 12
|
|
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
Bartender
Joined: Sep 08, 2007
Posts: 2693
|
|
|
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
Joined: Jan 26, 2011
Posts: 12
|
|
|
Sounds Great !.I Will try that and get to you back in case i hang still
|
 |
 |
|
|
subject: Change the Tick Label Value of X Axis in Java FX
|
|
|