Having some trouble with integrating billboard.js
into my Vue project as an alternative to using d3.js
. Struggling to get it working in both my repository and a vanilla Vue project.
Anyone familiar with the process of getting billboard.js
running smoothly in combination with Vue?
Snippet from My App.vue:
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<div id="chart">
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { bb } from 'billboard.js';
@Component
export default class App extends Vue {
mounted() {
console.log(this);
console.log(bb);
bb.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 170, 150, 250],
],
types: {
data1: 'line',
data2: 'area-spline',
},
colors: {
data1: 'red',
data2: 'green',
},
},
});
}
}
</script>
Error message received from devtools:
vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "TypeError: $$.generatePoint is not a function"
found in
---> <App> at src/App.vue
<Root>
Using the following npm package versions for this project:
"dependencies": {
"billboard.js": "^2.0.3",
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
"vue-property-decorator": "^8.4.2"
},
Created a GitHub repository with minimal code to replicate the issue.