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] 时间轴-series-bar. label显示问题 #16666

Closed
ITchenjian opened this issue Mar 11, 2022 · 18 comments
Closed

[Bug] 时间轴-series-bar. label显示问题 #16666

ITchenjian opened this issue Mar 11, 2022 · 18 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.

Comments

@ITchenjian
Copy link

ITchenjian commented Mar 11, 2022

Version

5.3.1

Link to Minimal Reproduction

No response

Steps to Reproduce

option = {
  yAxis: {
    type: 'category',
    data: ['Mon', 'Tue']
  },
  xAxis: {
    type: 'time',
    minInterval: 3600 * 24 * 1000,
    axisLabel : {
        color: '#3D3F4B',
        interval: 0,
        showMaxLabel: true,
        formatter: (value, index) => {
            var date = new Date(value);
            var texts = [(date.getMonth() + 1), date.getDate()];
            return texts.join('-');
        }
    },
  },
  series: [
    {
      data: ['2021/12/15', '2021/12/16'],
      type: 'bar',
      label: {
          show: true,
          position: "right",
          formatter: function(params) {
              return '测试' + params.name;
          },
          color: '#000',
      },
    }
  ]
};

Current Behavior

series-bar. label不显示(奇怪的是,将X轴于Y轴互换就可显示)
如图
image
X轴于Y轴互换后
image

Expected Behavior

series-bar. label显示问题

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

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

echarts-bot bot commented Mar 11, 2022

@ITchenjian 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] Timeline-series-bar. The label shows the problem

@susiwen8
Copy link
Contributor

I have copy your options, seem ok
Screen Shot 2022-03-11 at 5 35 04 PM

@ITchenjian
Copy link
Author

谢谢你的回答
可以在这看看(替换配置,在项目也是这种情况)
https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&version=5.3.1
@susiwen8

@susiwen8
Copy link
Contributor

Are you sure the option you provide is the one who can reproduce this issue? I stil can't reproduce bug by pasting your option in https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&version=5.3.1
Which browser and OS you have?

@ITchenjian
Copy link
Author

@susiwen8 确实是这样,用的是win10和谷歌
这是我笔记本上谷歌版本
image
我笔记本和公司电脑都是这样,配置确实没错,我自己就是粘的这个配置
image

@lefex
Copy link
Contributor

lefex commented Mar 11, 2022

image

I can show also. Maybe you resized the browser window. Not 100% show.

@susiwen8
Copy link
Contributor

@susiwen8 确实是这样,用的是win10和谷歌 这是我笔记本上谷歌版本 image 我笔记本和公司电脑都是这样,配置确实没错,我自己就是粘的这个配置 image

Chrome 版本和你一样,但我的系统是 MacOS, 难道是 win10 的问题?

@ITchenjian
Copy link
Author

谢谢你们的回答。
谢谢你的提示 @lefex
又发现了一个奇怪了现象,窗口100%不显示、110%显示、125%不显示、150%又显示
image
image
image
image

@ITchenjian
Copy link
Author

依次类推,随着窗口大小的改变时有时无!

@plainheart
Copy link
Member

plainheart commented Mar 12, 2022

应该还是因为被系列坐标系裁切的原因,设置下 series.clipfalse 对比下。和 #16661 问题类似,不同宽度下会出现被裁切的情况。

FYI: https://github.com/apache/echarts/blob/master/src/chart/bar/BarView.ts#L696

@ITchenjian
Copy link
Author

@plainheart
如果设置series.clip 为 false的话,label是出来了但柱状完全超出的部分就出来了
image

@ITchenjian
Copy link
Author

这种问题可有好的解决之法

@plainheart
Copy link
Member

我怎么感觉禁用裁切之后的图表渲染本身就有些问题... @Ovilia @susiwen8 WDYT?

@yulitg2110
Copy link

yulitg2110 commented Mar 15, 2022

I have the same issue. The height of some time bars is 0.

@pissang
Copy link
Contributor

pissang commented Mar 18, 2022

There are several unexpected issues here:

  1. The xAxis is a time axis. And when calculating the start point of bar. We usually starts with 0 value. Like https://github.com/apache/echarts/blob/master/src/layout/barGrid.ts#L606 did. But 0 is not a quite valid value in the time axis. So it cause a very weried shape:
{
  "x": -9730657.766666668,
  "y": 247.11,
  "width": 9730721.866666667,
  "height": 111.78
}
  1. Even if the calculated rect shape is quite unexpected. We can still render it normally in most cases after clipped in https://github.com/apache/echarts/blob/master/src/chart/bar/BarView.ts#L691 . And there may be a precision issue when do clipping calculation which cause the bar is totoally clipped and marked to be ignore

@fuchunhui
Copy link
Contributor

a very interesting case😂

Copy link
Contributor

github-actions bot commented Apr 6, 2024

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 Apr 6, 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 Apr 13, 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.
Projects
None yet
Development

No branches or pull requests

7 participants