Returns the content of the page to which this chart belongs.
Returns
actuate.report.PageContent. The report content.
Example
This example displays the viewer ID of the page content in an alert box:
function showViewID(myChart){
var pageContent = myChart.getPageContent( );
var pageViewerID = pageContent.getViewerId( );
alert (pageViewerID);
}
getType
Syntax
string Chart.getType( )
Returns the chart’s report element type.
Returns
String. This method returns the string "Chart" when the type is actuate.report.Chart.CHART and the string "Flash Chart" when the type is actuate.report.Chart.FLASH_CHART.
Example
This example displays the chart type in an alert box:
alert ("Chart is of type " + myChart.getType( ));
hide
Syntax
void Chart.hide( )
Hides this element.
Example
To hide the chart bchart, use code similar to the following:
alert("Hiding chart" + bchart.getBookmark( ));
bchart.hide( );
bchart.submit( );
setChartTitle
Syntax
void Chart.setChartTitle(string title)
Sets the title for this chart element.
Parameter
title
String. The title for the chart.
Example
This example sets the chart’s title to the bookmark name:
Sets the number of dimensions for the chart element. The chart dimension only works if supported by the chart’s type. A 3D chart does not support multiple value axes. Remove all of the y-axes after the first before converting a chart to 3D.
Parameter
dimension
actuate.report.Chart. The number of dimensions in which to display the chart element. Supported values are 2D and 2D with depth. The constants defined for this argument are:
Applies filters to this chart element. To apply more than one filter to a chart element, call this function multiple times, once for each filter object.
Parameters
filter
An actuate.data.Filter object. A single filter condition to apply to this chart element.
filters
An array of actuate.data.Filter objects. Filter conditions to apply to this chart element.
Example
This example applies a filter to the chart and changes the chart’s title to reflect the filter:
function chartFilter(bchart){
var filter = new actuate.data.Filter("PRODUCTLINE", "=",
"Trucks and Buses");
var filters = new Array( );
filters.push(filter);
bchart.setFilters(filters);
bchart.setChartTitle("Orders By Country (Trucks and Buses)");
bchart.submit( );
}
setSize
Syntax
void Chart.setSize(integer width, integer height)
Sets the width and height of the chart element displayed.
Parameters
width
Integer. The width in pixels.
height
Integer. The height in pixels.
Example
To set the chart bchart to be 600 pixels wide by 800 pixels high, use code similar to the following:
alert("Resizing " + bchart.getBookmark( ) + " to 600x800");
bchart.setSize(600,800);
bchart.submit( );
setSubType
Syntax
void Chart.setSubType(string chartType)
Sets a subtype for this chart element. When the report calls submit( ), the report redraws the chart element as the requested type.
Parameter
chartType
String. The format in which to redraw the chart element. The constants that define the chart subtypes are:
CHART_SUBTYPE_PERCENTSTACKED
CHART_SUBTYPE_SIDEBYSIDE
CHART_SUBTYPE_STACKED
Example
To change the subtype of the chart bchart to side-by-side, use code similar to the following:
To reveal the hidden chart bchart, use code similar to the following:
alert("Showing chart" + bchart.getBookmark( ));
bchart.show( );
bchart.submit( );
submit
Syntax
void Chart.submit(function callback)
Submits all the asynchronous operations for this chart. The submit( ) function triggers an AJAX request for all asynchronous operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the chart container.
Parameter
callback
Function. Optional. A function to execute after the asynchronous call processing is done. Submit passes the current actuate.Viewer object to the callback as an input parameter.
Example
This example sets the chart’s title to the bookmark name and pops up an alert box after calling submit( ):