Búsqueda de sitios web

javascript - ¿Cómo omitir valores decimales en el eje en echart?


En este momento mi gráfico tenía un eje y con valores decimales, pero quiero solo números enteros como 1, 2 o 3

aquí está mi configuración:

 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
        }
      }
    ]
  };

¿Cómo omitir números decimales usando la librería echarts en React?

¡Gracias por cualquier ayuda!

Respuesta #1

Ok, tengo respuestas para la pregunta futura y mis hijos.

yAxis.minInterval: 1

eso es todo

Respuesta #2

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

Artículos relacionados