QtCharts.py 765 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # -----------------------------------------------------------------------------
  3. # Copyright © 2019- The Spyder Development Team
  4. #
  5. # Licensed under the terms of the MIT License
  6. # (see LICENSE.txt for details)
  7. # -----------------------------------------------------------------------------
  8. """Provides QtChart classes and functions."""
  9. # Local imports
  10. from . import PYQT5, PYSIDE2, PythonQtError
  11. if PYQT5:
  12. try:
  13. from PyQt5 import QtChart as QtCharts
  14. except ImportError:
  15. raise PythonQtError('The QtChart module was not found. '
  16. 'It needs to be installed separately for PyQt5.')
  17. elif PYSIDE2:
  18. from PySide2.QtCharts import *
  19. else:
  20. raise PythonQtError('No Qt bindings could be found')