diff --git a/IHaskell/Display/Charts.hs b/IHaskell/Display/Charts.hs
--- a/IHaskell/Display/Charts.hs
+++ b/IHaskell/Display/Charts.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE NoImplicitPrelude, CPP #-}
 module IHaskell.Display.Charts () where
 
 import ClassyPrelude
@@ -30,14 +30,18 @@
 
 chartData :: Renderable a -> FileFormat -> IO DisplayData
 chartData renderable format = do
-  -- Switch to a temporary directory so that any files we create aren't
-  -- visible. On Unix, this is usually /tmp.
-  try (getTemporaryDirectory >>= setCurrentDirectory) :: IO (Either SomeException ())
+  switchToTmpDir
 
   -- Write the PNG image.
   let filename = ".ihaskell-chart.png"
       opts = def{_fo_format = format, _fo_size = (width, height)}
-  renderableToFile opts renderable filename
+      toFile = renderableToFile opts
+
+#if MIN_VERSION_Chart_cairo(1,3,0)
+  toFile filename renderable
+#else
+  toFile renderable filename
+#endif
 
   -- Convert to base64.
   imgData <- readFile $ fpFromString filename
diff --git a/ihaskell-charts.cabal b/ihaskell-charts.cabal
--- a/ihaskell-charts.cabal
+++ b/ihaskell-charts.cabal
@@ -7,7 +7,7 @@
 -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.1.0.0
+version:             0.2.0.0
 
 -- A short (one-line) description of the package.
 synopsis:            IHaskell display instances for charts types
@@ -58,14 +58,14 @@
               OverloadedStrings
              
   -- Other library packages from which modules are imported.
-  build-depends:       base ==4.6.*,
+  build-depends:       base ==4.6.* || ==4.7.*,
                        classy-prelude >=0.6,
                        bytestring,
                        data-default-class,
                        directory,
                        Chart,
                        Chart-cairo,
-                       ihaskell >= 0.3
+                       ihaskell >= 0.5
   
   -- Directories containing source files.
   -- hs-source-dirs:      
