OpenTD.Results.Plot.Plot2d Class Reference
Last update: 16.07.2025An abstract class representing a 2d plot. Inherit from it to take advantage of its many helpful features, such as auto-naming, auto-creating and scaling axes, etc. SimplePlot is a concrete definition of a Plot2d that uses the .NET charting tools. There are methods to display the plot on the screen, save it as a bitmap, and to output it as a table of data. More...

Public Member Functions | |
| Plot2d (string title) | |
| void | SetSeriesPaletteColor (int index, Color color) |
| void | SetPlotStyle (Plot2dStyle ps) |
| Plot2dStyle | GetPlotStyle () |
| Plot2d () | |
| 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) |
| virtual Bitmap | GetAsImage () |
| 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. | |
| virtual void | Show () |
| override string | ToString () |
Protected Member Functions | |
| 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 abstract class representing a 2d plot. Inherit from it to take advantage of its many helpful features, such as auto-naming, auto-creating and scaling axes, etc. SimplePlot is a concrete definition of a Plot2d that uses the .NET charting tools. There are methods to display the plot on the screen, save it as a bitmap, and to output it as a table of data.
Constructor & Destructor Documentation
◆ Plot2d() [1/2]
|
inline |
◆ Plot2d() [2/2]
|
inline |
Member Function Documentation
◆ AddSeries() [1/6]
◆ AddSeries() [2/6]
|
inline |
◆ AddSeries() [3/6]
|
inline |
◆ AddSeries() [4/6]
|
inline |
◆ AddSeries() [5/6]
|
inline |
◆ AddSeries() [6/6]
|
inline |
◆ AutoNameXAxes()
|
inline |
◆ AutoNameYAxesBasedOnSubtype()
|
inline |
◆ AutoScaleAxes()
|
inline |
Scales each axis based on the series attached to it.
- Exceptions
-
OpenTDException AutoScaleNumIntervals must be positive.
◆ AutoSetAxes()
|
inline |
Makes sure each series is assigned to an axis with the correct dimension. Throws away unused axes.
◆ AutoSetLegend()
|
inlineprotected |
◆ AutoSetMarkers()
|
inline |
◆ GetAsImage()
|
inlinevirtual |
Reimplemented in OpenTD.Results.Plot.SimplePlot.
◆ GetAsTable()
|
inline |
◆ GetPlotStyle()
|
inline |
◆ GetReadyToOutput()
|
inlineprotectedvirtual |
◆ GetSelfSuggestedComment()
|
inlineprotectedvirtual |
◆ GetSelfSuggestedName()
|
inlineprotectedvirtual |
◆ GetSeriesOnAxis()
◆ SaveAsImage()
|
inline |
◆ SaveAsTable()
|
inline |
Saves the plot as a tabular data.
- Parameters
-
pathname The output pathname. delimiter The column delimiter. consolidateXData if 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()
|
inline |
◆ SetSeriesPaletteColor()
|
inline |
◆ Show()
|
inlinevirtual |
Reimplemented in OpenTD.Results.Plot.SimplePlot.
◆ ToString()
|
inline |
Property Documentation
◆ AutoCommenter
|
getsetprotected |
◆ AutoNamer
|
getsetprotected |
◆ AutoScaleAxesMarginPercent
|
getset |
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
|
getset |
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
|
getset |
Implements OpenTD.Results.Dataset.IAutoComment.
◆ InternalSuggestedComment
|
getset |
Implements OpenTD.Results.Dataset.IAutoComment.
◆ InternalSuggestedName
|
getset |
Implements OpenTD.Results.Dataset.IAutoName.
◆ Legend
|
getset |
◆ Name
|
getset |
Implements OpenTD.Results.Dataset.IAutoName.
◆ Plot2dStyle
|
getset |
◆ Series
|
getset |
◆ Title
|
getset |
◆ TryToNameYAxesBasedOnSeriesSubtype
|
getset |
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
|
getset |
◆ YAxes
|
getset |
The documentation for this class was generated from the following file:
- C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/OpenTD/OpenTD.Results/Plot/Plot2d.cs