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

【echarts使用】之基准线markLine #10

Open
yihan12 opened this issue Jul 16, 2022 · 0 comments
Open

【echarts使用】之基准线markLine #10

yihan12 opened this issue Jul 16, 2022 · 0 comments
Labels
【echarts使用】 echarts使用

Comments

@yihan12
Copy link
Owner

yihan12 commented Jul 16, 2022

设置了两条基准线

markLine: {
    symbol: "none",
    data: [{
        label: {
            width: "30",
            position: 'start',
            formatter: t('sleepManage_cycle.sameChart.rs'),
            fontSize: '10',
            color: '#86899D',
            overflow: 'break',
        },
        silent: false,
        lineStyle: {
            type: "dashed",
            color: "#714EB3"
        },
        yAxis: 10
    },
    {
        label: {
            width: "30",
            position: 'start',
            formatter: t('sleepManage_cycle.sameChart.qc'),
            fontSize: '10',
            color: '#86899D',
            overflow: 'break',
        },
        silent: false,
        lineStyle: {
            type: "dashed",
            color: "#3F6293"
        },
        yAxis: 1
    }]
},

关键参数

yAxis:基准线的坐标

overflow:
'truncate' 截断,并在末尾显示ellipsis配置的文本,默认为...
'break' 换行
'breakAll' 换行,跟'break'不同的是,在英语等拉丁文中,'breakAll'还会强制单词内换行

ellipsis:在overflow配置为'truncate'的时候,可以通过该属性配置末尾显示的文本。

@yihan12 yihan12 added the 【echarts使用】 echarts使用 label Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
【echarts使用】 echarts使用
Projects
None yet
Development

No branches or pull requests

1 participant