Example of a Stacked Bar Chart SQL Template: Host CPU Performance
From the SQL Template Designer tabbed window, select and .
Select and click at the bottom of the Query window.
Enter the heading for the drop-down list in the Static Custom Combo box--for this example,
Enter the following comma-separated list of values and then click :
These will be the options that a user can select when generating a report.
Click on the tab and enter the following query:
SELECT trunc(log_date,DECODE('${freeCombo1}','Hour','HH24', 'Day','DD','Week','WW','Month', 'MM','Quarter','Q','Year')) the_date, avg(system_processing_time_pct) avg_system, avg(user_processing_time_pct) avg_user, max(system_processing_time_pct) max_system FROM apt_v_host_cpu_log WHERE log_date between ${startDate} AND ${endDate} GROUP BY trunc(log_date,DECODE('${freeCombo1}','Hour','HH24', 'Day','DD','Week','WW','Month', 'MM','Quarter','Q','Year'))Click and then .
In the Formatting window, select and set the Caption field to with the Axis label set to . To create a Dynamic Stacked Bar chart, select the Caption field and choose a different String field as a Legend. Legend can be selected from the Formatter.
Check all four fields:
One by one, select the bar fields, and , and click the Formatting button (at the bottom of the window) to configure the color of the bar. And, enter a relevant label for each field.
Select the max_system field and click the Formatting button (at the bottom of the window) to configure the color of the line.
Save the report to a report menu group. Then, click on the saved report to generate it.
The output for the stacked bar chart will look something like this: