typescript 如何在echart中省略轴上的小数值?

kulphzqa  于 2023-06-30  发布在  TypeScript
关注(0)|答案(2)|浏览(159)

现在我的图表有一个带有十进制值的y轴,但我只想要完整的数字,如123

下面是我的配置:

const option: EChartsOption = {
    dataset: {
      source: data()
    },
    grid: {
      left: "3%",
      right: "4%",
      bottom: "3%",
      containLabel: true
    },
    xAxis: {
      type: "category",
      splitLine: {
        show: true,
        lineStyle: {
          color: "#272A30",
          width: 1
        }
      }
    },
    yAxis: {
      type: "value",
      axisLabel: {
        color: "white",
        fontSize: 11
      },
      splitLine: {
        lineStyle: {
          color: "#272A30",
          width: 1
        }
      }
    },
    series: [
      {
        type: "line",
        smooth: true,
        name: "Incidents",
        showSymbol: false,
        color: "#E24D42",
        symbolSize: 0,
        lineStyle: {
          color: "#E24D42"
        },
        label: {
          precision: 2
        }
      }
    ]
  };

如何在react中使用echarts库省略十进制数?
感谢您的任何帮助!

k2fxgqgv

k2fxgqgv1#

好吧,我有一个未来的问题和我的查尔兹的答案,

yAxis.minInterval: 1

就这样

h6my8fg2

h6my8fg22#

yAxis: {
  type: "value",
  minInterval: 1,
}

相关问题