Skip to content
New issue

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

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

Already on GitHub? # to your account

series-candlestick.markPoint. symbolRotate support the Callback func, But actually NOT! #250

Open
ggz21s opened this issue May 9, 2022 · 0 comments

Comments

@ggz21s
Copy link

ggz21s commented May 9, 2022

The Official documents says, "Callback is supported since 4.8.0 ." BUT I test it doesn't work!

Code like below:

series: [{
            name: this.id,
            type: 'candlestick',
            data: this.klines,
            itemStyle: {
                color: Color.Red,
                color0: Color.Green,
                borderColor: Color.Red,
                borderColor0: Color.Green
            },
            markPoint: {
                symbol: function (value, params) {
                    var trade_type = params.data.trade_type;
                    if (trade_type === TradeType.OPEN_LONG
                        || trade_type === TradeType.OPEN_SHORT) {
                        return "arrow"
                    }
                    if (trade_type === TradeType.CLOSE_LONG
                        || trade_type === TradeType.CLOSE_SHORT) {
                        return "diamond"
                    }
                },
                symbolRotate: -90,  // 负数为顺时针旋转!
                // https://www.jianshu.com/p/9030e06f3fce  #拐点利用箭头显示当时风向
                // symbolRotate: 官方说从4.8.0版本支持回调函数,但测试结果没用啊!
                // symbolRotate: function (value, params) {
                //     // var trade_type = params.data.trade_type;
                //     // if (trade_type === TradeType.CLOSE_LONG
                //     //     || trade_type === TradeType.OPEN_SHORT) {
                //     //     return 180 // 图标翻转180°
                //     // }
                //     return 180
                // },
                symbolSize: 15,
                label: {
                    // 可以设置很多参数,默认就好!
                    formatter: function (params) {
                        // return "";
                        return params.data.desc;
                    }
                },
                itemStyle: {
                    color: Color.Yellow
                },
                data: this.tradePoints
            },
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant