我在Apexcharts的雷达图上遇到了一些问题。我像在文档apexcharts.js中一样定义了我的图表-基本雷达图表,在那里显示了x轴标签,而在我的版本中没有显示。有人知道我该怎么处理吗?这是我的代码:
var options = {
series: [{
name: 'Rating',
data: [4.2, 4.8, 3.1, 3.8, 3.5, 2.9],
}],
chart: { toolbar: {
show: false
},
height: 350,
type: 'radar',
},
colors: ['#00b0db'],
xaxis: {
categories: ['Meals', 'Location', 'Price', 'Features', 'Ambiance', 'Service']
},
dataLabels: {
enabled: true,
background: {
enabled: true,
borderRadius:2,
}
},
};
var chart = new ApexCharts(document.querySelector("#radar-chart-categories"), options);
chart.render();
不幸的是,我的雷达图截图没有显示x轴标签
我用你的数据创建了一个代码笔,看起来很有效:
https://codepen.io/welante/pen/dyWqMZK
window.Apex = {
tooltip: {
theme: "dark",
x: {
formatter: function (val) {
return val;
}
}
}
};
var options = {
series: [{
name: 'Rating',
data: [4.2, 4.8, 3.1, 3.8, 3.5, 2.9],
}],
chart: { toolbar: {
show: false
},
height: 350,
type: 'radar',
},
colors: ['#00b0db'],
xaxis: {
categories: ['Meals', 'Location', 'Price', 'Features', 'Ambiance', 'Service']
},
dataLabels: {
enabled: true,
background: {
enabled: true,
borderRadius:2,
}
},
};
var chart = new ApexCharts(document.querySelector("#radar-chart-categories"), options);
chart.render();