Hi,
I've a CIMChart object. There is some way with pro SDK to export it as image?
Solved! Go to Solution.
Hi @pspada_WT ,
Thanks for the question! Unfortunately, there is not currently an official Charts API for the Pro SDK and therefore there isn't any functionality to export a chart graphic. Please feel free to upvote the Pro Idea here if you would like to see a Charts API for the SDK (including export functionality):
I wanted to point out that creating and exporting a chart as an SVG file is possible with the arcpy.charts module if Python is an option for you. Here's an example that creates a bar chart an exports as SVG:
import arcpy
url = r"https://services1.arcgis.com/hLJbHVT9ZrDIzK0I/arcgis/rest/services/CrimesChiTheft/FeatureServer/0"
bar = arcpy.charts.Bar(x="BEAT", aggregation="count", title="Chicago Thefts by Beat", dataSource=url)
bar.exportToSVG('bar.svg', width=800, height=500)
Also, if you're able to share more details about your use case for exporting charts, we might be able to brainstorm alternative solutions.
Thanks!
Chris
Hi @pspada_WT ,
Thanks for the question! Unfortunately, there is not currently an official Charts API for the Pro SDK and therefore there isn't any functionality to export a chart graphic. Please feel free to upvote the Pro Idea here if you would like to see a Charts API for the SDK (including export functionality):
I wanted to point out that creating and exporting a chart as an SVG file is possible with the arcpy.charts module if Python is an option for you. Here's an example that creates a bar chart an exports as SVG:
import arcpy
url = r"https://services1.arcgis.com/hLJbHVT9ZrDIzK0I/arcgis/rest/services/CrimesChiTheft/FeatureServer/0"
bar = arcpy.charts.Bar(x="BEAT", aggregation="count", title="Chicago Thefts by Beat", dataSource=url)
bar.exportToSVG('bar.svg', width=800, height=500)
Also, if you're able to share more details about your use case for exporting charts, we might be able to brainstorm alternative solutions.
Thanks!
Chris