Is it possible to programmatically delete the QValueAxis axis.
At first, I couldn't set the scatters on the candle chart.
The candlestick chart disappeared when the scatter was set.
Default axes were used for the scatter.
I tried setting the axis for the scatter separately and the candlestick chart stopped disappearing.
Now, when I delete the scatter, the axes remain. Is it possible to programmatically delete them.
Below I attach a GIF file for clarity.
https://gifyu.com/image/6Y1R
I asked the same question on stackoverflow.com. https://stackoverflow.com/questions/...re-not-deleted
The code is in Python(Pyqt5), but I can probably understand the code in C++.
Re: Is it possible to programmatically delete the QValueAxis axis.
Can of course try to do this:
Quote:
chart.axisX(serie).setVisible(False)
But will the axes remain in memory?
Re: Is it possible to programmatically delete the QValueAxis axis.
Quote:
But will the axes remain in memory?
Most likely. All you are changing is the visibility status.
Why does it matter whether the memory is freed or not?
Re: Is it possible to programmatically delete the QValueAxis axis.
Quote:
Originally Posted by
d_stranz
Most likely. All you are changing is the visibility status.
Why does it matter whether the memory is freed or not?
I plan to add and remove various series from the chart many times.
Over time, the app will start to hang, work incorrectly, and so on. I think so, but I'm not sure.
I created a GIF where I add scatters many times and then delete them.https://gifyu.com/image/61Mb
You can see that the graph stops changing diagonally.
Although, if I make the axes immediately invisible, then there is no problem with diagonal stretching.
I don't have much programming experience. So I decided to ask about it.
Re: Is it possible to programmatically delete the QValueAxis axis.
Quote:
I plan to add and remove various series from the chart many times.
Over time, the app will start to hang, work incorrectly, and so on. I think so, but I'm not sure.
It shouldn't, if you are using the chart API correctly. If you are actually -removing- series from the plot instead of just making them invisible then python should be freeing up the memory for the items that have been removed. If all you are doing to "remove" a series is to make it invisible, then yes, you are basically forcing python and Qt to allocate more and more memory which will cause your app to bog down and probably eventually crash if you run it long enough..