Using the Chart Wizard

Top Previous Topic Next Topic  Print this topic

XF Designer 2011 supports charts defined in the Ecrion XChart format. They can be embedded in XSL-FO via the fo:instream-foreign-object element. You can create charts dynamically from XML data using an XFD template and the Insert Chart Wizard. That means that you should first assign a data source to the document.

 

To insert a chart, use the Chart button in the Graphics group under the Insert tab.

 

insert_chart

 

The Insert Chart Wizard will appear:

 

insert_chart_wizard

 

Select a chart type and click Next to continue.

 

We will create a sample 3D bar chart using data from the following source XML:

 

<?xml version="1.0" encoding="utf-8"?>

<root>

       <bar>

               <serie>

                       <data value="24.5" caption="Value 1" width="20px" color="red"/>

                       <data value="15.5" caption="Value 2" width="20px" color="green"/>

                       <data value="25" caption="Value 3" width="20px" color="purple"/>

                       <data value="35" caption="Value 4" width="20px" color="orange"/>

               </serie>

       </bar>

</root>

 

The next step allows defining one or more data series for the selected chart:

 

insert_chart_wizard_bar

 

Charts are created using repeating elements from the source XML file.

Choose the repeating element that should be the base for the current serie as the Base XPath.

Next, choose Value, Category, Fill Color, Width and Description as either static values or XPaths relative to the base XPath. In this example, the first two fields are dynamic, while the rest are static.

 

Note: In this example, we have selected a 3D bar chart. For other charts, the fields in the value and aspect properties may differ, but the behavior is the same.

 

Click OK to add the chart to the document.

 

The end result should be the following:

 

sample_bar_chart_3d

 

To edit the chart, double-click it in Design View and the previous wizard will appear, allowing you to make the changes you wish to make.