Skip to content
mkraska edited this page Apr 29, 2023 · 7 revisions

[ "line", "color", [x1, x2,...], [y1, y2,...] ,dash, th ]

polyline with optional dash style and thickness

  • "color" color of the line, string. If empty (""), "black" is used.
  • [x1, x2,...], [y1, y2,...] lists of x and y values. Must have same length.
  • dash (optional, defaults to "-") line style. possible values: "-", "--", ".", "-." (self explaining)
  • th (optional, default: 0.8) thickness in pixel

Example

image

[
  [ "grid", "x","y", -5,5,-4,5, 50 ],
  [ "line", "", [1, 2,3,4], [1,2,2,1] ],
  [ "line", "red", [2,3], [1,1],"--", 3 ]
]

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