Greetings!
I’ve been trying to make a line chart things, and I wanted to make line that connects two points.
I was checking a few of forums like: Drawing a path with Uis? - #2 by civ2k
so I used this script as making line:
local startX, startY = startBtn.Position.X.Offset, startBtn.Position.Y.Offset
local endX, endY = endBtn.Position.X.Offset, endBtn.Position.Y.Offset
local Line = Instance.new("Frame")
Line.AnchorPoint = Vector2.new(0.5, 0.5)
Line.Size = UDim2.new(0, ((endX - startX) ^ 2 + (endY - startY) ^ 2) ^ 0.5, 0, 5) -- Get the size using the distance formula
Line.Position = UDim2.new(0, (startX + endX) / 2, 0, (startY + endY) / 2) -- Get the position using the midpoint formula
Line.Rotation = math.atan2(endY - startY, endX - startX) * (180 / math.pi) -- Get the rotation using atan2, convert radians to degrees
Line.Parent = PARENT_HERE
end
(Thanks civ2k, for this script.)
but this one was for using offset. I need a scale one and I checked up but I didn’t found.
so well, I want to draw a line that connects two points with scale in GUI.
so, I just want a idea or entire script of that. Thanks in advance!
conditions of graph:
in position:
a = number
b = bottom setting (my setting: 1 million)
c = number of graph document number that can be in screen of graph (my setting: 10 million)
d = 0.1 per proceeded date
PointNew.Position = UDim2.new(1+(d*(i-1)),0,-(((a - b)/c)-1),0)