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轴显示精度问题,显示小数点后16位 #5041

Closed
kousuutetu opened this Issue Feb 9, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@kousuutetu

One-line summary [问题简述]

y轴显示精度问题,显示小数点后16位

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.4.0
  • Browser version [浏览器类型和版本]: Chrome 55.0.2883.95 (64-bit)、Safari 10.0.3 (11602.4.8.0.1)
  • OS Version [操作系统类型和版本]: OS X EI Capitan 10.11.6 (15G1217)

Expected behaviour [期望结果]

小数点后一到两位即可

ECharts option [ECharts配置项]

option = {
    "title": {
        "text": "l3.amp",
        "left": 30
    },
    "grid": {
        "left": 160
    },
    "tooltip": {
        "trigger": "axis"
    },
    "toolbox": {
        "right": 20,
        "feature": {
            "dataView": {
                "title": "DataView",
                "lang": [
                    "DataView",
                    "Close",
                    "Refresh"
                ]
            }
        }
    },
    "xAxis": {
        "data": [
            "2017-02-09 14:33:15",
            "2017-02-09 14:33:16",
            "2017-02-09 14:33:17",
            "2017-02-09 14:33:18",
            "2017-02-09 14:33:19",
            "2017-02-09 14:33:20",
            "2017-02-09 14:33:21",
            "2017-02-09 14:33:22",
            "2017-02-09 14:33:23",
            "2017-02-09 14:33:24",
            "2017-02-09 14:33:25",
            "2017-02-09 14:33:26",
            "2017-02-09 14:33:27",
            "2017-02-09 14:33:28",
            "2017-02-09 14:33:29",
            "2017-02-09 14:33:30",
            "2017-02-09 14:33:31",
            "2017-02-09 14:33:32",
            "2017-02-09 14:33:33",
            "2017-02-09 14:33:35",
            "2017-02-09 14:33:36",
            "2017-02-09 14:33:37",
            "2017-02-09 14:33:38",
            "2017-02-09 14:33:39",
            "2017-02-09 14:33:40",
            "2017-02-09 14:33:41",
            "2017-02-09 14:33:42",
            "2017-02-09 14:33:43",
            "2017-02-09 14:33:44",
            "2017-02-09 14:33:45",
            "2017-02-09 14:33:46",
            "2017-02-09 14:33:47",
            "2017-02-09 14:33:48",
            "2017-02-09 14:33:49",
            "2017-02-09 14:33:50",
            "2017-02-09 14:33:51",
            "2017-02-09 14:33:53",
            "2017-02-09 14:33:54",
            "2017-02-09 14:33:55",
            "2017-02-09 14:33:56",
            "2017-02-09 14:33:57",
            "2017-02-09 14:33:58",
            "2017-02-09 14:33:59",
            "2017-02-09 14:34:00",
            "2017-02-09 14:34:01",
            "2017-02-09 14:34:02",
            "2017-02-09 14:34:03",
            "2017-02-09 14:34:04",
            "2017-02-09 14:34:05",
            "2017-02-09 14:34:06",
            "2017-02-09 14:34:07",
            "2017-02-09 14:34:08",
            "2017-02-09 14:34:09",
            "2017-02-09 14:34:10",
            "2017-02-09 14:34:11",
            "2017-02-09 14:34:12",
            "2017-02-09 14:34:13",
            "2017-02-09 14:34:14",
            "2017-02-09 14:34:15",
            "2017-02-09 14:34:16",
            "2017-02-09 14:34:17",
            "2017-02-09 14:34:18",
            "2017-02-09 14:34:19",
            "2017-02-09 14:34:20",
            "2017-02-09 14:34:21",
            "2017-02-09 14:34:22",
            "2017-02-09 14:34:23",
            "2017-02-09 14:34:24",
            "2017-02-09 14:34:25",
            "2017-02-09 14:34:26",
            "2017-02-09 14:34:27",
            "2017-02-09 14:34:28",
            "2017-02-09 14:34:29",
            "2017-02-09 14:34:30",
            "2017-02-09 14:34:31",
            "2017-02-09 14:34:32",
            "2017-02-09 14:34:33",
            "2017-02-09 14:34:34",
            "2017-02-09 14:34:35",
            "2017-02-09 14:34:37",
            "2017-02-09 14:34:38",
            "2017-02-09 14:34:39",
            "2017-02-09 14:34:40",
            "2017-02-09 14:34:41",
            "2017-02-09 14:34:42",
            "2017-02-09 14:34:43",
            "2017-02-09 14:34:44",
            "2017-02-09 14:34:45",
            "2017-02-09 14:34:46",
            "2017-02-09 14:34:47",
            "2017-02-09 14:34:48",
            "2017-02-09 14:34:49",
            "2017-02-09 14:34:50",
            "2017-02-09 14:34:51",
            "2017-02-09 14:34:52",
            "2017-02-09 14:34:53",
            "2017-02-09 14:34:54",
            "2017-02-09 14:34:55",
            "2017-02-09 14:34:56",
            "2017-02-09 14:34:57"
        ]
    },
    "yAxis": {
        "min": "dataMin",
        "splitLine": {
            "show": false
        }
    },
    "visualMap": {
        "top": 260,
        "right": 10,
        "pieces": [
            {
                "gt": 0,
                "lte": 10,
                "color": "#096"
            },
            {
                "gt": 10,
                "lte": 20,
                "color": "#ff9933"
            },
            {
                "gt": 20,
                "color": "#cc0033"
            }
        ],
        "outOfRange": {
            "color": "#999"
        }
    },
    "series": {
        "name": "amp",
        "type": "line",
        "data": [
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6,
            1.6
        ],
        "markLine": {
            "silent": true,
            "data": [
                {
                    "yAxis": 10
                },
                {
                    "yAxis": 20
                }
            ]
        }
    }
}

Other comments [其他信息]

15cde092-1ea3-4d03-8e9a-9ad872cf161a

@sevenen

This comment has been minimized.

Show comment
Hide comment
@sevenen

sevenen Feb 10, 2017

去掉yAxis 里面的 "min": "dataMin"

sevenen commented Feb 10, 2017

去掉yAxis 里面的 "min": "dataMin"

@kousuutetu

This comment has been minimized.

Show comment
Hide comment
@kousuutetu

kousuutetu Feb 10, 2017

@sevenen 旁边这个也设置有dataMin,没有问题。另外不设置dataMin从y轴显示很难看,微小的波动根本看不到。

kousuutetu commented Feb 10, 2017

@sevenen 旁边这个也设置有dataMin,没有问题。另外不设置dataMin从y轴显示很难看,微小的波动根本看不到。

@sevenen

This comment has been minimized.

Show comment
Hide comment
@sevenen

sevenen Feb 10, 2017

yAxis: { min: dataMin, splitLine: { show: false }, axisLabel:{ formatter:function(data){ return data.toFixed(1); } } },

sevenen commented Feb 10, 2017

yAxis: { min: dataMin, splitLine: { show: false }, axisLabel:{ formatter:function(data){ return data.toFixed(1); } } },

@pissang pissang closed this Feb 14, 2017

100pah added a commit that referenced this issue Mar 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment