Skip to main content

Motion Standalone Postprocessor C# library 2025 R2

Interface IOperationsLegendModifier

Last update: 16.07.2025

Namespace: VM.Operations.Post.Interfaces
Assembly: VM.Operations.Post.dll

This interface contains properties that modify the attributes of the Legend.

public interface IOperationsLegendModifier

Examples

To view the examples, refer to the location of the 'Install_Path\Motion\Document\Postprocessor API for Python.zip' file.

# IOperationsLegendModifier.py
import sys

current_dir = __file__.rsplit('\\', 1)[0]
external_modules_path = current_dir + '\\..\\..\\Modules'

sys.path.append(external_modules_path)
from OperationAPI import *

# Start the headless application interface
applicationHandler = ApplicationHandler()

# Import result file
result_file_path = get_result_file_path()

# Set array about result file
filepaths = List[str]()
filepaths.Add(result_file_path)

# Open about result files
applicationHandler.AddDocument(filepaths)

# Get Page
page = applicationHandler.GetActivePage()

# Create PlotView
chartView = page.CreateChart("Chart")

chartView.Legend.Background = Colors.Red
chartView.Legend.FontColor = Colors.Black
chartView.Legend.FontFace = FontFamily("Arial")
chartView.Legend.FontSize = 15
chartView.Legend.FontStyle = OperationAPIService.GetFontStyleFromString("Italic")
chartView.Legend.FontWeight = OperationAPIService.GetFontWeightFromString("Bold")
chartView.Legend.LegendPlacement = LegendPlacementType.Bottom
chartView.Legend.ItemsInFilter = "Visible Curves"

# Close the Pages
page.Close()

# Close the Document
applicationHandler.CloseDocument(result_file_path)

Properties

Background

Gets or sets the background color of the legend.

Color Background { get; set; }

Property Value

Color

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

This property allows you to set the background color of the legend. In the UI, this property is represented under the "Font" category with the property name "Background".

FontColor

Gets or sets the font color of the legend.

Color FontColor { get; set; }

Property Value

Color

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

This property allows you to set the font color of the legend. In the UI, this property is represented under the "Font" category with the property name "Color".

FontFace

Gets or sets the font face of the chart title.

FontFamily FontFace { get; set; }

Property Value

FontFamily

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

This property allows you to set the font face of the chart title. In the UI, this property is represented under the "Font" category with the property name "Face".

FontSize

Gets or sets the font size of the chart title.

double FontSize { get; set; }

Property Value

double

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

This property allows you to set the font size of the chart title. In the UI, this property is represented under the "Font" category with the property name "Size".

FontStyle

Gets or sets the font style of the chart title.

FontStyle FontStyle { get; set; }

Property Value

FontStyle

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

This property allows you to set the font style of the chart title. In the UI, this property is represented under the "Font" category with the property name "Style". The supported types are:

FontWeight

Gets or sets the font weight of the chart title.

FontWeight FontWeight { get; set; }

Property Value

FontWeight

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

This property allows you to set the font weight of the chart title. In the UI, this property is represented under the "Font" category with the property name "Weight". The available options are:

ItemsInFilter

Gets or sets the filter option for displaying curves in the chart.

string ItemsInFilter { get; set; }

Property Value

string

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

The ItemsInFilter property allows you to control which curves are shown in the chart. By specifying either AllSeries or AllVisibleSeries, you can choose to display all curves or only the visible ones. The available options are:

  • "All Curves"
  • "Visible Curves"

LegendPlacement

Gets or sets the position of the legend in the chart.

LegendPlacementType LegendPlacement { get; set; }

Property Value

LegendPlacementType

Examples

For an example that includes this property, see the Interface IOperationsLegendModifier.

Remarks

Use this property to control the placement of the legend within or outside the chart area. By default, the legend is placed inside the chart area. The placement can be adjusted to improve the visibility and layout of the chart.

Connect with Ansys