Changing height of an UI panel using Array content I've created following code which works just fine:

GraphBar1.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [0] * 1000);
GraphBar2.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [1] * 1000);
GraphBar3.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [2] * 1000);
GraphBar4.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [3] * 1000);
GraphBar5.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [4] * 1000);
GraphBar6.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [5] * 1000);
GraphBar7.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [6] * 1000);
GraphBar8.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [7] * 1000);
GraphBar9.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [8] * 1000);
GraphBar10.GetComponent&lt;RectTransform&gt; ().sizeDelta = new Vector2 (50, oScript.reactionTimeArray [9] * 1000);


As I'm re-writing almost the same code so many times, I'm convinced this can be done using less code, even though I'm confused on how to do it with the Array properties being present.
It could be written as : 

var graphBars = new[] { GraphBar1, GraphBar2, GraphBar3, GraphBar4, GraphBar5, GraphBar6, GraphBar7, GraphBar8, GraphBar9, GraphBar10 };
for (int i = 0; i &lt; graphBars.Length; i++)
    graphBars[i].GetComponent&lt;RectTransform&gt;().sizeDelta =
        new Vector2(50, oScript.reactionTimeArray[i] * 1000);