小编kas*_*yap的帖子

Apexcharts:如何强制条形图中的轴仅显示整数值?

我正在使用 ApexCharts 中的条形图。水平 x 轴有项目数。当数字太低(例如 1、2)时,轴会显示没有意义的中间十进制值。如何强制轴仅以整数间隔显示整数值,如第二个图像中所示。Vue模板

        <apexchart
          ref="ratingChart"
          width="450"
          height="250"
          :options="ratingData.options"
          :series="ratingData.series"
        ></apexchart>
Run Code Online (Sandbox Code Playgroud)

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: …
Run Code Online (Sandbox Code Playgroud)

vue.js apexcharts

4
推荐指数
1
解决办法
7550
查看次数

标签 统计

apexcharts ×1

vue.js ×1