在 Ng Apex Chart(Angular) 中格式化 x 轴标签时,x 轴标签重复
When formatting x-axis labels in Ng Apex Chart(Angular), x-axis labels are duplicated
我正在使用 Ng Apex 图表。
在 X 轴标签 中,showDuplicates 属性 设置为 false,因为我不想要重复的 x 轴标签。
我的 x 轴数据值为 0.4, 0.7, 1.2, 1.3, 2, 2.4
I'm using xaxis > labels > formatter
function to show only integer values, no matter what data value it is and this is working fine, but the problem is the labels are shown duplicated like this: 0,0,1,1,2,2.
The result I want to be is: 0, 1, 2 in x-axis labels.
有什么解决办法吗?
谢谢。
如果您不需要分数,请将 tickAmount 设置为较小的数字。
例如,如果您的 x 值介于 0 到 3 之间,请设置
xaxis: {
tickAmount: 3
}
我正在使用 Ng Apex 图表。
在 X 轴标签 中,showDuplicates 属性 设置为 false,因为我不想要重复的 x 轴标签。
我的 x 轴数据值为 0.4, 0.7, 1.2, 1.3, 2, 2.4
I'm using
xaxis > labels > formatter
function to show only integer values, no matter what data value it is and this is working fine, but the problem is the labels are shown duplicated like this: 0,0,1,1,2,2.The result I want to be is: 0, 1, 2 in x-axis labels.
有什么解决办法吗?
谢谢。
如果您不需要分数,请将 tickAmount 设置为较小的数字。
例如,如果您的 x 值介于 0 到 3 之间,请设置
xaxis: {
tickAmount: 3
}