Hi,
I would like to know if it is possible to access and modify Highcharts chart code taken from a visual in a QuickSight dashboard using Boto3 through Python code.
Thanks
@ggg Yes, you can use describe_analysis_definition to dump the analysis definition including the Highchart visuals into JSON. Once you modify the Highchart visual definition as desired within the JSON, you can call update_analysis to update it back to the original analysis. I have tested this and it works as just any other visuals.
I’m trying to use describe-analysis-definition to retrieve code for a Highcharts chart, but it returns no code. Why ?
Hi @Emilie_Chaignon, if you already have a Highchart created in your analysis, its chart code should appear as in the following example describe-analysis-definition output from my test environment. If this is not the case, I’d like to suggest you log a support ticket with AWS Support.
{
"Status": 200,
"AnalysisId": "{AnalysisId}",
"Name": "{Name}",
"ResourceStatus": "CREATION_SUCCESSFUL",
"Definition": {
"DataSetIdentifierDeclarations": [...],
"Sheets": [
{
"SheetId": "{SheetId}}",
"Name": "{Name}",
"Visuals": [
{
"PluginVisual": {
"VisualId": "{VisualId}}",
"PluginArn": "arn:aws:quicksight::aws:visualplugin/highcharts/alias/V1",
"Title": {
"Visibility": "VISIBLE"
},
"Subtitle": {
"Visibility": "VISIBLE"
},
"ChartConfiguration": {
"FieldWells": [...],
"VisualOptions": {
"VisualProperties": [
{
"Name": "codeEditor",
"Value": "{ }" <--- YOUR JSON CHART CODE SHOULD APPEAR HERE
}
]
},
"SortConfiguration": {...}
}
}
}
],
"Layouts": [...],
"ContentType": "INTERACTIVE"
}
],
"CalculatedFields": [],
"ParameterDeclarations": [...],
"FilterGroups": [],
"ColumnConfigurations": [...],
"AnalysisDefaults": {...},
"Options": {...},
"QueryExecutionOptions": {...}
},
"RequestId": "{RequestId}"
}
Hi @ytakahr,
Thanks for your answer!
Indeed, it works, you have to pay attention to the version of aws-cli, it works with the version aws-cli/1.38.5
You are right. I should have reminded to use the latest AWS CLI version. Thanks for checking and pointing that out.