I'm using python to create bar charts and export them to SVG. This is no problem. The only issue I have is that I would like the top of each bar to display the value. If you create the bar chart manually in ArcGIS Pro, there is a little checkbox under Data Labels called Label bars.
However, this does not seem to be exposed to Python. I tried this:
chart = arcpy.charts.Bar(x=count_field, y=count_field, aggregation='count', showDataLabels=True, dataSource=input_feature)
showDataLabels does not appear to be a valid parameter. I get this error:
TypeError: Bar.__init__() got an unexpected keyword argument 'showDataLabels'
showDataLabels works for Pie charts. So I want to verify that there is no way to enable these labels.
Solved! Go to Solution.
Hi @JasonBennett ,
Thanks for the question. You are correct that the functionality to show data labels is not currently exposed for the `Bar` class, but this enhancement is on our near-term radar.
Thanks,
Chris
Hi @JasonBennett ,
Thanks for the question. You are correct that the functionality to show data labels is not currently exposed for the `Bar` class, but this enhancement is on our near-term radar.
Thanks,
Chris
Thanks for the answer, Chris. Any chance there are plans to allow exports to other formats like PNG?
Hi @JasonBennett ,
Adding functionality to export an ArcPy chart to PNG (and JPG) is on our near-term radar also. I've made a note of your request so that we can prioritize accordingly. In the meantime, we suggest using a third-party Python module such as cairosvg to convert SVG to PNG.
Take care,
Chris