How to use the highcharts.addEvent function in highcharts

To help you get started, we’ve selected a few highcharts 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 dynatrace-oss / barista / components / chart / src / chart.ts View on Github external
series: this._currentSeries[index],
          });
        }
      });
      addHighchartsEvent(series, 'show', () => {
        if (this._currentSeries) {
          this.seriesVisibilityChange.emit({
            source: this,
            visible: true,
            series: this._currentSeries[index],
          });
        }
      });
    });

    addHighchartsEvent(this._chartObject, 'redraw', () => {
      this._notifyAfterRender();
    });

    // adds event-listener to highcharts custom event for tooltip closed
    addHighchartsEvent(this._chartObject, 'tooltipClosed', () => {
      this._highChartsTooltipClosed$.next();
    });
    // Adds event-listener to highcharts custom event for tooltip refreshed closed */
    // We cannot type the event param, because the types for highcharts are incorrect
    // tslint:disable-next-line:no-any
    addHighchartsEvent(this._chartObject, 'tooltipRefreshed', (event: any) => {
      this._highChartsTooltipDataChanged$.next({
        data: (event as DtHcTooltipEventPayload).data,
        chart: this._chartObject!,
      });
    });
github dynatrace-oss / barista / src / lib / chart / chart.ts View on Github external
series: this._currentSeries[index],
          });
        }
      });
      addHighchartsEvent(series, 'show', () => {
        if (this._currentSeries) {
          this.seriesVisibilityChange.emit({
            source: this,
            visible: true,
            series: this._currentSeries[index],
          });
        }
      });
    });

    addHighchartsEvent(this._chartObject, 'redraw', () => {
      this._notifyAfterRender();
    });

    // adds event-listener to highcharts custom event for tooltip closed
    addHighchartsEvent(this._chartObject, 'tooltipClosed', () => {
      this._isTooltipOpen = false;
      this.tooltipOpenChange.emit(false);
      this._tooltipRefreshed.next(null);
    });
    // Adds event-listener to highcharts custom event for tooltip refreshed closed */
    // We cannot type the event param, because the types for highcharts are incorrect
    // tslint:disable-next-line:no-any
    addHighchartsEvent(this._chartObject, 'tooltipRefreshed', (event: any) => {
      if (!this._isTooltipOpen) {
        this._isTooltipOpen = true;
        this.tooltipOpenChange.emit(true);
github dynatrace-oss / barista / src / lib / chart / chart.ts View on Github external
if (this._currentSeries) {
          this.seriesVisibilityChange.emit({
            source: this,
            visible: true,
            series: this._currentSeries[index],
          });
        }
      });
    });

    addHighchartsEvent(this._chartObject, 'redraw', () => {
      this._notifyAfterRender();
    });

    // adds event-listener to highcharts custom event for tooltip closed
    addHighchartsEvent(this._chartObject, 'tooltipClosed', () => {
      this._isTooltipOpen = false;
      this.tooltipOpenChange.emit(false);
      this._tooltipRefreshed.next(null);
    });
    // Adds event-listener to highcharts custom event for tooltip refreshed closed */
    // We cannot type the event param, because the types for highcharts are incorrect
    // tslint:disable-next-line:no-any
    addHighchartsEvent(this._chartObject, 'tooltipRefreshed', (event: any) => {
      if (!this._isTooltipOpen) {
        this._isTooltipOpen = true;
        this.tooltipOpenChange.emit(true);
      }
      this._tooltipRefreshed.next({
        data: (event as DtHcTooltipEventPayload).data,
        chart: this._chartObject!,
      });
github dynatrace-oss / barista / components / chart / src / chart.ts View on Github external
}
      });
    });

    addHighchartsEvent(this._chartObject, 'redraw', () => {
      this._notifyAfterRender();
    });

    // adds event-listener to highcharts custom event for tooltip closed
    addHighchartsEvent(this._chartObject, 'tooltipClosed', () => {
      this._highChartsTooltipClosed$.next();
    });
    // Adds event-listener to highcharts custom event for tooltip refreshed closed */
    // We cannot type the event param, because the types for highcharts are incorrect
    // tslint:disable-next-line:no-any
    addHighchartsEvent(this._chartObject, 'tooltipRefreshed', (event: any) => {
      this._highChartsTooltipDataChanged$.next({
        data: (event as DtHcTooltipEventPayload).data,
        chart: this._chartObject!,
      });
    });

    this._notifyAfterRender();
  }
github dynatrace-oss / barista / src / lib / chart / chart.ts View on Github external
this._chartObject.series.forEach((series, index) => {
      addHighchartsEvent(series, 'hide', () => {
        if (this._currentSeries) {
          this.seriesVisibilityChange.emit({
            source: this,
            visible: false,
            series: this._currentSeries[index],
          });
        }
      });
      addHighchartsEvent(series, 'show', () => {
        if (this._currentSeries) {
          this.seriesVisibilityChange.emit({
            source: this,
            visible: true,
            series: this._currentSeries[index],
          });
        }
      });
    });
github intuit / foremast / foremast-browser / src / components / charts / scatter / ScatterChart.js View on Github external
}
          }, undefined, undefined, false);
      }

      function unbindAll() {
          handlers.forEach(function (unbind) {
              if (unbind) {
                  unbind();
              }
          });
          handlers.length = 0;
      }

      handlers.push(Highcharts.addEvent(document, 'mousemove', drag));
      handlers.push(Highcharts.addEvent(document, 'touchmove', drag));
      handlers.push(Highcharts.addEvent(document, 'mouseup', unbindAll));
      handlers.push(Highcharts.addEvent(document, 'touchend', unbindAll));
    };
github intuit / foremast / foremast-browser / src / components / charts / scatter / ScatterChart.js View on Github external
beta: beta + (posX - e.chartX) / sensitivity
                  }
              }
          }, undefined, undefined, false);
      }

      function unbindAll() {
          handlers.forEach(function (unbind) {
              if (unbind) {
                  unbind();
              }
          });
          handlers.length = 0;
      }

      handlers.push(Highcharts.addEvent(document, 'mousemove', drag));
      handlers.push(Highcharts.addEvent(document, 'touchmove', drag));
      handlers.push(Highcharts.addEvent(document, 'mouseup', unbindAll));
      handlers.push(Highcharts.addEvent(document, 'touchend', unbindAll));
    };