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.

When config option's singleAxis, nameTextStyle.overflow = 'truncate' invalid, width has been setted

See original GitHub issue

Version

5.1.1

Steps to reproduce

singleAxis: [
        {
          left: 150,
          name: '这是一段很长的标题名称',
          nameLocation: 'start',
          nameGap: 140,
          nameTextStyle: {
            align: 'left',
            width: 140,
            overflow: 'truncate',
            ellipsis: '...',
            fontSize: 18,
            fontWeight: 'bold'
          }]

What is expected?

singleAxis’s name break when set the width

What is actually happening?

overflow valid

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
WuYujieJustincommented, May 25, 2021

I got the same problem. Here are the link to reproduce the bug.

width: 20, overflow: ‘truncate’, ellipsis: ‘…’,

With above option, it does not work as expected

@https://www.makeapie.com/editor.html?c=xlT56sbYni&v=5

I read some source code. It seems that Echart doesn’t do anything on this option @Lysom @Ovilia

0reactions
Jagan-Pcommented, Dec 2, 2021

The nameTruncate property will do this job. Noticed this proprety in /echarts/src/coord/axisDefault.js

option = {
    xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
        show: true,
        name: 'bhemmmmmmmmmmmmmm gfdsmmmmmmmmmmmmmmmmmmmmmmmmmmm',
        type: 'value',
        nameTruncate: {
            maxWidth: 100,
            ellipsis: '...',
        }
    },
    series: [{
        data: [150, 230, 224, 218, 135, 147, 260],
        type: 'line'
    }]
};

@Lysom @WuYujieJustin

@Fnzero try this, it worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

subject:"\[GitHub\] \[echarts\] Jagan\-P edited a ... - The Mail Archive
... [echarts] Jagan-P edited a comment on issue #14911: When config option's singleAxis, nameTextStyle.overflow = 'truncate' invalid, width has been setted.
Read more >
lineOverflow:'truncate' cannot be implemented properly #15248
Version 5.1.2 Steps to reproduce xAxis: [ { type: "category", axisTick: { alignWithLabel: true, }, axisLabel: { show: true, width: 100, ...
Read more >
org.apache.echarts.commits - 2021 May - 1,300 messages - MarkMail
... echarts-bot[bot] commented on issue #14911: When config option's singleAxis, nameTextStyle.overflow = 'truncate' invalid, width has been setted - GitBox.
Read more >
Changelog - Apache ECharts
Provide more overflow configurations. Provide option set labelLayout to enable more abilities for developers to tweak the layout of the labels after it's ......
Read more >
echarts - UNPKG
159, constructor(x: number, y: number, width: number, height: number);. 160, union(other: BoundingRect): void;. 161, applyTransform(m: MatrixArray): void;.
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