Graph ClassDelta Engine Documentation
Renders a graph with one or more lines at a given scale. Various logic can be turned on and off including autogrowing, auto-pruning and rendering axes and percentiles. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Entities DrawableEntity
      DeltaEngine.Rendering2D Entity2D
        DeltaEngine.Rendering2D.Shapes Polygon2D
          DeltaEngine.Rendering2D.Shapes FilledRect
            DeltaEngine.Rendering2D.Graphs Graph

Namespace: DeltaEngine.Rendering2D.Graphs
Assembly: DeltaEngine.Rendering2D.Graphs (in DeltaEngine.Rendering2D.Graphs.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class Graph : FilledRect, Updateable

The Graph type exposes the following members.

Constructors

  NameDescription
Public methodGraph
Initializes a new instance of the Graph class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity2D.)
Public methodAddTag (Inherited from Entity.)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity2D.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Public methodCreateLine
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodGet T  (Inherited from Entity2D.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Public methodGetComponentsForEditing (Inherited from Entity2D.)
Protected methodGetComponentsForSaving (Inherited from Entity2D.)
Protected methodGetDrawBehaviors (Inherited from DrawableEntity.)
Public methodGetInterpolatedArray T  (Inherited from DrawableEntity.)
Public methodGetInterpolatedList T  (Inherited from DrawableEntity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Protected methodNextUpdateStarted (Inherited from Entity2D.)
Public methodOnDraw T  (Inherited from DrawableEntity.)
Protected methodOnPositionChanged (Inherited from Entity2D.)
Protected methodOnRotationChanged (Inherited from FilledRect.)
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveLine
Public methodRemoveTag (Inherited from Entity.)
Public methodRotatedDrawAreaContains (Inherited from Entity2D.)
Public methodSet (Inherited from Entity2D.)
Public methodSetComponents (Inherited from Entity.)
Public methodSetWithoutInterpolation T  (Inherited from Entity2D.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToggleVisibility (Overrides DrawableEntity ToggleVisibility .)
Public methodToString (Inherited from Entity.)
Public methodUpdate
Top
Extension Methods

  NameDescription
Public Extension MethodAffixToPhysics (Defined by Entity2DPhysicsExtensions.)
Public Extension MethodStartBouncingOffScreenEdges (Defined by Entity2DExtensions.)
Public Extension MethodStartFalling (Defined by Entity2DExtensions.)
Public Extension MethodStartMoving (Defined by Entity2DExtensions.)
Public Extension MethodStartRotating (Defined by Entity2DExtensions.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Protected fieldlastTickLerpComponents
Each element can either be a Lerp, a Lerp List or an array of Lerp objects. View code on GitHub
(Inherited from DrawableEntity.)
Top
Properties

  NameDescription
Public propertyAlpha (Inherited from Entity2D.)
Public propertyArePercentileLabelsInteger
Public propertyAxesIsVisible
Public propertyAxisColor
Public propertyCenter (Inherited from Entity2D.)
Public propertyColor (Inherited from Entity2D.)
Public propertyDidFootprintChange (Inherited from Entity2D.)
Public propertyDrawArea (Inherited from Polygon2D.)
Public propertyIsActive (Inherited from DrawableEntity.)
Public propertyIsAutogrowing
Public propertyIsPauseable (Inherited from Entity.)
Public propertyIsVisible (Inherited from DrawableEntity.)
Public propertyKeyVisibility
Public propertyLastColor (Inherited from Entity2D.)
Public propertyLastDrawArea (Inherited from Entity2D.)
Public propertyMaximumNumberOfPoints
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyNumberOfPercentiles
Public propertyOrigin
Public propertyPercentileColor
Public propertyPercentileLabelColor
Public propertyPercentileLabelsIsVisible
Public propertyPercentilePrefix
Public propertyPercentilesIsVisible
Public propertyPercentileSuffix
Public propertyPoints (Inherited from Polygon2D.)
Public propertyRenderLayer (Inherited from DrawableEntity.)
Public propertyRotation (Inherited from Entity2D.)
Public propertyRotationCenter (Inherited from Entity2D.)
Public propertySize (Inherited from Entity2D.)
Public propertyTopLeft (Inherited from Entity2D.)
Public propertyUpdatePriority (Inherited from Entity.)
Public propertyViewport
Top
Remarks

Tests: DeltaEngine.Rendering2D.Graphs.Tests.GraphLineTests
Examples

41 unit tests call DeltaEngine.Rendering2D.Graphs.Graph
[Test, CloseAfterFirstFrame]
public void CheckLineColor()
{
    var line = graph.CreateLine("", Color.Blue);
    line.AddPoint(Vector2D.Zero);
    line.AddPoint(Vector2D.One);
    Assert.AreEqual(Color.Blue, line.Color);
    Assert.AreEqual(Color.Blue, line.lines[0].Color);
    line.Color = Color.Green;
    Assert.AreEqual(Color.Green, line.Color);
}
[Test, CloseAfterFirstFrame]
public void ChangeLineColor()
{
    var line = graph.CreateLine("", Color.Blue);
    line.AddPoint(Vector2D.Zero);
    line.AddPoint(Vector2D.One);
    line.Color = Color.Green;
    Assert.AreEqual(Color.Green, line.Color);
    Assert.AreEqual(Color.Green, line.lines[0].Color);
}
[Test, CloseAfterFirstFrame]
public void ChangeLineKey()
{
    var line = graph.CreateLine("ABC", Color.Blue);
    Assert.AreEqual("ABC", line.Key);
    line.Key = "DEF";
    Assert.AreEqual("DEF", line.Key);
}
See Also