UNPKG

@nativescript-community/ui-chart

Version:

A powerful chart / graph plugin, supporting line, bar, pie, radar, bubble, and candlestick charts as well as scaling, panning and animations.

49 lines 1.06 kB
import { Utils } from '../utils/Utils'; export class AbstractBuffer { /** * Initialization with buffer-size. * * @param size */ constructor(size) { this.index = 0; this.buffer = Utils.getTempArray(size); } /** limits the drawing on the x-axis */ limitFrom(from) { if (from < 0) { from = 0; } this.from = from; } /** limits the drawing on the x-axis */ limitTo(to) { if (to < 0) { to = 0; } this.to = to; } /** * Resets the buffer index to 0 and makes the buffer reusable. */ reset() { this.index = 0; } /** * Returns the size (length) of the buffer array. */ get length() { return this.buffer.length; } /** * Set the phases used for animations. * * @param phaseX * @param phaseY */ setPhases(phaseX, phaseY) { this.phaseX = phaseX; this.phaseY = phaseY; } } //# sourceMappingURL=AbstractBuffer.js.map