微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Vue.js 中带圆角的圆环图

如何解决Vue.js 中带圆角的圆环图

我在我的 vue 项目中使用 vue-chartjs,我需要圆角圆环图。圆弧的所有边都必须倒圆。 (对不起,我不能写更多的描述)

我的代码

Home.vue

<template>
  <div class="chart">
    <doughnut-chart></doughnut-chart>
</template>

<script>
import DoughnutChart from '@/components/DoughnutChart'
export default {
    name: "Home",components: {
        DoughnutChart
    }
}

DoughnutChart.vue

<script>
import { Doughnut } from "vue-chartjs";

export default {
    extends: Doughnut,data() {
        return {
            chartData: {
                labels: ["Foydalanuvchilar soni","Uzatilgan xabarlar soni"],datasets: [
                    {
                        borderWidth: 0,backgroundColor: ["rgba(25,188,239,1)","rgba(251,99,89,1)"],hoverBackgroundColor: ["rgba(25,0.8)",0.8)"],data: [25,75],},],options: {
                legend: {
                    display: false,responsive: true,maintainAspectRatio: false,cutoutPercentage: 90,borderAlign: 'inner',animation: {
                        animationRotate: true,duration: 2000
                },tooltips: {
                        enabled: false
                },};
    },mounted() {
        this.renderChart(this.chartData,this.options);
    },};
</script>

this is my chart

and I want to do like this

提前致谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。