StockMarket Object

From BOARD18 Project WIKI
Revision as of 15:12, 29 July 2013 by Rich (talk | contribs) (Initial version of this page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page describes a BOARD18 JavaScript object.
This object is created using the StockMarket constructor function.
Go to Object List. - Go to Design Document.

The StockMarket object describes a stock market chart and its use.

Data Elements in Object
Element Type C Description
image url * URL of the image file
height int * Stock Market image height
width int * Stock Market image width
xStart int * Start of price boxes
xStep int * Spacing of price boxes
yStart int * Start of price boxes
yStep int * Spacing of price boxes

An * in the "C" column indicates that the element is created by the constructor function.

Methods in Object

place() The place function places the stock market chart on canvas1.

clear2() The clear2 function clears all tokens from canvas2.

chartCoord(xPix, yPix) The chartCoord function calculates the coordinates of the containing price box given an exact position in pixels on the stock market chart.