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.
@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
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.
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Don't get me started about those stupid light bulbs.