MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / updateStyle

Function updateStyle

libs/echarts/echarts.simple.js:42610–42649  ·  view source on GitHub ↗
(
    el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar
)

Source from the content-addressed store, hash-verified

42608}
42609
42610function updateStyle(
42611 el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar
42612) {
42613 var color = data.getItemVisual(dataIndex, 'color');
42614 var opacity = data.getItemVisual(dataIndex, 'opacity');
42615 var stroke = data.getVisual('borderColor');
42616 var itemStyleModel = itemModel.getModel('itemStyle');
42617 var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle();
42618
42619 if (!isPolar) {
42620 el.setShape('r', itemStyleModel.get('barBorderRadius') || 0);
42621 }
42622
42623 el.useStyle(defaults(
42624 {
42625 stroke: isZeroOnPolar(layout) ? 'none' : stroke,
42626 fill: isZeroOnPolar(layout) ? 'none' : color,
42627 opacity: opacity
42628 },
42629 itemStyleModel.getBarItemStyle()
42630 ));
42631
42632 var cursorStyle = itemModel.getShallow('cursor');
42633 cursorStyle && el.attr('cursor', cursorStyle);
42634
42635 var labelPositionOutside = isHorizontal
42636 ? (layout.height > 0 ? 'bottom' : 'top')
42637 : (layout.width > 0 ? 'left' : 'right');
42638
42639 if (!isPolar) {
42640 setLabel(
42641 el.style, hoverStyle, itemModel, color,
42642 seriesModel, dataIndex, labelPositionOutside
42643 );
42644 }
42645 if (isZeroOnPolar(layout)) {
42646 hoverStyle.fill = hoverStyle.stroke = 'none';
42647 }
42648 setHoverStyle(el, hoverStyle);
42649}
42650
42651// In case width or height are too small.
42652function getLineWidth(itemModel, rawLayout) {

Callers 1

echarts.simple.jsFile · 0.70

Calls 6

defaultsFunction · 0.70
isZeroOnPolarFunction · 0.70
setLabelFunction · 0.70
setHoverStyleFunction · 0.70
getModelMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected