Following the page on error bars in charts I wanted to make a BarChart3d with error bars, but I'm struggling with it because there is no help about the function "ChartElementData", which is used to add the error bars to the plot. To be more specific:
Data is of the form:
{3.6970967741935485` -> 1.2448175747118455`, 9.7975` -> 1.3853284164516986`, ...}
The following function is defined on the page:
errorBar[type_: "Rectangle"][{{x0_, x1_}, {y0_, y1_}}, value_, meta_] :=
Block[{error}, error = Flatten[meta];
error = If[error === {}, 0, Last[error]];
{ChartElementData[type][{{x0, x1}, {y0, y1}}, value, meta],
{Black, Line[{{{(x0 + x1)/2, y1 - error}, {(x0 + x1)/2,
y1 + error}}, {{1/4 (3 x0 + x1),
y1 + error}, {1/4 (x0 + 3 x1),
y1 + error}}, {{1/4 (3 x0 + x1),
y1 - error}, {1/4 (x0 + 3 x1), y1 - error}}}]}}]
After that, plotting
BarChart[chartData, ChartElementFunction -> errorBar["Rectangle"]]
BarChart3D[chartData, ChartElementFunction -> errorBar["Cone"]]
gives the right 2D plot, and the 3D plot shows the error bars, but not the data bars!
I understand that I have to fix the points in the Line command for the 3D case, but the error Mathematica shows is regarding the "type" variable passed to ChartElementData:
FEPrivate
If is not a Graphics3D primitive or directive. BarFunctionDump
ConeBar3D is not a Graphics3D primitive or directive.
Similar thing happens with
BarChart3D[chartData, ChartElementFunction -> errorBar[Cone[]]]
How can I get back the data bars?
The two commands
BarChart[chartData]
BarChart3D[chartData]
work fine, as expected.