出现高映射'未捕获的类型错误:undefined不是函数'并且不加载
Highmaps occuring 'Uncaught TypeError: undefined is not a function ' and not loading?
我正在尝试将Highmaps与Highchart一起使用。Highchart可以很好地工作,但Highmaps不适用于Highmaps。
高图未加载高图图形。并且在控制台上出现"Uncaught TypeError:undefined不是函数"错误。我认为它的javascript冲突错误。但是我该怎么解决呢?
代码:
<script src="http://code.highcharts.com/maps/highmaps.js"></script>
<script src="http://code.highcharts.com/maps/modules/data.js"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
<div id="container" style="height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto"></div>
<script>
$(function () {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function (data) {
var mapData = Highcharts.geojson(Highcharts.maps['custom/world']);
// Correct UK to GB in data
$.each(data, function () {
if (this.code === 'UK') {
this.code = 'GB';
}
});
$('#container').highcharts('Map', {
chart : {
borderWidth : 1
},
title: {
text: 'World population 2010 by country'
},
subtitle : {
text : 'Demo of Highcharts map with bubbles'
},
legend: {
enabled: false
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
series : [{
name: 'Countries',
mapData: mapData,
color: '#E0E0E0',
enableMouseTracking: false
}, {
type: 'mapbubble',
mapData: mapData,
name: 'Population 2010',
joinBy: ['iso-a2', 'code'],
data: data,
minSize: 4,
maxSize: '12%',
tooltip: {
pointFormat: '{point.code}: {point.z} thousands'
}
}]
});
});
});
</script>
谢谢你的帮助。
您需要在其他highmaps插件之前添加jquery.min.js
$(function () {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function (data) {
var mapData = Highcharts.geojson(Highcharts.maps['custom/world']);
// Correct UK to GB in data
$.each(data, function () {
if (this.code === 'UK') {
this.code = 'GB';
}
});
$('#container').highcharts('Map', {
chart : {
borderWidth : 1
},
title: {
text: 'World population 2010 by country'
},
subtitle : {
text : 'Demo of Highcharts map with bubbles'
},
legend: {
enabled: false
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
series : [{
name: 'Countries',
mapData: mapData,
color: '#E0E0E0',
enableMouseTracking: false
}, {
type: 'mapbubble',
mapData: mapData,
name: 'Population 2010',
joinBy: ['iso-a2', 'code'],
data: data,
minSize: 4,
maxSize: '12%',
tooltip: {
pointFormat: '{point.code}: {point.z} thousands'
}
}]
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://code.highcharts.com/maps/highmaps.js"></script>
<script src="http://code.highcharts.com/maps/modules/data.js"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
<div id="container" style="height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto"></div>
相关文章:
- 为什么会出现错误;未捕获的类型错误:undefined不是函数;
- /undefined在我的404错误日志中多次出现
- 为什么会出现错误,“UncaughtTypeError:undefined不是函数”
- 未捕获的类型错误:undefined不是函数$
- Bootstrap-“;未捕获的类型错误:undefined不是函数;
- 尝试使用.ninnerHTMLlog打印数据,获取错误Uncaught TypeError:undefined不是函数
- 得到“;undefined不是函数“;错误
- NodeJS:zlib.gunzip(body)错误地返回“undefined”
- 将服务中的函数绑定到$scope(错误:无法设置undefined的属性'onChange')
- 未捕获的类型错误:undefined不是函数
- HTML5拖拽&drop正在抛出undefined不是函数错误
- 我得到了这个错误,但是不要;我不知道如何修复它,www.example.com/undefined?1460018627
- d3.js voronoi.clipExtent()返回错误:undefined不是函数
- 将 jQuery 脚本加载更改为异步后出现“$ is undefined”错误
- 从另一个调用原型方法-得到'undefined'错误
- 使用RegisterClientScriptBlock在页面末尾注册一个脚本,以避免sys undefined错误
- CSS with JavaScript -无法读取属性'undefined'错误
- 什么会导致'消息:'console'undefined"错误突然出现
- 插入对象时myStorage是undefined错误
- jQuery alert 'undefined'错误而不是Java/Spring异常详细信息