2019-01-20 23:15:10 +08:00
# JKQTPlotter - A Qt Plotting Library
2022-07-29 18:28:10 +08:00
This is an extensive C++ library for data visualization, plotting and charting for Qt (>= 5.0, tested with Qt up to 6.3). It is feature-rich but self-contained and only depends on the [Qt framework ](https://qt.io ).
2015-07-11 23:51:59 +08:00
2018-12-29 00:46:47 +08:00
This software is licensed under the term of the [GNU Lesser General Public License 2.1
2019-01-12 20:43:12 +08:00
(LGPL 2.1)](./LICENSE) or above.
2018-11-25 22:02:55 +08:00
2019-11-24 20:36:27 +08:00
[![Lates Release ](https://img.shields.io/github/v/release/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/releases)
2019-11-24 19:19:37 +08:00
![Language ](https://img.shields.io/github/languages/top/jkriege2/JKQtPlotter )
2022-04-19 04:42:18 +08:00
[![Qt5 ](https://img.shields.io/badge/Qt-5-brightgreen )](https://doc.qt.io/qt-5/)
2022-04-23 02:19:25 +08:00
[![Qt6 ](https://img.shields.io/badge/Qt-6-brightgreen )](https://doc.qt.io/qt-6/)
2019-11-24 19:19:37 +08:00
[![Documentation ](https://img.shields.io/badge/documentation-online-blue )](http://jkriege2.github.io/JKQtPlotter/index.html)
2022-04-21 17:08:29 +08:00
[![Build status ](https://ci.appveyor.com/api/projects/status/vq2o9pfi97isxm2a?svg=true )](https://ci.appveyor.com/project/jkriege2/jkqtplotter)
2019-11-24 19:19:37 +08:00
2019-11-24 19:57:03 +08:00
[![Commit Activity ](https://img.shields.io/github/commit-activity/m/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/pulse)
[![Last Commit ](https://img.shields.io/github/last-commit/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/pulse)
[![Contributors ](https://img.shields.io/github/contributors/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/graphs/contributors)
2019-11-24 19:19:37 +08:00
[![Open Issues ](https://img.shields.io/github/issues/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/issues)
[![Closed Issues ](https://img.shields.io/github/issues-closed/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/issues?q=is%3Aissue+is%3Aclosed)
2019-11-24 19:57:03 +08:00
2019-11-24 19:19:37 +08:00
[![Open PRs ](https://img.shields.io/github/issues-pr/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/pulls)
[![Closed PRs ](https://img.shields.io/github/issues-pr-closed/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/pulls?q=is%3Apr+is%3Aclosed)
2022-04-21 18:25:03 +08:00
[![CodeQL ](https://github.com/jkriege2/JKQtPlotter/actions/workflows/codeql-analysis.yml/badge.svg )](https://github.com/jkriege2/JKQtPlotter/actions/workflows/codeql-analysis.yml)
2024-01-10 05:14:21 +08:00
[![MSVC-CodeAnalysis ](https://github.com/jkriege2/JKQtPlotter/actions/workflows/msvc-codeanalysis.yml/badge.svg )](https://github.com/jkriege2/JKQtPlotter/actions/workflows/msvc-codeanalysis.yml)
2020-08-14 22:21:32 +08:00
2024-02-09 18:59:22 +08:00
[![EXAMPLES-Page ](./screenshots/examplesbanner.png )](https://jkriege2.github.io/JKQtPlotter/example_tutorial_projects.html)
2019-11-24 19:58:52 +08:00
2019-01-14 00:18:27 +08:00
## Main Features
2022-07-29 18:48:19 +08:00
- 2D Plotter widget class [JKQTPlotter ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter.html ):
2019-01-14 00:18:27 +08:00
- high-quality plotting
2022-04-23 02:19:25 +08:00
- no other dependencies than Qt >= 5.0 ([CImg](https://cimg.eu/) and [OpenCV ](https://opencv.org/ ) are optional dependencies)
2019-01-14 00:18:27 +08:00
- highly customizable axes/grids (linear/log, date/time, custom ticks ...)
2022-07-16 19:06:59 +08:00
- [JKQTMathText: ](http://jkriege2.github.io/JKQtPlotter/group__jkqtmathtext.html ) integrated LaTeX parser (pure C++, no dependencies) to render mathematical equations in axis labels, ticks, ...
2019-01-14 00:18:27 +08:00
- extensive user-interactions pre-programmed (several zooming modes, selecting regions, custom context menus, switch graph visibility, ...)
- full print and export (PDF,PNG,...) support with preview and parametrization out-the-box
2022-07-29 18:48:19 +08:00
- [highly customizable look and feel ](http://jkriege2.github.io/JKQtPlotter/group__jkqtpplotter__styling.html )
2019-01-14 00:18:27 +08:00
- supports the Qt layout system for graphs and allows to symchronize several graphs with each other
2022-07-29 18:48:19 +08:00
- [centralized data management ](http://jkriege2.github.io/JKQtPlotter/group__jkqtpdatastorage.html ) in an internal datastore [JKQTPDatastore ](http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_datastore.html ):
2019-01-14 00:18:27 +08:00
- data organized by columns, can also represent image data (ropw-major)
- allows to reuse a column in several graphs
- access via Qt's model view framework
- external or internal datasets
- complete with GUI (table view)
- export capabilities (e.g. to CSV, SYLK, ...)
2019-05-30 04:47:26 +08:00
- C++ standard iterator interface
2022-07-29 18:48:19 +08:00
- [statistics library ](http://jkriege2.github.io/JKQtPlotter/group__jkqtcommon__statistics__and__math.html ) (basic statistics, boxplots, histograms, kernel density estimates, regression analysis, polynomial fitting)
2024-02-09 05:06:02 +08:00
- large variety of [graphs ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__concretegraphs.html ) that can be added to a plot, e.g.:
- [scatter plot ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__linesymbolgraphs__scatter.html ) and [parametrized scatter plots (e.g. bubble charts) ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__linesymbolgraphs__param.html )
- [line graphs ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__linesymbolgraphs__line.html ), [step graphs ](http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_special_line_horizontal_graph.html ), [impulses ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__sticks.html )
2022-07-29 18:48:19 +08:00
- [filled curves ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__filledgraphs.html )
2024-02-09 05:06:02 +08:00
- [barcharts ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__barcharts.html ) (also stacked)
2022-07-29 18:48:19 +08:00
- extensive support for different [styles of error indicators ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__basegraphserrors.html )
2024-02-09 05:06:02 +08:00
- [integrated mathematical function parser ](http://jkriege2.github.io/JKQtPlotter/group__jkqtptools__math__parser.html ) for [parsed function plots ](https://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_x_parsed_function_line_graph.html ) (with intelligent rendering algorithm)
2022-07-29 18:48:19 +08:00
- line/scatter graphs can also be [based on C/C++ functions ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__functiongraphs.html ) instead of data series (C++11 support!)
- [statistical plots) ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__statgraphs.html ) (e.g. boxplots, violinplots, ...)
- large variety of [image plots ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__imagelots.html ) (inclusing different color-scale modes, RGBA-plots, overlays/masks)
2024-02-09 05:06:02 +08:00
- [contour plots ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__imagelots__contour.html )
- [vector field graphs/quiver plots ](https://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__vectorfieldgraphs.html )
2022-07-29 18:48:19 +08:00
- [geometric forms ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__geoplots.html ) / [annotations ](http://jkriege2.github.io/JKQtPlotter/group__jkqtplotter__annotations.html )
- can be easily extended by deriving a new graph from [JKQTPPlotElement ](http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_plot_element.html ), [JKQTPPlotAnnotationElement ](http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_plot_annotation_element.html ), [JKQTPGeometricPlotElement ](http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_geometric_plot_element.html ), [JKQTPGraph ](http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_graph.html )
- optional: [OpenCV interface ](http://jkriege2.github.io/JKQtPlotter/group__jkqtpinterfaceopencv.html ), [CImg interfaces ](http://jkriege2.github.io/JKQtPlotter/group__jkqtpinterfacecimg.html )
2019-06-21 04:38:51 +08:00
- CMake-based build system
2024-02-09 05:06:02 +08:00
- extensive set of [Examples/Tutorials ](https://jkriege2.github.io/JKQtPlotter/example_tutorial_projects.html )
2019-01-21 16:31:13 +08:00
- extensive doxygen-generated [Documentation ](http://jkriege2.github.io/JKQtPlotter/index.html )
2018-12-21 22:31:56 +08:00
2019-01-21 16:30:57 +08:00
## [Documentation](http://jkriege2.github.io/JKQtPlotter/index.html)
2019-01-13 16:35:35 +08:00
A Documentation (auto-)generated with [doxygen ](http://www.doxygen.nl/ ) from the trunk source code can be found here:
2019-01-21 16:30:57 +08:00
**[http://jkriege2.github.io/JKQTPlotter/index.html](http://jkriege2.github.io/JKQtPlotter/index.html)**
2019-01-13 16:35:35 +08:00
2022-07-16 19:06:59 +08:00
There are also some subpage of general intetest:
- [TODO List ](http://jkriege2.github.io/JKQtPlotter/page_todo.html )
- [Release Notes & Version Overview ](http://jkriege2.github.io/JKQtPlotter/page_whatsnew.html )
2024-02-09 05:06:02 +08:00
## [Examples](https://jkriege2.github.io/JKQtPlotter/example_tutorial_projects.html)
2024-02-09 18:59:22 +08:00
[![EXAMPLES-Page ](./screenshots/examplesbanner.png )](https://jkriege2.github.io/JKQtPlotter/example_tutorial_projects.html)
2024-02-09 05:06:02 +08:00
There is a [large set of usage examples (with explanations for each) and tutorials ](https://jkriege2.github.io/JKQtPlotter/example_tutorial_projects.html ) in the folder [`./examples/` ](./examples ).
All test-projects are Qt-projects that use tcmake to build. Some of them are also available with additional qmake build-files.
2018-11-27 05:35:21 +08:00
2024-02-09 18:49:05 +08:00
In addition: The [Screenshots-folder ](./screenshots/ ) contains several screenshots, partly taken from the provided examples, but also from other software using this libarary (e.g. [QuickFit 3.0 ](https://github.com/jkriege2/QuickFit3 ))
2019-01-12 21:15:08 +08:00
2024-01-18 03:42:12 +08:00
## Building Using CMake
2019-06-22 20:21:32 +08:00
2019-11-24 20:36:27 +08:00
[![Lates Release ](https://img.shields.io/github/v/release/jkriege2/JKQtPlotter )](https://github.com/jkriege2/JKQtPlotter/releases)
2022-04-23 02:54:13 +08:00
JKQTPlotter contains two different build systems: A modern [CMake ](https://cmake.org/ )-based build and an older (and deprecated!) QMake-based build (which works out of the box with Qt 5.x and QT 6.x). Both systems are explained in detail in http://jkriege2.github.io/JKQtPlotter/page_buildinstructions.html.
2019-06-22 20:21:32 +08:00
With [CMake ](https://cmake.org/ ) you can easily build JKQTPlotter and all its examples, by calling something like:
2019-06-21 04:44:42 +08:00
```
$ mkdir build; cd build
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
$ cmake .. -G "< cmake_generator > " "-DCMAKE_PREFIX_PATH=< path_to_your_qt_sources > " "-DCMAKE_INSTALL_PREFIX=< where_to_install > "
2019-06-22 20:21:32 +08:00
$ cmake --build . --config "Debug"
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
$ cmake --install . --config "Debug"
2019-06-21 04:44:42 +08:00
```
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
This will create CMake targets, which you can easily link against. For the main plotter library, the target's name is \c JKQTPlotter5::JKQTPlotter5 or \c JKQTPlotter6::JKQTPlotter6 depending on the Qt-Version you use. You can then simmply link against this via:
```
find_package(JKQTPlotter6 REQUIRED)
target_link_libraries(${PROJECT_NAME} JKQTPlotter6::JKQTPlotter6)
```
or on a Qt-version agnostic way via:
```
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
target_link_libraries(${PROJECT_NAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
```
2024-01-16 21:14:43 +08:00
See https://jkriege2.github.io/JKQtPlotter/page_buildinstructions__c_m_a_k_e.html for details.
2022-11-08 22:21:33 +08:00
2024-01-18 03:42:12 +08:00
## Usage via CMake's FetchConten-API
In addition to the method described above (i.e. build and install the library and then use it), you can also use JKQTPlotter via CMake's [FetchContent-API ](https://cmake.org/cmake/help/latest/module/FetchContent.html ).
For this method, you need to add these lines to your CMake project:
```
include(FetchContent) # once in the project to include the module
# ... now declare JKQTPlotter5/6
FetchContent_Declare(JKQTPlotter${QT_VERSION_MAJOR}
GIT_REPOSITORY https://github.com/jkriege2/JKQtPlotter.git
# GIT_TAG v5.0.0)
# ... finally make JKQTPlotter5/6 available
FetchContent_MakeAvailable(JKQTPlotter${QT_VERSION_MAJOR})
```
These declare JKQTPlotter and make it available in your project. Afterwards you should be able to link against it, using
```
target_link_libraries(${PROJECT_NAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
```
2022-11-08 22:21:33 +08:00
## Stargazers over time
[![Stargazers over time ](https://starchart.cc/jkriege2/JKQtPlotter.svg )](https://starchart.cc/jkriege2/JKQtPlotter)