• 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

Interactive Charts

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hellow!

Do you know about any library that has built in funcitions for interactive charts in Swing/AWT.
Something like a "drag-drop" line chart. So that user can change the graph dynamically.

Or an idea how to do that in Java.

Tnx.
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you checked out JFreeChart
 
J Fae
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, but the graphs are not "clickable"
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... by which you mean what, exactly?
 
J Fae
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


At first you have blue, than by clicking on an dragging, you could change it
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JFreeChart comes with a subclass of JPanel (called ChartPanel if memory serves); that might be extendable to do this.
 
J Fae
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
final XYSeries series = new XYSeries("XYGraph");
series.add(1, 1);
series.add(1, 2);
series.add(2, 1);
series.add(3, 9);
series.add(4, 10);
...

panel.addChartMouseListener(new ChartMouseListener() {

@Override
public void chartMouseMoved(ChartMouseEvent arg0) {


}

@Override
public void chartMouseClicked(ChartMouseEvent arg0) {
// TODO Get location where user clicked and add coordination to data
// series.add(new Random().nextInt(10), new Random().nextInt(10));

//Returns the underlying mouse event (never null) that triggered the generation of this event.
//This contains information about the mouse location, among other things.
System.out.println("point:"+arg0.getTrigger().getPoint()); //<--doesnt help to identify the location of chart line



}
});
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ChartMouseEvent object has a method getEntity() which in this case returns an instance of 'XYItemEntity'. This class has methods like getSeries() and getItem() which gives back the data about which item on which series was clicked.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic