Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

One Appfire Support Knowledge Base
Results will update as you type.
  • Error while retrieving the data using SQL for Confluence
  • How to resolve a Generic SQL exception - 10.x
  • How to find pages that uses a specific data source profile in different SQL macros
  • How to get favorites list of Confluence users using Sql for Confluence
  • How to configure data source profiles for various databases with examples
  • How to do data source problem determination
  • How to handle the "No suitable driver found" error when connecting to an MS-SQL database
  • How to hyperlink the SQL macro results
  • How to implement role based security for SQL queries - 8.x
  • How to improve the display of SQL source - 8.x
  • How to show all table rows using a nested query with SQL for Confluence
  • How to implement role based security for SQL queries - 10.x
  • How to improve the display of SQL source - 10.x
  • How to index SQL data
  • How to use SQL data with inline macros
  • How to resolve a Listener refused connection error - 10.x
  • How to log SQL activity
  • Pro tips
  • How to publish SQL queries on Atlassian Cloud
  • How to run SQL queries securely without page edit restrictions
  • Sample Queries - Confluence Labels
  • How to resolve the Unable to load database driver error
  • How to use Confluence metadata in SQL queries
  • How to use HTML in queries
  • How to use SQL case statement to improve the visual appeal
  • How to use SQL macros securely
  • Using the SQL macro with Markup - 9.x and earlier
  • How to resolve an Oracle validation query throwing exception - 10.x
  • UI caching problem with SQL for Confluence
  • How to create a temporary MySQL table using the SQL for Confluence (Pro edition) app
  • Using SQL File with Markup - 9.x and earlier
  • How to use MySQL functions in SQL macro
  • How to get usage information about the SQL for Confluence app
  • How to create a database profile with read-only access using the SQL for Confluence app
  • How to set SSL connection for SQL server with SQL for Confluence (Pro Edition)
  • Connect SQL macro to MS SQL database using Windows authentication
  • Unable to see table views in SQL macro
  • How to use the Expand array option in SQL for Confluence to view values with line break
  • Use SQL Macro with Markup - 10.x
  • Use SQL File Macro with Markup - 10.x
  • Create a Bar chart using SQL macro
  • Create a Pie chart using the SQL macro
  • Create an xyArea chart using the SQL macro
  • Create an xyLine chart using the SQL macro
  • How to resolve a network error due to invalid database port - 10.x
  • How to resolve isValid exceptions - 10.x
  • How to resolve a Cannot load JDBC driver error - 10.x
  • How to resolve a Permission denied error - 10.x
  • How to resolve a Validation query exception - 10.x
  • How to implement role based security for Postgre SQL database - 10.x
  • How to limit active database connections
  • How to use SQL macro in a Confluence user macro
  • How to use macros parameter within nested SQL queries
  • How to resolve the Unable to connect to database error
  • How to create a chart with SQL - 8.x
  • How to implement role based security for Postgre SQL database - 8.x
  • User Macro with sql-query failed after Confluence upgrade to 7.7 version
  • SSL connection to Oracle DB setup issues in SQL for Confluence
  • Unable to load database driver: com.xxx.jdbc.Driver
  • How to Create a Chart From SQL Data
  • How to Automatically Create a Formatted Table From SQL Data
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Create a Bar chart using SQL macro
    Updated Feb 25, 2020

    Create a Bar chart using SQL macro

    Feb 25, 2020

    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 profile, BookWarehouse, 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 | +----+------+-------------------+-----------------+---------+

    For more information about data source profiles, click the appropriate version:

    • Data source profiles for 10.x version

    • Data source profiles for 8.x version 

    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:

    {"serverDuration": 32, "requestCorrelationId": "44a83ba2f4524687a78d59872202d0b4"}