You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "hantongyou (via GitHub)" <gi...@apache.org> on 2024/02/29 08:01:14 UTC
[I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
hantongyou opened a new issue, #19665:
URL: https://github.com/apache/echarts/issues/19665
### Version
5.4.3
### Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?c=tree-vertical
### Steps to Reproduce
1.我使用的是自定义的数据,但是数据格式和官网示例的数据结构保持一致;
2.对于其中每一个数据项我设置了一个属性用以自定义节点边框样式,通过设置如下的itemStyle配置项:
```javascript
...
itemStyle: {
borderColor: function(params){
if(params.data.value>10)
return "red";
else return "green";
}
}
...
```
3.在我尝试失败之后,我试图打印params,但是并没有任何东西被打印,同时如果我直接在borderColor中return "red"也并没有成功修改样式,这是为什么?为了达成自定义样式的效果我应该如何做?
### Current Behavior
渲染树状图节点时自定义修改节点边框样式失效
### Expected Behavior
可以根据节点属性值自定义节点边框样式
### Environment
```markdown
- OS:windows 11
- Browser:Chrome 122.0.6261.70
- Framework:React@18.2
```
### Any additional comments?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19665:
URL: https://github.com/apache/echarts/issues/19665#issuecomment-1971870546
API says [tree.itemStyle.borderColor](https://echarts.apache.org/en/option.html#series-tree.itemStyle.borderColor) can be set to a value, not to a function.
See #19606 for customizing trees.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "hantongyou (via GitHub)" <gi...@apache.org>.
hantongyou commented on issue #19665:
URL: https://github.com/apache/echarts/issues/19665#issuecomment-1972295734
> API says [tree.itemStyle.borderColor](https://echarts.apache.org/en/option.html#series-tree.itemStyle.borderColor) can be set to a value, not to a function. See #19606 for customizing trees.
Thanks, but according to the demo, it can only customizing tree labels but not the nodes' border or nodes color?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19665:
URL: https://github.com/apache/echarts/issues/19665#issuecomment-4020014443
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!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #19665:
URL: https://github.com/apache/echarts/issues/19665#issuecomment-1970603591
@hantongyou 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. 🤗
<details><summary><b>TRANSLATED</b></summary><br>
**TITLE**
[Bug] Treemap sets node border color, thickness, etc. based on node properties
**BODY**
### Version
5.4.3
### Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?c=tree-vertical
### Steps to Reproduce
1. I use custom data, but the data format is the same as the data structure of the official website example;
2. For each of these data items, I set a property to customize the node border style, by setting the following itemStyle configuration item:
```javascript
...
itemStyle: {
borderColor: function(params){
if(params.data.value>10)
return "red";
else return "green";
}
}
...
```
3. After I tried to print params, but nothing was printed, and if I returned "red" directly in borderColor, I didn't succeed in modifying the style, why?
### Current Behavior
When rendering a treemap node, the custom modification of the node border style is invalid
### Expected Behavior
You can customize the node border style based on the node property values
### Environment
```markdown
- OS:windows 11
- Browser:Chrome 122.0.6261.70
- Framework:React@18.2
```
### Any additional comments?
_No response_
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19665:
URL: https://github.com/apache/echarts/issues/19665#issuecomment-3981027933
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "hantongyou (via GitHub)" <gi...@apache.org>.
hantongyou commented on issue #19665:
URL: https://github.com/apache/echarts/issues/19665#issuecomment-1972406437
I found a way to solve this, however it is not elegant: whether in the data provider API code or in the middle data processing, define data directly by adding "itemStyle"and"borderColor" field at each node data, which means we need to modify backend data structure to achieve this goal. The data would look like this:
```javascript
data = {
name: 'prj-investran-ug',
value: 0.5,
name2: 'https://www.google.com',
"itemStyle":{"borderColor":"red"},
children: [
{
name: 'prj-security-ug',
children: [
{
name: 'converters',
children: [
{ name: 'Converters', value: 721 ,"itemStyle":{"borderColor":"red"}},
{ name: 'DelimitedTextConverter', value: 4294 ,"itemStyle":{"borderColor":"green"}}
]
},
{
name: 'DataUtil',
value: 3322
}
]
},
{
name: 'display', value:1,
children: [
{ name: 'DirtySprite', value: 8833 },
{ name: 'LineSprite', value: 1732 },
{ name: 'RectSprite', value: 3623 }
]
},
{
name: 'flex', value:3333,
children: [{ name: 'FlareVis', value: 4116 }]
}
]
};
```
is there any other way more elegent?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 树状图根据节点属性设置节点边框颜色,粗细等 [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #19665: [Bug] 树状图根据节点属性设置节点边框颜色,粗细等
URL: https://github.com/apache/echarts/issues/19665
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org