15

I've a page that contain chart and map menu for report function. Then, I choose Highchart-Highmap library to reach the purpose above. The chart function runs well but when I develop map function there's a error appear

TypeError: ma is not a function

  • I've traced the problem that the ma function is appear in highchart.js and highmaps.js but I don't know how to resolve this conflict.
  • I've try put jQuery.noConflict(); in highmaps but the conflict still appear

This how I code in main page

... some html code
<script type="text/javascript" src="././js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="././js/highcharts/highcharts-more.js"></script>
<script type="text/javascript" src="././js/highcharts/highcharts-3d.js"></script>            
<script type="text/javascript" src="././js/highcharts/modules/drilldown.js"></script>
<script type="text/javascript" src="././js/highcharts/modules/exporting.js"></script>

... some html code
<script type="text/javascript" src="././js/Highmaps/highmaps.js"></script>
<script type="text/javascript" src="././js/Highmaps/modules/data.js"></script>                
<script type="text/javascript" src="././js/Highmaps/modules/exporting.js"></script> 

How I can resolve this problem?

m hanif f
  • 406
  • 1
  • 7
  • 20

3 Answers3

42

Instead of highmaps, you need to use map.js module.

<script src="//code.highcharts.com/maps/modules/map.js"></script>

Here is the documentation on using both together.

Cybersupernova
  • 1,833
  • 1
  • 20
  • 37
Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75
  • I have done it in the same way. But Still getting error of missing some type of chart. Below is the jsFiddle link. Please help me out. http://jsfiddle.net/spidiweb/ad7spa3m/ Thanks, – Aman Jain Nov 14 '16 at 09:43
  • 1
    Got the solution. I have to include highcharts-more.js for bubble chart. http://jsfiddle.net/spidiweb/ad7spa3m/1/ – Aman Jain Nov 14 '16 at 10:11
  • Thanks! Saved my day! – CelinHC Feb 18 '18 at 12:03
5

You must include this script tag after highcharts.js:

<script src="https://code.highcharts.com/maps/modules/map.js"></script> 
Vael Victus
  • 3,966
  • 7
  • 34
  • 55
RicardO
  • 1,219
  • 1
  • 14
  • 24
1

I encountered the same issue, and resolved it by placing highcharts after the maps

<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/maps/modules/exporting.js"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>

http://jsfiddle.net/danny_shumer/tc898kgv/2/

Danny Shumer
  • 111
  • 1
  • 2