:param background:background json
(self, background=None)
| 155 | animation.get("options", 0) or 0, None) or QChart.NoAnimation) |
| 156 | |
| 157 | def __setBackground(self, background=None): |
| 158 | ''' |
| 159 | :param background:background json |
| 160 | ''' |
| 161 | if not background or not isinstance(background, dict): |
| 162 | return |
| 163 | # 设置是否背景可用 |
| 164 | self._chart.setBackgroundVisible( |
| 165 | background.get("visible", True) or True) |
| 166 | # 设置背景矩形的圆角 |
| 167 | self._chart.setBackgroundRoundness( |
| 168 | background.get("radius", 0) or 0) |
| 169 | # 设置下拉阴影 |
| 170 | self._chart.setDropShadowEnabled( |
| 171 | background.get("dropShadow", True) or True) |
| 172 | # 设置pen |
| 173 | self._chart.setBackgroundPen(self.__getPen( |
| 174 | background.get("pen", None), self._chart.backgroundPen())) |
| 175 | # 设置背景 |
| 176 | image = background.get("image", None) |
| 177 | color = background.get("color", None) |
| 178 | if image: |
| 179 | self._chart.setBackgroundBrush(QBrush(QPixmap(image))) |
| 180 | elif color: |
| 181 | self._chart.setBackgroundBrush(self.__getColor( |
| 182 | color, self._chart.backgroundBrush())) |
| 183 | |
| 184 | def __setMargins(self, margins=None): |
| 185 | ''' |
no test coverage detected