Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add charts to dashboards #15

Open
arieselinger opened this issue Apr 22, 2022 · 2 comments
Open

Add charts to dashboards #15

arieselinger opened this issue Apr 22, 2022 · 2 comments

Comments

@arieselinger
Copy link

arieselinger commented Apr 22, 2022

Hi, I was wondering if there is a way to add charts to dashboard using the client. I manage to tweak json_metadata in order to change the dashboard layout but I am not able to associate any existing chart. I feel like the added value of the superset client would be to be able to create a complete dashboard from scratch in python. I am also a bit confused by the charts attribute: dashboard.charts returns a list of chart names (string), dashboard.get_charts returns a list of Ids (This is the list I would like to be able to update). Do you have any insight on this? Is any of this related to the following comment?

# Need to find a solution
#
# Due to the design of the superset API,
# get /chart/_info only returns 'slice_name'
# for chart adds to work,
# we require the additional attributes:
# 'datasource_id',
# 'datasource_type'
if self.__class__.__name__ == 'Charts':
self.add_columns = [
'datasource_id',
'datasource_type',
'slice_name',
'params',
'viz_type',
'description'
]

Thank you.

@opus-42
Copy link
Owner

opus-42 commented Aug 10, 2022

Hello @arieselinger. I think the most recent version of Superset includes /dashboard/{id}/charts that could easily be used and integrated to the library. That would be a nice addition.

Let keep that issue open and see how to integrate that soon.

@ecederstrand
Copy link
Collaborator

I found out how to do this in #38 which also adds fixes to make it work. See

# Test connected charts
for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants