| 172 | self.lineItem.hide() |
| 173 | |
| 174 | def handleMarkerClicked(self): |
| 175 | marker = self.sender() # 信号发送者 |
| 176 | if not marker: |
| 177 | return |
| 178 | bar = marker.barset() |
| 179 | if not bar: |
| 180 | return |
| 181 | # bar透明度 |
| 182 | brush = bar.brush() |
| 183 | color = brush.color() |
| 184 | alpha = 0.0 if color.alphaF() == 1.0 else 1.0 |
| 185 | color.setAlphaF(alpha) |
| 186 | brush.setColor(color) |
| 187 | bar.setBrush(brush) |
| 188 | # marker |
| 189 | brush = marker.labelBrush() |
| 190 | color = brush.color() |
| 191 | alpha = 0.4 if color.alphaF() == 1.0 else 1.0 |
| 192 | # 设置label的透明度 |
| 193 | color.setAlphaF(alpha) |
| 194 | brush.setColor(color) |
| 195 | marker.setLabelBrush(brush) |
| 196 | # 设置marker的透明度 |
| 197 | brush = marker.brush() |
| 198 | color = brush.color() |
| 199 | color.setAlphaF(alpha) |
| 200 | brush.setColor(color) |
| 201 | marker.setBrush(brush) |
| 202 | |
| 203 | def handleMarkerHovered(self, status): |
| 204 | # 设置bar的画笔宽度 |