apache / echarts

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

自定义类型 custom 文字块颜色设置失效 #8860

Closed kongzhexin closed 2 years ago

kongzhexin commented 6 years ago

One-line summary [问题简述]

自定义类型,文字块颜色等功能无效

Version & Environment [版本及环境]

Expected behaviour [期望结果]

自定义类型支持颜色等功能

ECharts option [ECharts配置项]

option = {
    series: [
        {
            type: 'custom',
            coordinateSystem:"none",
            renderItem:function(){
                 return {
                type: "text",
                style: {
                  text: [
                    "{fregment1|A Text Fregment} {fregment2|Another Text Fregment}",
                    "{hr|}",
                    "Text fregments can be customized."
                  ].join("\n"),
                  x: 100,
                  rich: {
                    fregment1: {
                      backgroundColor: "#339911",
                      fontSize: "60"
                    },
                    hr: {
                      borderColor: "#000",
                      // 这里把 width 设置为 '100%',表示分割线的长度充满文本块。
                      // 注意,这里是文本块内容盒(content box)的 100%,而不包含 padding。
                      // 虽然这和 CSS 相关的定义有所不同,但是在这类场景中更加方便。
                      width: "100%",
                      borderWidth: 0.5,
                      height: 1
                    }
                  }
                }
              };
            },
            data: [0]
        }]
};

Other comments [其他信息]

Ovilia commented 6 years ago

http://echarts.baidu.com/option.html#series-custom.renderItem.return_text.style.fill 这个配置项是设置文字颜色的

kongzhexin commented 6 years ago

在rich 中配置并不管用 还有其他的rich中一些配置都是无效的

Ovilia commented 6 years ago

@kongzhexin 可以具体说下,你用到哪些配置项出问题了吗?

kongzhexin commented 6 years ago

@Ovilia 我给的demo option 中的配置就是无效的,是本身就不支持么,文档没有说明? 背景色、边框颜色 、宽度,这是我从label的rich中复制过来的一部分

CMISS1573 commented 4 years ago

这种需求有其他办法可以解决吗?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 2 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!