• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Change the Tick Label Value of X Axis in Java FX

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds Great !.I Will try that and get to you back in case i hang still
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic