2

嗨我在 MacOS 上运行 Xamarin 6.1.5 我已经安装了 FSharp.Charting 0.90.14

这是我第一次尝试使用它

无论我尝试编译还是尝试在 F# 交互中,我都会收到这种错误

(Chart.Line [ for x in 1.0 .. 100.0 -> (x, x ** 2.0) ]).ShowChart();;

System.ArgumentNullException:值不能为空。参数名称:System.ThrowHelper.ThrowArgumentNullException (...) 处的键

EDIT1 我确实很傻,没有安装Gtk版本

EDIT2 F# 交互式“作品”中的上述单行代码。执行需要一些不寻常的时间,但我看到带有图表的窗口。无法将鼠标悬停在图表上并查看坐标,但它可能不是默认设置?另外,我不明白如何关闭图表出现的窗口。一切还好吗 ?

4

1 回答 1

3

你是不是想FSharp.Charting在 Mac 上使用 package 而不是FSharp.Charting.Gtk,正如文档所说的那样?

https://fslab.org/FSharp.Charting/ReferenceTheLibrary.html

编辑:回答原始问题的编辑:不,应该没有警告。这就是它对我的工作方式:

$ fsharpi

F# Interactive for F# 4.1
Freely distributed under the Apache 2.0 Open Source License

For help type #help;;

> #load "packages/FSharp.Charting.Gtk.0.90.14/FSharp.Charting.Gtk.fsx" ;;
[Loading /Users/avysk/Projects/_Sandbox/testfsharpcharting/packages/FSharp.Charting.Gtk.0.90.14/FSharp.Charting.Gtk.fsx]

namespace FSI_0002.FSharp.Charting
  val verifyMac : unit -> bool
  val isMac : bool
  module FsiAutoShow = begin
  end

> open FSharp.Charting ;;
> (Chart.Line [ for x in 1.0 .. 100.0 -> (x, x ** 2.0) ]).ShowChart();;
Binding session to '/Users/avysk/Projects/_Sandbox/testfsharpcharting/packages/FSharp.Charting.Gtk.0.90.14/lib/net40/OxyPlot.dll'...
Binding session to '/Users/avysk/Projects/_Sandbox/testfsharpcharting/packages/FSharp.Charting.Gtk.0.90.14/lib/net40/OxyPlot.GtkSharp.dll'...
val it : unit = ()

(窗口立即出现。)

于 2017-03-01T09:21:39.510 回答