# Plotting a circular bar-chart in 3d with mathematica

I'm trying to generate a 3d-plot with mathematica that arranges numbers from a dataset of any size in a full circle as 3d-bars. In this process, the values ​​of the numbers reflect the height of the bars. The following example demonstrates it very well:

data={1,2,3,4};


out=

Can this be done with mathematica? If yes, how? Maybe someone here has a quick Solution for that :) Thanks in advance. Regards

Updated

Use Cuboid to draw any 3D BarChart.

Clear[values, n, cuboid, regs, r, pts, circle3];
values = {2.5, E, π, 4.15, 5.555, 6.45};
values = Reverse@values;
n = Length@values;
cuboid[h_] = Cuboid[{-1/2, -1/2, 0}, {1/2, 1/2, h}];
regs = Table[
Show[HighlightMesh[
cuboid@h, {Style[1, {Black, AbsoluteThickness[1]}],
Style[2, None]}],
RegionPlot3D[cuboid@h, Mesh -> {Range[Floor[h]]},
MeshFunctions -> {#3 &}, AspectRatio -> Automatic,
Boxed -> False, MeshStyle -> {Black, AbsoluteThickness[1]},
BoundaryStyle -> Thick, PlotStyle -> Pink]] // First, {h,
values}];
r = n;
pts = PadRight[#, 3] & /@ CirclePoints[{r, Pi}, n];
circle3[r_] =
ParametricPlot3D[{r*Cos[t], r*Sin[t], -.1}, {t, 0, 2 Pi},
PlotStyle -> Brown];
Graphics3D[{Pink,
GeometricTransformation[#1,
TranslationTransform[#2]@*
RotationTransform[π/3, {0, 0, 1}]] &, {regs, pts}],
Boxed -> False, ViewPoint -> {1, 1, 1},
ViewProjection -> "Orthographic", circle3[r][[1]],
Inset[Style[NumberForm[N@#1, 2], Blue,
20], #2 + {0, 0, #1} + {0, 0, .8}] &, {values, pts}]},
Boxed -> False]


Original

values = {1, 2, 3, 4};
values = Reverse@values;
n = Length@values;
regs = ArrayMesh[{ConstantArray[{1}, #]}] & /@ values;
r = n;
pts = PadRight[#, 3] & /@ CirclePoints[{r, Pi}, n];
circle3[r_] =
ParametricPlot3D[{r*Cos[t], r*Sin[t], -.1}, {t, 0, 2 Pi},
PlotStyle -> Brown];
Graphics3D[{Pink,
GeometricTransformation[#1,
TranslationTransform[#2]@*RotationTransform[π/3, {0, 0, 1}]@*
TranslationTransform[-{1/2, 1/2, 0}]] &, {regs, pts}],
Boxed -> False, ViewPoint -> {1, 1, 1},
ViewProjection -> "Orthographic", circle3[r][[1]],