use of org.eclipse.linuxtools.internal.systemtap.graphing.ui.charts.BarChart in project linuxtools by eclipse.
the class BarChartMouseMoveListener method mouseMove.
@Override
public void mouseMove(MouseEvent e) {
super.mouseMove(e);
ISeries[] allSeries = chart.getSeriesSet().getSeries();
if (allSeries.length == 0) {
return;
}
IAxis xAxis = chart.getAxisSet().getXAxis(0);
String[] categorySeries = ((BarChart) chart).getCategorySeries();
int barIndex = (int) xAxis.getDataCoordinate(e.x);
if (0 <= barIndex && barIndex < categorySeries.length) {
// $NON-NLS-1$
String textTip = "";
for (int i = 0; i < allSeries.length; i++) {
textTip = textTip.concat((i > 0 ? "\n" : "") + // $NON-NLS-1$ //$NON-NLS-2$
MessageFormat.format(// $NON-NLS-1$ //$NON-NLS-2$
Messages.BarChartBuilder_ToolTipCoords, allSeries[i].getId(), ((BarChart) chart).getBarValue(i, barIndex)));
}
setTextTip(textTip);
} else {
tipShell.setVisible(false);
}
chart.redraw();
}