# How do I determine which ChartElementDataFunction is Automatic?

In the course of exploring @kglr's answer to Edmund's question gain some insight into how I might answer my own question here, I came across the undocumented SystemChartElementData function, which evidently allows you to map the strings passed as options to ChartElementFunction to the actual functions which draw the elements. Thus, using the calling convention described for BoxChart in the docs for ChartElementFunction, you can do the following:

In[1]:= cfd = ChartElementData["Rectangle"]
Out[1]= ChartElementDataFunction["Rectangle"]

In[2]:= cfd[{{0, 1}, {0, 1}}, 1, "foo"]
Out[2]= Rectangle[{0, 0}, {1, 1}, "RoundingRadius" -> 0]


That's pretty neat. However, you can also find out that there are many applicable, named, ChartElementDataFunctions for any given chart type:

In[3]:= ChartElementData["BarChart"]

Looking at some output, I'm pretty sure that "Rectangle" is the default for BarChart, but I'm not 100% certain, and it would be nice to avoid having to do trial and error for every bar type should I wish to discover the default. Is there a way to find, programmatically, what ChartElementDataFunction is used by any given chart type when it's passed ChartElementFunction -> Automatic?
• TracePrint[(* charting function *), ChartElementDataFunction[_], TraceInternal -> True] quickly reveals not a few secrets. – J. M. will be back soon Nov 12 '15 at 5:16
• It doesn't always work, you see: TracePrint[PieChart3D[{1, 2, 3, 4}, PlotTheme -> "Marketing"], ChartElementDataFunction[_], TraceInternal -> True] so I left it as a comment. – J. M. will be back soon Nov 12 '15 at 5:23
• For "Marketing", this works: ChartElementFunction /. ChartingResolvePlotTheme["Marketing", BarChart3D]. For some of the other plot themes this doesn't work, but the previously presented approach works. I don't know if there's a situation where neither will work, but this at least reveals some inconsistency in internal handling. – J. M. will be back soon Nov 12 '15 at 5:36