The problem is that you must first display the underlying chart control before it can save the chart to a file (this is pretty dumb, but unfortunately the F # chart is just a lightweight shell from the .NET base libraries).
I think you can either run two lines separately in F # interactive, or you need to explicitly call some method that displays the chart (I believe there is FSharpChart.Show or something like that)
I tested this using F # Charting , which is a newer version of the library (with some API changes, but very similar ideas), and the following works (even when executing all in one command):
#load @"packages\FSharp.Charting.0.87\FSharp.Charting.fsx" open FSharp.Charting let pie = Chart.Pie([("Apples",1);("Oranges",2);("Bananas",3)]) pie.ShowChart() pie.SaveChartAs("D:\\temp\\test.png", ChartTypes.ChartImageFormat.Png)
source share