How to use the dygraphs.addEvent function in dygraphs

To help you get started, we’ve selected a few dygraphs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github numenta / numenta-apps / unicorn / app / browser / components / Chart.jsx View on Github external
// move chart back to last valid display position from previous viewing?
    if ('viewpoint' in metric && metric.viewpoint) {
      this._chartRange = [metric.viewpoint, metric.viewpoint + rangeWidth];
    }

    // init, render, and draw chart!
    options.labelsUTC = true;
    options.dateWindow = this._chartRange;  // update viewport of range selector
    this._previousDataSize = data.length;
    this._dygraph = new CustomDygraph(element, data, options,
                                      this.props.yScaleCalculate);

    // after: track chart viewport position changes
    rangeEl = element.getElementsByClassName(RANGE_SELECTOR_CLASS)[0];
    Dygraph.addEvent(rangeEl, 'mousedown', this._handleMouseDown.bind(this));
    Dygraph.addEvent(element, 'mouseup', this._handleMouseUp.bind(this));
  }
github numenta / numenta-apps / unicorn / app / browser / components / Chart.jsx View on Github external
// move chart back to last valid display position from previous viewing?
    if ('viewpoint' in metric && metric.viewpoint) {
      this._chartRange = [metric.viewpoint, metric.viewpoint + rangeWidth];
    }

    // init, render, and draw chart!
    options.labelsUTC = true;
    options.dateWindow = this._chartRange;  // update viewport of range selector
    this._previousDataSize = data.length;
    this._dygraph = new CustomDygraph(element, data, options,
                                      this.props.yScaleCalculate);

    // after: track chart viewport position changes
    rangeEl = element.getElementsByClassName(RANGE_SELECTOR_CLASS)[0];
    Dygraph.addEvent(rangeEl, 'mousedown', this._handleMouseDown.bind(this));
    Dygraph.addEvent(element, 'mouseup', this._handleMouseUp.bind(this));
  }