简体   繁体   English

XPlot.GoogleCharts.Chart.Map为什么不产生工具提示?

[英]Why isn't XPlot.GoogleCharts.Chart.Map producing tooltips?

I'm trying to plot locations on a map with XPlot and googlecharts.chart.map. 我正在尝试使用XPlot和googlecharts.chart.map在地图上绘制位置。

I followed the example I found, but the resulting map had no tool tips on the specified locations. 我按照找到的示例进行操作,但是生成的地图在指定位置没有工具提示。

To debug my code I simply attempted to reproduce the example, with the same result, ie no markers at the specified locations. 为了调试我的代码,我只是尝试以相同的结果重现该示例,即在指定位置没有标记。

My implementation of the example ( https://fslab.org/XPlot/chart/google-map-chart.html ) is below: 我对示例的实现( 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

The map is shown without any markers. 显示的地图没有任何标记。

How should the code be modified to ensure the locations are marked? 如何修改代码以确保标记位置?

The missing tooltips problem source is not in your code, but in the ambient environment. 缺少的工具提示问题源不在您的代码中,而是在周围环境中。

If you use your F# console charting app code without any changes, but bind it with nuget package XPlot.GoogleCharts ver 1.4.2 instead of the latest at the moment XPlot.GoogleCharts ver 1.5.0 , it will work as expected, ie tooltips will be present even on the html static page viewed in the browser. 如果您使用F#控制台制图应用程序代码而未做任何更改,但将其绑定到nuget包XPlot.GoogleCharts版本1.4.2,而不是当前的XPlot.GoogleCharts版本1.5.0 ,则它将按预期运行,即工具提示将存在甚至在浏览器中查看HTML静态页面上。

The regression, I believe, has nothing to do with XPlot.GoogleCharts per se and is likely caused by the change to the way of loading JS libraries introduced by Google : XPlot.GoogleCharts ver 1.4.2 uses the old loader , while the latest XPlot.GoogleCharts ver 1.5.0 uses the new one . 我认为回归与XPlot.GoogleCharts本身无关,很可能是由Google引入的加载JS库的方式发生了变化XPlot.GoogleCharts ver 1.4.2使用旧的loader ,而最新的XPlot.GoogleCharts ver 1.5.0使用了新版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM