= new Imagine\Image\Box(300, 200); $center = new Imagine\Image\Point\Center($size); $canvas = $size->increase($volume); $bg = new Imagine\Image\Color('000000', 100); $color1 = new Imagine\Image\Color('FFEF78'); $color2 = new Imagine\Image\Color('8A834B'); $color3 = new Imagine\Image\Color('8A554B'); $color4 = new Imagine\Image\Color('D94616'); $color5 = new Imagine\Image\Color('FEB48D'); $chart = $imagine->create($canvas, $bg); for ($i = $volume; $i > 0; $i--) { $shift = $center->move($i); $chart->draw() ->pieSlice($shift, $size, -10, 70, $color1->darken(68), true) ->pieSlice($shift, $size, 70, 160, $color2->darken(68), true) ->pieSlice($shift, $size, 160, 170, $color3->darken(68), true) ->pieSlice($shift, $size, 170, 210, $color4->darken(68), true) ->pieSlice($shift, $size, 210, 350, $color5->darken(68), true); } $chart->draw() ->pieSlice($center, $size, -10, 70, $color1, true) ->pieSlice($center, $size, 70, 160, $color2, true) ->pieSlice($center, $size, 160, 170, $color3, true) ->pieSlice($center, $size, 170, 210, $color4, true) ->pieSlice($center, $size, 210, 350, $color5, true); $chart->save('/path/to/chart.png'); get imagine, define chart 3d volume and size Sunday, October 16, 11