Skip to content

折线图 scale 设置max之后,图表显示异常 #4945

Answered by hustcc
Dawnwangzi asked this question in Q&A
Discussion options

You must be logged in to vote
  • 设置 min 后,折线超出下方的问题,加上 limitInPlot 可以解决。
const chart = new Chart({
    container: 'container',
    autoFit: true,
    height: 500,
    limitInPlot: true,  // 👈🏻 这里
  });
  • max 设置为 2000 不显示的问题,需要再排查,确实有点奇怪,不过对你这个数据量级差距大的情况,建议使用 log 类型
chart.scale({
    ts: {
      tickCount: 10,
      type: 'timeCat',
    },
    value: {
      nice: false,
      type: 'log',  // 👈🏻 这里
      max: 2000,
      // min: 1500
    }
  });
  

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hustcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4927 on May 06, 2023 03:18.