haskell-chart
haskell-chart copied to clipboard
Is the code example given in SparkLine.hs correct?
The example code given in the introduction to SparkLine.hs has the final line:
renderableToFile fopts (sparkLineToRenderable sl) "bar_spark.png"
However, in Graphics.Rendering.Chart.Backend.Cairo, the type of renderableToFile is:
renderableToFile :: FileOptions -> FilePath -> Renderable a -> IO (PickFn a)
and the file path comes second, not last. Should the line read:
renderableToFile fopts "bar_spark.png" (sparkLineToRenderable sl)
I think you are correct:
https://github.com/timbod7/haskell-chart/blob/master/chart/Graphics/Rendering/Chart/SparkLine.hs#L26
Clearly the comment needs to be fixed following a change to the rendererableToFile function.
I'll do this soon.