IVZDataVisualizer.LoadFromXml

Syntax

LoadFromXml(Value: String);

Parameters

Value. Visualizator parameters in XML format.

Description

The LoadFromXml method loads XML parameters of visualizer: style and data.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. Add links to the Express, Metabase, Visualizators, and Xml system assemblies.

Before executing the example, the bubble tree looks as shown on the IVZBubbleTree interface description page. Get style parameters in the XML format for this tree and change the color of labels that are outside the bubbles:

Public Sub UserProc;
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    BubbleTreeXML: String; // Style settings in XML format
    //To work with XML structure
    XMLDoc: IXMLDOMDocument; 
    Loaded: Boolean; 
    Nodes: IXmlDomNodeList; 
    Node, NodeAttr: IXmlDomNode; 
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get bubble tree parameters in XML format  
    BubbleTreeXML := BubbleTree.SaveToXml;
    // Create a structure to change XML
    XMLDoc := New DOMDocument.Create;
    Loaded := XMLDoc.loadXML(BubbleTreeXML);
    If Loaded Then
        // Get the Font node
        Nodes := XMLDOc.getElementsByTagName("Font");
        Node := Nodes.item(1);
        // Search for the Color attribute
        NodeAttr := Node.attributes.getNamedItem("Color");
        // Set other color
        NodeAttr.nodeValue := "#FF404EED";
        // Get changed XML
        BubbleTreeXML := XMLDoc.xml;
    End If;
    // Set new values of bubble tree style parameters from XML
    BubbleTree.LoadFromXml(BubbleTreeXML);
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the color of the labels that are outside the bubble is changed for blue.

See also:

IVZDataVisualizer