Skip to end of banner
Go to start of banner

Create a Bar Chart using SQL macro - 10.x

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Scenario

Estimated Time: 11 min

As an example, let's create a 3-D bar chart to display the top publishers by revenue (in $M). 

Background

Our scenario uses a data source profileBookWarehouse, to query a database table, PUBLISHERS. The table contains the following columns and rows:

SQL > select * from publishers;
+----+------+-------------------+-----------------+---------+
| id | rank | parent_company    | company_name    | revenue |
+----+------+-------------------+-----------------+---------+
| 10 | 1    | Pearson           | Pearson         | 5000.00 |
| 11 | 2    | Reed              | RELXGroup       | 4900.00 |
| 12 | 3    | WoodbridgeCompany | ThompsonReuters | 4700.00 |
| 13 | 4    | BertelsmannAG-NV  | Bertelsmann     | 4500.00 |
| 14 | 5    | WoltersKluwer     | WoltersKluwer   | 4100.00 |
+----+------+-------------------+-----------------+---------+

Our query against the PUBLISHERS table looks like:

SELECT company_name as "Publisher", CONCAT('$',format(revenue,0)) as "M Rev" FROM publishers ORDER BY rank asc;

Steps

The following steps demonstrate how to use Markup to insert Confluence's native Chart Macro and our SQL macro on a Confluence page:

  • No labels