tmf.ui: make common line charts display the window range, not their model range
[deliverable/tracecompass.git] / 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.026603 seconds and 5 git commands to generate.