Created
October 24, 2013 13:02
-
-
Save ashic/7136850 to your computer and use it in GitHub Desktop.
F# Console app (tried .NET 4.5 and 4.5.1). Chart seems to hang with Not Responding on Windows 8.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Charting | |
open System | |
[<EntryPoint>] | |
let main argv = | |
printfn "%A" argv | |
Chart.Line([ for x in 0 .. 10 -> x, x*x ]).ShowChart() | |
Console.ReadLine() |> ignore | |
0 // return an integer exit code |
You're blocking the message pump. Change ReadLine
to System.Windows.Forms.Application.Run()
Not sure why this is only happening on 8.1 for you though, I would expect this to fail on any Windows version.
It probably will...just happen to be running on Windows 8.1. Haven't tried other versions. Any idea how to terminate the app when using Run()? Launch on separate thread? Easier?
Also, SaveToImage() still gives empty rectangle :(
Hmmm...seems like you need to call ShowChart() before SaveChartAs() otherwise nothing gets rendered.
Please add a bug to http://fsharp.github.io/FSharp.Charting/ and if possible fix it as well :)
hack, but works
use form = new Form(Width=400, Height=300, Visible=true, Text="Hello charting")
Chart.Line([for x in 0 ..10 -> x, x+x]).ShowChart()
System.Windows.Forms.Application.Run(form)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changing ShowChart to
Chart.Line([ for x in 0 .. 10 -> x, x*x ]).SaveChartAs("Foo.png", ChartTypes.ChartImageFormat.Png)
doesn't hang, but results in an empty white rectangle.