echarts visualMap设置文字width无效

khbbv19g  于 2022-11-05  发布在  Echarts
关注(0)|答案(4)|浏览(390)

Version

4.9.0

Steps to reproduce

1.官网可以验证:设置该属性--visualMap-piecewise.textStyle. width
2.具体设置值:

visualMap: {
    type: "piecewise",
    splitNumber: 8,
    min: 0,
    max: 100,
    calculable: true,
    realtime: false,
    inRange: {
      color: ["#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf", "#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026"]
    },
    textStyle: {
      width: 4,
      overflow: "break"
    }
  },

What is expected?

希望设置了文字宽度后,能实现文字换行

What is actually happening?

设置了width以及overflow属性依然无效

分段型视觉Map组件在应用时有可能文字过长,希望能换行好看点

ig9co6j1

ig9co6j11#

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that it containsa minimum reproducible demoand necessaryimagesto illustrate. Otherwise, our committers will ask you to do so.

  • A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org . Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe to our mailing list .

Have a nice day! 🍵

iaqfqrcu

iaqfqrcu2#

@cj11032 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

VisualMap setting text width is invalid

BODY

Version

4.9.0

Steps to reproduce

  1. The official website can be verified: set the attribute --visualMap-piecewise.textStyle. width
  2. Specific setting value:
    visualMap: {
    type: "piecewise",
    splitNumber: 8,
    min: 0,
    max: 100,
    calculable: true,
    realtime: false,
    inRange: {
    color: ["#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf", "#fee090", "#fdae61", "#f46d43", "# d73027", "#a50026"]
    },
    textStyle: {
    width: 4,
    overflow: "break"
    }
    },

What is expected?

I hope that after setting the text width, the text can be wrapped

What is actually happening?

Setting the width and overflow properties is still invalid

The segmented visual mapping component may be too long in the application, I hope it can be changed to look better

20jt8wwn

20jt8wwn3#

@cj11032 Please provide a minimum reproducible demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , https://www.makeapie.com/editor.html or https://codesandbox.io/s/mystifying-bash-2uthz .

  • A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
ttygqcqt

ttygqcqt4#

5.0 开始才支持设置 width 和 overflow 换行

相关问题