How to create a pie graph Web part

book

Article ID: 180947

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

 

Resolution

Question
How do I create a pie graph Web part for Altiris Console 6.5?

Answer

In order to create a pie graph, you must use the pie graph control included with Altiris Console 6.5. This control is used to display a set of data in the form of a pie graph, which means the data represented must include a total sum of parts and the appropriate fractional components. This allows the pie graph control to interpret the data as percentages that can be drawn as "slices" of the pie.

The Web part must be configured to use this control to display the pie graph. The first step in setting this up is to configure the Web part to use the pie graph control. In the Web Part Configuration page, make sure the Show URL radio button is selected in the Web Parts Contents of the page. The URL to the pie graph control must be typed into the box to the right, and it will look like the following:

/Altiris/Console/WebParts/GraphOutput.aspx?ItemGuid={REPORT_GUID.EN_US}

The report_GUID in the previous example must be the GUID of an existing report in the Altiris database. There are a few ways to get the GUID of the report. Here are two easy ways to accomplish this:

  1. Right-click on the report in the Altiris Console and select Properties from the context sensitive menu. This will cause a new window to open. The GUID is listed under the tab marked General.
  2. Right-click on the report in the Altiris Console and select View as XML from the context sensitive menu. This will cause a new window to open. The GUID of the report can be found at the top of the XML document or in the URL bar of the Web browser.

This report must also have a specific format in order for the pie graph control to process the information correctly. The columns included in the report must be as follows:

  1. [Name]—the name that will appear in the legend of the pie graph.
  2. [Value]—the value associated with the name as it appears in the legend of the pie graph.
  3. [_Color]—the value (in hex) of the color that will be displayed in the pie graph for the entry.
  4. [_Order]—the order in which the names will appear from top to bottom in the legend of the pie graph.
  5. [_ReportTitleURL]—the item that will be opened in the Altiris Console when the link at the bottom of the pie graph control is clicked by the user.

There are a couple of items to note regarding this report format:

  1. The top row of the report will be used by the pie graph control as the complete data set for processing the pie graph.  An ORDER BY clause on the [_Order] column should be used to ensure the correct row appears at the top of the report for proper processing by the control.
  2. The [_ReportTitleURL] must be the same for every row. Only a single link is available in the pie graph control. Every row must reflect the same value.

A valid report will have results similar to the following table:

 Name  Value  _Color  _ReportTitleURL  _Order
 Total Checks  562  000000  /Altiris/NS/Admin/Reports/report_summary.aspx?Guid=<guid>  1
 Number OK  244  20c638  /Altiris/NS/Admin/Reports/report_summary.aspx?Guid=<guid>  2
 Number Not OK  254  d5e15c  /Altiris/NS/Admin/Reports/report_summary.aspx?Guid=<guid>  3
 Info  0  32ced3  /Altiris/NS/Admin/Reports/report_summary.aspx?Guid=<guid>  4
 Error  64  d53c45  /Altiris/NS/Admin/Reports/report_summary.aspx?Guid=<guid>  5

In this example the row, "Total Checks" will be used as the 100 percent reference point for the pie graph. The "slices" of the pie graph will be drawn as fractions compared to this number. For example, the "Number OK" slice will be calculated as 244/562 (43.42%). The pie chart will contain a slice representing 43.42% of the pie in the color 20c638 (hex).

The _ReportTitleURL field in this example points to another report represented by the value <guid>. Replace the entire value <guid> (including angled brackets) with the GUID of the report you want to open when the user clicks on the link that appears beneath the pie graph.  The name of this link will be the name of the report identified by the value <guid>.

The SQL needed to generate this report will generally require the use of the UNION operator. The previous table was created with the SQL command below. This is meant to provide an example for you to use to create your own reports that can be consumed by the pie graph control. An XML version of the report is also included in this article. This report can be imported into an Notification Server as a sample; however, this particular example will only return valid results if the Audit Integration Component for SecurityExpressions is installed on the Notification Server.

SELECT 'Total Checks' AS [Name],
   SUM(OK) + SUM([Not OK]) + SUM(Info) + SUM(Error) As [Value],
   '000000' AS [_Color],
   '/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=a6f4f35f-6b42-47c7-b154-6afac8b5eab4' AS [_ReportTitleURL],
   '1' AS [_Order]
FROM Inv_Audit_Results_Summary
UNION
SELECT 'Number OK' AS [Name],
   SUM(OK) As [Value],
   '20c638' AS [_Color],
   '/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=a6f4f35f-6b42-47c7-b154-6afac8b5eab4' AS [_ReportTitleURL],
   '2' AS [_Order]
FROM Inv_Audit_Results_Summary
UNION
SELECT 'Number Not OK' AS [Name],
   SUM([Not OK]) As [Value],
   'd5e15c' AS [_Color],
   '/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=a6f4f35f-6b42-47c7-b154-6afac8b5eab4' AS [_ReportTitleURL],
   '3' AS [_Order]
FROM Inv_Audit_Results_Summary
UNION
SELECT 'Info' AS [Name],
   SUM(Info) As [Value],
   '32ced3' AS [_Color],
   '/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=a6f4f35f-6b42-47c7-b154-6afac8b5eab4' AS [_ReportTitleURL],
   '4' AS [_Order]
FROM Inv_Audit_Results_Summary
UNION
SELECT 'Error' AS [Name],
   SUM(Error) As [Value],
   'd53c45' AS [_Color],
   '/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=a6f4f35f-6b42-47c7-b154-6afac8b5eab4' AS [_ReportTitleURL],
   '5' AS [_Order]
FROM Inv_Audit_Results_Summary
ORDER BY [_Order]

Attachments

Graph Audit Checks.xml get_app