Skip to content
mkraska edited this page Nov 27, 2024 · 8 revisions

[ "bar", "<name>", [x1, y1], [x2, y2], state ]

bar, thick black line with hinge points (nodes) at the ends. The label is placed next to the center of the line on the left side if seen from point 1 to point 2.

  • "<name>" label text, typeset in text mode
  • [x1, y1], [x2, y2] start and end point
  • state (optional, default: "SHOW") can be "hide" or "show" or "HIDE" or "SHOW". The uppercase versions lock the object in the given state, otherwise it can be changed interactively.

image

[
  [ "grid", "x","y", -5,5,-4,5, 50, [10,10], [0,0] ],
  [ "bar", "name", [1, 1], [4, 1] ],
  ["label", "1", [0.7,1]],
  ["label", "2", [4.2,1]]
]

Feedback functions

Tryout Space

In order to try code snippets in jsfiddle,

  1. copy the code from the wiki page to the clipboard
  2. follow the link for the JSXGraph version you want to try
  3. Replace the code in the HTML section (contents of <p hidden id="init">) with the content of the clipboard
Clone this wiki locally