score:1
Update: with help of a Chart.js contributor we've confirmed that it's a bug with Chart.js' way of loading things, see this comment and above for details. So below workaround is probably as good as it gets for now.
I ran into the same issue, and I made a bug report for it on the Chart.js repository. I also found a workaround, which is to add this to moment.min.js
when building/packing your extension:
// Minified momentjs code on this line;
window.moment = moment;
In my case I use Powershell to dump files into a build
folder:
Remove-Item build -Recurse -Force -Confirm:$false
mkdir build
Copy-Item node_modules/moment/min/moment.min.js build/
Copy-Item node_modules/chart.js/dist/Chart.js build/
Copy-Item src/js/app.js build/app.js
Copy-Item manifest.json build/manifest.json
# Workaround for: https://stackoverflow.com/questions/51948350/
# See also: https://github.com/chartjs/Chart.js/issues/5901
Add-Content -Path build/moment.min.js -Value "`n`nwindow.moment = moment;"
Not really a solution or answer, but useful enough to post I suppose...
Source: stackoverflow.com
Related Query
- moment.js is not loading before chart.js in Firefox extension
- Firefox is not responding when loading 800+ data sets in Bar Chart with Charts.Js
- Chart.js - How to show loading animation before plotting chart
- Chart JS Error: Chart is not defined Firefox
- chart js download to png with canvas.toDataURL() not working in IE and firefox
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Background color does not work when trying to create my data before using scatter chart with chart.js
- how to not repeat code while creating multiple charts in chart js
- ReferenceError: Chart is not defined - chartjs
- Chart.js: bar chart first bar and last bar not displaying in full
- ChartJS canvas not displaying rgba colors in IE, Safari and Firefox
- Bootstrap 3 tabs & Chart.js - charts not loading on tabs
- Chart.js responsive option - Chart not filling container
- show label in tooltip but not in x axis for chartjs line chart
- Html chart does not fit a small Android WebView
- Chart.js ng2-charts colors in pie chart not showing
- Chart.JS Mixed Chart - Bars Not Showing
- Chart looks only grey, does not show the color - Chartjs,discordjs
- Angular-chart.js - Make line chart does not curve
- angular-chartjs line chart TypeError: t.merge is not a function
- Creating a horizontal bar chart extension on Chart.js
- Chart.js line chart is not displaying
- Chart.js: width and height of a pie chart not respected
- Uncaught TypeError: Chart is not a constructor when using Chart.js
- Line chart is not being displayed in Chart.js
- Series Details Not Showing in Angular Chart with Charts.js
- Chartjs not rendering chart and no error thrown
- Chart.js pie chart not showing in Google Chrome canvas
- Chart.js Chart in Angular does not load until resizing browser window
- vue.js vue-chartjs chart not updating when chartData replaced, updated etc
More Query from same tag
- Chartjs.org Bar chart not scale properly
- Hide x-axis labels but show tooltips in chart.js
- how to set color of label in chartjs?
- My Chartjs is not updating after setstate full code attached Reactjs Update
- chart.js not allowing y axis steps with logarithmic scale
- Doughnut chart - interaction with specific segment of a chart
- Detect if the click is in bar or outside of bar in ChartJS
- How to position chart details next to a chart responsive for multiple devices?
- Chart.js - Mixed Chart: Bar Graph with Diagonal Line
- Iterating over an IEnumerable in Javascript for Chartjs
- Angular Overlapping bars using chart.js
- How can i get the Chart JS Bar Graph Bar Label and Value on click?
- Having problems displaying multiple charts on a page
- How to remove numbering on PolarArea circles?
- How to center radar chart ticks when changing start angle of chart?
- Angular Chart color does not change
- Chartjs not showing up in Foundation5 Tabs
- Is it possible to use mouseenter and mouseleave event in chart js?
- How to sort XY line chart tooltip items based on value and add thousands separators?
- How to change chartjs ticks orientation to 'slope right'?
- Chart.js Treemap Adding custom text to each rectangle
- Change bar color depending on value
- Vue Chart 3 - Doughnut Charts with Text in the Middle (Trouble registering a plugin)
- is there a way to do automatic scrolling?
- how to render the same chart using Chart.js
- create a multi line chart using Chart.js
- Chart.js: Creating a Barchart with overlaying and offset Bars
- Chartjs: Double x axis not having the same gridline
- add a unit to label with chartjs plugin datalabels
- Add codeigniter php data to Chart js