...
...
Scenario
Div |
---|
|
Estimated Time: 11 min
|
In this scenario, we will create a 3-D bar chart to display "Top Publishers by Revenue (in $M).
...
Table plus |
---|
border | 0 |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
columnAttributes | style="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;" |
---|
id | steps_table |
---|
enableSorting | false |
---|
enableHighlighting | false |
---|
|
| Create a Confluence pageCreate a Confluence page that will eventually contain the macros needed to produce the chart. - Create a page named Top Publishers Worldwide in a space accessible to the desired audience.
- Click Save to close the Page Restrictions screen.
- Click Save to save to publish the new page.
|
|
| | Edit the Top Publishers Worldwide page and do the following: - Insert the Chart macro.
- Click the Chart macro container and click Edit so you can adjust its parameters as shown on the right. The following parameters indicate:
- Type - type of a chart.
- Width - width of the chart in pixels.
- Height - height of the chart in pixels.
- Display rendered data - a data table should be displayed after (below) the chart.
- Chart Title - title for the chart.
- Show in 3-D - add dimension to the bars within the chart.
- Opacity - recommended when using 3-D and for bar the recommendation is 75%.
- Horizontal-axis - column values rendered on the horizon line.
- Vertical-axis - column values rendered on the vertical line.
- Show legend - name associated with the colored bars rendered.
- Click Save to save your changes to the Chart macro's parameters.
| Chart macro parameters: Type | pie | Width (pixel value only) | 600 | Height (pixel value only) | 400 | Chart Title | Top Publishers by Revenue | Show in 3-D | ![(tick)](/wiki/s/-560635863/6452/fe8f61945d11cc414cb1fd8fd46a03da37ca467c/_/images/icons/emoticons/check.png) | Opacity | 75 | Horizontal-axis label | Publisher | Vertical-axis label | Revenue (in $M) | Show legend | ![(tick)](/wiki/s/-560635863/6452/fe8f61945d11cc414cb1fd8fd46a03da37ca467c/_/images/icons/emoticons/check.png) |
|
| | This step uses the SQL macro, to retrieve the data that will be displayed in the bar chart. To configure the SQL macro, do the following: - Edit your Top Publishers Worldwide page.
- Add a line below your Chart Macro.
- Using Markup, insert a new SQL macro on the page (more on Markup here).
- Adjust its parameters as shown on the right. The following parameters indicate:
- Data source profile - name of the data source profile that you set up.
- Use database column labels - usage of the column names defined within the SELECT statement (e.g., Publisher, M Rev.) rather than the columns names defined within the database table(s) themselves.
- Show error if there are no rows - displays an error if no rows are returned in the resultset of the SQL query.
- Text to display when there are no rows - text of the error message to be displayed when no rows are returned in the resultset of the SQL query.
- Click Save to save your changes to the SQL macro's parameters.
Paste the SQL statement in SQL settings > SQL statement > SQL statement: Code Block |
---|
language | sql |
---|
theme | DJango |
---|
linenumbers | true |
---|
| SELECT company_name as "Publisher"
,CONCAT('$',format(revenue,0)) as "M Rev"
FROM publishers
ORDER BY rank asc; |
Using your mouse, drag the SQL macro container into your Chart macro container (see right).
| SQL macro parameters: SQL settings > SQL statement > Data source profile | BooksWarehouse | Display settings > Data layout > Use database column labels | On | Display settings > Data layout > Show error if there are no rows | On | Display settings > Data layout > Text to display when there are no rows | No rows selected |
Moving the SQL macro inside the Chart Macro ![](https://appfire.atlassian.net/wiki/download/thumbnails/74322325/drag-sqlmacro-container-into-barchart-container.gif?version=1&modificationDate=1556194450941&cacheVersion=1&api=v2&width=450)
|
| | Save and test the pageNow, go back to the Top Publishers Worldwide page and click Save to save it. You should now see a page that appears as shown on the right.
| Top Publishers by Revenue (in $M): ![](https://appfire.atlassian.net/wiki/download/thumbnails/74322325/top-publishers-by-rev.png?version=1&modificationDate=1556194451261&cacheVersion=1&api=v2&width=450)
|
|
...