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 Axis

JXG.GeometryElement
   ↳ JXG.Line
         ↳ Axis

This element is used to provide a constructor for an axis. It's strictly spoken just a wrapper for element Line with Line#straightFirst and Line#straightLast properties set to true. Additionally Line#lastArrow is set to true and default Ticks will be created.

Defined in: line.js.
Extends JXG.Line.

Element Summary
Constructor Attributes Constructor Name and Description
 
Attributes Summary
Field Attributes Field Name and Description
 
Position is used in cases: position=='sticky' or position=='fixed'.
 
Used to define at which distance to the edge of the board the axis should stick or be fixed.
 
Attributes for the axis label.
 
Attributes for first point the axis.
 
Attributes for second point the axis.
 
Is used to define the behaviour of the axis.
 
Attributes for ticks of the axis.
 
If set to true, the tick labels of the axis are automatically positioned in the narrower area between the axis and the side of the board.
 
Defines, when ticksAutoPos takes effect.
 
Show / hide ticks.
Field Summary
Field Attributes Field Name and Description
 
The ticks attached to the axis.
Methods borrowed from class JXG.Line:
addTransform, Direction, getAngle, getRise, getSlope, hasPoint, isHorizontal, isVertical, L, maxX, minX, setFixedLength, setLabelRelativeCoords, setStraight, Slope, updateRenderer, updateSegmentFixedLength, updateStdform, X, Y, Z
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, show, showElement, snapToPoints, update, updateVisibility, useLocale
Events borrowed from class JXG.GeometryElement:
attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up
Element Detail
Axis
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create with type "axis".

Possible parent array combinations are:
{JXG.Point|array} point1
{JXG.Point|array} point2

Parent elements can be two elements either of type JXG.Point or array of numbers describing the coordinates of a point. In the latter case, the point will be constructed automatically as a fixed invisible point.


{Number} a
{Number} b
{Number} c

A line can also be created providing three numbers. The line is then described by the set of solutions of the equation a*x+b*y+c*z = 0.


Throws:
{Exception}
If the element cannot be constructed with the given parent objects an exception is thrown.
Examples:
// Create an axis providing two coords pairs.
  var l1 = board.create('axis', [[0.0, 1.0], [1.0, 1.3]]);

				
				
 // Create ticks labels as fractions
 board.create('axis', [[0,1], [1,1]], {
     ticks: {
         label: {
             toFraction: true,
             useMathjax: false,
             anchorX: 'middle',
             offset: [0, -10]
         }
     }
 });



				
                
Attribute Detail
anchor
Position is used in cases: position=='sticky' or position=='fixed'. Possible values are 'right', 'left', 'right left'. Left and right indicate the side as seen from the axis. It is used in combination with the attribute position to decide on which side of the board the axis should stick or be fixed.
Defined in: options.js.
 board.create('axis', [[0,0],[0,1]],{
     position: 'fixed',
     anchor: 'left',
     anchorDist: 2,
     strokeColor : 'green',
     ticks: {
         majorHeight: 7,
         drawZero: true,
     }
 });

 board.create('axis', [[0,0],[0,1]], {
     position: 'fixed',
     anchor: 'right',
     anchorDist: 2,
     strokeColor : 'blue',
     ticks: {
         majorHeight: 7,
         drawZero: true,
     }
 });

 board.create('axis', [[0,0],[0,-1]], {
     position: 'fixed',
     anchor: 'left',
     anchorDist: 4,
     strokeColor : 'red',
     ticks:{
         majorHeight: 7,
         drawZero: true,
     }
 });


					
					

						
						
						
						
							
Default Value:
''

anchorDist
Used to define at which distance to the edge of the board the axis should stick or be fixed. This only has an effect if position=='sticky' or position=='fixed'. There are the following possibilities:
Defined in: options.js.
Default Value:
'10%'

{Label} label
Attributes for the axis label.
Defined in: options.js.

{Point} point1
Attributes for first point the axis.
Defined in: options.js.

{Point} point2
Attributes for second point the axis.
Defined in: options.js.

position
Is used to define the behaviour of the axis. Settings in this attribute only have an effect if the axis is exactly horizontal or vertical. Possible values are:
Defined in: options.js.
// Use navigation to see effect.
 var axis1, axis2, circle;

 board.create('axis', [[0,0],[1,0]],{
     position: 'fixed',
     anchor: 'right',
     anchorDist: '0.1fr'
 });

 board.create('axis', [[0,0],[0,1]], {
     position: 'fixed',
     anchor: 'left',
     anchorDist: 1
 });


					
					
// Use navigation to see effect.
     board.create('axis', [[0,0],[1,0]],{
         position: 'sticky',
         anchor: 'right',
         anchorDist: '0.2fr'
     });

     board.create('axis', [[0,0],[0,1]], {
         position: 'sticky',
         anchor: 'right left',
         anchorDist: '75px'
     });


					
					

						
						
						
							
See:
Axis#anchor
Axis#anchorDist
Default Value:
'static'

{Ticks} ticks
Attributes for ticks of the axis.
Defined in: options.js.

ticksAutoPos
If set to true, the tick labels of the axis are automatically positioned in the narrower area between the axis and the side of the board. Settings in this attribute only have an effect if the axis is exactly horizontal or vertical. This option overrides offset, anchorX and anchorY of axis tick labels.
Defined in: options.js.
// Navigate to see an effect.
board.create('axis', [[0, 0], [1, 0]], {
    position: 'sticky',
    anchor: 'left right',
    anchorDist: '0.1',
    ticksAutoPos: true,
});

board.create('axis', [[0, 0], [0, 1]], {
    position: 'sticky',
    anchor: 'left right',
    anchorDist: '0.1',
    ticksAutoPos: true,
});


					
					

						
						
						
						
							
Default Value:
false

ticksAutoPosThreshold
Defines, when ticksAutoPos takes effect. There are the following possibilities:
Defined in: options.js.
Default Value:
'5%'

{Boolean} withTicks
Show / hide ticks. Deprecated. Suggested alternative is "ticks: {visible: false}"
Defined in: options.js.
Default Value:
true
Field Detail
{JXG.Ticks} defaultTicks
The ticks attached to the axis.

Attributes borrowed from other Elements
Attributes borrowed from class JXG.GeometryElement:
aria, cssClass, dash, dashScale, draft, dragToTopOfLayer, element3D, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, highlight, highlightCssClass, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, isLabel, layer, lineCap, needsRegularUpdate, nonnegativeOnly, precision, priv, rotatable, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, tabindex, trace, traceAttributes, transitionDuration, transitionProperties, visible, withLabel

Fields borrowed from other Elements
Fields borrowed from class JXG.Line:
parentPolygon
Fields borrowed from class JXG.GeometryElement:
_org_type, _pos, ancestors, baseElement, board, childElements, descendants, dump, elementClass, elType, hasLabel, highlighted, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, stdform, subs, symbolic, traces, transformations, type, visProp, visPropCalc

Methods borrowed from other Elements
Methods borrowed from class JXG.Line:
addTransform, Direction, getAngle, getRise, getSlope, hasPoint, isHorizontal, isVertical, L, maxX, minX, setFixedLength, setLabelRelativeCoords, setStraight, Slope, updateRenderer, updateSegmentFixedLength, updateStdform, X, Y, Z
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, show, showElement, snapToPoints, update, updateVisibility, useLocale

Events borrowed from other Elements
Events borrowed from class JXG.GeometryElement:
attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up
Documentation generated by JsDoc Toolkit 2.4.0 on Fri Nov 08 2024 12:13:02 GMT+0100 (Mitteleuropäische Normalzeit)