Set Label Colors Using Superset API
aprendizlaura opened this issue · 1 comments
I am using Superset's API to download individual charts through the /api/v1/chart/{pk}/cache_screenshot/
endpoint. Currently, I can specify parameters such as the chart ID (pk
) and the dimensions for the download. However, I would like to know if there is a way to set or customize the chart's colors when downloading it (perhaps using the q
parameter?).
In my dashboard, I define label colors using the label_colors
attribute in the dashboard's JSON metadata. I would like to somehow leverage this configuration from my dashboard so that the colors are preserved when downloading a specific chart from a specific dashboard. If this is not possible, I would like to set label_colors
for a specific chart and ensure it remains consistent.
Is there any way to set label colors directly when downloading an individual chart, either by configuring them beforehand or passing them as a parameter to the endpoint? If not, are there any recommended alternatives or solutions to achieve this?
Currently, there is no documented method to directly set or customize chart colors using the /api/v1/chart/{pk}/cache_screenshot/
endpoint in Superset. The q
parameter and other parameters for this endpoint do not appear to support color customization directly [1].
The label_colors
attribute is used in the dashboard's JSON metadata to map specific labels to colors, but this configuration does not automatically apply to individual chart downloads through the API [2][3].
As a workaround, you might consider setting the label_colors
in the dashboard's metadata and ensuring that the chart reflects these settings when viewed in the dashboard. However, for API downloads, you may need to manually adjust the chart's color settings in the Superset UI before downloading, as there is no direct API support for this feature at the moment.