I'm using bar chart from ApexCharts. The horizontal x axis has counts of items. When the number goes too low like 1, 2, the axis shows intermediate decimal values which doesn't make sense. How to force the axis to display only integer values only with ticks at integer intervals like in second image. Vue template
<apexchart
ref="ratingChart"
width="450"
height="250"
:options="ratingData.options"
:series="ratingData.series"
></apexchart>
Javascript
data: function () {
return {
ratingData: {
options: {
chart: {
id: "item-rating",
type: "bar",
},
title: {
text: "Item by Rating",
align: "center",
margin: 10,
offsetX: 0,
offsetY: 0,
floating: false,
style: {
fontSize: "14px",
fontWeight: "normal",
fontFamily: "Arial",
color: "#595959",
},
},
noData: {
text: "Loading...",
},
xaxis: {
categories: ["Very High", "High", "Medium", "Low", "Eliminated"],
type: "category",
tickPlacement: "on",
labels: {
rotate: 0,
rotateAlways: false,
},
decimalsInFloat: 0,
},
colors: ["#E53935", "#FFA726", "#FDD835", "#7CB342", "#29B6F6"],
dataLabels: {
enabled: true,
},
plotOptions: {
bar: {
distributed: true,
borderRadius: 0,
horizontal: true,
},
},
},
series: [
{
name: "itemCount",
data: [10, 4, 8, 9, 3],
//data: [1, 2, 2, 1, 3], // for low counts
},
],
},
}
}