0

I am using this demo to place my Map on a webpage: http://www.highcharts.com/maps/demo/geojson

My map is correctly loading but when I'm trying to enable the dataLabels I got this console error:

Uncaught TypeError: Cannot read property 'MPIO_CCDGO' of undefined

 dataLabels: {
                    enabled: true,
                    format: '{point.properties.MPIO_CCDGO}'
                }

This is my json file : https://jsfiddle.net/seph1603/sp6d2p3k/

Seph1603
  • 99
  • 11
  • 2
    Can you share a fiddle that shows the issue happening, please? – Roco CTZ May 25 '15 at 03:33
  • I would try `point.options.properties.MPIO_CCDGO`. Anyway, **working** jsfiddle would be better (than some JSON only). – Paweł Fus May 25 '15 at 09:17
  • Also, make sure you are using proper `joinBy` option, like `joinBy: ['OBJECTID', 'code'],` or whatever you have in your data to connect map and the data. For example: http://jsfiddle.net/sp6d2p3k/6/ – Paweł Fus May 25 '15 at 09:42
  • Hi, this is the working jsfiddle http://jsfiddle.net/seph1603/reo0kxk8/23/ . On windows it is working now :), I think it was because Xampp on Mac has some folders restrictions. http://stackoverflow.com/questions/9046977/xampp-permissions-on-mac-os-x – Seph1603 May 25 '15 at 20:21
  • Now, on the JSFiddle from Highmaps when you move the mouse over the geometry, the legend shows the name of the city. How can I add that function. – Seph1603 May 25 '15 at 20:39
  • 1
    To show the name of the city in a tooltip, see this JSFiddle: http://jsfiddle.net/reo0kxk8/25/ You have to use the `tooltip` property – Roco CTZ May 25 '15 at 22:39

1 Answers1

0

Working JSFiddle http://jsfiddle.net/reo0kxk8/25/

 series : [{
                data : data,
                mapData: geojson,
                joinBy: ['DPTOC_MPIO', 'code'],
                name: 'Random data',
                states: {
                    hover: {
                        color: '#BADA55'
                    }
                },
                dataLabels: {
                    enabled: true,
                    format: '{point.properties.MPIO_CNMBR}'
                }
            }]
Seph1603
  • 99
  • 11