我正在玩FSharp.Charting和observables。鉴于下面的代码chart.ShowChart()
抛出InvalidOperationException“枚举已经完成”
如果删除此行,数据将在控制台上正确打印。
感谢。
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