haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

Is the code example given in SparkLine.hs correct?

Open mpilgrem opened this issue 9 years ago • 1 comments

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)

mpilgrem avatar May 23 '16 22:05 mpilgrem

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.

timbod7 avatar May 23 '16 22:05 timbod7