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 4-30 lists actuate.report.HTML5Chart.ClientChart functions.
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
actuate.report.HTML5Chart.ClientChart.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]);
actuate.report.HTML5Chart.ClientChart.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.");
actuate.report.HTML5Chart.ClientChart.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( ));
actuate.report.HTML5Chart.ClientChart.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( ));
actuate.report.HTML5Chart.ClientChart.getClientOptions
Syntax
actuate.report.HTML5Chart.ClientOption ClientChart.getClientOptions( )
Returns the ClientOptions set for this ClientChart.
Returns
actuate.report.HTML5Chart.ClientOption object. The client options.
Example
This example retrieves the client options for myClientChart and stores them in the myClientOptions variable:
var myClientOptions = myClientChart.getClientOptions( );
actuate.report.HTML5Chart.ClientChart.getCore
Syntax
actuate.report.HTML5Chart.Highcharts ClientChart.getCore( )
Returns the Highcharts object contained in this ClientChart.
Returns
actuate.report.HTML5Chart.Highcharts object. A highchart.
Example
This example retrieves the Highcharts object from myClientChart and stores it in the myHighchart variable:
var myHighchart = myClientChart.getCore( );
actuate.report.HTML5Chart.ClientChart.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( ));
actuate.report.HTML5Chart.ClientChart.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( ));
actuate.report.HTML5Chart.ClientChart.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( ));
actuate.report.HTML5Chart.ClientChart.getYAxisMax
Syntax
float ClientChart.getYAxisMax( integer axisIndex)
Returns the maximum value of a series associated with the Y-axis in this ClientChart.
Parameters
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( ));
actuate.report.HTML5Chart.ClientChart.getYAxisMin
Syntax
float ClientChart.getYAxisMin( integer axisIndex)
Returns the minimum value of a series associated with the Y-axis in this ClientChart.
Parameters
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( ));
actuate.report.HTML5Chart.ClientChart.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( ));
actuate.report.HTML5Chart.ClientChart.redraw
Syntax
void ClientChart.redraw(actuate.report.HTML5Chart.ClientOption chartOptions)
Redraws this ClientChart with options.
Parameters
chartOptions
actuate.report.HTML5Chart.ClientOption object. Optional. The chart options.
Example
This example redraws myClientChart with the default options:
myClientChart.redraw( );
actuate.report.HTML5Chart.ClientChart.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);
actuate.report.HTML5Chart.ClientChart.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);
actuate.report.HTML5Chart.ClientChart.setTitle
Syntax
void ClientChart.setTitle(string title)
Sets the title of this ClientChart.
Parameters
title
String. Chart title text.
Example
This example sets the title of myClientChart to 'Annual Report':
myClientChart.setTitle('Annual Report');
actuate.report.HTML5Chart.ClientChart.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]);
actuate.report.HTML5Chart.ClientChart.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);
actuate.report.HTML5Chart.ClientChart.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);

Additional Links:

Copyright Actuate Corporation 2012