GraphModel class is used to output graph data and image files.
The class can be called from DataManager class.
.
More...
Public Member Functions | |
| void | AddDataSet (DataSet *set, int pos=-1) |
| Adds dataset to a graph. More... | |
| Variant | GetAllXAxisTypes () |
| Returns a list of type names of X-axis types that can be set. More... | |
| bool | GetAverageVisible (Variant val) |
| Returns whether or not the line average is displayed or hidden on the graph by specifying the line ID or name. More... | |
| Variant | GetColor (Variant val) |
| Returns the line color on the graph by specifying the line ID or name. More... | |
| Variant | GetGraphProperty (String &name) |
| Returns setting for an item. More... | |
| bool | GetHCrossPoint (Variant val) |
| Returns whether or not the cross point (horizontal) of the line is displayed or hidden on the graph by specifying the line ID or name. More... | |
| String | GetLineName (int line) |
| Returns the line name by specifying the Line ID. More... | |
| Variant | GetLineType (Variant val) |
| Returns the graph type of the line on the graph by specifying the line ID or name. More... | |
| bool | GetLineVisible (Variant val) |
| Returns whether or not the line is displayed or hidden on the graph by specifying the line ID or name. More... | |
| String | GetName () |
| Returns the name of graph model as a string. More... | |
| bool | GetRMSVisible (Variant val) |
| Returns whether or not the line RMS is displayed or hidden on the graph by specifying the line ID or name. More... | |
| Variant | GetSymbol (Variant val) |
| Returns the line symbol on the graph by specifying the line ID or name. More... | |
| bool | GetVCrossPoint (Variant val) |
| Returns whether or not the cross point (vertical) of the line is displayed or hidden on the graph by specifying the line ID or name. More... | |
| String | GetXAxisType () |
| Returns current X-axis type. More... | |
| Variant | GetYAxisPosition (Variant val) |
| Returns the Y-axis of the line on the graph by specifying the line ID or name. More... | |
| void | Hide () |
| Hides the [Graph] dialog. | |
| virtual bool | IsValid () |
| Returns True if an object is valid. More... | |
| int | NumLines () |
| Returns the number of lines for a graph model. More... | |
| bool | SaveGraphImage (String &filename, int width, int height) |
| Specifies the size of the graph image and saves it. More... | |
| void | SetAverageVisible (Variant val, bool show) |
| Specifies whether or not to display or hide the line average on the graph. The line is specified by its name or ID. More... | |
| void | SetColor (Variant val, Variant value) |
| Specifies the color of the line on the graph. The line is specified by its name or ID. More... | |
| void | SetGraphProperty (String &name, Variant var) |
| Specifies the graph properties by specifying the item name and the value. More... | |
| void | SetHCrossPoint (Variant val, bool show) |
| Specifies whether or not to display or hide the cross point (horizontal) on the graph. The line is specified by its name or ID. More... | |
| void | SetLineName (int line, String &name) |
| Specifies line ID and sets name for line. More... | |
| void | SetLineType (Variant val, Variant value) |
| Specifies the graph type of the line on the graph. The line is specified by its name or ID. More... | |
| void | SetLineVisible (Variant val, bool show) |
| Specifies whether or not to display or hide lines in a graph. The line is specified by its name or ID. More... | |
| void | SetName (String &name) |
| Specifies the name of a graph model. | |
| void | SetRMSVisible (Variant val, bool show) |
| Specifies whether or not to display or hide the line RMS. The line is specified by its name or ID. More... | |
| void | SetSymbol (Variant val, Variant value) |
| Specifies the symbol of the line on the graph. The line is specified by its name or ID. More... | |
| void | SetVCrossPoint (Variant val, bool show) |
| Specifies whether or not to display or hide the cross point (vertical) on the graph. The line is specified by its name or ID. More... | |
| void | SetXAxisType (String &type) |
| Changes X-axis type to another type. More... | |
| void | SetYAxisPosition (Variant val, Variant value) |
| Specifies the label position of the Y-axis of the line on the graph. The line is specified by its name or ID. More... | |
| void | Show () |
| Displays the [Graph] dialog. | |
| void | WriteAllCaseTable (String &filename) |
| Exports the data of all cases to a file. More... | |
| void | WriteAllCaseVisibleTable (String &filename) |
| Exports data to a file for all the cases of the selected check boxes shown under Line Options. More... | |
| void | WriteTable (String &filename) |
| Exports the data to a file. More... | |
| void | WriteVisibleTable (String &filename) |
| Exports data of the selected check boxes shown under Line Options to a file. More... | |
Detailed Description
GraphModel class is used to output graph data and image files.
The class can be called from DataManager class.
.
Example of obtaining the class object:
Member Function Documentation
| void GraphModel::AddDataSet | ( | DataSet * | set, |
| int | pos = -1 |
||
| ) |
Adds dataset to a graph.
- Parameters
-
set DataSet object pos Position to be added
pos can be omitted. The position is added to the end of the list when left out.
| Variant GraphModel::GetAllXAxisTypes | ( | ) |
Returns a list of type names of X-axis types that can be set.
- Returns
- List of X-axis types that can be set
| bool GraphModel::GetAverageVisible | ( | Variant | val | ) |
Returns whether or not the line average is displayed or hidden on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Show/hide line average
| Variant GraphModel::GetColor | ( | Variant | val | ) |
Returns the line color on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Line color name
| Variant GraphModel::GetGraphProperty | ( | String & | name | ) |
Returns setting for an item.
- Parameters
-
name Item name
Item name Description XMaxDefault Default maximum value of X-axis is used XMaxRange Specifies maximum value of X-axis XMinDefault Default minimum value of X-axis is used XMinRange Specifies minimum value of X-axis LeftYMaxDefault Default maximum value of Y-axis (left) is used LeftYMaxRange Specifies maximum value of Y-axis (left) LeftYMinDefault Default minimum value of Y-axis (left) is used LeftYMinRange Specifies minimum value of Y-axis (left) RightYMaxDefault Default maximum value of Y-axis (right) is used RightYMaxRange Specifies maximum value of Y-axis (right) RightYMinDefault Default minimum value of Y-axis (right) is used RightYMinRange Minimum value of Y-axis (right) is used XReferenceLine Reference line of X-axis is used XReferenceLineValue Value in reference line of X-axis LeftYReferenceLine Reference line of Y-axis (left) is used LeftYReferenceLineValue Value in reference line of Y-axis (left) RightYReferenceLine Reference line of Y-axis (right) is used RightYReferenceLineValue Value in reference line of Y-axis (right) XPlotTitleDefault Default of title in X-axis is used XPlotTitleName Specifies title name for X-axis LeftYPlotTitleDefault Default of title in Y-axis (left) is used LeftYPlotTitleName Specifies title name for Y-axis (left) RightYPlotTitleDefault Default title for Y-axis (right) is used RightYPlotTitleName Specifies title name for Y-axis (right) XAxisLine Display of X-axis is used YAxisLine Display of Y-axis is used GridLine Specifies grid type XScaling Logarithm indicator for X-axis is used LeftYScaling Logarithm indicator for Y-axis (left) is used RightYScaling Logarithm indicator for Y-axis (right) is used XAxisDomain Specifies unit for X-axis ApplyCurrentPlot Use fixed display area XPrecision Number of significant figures for X-axis LeftYPrecision Number of significant figures for Y-axis (left) RightYPrecision Number of significant figures for Y-axis (right) XMajorTicksDefault Use the default major tick marks for X-Axis XMajorTicks The number of major tick marks for the X-axis LeftYMajorTicksDefault Use the default major tick marks for Y-Axis (left) LeftYMajorTicks The number of major tick marks for the Y-Axis (left) RightYMajorTicksDefault Use the default major tick marks for Y-Axis (right) RightYMajorTicks The number of major tick marks for the Y-Axis (right) XMinorTicksDefault Use the default minor tick marks for X-Axis XMinorTicks The number of minor tick marks for the X-axis LeftYMinorTicksDefault Use the default minor tick marks for Y-Axis (left) LeftYMinorTicks The number of minor tick marks for the Y-Axis (left) RightYMinorTicksDefault Use the default minor tick marks for Y-Axis (right) RightYMinorTicks The number of minor tick marks for the Y-Axis (right)
- Returns
- Value of specified item
| bool GraphModel::GetHCrossPoint | ( | Variant | val | ) |
Returns whether or not the cross point (horizontal) of the line is displayed or hidden on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Show/hide of the cross point (horizontal) of the line
| String GraphModel::GetLineName | ( | int | line | ) |
Returns the line name by specifying the Line ID.
- Parameters
-
line Line ID
- Returns
- Line name
| Variant GraphModel::GetLineType | ( | Variant | val | ) |
Returns the graph type of the line on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Graph type of the line
| bool GraphModel::GetLineVisible | ( | Variant | val | ) |
Returns whether or not the line is displayed or hidden on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Show/hide line
| String GraphModel::GetName | ( | ) |
Returns the name of graph model as a string.
- Returns
- Graph model name
| bool GraphModel::GetRMSVisible | ( | Variant | val | ) |
Returns whether or not the line RMS is displayed or hidden on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Show/hide line RMS
| Variant GraphModel::GetSymbol | ( | Variant | val | ) |
Returns the line symbol on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Line symbol name
| bool GraphModel::GetVCrossPoint | ( | Variant | val | ) |
Returns whether or not the cross point (vertical) of the line is displayed or hidden on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Show/hide of the cross point (vertical) of the line
| String GraphModel::GetXAxisType | ( | ) |
Returns current X-axis type.
- Returns
- X-axis type
| Variant GraphModel::GetYAxisPosition | ( | Variant | val | ) |
Returns the Y-axis of the line on the graph by specifying the line ID or name.
- Parameters
-
val Name or index of the line
- Returns
- Y-axis of the line
|
virtual |
Returns True if an object is valid.
- Returns
- Whether or not the GraphModel objects are enabled or disabled.
| int GraphModel::NumLines | ( | ) |
Returns the number of lines for a graph model.
- Returns
- Number of lines
| bool GraphModel::SaveGraphImage | ( | String & | filename, |
| int | width, | ||
| int | height | ||
| ) |
Specifies the size of the graph image and saves it.
- Parameters
-
filename File path (jpeg, png, bmp, svg) width Image width height Image height
- Returns
- Whether or not the graph image was saved
| void GraphModel::SetAverageVisible | ( | Variant | val, |
| bool | show | ||
| ) |
Specifies whether or not to display or hide the line average on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line show True=1 : Displays a line averageFalse=0 : Hides a line average
| void GraphModel::SetColor | ( | Variant | val, |
| Variant | value | ||
| ) |
Specifies the color of the line on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line value Name or index of the color 0 : "Black"1 : "Red"2 : "Green"3 : "Blue"4 : "Cyan"5 : "Magenta"6 : "Yellow"7 : "Gray"8 : "Dark Red"9 : "Dark Green10 : "Dark Blue"11 : "Dark Cyan"12 : "Dark Magenta"13 : "Dark Yellow"14 : "Dark Gray"
| void GraphModel::SetGraphProperty | ( | String & | name, |
| Variant | var | ||
| ) |
Specifies the graph properties by specifying the item name and the value.
- Parameters
-
name Item name
Item name Description XMaxDefault Default maximum value of X-axis is used XMaxRange Specifies maximum value of X-axis XMinDefault Default minimum value of X-axis is used XMinRange Specifies minimum value of X-axis LeftYMaxDefault Default maximum value of Y-axis (left) is used LeftYMaxRange Specifies maximum value of Y-axis (left) LeftYMinDefault Default minimum value of Y-axis (left) is used LeftYMinRange Specifies minimum value of Y-axis (left) RightYMaxDefault Default maximum value of Y-axis (right) is used RightYMaxRange Specifies maximum value of Y-axis (right) RightYMinDefault Default minimum value of Y-axis (right) is used RightYMinRange Minimum value of Y-axis (right) is used XReferenceLine Reference line of X-axis is used XReferenceLineValue Value in reference line of X-axis LeftYReferenceLine Reference line of Y-axis (left) is used LeftYReferenceLineValue Value in reference line of Y-axis (left) RightYReferenceLine Reference line of Y-axis (right) is used RightYReferenceLineValue Value in reference line of Y-axis (right) XPlotTitleDefault Default of title in X-axis is used XPlotTitleName Specifies title name for X-axis LeftYPlotTitleDefault Default of title in Y-axis (left) is used LeftYPlotTitleName Specifies title name for Y-axis (left) RightYPlotTitleDefault Default title for Y-axis (right) is used RightYPlotTitleName Specifies title name for Y-axis (right) XAxisLine Display of X-axis is used YAxisLine Display of Y-axis is used GridLine Specifies grid type XScaling Logarithm indicator for X-axis is used LeftYScaling Logarithm indicator for Y-axis (left) is used RightYScaling Logarithm indicator for Y-axis (right) is used XAxisDomain Specifies unit for X-axis ApplyCurrentPlot Use fixed display area XPrecision Number of significant figures for X-axis LeftYPrecision Number of significant figures for Y-axis (left) RightYPrecision Number of significant figures for Y-axis (right) XMajorTicksDefault Use the default major tick marks for X-Axis XMajorTicks The number of major tick marks for the X-axis LeftYMajorTicksDefault Use the default major tick marks for Y-Axis (left) LeftYMajorTicks The number of major tick marks for the Y-Axis (left) RightYMajorTicksDefault Use the default major tick marks for Y-Axis (right) RightYMajorTicks The number of major tick marks for the Y-Axis (right) XMinorTicksDefault Use the default minor tick marks for X-Axis XMinorTicks The number of minor tick marks for the X-axis LeftYMinorTicksDefault Use the default minor tick marks for Y-Axis (left) LeftYMinorTicks The number of minor tick marks for the Y-Axis (left) RightYMinorTicksDefault Use the default minor tick marks for Y-Axis (right) RightYMinorTicks The number of minor tick marks for the Y-Axis (right)
var Value
GridLineValue Description 0 Grid does not exist 1 Displays grid 2 Displays major and minor grid lines
| void GraphModel::SetHCrossPoint | ( | Variant | val, |
| bool | show | ||
| ) |
Specifies whether or not to display or hide the cross point (horizontal) on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line show True=1 : Displays a Cross point to horizontal lineFalse=0 : Hides a Cross point to horizontal line
| void GraphModel::SetLineName | ( | int | line, |
| String & | name | ||
| ) |
Specifies line ID and sets name for line.
- Parameters
-
line Line ID name Line name
| void GraphModel::SetLineType | ( | Variant | val, |
| Variant | value | ||
| ) |
Specifies the graph type of the line on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line value Name or index of the graph type 0 : "Curve"1 : "Scatter"2 : "Histogram"
| void GraphModel::SetLineVisible | ( | Variant | val, |
| bool | show | ||
| ) |
Specifies whether or not to display or hide lines in a graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line show True=1 : Displays a lineFalse=0 : Hides a line
| void GraphModel::SetRMSVisible | ( | Variant | val, |
| bool | show | ||
| ) |
Specifies whether or not to display or hide the line RMS. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line show True=1 : Displays a line RMSFalse=0 : Hides a line RMS
| void GraphModel::SetSymbol | ( | Variant | val, |
| Variant | value | ||
| ) |
Specifies the symbol of the line on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line value Name or index of the symbol 0 : "None"1 : "Ellipse"2 : "Rectangle"3 : "Diamond"4 : "Down Triangle"5 : "Up Triangle"6 : "Left Triangle"7 : "Right Triangle"8 : "+ Plus"9 : "x Cross"
| void GraphModel::SetVCrossPoint | ( | Variant | val, |
| bool | show | ||
| ) |
Specifies whether or not to display or hide the cross point (vertical) on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line show True=1 : Displays the cross point (vertical) of the linesFalse=0 : Hides the cross point (vertical) of the lines
| void GraphModel::SetXAxisType | ( | String & | type | ) |
Changes X-axis type to another type.
- Parameters
-
type Specifies X-axis type name - Example of X-axis type
step
time
angle
harmonic
frequency
length
- Example of X-axis type
| void GraphModel::SetYAxisPosition | ( | Variant | val, |
| Variant | value | ||
| ) |
Specifies the label position of the Y-axis of the line on the graph. The line is specified by its name or ID.
- Parameters
-
val Name or index of the line value Name or index of the Y-axis label position 0 : "Left"1 : "Right"
| void GraphModel::WriteAllCaseTable | ( | String & | filename | ) |
Exports the data of all cases to a file.
- Parameters
-
filename File path
Refers to WriteTable for the output file format.
| void GraphModel::WriteAllCaseVisibleTable | ( | String & | filename | ) |
Exports data to a file for all the cases of the selected check boxes shown under Line Options.
- Parameters
-
filename File path
Refers to WriteTable for the output file format.
| void GraphModel::WriteTable | ( | String & | filename | ) |
Exports the data to a file.
- Parameters
-
filename File path
Output file formats are different according to their specified extensions.
- ***.txt >>> Text file (tab-delimited)
- ***.csvj >>> CSV file (comma-delimited)
- ***.htm or ***.html >>> HTML file
- Extension not specified >>> Text file (tab-delimited)
| void GraphModel::WriteVisibleTable | ( | String & | filename | ) |
Exports data of the selected check boxes shown under Line Options to a file.
- Parameters
-
filename File path
Refers to WriteTable for the output file format.