Skip to main content

OpenTD .NET4 reference 2025 R2

OpenTD.Results.Plot.SimplePlot Class Reference

Last update: 16.07.2025

An implementation of Plot2d using the .NET charting tools. Use this class to create 2d plots of solution data. One limitation: currently SimplePlot only allows one axis in each position, i.e., a primary and secondary x axis, and a primary and secondary y axis. If you try to plot more axes, it will throw an exception. More...

Inheritance diagram for OpenTD.Results.Plot.SimplePlot:
OpenTD.Results.Plot.Plot2dOpenTD.Results.Dataset.IAutoNameOpenTD.Results.Dataset.IAutoComment

Public Member Functions

 SimplePlot (string title)
 
 SimplePlot ()
 
override Bitmap GetAsImage ()
 
override void Show ()
 
void SetSeriesPaletteColor (int index, Color color)
 
void SetPlotStyle (Plot2dStyle ps)
 
Plot2dStyle GetPlotStyle ()
 
void AutoSetMarkers ()
 
void AutoSetAxes ()
 Makes sure each series is assigned to an axis with the correct dimension. Throws away unused axes.
 
void AutoScaleAxes ()
 Scales each axis based on the series attached to it.
 
void AutoNameXAxes ()
 
void AutoNameYAxesBasedOnSubtype ()
 
void AddSeries (Series2d series)
 
void AddSeries (DataArray xData, DataArray yData)
 
void AddSeries (DataArray yData)
 
void AddSeries (DataArrayCollection dataCollection, bool useFirstArrayAsXData=false)
 
void AddSeries (DataSubtype subtype, IEnumerable< double > values, UnitsData units=null, ItemIdentifier item=null)
 
void AddSeries (IEnumerable< double > xData)
 
List< Series2d > GetSeriesOnAxis (Axis a)
 
void SaveAsImage (string pathname)
 
string GetAsTable (string delimiter=",", bool consolidateXData=true)
 
void SaveAsTable (string pathname, string delimiter=",", bool consolidateXData=true)
 Saves the plot as a tabular data.
 
override string ToString ()
 

Protected Member Functions

void CheckData ()
 
virtual void GetReadyToOutput ()
 
void AutoSetLegend ()
 
virtual string GetSelfSuggestedName ()
 
virtual string GetSelfSuggestedComment ()
 

Properties

Plot2dStyle Plot2dStyle [get, set]
 
string Title [get, set]
 
Series2dCollection Series [get, set]
 
List< Axis > XAxes [get, set]
 
List< Axis > YAxes [get, set]
 
Legend Legend [get, set]
 
double AutoScaleAxesMarginPercent [get, set]
 For axes that are autoscaled, this is the amount that each axis will be grown beyond the range of the data, as a percentage of the total range. Exceptions: if the minimum value of the data is 0, autoscaling will not extend the minimum value of the axis below 0. If the axis is for Record Numbers, autoscaling won't extend the minimum value of the axis below the first record number.
 
bool AutoUseMarkersForNonContinuousSeries [get, set]
 If true, series that are detected to be non-continuous (because one or more y-values is NaN, for example) will have markers turned on automatically, to help spot orphaned points or small curve segments. This also applies to series with just one point.
 
bool TryToNameYAxesBasedOnSeriesSubtype [get, set]
 Normally, Y axes are named based on their dimension, e.g., "Temperature". If this member is true, the plot will attempt to name them based on the subtype of the series applied to them, e.g., "Node Temperature" or "Lump Temperature". Defaults to false.
 
AutoNamer AutoNamer [get, set]
 
string Name [get, set]
 
string InternalSuggestedName [get, set]
 
AutoCommenter AutoCommenter [get, set]
 
string Comment [get, set]
 
string InternalSuggestedComment [get, set]
 

Detailed Description

An implementation of Plot2d using the .NET charting tools. Use this class to create 2d plots of solution data. One limitation: currently SimplePlot only allows one axis in each position, i.e., a primary and secondary x axis, and a primary and secondary y axis. If you try to plot more axes, it will throw an exception.

See also
OpenTD.Results.Plot.Plot2d

Constructor & Destructor Documentation

◆ SimplePlot() [1/2]

OpenTD.Results.Plot.SimplePlot.SimplePlot ( string title)
inline

◆ SimplePlot() [2/2]

OpenTD.Results.Plot.SimplePlot.SimplePlot ( )
inline

Member Function Documentation

◆ AddSeries() [1/6]

void OpenTD.Results.Plot.Plot2d.AddSeries ( DataArray xData,
DataArray yData )
inlineinherited

◆ AddSeries() [2/6]

void OpenTD.Results.Plot.Plot2d.AddSeries ( DataArray yData)
inlineinherited

◆ AddSeries() [3/6]

void OpenTD.Results.Plot.Plot2d.AddSeries ( DataArrayCollection dataCollection,
bool useFirstArrayAsXData = false )
inlineinherited

◆ AddSeries() [4/6]

void OpenTD.Results.Plot.Plot2d.AddSeries ( DataSubtype subtype,
IEnumerable< double > values,
UnitsData units = null,
ItemIdentifier item = null )
inlineinherited

◆ AddSeries() [5/6]

void OpenTD.Results.Plot.Plot2d.AddSeries ( IEnumerable< double > xData)
inlineinherited

◆ AddSeries() [6/6]

void OpenTD.Results.Plot.Plot2d.AddSeries ( Series2d series)
inlineinherited

◆ AutoNameXAxes()

void OpenTD.Results.Plot.Plot2d.AutoNameXAxes ( )
inlineinherited

◆ AutoNameYAxesBasedOnSubtype()

void OpenTD.Results.Plot.Plot2d.AutoNameYAxesBasedOnSubtype ( )
inlineinherited

◆ AutoScaleAxes()

void OpenTD.Results.Plot.Plot2d.AutoScaleAxes ( )
inlineinherited

Scales each axis based on the series attached to it.

Exceptions
OpenTDExceptionAutoScaleNumIntervals must be positive.

◆ AutoSetAxes()

void OpenTD.Results.Plot.Plot2d.AutoSetAxes ( )
inlineinherited

Makes sure each series is assigned to an axis with the correct dimension. Throws away unused axes.

◆ AutoSetLegend()

void OpenTD.Results.Plot.Plot2d.AutoSetLegend ( )
inlineprotectedinherited

◆ AutoSetMarkers()

void OpenTD.Results.Plot.Plot2d.AutoSetMarkers ( )
inlineinherited

◆ CheckData()

void OpenTD.Results.Plot.SimplePlot.CheckData ( )
inlineprotected

◆ GetAsImage()

override Bitmap OpenTD.Results.Plot.SimplePlot.GetAsImage ( )
inlinevirtual

Reimplemented from OpenTD.Results.Plot.Plot2d.

◆ GetAsTable()

string OpenTD.Results.Plot.Plot2d.GetAsTable ( string delimiter = ",",
bool consolidateXData = true )
inlineinherited

◆ GetPlotStyle()

Plot2dStyle OpenTD.Results.Plot.Plot2d.GetPlotStyle ( )
inlineinherited

◆ GetReadyToOutput()

virtual void OpenTD.Results.Plot.Plot2d.GetReadyToOutput ( )
inlineprotectedvirtualinherited

◆ GetSelfSuggestedComment()

virtual string OpenTD.Results.Plot.Plot2d.GetSelfSuggestedComment ( )
inlineprotectedvirtualinherited

◆ GetSelfSuggestedName()

virtual string OpenTD.Results.Plot.Plot2d.GetSelfSuggestedName ( )
inlineprotectedvirtualinherited

◆ GetSeriesOnAxis()

List< Series2d > OpenTD.Results.Plot.Plot2d.GetSeriesOnAxis ( Axis a)
inlineinherited

◆ SaveAsImage()

void OpenTD.Results.Plot.Plot2d.SaveAsImage ( string pathname)
inlineinherited

◆ SaveAsTable()

void OpenTD.Results.Plot.Plot2d.SaveAsTable ( string pathname,
string delimiter = ",",
bool consolidateXData = true )
inlineinherited

Saves the plot as a tabular data.

Parameters
pathnameThe output pathname.
delimiterThe column delimiter.
consolidateXDataif set to true, Will attempt to combine series x-values into the fewest possible columns. Will only combine x-values if they point to exactly the same source, i.e., it tests equality by reference, not by value.

◆ SetPlotStyle()

void OpenTD.Results.Plot.Plot2d.SetPlotStyle ( Plot2dStyle ps)
inlineinherited

◆ SetSeriesPaletteColor()

void OpenTD.Results.Plot.Plot2d.SetSeriesPaletteColor ( int index,
Color color )
inlineinherited

◆ Show()

override void OpenTD.Results.Plot.SimplePlot.Show ( )
inlinevirtual

Reimplemented from OpenTD.Results.Plot.Plot2d.

◆ ToString()

override string OpenTD.Results.Plot.Plot2d.ToString ( )
inlineinherited

Property Documentation

◆ AutoCommenter

AutoCommenter OpenTD.Results.Plot.Plot2d.AutoCommenter
getsetprotectedinherited

◆ AutoNamer

AutoNamer OpenTD.Results.Plot.Plot2d.AutoNamer
getsetprotectedinherited

◆ AutoScaleAxesMarginPercent

double OpenTD.Results.Plot.Plot2d.AutoScaleAxesMarginPercent
getsetinherited

For axes that are autoscaled, this is the amount that each axis will be grown beyond the range of the data, as a percentage of the total range. Exceptions: if the minimum value of the data is 0, autoscaling will not extend the minimum value of the axis below 0. If the axis is for Record Numbers, autoscaling won't extend the minimum value of the axis below the first record number.

◆ AutoUseMarkersForNonContinuousSeries

bool OpenTD.Results.Plot.Plot2d.AutoUseMarkersForNonContinuousSeries
getsetinherited

If true, series that are detected to be non-continuous (because one or more y-values is NaN, for example) will have markers turned on automatically, to help spot orphaned points or small curve segments. This also applies to series with just one point.

◆ Comment

string OpenTD.Results.Plot.Plot2d.Comment
getsetinherited

◆ InternalSuggestedComment

string OpenTD.Results.Plot.Plot2d.InternalSuggestedComment
getsetinherited

◆ InternalSuggestedName

string OpenTD.Results.Plot.Plot2d.InternalSuggestedName
getsetinherited

◆ Legend

Legend OpenTD.Results.Plot.Plot2d.Legend
getsetinherited

◆ Name

string OpenTD.Results.Plot.Plot2d.Name
getsetinherited

◆ Plot2dStyle

Plot2dStyle OpenTD.Results.Plot.Plot2d.Plot2dStyle
getsetinherited

◆ Series

Series2dCollection OpenTD.Results.Plot.Plot2d.Series
getsetinherited

◆ Title

string OpenTD.Results.Plot.Plot2d.Title
getsetinherited

◆ TryToNameYAxesBasedOnSeriesSubtype

bool OpenTD.Results.Plot.Plot2d.TryToNameYAxesBasedOnSeriesSubtype
getsetinherited

Normally, Y axes are named based on their dimension, e.g., "Temperature". If this member is true, the plot will attempt to name them based on the subtype of the series applied to them, e.g., "Node Temperature" or "Lump Temperature". Defaults to false.

◆ XAxes

List<Axis> OpenTD.Results.Plot.Plot2d.XAxes
getsetinherited

◆ YAxes

List<Axis> OpenTD.Results.Plot.Plot2d.YAxes
getsetinherited

The documentation for this class was generated from the following file:
  • C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/TDDEV_ALPHA/buildXX/OpenTD.Results/Plot/SimplePlot.cs

Connect with Ansys