【问题标题】:Displaying charts using F# Ionide plugin in Visual Studio Code or Atom在 Visual Studio Code 或 Atom 中使用 F# Ionide 插件显示图表
【发布时间】: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


【解决方案1】:

这个问题是在搜索 Visual Studio Code Insiders 和 .NET Interactive 时提出的。看起来这是目前内联 XPlot 的方法:

#i "nuget:https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"
#r "nuget:xplot.plotly.interactive"

【讨论】:

    猜你喜欢
    • 2015-10-04
    • 1970-01-01
    • 2019-10-18
    • 2018-01-19
    • 2015-10-16
    • 2018-03-28
    • 2022-10-22
    • 2018-09-25
    • 1970-01-01
    相关资源
    最近更新 更多