Working with SVG (Scalable Vector Graphics) in a Cockpit

You can work with SVG (Scalable Vector Graphics) in text areas in cockpits. This means that you can insert rich and intuitive representations of the simulation results, and still animate the results.

Note: If the cockpit contains a parametric task, dynamic update of text areas is not supported.

See Also
Simulating a Model in a Cockpit
Managing Properties
Editing Parameters and Variables
  1. In a cockpit, from the Cockpit section of the action bar, click Create Text Area .
  2. To activate the text area, click it.
    A toolbar appears, with common text creating options, including PDF file creation, and adding of links, images, tables, and expressions.
  3. To insert SVG content, click SVG from the toolbar.
  4. In the SVG Editor that appears, you can enter raw SVG code or use SVG templates:
    • You can enter raw SVG code in the editor.
      Notes:
      • Only a subset of SVG is supported. CSS styling, scripting, and other advanced SVG tags are not allowed. To see the supported SVG tags, you can click Help ? in the editor.
      • You can use dynamic variables and expressions like %variable and %(expression) anywhere inside the SVG code. When you simulate a model, they are replaced by their actual values for each time frame. As an example, the following text shows the time during the simulation:
        <svg height="20" width="80"><text y="15">%Time</text></svg>
        For more about dynamic variables and expressions as such, see Working with Dynamic Texts in a Cockpit.
      • You can add SVG content that you have created using other tools, but the limitation on what tags that are supported is still valid. You can add the content and click OK. A message appears with information of errors, like tags not supported. You can use this information to edit your content.
      When you click OK, the SVG code result, if correct, is added in the text area.
    • You can use SVG templates the following way:
      1. In the editor, click Use a template.
      2. From the displayed templates, select a template.
      3. To control the animation of the template, enter dynamic variables.
      4. Click OK.

        The SVG template result is added in the text area.