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

当y轴为默认的value类型时,y轴的dataZoom会导致部分临界数据点被过滤的问题(3.x.x版本) #2757

Closed
netwww1 opened this issue Mar 8, 2016 · 2 comments
Labels

Comments

@netwww1
Copy link

netwww1 commented Mar 8, 2016

问题简述 (One-line summary)

当y轴为默认的value类型时,y轴的dataZoom会导致部分临界数据点(例如接近dataZoom自动设置的最大值的数据点)被过滤的问题。

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version): 3.0.2, 3.1.2 (3.1.1未作测试)
  • 浏览器类型和版本 (Browser version): 49.0.2623.75 m
  • 操作系统类型和版本 (OS Version): win7 64bit

重现步骤 (Steps to reproduce)

  1. 运行如下的option,当endValue被注释时,运行产生的图形会缺失第一个点"83.56",虽然dataZoom的上端手柄标签显示为"84";
  2. 当启用endValue设置值时,运行产生的图形能显示第一个点"83.56",但当向下移动dataZoom的上端手柄,并移动回最上端后,第一个点仍然会消失;
  3. 删除整个dataZoom,则图形正确。或者将第一个点的值改为"83.55",即使有dataZoom,图形也正确。

期望结果 (Expected behaviour)

临界数据点仍然能正确显示。

可能哪里有问题 (What went wrong)

dataZoom一端自动计算出的限值过于接近临界数据点,可能引起浮点精度问题。

ECharts配置项 (ECharts option)

option = {
        "title": {
            "text": "1个月温度",
            "left": "center"
        },
        "tooltip": {
            "trigger": "axis"
        },
        "dataZoom": [
            {
                "show": true,
                "yAxisIndex": 0,
                //endValue:83.57,
                "filterMode": "empty",
                "showDataShadow": false
            }
        ],
        "legend": [
            {
                "data": [
                    "温度"
                ],
                "top": 31,
                "left": "center"
            }
        ],
        "grid": {},
        "xAxis": [
            {
                "data": [
                    "2015-12-08",
                    "2015-12-09",
                    "2015-12-10",
                    "2015-12-11",
                    "2015-12-12"
                ]
            }
        ],
        "yAxis": [
            {
                "name": "温度(℃)"
            }
        ],
        "series": [
            {
                "type": "line",
                "data": [
                    "83.56",
                    "83.39",
                    "55.10",
                    "-5.47",
                    "-62.83"
                ],
                "name": "温度"
            }
        ]
}

其他信息 (Other comments)

@netwww1
Copy link
Author

netwww1 commented Mar 8, 2016

补充:
如果给 yAxis 设置 max 为 dataMax,则可以看到y轴标尺的最大刻度是 83.39,而不是83.56。也许是查找最大值功能的问题?
如果 max 设置为 84,则功能正确。

@fionagithub
Copy link

如果给 yAxis 设置 max 为 dataMax,请问min怎么可以设置为-1*dataMax?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants