Index: trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
===================================================================
--- trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11703)
+++ trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11704)
@@ -1390,4 +1390,7 @@
  * CURRENT EVENT HAS CHANGED. ui handler
  ************************************************************/
+double xval[4096];
+double yval[4096];
+
 void UIConnector::currentEventHasChanged(int cEvent)
 {
@@ -1484,47 +1487,144 @@
     }
 
-    QVector<QwtIntervalSample> boardsHistoSamples(boardsHistoMap.size());
     std::map<int,int>::iterator it = boardsHistoMap.begin();
+    int nsamples = 0;
+    int previousValue = it->first-10;
     for (unsigned int i=0;i<boardsHistoMap.size();i++)
     {
-        QwtInterval interval(double(it->first), it->first+1.0);
-        interval.setBorderFlags(QwtInterval::ExcludeMaximum);
-        boardsHistoSamples[i] = QwtIntervalSample(it->second, interval);
+        if (previousValue != it->first-1)
+        {
+            xval[nsamples] = previousValue+1;
+            yval[nsamples] = 0;
+            nsamples++;
+            xval[nsamples] = it->first-1;
+            yval[nsamples] = 0;
+            nsamples++;
+        }
+        xval[nsamples] = it->first;
+        yval[nsamples] = it->second;
+        previousValue = it->first;
         it++;
-    }
-    boardsTimeHistoItem.setData(new QwtIntervalSeriesData(boardsHistoSamples));
-
-    QVector<QwtIntervalSample> pixelHistoSamples(pixelHistoMap.size());
+        nsamples++;
+        xval[nsamples] = previousValue;
+        yval[nsamples] = 0;
+        nsamples++;
+        if (nsamples > 4090)
+        {
+            cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
+            break;
+        }
+    }
+    it--;
+    xval[nsamples] = it->first+1;
+    yval[nsamples] = 0;
+    nsamples++;
+ //   if (nsamples > 5)
+        boardsTimeHistoItem.setSamples(xval, yval, nsamples);
+
     it = pixelHistoMap.begin();
+    nsamples = 0;
+    previousValue = it->first-10;
     for (unsigned int i=0;i<pixelHistoMap.size();i++)
     {
-        QwtInterval interval(double(it->first), it->first+1.0);
-        interval.setBorderFlags(QwtInterval::ExcludeMaximum);
-        pixelHistoSamples[i] = QwtIntervalSample(it->second, interval);
+        if (previousValue != it->first-1)
+        {
+            xval[nsamples] = previousValue+1;
+            yval[nsamples] = 0;
+            nsamples++;
+            xval[nsamples] = it->first-1;
+            yval[nsamples] = 0;
+            nsamples++;
+        }
+        xval[nsamples] = it->first;
+        yval[nsamples] = it->second;
+        previousValue = it->first;
         it++;
-    }
-    startCellHistoItem.setData(new QwtIntervalSeriesData(pixelHistoSamples));
-
-    QVector<QwtIntervalSample> TMHistoSamples(timeMarksMap.size());
+        nsamples++;
+        xval[nsamples] = previousValue;
+        yval[nsamples] = 0;
+        nsamples++;
+        if (nsamples > 4090)
+        {
+            cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
+            break;
+        }
+   }
+    it--;
+    xval[nsamples] = it->first+1;
+    yval[nsamples] = 0;
+    nsamples++;
+//    if (nsamples > 5)
+        startCellHistoItem.setSamples(xval, yval, nsamples);
+
     it = timeMarksMap.begin();
+    nsamples = 0;
+    previousValue = it->first-10;
     for (unsigned int i=0;i<timeMarksMap.size();i++)
     {
-        QwtInterval interval(double(it->first), it->first+1.0);
-        interval.setBorderFlags(QwtInterval::ExcludeMaximum);
-        TMHistoSamples[i] = QwtIntervalSample(it->second, interval);
+        if (previousValue != it->first-1)
+        {
+            xval[nsamples] = previousValue+1;
+            yval[nsamples] = 0;
+            nsamples++;
+            xval[nsamples] = it->first-1;
+            yval[nsamples] = 0;
+            nsamples++;
+        }
+        xval[nsamples] = it->first;
+        yval[nsamples] = it->second;
+        previousValue = it->first;
         it++;
-    }
-    startTimeMarkHistoItem.setData(new QwtIntervalSeriesData(TMHistoSamples));
-
-    QVector<QwtIntervalSample> delayTriggerSamples(delayMap.size());
+        nsamples++;
+        xval[nsamples] = previousValue;
+        yval[nsamples] = 0;
+        nsamples++;
+        if (nsamples > 4090)
+        {
+            cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
+            break;
+        }
+    }
+    it--;
+    xval[nsamples] = it->first+1;
+    yval[nsamples] = 0;
+    nsamples++;
+ //   if (nsamples > 5)
+        startTimeMarkHistoItem.setSamples(xval, yval, nsamples);
+
     it = delayMap.begin();
-    for (unsigned int i=0;i<delayMap.size(); i++)
-    {
-        QwtInterval interval(double(it->first), it->first+1.0);
-        interval.setBorderFlags(QwtInterval::ExcludeMaximum);
-        delayTriggerSamples[i] = QwtIntervalSample(it->second, interval);
+    nsamples = 0;
+    previousValue = it->first-10;
+    for (unsigned int i=0;i<delayMap.size();i++)
+    {
+        if (previousValue != it->first-1)
+        {
+            xval[nsamples] = previousValue+1;
+            yval[nsamples] = 0;
+            nsamples++;
+            xval[nsamples] = it->first-1;
+            yval[nsamples] = 0;
+            nsamples++;
+        }
+        xval[nsamples] = it->first;
+        yval[nsamples] = it->second;
+        previousValue = it->first;
         it++;
-    }
-    triggerDelayHistoItem.setData(new QwtIntervalSeriesData(delayTriggerSamples));
+        nsamples++;
+        xval[nsamples] = previousValue;
+        yval[nsamples] = 0;
+        nsamples++;
+        if (nsamples > 4090)
+        {
+            cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
+            break;
+        }
+   }
+    it--;
+    xval[nsamples] = it->first+1;
+    yval[nsamples] = 0;
+    nsamples++;
+  //  if (nsamples > 5)
+        triggerDelayHistoItem.setSamples(xval, yval, nsamples);
+
 
 //    startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect());
@@ -1604,9 +1704,18 @@
     triggerDelayHisto->setTitle("Trigger Delays");
 
-    boardsTimeHistoItem.setBrush(QBrush(Qt::red));
-    startCellHistoItem.setBrush(QBrush(Qt::red));
-    startTimeMarkHistoItem.setBrush(QBrush(Qt::red));
-    triggerDelayHistoItem.setBrush(QBrush(Qt::red));
+ //   boardsTimeHistoItem.setBrush(QBrush(Qt::red));
+//    startCellHistoItem.setBrush(QBrush(Qt::red));
+//    startTimeMarkHistoItem.setBrush(QBrush(Qt::red));
+//    triggerDelayHistoItem.setBrush(QBrush(Qt::red));
 //    pixelValueCurveItem.setBrush(QBrush(Qt::red));
+
+    boardsTimeHistoItem.setPen(QColor(Qt::darkGreen));
+    boardsTimeHistoItem.setStyle(QwtPlotCurve::Steps);
+    startCellHistoItem.setPen(QColor(Qt::darkGreen));
+    startCellHistoItem.setStyle(QwtPlotCurve::Steps);
+    startTimeMarkHistoItem.setPen(QColor(Qt::darkGreen));
+    startTimeMarkHistoItem.setStyle(QwtPlotCurve::Steps);
+    triggerDelayHistoItem.setPen(QColor(Qt::darkGreen));
+    triggerDelayHistoItem.setStyle(QwtPlotCurve::Steps);
 
     boardsTimeHistoItem.attach(boardsTimeHisto);
@@ -1641,6 +1750,4 @@
 
 }
-double xval[1024];
-double yval[1024];
 void UIConnector::pixelChanged(int pixel)
 {
Index: trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
===================================================================
--- trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h	(revision 11703)
+++ trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h	(revision 11704)
@@ -31,5 +31,5 @@
 
 #include "qwt_plot.h"
-#include "qwt_plot_histogram.h"
+//#include "qwt_plot_histogram.h"
 #include "qwt_plot_curve.h"
 
@@ -271,7 +271,7 @@
     QwtPlot*     startTimeMarkHisto;
     QwtPlot*     pixelValueCurve;
-    QwtPlotHistogram boardsTimeHistoItem;
-    QwtPlotHistogram startCellHistoItem;
-    QwtPlotHistogram startTimeMarkHistoItem;
+    QwtPlotCurve boardsTimeHistoItem;
+    QwtPlotCurve startCellHistoItem;
+    QwtPlotCurve startTimeMarkHistoItem;
     QwtPlotCurve     pixelValueCurveItem;
     QwtPlotZoomer* curveZoom;
@@ -281,5 +281,5 @@
 
     QwtPlot*        triggerDelayHisto;
-    QwtPlotHistogram triggerDelayHistoItem;
+    QwtPlotCurve triggerDelayHistoItem;
     QwtPlotZoomer* triggerDelayHistoZoom;
     QListWidget* triggerDelayList;
