Compare the distribution of different applicati...
Created on Apr 10, 2025
Prompt
Compare the distribution of different application types (A vs N)
Chart
Query Results
Query Results
SQL Query:
SELECT appl_type AS category, COUNT(*) AS value, CASE appl_type WHEN 'A' THEN 'Application Type A' WHEN 'N' THEN 'Application Type N' ELSE 'Other' END AS series, CASE appl_type WHEN 'A' THEN 'Application Type A' WHEN 'N' THEN 'Application Type N' ELSE 'Other' END AS label, FALSE AS highlight FROM orange_book_products GROUP BY appl_type UNION ALL SELECT appl_type AS category, COUNT(*) AS value, CASE appl_type WHEN 'A' THEN 'Application Type A' WHEN 'N' THEN 'Application Type N' ELSE 'Other' END AS series, CASE appl_type WHEN 'A' THEN 'Application Type A' WHEN 'N' THEN 'Application Type N' ELSE 'Other' END AS label, FALSE AS highlight FROM orange_book_patents GROUP BY appl_type UNION ALL SELECT appl_type AS category, COUNT(*) AS value, CASE appl_type WHEN 'A' THEN 'Application Type A' WHEN 'N' THEN 'Application Type N' ELSE 'Other' END AS series, CASE appl_type WHEN 'A' THEN 'Application Type A' WHEN 'N' THEN 'Application Type N' ELSE 'Other' END AS label, FALSE AS highlight FROM orange_book_exclusivities GROUP BY appl_type;
Results:
category | value | series | label | highlight |
---|---|---|---|---|
A | 35795 | Application Type A | Application Type A | false |
N | 10562 | Application Type N | Application Type N | false |
N | 19693 | Application Type N | Application Type N | false |
A | 40 | Application Type A | Application Type A | false |
N | 2022 | Application Type N | Application Type N | false |
Chart Configuration
{ "color": [ "#0088cc", "#cc0033" ], "title": { "top": "20px", "left": "center", "text": "Distribution of Application Types (A vs N)" }, "xAxis": { "data": [ "A", "N" ] }, "yAxis": { "type": "value" }, "legend": { "top": "center", "data": [ "Application Type A", "Application Type N" ], "left": "left", "orient": "vertical" }, "series": [ { "data": [ 35795, 0 ], "name": "Application Type A", "type": "bar" }, { "data": [ 0, 10562 ], "name": "Application Type N", "type": "bar" } ], "tooltip": { "trigger": "item", "formatter": "{a} <br/>{b} : {c} ({d}%)" } }