3 javascript vue.js vuejs2 apexcharts
如何增加使用 apexchart 创建的圆环图的字体大小。
这是图像
<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>
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我没有将所有代码放在这里,这只是片段。
Ali*_*ini 14
我不确定图表的哪个部分您想要更改字体大小(数据标签表示图表中的数字,如 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"],
}
Run Code Online (Sandbox Code Playgroud)
如果你想改变图例的字体大小:
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"]
}
Run Code Online (Sandbox Code Playgroud)
希望它对你有帮助;)
| 归档时间: |
|
| 查看次数: |
16438 次 |
| 最近记录: |