# Area Graph

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-Lg-2KC0nUNc_Zwh9mWo%2F-Lg-2VO8OinaFYAu5-HP%2FAreaGraph.gif?alt=media\&token=fe8df1a6-07d6-4f10-9fd4-90132f69927c)

{% file src="<https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-Lg-2KC0nUNc_Zwh9mWo%2F-Lg-2Xd3V5AQAV-7MM2f%2FAreaGraph.dyn?alt=media&token=e576cd96-54a9-4769-a4a7-97f0c7ddd587>" %}

```d
sq01 = Math.Sqrt(Math.Sum(a));
sq02 = sq01 % Math.Floor(sq01);
sq03 = 1+sq02/Math.Floor(sq01);
sq04 = Rectangle.ByWidthLength(sq03,sq03);
sq05 = sq04.Translate(Vector.YAxis(),0..#Math.Floor(sq01)..sq03);
sq06 = sq05<1>.Translate(Vector.XAxis(),0..#Math.Floor(sq01)..sq03);
sq07 = List.TakeEveryNthItem(sq06,2,1);
sq08 = List.Reverse(List.TakeEveryNthItem(sq06,2,0)<1>);
sq09 = List.Clean(Flatten(List.Transpose({sq07,sq08})),false);
ct01 = Math.Pow(Math.Floor(sq01),2);
ct02 = Math.Round(a/(Math.Sum(a)/ct01));
ct03 = List.ReplaceItemAtIndex(ct02,-1,List.LastItem(ct02)+(ct01-Math.Sum(ct02)));
sq10 = PolySurface.ByJoinedSurfaces(List.Chop(sq09,ct03).Patch());
clr1 = List.Chop(Math.Floor(Math.RemapRange(Math.RandomList(List.Count(sq10)*3),10,255)),List.Count(sq10));
clr2 = Display.ByGeometryColor(sq10,Color.ByARGB(255,clr1[0],clr1[1],clr1[2]));
```
