AlbinoDrought / chartjs-plugin-downsample

Chart.js plugin to downsample chart data
https://albinodrought.github.io/chartjs-plugin-downsample/
MIT License
41 stars 6 forks source link

Use with chart.js #4

Open tomherold opened 5 years ago

tomherold commented 5 years ago

How can I use this plugin with chart.js without the bundle? I am getting error messages in line 1 because of this.

AlbinoDrought commented 5 years ago

Without which bundle? The chart.js or chartjs-plugin-downsample bundle? Which error messages are you getting, and which unbundled thing are you using (unpacked git repo, npm package, etc).

Any chance you can pop out a demo too?

Thanks!

tomherold commented 5 years ago

Hello Sean,

Thank you for the quick reply.

I am using this in my html file:

Error message:

Uncaught ReferenceError: require is not defined at chartjs-plugin-downsample.js:1

kind regards

Thomas Herold

Founder & CEO Book Ad Report https://www.bookadreport.com https://www.bookadreport.com/

Am 19.12.2018 um 16:45 schrieb Sean notifications@github.com:

Without which bundle? The chart.js or chartjs-plugin-downsample bundle? Which error messages are you getting, and which unbundled thing are you using (unpacked git repo, npm package, etc).

Any chance you can pop out a demo too?

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AlbinoDrought/chartjs-plugin-downsample/issues/4#issuecomment-448641588, or mute the thread https://github.com/notifications/unsubscribe-auth/ACvX5Lh_zR0PXUzYVVRhTJmy507seZWSks5u6l8mgaJpZM4Zafuh.

tomherold commented 5 years ago

Any ideas how I can get this to work?

AlbinoDrought commented 5 years ago

This error makes me think a nodejs-targeting script is being used in a non-nodejs environment:

Uncaught ReferenceError: require is not defined at chartjs-plugin-downsample.js:1

Is the copy of assets/js/chartjs-plugin-downsample.js being used the raw one from this repository? If so, that one won't work in a browser, but the built version on the releases page should work.

tomherold commented 5 years ago

Hello Sean,

ok, I am using this file now.

Now I am getting:

Uncaught TypeError: Cannot read property 'x' of undefinedchartjs-plugin-downsample.js:76

The chart.bundle.js you are using in your sample contains the moment.js file, which I also have loaded before the chart.js.

kind regards

Thomas Herold

Am 19.12.2018 um 20:12 schrieb Sean notifications@github.com:

This error makes me think a nodejs-targeting script is being used in a non-nodejs environment:

Uncaught ReferenceError: require is not defined at chartjs-plugin-downsample.js:1

Is the copy of assets/js/chartjs-plugin-downsample.js being used the raw one from this repository https://raw.githubusercontent.com/AlbinoDrought/chartjs-plugin-downsample/master/src/chartjs-plugin-downsample.js? If so, that one won't work in a browser, but the built version on the releases page should work https://github.com/AlbinoDrought/chartjs-plugin-downsample/releases.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AlbinoDrought/chartjs-plugin-downsample/issues/4#issuecomment-448710789, or mute the thread https://github.com/notifications/unsubscribe-auth/ACvX5O4QmxohGUwVxuJVrlWon2pfqt1Iks5u6o-KgaJpZM4Zafuh.

tomherold commented 5 years ago

I think it is the same issue as here: https://github.com/AlbinoDrought/chartjs-plugin-downsample/issues/3

Would be lovely if you could fix the plugin to use with number datasets.