我用APEXCHARTS制作了DONUT图表。看起来像这样:
这是我的代码:
var options = {
series: [44, 55, 41, 17, 15],
labels: ['Apple', 'Mango', 'Orange', 'Watermelon', 'test'],
chart: {
type: 'donut',
foreColor: '#ffffff'
},
grid: {
borderColor: "#EF3252"
},
plotOptions: {
pie: {
expandOnClick: false
}
},
responsive: [{
breakpoint: 480,
options: {
chart: {
width: '100%'
},
legend: {
position: 'bottom'
}
}
}],
datasets: [{
borderColor: ["#EF3252"]
}]
};
var chart = new ApexCharts(document.getElementById("stats1_chart1"), options);
chart.render();
<div id="stats1_chart1"></div>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
我想实现更改边框颜色。但我不知道这应该如何工作。
〜马库斯
答案 0 :(得分:4)
只需添加stroke属性:
var options = {
series: [44, 55, 41, 17, 15],
labels: ['Apple', 'Mango', 'Orange', 'Watermelon', 'test'],
chart: {
type: 'donut',
foreColor: '#ffffff'
},
grid: {
borderColor: "#EF3252"
},
plotOptions: {
pie: {
expandOnClick: false
}
},
stroke:{
colors:['#000']
},
responsive: [{
breakpoint: 480,
options: {
chart: {
width: '100%'
},
legend: {
position: 'bottom'
}
}
}],
datasets: [{
borderColor: ["#EF3252"]
}]
};
var chart = new ApexCharts(document.getElementById("stats1_chart1"), options);
chart.render();
<div id="stats1_chart1"></div>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
答案 1 :(得分:0)
要完全消除中风,请执行以下操作;
stroke: {
show: false,
width:0
},