MCPcopy
hub / github.com/apache/echarts / setBoxCommon

Function setBoxCommon

src/chart/candlestick/CandlestickView.ts:299–324  ·  view source on GitHub ↗
(el: NormalBoxPath, data: SeriesData, dataIndex: number, isSimpleBox?: boolean)

Source from the content-addressed store, hash-verified

297}
298
299function setBoxCommon(el: NormalBoxPath, data: SeriesData, dataIndex: number, isSimpleBox?: boolean) {
300 const itemModel = data.getItemModel(dataIndex) as Model<CandlestickDataItemOption>;
301
302 el.useStyle(data.getItemVisual(dataIndex, 'style'));
303 el.style.strokeNoScale = true;
304
305 const cursorStyle = itemModel.getShallow('cursor');
306 cursorStyle && el.attr('cursor', cursorStyle);
307
308 el.__simpleBox = isSimpleBox;
309
310 setStatesStylesFromModel(el, itemModel);
311
312 const sign = data.getItemLayout(dataIndex).sign;
313 zrUtil.each(el.states, (state, stateName) => {
314 const stateModel = itemModel.getModel(stateName as any);
315 const color = getColor(sign, stateModel);
316 const borderColor = getBorderColor(sign, stateModel) || color;
317 const stateStyle = state.style || (state.style = {});
318 color && (stateStyle.fill = color);
319 borderColor && (stateStyle.stroke = borderColor);
320 });
321
322 const emphasisModel = itemModel.getModel('emphasis');
323 toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));
324}
325
326function transInit(points: number[][], dim: number, itemLayout: CandlestickItemLayout) {
327 return zrUtil.map(points, function (point) {

Callers 2

_renderNormalMethod · 0.85

Calls 11

setStatesStylesFromModelFunction · 0.90
getColorFunction · 0.90
getBorderColorFunction · 0.90
toggleHoverEmphasisFunction · 0.90
getItemModelMethod · 0.80
getShallowMethod · 0.80
getItemLayoutMethod · 0.80
getItemVisualMethod · 0.45
eachMethod · 0.45
getModelMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…