예제 #1
0
 void FillGraph()
 {
     Graph.DataSource.ClearCategory("Category1");
     for (int i = 0; i < Bar.DataSource.TotalCategories; i++)
     {
         string categoryName = Bar.DataSource.GetCategoryName(i);
         for (int j = 0; j < Bar.DataSource.TotalGroups; j++)
         {
             string  groupName = Bar.DataSource.GetGroupName(j);
             Vector3 position;
             Bar.GetBarTrackPosition(categoryName, groupName, out position);          // find the position of the top of the bar chart
             double x, y;
             Graph.PointToClient(position, out x, out y);                             // convert it to graph coordinates
             Graph.DataSource.AddPointToCategory("Category1", x, Random.value * 10f); // drop the y value and set your own value
         }
     }
 }