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.

axis nametextstyle overflow truncate not working HELP ASAP

See original GitHub issue

Version

5.0.2

Steps to reproduce

I used this options

option = {
    xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
        show: true,
        name: 'bhemmmmmmmmmmmmmm gfdsmmmmmmmmmmmmmmmmmmmmmmmmmmm',
        type: 'value',
        nameTextStyle: {
            overflow: 'truncate',
            width: 10
        }
        
    },
    series: [{
        data: [150, 230, 224, 218, 135, 147, 260],
        type: 'line'
    }]
};

What is expected?

I am expecting the axis name to be truncated at a specific width

What is actually happening?

It is not getting truncated, I think the width property is not working

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
Jagan-Pcommented, Sep 20, 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'
    }]
};

@TheLostDory

1reaction
ArslanAmeercommented, Jul 29, 2022

@Jagan-P & @jackielan66

nameTruncate works for me. But i wanted to break the name, so it can appear as complete in next line ?

any solution for that?

nameTextStyle: { overflow: 'break-all' | 'break', width: 10 }

Not working either

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] [echarts] JaganPandu commented on issue #15429
[GitHub] [echarts] JaganPandu commented on issue #15429: axis nametextstyle overflow truncate not working HELP ASAP.
Read more >
Label can't display when ECharts label's length is too long
I just use the treemap type of EChart to show the data. But I meet a problem. And the label ...
Read more >
lineOverflow:'truncate' cannot be implemented properly #15248
Set height text overflow, ellipsis not displayed ... This is the best way for us to reproduce it and solve the problem faster....
Read more >
Changelog - Apache ECharts
[Fix] Fix text truncate bug in treemap when using SVG renderer. [Fix] Fix label.rotate does not work in graph. Fix #9182, contributed by...
Read more >
Wrapping, truncating, and auto-rotating axis labels - amCharts
labels.template . An axis label is an object of type Label . Click the link on it to explore it's all options. For...
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