JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

Elements

Classes


Element Ticks

JXG.GeometryElement
   ↳ JXG.Ticks
         ↳ Ticks

Ticks are used as distance markers on a line.

Defined in: ticks.js.
Extends JXG.Ticks.

Element Summary
Constructor Attributes Constructor Name and Description
 
Attributes Summary
Field Attributes Field Name and Description
 
Determine the position of the tick with value 0.
 
Draw labels yes/no
 
Draw the zero tick, that lies at line.point1?
 
A function that expects two JXG.Coords, the first one representing the coordinates of the tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
<deprecated>  
A function that expects two JXG.Coords, the first one representing the coordinates of the tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
 
Whether line boundaries should be counted or not in the lower and upper bounds when creating ticks.
 
If the distance between two ticks is too big we could insert new ticks.
 
User defined labels for special ticks.
 
Total height of a major tick.
 
The maximum number of characters a tick label can use.
 
Total height of a minor tick.
 
The number of minor ticks between two major ticks.
 
If a label exceeds JXG.Ticks#maxLabelLength this determines the precision used to shorten the tick label.
 
Scale the ticks but not the tick labels.
 
A string that is appended to every tick, used to represent the scale factor given in JXG.Ticks#scaleSymbol.
 
Decides in which direction finite ticks are visible.
 
The default distance between two ticks.
 
Use the unicode character 0x2212, i.e.
Methods borrowed from class JXG.Ticks:
adjustTickDistance, calculateTicksCoordinates, generateEquidistantTicks, generateFixedTicks, generateLabel, getDistanceFromZero, getLowerAndUpperBounds, getXandYdeltas, getZeroCoordinates, hasPoint, makeTicksFunction, processTickPosition, removeTickLabels, setPositionDirectly, setTicksSizeVariables, update, updateRenderer
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addRotation, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, handleSnapToGrid, hideElement, labelColor, noHighlight, normalize, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setLabel, setLabelText, setName, setParents, setPosition, setProperty, showElement, snapToPoints
Events borrowed from class JXG.GeometryElement:
attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
Element Detail
Ticks
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create with type "ticks".

Possible parent array combinations are:

The parents consist of the line the ticks are going to be attached to and the distance between two major ticks. The third parameter (optional) is a function which determines the tick label. It has as parameter a coords object containing the coordinates of the new tick.


Throws:
{Exception}
If the element cannot be constructed with the given parent objects an exception is thrown.
Examples:
// Create an axis providing two coord pairs.
  var p1 = board.create('point', [0, 3]);
  var p2 = board.create('point', [1, 3]);
  var l1 = board.create('line', [p1, p2]);
  var t = board.create('ticks', [l1], {ticksDistance: 2});

				
                
Attribute Detail
{String} anchor
Determine the position of the tick with value 0. 'left' means point1 of the line, 'right' means point2, and 'middle' is equivalent to the midpoint of the defining points. This attribute is ignored if the parent line is of type axis and is parallel to either the x (i.e. y = 0) or the y (i.e. x = 0) axis.
Defined in: options.js.
Default Value:
'left'

{Boolean} drawLabels
Draw labels yes/no
Defined in: options.js.
Default Value:
false

{Boolean} drawZero
Draw the zero tick, that lies at line.point1?
Defined in: options.js.
Default Value:
false

{function} generateLabelText
A function that expects two JXG.Coords, the first one representing the coordinates of the tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
Defined in: options.js.

{function} generateLabelValue
A function that expects two JXG.Coords, the first one representing the coordinates of the tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
Defined in: options.js.
Deprecated:
Use JGX.Options@generateLabelValue

{Boolean} includeBoundaries
Whether line boundaries should be counted or not in the lower and upper bounds when creating ticks.
Defined in: options.js.
Default Value:
false

{Boolean} insertTicks
If the distance between two ticks is too big we could insert new ticks. If insertTicks is true, we'll do so, otherwise we leave the distance as is. This option is ignored if equidistant is false. In the example below the distance between two ticks is given as 1 but because insertTicks is set to true many ticks will be omitted in the rendering process to keep the display clear.
Defined in: options.js.
// Create an axis providing two coord pairs.
  var p1 = board.create('point', [0, 0]);
  var p2 = board.create('point', [50, 25]);
  var l1 = board.create('line', [p1, p2]);
  var t = board.create('ticks', [l1, 1], {
     insertTicks: true,
     majorHeight: -1,
     label: {
         offset: [4, -9]
     },
     drawLabels: true
 });

					
					

						
						
						
							
See:
Ticks#equidistant
Ticks#minTicksDistance
Default Value:
false

{Array} labels
User defined labels for special ticks. Instead of the i-th tick's position, the i-th string stored in this array is shown. If the number of strings in this array is less than the number of special ticks, the tick's position is shown as a fallback.
Defined in: options.js.
Default Value:
[]

{Number} majorHeight
Total height of a major tick. If negative the full height of the board is taken.
Defined in: options.js.
Default Value:
10

{Number} maxLabelLength
The maximum number of characters a tick label can use.
Defined in: options.js.
See:
Ticks#precision
Default Value:
5

{Number} minorHeight
Total height of a minor tick. If negative the full height of the board is taken.
Defined in: options.js.
Default Value:
4

{Number} minorTicks
The number of minor ticks between two major ticks.
Defined in: options.js.
Default Value:
4

{Number} precision
If a label exceeds JXG.Ticks#maxLabelLength this determines the precision used to shorten the tick label.
Defined in: options.js.
See:
Ticks#maxLabelLength
Default Value:
3

{Number} scale
Scale the ticks but not the tick labels.
Defined in: options.js.
See:
Ticks#scaleSymbol
Default Value:
1

{String} scaleSymbol
A string that is appended to every tick, used to represent the scale factor given in JXG.Ticks#scaleSymbol.
Defined in: options.js.
See:
Ticks#scale
Default Value:
''

{Array} tickEndings
Decides in which direction finite ticks are visible. Possible values are 0=false or 1=true. In case of [0,1] the tick is only visible to the right of the line. In case of [1,0] the tick is only visible to the left of the line.
Defined in: options.js.
Default Value:
[1, 1]

{Number} ticksDistance
The default distance between two ticks. Please be aware that this value does not have to be used if JXG.Ticks#insertTicks is set to true.
Defined in: options.js.
See:
Ticks#equidistant
Ticks#insertTicks
Default Value:
1

{Boolean} useUnicodeMinus
Use the unicode character 0x2212, i.e. the HTML entity &minus; as minus sign. That is −1 instead of -1.
Defined in: options.js.
Default Value:
true

Attributes borrowed from other Elements
Attributes borrowed from class JXG.GeometryElement:
dash, draft, fillColor, fillOpacity, fixed, frozen, highlight, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, needsRegularUpdate, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, trace, traceAttributes, visible, withLabel

Fields borrowed from other Elements
Fields borrowed from class JXG.Ticks:
board, equidistant, fixedTicks, labelCounter, labelsRepo, line, minTicksDistance, ticks, ticksDelta, ticksFunction
Fields borrowed from class JXG.GeometryElement:
_org_type, _pos, ancestors, baseElement, childElements, descendants, dump, elementClass, elType, hasLabel, highlighted, id, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, stdform, subs, symbolic, traces, transformations, type, visProp

Methods borrowed from other Elements
Methods borrowed from class JXG.Ticks:
adjustTickDistance, calculateTicksCoordinates, generateEquidistantTicks, generateFixedTicks, generateLabel, getDistanceFromZero, getLowerAndUpperBounds, getXandYdeltas, getZeroCoordinates, hasPoint, makeTicksFunction, processTickPosition, removeTickLabels, setPositionDirectly, setTicksSizeVariables, update, updateRenderer
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addRotation, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, handleSnapToGrid, hideElement, labelColor, noHighlight, normalize, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setLabel, setLabelText, setName, setParents, setPosition, setProperty, showElement, snapToPoints

Events borrowed from other Elements
Events borrowed from class JXG.GeometryElement:
attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jul 05 2016 11:01:15 GMT+0200 (CEST)