score:1
Accepted answer
if you look in app.js, is it wrapped in a function? it sounds like it's not part of the global namespace, despite being present in app.js.
score:1
if you're using es6 you might need to change the way you require it.
from the docs: http://www.chartjs.org/docs/
// using commonjs
var chart = require('chart.js')
var mychart = new chart({...})
// es6
import chart from 'chart.js'
let mychart = new chart({...})
// using requirejs
require(['path/to/chartjs'], function(chart){
var mychart = new chart({...})
})
Source: stackoverflow.com
Related Query
- Uncaught ReferenceError : require is not defined - Chart.js
- Uncaught ReferenceError: Chart is not defined
- Uncaught ReferenceError: Chart is not defined at test.html:11
- Uncaught ReferenceError: Chart is not defined - Chart.js in laravel 5
- Uncaught ReferenceError: Chart is not defined in Laravel mix
- Chart.js - Uncaught ReferenceError: chart is not defined
- Getting a Chart is not defined ReferenceError with in React + React-chartjs
- ReferenceError: Chart is not defined - chartjs
- Uncaught TypeError: Chart is not a constructor when using Chart.js
- Example: Doughnut | Error: Uncaught ReferenceError: Utils is not defined
- Chart JS Error: Chart is not defined Firefox
- chart.js:4 Uncaught ReferenceError: require is not defined in ionic 2
- ChartJS on NodeJS: error Chart is not defined
- Error says Chart is not defined
- 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
- Chart is not defined Node.js Chart.js
- Yii2 Chart is not defined
- Chart.JS not working in Xpages, chart not defined errror
- ReferenceError: Chart is not defined with primeNg and angular 4
- Uncaught ReferenceError: require is not defined using react-chartjs.min.js
- how to not repeat code while creating multiple charts in chart js
- why i have this error Utils is not defined when i want create a chart from chart.js
- Canvas is not defined for simple chart
- Chart.js: bar chart first bar and last bar not displaying in full
- 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
More Query from same tag
- ChartJs x-axis label to be in dateTime format issue: DD-MMM-YYYY, but displayed as MMM-YYYY-DD
- how to add FAHRENHEIT symbol in chart js donut chart
- Chart.js Fill line chart from another value than 0
- Count up values in Chart JS
- Merge two objects with different keys in chartjs bar
- Chart.js turn off all y axis and toggle them on / off
- $scope variable do not respond to the onClick function of angular chart
- Chart.js: bar chart first bar and last bar not displaying in full
- Chartjs v2 on retina display has label size issue (text is too large)
- Disable or hide YAixs of chart in chartJs
- How to reduce the number of data points displayed in react-chart-js2 (data decimation)
- Something similar to grace available in the latest chartJs for ChartJs 2.9.3
- Chartjs xAxes gridline html (html in ticks callback)
- Chart.js Radar chart multiple datasets
- chartjs Asp.net MVC Remote Data
- Dynamically pass the JSON data in chartjs
- Grouped Bar Char in D3.js or Google Charts or Chart.js
- Php Array to line chart in ChartJs
- Chart.js, set a max value
- Generating different chart results on fly causes flickering
- Combo bar chart graph line gets obscured by bars
- Change Vertical Line and Color bar chart in bar chart.js
- chartjs: set default min for the line chart
- chart.js labels text font size and digits text font size too small
- Google Chart and Chart.Js, Send C# variable to Script side in Asp .NET Core 2.2
- How to loading animation while populating activerecord in Rails 4.0?
- Plot time on Y axis
- How to make pie chart from array values?
- Add custom data scale to Chart.js
- Javascript chart one number step