I want to use FSharpChart with a fsx script file in my project. I downloaded and referenced the MSDN.FSharpChart.dll using Nuget and my code looks like this
#r @"..\packages\MSDN.FSharpChart.dll.0.60\lib\MSDN.FSharpChart.dll"
open System.Drawing
open MSDN.FSharp.Charting
[for x in 0.0 .. 0.1 .. 6.0 -> sin x + cos (2.0 * x)]
|> FSharpChart.Line
The path is correct because VS 2012 offers me intellisense and knows the MSDN.FSharp namespace. The problem is that when I run this script in FSI, nothing is shown.
What is wrong?
In order to make your chart show up from FSI you should preload FSharpChart.fsx into your FSI session like in a snippet below:
UPDATE 08/23/2012: For comparison, visualizing the same chart off
FSharpChart.dll
would require some WinForms plumbing: