huww98 / TimeChart

An chart library specialized for large-scale time-series data, built on WebGL.

Home Page:https://huww98.github.io/TimeChart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug `TypeError: e is undefined`

leonard84 opened this issue · comments

With the published version of e7b086e, as there are no source maps (#56) I can only give this unhelpful error message.

Uncaught TypeError: e is undefined
    plugins index.ts:94
    y index.ts:94
[index.ts:94:77](https://huww98.github.io/src/core/index.ts)
    plugins index.ts:94
    map self-hosted:221
    y index.ts:94

I will look at the source map issue.

Could you try this demo https://huww98.github.io/TimeChart/demo/line_style.html and share the error message? This one is not using the minimized version.

The error is not in that demo, it is in my local chart, which is also using timechart.plugins_extra.min.js. Anyway, even with the umd version the error is still reported for index.ts:94 and FF wants to open the sourcemap instead of jumping to the js version.

So, I assume this error is not specific to Mac? Could you share some code for me to reproduce it?

If you are using the plugins, note that now you need tooltip: new TimeChartTooltipPlugin({enabled: true, ...}), instead of the old tooltip object. I suspect you have specified some plugin as undefined

Ok, using


      tooltip: new TimeChart.plugins.TimeChartTooltipPlugin({
        enabled: true,
        xFormatter: (x) => new Date(x + baseTime).toLocaleString([], { hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 })
      }),

instead of

tooltip: TimeChart.plugins.tooltip,

fixed it. For me it is not totally clear, when to use the new plugin, and when to use the reference to the built-in instance.

The built-in instance is now removed. You cannot use it anymore from beta.9