im trying to create a chart for my vue.js site using Apexcharts however my chart isnt appearing at all.
-Apexcharts documentation Here
HTML
<div class="section sec2">
<div id="chart"></div>
{{chart}} <--failed attempt
</div>
...
JavaScript
<script>
import ApexCharts from 'apexcharts'
export default {
// name: 'HelloWorld',
props: {//////////this is how i use global variable with vue.js///////////////
width:{ type: String, default: function(){return('width:')}},
}
}
var options = {
chart: {
type: 'bar'
},
series: [{
name: 'sales',
data: [30,40,45,50,49,60,70,91,125]
}],
xaxis: {
categories: [1991,1992,1993,1994,1995,1996,1997, 1998,1999]
}
}
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
</script>
CSS
<style>
@import '../assets/style/sec.css';
#chart {
max-width: 650px;
margin: 35px auto;
}
</style>
i tried using the vue.js global variable by turning "var option = ..." into "option:...", but it only gave me an error.
im pretty sure its supossed to show in the div with the "#chart" id
any helpand or advice is greatly appreciated, thank you.