A Pen by Zhenye Wei on CodePen.
Created
June 2, 2019 19:37
-
-
Save derka6391/e751e5ef4bd9792ec935f2e5047752a9 to your computer and use it in GitHub Desktop.
vue-highcharts demo - Use Highmaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/highcharts@6/highmaps.js"></script> | |
<script src="https://code.highcharts.com/mapdata/custom/europe.js"></script> | |
<!-- vue-highcharts should be load after Highmaps --> | |
<script src="https://cdn.jsdelivr.net/npm/vue-highcharts/dist/vue-highcharts.min.js"></script> | |
<div id="app"> | |
<highmaps :options="options"></highmaps> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
chart: { | |
borderWidth: 1 | |
}, | |
title: { | |
text: 'Nordic countries' | |
}, | |
subtitle: { | |
text: 'Demo of drawing all areas in the map, only highlighting partial data' | |
}, | |
legend: { | |
enabled: false | |
}, | |
series: [{ | |
name: 'Country', | |
mapData: Highcharts.maps['custom/europe'], | |
data: [ | |
['is', 1], | |
['no', 1], | |
['se', 1], | |
['dk', 1], | |
['fi', 1] | |
], | |
dataLabels: { | |
enabled: true, | |
color: '#FFFFFF', | |
formatter: function () { | |
if (this.point.value) { | |
return this.point.name; | |
} | |
} | |
}, | |
tooltip: { | |
headerFormat: '', | |
pointFormat: '{point.name}' | |
} | |
}] | |
}; | |
var vm = new Vue({ | |
el: '#app', | |
data: { | |
options: options | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment