(self, file)
| 41 | self.initUi(file) |
| 42 | |
| 43 | def initUi(self, file): |
| 44 | if isinstance(file, dict): |
| 45 | return self.__analysis(file) |
| 46 | if isinstance(file, str): |
| 47 | if not os.path.isfile(file): |
| 48 | return self.__analysis(json.loads(file)) |
| 49 | with open(file, "rb") as fp: |
| 50 | data = fp.read() |
| 51 | encoding = chardet.detect(data) or {} |
| 52 | data = data.decode(encoding.get("encoding") or "utf-8") |
| 53 | self.__analysis(json.loads(data)) |
| 54 | |
| 55 | # def onSeriesHoverd(self, point, state): |
| 56 | # print(point, state) |