Search Unity

Shaded Graph (NGUI?)

Discussion in 'Scripting' started by KamiKaze425, May 19, 2014.

  1. KamiKaze425

    KamiKaze425

    Joined:
    Nov 20, 2012
    Posts:
    207
    Hey guys, so I'm trying to create a graph similar to the one in the attached image.

    I'm using NGUI and the NGUI Graph Maker extension. I have graphs that are created based on the players' scores. One line is player 1, the other is player 2.

    But I can't figure out how to do the color shading under the lines. Any ideas?

    Couple of ideas but I'm not sure how to implement:
    1) Create two multi-sided polygons based on the coordinates of the graph and overlap them without transparency. Although this probably won't display properly with criss-crossing lines...but I don't mind haha.
    2) Create several trapezoids based on the line segments of the graph and place them accordingly. I'm mainly not sure how to dynamically create all these trapezoids. It would roughly be 26 trapezoids per graph (13 for each player)

    $graph.png
     
  2. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hi, this is possible as of version 1.3.6 of Graph Maker for NGUI and Daikon. Product link in my sig, enjoy :)