-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I'm putting this here as a placeholder to collect thoughts. I don't think it's an immediate priority, but would be cool.
We support form creation using FormConfig. We might be able to add something similar called ChartConfig. It would initially just be for very simple chart types, like bar, line, and pie.
Here's an example:
async def get_data():
movies = await Movie.select(
Movie.director.name.as_alias("director"),
Count(Movie.id)
).group_by(
Movie.director
)
# Flatten the response so it's a list of lists like [['George Lucas', 3], ...]
return [[i['director'], i['count']] for i in movies]
director_chart = ChartConfig(title='Movie count', type=Bar(source=get_data))
create_admin(charts=[director_chart])There would be a new section in the sidebar:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
