UI : Revision chart tooltip location
authorjungwook.ryu <jungwook.ryu@samsung.com>
Tue, 30 Jun 2015 08:54:13 +0000 (17:54 +0900)
committerjungwook.ryu <jungwook.ryu@samsung.com>
Tue, 30 Jun 2015 08:54:36 +0000 (17:54 +0900)
Change-Id: Ifcf7fec7772d89d66823b4bbe89ccf5c1e3a2ef7
Signed-off-by: jungwook.ryu <jungwook.ryu@samsung.com>
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java

index ef72ec0..8d0f9e9 100644 (file)
@@ -617,9 +617,6 @@ public class DAChartRenderer {
                 */
                int preTextWidthMargin = DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
                                + (DAChartPlotTooltip.TOOLTIP_MARGIN * 2);
-               int startX = getTooltipStartX(realXVal, (preTextWidthMargin + textWidthMax)
-                               * (tooltipSize / seriesCountPerColumn), DAChartPlotTooltip.TOOLTIP_MARGIN);
-
                int totalHeight;
                if (plot instanceof DAUIEventChartPlot) {
                        if (!tooltipTexts.isEmpty()) {
@@ -647,11 +644,13 @@ public class DAChartRenderer {
                } else {
                        startY = (r.y + r.height / 2) - (totalHeight / 2);
                }
-               int rowCount = tooltipSize / seriesCountPerColumn;
+               int columnCount = tooltipSize / seriesCountPerColumn;   // column count of tooltip
                if ((tooltipSize % seriesCountPerColumn) != 0) {
-                       rowCount++;
+                       columnCount++;
                }
-               int tooltipBoxWidth = (preTextWidthMargin + textWidthMax) * rowCount + DAChartPlotTooltip.TOOLTIP_MARGIN;
+               int startX = getTooltipStartX(realXVal, (preTextWidthMargin + textWidthMax)
+                               * columnCount, DAChartPlotTooltip.TOOLTIP_MARGIN);
+               int tooltipBoxWidth = (preTextWidthMargin + textWidthMax) * columnCount + DAChartPlotTooltip.TOOLTIP_MARGIN;
                gc.setAlpha(150);
                gc.setBackground(tooltip.getBackgroundColor());
                gc.setForeground(tooltip.getForegroundColor());