I'd like to draw a Graph, but i have no clue how to accomplish this.
To be more specific, i'd like to make something like the DPSgraph in recount.
I do have the data gathered in combat, also the time spent in combat, however when i google search i get various results like libraries for handling it, or different forms of graphs, etc.
The closest i've come is to think it may have to do with some kind of x and y axis, a periodic update functon and something to draw a line. And here comes my misery, i really don't know how to accomplish this with the API given and when i look at the code from Recount or CombatGraph i don't really get it either.
So if anyone could give me a simple example in that direction that would be enough to get me going, thanks in advance!
The type of graph you want to show would determine the complexity of creating it. Bar graphs are the easiest to make. You can just line up textures next to each other, stick them in a table, and iterate over them, setting their width or height according to the data you're representing. Line graphs are a little more tricky. In the past, you had to make an image file with a line in it, and manipulate the rotation. Then you had to position the texture between the previous and current data points when iterating over your lines. New in Legion are Line objects, which would make this task easier. You create them, set their width along with starting and ending anchors, and you're set. Pie charts are by far the most complex. They involve creating a half-circle image, sticking textures in ScrollFrames to crop one end of the half-circle while you rotate the textures inside to adjust the angle of the pie piece.