echarts [Bug] 在树图 tree 的 data 中给树图使用 lineStyle 设置某一条树图边颜色时,当数据项没有 children 属性时会设置失败

wpcxdonn  于 5个月前  发布在  Echarts
关注(0)|答案(1)|浏览(44)

Version

5.3.1

https://echarts.apache.org/examples/zh/editor.html?version=5.3.1&code=MYewdgzgLgBAJgQygmBeGBvAUDGYEC2ApgFwwDkAZgDYIBOR5ANDjNQJZhEDKUAntVKZWuUNRB0y5AMSUADHPIwA9MpiAgzUA55oAp1QJvxgGcTAfdGA7f0CIFoD-1QJ3xgHIzATkGAYf8CYSoGg5QABygcr9AL26A9HUAhbjGAAC3ZqOAYwGEBaOUABI0BIc18LG1tAaojAfb9XE0AwuUAgBlYAXxZRYNDwsgBtEWFcarxCIXJEZGZK3A4uXgEhbBqasQkpaTl5JVUYQGV9QFklQAdTQDtjWIDisKIIqcARv3sTRN87QAQjQHylFpgCw6CQpbByw9xunpr8YikAESQEAFUoEObbmoA3BGoAK5CADMwIATGCrkdDgBdSrHGo3O51KRwdgQAAOtD4Xx6f0BIPBwMKPTaPH4gjISJ6fUkFEGQxGakms0AhTbzU4lZYwNYbMxWba2QCMmoBSWMOeXhrDheQA3FhRoBTuWcgFlE4yANeVAFeBgAztQCK_oAuT0A0fL2QBU5oAtBUAd_KATlMsCAMR9wGgqjAoCAQNQPhiqZUoHR2ABzP1EOnkdhQIgEXG4H3-wN0ADyFwoBBAAIg4ZAP0Y-RJad9RAgl0Rh34GPqPqIjBJNXYcDIcir1XuZYYRAAjJHqo0EOUuzCG1HbVJW3IAKQd1pEShQKQADjH_ZgACMQFAXQQpBD54dfX7AtOKGDR-OYBA-ARl9RuOwAF5CADsC6IcED3ECCFLUgxboEnErhyfgYAGISAA1gACiAEChuw4BSAAbMCW63Jw0H_AAKi2jxEHagRkMShxkh0lJOrcADuNZQLhMCQrcCKkggi5ENQXrfEuCDACBfp0CmYBwAAwm6_T0pQInHrgX5QfaibkIIU5iTAmZ0B8wD_AAghwfrSQQNZwII8n_P60k7nu5DiguggIJmBYkfRjHMTZtwSdBsEUMZUDybginKWpGlaTpekLjUBmaVIsnuVCEq0Y-BAYm-UHWdSNSUCAwCpqi-bAMsiBgOFUX_gAHhiCC8apvECdQtAYmmZA-kCC7FewBBIDBYCPACdDNS5ACsXX1ocDVNVJbUdVJrwYo0969ZKuDSnKNp2i1MAAGRLTABB8Hxb5KQAdGmUBxgt4AABS2lJACUMpAA

Steps to Reproduce

1.引入 5.3.1 版本的 echarts。
2.创建一个 id 为 main 的 div ,并设置宽高。
3.参照 echarts 树图示例渲染一张树图。
4.在树图的 data 中给有 children 子节点的数据项设置树图边颜色 lineStyle: {color: 'red'},可以设置成功。
5.当给没有 children 子节点的数据项设置树图边颜色 lineStyle: {color: 'red'},发现设置失败。

Current Behavior

依照文档我在树图的 data 中给数据项设置 lineStyle 树图边颜色发现只可以给有 children 子节点的数据项设置成功,当数据项没有children 属性(没有子节点)时,会设置失败。

Expected Behavior

我希望数据 display 所在的树图边 lineStyle 颜色可以单独设置,比如 display 所在数据项有一个中断连接状态时,lineStyle 可以被设置为红色。

Environment

- OS: macOS 12.5
- Browser: edge 107.0.1418.62 (正式版本) (arm64)
- Framework: vue 2.6.14

Any additional comments?

No response

kq0g1dla

kq0g1dla1#

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

TITLE

[Bug] When using lineStyle to set the edge color of a tree diagram in the data of the tree tree, the setting fails when the data item does not have the children property

相关问题