tmf.ui: make common line charts display the window range, not their model range
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 14 Oct 2016 16:45:55 +0000 (12:45 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 19 Oct 2016 01:08:25 +0000 (21:08 -0400)
Change-Id: Ie6cea17dea1490af724adec1d0743d01cad884f6
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/83251
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/linecharts/TmfCommonXLineChartViewer.java

index 1bf9e503bb89ca718ba9b99fabf08e5e5d28c1ab..10db54ba7168a57a9393ef71852f2867650080c9 100644 (file)
@@ -323,8 +323,8 @@ public abstract class TmfCommonXLineChartViewer extends TmfXYChartViewer {
      *            The array of values for the series
      */
     protected void setSeries(String seriesName, double[] seriesValues) {
-        if (fXValues.length > seriesValues.length) {
-            throw new IllegalStateException();
+        if (fXValues.length != seriesValues.length) {
+            throw new IllegalStateException("All series in list must be of length : " + fXValues.length); //$NON-NLS-1$
         }
         fSeriesValues.put(seriesName, seriesValues);
     }
@@ -400,9 +400,8 @@ public abstract class TmfCommonXLineChartViewer extends TmfXYChartViewer {
                     IAxisTick xTick = getSwtChart().getAxisSet().getXAxis(0).getTick();
                     xTick.setFormat(tmfChartTimeStampFormat);
 
-                    final double start = xValues[0];
-                    int lastX = xValues.length - 1;
-                    double end = (start == xValues[lastX]) ? start + 1 : xValues[lastX];
+                    final double start = 0.0;
+                    double end = getWindowEndTime() - getWindowStartTime();
                     getSwtChart().getAxisSet().getXAxis(0).setRange(new Range(start, end));
                     if (maxy > miny) {
                         getSwtChart().getAxisSet().getYAxis(0).setRange(new Range(miny, maxy));
This page took 0.025754 seconds and 5 git commands to generate.