2015-06-01 74 views
0

我試圖將2個Json文件加載到Highmaps插件中。將Json文件加載到Highmaps

  • 的firts一個是地圖信息(幾何)
  • 第二個要被顯示

數據的第二JSON文件結構爲:

[{"code":"034","value":1},{"code":"036","value":1},{"code":"042","value":43},{"code":"045","value":18},{"code":"088","value":33},{"code":"120","value":3},{"code":"148","value":1},{"code":"154","value":3},{"code":"212","value":6},{"code":"250","value":1},{"code":"266","value":11},{"code":"308","value":4},{"code":"347","value":2},{"code":"360","value":6},{"code":"390","value":4},{"code":"001","value":147},{"code":"490","value":6},{"code":"579","value":1},{"code":"649","value":1},{"code":"736","value":1},{"code":"792","value":6},{"code":"837","value":10},{"code":"858","value":1},{"code":"890","value":4},{"code":"895","value":2}] 

這是JSFIDDLE:

http://jsfiddle.net/reo0kxk8/28/

Highmaps不顯示數據。

回答

0

您正在使用哪種瀏覽器?它顯示在Chrome有一些錯誤。

對於火狐,它需要時間來顯示。

我認爲錯誤是不能訪問json數據,所以先從本地目錄進行測試。 format: '{point.properties.MPIO_CNMBR}'。該代碼無法獲得MPIO_CNMBR的值。

您錯過了文件Highmaps Library。

添加下面的一個

<script src="http://code.highcharts.com/maps/modules/data.js"></script>