C# Class LitDev.LDGraph

Afficher le fichier Open project: litdev1/LitDev

Méthodes publiques

Méthode Description
AddGraph ( Primitive xpos, Primitive ypos, Primitive width, Primitive height, Primitive title, Primitive labelX, Primitive labelY ) : Primitive

Create a graph.

AddSeriesHistogram ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void

Add a new data series to an existing graph as a histogram.

AddSeriesLine ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void

Add a new data series to an existing graph as a line graph.

AddSeriesPoints ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void

Add a new data series to an existing graph as points.

CreateTrend ( Primitive data, Primitive order ) : Primitive

Create a trend from data.

DeleteSeries ( Primitive graphName, Primitive seriesLabel ) : void

Delete an existing series on existing graph.

ExportCSV ( Primitive data, Primitive fileName ) : void

Export data series directly to CSV file (no graphing).

Help ( ) : void

This function is just to display this help. Graphs of data can be plotted as lines, points or histograms. Each series of data is a SmallBasic array with the array index reprenting the (unique) X value and the array value representing the Y value. For example: data[1] = 5 data[2] = 8 data[3] = 3 First create a graph object with AddGraph, then add series with AddSeriesLine, AddSeriesHistogram or AddSeriesPoints. Once a graph is created and plotted, the axes can be grabbed and scrolled where the hand cursor appears. The legend can also be moved. The graph can be rescaled by using the left mouse button to select a region to zoom, or the mouse wheel can be used to zoom the display. A double click will reset the scaling to the original default. A right click will bring up a menu with other features like export of image or data, displaying the cursor coordinates, hiding the legend etc. Finally the various parmeters for this method give further control of the plotting colours and behaviour.

RestartEvents ( ) : void

Restart all the graph left click mouse events.

ScaleAxisX ( Primitive graphName, Primitive min, Primitive interval, Primitive max ) : void

Set the X axis scaling. This over-rides any automatic methods.

ScaleAxisY ( Primitive graphName, Primitive min, Primitive interval, Primitive max ) : void

Set the Y axis scaling. This over-rides any automatic methods.

StopEvents ( ) : void

Stop all the graph left click mouse events.

TrendCoef ( ) : Primitive

Get the polynomial trend line coefficients for the last calculated trend using CreateTrend.

Private Methods

Méthode Description
AddSeriesHitogram ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void

Method Details

AddGraph() public static méthode

Create a graph.
public static AddGraph ( Primitive xpos, Primitive ypos, Primitive width, Primitive height, Primitive title, Primitive labelX, Primitive labelY ) : Primitive
xpos Primitive /// The graph left position. ///
ypos Primitive /// The graph right position. ///
width Primitive /// The graph width. ///
height Primitive /// The graph height. ///
title Primitive /// The graph title. ///
labelX Primitive /// The X axis label. ///
labelY Primitive /// The Y axis label. ///
Résultat Primitive

AddSeriesHistogram() public static méthode

Add a new data series to an existing graph as a histogram.
public static AddSeriesHistogram ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void
graphName Primitive /// The graph name. ///
seriesLabel Primitive /// The series label. /// If a series with this label already exists then it is replaced with this series. ///
data Primitive /// An array holding the X and Y coordinate data. /// /// For example, a line with points (0,1) and (2,3) would have /// data[0] = 1 /// data[2] = 3 /// /// More generally data[x] = y. ///
colour Primitive /// The colour of the series data. ///
Résultat void

AddSeriesLine() public static méthode

Add a new data series to an existing graph as a line graph.
public static AddSeriesLine ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void
graphName Primitive /// The graph name. ///
seriesLabel Primitive /// The series label. /// If a series with this label already exists then it is replaced with this series. ///
data Primitive /// An array holding the X and Y coordinate data. /// /// For example, a line with points (0,1) and (2,3) would have /// data[0] = 1 /// data[2] = 3 /// /// More generally data[x] = y. ///
colour Primitive /// The colour of the series data. ///
Résultat void

AddSeriesPoints() public static méthode

Add a new data series to an existing graph as points.
public static AddSeriesPoints ( Primitive graphName, Primitive seriesLabel, Primitive data, Primitive colour ) : void
graphName Primitive /// The graph name. ///
seriesLabel Primitive /// The series label. /// If a series with this label already exists then it is replaced with this series. ///
data Primitive /// An array holding the X and Y coordinate data. /// /// For example, a line with points (0,1) and (2,3) would have /// data[0] = 1 /// data[2] = 3 /// /// More generally data[x] = y. ///
colour Primitive /// The colour of the series data. ///
Résultat void

CreateTrend() public static méthode

Create a trend from data.
public static CreateTrend ( Primitive data, Primitive order ) : Primitive
data Primitive /// An array holding the X and Y coordinate data. /// /// For example, a line with points (0,1) and (2,3) would have /// data[0] = 1 /// data[2] = 3 /// /// More generally data[x] = y. ///
order Primitive The polynomial order for the trend line. /// 1 is linear. /// 2 is quadratic. ///
Résultat Primitive

DeleteSeries() public static méthode

Delete an existing series on existing graph.
public static DeleteSeries ( Primitive graphName, Primitive seriesLabel ) : void
graphName Primitive /// The graph name. ///
seriesLabel Primitive /// The series label name to delete. ///
Résultat void

ExportCSV() public static méthode

Export data series directly to CSV file (no graphing).
public static ExportCSV ( Primitive data, Primitive fileName ) : void
data Primitive /// An array holding the X and Y coordinate data. ///
fileName Primitive /// The CSV output file name. ///
Résultat void

Help() public static méthode

This function is just to display this help. Graphs of data can be plotted as lines, points or histograms. Each series of data is a SmallBasic array with the array index reprenting the (unique) X value and the array value representing the Y value. For example: data[1] = 5 data[2] = 8 data[3] = 3 First create a graph object with AddGraph, then add series with AddSeriesLine, AddSeriesHistogram or AddSeriesPoints. Once a graph is created and plotted, the axes can be grabbed and scrolled where the hand cursor appears. The legend can also be moved. The graph can be rescaled by using the left mouse button to select a region to zoom, or the mouse wheel can be used to zoom the display. A double click will reset the scaling to the original default. A right click will bring up a menu with other features like export of image or data, displaying the cursor coordinates, hiding the legend etc. Finally the various parmeters for this method give further control of the plotting colours and behaviour.
public static Help ( ) : void
Résultat void

RestartEvents() public static méthode

Restart all the graph left click mouse events.
public static RestartEvents ( ) : void
Résultat void

ScaleAxisX() public static méthode

Set the X axis scaling. This over-rides any automatic methods.
public static ScaleAxisX ( Primitive graphName, Primitive min, Primitive interval, Primitive max ) : void
graphName Primitive The graph name.
min Primitive The X axis minimum value.
interval Primitive The grid spacing interval. /// If this value is 0 then the interval is calculated from the data.
max Primitive The X axis maximum value. /// If this value is equal to min, then the maximum is calculated from the data. /// If this value is less than min, then both the minimum and maximum are calculated from the data.
Résultat void

ScaleAxisY() public static méthode

Set the Y axis scaling. This over-rides any automatic methods.
public static ScaleAxisY ( Primitive graphName, Primitive min, Primitive interval, Primitive max ) : void
graphName Primitive The graph name.
min Primitive The Y axis minimum value.
interval Primitive The grid spacing interval. /// If this value is 0 then the interval is calculated from the data.
max Primitive The Y axis maximum value. /// If this value is equal to min, then the maximum is calculated from the data. /// If this value is less than min, then both the minimum and maximum are calculated from the data.
Résultat void

StopEvents() public static méthode

Stop all the graph left click mouse events.
public static StopEvents ( ) : void
Résultat void

TrendCoef() public static méthode

Get the polynomial trend line coefficients for the last calculated trend using CreateTrend.
public static TrendCoef ( ) : Primitive
Résultat Primitive