我正在尝试使用F#Charting:用于数据可视化的库 https://fslab.org/FSharp.Charting/
我遇到了基本的麻烦 我在GitHub上发布了我的问题,但我在这里交叉发布 https://github.com/fslaborg/FSharp.Charting/issues/126
我在最近的iMAC上在MacOS Sierra上运行Xamarin 6.3
我已加载FSharp.Charting.Gtk(0.90.14)
我需要使用BTW open FSharp.Charting
还是open FSharp.Charting.Gtk
?
Chart.Line
,那么我得到消息
System.Exception:由于之前的原因,操作无法完成 error命名空间或模块“Chart”未定义为3,0
1)编译后执行时出现问题
open System
open FSharp.Charting
let ch = Chart.Line [ for x in 0 .. 10 -> x, x*x ]
ch.ShowChart()
[<EntryPoint>]
let main args =
printfn "Arguments passed to function : %A" args
printfn "hello world"
0
这就是我得到的
错误日志的开头看起来像
上次登录:4月20日星期四00:55:57 ttys000 59x159x64x204:〜... $ clear; cd“/Users /.../bin/Debug”; export PKG_CONFIG_PATH =“/ Applications / Xamarin Studio.app/Contents/Resources/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/4.8.1/lib/pkgconfig”; export PKG_CONFIG_LIBDIR =“”; export PATH =“/ Library / Frameworks / Mono.framework / Commands:/ Applications / Xamarin Studio.app/Contents/Resources:/Applications/Xamarin Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/ sbin目录:/ sbin目录“; export MONO_GAC_PREFIX =“/ Applications / Xamarin Studio.app/Contents/Resources”; export XBUILD_FRAMEWORK_FOLDERS_PATH =“”; “/ Library/Frameworks/Mono.framework/Versions/4.8.1/bin/mono32”--debug“/Users/.../bin/Debug/The42project.exe”;回声$? &GT; /var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmp1493d63.tmp;回声;读-p'按任意键继续......' - n1;出口
(进程:14805):GLib-GObject-WARNING **:无效(NULL)指针实例
(进程:14805):GLib-GObject-CRITICAL **:gulong g_signal_connect_data(gpointer,const gchar *,GCallback,gpointer,GClosureNotify,GConnectFlags):断言`G_TYPE_CHECK_INSTANCE(instance)'失败
(进程:14805):Gtk-WARNING **:未设置GtkWindow的屏幕;你必须经常设置 使用窗口之前的GtkWindow屏幕
(进程:14805):Gdk-CRITICAL **:GdkColormap * gdk_screen_get_default_colormap(GdkScreen *):断言`GDK_IS_SCREEN(屏幕)'失败
这里有完整的错误消息 https://gist.github.com/FaguiCurtain/a70fb8d894199f0a65de3a9006fb4758
2)在FSI中执行时出现问题
[Loading /Users/.../packages/FSharp.Charting.Gtk.0.90.14/FSharp.Charting.Gtk.fsx]
namespace FSI_0001.FSharp.Charting
val verifyMac : unit -> bool
val isMac : bool
module FsiAutoShow = begin
end
The search directory '/usr/lib/mono/gtk-sharp-2.0' could not be found at 28,0
The search directory '/usr/lib/mono/gtk-sharp-2.0' could not be found at 28,0
open FSharp.Charting;;
Chart.Line [ for x in 0 .. 10 -> x, x*x ];;
Binding session to '/Users/.../packages/FSharp.Charting.Gtk.0.90.14/lib/net40/OxyPlot.dll'...
Binding session to '/Users/.../packages/FSharp.Charting.Gtk.0.90.14/lib/net40/OxyPlot.GtkSharp.dll'...
val it : ChartTypes.GenericChart = (Chart)
在FSI中,图表窗口立即打开,但图表实际显示需要20-30秒。
它需要这么长时间才正常吗?
当我将鼠标悬停在图表上时,我看不到坐标,这是正常的吗?
我无法关闭此窗口。正如您在屏幕截图中看到的那样,图表窗口左上方的3个按钮未激活。我找不到让这个窗口消失的方法。这是正常的吗?
感谢
3)在FSI中,如果我输入以Chart.
开头的命令,我只会得到几个选项,远远少于库中的选项。
不出所料,如果我使用Combine
键入,而智能感知不会出现
Chart.Combine [ Chart.Line(msft?Difference |> Series.observations)
Chart.Line(fb?Difference |> Series.observations) ]
System.Exception:由于之前的原因,操作无法完成 错误未定义字段,构造函数或成员“组合” 2,6