# JSXGraph 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
- Axis
- Bisector
- Bisectorlines
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- Circumcirclesector
- Conic
- Curve
- Ellipse
- Functiongraph
- Glider
- Grid
- Hyperbola
- Image
- Incenter
- Incircle
- Integral
- Intersection
- Line
- Locus
- Midpoint
- Mirrorpoint
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- Perpendicularpoint
- Point
- Polygon
- Reflection
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Tangent
- Text
- Ticks
- Tracecurve

## Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.C
- JXG.CanvasRenderer
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.Curve
- JXG.Dump
- JXG.GeometryElement
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Line
- JXG.Math
- JXG.Math.Geometry
- JXG.Math.Numerics
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.Statistics
- JXG.Math.Symbolic
- JXG.Point
- JXG.Polygon
- JXG.Server
- JXG.Server.modules
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Turtle
- JXG.Util
- JXG.VMLRenderer

# Class JXG.Ticks

JXG.GeometryElement
↳ JXG.Ticks

Ticks provides methods for creation and management of ticks on an axis.
Defined in: Ticks.js.
Extends JXG.GeometryElement.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Ticks(line, ticks, attributes) Creates ticks for an axis.

Attributes Summary
Field Attributes | Field Name and Description
--- | ---
| drawLabels Draw labels yes/no
| drawZero Draw the zero tick, that lies at line.point1?
| insertTicks If the distance between two ticks is too big we could insert new ticks.
| majorHeight Total height of a major tick.
| minorHeight Total height of a minor tick.
| minorTicks The number of minor ticks between two major ticks.
| ticksDistance The default distance between two ticks.

Fields borrowed from class JXG.GeometryElement:
  addEvent, ancestors, baseElement, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel

Field Summary
Field Attributes | Field Name and Description
--- | ---
| board The board the ticks line is drawn on.
| equidistant Equidistant ticks.
| fixedTicks Array of fixed ticks.
| labels Array where the labels are saved.
| line The line the ticks belong to.
<deprecated> | maxTicksDistance Maximum distance between two ticks, measured in pixels.
| minTicksDistance Least distance between two ticks, measured in pixels.
| ticksFunction A function calculating ticks delta depending on the ticks number.

Fields borrowed from class JXG.GeometryElement:
  addEvent, ancestors, baseElement, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> | _makeLabel(pos, newTick, board, drawLabels, id, i) Create a tick label
| calculateTicksCoordinates() (Re-)calculates the ticks coordinates.
| removeTickLabels() Removes the HTML divs of the tick labels before repositioning
| update() Recalculate the tick positions and the labels.
| updateRenderer() Uses the boards renderer to update the arc.

Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, hasPoint, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, setProperty, setStraight, showElement, triggerEventHandlers

Class Detail
JXG.Ticks(line, ticks, attributes)
Creates ticks for an axis.

Parameters:
{JXG.Line} line
  Reference to the axis the ticks are drawn on.
{Number|Array} ticks
  Number defining the distance between two major ticks or an array defining static ticks.
{Object} attributes
  Properties

See:
  JXG.Line#addTicks

Attribute Detail
{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

{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.
Defined in: Options.js.

See:
  JXG.Ticks#equidistant
  JXG.Ticks#maxTicksDistance

Default Value:
  false

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

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

{Number} minorTicks
The number of minor ticks between two major ticks.
Defined in: Options.js.

{Boolean} 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:
  JXG.Ticks#equidistant
  JXG.Ticks#insertTicks

Default Value:
  1

Field Detail
{JXG.Board} board
The board the ticks line is drawn on.

{Boolean} equidistant
Equidistant ticks. Distance is defined by ticksFunction

{Array} fixedTicks
Array of fixed ticks.

{Array} labels
Array where the labels are saved. There is an array element for every tick, even for minor ticks which don't have labels. In this case the array element contains just `null`.

{JXG.Line} line
The line the ticks belong to.

{int} maxTicksDistance
Maximum distance between two ticks, measured in pixels. Is used only when insertTicks is set to true.

Deprecated:
This value will be ignored.

See:
  #insertTicks

{int} minTicksDistance
Least distance between two ticks, measured in pixels.

{Function} ticksFunction
A function calculating ticks delta depending on the ticks number.
Method Detail
<private> _makeLabel(pos, newTick, board, drawLabels, id, i)
Create a tick label

Parameters:
pos
newTick
board
drawLabels
id
i

calculateTicksCoordinates()
(Re-)calculates the ticks coordinates.

removeTickLabels()
Removes the HTML divs of the tick labels before repositioning

update()
Recalculate the tick positions and the labels.

updateRenderer()
Uses the boards renderer to update the arc.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Apr 02 2012 17:54:09 GMT+0200 (MESZ)