1.0.6 • Published 7 months ago
@jing-shi/pie-chart-component v1.0.6
Pie Chart Component
A Vue 3 pie chart component based on ECharts.
Installation
npm install @jing-shi/pie-chart-componentUsage
Global Registration
import { createApp } from 'vue'
// main.ts
import PieChartComponent from '@jing-shi/pie-chart-component'
import '@jing-shi/pie-chart-component/style.css'
const app = createApp(App)
app.use(PieChartComponent)Local Registration
<template>
<pie-chart :data="chartData" :title="'My Chart'" />
</template>
<script setup>
import { PieChart } from 'pie-chart-component'
import 'pie-chart-component/dist/style.css'
const chartData = [
{
countResults: [
{
algorithmName: "Category 1",
countNumber: 100
},
{
algorithmName: "Category 2",
countNumber: 200
}
],
dateType: "day"
}
// ... more data
]
</script>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| data | Array | [] | Chart data array |
| title | String | '' | Chart title |
| colorList | Array | default colors | Custom color list for chart |
License
MIT