:param value: animation json
(self, animation=None)
| 139 | self._chart.setTitleFont(font) |
| 140 | |
| 141 | def __setAnimation(self, animation=None): |
| 142 | ''' |
| 143 | :param value: animation json |
| 144 | ''' |
| 145 | if not animation or not isinstance(animation, dict): |
| 146 | return |
| 147 | # 动画持续时间 |
| 148 | self._chart.setAnimationDuration( |
| 149 | animation.get("duration", 1000) or 1000) |
| 150 | # 设置动画曲线 |
| 151 | self._chart.setAnimationEasingCurve(EasingCurve.get( |
| 152 | animation.get("curve", 10) or 10, None) or QEasingCurve.OutQuart) |
| 153 | # 设置开启何种动画 |
| 154 | self._chart.setAnimationOptions(AnimationOptions.get( |
| 155 | animation.get("options", 0) or 0, None) or QChart.NoAnimation) |
| 156 | |
| 157 | def __setBackground(self, background=None): |
| 158 | ''' |