gpt4 book ai didi

javascript - 在 apexchart 中更改图表的字体大小

转载 作者:行者123 更新时间:2023-12-05 08:38:34 24 4
gpt4 key购买 nike

如何增加使用 apexchart 创建的圆环图的字体大小。

这是图片

chart

<template>
<section>
<v-card raised>
<v-card-title class="blue--text">Requests Overview</v-card-title>
<apexchart width="530" type="donut" :options="options" :series="newSeries" />
</v-card>
</section>
</template>

<script>
import apexchart from "vue-apexcharts";

export default {
components: {
apexchart
},
data() {
return {
series: [],
options: {
height: 180,
width: "100%",
labels: [
"Pending Requests",
"Approved Requests",
"Rescheduled Requests"
],
//colors can be styled using hex code only
colors: ["#54D52A", "#2A54D5", "#D52A54"],
}
};
}
};
</script>

顺便说一句,我没有把所有的代码都放在这里,这只是代码片段。

最佳答案

我不确定图表的女巫部分是否要更改字体大小(数据标签表示图表中的数字,如 35.5% 或图例,表示显示在图像右上角的图表部分的名称,如“待定”请求”等)

顺便说一句,如果你想改变数据标签的字体大小,你可以这样做:

options: {
height: 180,
width: "100%",
dataLabels: {
enabled: true,
style: {
fontSize: "140px",
fontFamily: "Helvetica, Arial, sans-serif",
fontWeight: "bold"
}
},
labels: [
"Pending Requests",
"Approved Requests",
"Rescheduled Requests"
],
//colors can be styled using hex code only
colors: ["#54D52A", "#2A54D5", "#D52A54"],
}

如果您想更改 Legends 的字体大小:

options: {
height: 180,
width: "100%",

legend: {
fontSize: "32px"
},
labels: [
"Pending Requests",
"Approved Requests",
"Rescheduled Requests"
],
//colors can be styled using hex code only
colors: ["#54D52A", "#2A54D5", "#D52A54"]
}

希望对你有帮助;)

关于javascript - 在 apexchart 中更改图表的字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62441825/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com