XPlot:如何显示和导出图表?

时间:2019-07-02 11:22:14

标签: charts .net-core f# plotly fslab

我在MacOS上使用paket.dependencies

有一个简单的.NET Core控制台项目。
storage: symlink
source https://www.nuget.org/api/v2
nuget FsLab

paket.references

FsLab

和程序

open XPlot.Plotly
[<EntryPoint>]
let main argv =
    [1 .. 10] |> Chart.Line |> Chart.Show
    0

dotnet run发出警告时

warning NU1701: Package 'XPlot.Plotly 1.5.0' was restored using
'.NETFramework,Version=v4.6.1' instead of the project target framework
'.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your
project.

和一堆类似的错误,然后是错误

Unhandled Exception: System.ComponentModel.Win32Exception: Permission denied
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at XPlot.Plotly.Html.showInBrowser(String html, String pageId)
at XPlot.Plotly.Chart.Show(PlotlyChart chart)
at Program.main(String[] argv)

似乎正在尝试在浏览器中显示图表。我有三个问题:

  1. 发生了什么事?
  2. 如何使它显示在浏览器中?
  3. 如何以编程方式将图表导出到文件(例如PNG)?

0 个答案:

没有答案