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

Same zero line for left and right axis #3011

Closed
Heckscheibe opened this issue Nov 15, 2017 · 2 comments
Closed

Same zero line for left and right axis #3011

Heckscheibe opened this issue Nov 15, 2017 · 2 comments

Comments

@Heckscheibe
Copy link

Hi there,
is there a way how I can configure two datasets, one having dataSet.axisDependency = .left and the other dataSet.axisDependency = .right to have the zero line at the same spot?
screen shot 2017-11-15 at 11 04 51
As you can see in the screenshot, they have a very different scaling. The right axis has its zero line at the very bottom (I am not displaying it), the left one in the middle. The X axis values here are very different, but it should only be a matter of scaling in my opinion. But I could not find a way to do this.

Ideally like this, where the axis are scaled in a differently, but have the same zero line.
screen shot 2017-11-15 at 11 12 38

@liuxuan30
Copy link
Member

liuxuan30 commented Nov 18, 2017

well, if you want to have diferent range and keep the 0 line at the same position, it's kind of tricky;

the simpliest way is to use same axis range for both left and right axis, but if your line and bar data range vary a lot, one of them may seems very small.

if you really want this, you have to do this. You need to make sure you carefully calculated the axis range and interval, to make sure your 0 draw at the same y position.

That means when your left axis know where is the 0 position, it have to tell right axis where is the 0 position, and then you start calculating the axis interval around 0.

you need to carefully look at how it calculate the matrix and computeAxisValues().

same question here: #2989 but yours have negative values, so things are more comlex.

@Heckscheibe
Copy link
Author

ok, thanks anyway :)

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