【发布时间】:2017-03-31 14:09:03
【问题描述】:
我正在尝试使用 Visual Studio Code 或 Atom 中的 F# 脚本来可视化一些数据(两者都尝试过)。有一些简单的例子展示了它是如何使用 XPlot Google Charts 工作的:
https://tahahachana.github.io/XPlot/ http://tomasp.net/blog/2016/fslab-ionide/
但我没有得到任何图表输出。如果我执行这样的代码:
inputs
|> Chart.Combo
|> Chart.WithOptions
(Options(title = "Coffee Production", series =
[| for typ in series -> Series(typ) |]))
|> Chart.WithLabels
["Bolivia"; "Ecuador"; "Madagascar"]
|> Chart.WithLegend true
|> Chart.WithSize (600, 250)
我只在 FSI 窗口中得到输出:
验证它:GoogleChart = XPlot.GoogleCharts.GoogleChart {Height = 250; id = "85c0bc41-3ae2-4a40-8517-da33aa7ad713"; 宽度 = 600;}
...这当然是正确的,在文本窗口中还可以显示什么?但是如何使用 F# 交互获得 VS Code 或 Atom 中的图形输出?我显然缺少一些基本的东西,但是什么?
【问题讨论】:
-
如果您通过
#load加载它,那么注册的 fsi 输出处理程序应该在新的浏览器窗口中打开图表...(该博客仅适用于 Atom,因为 VS Code 中的 Ioined 不支持漂亮的 HTML 输出...) -
感谢 Tomas,现在可以了,VS Code 和 Atom 都在外部浏览器窗口中显示输出。但我以为我看到了 Atom 显示输出的屏幕截图。还是我错了?
标签: charts visual-studio-code atom-editor f#-interactive ionide