coreui-react
coreui-react copied to clipboard
Unable to use time series axis with current configuration
Hello, after a very long and exhausting set of digging, I figured out that the way that this module handles either distribution or some other component in the CI pipeline disallows one from using time series axis.
This is normally done with a plugin like https://github.com/chartjs/chartjs-adapter-moment, which, import {_adapters} from 'chart.js' and then override() the various method to allow for time series.
The way that this module is implemented, the entirety, or a large portion of the chart.js library is compiled into the dist of this package, and so when the time series is override()n in the extensions, the _adapter.date value is unaffected in this module and thus you get:
Uncaught Error: This method is not implemented: Check that a complete date adapter is provided
There are a few options on how to resolve this.
- An immediate fix would be to export
_adaptersfrom this module, which can be manually overwritten or linked to thechart.jsone. - A better long-term fix would be to see if chart.js is even available, and if so, pull in it's
_adaptersvalue so that everything works as expected out of the box.
Let me know if additional clarification or assistance is needed
For those looking to get around this, so far I am unable to find a method other than vendorizing (at least until this is fully resolved) both packages.
You have to add this to the end of index.js for this package:
exports.adapters = adapters;
exports._adapters = adapters;
And change the import of chartjs-adapter-moment to the following:
import {_adapters} from './react-chartjs/index';
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions