linghaoSu commented on code in PR #20105:
URL: https://github.com/apache/echarts/pull/20105#discussion_r1672410954
##########
src/chart/candlestick/CandlestickView.ts:
##########
@@ -294,6 +295,19 @@ function setBoxCommon(el: NormalBoxPath, data: SeriesData,
dataIndex: number, is
el.__simpleBox = isSimpleBox;
setStatesStylesFromModel(el, itemModel);
+
+ const sign = data.getItemLayout(dataIndex).sign;
+ zrUtil.each(el.states, (state, stateName) => {
+ const stateModel = itemModel.getModel(stateName as any);
+ const color = getColor(sign, stateModel);
+ const borderColor = getBorderColor(sign, stateModel) || color;
+ const stateStyle = state.style || (state.style = {});
+ color && (stateStyle.fill = color);
+ borderColor && (stateStyle.stroke = borderColor);
+ });
+
+ const emphasisModel = itemModel.getModel('emphasis');
+ toggleHoverEmphasis(el, emphasisModel.get('focus'),
emphasisModel.get('blurScope'), emphasisModel.get('disabled'));
Review Comment:
看到 barView 中的写法如下
https://github.com/apache/echarts/blob/e4061f69e6eb38cccf0ca5d1c99fb48414e871df/src/chart/bar/BarView.ts#L1059-L1061
因此做了一下修改
```suggestion
const emphasisModel = itemModel.getModel('emphasis');
toggleHoverEmphasis(el, emphasisModel.get('focus'),
emphasisModel.get('blurScope'), emphasisModel.get('disabled'));
setStatesStylesFromModel(el, itemModel);
```
似乎结果是一样的?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]