PHP - Trato de mostrar el mapa mediante highcharts y no me carga

 
Vista:
sin imagen de perfil
Val: 135
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

Trato de mostrar el mapa mediante highcharts y no me carga

Publicado por Rey (74 intervenciones) el 04/09/2020 05:12:22
me sale este error en :
mapa.php:61 Uncaught ReferenceError: Highcharts is not defined
at mapa.php:61

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<html lang="es">
<head>
 
    <style>
    #mapa-container {
        height: 800px;
        max-width: 100%;
        margin: 0 auto;
    }
    .loading {
        margin-top: 10em;
        text-align: center;
        color: gray;
    }
 </style>
 
    <script type="text/javascript">
 
    // Prepare demo data
    // Data is joined to map using value of 'hc-key' property by default.
    // See API docs for 'joinBy' for more info on linking data and map.
    var data = [
      ['co-sa', 0],
      ['co-ca', 1],
      ['co-na', 2],
      ['co-ch', 3],
      ['co-3653', 4],
      ['co-to', 5],
      ['co-cq', 6],
      ['co-hu', 7],
      ['co-pu', 8],
      ['co-am', 9],
      ['co-bl', 10],
      ['co-vc', 11],
      ['co-su', 12],
      ['co-at', 13],
      ['co-ce', 14],
      ['co-lg', 15],
      ['co-ma', 16],
      ['co-ar', 17],
      ['co-ns', 18],
      ['co-cs', 19],
      ['co-gv', 20],
      ['co-me', 21],
      ['co-vp', 22],
      ['co-vd', 23],
      ['co-an', 24],
      ['co-co', 25],
      ['co-by', 26],
      ['co-st', 27],
      ['co-cl', 28],
      ['co-cu', 29],
      ['co-1136', 30],
      ['co-ri', 31],
      ['co-qd', 32],
      ['co-gn', 33]
    ];
 
 
    // Create the chart
    Highcharts.mapChart('#mapa-container', {
      chart: {
          map: 'countries/co/co-all'
      },
 
      title: {
          text: 'Reportes de Mapa'
      },
 
      subtitle: {
          text: 'Un descripción de reportes'
      },
 
      mapNavigation: {
          enabled: true,
          buttonOptions: {
              verticalAlign: 'top'
          }
      },
 
      colorAxis: {
          min: 0
      },
 
      series: [{
          data: data,
          name: 'Población',
          states: {
              hover: {
                  color: '#BADA55'
              }
          },
          dataLabels: {
              enabled: true,
              format: '{point.name}'
          }
      }]
    });
 
    </script>
    </head>
<body>
 
 
 <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/countries/co/co-all.js"></script>
 
 
    <div id="mapa-container" style="min-width: 310px; height: 400px; max-width: 600px; margin:0 auto"></div>
       </body>
        </html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Luis
Val: 128
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

Trato de mostrar el mapa mediante highcharts y no me carga

Publicado por Luis (31 intervenciones) el 05/09/2020 10:18:48
Hola, ejecutas la función antes de crear el div, pon el script al final justo antes de la etiqueta que cierra el body.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar