P
P
polyakovyevgeniy2017-03-21 15:26:13
Unity
polyakovyevgeniy, 2017-03-21 15:26:13

How can you draw graphs in Unity3D?

How to draw a graph in Canvas in Unity3D? I have a Web Api that returns a dataset, and I have a Canvas in Unity. How can I plot a function based on data and display it in Unity on Canvas?
Is it possible to somehow use JS libraries for charts (he said without thinking, but you never know), or how is this done at all?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Daniil Basmanov, 2017-03-21
@polyakovyevgeniy

The unit uses UnityScript, with browser-based JavaScript they only have a common syntax, nothing else, so only unit libraries can be used in it.
Graphs can be drawn in different ways, depending on the desired visual solution, there are no ready-made components, in the end everything will have to be done through a script. To draw lines, the easiest option would be to use the Line Renderer . A more advanced and productive option would be GL , but it will take longer to fiddle with. At worst, you can just draw on the texture with Texture2D.SetPixels .

S
Sergey Kopylov, 2020-06-27
@kopylov1558

Here is a video made in Russian with a full explanation of how to make a graph - https://www.youtube.com/watch?v=nTKivkiYbK8&t=21s

G
GreatRash, 2017-03-21
@GreatRash

Line Renderer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question