Has anyone tried designing graphs in ue4?

Hi,

Has any one tried to design a graph in Unreal Engine?

I’m trying to do that in HUD.

Something like this

74852-eeg.gif

Thanks.

I did find this https://forums.unrealengine.com/showthread.php?69170-Material-draw-a-line-between-two-coordinates which shows creating a line between two points, But if i think of multiple points say

10 - 20, 20 -15, 15 - 18 … this is only for one line

This will be a bit tough thing to do.

There is not graph as i know in UMG

in 4.1 there was some debug histogram introduced, but i have 0 idea how to use it, when i deach for histogram theres not much info

You could use old HUD canvas (AHUD class) and draw graph with lines

If you want to use UMG, you need first to create graph Slate widget (from SWidget) which work as a graph and then make UMG frontend class for it (UWidget class), here you have Slate documentation, UMG is blueprint frontend of Slate

Here you got code Slate Widgets code to learn from:
https://github.com/EpicGames/UnrealEngine/tree/97c8d3ef55e869e17ef149903eae2a33101381c9/Engine/Source/Runtime/Slate/Private/Widgets

Here you got UMG widgets (UMG widget and be combination of multiple Slate widgets):

https://github.com/EpicGames/UnrealEngine/tree/97c8d3ef55e869e17ef149903eae2a33101381c9/Engine/Source/Runtime/UMG/Private/Components

As i know UMG don’t have any drawing functions, it just paste Slate widgets, so you need to create Slate widget first. MAybe there is some drawing canvas widget that i forget about existance of it (actully something sit in my head that there was one), so search :stuck_out_tongue:

Profiler has a graph and it’s SDataGraph Slate widget, but it’s code is in profiler module so you can’t use it in game (well you can technically) as you can’t distribute editor modules. If you find interesting widget in editor you can check what is it with “Widget Reflector”