You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/05/17 07:30:52 UTC

[GitHub] [echarts] magicdict opened a new issue #14964: 能否修改一下类型定义文件

magicdict opened a new issue #14964:
URL: https://github.com/apache/echarts/issues/14964


   ### Version
   5.1.1
   
   ### Steps to reproduce
   我现在想开发一个能够灵活生成Option的第三方库,所以使用了@types/echarts这个类型定义库。
   大部分类型定义都很好,确实不需要我再次定义类型了。但是,有一些功能可以考虑加入。
   
   例如,其实echarts是支持一个color属性为一个fn(parm)=>string的,这个在bar类型,不同bar显示不同颜色的时候非常有用。
   但是在@types/echarts的itemStyle里面,EChartOption.Color的定义如下
   type Color = string | LinearGradient | RadialGradient | Texture;
   这样的话,我不知道怎么将一个fn赋予Color。
   
     getColor(params: any):string {
       //定义一个颜色集合
       var colorList = ChartColor.colorlist_7_Baidu;
       //对每个bar显示一种颜色
       return colorList[params.dataIndex];
     }
   
   能不能将这个定义稍微修改一下,能够让二次开发者实现更多的功能呢。
   
   ### What is expected?
   Color无法使用FN
   
   ### What is actually happening?
   Color无法使用FN
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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.

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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14964: 能否修改一下类型定义文件

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14964:
URL: https://github.com/apache/echarts/issues/14964#issuecomment-842083048






-- 
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.

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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14964: 能否修改一下类型定义文件

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14964:
URL: https://github.com/apache/echarts/issues/14964#issuecomment-842083048






-- 
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.

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


[GitHub] [echarts] magicdict commented on issue #14964: 能否修改一下类型定义文件

Posted by GitBox <gi...@apache.org>.
magicdict commented on issue #14964:
URL: https://github.com/apache/echarts/issues/14964#issuecomment-842106792


   在定义里面,有些属性确实是允许Function的,例如emphasis的formatter?: Function | string;
   这里的差异到底是怎么回事?能不能吧支持function的属性都补全呢?


-- 
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.

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


[GitHub] [echarts] magicdict commented on issue #14964: 能否修改一下类型定义文件

Posted by GitBox <gi...@apache.org>.
magicdict commented on issue #14964:
URL: https://github.com/apache/echarts/issues/14964#issuecomment-842106792


   在定义里面,有些属性确实是允许Function的,例如emphasis的formatter?: Function | string;
   这里的差异到底是怎么回事?能不能吧支持function的属性都补全呢?


-- 
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.

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