• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

possible to install tooltips into JavaFX barchart nodes?

 
Ranch Hand
Posts: 151
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found some examples of people inserting tooltips into javafx line-graphs, I tried doing a similar thing for a javafx stackedbarchart and couldn't get it to work.
The mouse event is rarely fired, but even when it is fired the tooltip almost never shows up. Any idea what is wrong?

I'm running this from the initialize() method in my FXcontroller class:


my method for building the charts/graphs data into a series
 
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't tell you how to make it work in the controllerclass, I can however tell you how to in the fxmlfile. I use my controllerclasses only for the businesslogic and do my layout in fxmlfiles.
but looking at you code I gues the problem is you don't add it to the scene.
Hard to say without the rest of the code.
 
S Fox
Ranch Hand
Posts: 151
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can I do it from fxml? I didn't find any info online about charts with fxml.
My charts are showing in the scene but I'm trying to show data values as a pop-up tooltip when you hover the mouse on the bars in the chart. The handler and tooltips aren't working correctly at all.
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for tooltips you dont need a event, that's the point of a tooltip, it always shows when hovering your mousepointer over the field.
 
S Fox
Ranch Hand
Posts: 151
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha you are right!
I got it to work by embedding tooltips into the chart data without a handler, with this example code I found on stackoverflow:



So I can assign my chart data in fxml somehow? I wasn't sure how, so I just put it into controller initialize.

 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!