#Creating UI-Based Graphs in Unity?

1 messages · Page 1 of 1 (latest)

wise nest
#

Hey, I'm pretty new to Unity and I'd like to build a graphs system for my heavily data and UI based game. I'd like to create something looking similar to the Cities Skylines 2 graphs which I've attached. What are some methods you'd recommend for achieving this effect?

I've been researching over the last few days on various approaches like:

  • Rotating rects along the canvas - creates unwanted jagged effect on steep lines (not fixable with anti-aliasing)
  • Rendering a custom mesh using the canvas renderer - same jagged issue, I also have no idea where to learn about creating that colour fill effect with a border like in cities skylines ive done a lot of googling but I really don't know where to look

I've attached this jagged effect I've been talking about, which is partially fixable with 8x MSAA anti aliasing but this still doesn't completely solve the problem.

violet knot
wise nest
wise nest
calm canyon
violet knot
wise nest
#

when would you be free?

#

oh didn't realise that was a question 😄

#

yeah resources for now would be great and if i can't figure it out we could always do the second option

violet knot
# wise nest yeah resources for now would be great and if i can't figure it out we could alwa...

Sounds good. For meshes + filled areas, check out Unity’s Mesh API docs (https://docs.unity3d.com/ScriptReference/Mesh.html) and this tutorial on procedural mesh generation: https://catlikecoding.com/unity/tutorials/mesh-basics/. For clean lines/fills, using a shader is the way to go—this guide is solid: https://thebookofshaders.com/. There’s also a good Unity forum thread on smooth graph rendering: https://forum.unity.com/threads/simple-line-graph.556703/. That should get you started—if you hit a wall, just ping me and I can help you build it out. @wise nest

A tutorial series about procedural mesh basics in Unity.

wise nest
wise nest
#

@violet knot ended up using uitoolkit and the vector api and got something really nice (still a WIP)