3

I'm currently trying to get FSharpChart to work. Unfortunately after compiling the library and feeding any FSharpChart with data I only get blank outputs, whether I use FSharpChart.WithCreate, FSharpChart.SaveAs or FSharpChart.CopyToClipboard.

Even the included examples produce blank output. Of course I've got Visual Studio 2010 SP1 installed, .NET Framework 4.0 with all the latest patches etc. The code is hosted on Windows 7 x64.

What am I missing?

Be Brave Be Like Ukraine
  • 7,596
  • 3
  • 42
  • 66
em70
  • 6,088
  • 6
  • 48
  • 80

3 Answers3

2

I know it has been a long time but after having the same issue i found that form refreshing do the trick:

open System.Windows.Forms
open MSDN.FSharp.Charting

[<EntryPoint>]
let main argv = 
    let myChart = [for x in 0.0 .. 0.1 .. 6.0 -> sin x + cos (2.0 * x)]
                  |> FSharpChart.Line
    let form = new Form(Visible = true, TopMost = true, Width = 700, Height = 500)
    let ctl = new ChartControl(myChart, Dock = DockStyle.Fill)
    form.Controls.Add(ctl)
    form.Refresh()
    System.Console.ReadKey() |> ignore
    0
eye
  • 304
  • 6
  • 22
0

I hit a similar problem and one issue is that unless it displays on the screen, the forms don't appear to get rendered which is a major PITA and seems to make them useless for any kind of batch generation.

Darren
  • 548
  • 7
  • 10
0

I've seen this too, but I'm afraid I can't recall now what caused the problem.

Have you tried the samples that come included? Can you get them to work?

If you can, the problem is somewhere in your code, and you should be able to work out where.

If not, mail fsbugs@microsoft.com...

Benjol
  • 63,995
  • 54
  • 186
  • 268
  • Quoting myself: "Even the incldued examples produce blank output." When I tried I couldn't get it to work, full stop. Eventually I gave up on it – em70 Jul 30 '11 at 21:11
  • @emaster70, oops, sorry, I must have skip-read that bit. Have you got the latest version of the charting dll? (just a thought) – Benjol Aug 02 '11 at 06:31
  • Very late reply, but gave another try on another machine with no luck, still latest version of the dll... – em70 Dec 11 '11 at 14:12