Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble showing high-maps and high-charts on same page?

    // Initiate the chart
    $('#container_origin').highcharts('Map', {
		
		
        title : {
            text : 'Heat Map Of Visited Orgins'
        },

        subtitle : {
            text : ''
        },
		

        mapNavigation: {
            enabled: true,
            buttonOptions: {
                verticalAlign: 'bottom'
            }
        },

			colorAxis: {
                min: 1,
                type: 'logarithmic',
                minColor: '#338ACA',
                maxColor: '#1B4761'
            },
			
			

        series : [{
		
		
            data : data,
            mapData: Highcharts.maps['custom/world-highres'],
            joinBy: 'hc-key',
            //name: 'Random data',
            states: {
                hover: {
                    color: Highcharts.getOptions().colors[6]
                }
            },
			
            dataLabels: {
                enabled: true,
                format: '{point.name}'
            },
			tooltip: {
                headerFormat: '',
            }
			
			
			
        }]
    });

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
		<script src="https://code.highcharts.com/highcharts.js"></script>
		<script src="https://code.highcharts.com/highcharts-more.js"></script>
		<script src="https://code.highcharts.com/modules/exporting.js"></script>
		
		<!--Use this for maps/chart combo -->
		<script src="http://code.highcharts.com/maps/modules/map.js"></script>
		
		
		<link rel="stylesheet" type="text/css" href="chart.css">
		<link href='https://fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'>
		<script src="bb.js"></script>

		
	</head>

I'm having trouble rendering highcharts and highmaps on the same page. At first, I was just getting an error but then I swapped.

    <script src="https://code.highcharts.com/maps/highmaps.js"></script>
    <script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
    <script src="https://code.highcharts.com/mapdata/custom/world-highres.js"></script>

With this -

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

I now get the out line of the chart (see img). Can anybody suggest a solution? enter image description here

like image 408
JIMMY THE CODE Avatar asked Nov 22 '25 08:11

JIMMY THE CODE


1 Answers

As you can see from this getting started tutorial / Highmaps documentation for Highmaps to work you need to load, same as in Highcharts and Highstock, a framework - jQuery or Standalone Highcharts Framework and:

1) highmaps.js

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

or, if you have a license for Highcharts and Highmaps, 2) highcharts.js + maps.js module

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

Working example: http://jsfiddle.net/pe40p00y/14/

like image 149
Kacper Madej Avatar answered Nov 24 '25 11:11

Kacper Madej



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!