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..
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.