score:1

Accepted answer

okay i think i've figured it out and it's hilariously simple, i printed the object imported from chartjs-plugin-downsample and it came out looking suspiciously like the thing you're meant to pass to the plugin service.

so the way to do this is:

import { chart } from 'react-chartjs-2';
import downsampleplugin from 'chartjs-plugin-downsample';

...(component declaration)...

componentwillmount() {
  chart.plugins.register(downsampleplugin);
}

...(rest of your component)...

and then just play around with the options. make sure to set your min and max options, i've had it do weird things otherwise.


Related Query

More Query from same tag