# JSXGraph 1.10.0 Reference

## 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

- Angle
- Arc
- Arrow
- Arrowparallel
- Axes3D
- Axis
- Axis3D
- Bisector
- Bisectorlines
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circle3D
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Curve
- Curve3D
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- ForeignObject
- Functiongraph
- Functiongraph3D
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- ImplicitCurve
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- IntersectionCircle3D
- IntersectionLine3D
- Label
- Legend
- Line
- Line3D
- Locus
- MajorArc
- MajorSector
- Measurement
- Mesh3D
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- mirrorelement
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelogram
- Parallelpoint
- ParametricSurface3D
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- Point3D
- PolarLine
- PolePoint
- Polygon
- PolygonalChain
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopefield
- Slopetriangle
- Smartlabel
- Sphere3D
- Spline
- Stepfunction
- Tangent
- TangentTo
- Tapemeasure
- Text
- Text3D
- Ticks
- Ticks3D
- Tracecurve
- Transformation
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- JXG.Circle3D
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Curve3D
- JXG.Dump
- JXG.EventEmitter
- JXG.Expect
- JXG.ForeignObject
- JXG.GeometryElement
- JXG.GeometryElement3D
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Legend
- JXG.Line
- JXG.Line3D
- JXG.Math
- JXG.Math.BoxQuadtree
- JXG.Math.Clip
- JXG.Math.Extrapolate
- JXG.Math.Geometry
- JXG.Math.ImplicitPlot
- JXG.Math.IntervalArithmetic
- JXG.Math.Metapost
- JXG.Math.Nlp
- JXG.Math.Numerics
- JXG.Math.Plot
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.ProbFuncs
- JXG.Math.Quadtree
- JXG.Math.Statistics
- JXG.Math.Symbolic
- JXG.NoRenderer
- JXG.Options
- JXG.Plane3D
- JXG.Point
- JXG.Point3D
- JXG.Polygon
- JXG.Polygon3D
- JXG.PrefixParser
- JXG.Server
- JXG.Server.modules
- JXG.Sphere3D
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Text3D
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML

# 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
--- | ---
| Axis

Attributes Summary
Field Attributes | Field Name and Description
--- | ---
| anchor Position is used in cases: `position=='sticky'` or `position=='fixed'`.
| anchorDist Used to define at which distance to the edge of the board the axis should stick or be fixed.
| label Attributes for the axis label.
| point1 Attributes for first point the axis.
| point2 Attributes for second point the axis.
| position Is used to define the behaviour of the axis.
| ticks Attributes for ticks of the axis.
| 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.
| ticksAutoPosThreshold Defines, when `ticksAutoPos` takes effect.
| withTicks Show / hide ticks.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| defaultTicks 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, 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:

- Numbers or strings which are numbers (e.g. '10') are interpreted as usrCoords.
- Strings with the unit 'px' are interpreted as screen pixels.
- Strings with the unit '%' or 'fr' are interpreted as a ratio to the width/height of the board. (e.g. 50% = 0.5fr)

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:

- `'static'`: Standard behavior of the axes as know in JSXGraph.
- `'fixed'`: The axis is placed in a fixed position. Depending on the attribute `anchor`, it is positioned to the right or left of the edge of the board as seen from the axis with a distance defined in `distanceBoarder`. The axis will stay at the given position, when the user navigates through the board.
- `'sticky'`: This mixes the two settings `static` and `fixed`. When the user navigates in the board, the axis remains in the visible area (taking into account `anchor` and `anchorDist`). If the axis itself is in the visible area, the axis can be moved by navigation.

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:

- Numbers or strings which are numbers (e.g. '10') are interpreted as usrCoords.
- Strings with the unit 'px' are interpreted as screen pixels.
- Strings with the unit '%' or 'fr' are interpreted as a ratio to the width/height of the board. (e.g. 50% = 0.5fr)

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:
  dash, dashScale, draft, dragToTopOfLayer, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, highlight, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, isLabel, layer, lineCap, needsRegularUpdate, nonnegativeOnly, precision, priv, rotatable, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, tabindex, trace, traceAttributes, transitionDuration, transitionProperties, viewport, 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, 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 Wed Oct 02 2024 09:14:33 GMT+0200 (Mitteleuropäische Sommerzeit)