QPR Knowledge Base 2019.1

GetGraph

GetGraph

Previous topic Next topic  

GetGraph

Previous topic Next topic  

Revision history:

Introduced in QPR 8.0

Last changed in QPR 8.2

 

Returns a graph image from an element defined in the function call. With parameters you can define the type and attributes of the fetched graph.

 

Synopsis:

 

BinaryData GetGraph(string sessionId, string objectId, string options)

 

Return Value:

 

Graph as a BinaryData object. The BinaryData object has the following member variables:

Content (Byte[]). Actual binary content
FileName (String). Name generated for the file.
MimeType (String). MIME type of the binary content.

 

Parameters:

 

sessionId: String. ID of an authenticated session.

objectId: String. ID of an object from which a graph is fetched.

options: String. List of comma-separated attributes:

GraphType:
oPG
oprocesslevel (default): Returns a diagram image. The default image size is the size of the bitmap with 100% zoom. Parameters:
See common graph parameters
oSC
scorecardview (default): Returns a hierarchy view. The default image size is the size of the bitmap with 100% zoom. Parameters:
See common graph parameters
See common SC graph parameters
strategymapview: Returns a dashboards view. The default image size is the size of the bitmap with 100% zoom. Parameters:
See common graph parameters
See common SC graph parameters
graph: Returns the graph defined for the element. The default image size is the size of the bitmap with 100% zoom. Parameters:
See common graph parameters
See common SC graph parameters
See common SC chart parameters
rangecolor: Returns a circle filled with the range color of the defined element. Parameters:
See common graph parameters
See common SC graph parameters
trend: Returns the trend arrow. The default image size is 16x16 with the default trend arrow. Parameters:
See common graph parameters
See common SC graph parameters

 

Common graph parameters:
ozoom = <zoom value>: Zoom level. This needs to be a positive integer with an optional "%" suffix.
owidth = <image width in pixels>: This parameter overrides the default image width value.
oheight = <image height in pixels>: This parameter overrides the default image height value.
otype = <image type>: Type of the image in the returned binary content. Supported formats: bmp, png, and jpg. Also wmf is supported for QPR Metrics graphs.
oviewsettings = <name or FullID>: Name or full ID of views or graph template depending on the graph type. This option is supported with all graph types except for trend and rangecolor. In case this parameter is omitted or the value refers to invalid or non-existent view/template, the default one is used.

 

Common PG graph parameters:
ocliprect = <left>,<top>,<right>,<bottom>: This parameter is used to retrieve an image of the desired section of the actual image. The coordinates are in the physical pixel coordinates of the actual full image.
odraworganizations = This parameter is used to force the organization units to be drawn into the image clipped with the cliprect parameter. Possible values are 0 (no, default value) and 1 (yes).

 

Common SC graph parameters:
operiod = <ID, full ID, or name of a period>. Select the period that is used. Also the following special values are available:
o-1 = latest
o-2 = current
o-3 = latest for all
o-4 = chart period (uses settings defined in QPR Metrics client)
o-5 = previous
o-6 = nexts
oseries = <ID, full ID, or symbol of a series>. Select the series that is used. Also the following special values are available:
-1 = default series

 

Language parameters similarly as in the QueryObjects function.

 

 

Example Procedure:

 

ServiceClient client = new ServiceClient("WSHttpBinding_IService");

string sessionId = client.Authenticate("qpr", "demo");

BinaryData graphImage = client.GetGraph(sessionId, "SC.12345.6789", "GRAPHTYPE=STRATEGYMAPVIEW, PERIOD=-2, WIDTH=200, HEIGHT=100");

MemoryStream ms = new MemoryStream(graphImage.content);

GraphImageBox.Image = Image.FromStream(ms);

client.Close();