Skip to content

RangeError: Maximum call stack size exceeded #452

@simeon9696

Description

@simeon9696

I'm following the instructions here and I got the below error as soon as the graph is plotted. It only happens when I enable this package. I also get the error even though I have no annotation property in the config. The graph still plots but this error is thrown along with it. My function is attached after the stack trace.

instrument.js?ea14:109 RangeError: Maximum call stack size exceeded
    at Reflect.ownKeys (<anonymous>)
    at Object.ownKeys (helpers.segment.js?dd3d:1661)
    at Function.keys (<anonymous>)
    at Observer.walk (vue.runtime.esm.js?2b0e:930)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1020)
    at Observer.walk (vue.runtime.esm.js?2b0e:932)
    at new Observer (vue.runtime.esm.js?2b0e:920)
    at observe (vue.runtime.esm.js?2b0e:988)
import { CrosshairPlugin, Interpolate } from "chartjs-plugin-crosshair";

import {
  Chart,
  LineController,
  LineElement,
  PointElement,
  LinearScale,
  Legend,
  Decimation,
  Title,
  Tooltip,
  CategoryScale,
  Interaction
} from "chart.js";
import annotationPlugin from "chartjs-plugin-annotation";


Chart.register(
  LineController,
  LineElement,
  PointElement,
  Legend,
  Decimation,
  LinearScale,
  Title,
  Tooltip,
  CategoryScale,
  CrosshairPlugin,
  annotationPlugin
);
    plotControlGraph() {
      const data = {
        labels: this.existingMeasurements.map(m =>
          m.dateAdded.toDate().toLocaleString()
        ),
        datasets: [
          {
            label: "Characteristic",
            backgroundColor: "#000000",
            borderColor: "#FFFFFF",
            data: this.existingMeasurements.map(m => m.value)
          }
        ]
      };
      const annotation2 = {
        type: "line",
        scaleID: "y",
        borderWidth: 3,
        borderColor: "white",
        value: 5,
        label: {
          content: "Hello",
          enabled: true
        }
      };
      const config = {
        scales: {
          y: {
            stacked: true
          }
        },
        type: "line",
        data,
        options: {

          interaction: {
            mode: "index",
            intersect: false,
            axis: "x"
          },
          spanGaps: true, // enable for all datasets
          normalized: true,

          plugins: {
            decimation: {
              enabled: true,
              algorithm: "lttb"
            },

            legend: {
              display: false
            },
            autocolors: false,
            annotation: {
              annotations: {
                annotation2,
                line1: {
                  type: "line",
                  yMin: 60,
                  yMax: 60,
                  borderColor: "rgb(255, 99, 132)",
                  borderWidth: 2
                }
              }
            }
          }
        }
      };

      try {
        const ctx = document.querySelector("#myChart");
        if (this.chart) this.chart.destroy();
        this.chart = new Chart(ctx, config);
      } catch (error) {
        console.error(error);
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions