Thread: Drawing a Graph
View Single Post
12-23-16, 06:44 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote