Altova XMLSpy 2024 Enterprise Edition

Charts can be created in Grid View by using the Altova XPath/XQuery extension named altovaext:chart (see screenshots below). This extension is described below. It is also described along with other chart extensions in the section Chart Functions.

 

Chart example in XML

The altovaext:chart extension shown in the screenshot below is used in an XQuery Let expression that is defined inside a Grid View formula. The chart is displayed as an image below the formula. You can use the XML document listing and the XQuery expression given below to try out the charts function.

Click to expand/collapse

 

 

Chart example in JSON

The altovaext:chart extension shown in the screenshot below is used in an XQuery Let expression that is defined inside a Grid View formula. The chart is displayed as an image below the formula. This chart example is in the file Chart.jsonc, which is located in the Examples folder of your (My) Documents folder and also accessible via the Examples project.) The JSON document listing is also given below for your convenience so that you can more easily try out the charts function. The charts function is contained in the JSON document listing, but it is also listed separately below.

Click to expand/collapse

 

 

 

Using the Altova Charts extension

 

The charts extension function altovaext:chart must use the namespace prefix altovaext:.

The function altovaext:chart takes two arguments: (i) chart configuration information, and (ii) chart data series information.

The chart configuration information is the first argument of altovaext:chart. It is an unordered series of four key–value pairs. These pairs are for (i) the chart's title (key is title), (ii) the kind of chart, such as pie chart, line chart, etc (key is kind; see Chart Functions for available kinds), (iii) chart width in pixels (integers only; key is width), and (iv) chart height in pixels (integers only; key is height). If either, the width or height value, or both values are not given, then the missing value or values are auto-calculated on the basis of the data.

In the screenshot of the JSON example above, the configuration information is stored in the ChartConfig object, which is referenced in the altovaext:chart function.

The chart data series is the second argument of altovaext:chart. Each data series is an array of size 3: (i) the name of the series, (ii) the x-axis values, (ii) the y-axis values. If you wish to create multiple series (for example where each series represents a line, as in the example above) then create a sequence of multiple arrays.

The XML example above has two data series; for the minimum, and maximum temperatures. The data for the X and Y axes are referenced from the sequence of all Month elements.

The JSON example above has three data series; for the minimum, maximum, and average temperatures. The data for the X and Y axes are referenced from the array named Temperatures.

 

For more information, see the section Chart Functions.

 

© 2018-2024 Altova GmbH