1

我正在尝试使用 XPlot 和 googlecharts.chart.map 在地图上绘制位置。

我按照我找到的示例进行操作,但生成的地图在指定位置没有工具提示。

为了调试我的代码,我只是尝试重现该示例,结果相同,即在指定位置没有标记。

我的示例实现(https://fslab.org/XPlot/chart/google-map-chart.html)如下:

let data =
        [
            "China", "China: 1,363,800,000"
            "India", "India: 1,242,620,000"
            "US", "US: 317,842,000"
            "Indonesia", "Indonesia: 247,424,598"
            "Brazil", "Brazil: 201,032,714"
            "Pakistan", "Pakistan: 186,134,000"
            "Nigeria", "Nigeria: 173,615,000"
            "Bangladesh", "Bangladesh: 152,518,015"
            "Russia", "Russia: 146,019,512"
            "Japan", "Japan: 127,120,000"
        ]


let options = XPlot.GoogleCharts.Configuration.Options(showTip = true)

let chart =  data 
             |> XPlot.GoogleCharts.Chart.Map
             |> XPlot.GoogleCharts.Chart.WithOptions options
             |> XPlot.GoogleCharts.Chart.WithHeight 420
             |> XPlot.GoogleCharts.Chart.WithWidth 800

chart |> XPlot.GoogleCharts.Chart.Show

地图显示没有任何标记。

应如何修改代码以确保标记位置?

4

1 回答 1

0

缺少工具提示的问题源不在您的代码中,而是在环境环境中。

如果您使用 F# 控制台图表应用程序代码而不进行任何更改,但将其与 nuget 包XPlot.GoogleCharts ver 1.4.2而不是当前最新的XPlot.GoogleCharts ver 1.5.0 绑定,它将按预期工作,即工具提示将甚至出现在浏览器中查看的 html 静态页面上。

XPlot.GoogleCharts回归,我认为与本身无关,可能是由于谷歌引入的加载 JS 库的方式发生了变化XPlot.GoogleCharts ver 1.4.2使用旧的加载器,而最新XPlot.GoogleCharts ver 1.5.0的使用的加载器。

于 2018-08-16T21:34:46.817 回答