How to use the dygraphs/src/dygraph.Plugins 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 influxdata / influxdb / ui / src / external / dygraph.ts View on Github external
closestSeries = setIdx
        closestPoint = point
      }
    }
  }
  const name = this.layout_.setNames[closestSeries]
  return {
    row: closestRow,
    seriesName: name,
    point: closestPoint,
  }
}

Dygraph.synchronize = synchronize

Dygraph.Plugins.Crosshair = (function() {
  'use strict'
  /**
   * Creates the crosshair
   *
   * @constructor
   */

  const crosshair = function(opt_options) {
    this.canvas_ = document.createElement('canvas')
    opt_options = opt_options || {}
    this.direction_ = opt_options.direction || null
  }

  crosshair.prototype.toString = function() {
    return 'Crosshair Plugin'
  }