QCharts provides various 2D chart types to be used within Qt Widgets or Qt Quick applications.
Questions tagged [qchart]
120 questions
3
votes
1 answer
How to change QLineSeries width?
I need to set width of QLineSeries
I do
QPen pen = series->pen();
pen.setWidth(1);
series->setPen(pen);
And it works but color is changed to black. What do I need to do to set only the width?

Ufx
- 2,595
- 12
- 44
- 83
3
votes
2 answers
Can't properly save QChartView as image when using QLineSeries with openGL on
i am trying to create an application which can plot large data sets (so using of OpenGl is important to me). I use QChartView, QChart and QLineSeries. Also for QLineSeries i turn using openGL on. But when i'm trying to save chart as an image i get…

monkeber
- 73
- 2
- 5
3
votes
1 answer
Qt setUseOpenGL(true) and removeSeries() do not update QChart
The Problem
I'm using a Qt LineChart, this QLineChart can load and remove data without a problem on CPU rendering. However, QChart removeSeries() does not update my QLineChart properly when using setUseOpenGL(true). The removed data is still visible…

Thomas V
- 33
- 3
2
votes
0 answers
No viable conversion from 'QCharRef' to 'QString' for 1st argument of QPieSlice in Qt Creator
I have a QStringlist "word" and a Qstring "a" which is one element of word. I want to insert "a" as a label for QPieSlice but I got the following error. Any idea?
error: No viable conversion from 'QCharRef' to 'QString'
How can I convert QCharRef to…

mahya
- 51
- 4
2
votes
0 answers
Export QChartView with specific size independent of widget size
I try to save QChartView in pdf file format.
void ExportResult::printAsPdf(QString fileName, QChartView* chartView)
{
QPrinter printer(QPrinter::ScreenResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setFullPage(true);
…

Abolfazl Diyanat
- 397
- 2
- 13
2
votes
1 answer
How to add subplots in QtCharts?
I need to create two graphs (subplots, synchronous) and set the dimensions as follows:
the upper graph is 75% of the output area
and the lower graph is 25% of the height of the output area.
Something like this sketch.
One chart is easy to create…

paradoxarium
- 177
- 1
- 12
2
votes
1 answer
QCharts Crop to Rectangle and Use Horizontal Scroll
am trying to implement a custom graph going off the QtCharts Callout example. I want to restrict the selection of the chart to a specific area and make it possible to scroll horizontally while still displaying the Axis Values.
the classes i am using…

BigL
- 165
- 1
- 2
- 15
2
votes
2 answers
Getting PySide2 QCharts to show up when using Qt Designer
I've have a similar problem to the question here: How to insert QChartView in form with Qt Designer?
So I created my MainWindow of my UI in Qt Designer and I'm trying to get a QtChart to show up inside one of the tabs in my window. I'm importing the…

AWheeler
- 23
- 1
- 8
2
votes
2 answers
How to Set the Color of a Bar in a QBarSet?
I have an horizontal bar chart with a single QBarSet that looks like this:
I want to individually set the color of each bar of the QBarSet. Is there any way this could be done?
I know I could use 3 separate QBarSet instead of one and set the color…

mathlizee
- 185
- 2
- 12
2
votes
1 answer
QChart Line exceed the boundary when the window first start to show?
In my app, i need to draw a line when user move mouse. But when the chart window first showing and move mouse, the line exceed boundary. The i resize window, it work ok. i don't know why first start window it not work fine, it's seem that there is…

jett chen
- 1,067
- 16
- 33
2
votes
1 answer
How to disable right click action when using QRubberBand?
Whenever I press the right-click button, it sort of zooms out a little instead I want to restore the initial position of my QChart whenever I press the Right-Click. Is there a way to do this?

Prashant Kumar
- 33
- 4
2
votes
1 answer
QChart how to get points that are displayed while zoomed in
The QChart contains some series.
Is it possible to retrieve the list of points that are currently visible on the chart while the chart is zoomed in ?
Means getting a list/vector of point of the actually displayed points.
Digested and simplified…

Damien
- 1,492
- 10
- 32
2
votes
1 answer
QLineSeries and QDateTimeAxis - Chart doesn't display values
I am trying to achieve something like https://doc.qt.io/qt-5.9/qtcharts-datetimeaxis-example.html .
In a method I have this code
QDateTime past = QDateTime::currentDateTime().addMonths(-10);
QDateTime now = QDateTime::currentDateTime();
qreal…

vdomanico
- 23
- 1
- 4
2
votes
1 answer
QChart log axis data not shown
I have a 2Y Axis plo with a QValueAxison the y1 and QLogValueAxis on y2.
The linear plot is shown, the log plot is not shown. The data for both is the same.
I wonder how to set up the ticks and limits for the log axis?
This is the code:
chart = new…

Matthias Pospiech
- 3,130
- 18
- 55
- 76
2
votes
2 answers
QChart unresponsive with large data set
I have this code which works well for data sizes up to 1000. Now I tested it with 65536 points.
series = new QLineSeries();
QList points;
points.reserve(data.size());
for(std::vector::size_type i = 0; i != data.size(); i++) {
…

Matthias Pospiech
- 3,130
- 18
- 55
- 76