(
el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar
)
| 42608 | } |
| 42609 | |
| 42610 | function 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. |
| 42652 | function getLineWidth(itemModel, rawLayout) { |
no test coverage detected