Chart Functions

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Appendices > XSLT and XPath/XQuery Functions > Altova Extension Functions >

Chart Functions

The chart functions listed below enable you to create, generate, and save charts as images. They are supported in the current version of your Altova product in the manner described below. However, note that in future versions of your product, support for one or more of these functions might be discontinued or the behavior of individual functions might change. Consult the documentation of future releases for information about support for Altova extension functions in that release.

 

The chart functions are XPath functions (not XSLT functions), and organized into two groups:

 

Functions for generating and saving charts
Functions for creating charts

 

Note:Chart functions are supported only in Altova's Server products and the Enterprise Editions of Altova products.

 

Note:Supported image formats for charts in server editions are jpg, png, and bmp. The best option is png because it is lossless and compressed. In Enterprise editions, the supported formats are jpg. png, bmp, and gif.

 

 

Functions for generating and saving charts

These functions take the chart object (obtained with the chart creation functions) and either generate an image or save an image to file

 

altova:generate-chart-image ($chart, $width, $height, $encoding) as atomic

 

where

 

$chart is the chart extension item obtained with the altova:create-chart function
$width and $height must be specified with a length unit
$encoding may be binarytobase64 or binarytobase16

 

The function returns the chart image in the specified encoding.

 

altova:generate-chart-image ($chart, $width, $height, $encoding, $imagetype) as atomic

 

where

 

$chart is the chart extension item obtained with the altova:create-chart function
$width and $height must be specified with a length unit
$encoding may be base64Binary or hexBinary
$imagetype may be one of the following image formats: png, gif, bmp, jpg, jpeg. Note that gif is not supported on server products. Also see note at top of page.

 

The function returns the chart image in the specified encoding and image format.

 

altova:save-chart-image ($chart, $filename, $width, $height) as empty() (Windows only)

 

where

 

$chart is the chart extension item obtained with the altova:create-chart function
$filename is the path to and name of the file to which the chart image is to be saved
$width and $height must be specified with a length unit

 

The function saves the chart image to the file specified in $filename.

 

altova:save-chart-image ($chart, $filename, $width, $height, $imagetype) as empty() (Windows only)

 

where

 

$chart is the chart extension item obtained with the altova:create-chart function
$filename is the path to and name of the file to which the chart image is to be saved
$width and $height must be specified with a length unit
$imagetype may be one of the following image formats: png, gif, bmp, jpg, jpeg. Note that gif is not supported on server products. Also see note at top of page.

 

The function saves the chart image to the file specified in $filename in the image format specified.

 

 

Functions for creating charts

The following functions are used to create charts.

 

altova:create-chart($chart-config, $chart-data-series*) as chart extension item

 

where

 

$chart-config is the chart-config extension item obtained with the altova:create-chart-config function or or via the altova:create-chart-config-from-xml function
$chart-data-series is the chart-data-series extension item obtained with the altova:create-chart-data-series function or altova:create-chart-data-series-from-rows function

 

The function returns a chart extension item, which is created from the data supplied via the arguments.

 

altova:create-chart-config($type-name, $title) as chart-config extension item

 

where

 

$type-name specifies the type of chart to be created: Pie, Pie3d, BarChart, BarChart3d, BarChart3dGrouped, LineChart, ValueLineChart, RoundGauge, BarGauge
$title is the name of the chart

 

The function returns a chart-config extension item containing the configuration information of the chart.

 

altova:create-chart-config-from-xml($xml-struct) as chart-config extension item

 

where

 

$xml-struct is the XML structure containing the configuration information of the chart

 

The function returns a chart-config extension item containing the configuration information of the chart. This information is supplied in an XML data fragment.

 

altova:create-chart-data-series($series-name?, $x-values*, $y-values*) as chart-data-series extension item

 

where

 

$series-name specifies the name of the series
$x-values gives the list of X-Axis values
$y-values gives the list of Y-Axis values

 

The function returns a chart-data-series extension item containing the data for building the chart: that is, the names of the series and the Axes data.

 

altova:create-chart-data-row(x, y1, y2, y3, ...) as chart-data-x-Ny-row extension item

 

where

 

x is the value of the X-Axis column of the chart data row
yN are the values of the Y-Axis columns

 

The function returns a chart-data-x-Ny-row extension item, which contains the data for the X-Axis column and Y-Axis columns of a single series.

 

altova:create-chart-data-series-from-rows($series-names as xs:string*, $row*) as chart-data-series extension item

 

where

 

$series-name is the name of the series to be created
$row is the chart-data-x-Ny-row extension item that is to be created as a series

 

The function returns a chart-data-series extension item, which contains the data for the X-Axis and Y-Axes of the series.

 

altova:create-chart-layer($chart-config, $chart-data-series*) as chart-layer extension item

 

where

 

$chart-config is the chart-config extension item obtained with the altova:create-chart-config function or or via the altova:create-chart-config-from-xml function
$chart-data-series is the chart-data-series extension item obtained with the altova:create-chart-data-series function or altova:create-chart-data-series-from-rows function  

 

The function returns a chart-layer extension item, which contains chart-layer data.

 

altova:create-multi-layer-chart($chart-config, $chart-data-series*, $chart-layer*)

 

where

 

$chart-config is the chart-config extension item obtained with the altova:create-chart-config function or or via the altova:create-chart-config-from-xml function
$chart-data-series is the chart-data-series extension item obtained with the altova:create-chart-data-series function or altova:create-chart-data-series-from-rows function  
$chart-layer is the chart-layer extension item obtained with the altova:create-chart-layer function

 

The function returns a multi-layer-chart item.

 

altova:create-multi-layer-chart($chart-config, $chart-data-series*, $chart-layer*, xs:boolean $mergecategoryvalues)

 

where

 

$chart-config is the chart-config extension item obtained with the altova:create-chart-config function or or via the altova:create-chart-config-from-xml function
$chart-data-series is the chart-data-series extension item obtained with the altova:create-chart-data-series function or altova:create-chart-data-series-from-rows function  
$chart-layer is the chart-layer extension item obtained with the altova:create-chart-layer function

 

The function returns a multi-layer-chart item.

 


© 2019 Altova GmbH