Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Hi, i need to create something like this:
There are two axis, and the values are dependent by the specific values on the axis, and the curve, i don't have any idea how to create it, since i need to fill the values one by another, and there can be an infinitive amount of them, it's something like coordination system, if someone could give me any idea how to do it, most likely i don't need any widgets to show it, because it will be all "virtual".
This post is deleted!
@jsulm Ok i try with that, but i think i will need some help, depends.
@jsulm If i just add QT += charts, then i get the error, there is no module like that, i have Qt 5.23.
One more thing, like i said, i don't have to show it, i just need to generate the data.
@Loc888 Qt Charts is not part of a standard Qt set-up. You need to install it first (use Qt Maintenance Tool for that).
@jsulm Ok, can i generate the data there, or it's it will just show it?
@Loc888 I'm not sure what you mean with "generate the data"?
generate the data ? You mean to want to know of a convenient way to store a pair of varibales in a list?
There are countless ways to do that.
In this object specific case I would suggest using QVector2d as the container for the x/y pair and a simple QVector<QVector2d> as the "list"
@J.Hilk You don't understand what i mean, i explain, if i put into a vector (10,20), (20,40), (40,60), then they are just 6 values in total, in any coordination, when the object moves, there are infinitive combinations.
If i have a line, the length is 50units ok?
The problem is, if someone will point somewhere in the middle, then where it is? It's something close to 25unit of 50, because the total length is 50, but there are a lot of combinations, and if i wanna use any decimal points, then i just can't add to the vector 500000 values, i need something to "generate it".
What i want is, somebody points in the middle of the line, middle is 25, half of that distance is 12.5, beginning is 0 and the end is 50, and keep going, wherever somebody points, i get the coordination, i don't want a fixed size vector.
The chart you have shown does not have straight lines between the points.
Is that really the case or will it be straight lines ?
@mrjj Idk what you mean, and it doesn't matter, because like i said, i am not gonna do any chart, before i have the data.
If the lines are indeed straight between the point you can use
a formula to calculate the any Y from a given x.
@mrjj Doesn't matter, i did +/- what i want. I wanted something like this:
Object is at 25000, speed of movement is 30u/s, if the speed is > 50, the deceleration will be -0,50u for example.
Then move it, that's what i get:
New deceleration: -0.00734294 for: 33.1444
New deceleration: -0.00734131 for: 33.1371
New deceleration: -0.00733968 for: 33.1297
New deceleration: -0.00733806 for: 33.1224
New deceleration: -0.00733643 for: 33.1151
New deceleration: -0.00733481 for: 33.1077
New deceleration: -0.00733318 for: 33.1004
New deceleration: -0.00733156 for: 33.0931
New deceleration: -0.00732993 for: 33.0857
New deceleration: -0.00732831 for: 33.0784
New deceleration: -0.00732668 for: 33.0711
New deceleration: -0.00732506 for: 33.0637
New deceleration: -0.00732344 for: 33.0564
New deceleration: -0.00732182 for: 33.0491
New deceleration: -0.00732019 for: 33.0418
New deceleration: -0.00731857 for: 33.0344
New deceleration: -0.00731695 for: 33.0271
New deceleration: -0.00731533 for: 33.0198
New deceleration: -0.00731371 for: 33.0125
New deceleration: -0.00731209 for: 33.0052
I have only few values, starting speed, starting speed loss, and the destination, and all the others, are calculated, that's what i wanted.
ok, so it was some form of speed calculation. :)