You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there I am trying to fetch the data from the mysql database through php . I have got the values in JSON format but not able to show it in the Vector Map.
Here is my Script :
`<script type="text/javascript">
var dataC = '';
dataC = JSON.parse(dataC) ;
var countryData = {};
$.each(dataC, function() {
countryData[this.CountryCode] = this.persons;
});
$(function() {
$('#world-map').vectorMap({
map: 'world_mill_en',
series: {
regions: [{
values: countryData, //load the data
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial'}]
},
//-----------------------------------------------
// changed to onRegionLabelShow from onLabelShow
//-----------------------------------------------
onRegionLabelShow: function(e, el, code) {
//search through dataC to find the selected country by it's code
var country =$.grep(dataC, function(obj, index) {
return obj.CountryCode == code;
})[0]; //snag the first one
//only if selected country was found in dataC
if (country != undefined) {
el.html(el.html() +
" Code: " +country.CountryCode +
" Name: " + country.Country +
" persons: " + country.persons);}}
});
});
</script>`
The Code is Showing the Error :
Uncaught ReferenceError: jvm is not defined
at w.fn.init.a.fn.vectorMap
The text was updated successfully, but these errors were encountered:
jvectormap/jquery-jvectormap.js (add .vectorMap as a JQuery plugin $.fn.vectorMap and registers 'addMap' or 'set' callbacks, for a later world map registration/update: e.g 'world_mill'), useful on Ajax requests when map data is loaded after.
jvectormap-maps/jquery-jvectormap-world-mill.js
If using bower (bower.json), these were the packages:
"jvectormap": "2.0.5",
"jvectormap-maps": "*"
Best, using jquery.jvectormap.min.js file from distribution.
Or, run locally: 'build.sh', from downloaded .zip file.
See: build.sh
Hi there I am trying to fetch the data from the mysql database through php . I have got the values in JSON format but not able to show it in the Vector Map.
Here is my Script :
`<script type="text/javascript">
var dataC = '';
dataC = JSON.parse(dataC) ;
var countryData = {};
$.each(dataC, function() {
countryData[this.CountryCode] = this.persons;
});
$(function() {
$('#world-map').vectorMap({
map: 'world_mill_en',
series: {
regions: [{
values: countryData, //load the data
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial'}]
},
//-----------------------------------------------
// changed to onRegionLabelShow from onLabelShow
//-----------------------------------------------
onRegionLabelShow: function(e, el, code) {
//search through dataC to find the selected country by it's code
var country =$.grep(dataC, function(obj, index) {
return obj.CountryCode == code;
})[0]; //snag the first one
//only if selected country was found in dataC
if (country != undefined) {
el.html(el.html() +
"
Code: " +country.CountryCode +
"
Name: " + country.Country +
"
persons: " + country.persons);}}
});
});
</script>`
The Code is Showing the Error :
Uncaught ReferenceError: jvm is not defined
at w.fn.init.a.fn.vectorMap
The text was updated successfully, but these errors were encountered: