Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 单独设置每根蜡烛图的颜色 #555

Closed
ooyeah opened this issue Apr 28, 2024 · 2 comments
Closed

[Feature] 单独设置每根蜡烛图的颜色 #555

ooyeah opened this issue Apr 28, 2024 · 2 comments

Comments

@ooyeah
Copy link

ooyeah commented Apr 28, 2024

需求描述

希望每根K线可以自定义颜色,这样可以实现不同波段显示不同的颜色。

image

具体实现

增加颜色作为数据项一起传进去设置单个蜡烛图的颜色

// 为图表添加数据
chart.applyNewData([
{ color: '#FF0000', close: 4976.16, high: 4977.99, low: 4970.12, open: 4972.89, timestamp: 1587660000000, volume: 204 },
{ color: '#AAAAAA', close: 4977.33, high: 4979.94, low: 4971.34, open: 4973.20, timestamp: 1587660060000, volume: 194 },
])

@ooyeah ooyeah changed the title [Feature] 每根蜡烛图可以单独设置颜色 [Feature] 单独设置每根蜡烛图的颜色 Apr 28, 2024
@liihuu
Copy link
Member

liihuu commented Apr 28, 2024

可以用自定义指标覆盖原有的k线柱实现

@liihuu liihuu closed this as completed May 27, 2024
@yokiyokiyoki
Copy link

我是建议 可以用函数实现这个style里面样式,传参可以当前柱子,下个柱子,价格这些(参考echarts),然后里面的颜色可以动态算出来。自义定指标有点过于麻烦了..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants