Main Content

Modify the Graphical Properties of Your Chart

About Editor Objects

The Editor object provides access to the purely graphical properties and methods of Chart objects. Each Chart object has its own Editor object.

Access the Editor Object

You cannot directly create or destroy the Editor and Clipboard objects as you do other Stateflow® API objects. However, you can attach a handle to them to use their properties and methods for modifications to Stateflow charts.

When you create a chart, an Editor object is automatically created for it. If ch is a workspace handle to a chart, you create a handle to the Editor object for that chart with this command:

ed = ch.Editor;

Change the Display in the Stateflow Editor

Use the handle ed from the preceding example to access the Editor object properties and methods. For example, this command calls the zoomIn method to zoom in the chart by a factor of 20%:


Or, you can simply set the ZoomFactor property to an absolute zoom factor of 150%:

ed.ZoomFactor = 1.5;

The ZoomFactor is based on a Dots Per Inch (DPI) of 72. If your screen DPI is different, for example 96, and you want to change the zoom level of the chart, you must to scale your ZoomFactor accordingly. For example, if you want 100%, you would set the ZoomFactor to 72/96 (0.75).

You can also use an Editor object to change the window position of the Stateflow Editor. For more information, see Stateflow.Editor.

Related Topics