Skip to end of banner
Go to start of banner

Create a Pie Chart using the SQL Macro

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

Version 1 Next »

Scenario

Estimated Time: 13 min

In this scenario, we will create a Bar chart to display "Book Print Operational Costs". 

Background

Our scenario will use a Data Source Profile called "BookWarehouse" to query a database table called "PRINTOPERATION". The table contains current min, max, and average operational costs associated with the printing and go-to-market costs for books. For this scenario, we will focus on charting the current average market costs for each type of print operation:

SQL > mysql> select po_book_id, printoperation, avgcost from printoperation;
+------------+-----------------------+----------+
| po_book_id | printoperation        | avgcost  |
+------------+-----------------------+----------+
|          2 | Developmental Editing | 18000.00 |
|          3 | Copyediting           |  7000.00 |
|          4 | Cover Design          |  3500.00 |
|          5 | Formatting            |  2500.00 |
|          6 | Illustrations         |  4000.00 |
|          7 | ISBN Registration     |   250.00 |
|          8 | Marketing & PR        |  5000.00 |
+------------+-----------------------+----------+

Our example query against the PRINTOPERATION table looks like:

SELECT printoperation
,format(avgcost,0) AS "AvgCost" 
FROM printoperation;

Steps

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



  • No labels