apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.29k stars 19.61k forks source link

legend:textStyle-padding invalid #15567

Open Xqrrrr opened 3 years ago

Xqrrrr commented 3 years ago

Version

5.1.2

Steps to reproduce

legend:{ textStyle:{ padding:[15,0,0,0] } }

What is expected?

The text can be set to padding top

What is actually happening?

When I use TextStyle padding in legend to set top and bottom, the text of legend does not follow the padding setting

echarts-bot[bot] commented 3 years ago

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 contains a minimum reproducible demo and necessary images to 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! 🍵

plainheart commented 3 years ago

You may need to specify a valid backgroundColor to enable the text box.

Here is the related logic: https://github.com/ecomfe/zrender/blob/master/src/graphic/Text.ts#L824

@pissang Is it by design that the text box won't be drawn if the developer doesn't specify the backgroundColor(null/undefined)?

Xqrrrr commented 3 years ago

You may need to specify a valid backgroundColor to enable the text box.

Here is the related logic: https://github.com/ecomfe/zrender/blob/master/src/graphic/Text.ts#L824

@pissang Is it by design that the text box won't be drawn if the developer doesn't specify the backgroundColor(null/undefined)?

I don't know if it's the backgroundColor problem. The default value of backgroundColor is transparent, and the echarts 4 version can directly use padding . So I don't know what the problem is, But I used rich to solve my problem

ldc-37 commented 3 years ago

I also met this problem. Here is another relevant issue https://github.com/apache/echarts/issues/15425

So I don't know what the problem is, But I used rich to solve my problem

Well, there isn't "rich" property for "name" of an axis......