MCPcopy Create free account
hub / github.com/KDAB/KDChart

github.com/KDAB/KDChart @kdchart-3.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release kdchart-3.0.0 ↗ · + Follow
4,306 symbols 12,085 edges 521 files 536 documented · 12% updated 8d agokdchart-3.0.0 · 2022-08-28★ 1746 open issues

Browse by type

Functions 3,538 Types & classes 768
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

KDChart and Python bindings

These are the instructions for building the Python bindings for KDChart.

Starting with version 2.7.0 KD Chart can build Python3 bindings.

Currently unsupported:

Also, there are no plans to support the qmake buildsystem.

Prerequisites

You will need:

  • a compiler with C++14 support
  • Python3.6 or higher
  • Qt 5.15 or higher
  • QtForPython provided by the Qt project.

Install PySide2 for Qt5

Make sure you have PySide2, shiboken2 and shiboken2-generator installed. As this time, you cannot get shiboken2-generator because the wheels are not on PyPi. To use the wheels do this:

% pip3 install \
    --index-url=http://download.qt.io/official_releases/QtForPython/ \
    --trusted-host download.qt.io \
    shiboken2 pyside2 shiboken2_generator

For QtForPython you must use the exact same Qt version used when building KD Chart.

For more info visit https://doc.qt.io/qtforpython/shiboken2/gettingstarted.html

afterwards run:

pip3 list | grep PySide

Note the version must match the same Qt you intend to use when building KD Chart.

Install PySide6 for Qt6

Follow the same instructions as the previous section, except installing shiboken6 pyside6 shiboken6_generator with pip3.

Building KDChart Python Bindings

Tell CMake to build the bindings by passing the -DKDChart_PYTHON_BINDINGS=True' option. Then runcmake --build` as usual.

The bindings will be installed to CMAKE_INSTALL_PREFIX, which might require setting the PYTHONPATH env variable to point to that path when running applications.

For example, if you install to the default location on linux you would:

  export PYTHONPATH=/usr/local/KDAB/KDChart-3.0.0/lib64/python3.10/site-packages

Alternatively, configure the bindings install location by passing (for example) -DKDChart_BINDINGS_INSTALL_PREFIX=/usr/lib/python3.8/site-packages to CMake and adjust to the PYTHONPATH accordingly, as necessary.

Build Issues

  • If you see errors like "Unable to locate Clang's built-in include directory" then first mROUBLESHOOTINGake sure you have llvm installed. If you still have problems try setting the environment variable LLVM_INSTALL_DIR to point to your llvm installation.

Examples:

    export LLVM_INSTALL_DIR=/usr/local/opt/llvm-11
    set "LLVM_INSTALL_DIR=C:\Program Files\LLVM" #Windows
  • When building the examples you may encounter errors loading shared libraries from shiboken2_generator.

Try:

    export LD_LIBRARY_PATH=/usr/local/lib/python/dist-packages/PySide2/Qt/lib #linux
    export DYLD_LIBRARY_PATH=/usr/local/lib/python/dist-packages/PySide2/Qt/lib #Mac
    (Adjust to wherever your PySide is installed)
  • On Windows the libclang.dll that ship with QtForPython is not compatible with MSVC2019. To fix this, copy the libclang.dll that comes with llvm into shiboken2, like so:
    cd C:\Python37\Lib\site-packages\shiboken2_generator
    copy libclang.dll libclang.dll.save
    copy "C:\Program Files\llvm\bin\libclang.dll" libclang.dll
    (Python3 installation in C:\Python37 and llvm in c:\Program Files\llvm. adjust as needed)

Core symbols most depended-on inside this repo

Shape

Method 3,264
Class 726
Function 274
Enum 42

Languages

C++95%
Python5%

Modules by API surface

src/KDChart/KDChartLegend.cpp93 symbols
src/KDChart/KDChartChart.cpp88 symbols
src/KDGantt/kdganttdatetimegrid.cpp79 symbols
src/KDChart/Cartesian/KDChartCartesianCoordinatePlane.cpp71 symbols
src/KDGantt/kdganttgraphicsscene.cpp68 symbols
src/KDChart/KDChartAbstractDiagram.cpp68 symbols
src/KDGantt/kdganttgraphicsview.cpp53 symbols
src/KDChart/Cartesian/KDChartCartesianAxis.cpp52 symbols
src/KDChart/KDChartLayoutItems.cpp46 symbols
src/KDChart/Cartesian/KDChartLeveyJenningsDiagram.cpp45 symbols
src/KDChart/KDChartWidget.cpp44 symbols
src/KDGantt/kdganttview.cpp43 symbols

For agents

$ claude mcp add KDChart \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page