• 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

mouse event

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to add tooltip for the mouse event i.e., In graph, when the mouse goes over the co-ordinate the values should be display.I used paint method to draw the graph,in java.Can any one say how this should be achieved...Its quite emergency..
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot...
But you have taken the data as 26.2,45.5,....in that way,
i need for the co-odrinates of x and y ie.,for a graph..
Like a real graph for plotting datas..
can you help me..
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See how the ordinate data was scaled in the example above: from zero to the maximum value.
You can do the same for your x values - compute a scale factor that will show them in the
available space. You can scale them to fit within any limits that you want.
For example you could scale the data along either axis to fit between the minimum value
and maximum value, or from zero to the maximum value or from zero to a value above the
maximum. How you set your graph up depends on what you want to do.
The technique is the same: divide the available space by the range in data values to get
the scale. Apply the scale to your data values and offset them relative to the graph
origin.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No,craig..I'm struck up when i doing so i.e., getting x&y values and plotting,scince i'm new to java..So can you please mmodify the above coding and explain me...Its quite emergency
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic