adding the dependance

This commit is contained in:
2024-03-30 13:10:11 +01:00
parent c1b2742a8f
commit 91ee3adbcd
4 changed files with 51 additions and 2 deletions

View File

@ -1,5 +1,33 @@
<script setup>
import CanvasJSChart from "@canvasjs/vue-charts";
const chartData ={
options: {
theme: "light2",
animationEnabled: true,
title:{
text: "Visitors By Channel"
},
data: [{
type: "pie",
indexLabel: "{label} (#percent%)",
yValueFormatString: "#,##0",
toolTipContent: "<span style='\"'color: {color};'\"'>{label}</span> {y}(#percent%)",
dataPoints: [
{ label: "Organic Traffic", y: 130631 },
{ label: "Direct", y: 28874 },
{ label: "Referral", y: 15467 },
{ label: "Social", y: 10543 },
{ label: "Email", y: 5613 },
{ label: "Others", y: 8492 }
]
}]
},
styleOptions: {
width: "100%",
height: "360px"
}
}
</script>
@ -52,8 +80,10 @@
<option value="months">Months</option>
<option value="topics">Topics</option>
</select>
</div>
<div id="statsPie">
<CanvasJSChart :data="chartData"/>
</div>

View File

@ -4,5 +4,8 @@ import 'https://kit.fontawesome.com/fb3bbd0a95.js'
import { createApp } from 'vue'
import App from './App.vue'
import CanvasJSChart from '@canvasjs/vue-charts';
createApp(App).mount('#app')
const app = createApp(App);
app.use(CanvasJSChart);
app.mount('#app');