QtCharts: dynamic updation
-
I am new in Qt trying to display SNR values of satellites using Qbarsets, The data is read from serial input continously, the problem is instead of refreshing the Barsets gets appended in chartview means earlier if data was for 7 satellites, then more 7 series lines gets added in my chart, i want to just keep only 7 lines with new values whatever i am getting from serial input. i hope question is understood, i cannot paste my output or code here, i tried removing and then adding series but that didn't worked, there is accumalation of bar lines however i want to keep only satellites whose SNR is available but in chart data is accumalating.
-
Clear your series first, then append.
Can't be 100% sure without seeing code but that is my guess.
It may be more complicated then that on your end but the idea is that appending is adding more data, as where you want to delete the old values and refresh with new ones.
-
@MrShawn said in QtCharts: dynamic updation:
be 100% sure without seeing code but that is my gues
when i clear my series i gets sigsev error segmentation fault and when tried debugging that its shows the barsets that i created gets completely emptied and has nothing in it as seen in values and expression table so it doesnot adds new values and returns error
-
@MrShawn said in QtCharts: dynamic updation:
It may be more complicated then that on your end but the idea is that appending is adding more data, as where you want to delete the old values and refresh with new ones.
one more thing the plot starts coming from right side and moves towards left and next time same data gets added on right, as i am updating chart while getting data in continous manner, so why data is coming from right in chart why not it appears directly in centre occupying whole area, what could be wrong, i am using basic add series code and for sets i have declared a Qvector that takes say N sets in which i am feeding data
of satellite SNR. -
well i have solved the issue by declaring new Qbarset again after clearing off the series.
now i have one more problem since i have 32 satellites to look for every time i am not getting SNR values for each satellite. i want to attach labels on x axis for which satellite has got snr corresponding to barset value, so x axis will be dynamic and values keep changing depending on for which satelllite i am getting SNR values during particular time. if anybody having any idea it will be of great help to me.