[Title] Fix bug in ui event chart tooltip
authorkamuru <kamuru@kamuru-Samsung-Desktop-System.(none)>
Mon, 18 Nov 2013 03:45:28 +0000 (12:45 +0900)
committerkamuru <kamuru@kamuru-Samsung-Desktop-System.(none)>
Mon, 18 Nov 2013 03:45:28 +0000 (12:45 +0900)
[Desc.] Fix bug in ui event chart tooltip
[Issue]

org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java

index 002dbe0..4201f49 100644 (file)
@@ -171,6 +171,7 @@ public class DAChartRenderer {
                                        break;
                                }
                        }
+                       
                        if (plot.isShowAxis()) {
                                if (plot.isSeriesHeightRange()) {
                                        for (int i = 0; i < seriesSize; i++) {
@@ -588,6 +589,7 @@ public class DAChartRenderer {
 
                int startY;
                if (plot instanceof DAUIEventChartPlot) {
+                       tooltipSize = seriesList.size();
                        startY = (int) (r.height
                                        * (int) (tooltip.getYPosRatio() * tooltipSize) / tooltipSize);
                        if (r.height - startY - totalHeight < 0) {
@@ -596,7 +598,6 @@ public class DAChartRenderer {
                                        startY = 0;
                                }
                        }
-
                } else {
                        startY = (r.y + r.height / 2) - (totalHeight / 2);
                }
@@ -619,6 +620,7 @@ public class DAChartRenderer {
                        if (plot instanceof DAUIEventChartPlot) {
                                series = seriesList.get((int) (seriesList.size() * tooltip
                                                .getYPosRatio()));
+                               tooltipSize = 0;
                        } else {
                                series = seriesList.get(i);
                                if(series.isDisableTooltip()) {
@@ -756,11 +758,6 @@ public class DAChartRenderer {
                        return;
                }
 
-               int seriesItemSize = seriesItems.size();
-               if (seriesItemSize < 1) {
-                       return;
-               }
-               
                Rectangle rect = new Rectangle(r.x, r.y
                                + (r.height / seriesSize * seriesIndex), r.width, r.height
                                / seriesSize);
@@ -778,6 +775,11 @@ public class DAChartRenderer {
                        gc.setForeground(ColorResources.UI_EVENT_CHART_SEPERATE_LINE);
                        gc.drawLine(rect.x, rect.y, rect.width, rect.y);
                }
+               
+               int seriesItemSize = seriesItems.size();
+               if (seriesItemSize < 1) {
+                       return;
+               }
 
                DAChartSeriesItem seriesItem;
                Color color = series.getColor();