fsharp.charting live chart doesn't show data

431 views Asked by At

I'm playing with FSharp.Charting and observables. Given the code below chart.ShowChart() throws InvalidOperationException "Enumeration already finished"

If I remove this line the data is printed correctly on the console.

Thanks.

let oauthCfg = oauth.parse @"..\..\oauth.config"
let stream = TweetStream (oauthCfg, 
                          "https://stream.twitter.com/1.1/statuses/sample.json",
                           [])           
stream.TweetReceived |> Observable.add (tweetWriter "tweet.out")
let tweetData : IObservable<list<string*int>> =
    stream.TweetReceived
    |> Observable.scan collectTweets Vector.empty
    |> Observable.map (Seq.map (fun t -> t.Text))
    |> Observable.map countWords

Observable.add (printfn "%A") tweetData

let chart = LiveChart.Column(tweetData)
chart.ShowChart() // <------ InvalidOperationException "Enumeration already finished" thrown

printfn "Press any key to exit."
System.Console.ReadKey() |> ignore
0

There are 0 answers