highcharts / highcharts-vue

Other
686 stars 150 forks source link

Update map series generate error #89

Closed Eclixal closed 5 years ago

Eclixal commented 5 years ago

I want to update the data on a map with this code :

mapOptions.series[0].data = '[["FR", 22], ["US", 554]]';

mapOptions: {
                    chart: {
                        map: 'myMapName',
                        backgroundColor: '#26374C'
                    },
                    title: {
                        text: ''
                    },
                    mapNavigation: {
                        enabled: true,
                        enableButtons: false
                    },

                    legend:{enabled: false},
                    credits:{enabled:false},
                    exporting:{enabled: false},
                    colorAxis: {
                        min: 0,
                        minColor: 'rgba(0,121,234,0.1)',
                        maxColor: 'rgba(0,121,234,0.9)'
                    },
                    series: [{
                        name: 'Répartition des joueurs',
                        nullColor: '#324967',
                        borderColor: '#2d3d5a',
                        states: {
                            hover: {
                                color: '#0079EA'
                            }
                        },
                        allAreas: true,
                        data: null
                    }]
                }

But I have the following error :

image

Denyllon commented 5 years ago

Hi @Eclixal

Thank you for reporting the issue. I'll take a look on that today, and after that get back with response. Meanwhile, could you provide me with some live example where the problem is noticeable? It should speed up finding potential source of the problem.

Kind regards!

Eclixal commented 5 years ago

I use axios to get all my data and on success I just

mapOptions.series[0].data = '[["FR", 22], ["US", 554]]';

But he doesn't work

Denyllon commented 5 years ago

If you assigning it exactly like above, the problem is that the data is String instead of Array. Could you verify it?

Eclixal commented 5 years ago

Oh yes, I'm stupid ... Its work now