Rest API: load the color details with mapping

The Rest API Bulk Get (api/saved_objects/_bulk_get) doesn't return the colors used in a pie chart, unless user updates the color of pie chart slice.

With default colors the response "uiStateJSON" is empty {}

But when I update a particular slice color then the response looks like:

{"uiStateJSON": "{\"vis\":{\"colors\":{\"Kibana Airlines\":\"#E5AC0E\"}}}"}

How do I load all the colors with mapping?

AFAIK this is not possible without changing the colors, like you mentioned. Default colors are not persisted using saved_objects. What's your use case for this?


I am using the REST API to create a custom pie chart on a mobile application, I want to map the colors used in pie slices. if I get all the colors with mapping under uiStateJSON I can use the same colors for my custom Pie chart slices

Got it, thx. Sadly we don't provide this functionally, since it doesn't make sense to persist default settings. So you would need to implement your way of color mapping to ours to make it similar in this case.

Got it, Thank you :slight_smile: @matw

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.