diff --git a/Tools/TimePlot.hs b/Tools/TimePlot.hs
--- a/Tools/TimePlot.hs
+++ b/Tools/TimePlot.hs
@@ -4,6 +4,7 @@
 import Control.Monad
 import Control.Arrow
 import Data.List
+import Data.Ord
 import Data.Maybe
 import qualified Data.Map as M
 import qualified Data.ByteString.Char8 as S
@@ -228,8 +229,9 @@
 makeChart :: forall t . TimeAxis t =>
              (S.ByteString -> ChartKind t) -> [(t, S.ByteString, InEvent)] -> Renderable ()
 makeChart chartKindF []                  = emptyRenderable
-makeChart chartKindF events@((t0,_,_):_) = renderLayout1sStacked plots
+makeChart chartKindF events0 = renderLayout1sStacked plots
   where
+    events@((t0,_,_):_) = sortBy (comparing (\(t,_,_)->t)) events0
     track2events = reverse `fmap` foldl' insert M.empty [(s, (t, e)) | (t, s, e) <- events]
       where insert m (s, r) = M.alter (Just . maybe [r] (r:)) s m
 
diff --git a/timeplot.cabal b/timeplot.cabal
--- a/timeplot.cabal
+++ b/timeplot.cabal
@@ -1,5 +1,5 @@
 Name: timeplot
-Version: 0.2.10
+Version: 0.2.11
 License: BSD3
 License-file: LICENSE
 Copyright: Eugene Kirpichov, 2009
