Search This Blog

Showing posts with label charts. Show all posts
Showing posts with label charts. Show all posts

Wednesday, July 23, 2025

How Do I Use Charts in Oracle APEX

Charts in Oracle APEX are a powerful and visually engaging way to present data in your applications. Whether you are building dashboards, analytics pages, or interactive reports, APEX provides a wide variety of chart types—including bar, pie, line, donut, area, and more—through a modern, responsive charting engine (based on Oracle JET). Charts help users quickly understand patterns, trends, and comparisons, enabling better decision-making with less effort.

How to Use Charts in Oracle APEX

Charts are easy to implement using declarative tools. Here’s a detailed breakdown of how to create and configure charts:

  1. Create or Open a Page

    • In APEX, go to the App Builder.

    • Add a new page or open an existing one.

    • Select Chart under the Reports section.

    • Choose a chart type, such as Bar Chart, Line Chart, Pie Chart, etc.

  2. Choose a Data Source

    • Choose a SQL Query, Web Source, or RESTful Web Service.

    • Example for a column chart:

      SELECT department_name AS label,
             COUNT(*) AS value
        FROM employees
      

    GROUP BY department_name

    - The query should return one column for **labels** (categories) and one or more for **values** (measures).
    
    
  3. Configure Chart Attributes

    • Under Chart Attributes, set:

      • Label: the column that contains the category (e.g., department name)

      • Value: the numeric data (e.g., employee count)

      • Series Name: optional, used if you want multiple grouped values

    • For multi-series charts (e.g., grouped bar or stacked bar), make sure your query returns a series column.

  4. Customize Appearance

    • In Appearance, choose:

      • Chart colors (predefined or custom)

      • Legend placement (top, right, none)

      • Axis labels and tooltips

      • Data label display (on/off)

      • Interactivity such as zoom or selection

  5. Add Interactivity (Optional)

    • Use Link attributes to make chart elements clickable.

    • For example, clicking a bar could navigate to a detail page and pass a department name as a parameter.

    • You can also enable drill-down charts using dynamic actions or link regions.

  6. Preview and Fine-Tune

    • Run the page to preview the chart.

    • Adjust padding, size, axes, or labels as needed for clarity and usability.

Examples

Example 1: Employee Count by Department

  • Chart Type: Bar

  • Label: Department Name

  • Value: Count of Employees

  • Series: N/A

  • Link: Navigate to employee detail report

Example 2: Monthly Sales Over Time

  • Chart Type: Line

  • Label: Month

  • Value: Total Sales

  • Series: Sales Channel (Online, In-Store)

Example 3: Expense Distribution

  • Chart Type: Pie

  • Label: Expense Category

  • Value: Total Cost

  • Series: N/A

  • Tooltip: Show percentage of total

Best Practices

  • Choose the right chart type for the data you’re showing. Use bar/column for comparisons, line for trends, and pie for proportions.

  • Keep it simple—don’t overload a chart with too many data points or series.

  • Use consistent colors to represent the same data categories across multiple charts.

  • Label clearly—always include axis titles and legends for clarity.

  • Enable links or drill-downs to make charts interactive and connected to deeper data views.

  • Test responsiveness to make sure charts display properly on mobile and tablets.

Bar Chart Example

A screenshot of a computer

Description automatically generated

A black rectangular object with a black stripe

Description automatically generated

A screenshot of a computer

Description automatically generated

A black and grey striped background

Description automatically generated

A screenshot of a computer program

Description automatically generated

A screenshot of a computer

Description automatically generated



A screenshot of a computer error

Description automatically generated

Region Attributes

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated

select

    rownum  as value,

    'label' as label

from

    sometable

connect by level <= 12

A screenshot of a black screen

Description automatically generated


A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer program

Description automatically generated


A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated


A screenshot of a computer program

Description automatically generated

Result 

A graph with blue squares

Description automatically generated



Gauge Chart Example

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated


Attributes

A screenshot of a computer

Description automatically generated

A black and grey striped background

Description automatically generated with medium confidence

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

Using the following SQL:

SELECT

    80 value, 

    100 max_value 

FROM

    dual


A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a black screen

Description automatically generated

Outcome:

A black and white image of a speedometer

Description automatically generated


Donut Chart example

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A black and grey striped background

Description automatically generated

A screenshot of a computer program

Description automatically generated

A screenshot of a computer

Description automatically generated

A black box with white text

Description automatically generated





Attributes:

A screenshot of a computer

Description automatically generated

A black and grey striped background

Description automatically generated with medium confidence

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A black rectangular object with white text

Description automatically generated

A screenshot of a computer

Description automatically generated

A screen shot of a computer

Description automatically generated


Using the following query:

select

    rownum  as value,

    rownum || ' label' as label

from

    dual

connect by level <= 5


A screenshot of a computer

Description automatically generated

A screenshot of a computer program

Description automatically generated

A screenshot of a computer program

Description automatically generated

Final Outcome:

A colorful circle with a circle in the middle

Description automatically generated


Oracle APEX Documentation

You can explore chart options and configuration in the official documentation:
https://docs.oracle.com/en/database/oracle/apex/
Search for “Charts” or “JET Chart Attributes” to view supported types and properties.

Conclusion

Charts in Oracle APEX transform raw data into clear, visual insights. With built-in support for Oracle JET charts, APEX lets you create responsive, customizable, and interactive charts without needing JavaScript or complex coding. By selecting the right chart type, organizing your data effectively, and applying best practices, you can build professional dashboards and reports that help users quickly understand key information and act on it.

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...