Closed j1nhu closed 6 years ago
Components like 'note' or 'legends' can only be added within the 'graph-xxx' component. This is because it is a widget that assists the chart.
I have the following component (slightly modified from codepen)
<template>
<graph-stackbar
:width="600"
:height="400"
:fullMode="true"
:axis-reverse="true"
:labels="[ 'Threat 1', 'Threat 2', 'Threat 3', 'Threat 4' ]"
:full-mode="false"
:axis-min="0"
:axis-max="50"
:values="values"
>
<note :text="'StackBar Chart'"></note>
</graph-stackbar>
</template>
<script>
import GraphStackbar from 'vue-graph/src/components/stackbar.js'
import Note from 'vue-graph/src/widgets/note.js'
export default {
components: { GraphStackbar, Note },
data () {
return {
values: [
[ 10, 5, 5, 5 ]
]
}
}
}
</script>
And I am getting this error. Any way to resolve? If the only way this works is to have this attached to <div id="app"></div>
directly this won't work for large scale applications.
@twickstrom I'll check it out as soon as possible.
@j1nhu @twickstrom Issue resolved. Check please...
It looks like the graph box components can only be used directly under the root element. Why is that and is there any workaround other than creating multiple root elements in our app?
Error: [Vue Graph error]: Can only be used as parent nodes.