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] yAxis.max /min generates additional gridlines that cannot be hidden #19929

Open
sssning opened this issue May 13, 2024 · 1 comment
Open
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: author

Comments

@sssning
Copy link

sssning commented May 13, 2024

Version

5.5.0

Link to Minimal Reproduction

https://jsfiddle.net/j5yospvx/

Steps to Reproduce

const xData = ['2020-01-01','2020-01-02','2020-01-03','2020-01-04','2020-01-05']; const priceList = [21, 13, 14, 24, 17]; const lastData = priceList [priceList .length - 1]; const minPrice = Math.min(...priceList ) const maxPrice = Math.max(...priceList ) const maxAxis = Math.max(2 * lastData - minPrice, maxPrice); const minAxis = Math.min(minPrice, 2 * lastData - maxPrice); const option = { grid: { x: 80, y: 60, x2: 60, y2: 60 }, legend: { selectedMode: false }, xAxis: { boundaryGap: [0.5, 0.5], axisLine: { show: false }, axisTick: { show: false }, type: 'category', data: xData , show: true, axisLabel: { inside: false, fontSize: 14, padding: [20, 20, 20, 20], align: 'center', interval: xData.length - 2, showMinLabel: true, showMaxLabel: true, } }, yAxis: { boundaryGap: [0.5, 0.5], type: 'value', show: true, max: maxAxis, min: minAxis, minInterval: Math.abs(minAxis-maxAxis) / 5, splitLine: { show: true, lineStyle: { type: "dashed" } }, axisLabel: { formatter: function (value, index) { return value.toFixed(2) + "%" }, fontSize: 14, showMinLabel: false, showMaxLabel: false } }, series: [ { silent: true, data: priceList, showSymbol: false, type: 'line', smooth: true }, { data: priceList, showSymbol: false, type: 'line', smooth: true, lineStyle: { width: 0, color: '#326EEB', } } ], animation: false };

Current Behavior

I set the yAxis.max and min properties, resulting in two extra grid lines in the chart that I don't need, but can't hide

Expected Behavior

I wish I could manually control the grid lines generated by min and max

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@sssning sssning added the bug label May 13, 2024
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels May 13, 2024
@Ovilia
Copy link
Contributor

Ovilia commented May 16, 2024

This is not a bug, since there is also no way to hide the second/third/... splitLines. Can you specify why it's necessary to hide the first/last splitLine? Would it be misleading about the range of the chart?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: author
Projects
None yet
Development

No branches or pull requests

2 participants