Index: trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc	(revision 7091)
+++ trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc	(revision 7210)
@@ -38,4 +38,31 @@
 //    YOU HAVE TWO SEMICOLON!)
 //
+// Example:
+// --------
+//     // Initialize histogram
+//     MHSectorVsTime hist1;
+//     hist1.SetNameTime("MTimeCurrents");
+//     hist1.SetTitle("Title for your Graph;;Q [phe]");
+//
+//     // Define sectors you want to display the mean from
+//     TArrayI s0(3);
+//     s0[0] = 6;
+//     s0[1] = 1;
+//     s0[2] = 2;
+// 
+//     // Define area index [0=inner, 1=outer]
+//     TArrayI inner(1);
+//     inner[0] = 0;
+// 
+//     // Don't call this if you want to have all sectors
+//     hist1.SetSectors(s0);
+// 
+//     // Don't call this if you want to have all area indices
+//     hist1.SetAreaIndex(inner);
+// 
+//     // Task to fill the histogram
+//     MFillH fill1(&hist1, "MCameraDC");
+// 
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MHSectorVsTime.h"
@@ -93,5 +120,6 @@
 void MHSectorVsTime::SetName(const char *name)
 {
-    fGraph->SetName(name);
+    if (fGraph)
+        fGraph->SetName(name);
     MParContainer::SetName(name);
 }
@@ -103,5 +131,6 @@
 void MHSectorVsTime::SetTitle(const char *title)
 {
-    fGraph->SetTitle(title);
+    if (fGraph)
+        fGraph->SetTitle(title);
     MParContainer::SetTitle(title);
 }
@@ -160,4 +189,5 @@
     fGraph->SetName(fEvt ? dynamic_cast<TObject*>(fEvt)->GetName() : "MCamEvent");
     fGraph->SetTitle(fTitle==gsDefTitle?"Camera":fTitle.Data());
+    fGraph->SetMarkerStyle(kFullDotMedium);
 
     fMin =  FLT_MAX;
@@ -191,6 +221,6 @@
     const Double_t val0 = fHCamera.GetMeanSectors(fSectors, fAreaIndex);
 
-    if (TMath::IsNaN(val0)/* || TMath::IsNaN(rms0)*/)
-        return kCONTINUE;
+    if (TMath::IsNaN(val0))
+        return kTRUE;
 
     fGraph->SetPoint(fGraph->GetN(), t, val0);
@@ -200,5 +230,5 @@
         const Double_t rms0 = fHCamera.GetRmsSectors(fSectors, fAreaIndex);
         if (TMath::IsNaN(rms0))
-            return kCONTINUE;
+            return kTRUE;
         ((TGraphErrors*)fGraph)->SetPointError(fGraph->GetN()-1, 0, rms0);
     }
@@ -221,7 +251,4 @@
     fGraph->SetMaximum(fMax+add);
 
-    *fLog << dbg << "Min=" << fMin << " " << fMin-add << endl;
-    *fLog << dbg << "Max=" << fMax << " " << fMax+add << endl;
-
     return kTRUE;
 }
@@ -236,5 +263,5 @@
 }
 
-void MHSectorVsTime::Draw(Option_t *opt)
+void MHSectorVsTime::Paint(Option_t *opt)
 {
     if (!fGraph)
@@ -244,16 +271,9 @@
         return;
 
-    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
-    pad->SetBorderMode(0);
-
-    AppendPad("");
-
     TString str(opt);
-
     if (!str.Contains("A"))
         str += "A";
-    if (!str.Contains("L"))
-        str += "L";
-
+    if (!str.Contains("P"))
+        str += "P";
     if (str.Contains("same", TString::kIgnoreCase))
     {
@@ -269,9 +289,26 @@
     {
         TAxis *axe = h->GetXaxis();
-        axe->SetTimeFormat("%H:%M:%S %F1995-01-01 00:00:00 GMT");
+        axe->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT");
         axe->SetTimeDisplay(1);
-        axe->SetLabelSize(0.025);
-    }
-
-    fGraph->Draw(str);
-}
+        axe->SetLabelSize(0.033);
+        h->GetYaxis()->SetTitleOffset(1.15);
+    }
+
+    // This is a workaround if the TGraph has only one point.
+    // Otherwise MStatusDisplay::Update hangs.
+    gPad->GetListOfPrimitives()->Remove(fGraph);
+    fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data());
+}
+
+// --------------------------------------------------------------------------
+//
+// This displays the TGraph like you expect it to be (eg. time on the axis)
+// It should also make sure, that the displayed time always is UTC and
+// not local time...
+//
+void MHSectorVsTime::Draw(Option_t *opt)
+{
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fGraph);
+    pad->SetBorderMode(0);
+    AppendPad(opt);
+}
Index: trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h	(revision 7091)
+++ trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h	(revision 7210)
@@ -47,4 +47,5 @@
     TArrayI fAreaIndex;
 
+    // MH
     Bool_t SetupFill(const MParList *pList);
     Bool_t Fill(const MParContainer *par, const Stat_t w=1);
@@ -55,7 +56,5 @@
     ~MHSectorVsTime();
 
-    void SetName(const char *name);
-    void SetTitle(const char *title);
-
+    // Setter
     void SetNameEvt(const TString name)  { fNameEvt = name; }
     void SetNameTime(const TString name) { fNameTime = name; }
@@ -64,8 +63,14 @@
     void SetAreaIndex(const TArrayI &a)  { fAreaIndex=a; }
 
+    // Getter
     TH1 *GetHistByName(const TString name="") const;
     //TGraph *GetGraph() { return fGraph; }
 
+    // TObject
+    void SetName(const char *name);
+    void SetTitle(const char *title);
+
     void Draw(Option_t *o=NULL);
+    void Paint(Option_t *o=NULL);
 
     ClassDef(MHSectorVsTime, 1) // Histogram to sum camera events
Index: trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc	(revision 7091)
+++ trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc	(revision 7210)
@@ -291,5 +291,5 @@
         fGraph->GetHistogram()->SetXTitle("Time");
         fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033);
-        fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S %F1995-01-01 00:00:00 GMT");
+        fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT");
         fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1);
     }
