Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧐[问题] - How to set Area to startOnZero: false? #528

Closed
MarkLyck opened this issue Mar 9, 2021 · 6 comments
Closed

🧐[问题] - How to set Area to startOnZero: false? #528

MarkLyck opened this issue Mar 9, 2021 · 6 comments

Comments

@MarkLyck
Copy link

MarkLyck commented Mar 9, 2021

in AntVis G2 I can run the following to make my Area chart start at a negative value.

chart
    .area({
      startOnZero: false,
    })

Screen Shot 2021-03-09 at 08 38 40

But I haven't found a similar option for ant-design-charts :(

I've tried:

area: {
      startOnZero: false,
      options: {
        startOnZero: false,
      },
    },
options: {
      startOnZero: false,
    },
    startOnZero: false,
yAxis: {
      startOnZero: false
}

none of which worked.

Right now my chart looks terrible :/

Screen Shot 2021-03-09 at 08 02 09

How can I make the area draw from -100 and up?

@lxfu1
Copy link
Member

lxfu1 commented Mar 9, 2021

  yAxis: {
    min: -100
  }

@MarkLyck
Copy link
Author

MarkLyck commented Mar 9, 2021

@lxfu1 I have that already.

This is my yAxis:

yAxis: {
      startOnZero: false,
      min: -100,
      minLimit: -100,
      maxLimit: Math.ceil(maxLimit / 100) * 100,
      tickCount: 6,
      label: {
        labelLine: null,
        formatter: (v: string) => `${numberFormatter.format(Math.floor(Number(v)))}%`,
        style: {
          fill: '#A0A5B2',
        },
      },
      grid: {
        line: {
          style: {
            stroke: '#EFF4F7',
            lineWidth: 1,
          },
        },
      },
    },

Does not fix it.

@MarkLyck
Copy link
Author

anyone 🙏 ?

@MarkLyck
Copy link
Author

I still have not found a solution for this :(

@lxfu1 do you have any other ideas?

@lxfu1
Copy link
Member

lxfu1 commented Mar 19, 2021

It's a problem, It will be fixed soon.

@lxfu1
Copy link
Member

lxfu1 commented Mar 22, 2021

antvis/G2Plot#2444

@lxfu1 lxfu1 closed this as completed Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants