Libraries.Interface.Controls.Charts.LineChart Documentation
The LineChart class is Chart object that inherits from TwoVariableChart and like other UI elements it is added to the Game class. The Line Chart is used to track changes over short and long periods of time. Line charts can also be used to compare changes over the same period of time for more than one group. The title label, axis labels, and scales can be modified. Any number of lines can be added.
Inherits from: Libraries.Interface.Controls.Charts.TwoVariableChart, Libraries.Interface.Controls.Charts.Chart, Libraries.Interface.Controls.Control, Libraries.Interface.Item, Libraries.Interface.Controls.Charts.ChartItem, Libraries.Interface.Item2D, Libraries.Language.Object
Actions Documentation
Activate()
This action returns a default behavior for this paricular control. Some controls do nothing by default, like a TextBox that responds to different kinds of input. Others, however, have default behaviors, like a Button or a MenuItem. If there is no default behavior, this action returns undefined.
Activate(Libraries.Interface.Events.BehaviorEvent event)
Add(integer index, Libraries.Interface.Item2D newItem)
This action adds a different Item2D into this one, storing the added Item2D at a specific index in the internal array.
Parameters
- integer index
- Libraries.Interface.Item2D
Example
use Libraries.Interface.Item2D
Item2D parentItem
Item2D child
parentItem:Add(0, child)
Add(Libraries.Interface.Item2D newItem)
This action adds a different Item2D into this one. This makes a few things happen. 1. The added item will get this item as its parent. 2. The added item's x and y coordinates will become relative to this Item. 3. Most actions on this Item will also affect the added Item.
Parameters
Example
use Libraries.Interface.Item2D
Item2D parentItem
Item2D child
parentItem:Add(child)
AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)
AddChartAreaInstructions(text description)
This action generates the instruction text for the Chart Area description.
Parameters
- text description: The base portion of the description that will appear before the instructions
AddChartItemInstructions(Libraries.Interface.Item chartItem, text description)
This action generates the instruction text for a chart item description.
Parameters
- Libraries.Interface.Item: The chart item that will have the instructions
- text description: The base portion of the description that will appear before the instructions
AddChartLine(Libraries.Interface.Controls.Charts.ChartLine newLine)
Used to create a new ChartLine object for the chart and add it to the lines array.
Parameters
AddControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)
This action removes an Item2D at a specifed index from the internal array.
Parameters
Example
use Libraries.Interface.Item2D
Item2D parentItem
Item2D child
parentItem:Add(0, child)
parentItem:Remove(0)
AddFocusListener(Libraries.Interface.Events.FocusListener listener)
This action adds a FocusListener to the Item. When the Item receives a FocusEvent due to either gaining or losing the focus, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.FocusListener
Item myItem
FocusListener listener
myItem:AddFocusListener(listener)
AddGestureListener(Libraries.Interface.Events.GestureListener listener)
This action adds a GestureListener to the Item. If the Item ever receives a GestureEvent, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.GestureListener
Item myItem
GestureListener listener
myItem:AddGestureListener(listener)
AddGroupPanel(Libraries.Interface.Controls.Charts.GroupPanel group)
This action is used by the layout to position the graphical components of the Chart. Layout is handled automatically so users don't need to use this action directly.
Parameters
AddGroupPanelInstructions(Libraries.Interface.Controls.Charts.Graphics.ChartDrawable groupPanel, text description)
This action generates the instruction text for a group panel description.
Parameters
- Libraries.Interface.Controls.Charts.Graphics.ChartDrawable: The group panel that will have the instructions
- text description: The base portion of the description that will appear before the instructions
AddLayoutProperties(Libraries.Interface.Layouts.LayoutProperties properties)
Returns true if rendering the mouse down event.
Parameters
AddMouseListener(Libraries.Interface.Events.MouseListener listener)
This action adds a MouseListener to the Item. If the Item ever receives a MouseEvent due to a mouse click, the mouse listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseListener
Item myItem
MouseListener listener
myItem:AddMouseListener(listener)
AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)
This action adds a MouseMovementListener to the Item. If the Item ever receives a MouseEvent due to mouse movement, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseMovementListener
Item myItem
MouseMovementListener listener
myItem:AddMouseMovementListener(listener)
AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)
This action adds a MouseWheelListener to the Item. If the Item ever receives a MouseEvent due to the mouse wheel being scrolled, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseWheelListener
Item myItem
MouseWheelListener listener
myItem:AddMouseWheelListener(listener)
AddPoint(Libraries.Interface.Controls.Charts.ChartPoint point)
Used to create a new ChartPoint object for the chart and add it to the chart point array.
Parameters
AddPoints(Libraries.Interface.Controls.Charts.ChartItem summary, Libraries.Interface.Controls.Charts.ChartItem parentItem, Libraries.Containers.Array<Libraries.Interface.Controls.Charts.ChartPoint> points)
This action adds points to the two variable chart. These point have
descriptions, a chartItem, and list of points.
Atrribute: Parameter summary the chart point summary.
Atrribute: Parameter parentItem the chart point parent.
Atrribute: Parameter points the chart point, Array
Parameters
AddSelectionListener(Libraries.Interface.Events.SelectionListener listener)
This action adds the given SelectionListeners to the Control.
Parameters
- Libraries.Interface.Events.SelectionListener: the selectionListener to add to the control.
AddSeries(Libraries.Interface.Controls.Charts.Series series)
This action adds to the list of Series.
Parameters
- Libraries.Interface.Controls.Charts.Series: the Series object to add to the list of Series.
AddSubChartAreaInstructions(Libraries.Interface.Controls.Charts.ChartAreaPanel subChartArea, text description)
This action generates the instruction text for a sub chart area description.
Parameters
- Libraries.Interface.Controls.Charts.ChartAreaPanel: The sub chart area that will have the instructions
- text description: The base portion of the description that will appear before the instructions
AddTouchListener(Libraries.Interface.Events.TouchListener listener)
This action adds a TouchListener to the Item. If the Item ever receives a TouchEvent, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.TouchListener
Item myItem
TouchListener listener
myItem:AddTouchListener(listener)
AdjustForLegend()
This action adjusts the chart for the legend.
AdjustForXAxis()
This action adjusts for the x-axis.
AdjustForYAxis()
This action adjusts for the y-axis.
Advance(number time)
This action is used to advance the item forward in time in physics space to synchronize it for time of impact solving. This action is used internally and users should not need to use this action. Attribute Parameter time The amount of seconds to advance the item forward in time
Parameters
- number time
ApplyAngularImpulse(number impulse)
This action applies an angular impulse to this item. The units are in kilogram units squared per second. This modifies the angular velocity of this item. Physics must be enabled on this item before using this action.
Parameters
- number impulse: The angular impulse in kilogram units squared per second
Example
use Libraries.Interface.Item2D
Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:ApplyAngularImpulse(80)
ApplyForce(Libraries.Compute.Vector2 force, Libraries.Compute.Vector2 point)
This action applies a force to this item at the passed point. The force is in kilogram units per second per second. The point is the screen coordinates where the point will be applied. If the point is not on the center of the item, then a torque will be introduced causing the item to rotate. Physics must be enabled on this item before using this action.
Parameters
- Libraries.Compute.Vector2: The force to apply to the item in kilogram units per second per second
- Libraries.Compute.Vector2: The point at which to apply the force
Example
use Libraries.Compute.Vector2
use Libraries.Interface.Item2D
Item2D item
Vector2 force
Vector2 point
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
force:Set(300, 350)
point:Set(100, 100) // apply the force to the top right corner of the item
item:ApplyForce(force, point)
ApplyForceToCenter(Libraries.Compute.Vector2 force)
This action applies a force to this item at the center of the item. The force is in kilogram units per second per second. No torque is introduced to the item when using this action. Physics must be enabled on this item before using this action.
Parameters
- Libraries.Compute.Vector2: The force to apply to the item in kilogram units per second per second
Example
use Libraries.Compute.Vector2
use Libraries.Interface.Item2D
Item2D item
Vector2 force
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
force:Set(300, 350)
item:ApplyForce(force)
ApplyLinearImpulse(Libraries.Compute.Vector2 impulse, Libraries.Compute.Vector2 point)
This action applies a linear impulse to this item at the passed point. The impulse is in kilogram units per second. This immeadietly modifies the linear velocity of this item. The point is the screen coordinates where the impulse will be applied. If the point is not the center of the item, then the angular velocity of this item will also be modified. Physics must be enabled on this item before using this action.
Parameters
- Libraries.Compute.Vector2: The impulse to apply in kilogram units per second
- Libraries.Compute.Vector2: The point at which to apply the impulse
Example
use Libraries.Interface.Item2D
use Libraries.Compute.Vector2
Item2D item
Vector2 impulse
Vector2 point
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
impulse:Set(100)
point:Set(100, 100) // apply the impulse to the top right corner
item:ApplyLinearImpulse(impulse, point)
ApplyTorque(number torque)
This action applies a torque to this item. The units are kilogram units squared per second per second. Physics must be enabled on this item before using this action.
Parameters
- number torque: The torque to apply to this item in kilogram units squared per second per second
Example
use Libraries.Interface.Item2D
Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:ApplyTorque(350)
AreChildrenProcessingMouseEvents()
This action returns whether or not this Item is allowing its children to receive mouse events if the Item is custom drawing. If the Item isn't using custom drawing, this value is irrelevant -- children objects always receive mouse events before the parent if the parent isn't performing custom drawing.
Return
boolean:
BeginCollision(Libraries.Interface.Item item)
This action is used to indicate that two items have just begun colliding. When two Items collide, the BeginCollision action should be called on both of them, with the other item passed as a parameter to the action. Note that this action does nothing by default, but classes that inherit from Item may override it.
Parameters
- Libraries.Interface.Item: The other Item involved in the collision.
Example
use Libraries.Interface.Item
Item collider1
Item collider2
collider1:BeginCollision(collider2)
collider2:BeginCollision(collider1)
BeginMouseOver()
This action is used when a control is moused over by the mouse.
CalculateLineSegmentPhrase(Libraries.Interface.Controls.Charts.ChartPoint point1, Libraries.Interface.Controls.Charts.ChartPoint point2, integer iteration)
Updates the description of all of the line segments in the array of line segments. The array should contain all points inside of a single series.
Parameters
- Libraries.Interface.Controls.Charts.ChartPoint: the first point to draw the line segment from.
- Libraries.Interface.Controls.Charts.ChartPoint: the second point to draw the line segment to.
- integer iteration
Return
text:
CanRotate(boolean flag)
This action gets the position of the center of this item in global (world) coordinates.
Parameters
- boolean flag
CancelBehaviors()
This action stops all behaviors this Item is following without finishing them.
CastToPoints(Libraries.Containers.Array<Libraries.Interface.Item> chartAreaItems)
If we have any Series objects from movable regression lines, gather those up so we can iterate over them too.
Parameters
Return
CheckPlatformInstructions()
This action is used to check the current platform and adjust the command instructions to use gestures rather than keys
Example
use Libraries.Compute.Statistics.DataFrame
use Libraries.Interface.Controls.Charts.BarChart
DataFrame frame
frame:Load("Data.csv")
frame:AddSelectedColumn(1)
BarChart chart = frame:BarChart()
chart:CheckPlatformInstructions
ClickedMouse()
This action is used when a control is clicked by the mouse.
CollideWithChildren()
This action sets the mass, mass moment of inertia, and how the 2D item should move (via linear velocity) to be at the desired location.
Return
boolean: