Echarts 烛台太短

问题描述 投票:0回答:1

我使用 echarts-for-react 来显示蜡烛图,有时当间隔太小时。我买的烛台太小了。我尝试设置 yAxis 最小值和最大值,但它不起作用。

有什么帮助吗?

这是我的代码

  const option = {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "cross",
      },
    },
    axisPointer: {
      link: [{ xAxisIndex: "all" }],
    },
    xAxis: {
      data: state?.times?.map?.(i => new Date(i)).map(a => new Intl.DateTimeFormat().format(a)),
      splitLine: { show: false },
      axisLine: { show: false },
      axisTick: { show: false },
    },
    yAxis: {
      splitLine: {
        show: false,
        min: min || 0,
        max: max || 0,
      },
    },
    grid: {
      left: 0,
    },
    dataZoom: [
      {
        type: "inside",
        minValueSpan: 10,
      },
    ],
    series: [
      {
        type: "candlestick",
        data: state?.prices,
      },
    ],
  };

<EChartsReact
   option={option}
   className="react-charts-custom"
   style={{ height: "600px" }}
/>

这里有一些SS

charts echarts candlestick-chart candlesticks
1个回答
0
投票

正如@Matthais Mertens 在评论设置中提到的那样

scale: true
解决了问题

© www.soinside.com 2019 - 2024. All rights reserved.