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

[Bug] the second log Y axis affects the first log #16992

Closed
FM3631 opened this issue May 7, 2022 · 4 comments
Closed

[Bug] the second log Y axis affects the first log #16992

FM3631 opened this issue May 7, 2022 · 4 comments
Labels
bug pending We are not sure about whether this is a bug/new feature. stale Inactive for a long time. Will be closed in 7 days. waiting-for: community

Comments

@FM3631
Copy link

FM3631 commented May 7, 2022

Version

5.2.2

Link to Minimal Reproduction

Reproduction Link

Steps to Reproduce

Current Behavior

Expected Behavior

The two don't affect each other.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

@FM3631 FM3631 added the bug label May 7, 2022
@echarts-bot echarts-bot bot added pending We are not sure about whether this is a bug/new feature. waiting-for: community labels May 7, 2022
@echarts-bot
Copy link

echarts-bot bot commented May 7, 2022

@FM3631 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] Gird contains multiple Y axes, when multiple Y axis types are set to 'log' at the same time, the second Y axis affects the first Y axis, which god tells the little brother

BODY

Version

5.2.2

Link to Minimal Reproduction

No response

Steps to Reproduce

Direct copy can see the phenomenon in echarts

Current Behavior

// prettier-ignore
const data = [["2000-06-05", 116], ["2000-06-06", 129], ["2000-06-07", 135], ["2000-06-08", 86 ], ["2000-06-09", 73], ["2000-06-10", 85], ["2000-06-11", 73], ["2000-06-12", 68], ["2000-06-13", 92], ["2000-06-14", 130], ["2000-06-15", 245], ["2000-06-16", 139], [" 2000-06-17", 115], ["2000-06-18", 111], ["2000-06-19", 309], ["2000-06-20", 206], ["2000- 06-21", 137], ["2000-06-22", 128], ["2000-06-23", 85], ["2000-06-24", 94], ["2000-06- 25", 71], ["2000-06-26", 106], ["2000-06-27", 84], ["2000-06-28", 93], ["2000-06-29" , 85], ["2000-06-30", 73], ["2000-07-01", 83], ["2000-07-02", 125], ["2000-07-03", 107 ], ["2000-07-04", 82], ["2000-07-05", 44], ["2000-07-06", 72], ["2000-07-07", 106], ["2000-07-08", 107], ["2000-07-09", 66], ["2000-07-10", 91], ["2000-07-11", 92], [" 2000-07-12", 113], ["2000-07-13", 107], ["2000-07-14", 131], ["2000-07-15", 111], ["2000- 07-16", 64], ["2000-07-17", 69], ["2000-07-18", 88], ["2000-07-19", 77], ["2000-07- 20", 83], ["2000-07-21", 111], ["2000-07-22", 57], ["20 00-07-23", 55], ["2000-07-24", 60]];
const dateList = data.map(function (item) {
return item[0];
});
const valueList = data.map(function (item) {
return item[1];
});
option = {
title: [
{
left: 'center',
text: 'Gradient along the y axis'
},
{
top: '55%',
left: 'center',
text: 'Gradient along the x axis'
}
],
tooltip: {
trigger: 'axis'
},
xAxis: [
{
data: dateList
},
{
data: dateList,
gridIndex: 1
}
],
yAxis: [
{
type: 'log',
min: 0.01
},
{
type: 'log',
gridIndex: 1,

  min: 0.1,
  axisLabel: {
    fontSize: '34'
  }
}

],
grid: [
{
bottom: '60%'
},
{
top: '60%'
}
],
series: [
{
type: 'line',
showSymbol: false,
data: valueList
},
{
type: 'line',
showSymbol: false,
data: valueList,
xAxisIndex: 1,
yAxisIndex: 1
}
]
};

Expected Behavior

1

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

none

@fuchunhui fuchunhui changed the title [Bug] gird中包含多个Y轴,将多个Y轴type同时设置为‘log’时,第二个Y轴影响第一个Y轴,哪位大神告知一下小弟 [Bug] the second log Y axis affects the first log May 7, 2022
jiawulin001 added a commit to jiawulin001/echarts that referenced this issue May 18, 2022
@jiawulin001
Copy link
Member

Problem locating

This problem exist here:

echarts/src/scale/Log.ts

Lines 74 to 76 in 5cf53e2

powVal = (val === extent[0] && this._fixMin)
? fixRoundingError(powVal, originalExtent[0])
: powVal;

When Echarts tries to obtain the extent of data and set ticks, it's trying to use the precision of originalExtent to fix powVal. This behavior is to fix the problem of #4158, where precision issue is caused by logarithm and exponentiation. However here powVal can be user-set min/max, which is 0.01 here and originalExtent is the real extent of data, which is 44 here. When using the precision of 44 to fix 0.01, tick value becomes 0 and it has nowhere to go on log axis. That's the reason why there's a big 0 up there.

Plan to fix

The way to fix #4158 is not fixing it completely (a user-set max of 2000000000000 still displays wrongly) and it also causes #16992. My plan is to change the way to fix #4158 and can fix #16992 in the same time.

Submitting a PR to solve this

Copy link
Contributor

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label May 17, 2024
Copy link
Contributor

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pending We are not sure about whether this is a bug/new feature. stale Inactive for a long time. Will be closed in 7 days. waiting-for: community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants