Class actuate.report.HTML5Chart.ClientChart
Description
A container for an HTML5-enabled chart element in a report. ClientChart provides functions to operate on a ClientChart element on the client side only, such as retrieving the chart size or setting the title and series values for the currently displayed chart.
Constructor
The ClientChart object is constructed by actuate.report.Chart.getClientChart( ).
Function summary
Table 44‑30 lists actuate.report.HTML5Chart.ClientChart functions.
Table 44‑30 actuate.report.HTML5Chart.ClientChart functions
Function
Description
Adds a series to the chart
Returns the number of categories in the chart
Returns the height of the chart in pixels
Returns the width of the chart in pixels
Returns the chart options
Returns the core Highcharts object
Returns the number of run-time series in the chart
Returns the maximum value of X-axis series
Returns the minimum value of X-axis series
Returns the maximum value of Y-axis series
Returns the minimum value of Y-axis series
Returns whether chart has axes
Redraws the chart according to chart options
Removes specified series
Hides or displays specified series
Updates chart title
Updates values of specified series
Changes the minimum and maximum of the X‑axis and zooms in on the new data range
Changes the minimum and maximum of the Y‑axis and zooms in on the new data range
addSeries
Syntax
void ClientChart.addSeries(string seriesName, Array values)
Adds a data series to this ClientChart.
Parameters
seriesName
String. A name for the series.
values
Array. The values for the series, defining X and Y value pairs.
Example
This example adds the monthly revenue series as an array of numbers:
myClientChart.addSeries('monthly revenue' , [1,5.5, 2,4.5, 3,7.8, 4,7.7, 5,1.2, 6,8.5 7,1.9, 8,4.5, 9,12, 10,9.1, 11,4, 12,6.6]);
getCategoryCount
Syntax
integer ClientChart.getCategoryCount( )
Returns the number of categories in this ClientChart.
Returns
Integer. The number of categories.
Example
This example displays the number of categories in myClientChart as an alert:
alert("This HTML5 client chart has" + myClientChart.getCategoryCount( ) + "categories." );
getChartHeight
Syntax
integer ClientChart.getChartHeight( )
Returns the height of this ClientChart in pixels.
Returns
Integer. The height of the chart in pixels.
Example
This example displays the height of myClientChart as an alert:
alert("Height: " + myClientChart.getHeight( ));
getChartWidth
Syntax
integer ClientChart.getChartWidth( )
Returns the width of this ClientChart in pixels.
Returns
Integer. The width of the chart in pixels.
Example
This example displays the width of myClientChart as an alert:
alert("Width: " + myClientChart.getChartWidth( ));
getClientOptions
Syntax
Returns the ClientOptions set for this ClientChart.
Returns
Example
This example retrieves the client options for myClientChart and stores them in the myClientOptions variable:
var myClientOptions = myClientChart.getClientOptions( );
getCore
Syntax
Returns the Highcharts object contained in this ClientChart.
Returns
Example
This example retrieves the Highcharts object from myClientChart and stores it in the myHighchart variable:
var myHighchart = myClientChart.getCore( );
getSeriesCount
Syntax
integer ClientChart.getSeriesCount( )
Returns the number of run-time series in this ClientChart.
Returns
Integer. The number of series.
Example
This example displays the number of run-time series in myClientChart as an alert:
alert("Runtime Series: " + myClientChart.getSeriesCount( ));
getXAxisMax
Syntax
float ClientChart.getXAxisMax( )
Returns the maximum value of the series associated with the X‑axis in this ClientChart.
Returns
Float. The axis series’ maximum.
Example
This example displays the maximum value of the series associated with the X‑axis in myClientChart as an alert:
alert("Max for X-axis series: " + myClientChart.getXAxisMax( ));
getXAxisMin
Syntax
float ClientChart.getXAxisMin( )
Returns the minimum value of the series associated with the X‑axis in this ClientChart.
Returns
Float. The axis series’ minimum.
Example
This example displays the minimum value of the series associated with the X‑axis in myClientChart as an alert:
alert("Min for X-axis series: " + myClientChart.getXAxisMin( ));
getYAxisMax
Syntax
float ClientChart.getYAxisMax( integer axisIndex)
Returns the maximum value of a series associated with the Y‑axis in this ClientChart.
Parameter
axisIndex
Integer. Optional. Axis index. The minimum value is 0, which is the default value, indicating the first Axis.
Returns
Float. The axis series’ maximum.
Example
This example displays the maximum value of the series associated with the Y‑axis in myClientChart as an alert:
alert("Max for Y-axis series: " + myClientChart.getYAxisMax( ));
getYAxisMin
Syntax
float ClientChart.getYAxisMin( integer axisIndex)
Returns the minimum value of a series associated with the Y‑axis in this ClientChart.
Parameter
axisIndex
Integer. Optional. Axis index. The minimum value is 0, which is the default value, indicating the first Axis.
Returns
Float. The axis series’ minimum.
Example
This example displays the minimum value of the series associated with the Y‑axis in myClientChart as an alert:
alert("Min for Y-axis series: " + myClientChart.getYAxisMin( ));
isChartWithAxes
Syntax
boolean ClientChart.isChartWithAxes( )
Returns whether this chart has axes.
Returns
Boolean. True indicates axes, false otherwise.
Example
This example displays whether myClientChart has axes:
alert("Chart has axes: " + myClientChart.isChartWithAxes( ));
redraw
Syntax
Redraws this ClientChart with options.
Parameter
chartOptions
Example
This example redraws myClientChart with the default options:
removeSeries
Syntax
void ClientChart.removeSeries(string seriesName, boolean redraw)
Removes a series by name.
Parameters
seriesName
String. The name of the series to remove.
redraw
Boolean. Optional. Specifies whether to redraw the chart. Default is true.
Example
This example removes the series monthly revenue from myClientChart and redraws the chart:
myClientChart.removeSeries('monthly revenue' , true );
setSeriesVisible
Syntax
void ClientChart.setSeriesVisible(string seriesName, boolean visible)
Makes a series visible.
Parameters
seriesName
String. The name of the series to change.
visible
Boolean. Optional. True indicates visible. Default is true.
Example
This example sets the series monthly revenue as visible for myClientChart:
myClientChart.setSeriesVisible('monthly revenue' , true );
setTitle
Syntax
void ClientChart.setTitle(string title)
Sets the title of this ClientChart.
Parameter
title
String. Chart title text.
Example
This example sets the title of myClientChart to 'Annual Report':
myClientChart.setTitle('Annual Report' );
setValues
Syntax
void ClientChart.setValues(string seriesName, float[ ] values, boolean redraw)
Sets the value for a series.
Parameters
seriesName
String. Name of the series to change.
values
Array of float. The values for the series, defining X and Y value pairs.
redraw
Boolean. Optional. Specifies whether to redraw the chart. Default is true.
Example
This example adds the monthly revenue series as an array of numbers:
myClientChart.setValues('monthly revenue' , [1,5.5, 2,4.5, 3,7.8, 4,7.7, 5,1.2, 6,8.5 7,1.9, 8,4.5, 9,12, 10,9.1, 11,4, 12,6.6]);
setXAxisRange
Syntax
void ClientChart.setXAxisRange(float min, float max, boolean redraw)
Sets the value range for the X‑axis.
Parameters
min
Float. A new minimum value.
max
Float. A new maximum value.
redraw
Boolean. Optional. Specifies whether to redraw the chart. Default is true.
Example
This example sets the X-axis range to 1 through 3 and redraws the chart:
myClientChart.setXAxisRange(1,3);
setYAxisRange
Syntax
void ClientChart.setYAxisRange(float min, float max, boolean redraw, integer axisIndex)
Sets the value range for the Y‑axis.
Parameters
min
Float. A new minimum value.
max
Float. A new maximum value.
redraw
Boolean. Optional. Specifies whether to redraw the chart. Default is true.
axisIndex
Integer. Optional. Axis index. The minimum value is 0, which is the default value, indicating the first Axis.
Example
This example sets the Y‑axis range to 0 through 15 and redraws the chart:
myClientChart.setYAxisRange(0,15);