question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

title.textStyle.width property not working

See original GitHub issue

One-line summary [问题简述]

title.textStyle.width property not working on Title

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: Tested at 4.1.0
  • Browser version [浏览器类型和版本]: All
  • OS Version [操作系统类型和版本]: All

Expected behaviour [期望结果]

When sets title.textStyle.width and title.textStyle.rich is specified, title width is applied. Test at https://codepen.io/bantaur/pen/PyrJBb

ECharts option [ECharts配置项]

option = {
	title: {
       text: "{aaa|Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}",
		textStyle: {
		    width: '20%',
			rich: {
				aaa: {
					backgroundColor: 'red',
					color: 'blue'
				}
			}
		}
	},
    legend: {
        data:['邮件营销','联盟广告']
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['周一','周二']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'邮件营销',
            type:'line',
            stack: '总量',
            areaStyle: {},
            data:[120, 132, 101, 134, 90, 230, 210]
        },
        {
            name:'联盟广告',
            type:'line',
            stack: '总量',
            areaStyle: {},
            data:[220, 182, 191, 234, 290, 330, 310]
        }
    ]
};

Other comments [其他信息]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
100pahcommented, Oct 31, 2018

Currently, auto line wrap is not supported. So text with only make sense on text background. We should take into account the implementation of auto line wrap, although it is not easy.

0reactions
diogoalmeidaribeirocommented, Dec 1, 2020

So this is a two year bug and still not updates … Any workaround or solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

title.textStyle.width property not working · Issue #9311 - GitHub
When sets title.textStyle.width and title.textStyle.rich is specified, title width is applied. Test at https://codepen.io/bantaur/pen/PyrJBb ...
Read more >
CSS width properties not working correctly - Stack Overflow
I set width:100% for header and footer, and it should make then to stretch so fill all the body width, as body is...
Read more >
font-size - CSS: Cascading Style Sheets - MDN Web Docs
The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length>...
Read more >
Alignment, font styles, and horizontal rules in HTML documents
The BASEFONT element sets the base font size (using the size attribute). Font size changes achieved with FONT are relative to the base...
Read more >
CSS width property - W3Schools
The width property sets the width of an element. The width of an element does not include padding, borders, or margins! Note: The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found