Source:
<code>public void fill(Control control, MouseEvent event, Point pt) { if (getChartViewer().getWindowDuration() != 0) { Chart chart = getChart(); IAxisSet axisSet = chart.getAxisSet(); IAxis xAxis = axisSet.getXAxis(0); double xCoordinate = xAxis.getDataCoordinate(pt.x); ISeries[] series = getChart().getSeriesSet().getSeries(); if ((xCoordinate < 0) || (series.length == 0)) { return; } double[] xS = series[0].getXSeries(); if (xS == null) { return; } int index = Arrays.binarySearch(xS, xCoordinate); index = index >= 0 ? index : -index - 1; int maxLen = 0; for (ISeries serie : series) { if (isValid(index, serie)) { maxLen = Math.max(maxLen, serie.getId().length()); } } TmfCommonXAxisChartViewer viewer = null; ITmfChartTimeProvider timeProvider = getChartViewer(); if (timeProvider instanceof TmfCommonXAxisChartViewer) { viewer = (TmfCommonXAxisChartViewer) timeProvider; } ITmfTimestamp time = TmfTimestamp.fromNanos((long) xCoordinate + getChartViewer().getTimeOffset()); addItem(null, ToolTipString.fromString(Messages.TmfCommonXLineChartTooltipProvider_time), ToolTipString.fromTimestamp(time.toString(), time.toNanos())); for (ISeries serie : series) { double[] yS = serie.getYSeries(); if (isValid(index, serie)) { String key = serie.getId(); <START> Format format = null; <END> if (key != null && viewer != null) { IYAppearance appearance = viewer.getSeriesAppearance(key); key = String.format(HTML_COLOR_TOOLTIP, appearance.getColor(), key); format = viewer.getSwtChart().getAxisSet().getYAxes()[0].getTick().getFormat(); } if(format == null) { format = getNumberFormat(); } addItem(null, ToolTipString.fromHtml(key), ToolTipString.fromString(format.format(yS[index]))); } } } }</code><technical_language>Still, format obtained this enclosing for, I think, avoid for series same</technical_language>

Target:
public void fill(Control control, MouseEvent event, Point pt) { if (getChartViewer().getWindowDuration() != 0) { Chart chart = getChart(); IAxisSet axisSet = chart.getAxisSet(); IAxis xAxis = axisSet.getXAxis(0); double xCoordinate = xAxis.getDataCoordinate(pt.x); ISeries[] series = getChart().getSeriesSet().getSeries(); if ((xCoordinate < 0) || (series.length == 0)) { return; } double[] xS = series[0].getXSeries(); if (xS == null) { return; } int index = Arrays.binarySearch(xS, xCoordinate); index = index >= 0 ? index : -index - 1; int maxLen = 0; for (ISeries serie : series) { if (isValid(index, serie)) { maxLen = Math.max(maxLen, serie.getId().length()); } } TmfCommonXAxisChartViewer viewer = null; Format format = null; ITmfChartTimeProvider timeProvider = getChartViewer(); if (timeProvider instanceof TmfCommonXAxisChartViewer) { viewer = (TmfCommonXAxisChartViewer) timeProvider; format = viewer.getSwtChart().getAxisSet().getYAxes()[0].getTick().getFormat(); } ITmfTimestamp time = TmfTimestamp.fromNanos((long) xCoordinate + getChartViewer().getTimeOffset()); addItem(null, ToolTipString.fromString(Messages.TmfCommonXLineChartTooltipProvider_time), ToolTipString.fromTimestamp(time.toString(), time.toNanos())); for (ISeries serie : series) { double[] yS = serie.getYSeries(); if (isValid(index, serie)) { String key = serie.getId(); if (key != null && viewer != null) { IYAppearance appearance = viewer.getSeriesAppearance(key); key = String.format(HTML_COLOR_TOOLTIP, appearance.getColor(), key); } double yValue = yS[index]; if (format == null) { addItem(null, ToolTipString.fromHtml(key), ToolTipString.fromDecimal(yValue)); } else { addItem(null, ToolTipString.fromHtml(key), ToolTipString.fromString(format.format(yValue))); } } } } }