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] ECharts splitLine not showing on interval function #19247

Open
laurentiupomenar opened this issue Oct 25, 2023 · 5 comments
Open

[Bug] ECharts splitLine not showing on interval function #19247

laurentiupomenar opened this issue Oct 25, 2023 · 5 comments
Assignees
Labels
bug en This issue is in English topic: axis
Milestone

Comments

@laurentiupomenar
Copy link

Version

5.4.3

Link to Minimal Reproduction

https://codepen.io/calabasssita/pen/wvNaJrd

Steps to Reproduce

You can reproduce it also on the examples editor:
There are splitLines under each data label when it's not an empty string:

option = {
  xAxis: {
    type: 'category',
    position: 'top',
    data: ['', 'bbb', '', '', 'aaa', ''],
    splitLine: {
      show: true,
      interval: function(index, value) {
        return value != '';
      }
    }
  },
  dataZoom: [
    {
      type: 'slider'
    }
  ],
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [150, 230, 224, 147, 260, 50],
      type: 'line'
    }
  ]
};

Change data do this, for example, the splitLine goes to the left side of the chart, and not under the data label:

 data: ['', '', '', '', 'aaa', ''],

It also happens if you have data like this, and you zoom leaving only one label on the zoomed data

 data: ['', 'bbb', '', '', 'aaa', ''],

Current Behavior

The splitLines does not show under the label when there's only one not empty value in data, it also happens while having more than one not empty values if you zoom the chart so only one one not empty value is shown.

Expected Behavior

To have a splitLine under the data label when it satisfies the function.

Environment

- OS:macOs Ventura 13.4
- Browser: Firefox version 118.0.2 (64-bit)
- Framework:

Any additional comments?

If there's a workaround, to only show the splitLines when a value is different from X it would also help, Thanks.

@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 Oct 25, 2023
@helgasoft
Copy link

Observations are correct and several bugs are confirmed for interval :

  • creates a permanent splitline at the end of the axis, regardless of dataZoom
  • creates a splitline at the start of the axis when there is just one axis.data.value!=''
  • dataZoom-in shows incorrect splitlines

One partial fix is to use index instead of value - Demo Code
image

@laurentiupomenar
Copy link
Author

Observations are correct and several bugs are confirmed for interval :

* creates a permanent splitline at the end of the axis, regardless of dataZoom

* creates a splitline at the start of the axis when there is just one axis.data.value!=''

* dataZoom-in shows incorrect splitlines

One partial fix is to use index instead of value - Demo Code image

Using your demo code and zooming like this also gives the same result

Image

@helgasoft
Copy link

That's why I call it "partial fix".

@Ovilia
Copy link
Contributor

Ovilia commented Oct 26, 2023

There seems to be a bug when there's only one tick. The logic here takes special care about the case with single tick but it assumes the tick is at the start. But in the case of callback, it may not be at the start. I think we should be careful when changing the related logic to make sure we don't break things down. I will look into this later.

@Ovilia Ovilia removed the pending We are not sure about whether this is a bug/new feature. label Oct 26, 2023
@Ovilia Ovilia self-assigned this Oct 26, 2023
@Ovilia Ovilia added this to the TBD milestone Oct 26, 2023
JohnLYYN123 added a commit to JohnLYYN123/echarts that referenced this issue Dec 10, 2023
@JohnLYYN123
Copy link

JohnLYYN123 commented Dec 13, 2023

Here is my fix on the issue and PR link (#19382)

The given data array has only one non-empty value and the rest are empty values
image

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 topic: axis
Projects
None yet
Development

No branches or pull requests

4 participants