Qt Graphs. Building 2d plot using c++ only.
-
-
The former Qt Chart module is now called (and transferred to) Qt Graphs, which includes 2D, 3D plotting and has a C++ as well as a QML interface.
So for 2D plotting in C++, either :
or the "old":
-
@Pl45m4 They are about using Qt Charts, not about Qt Graphs. I saw https://doc.qt.io/qt-6/graphs-examples-2d.html. They all are about using Qt Graphs from qml side. They use https://doc.qt.io/qt-6/qml-qtgraphs-graphsview.html as the main type for showing a plot. I tried to find its C++ representation and did not find it. That is why I started this topic. Is it possible to build 2d in C++ using Qt Graphs?
-
@Vernat said in Qt Graphs. Building 2d plot using c++ only.:
Is it possible to build 2d in C++ using Qt Graphs?
Yes, just look at the module documentation and the C++ classes. That's what I said above.
But AFAICS there are no Qt Graph C++ Examples yet.
Most 2D plotting is still in QtCharts. As you can read there, the module is under maintenance.
Most parts will be moved to the new QtGraphs, which unites QML, C++, 2D and 3D plotting. -
Note: The Qt Charts module is in the maintenance phase. For new projects, consider using the Qt Graphs module. To render 2D charts, QtGraphs uses Qt Quick Shapes, which is a more modern GUI technology compared to the outdated Qt Graphics View Framework used by the Qt Charts module.
( https://doc.qt.io/qt-6/qtcharts-index.html )You said you don't want to deal with QML, but in the future the backend and how Graphs are rendered will be QML even in C++ use cases.
@Vernat said in Qt Graphs. Building 2d plot using c++ only.:
QValueAxis from the charts is not the same as QValueAxis from the graphs.
What is different?
Make your own axis?!I hope it will be fixed
I don't think they will revert "improvements" to where it was before in QtChart with GraphicsView backend/rendering.