Skip to content
Snippets Groups Projects
Commit 8c31676d authored by tcarver's avatar tcarver
Browse files

fix heatmap tooltip

parent 282326f1
No related branches found
No related tags found
No related merge requests found
......@@ -985,28 +985,19 @@ public class BasePlot extends Plot
if(offset < 1)
offset = 0;
final int get_values_return_count =
final int nvalues =
getBaseAlgorithm().getValueCount();
int xpos = getPointPosition(event.getPoint().x);
//getXCoordinate(getWidthInBases(),
// offset, event.getPoint().x);
String tt = Integer.toString(xpos);
NumberFormat df = NumberFormat.getNumberInstance();
df.setMaximumFractionDigits(2);
float ypos;
for(int value_index = 0; value_index < get_values_return_count;
++value_index)
{
ypos = getYCoordinate(step_size, getWindowSize(),
offset, value_array_array[value_index],
xpos);
tt = tt + ", " + df.format(ypos);
}
for(int i = 0; i < nvalues; ++i)
tt += ", " + df.format(
getYCoordinate(step_size, getWindowSize(),
offset, value_array_array[i], xpos));
if(lines != null)
{
......@@ -1014,16 +1005,23 @@ public class BasePlot extends Plot
String plotType = lines[0].getPlotType();
if(plotType.equals(LineAttributes.PLOT_TYPES[2]))
{
final int graph_height = super.getSize().height -
final int graph_height = getSize().height -
getLabelHeight() - getScaleHeight() - 2;
float hgt = ((float)graph_height/(float)lines.length);
int hgt = graph_height/value_array_array.length;
float mousePos = (float) (event.getPoint().getY()-
getLabelHeight() - getScaleHeight() - 2.f );
int plotNumber = Math.round(( mousePos / hgt )+.5f);
if(plotNumber < 1)
plotNumber = 1;
else if(plotNumber > value_array_array.length)
plotNumber = value_array_array.length;
if(nvalues > 5)
tt = Integer.toString(xpos)+", "+df.format(
getYCoordinate(step_size, getWindowSize(),
offset, value_array_array[plotNumber-1], xpos));
tt = "Plot number : "+plotNumber+"\n"+tt;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment