How to populate a pie chart (i.e any chart) with table data? #533
-
Hi there, I have a query which fetches item and unique counts of each item in a table. I want to now use this output to render a pie chart. https://sql.ophir.dev/documentation.sql?component=chart#component I don't see an example of it so far in the docs. I have been able to populate options for a form field though so I believe there is hope. Is this supported? The query used is something like: SELECT item, count(*)
FROM Items
GROUP BY item
ORDER by count(*) DESC; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello and welcome to SQLPage ! What you want is probably select 'chart' as component, 'pie' as type;
SELECT item as label, count(*) as value
FROM Items
GROUP BY item; Here is a live example that you can run in your browser: https://replit.com/@pimaj62145/SQLPage-bar-chart#index.sql Two important concepts in SQLPage are components and properties. A component is a graphical widget that you can add to your page.
|
Beta Was this translation helpful? Give feedback.
Hello and welcome to SQLPage !
What you want is probably
Here is a live example that you can run in your browser: https://replit.com/@pimaj62145/SQLPage-bar-chart#index.sql
Two important concepts in SQLPage are components and properties. A component is a graphical widget that you can add to your page.
type
, that is set to the str…