I needed to import the ChartModule in the module.ts file of the component that I wanted to use the chart in. I originally only had it imported in app.module.ts.
For Angular 7 or greater version use
npm install firstname.lastname@example.org
--save npm install chart.js --save
In the app.module.ts file, within the NgModule decorater there is an array called imports, mention ChartsModule in the imports array like this
imports: [BrowserModule, RouterModule.forRoot(appRoutes),ChartsModule ],
It helped me. It can be helpful to you as well
Try using the attribute syntax for binding:
I'm not certain if this will work in your case, but this has to do with what's a DOM property versus an attribute, and how Angular handles binding for both.
- NG2-Charts Can't bind to 'datasets' since it isn't a known property of 'canvas'
- Can't bind to 'data' since it isn't a known property of 'canvas'
- ng2-chart with Angular 4: Can't bind to 'data' since it isn't a known property of 'canvas'
- Can't bind to 'chartType' since it isn't a known property of 'canvas' with angular12
- How to bind json array data to chart.js with same canvas id?
- Chart.js - bind data in dataset to specific chart labels
- Is it possible to create a canvas to extract image data without actually rendering the canvas?
- Angular / ng2-charts: Fetching json data in chart object showing: Cannot read property 'length' of undefined
- Chart.js: get chart data from canvas
- How to load chart data to an appended canvas
- How to get the data attribute of the canvas chart created using chartjs
- ChartJS have xAxes labels match data source
- chartjs how to update dynamically data from database(Chartjs cant get the data)
- Resetting transform: rotate() by removing and appending canvas not showing data after appending and redrawing chart
- bind first property value of an array of object into chart.js
- Calling data from outside of Chartjs code
- How do I destroy/update Chart Data in this chart.js code example?
- display ng2 chart when the property of data returned is >=0
- How to bind data from Controler to chartjs line chart to create it as dynamic?
- getting additional value fields from data source for dx.chartjs doughnut chart
- why isnt vue-chartjs receiving data from api?
- Chart JS - Title missing when clearing canvas if no data is available
- Bind Angular FormGroup to Chartjs data
- Created an onclick function to remove data from a line chart in ChartsJs, but getting "Cannot read property 'data' of undefined" error
- How to use computed property with data from JSON in data object for time axis in Vue using Chart.js
- How to run Chart.js samples using source code
- When updating Chart.js chart the data is updated but canvas is emptied
- Use Google Spreadsheet as data source for Chart.js
- Cant assign data to ng2 piechart after receiving it in HTTP response
- Parsing webserver JSON Values to data property
More Query from same tag
- hide data of the datasets in radar chart?
- Give '%' on Bar Chart Datalabel Chartjs
- Not able to see values on bar chart
- Chart.js Show Dollar Amount On Left Y And Percent Amount On Right Y
- React component wont re-render ChartJS chart with redux props
- nodejs express jade mongodb project: how to import include chart.js
- Y-Axis with different colors
- Chart js with ng-repeat
- Chart.js setting maximum bar size of bar chart
- Remove empty spaces created by null values in Chart.js
- In Chart.js, how do I hide certain axis labels from a stacked bar chart?
- Chartjs with Typescript: The types of 'interaction.mode' are incompatible between these types
- Angular: How to change color of chartjs?
- Create multiple chart by Chart.js
- How to pass my array of objects into a graph with Chart.js
- chart.js aspect ratio not square
- Chart.js time object labels not updating correctly
- Chartjs box plot with Y-axis negative values
- How to create stacked bar chart using react-chartjs-2?
- Chart.js and Firebase Ionic App Angular 4
- How to get Chart js labels in scientific notation
- Angular ChartJs does not show Data for multiple Charts
- Loop through array of objects in Node
- ChartJS - Show percentage on hover (AngularJS)
- Chartjs treemap example
- Set different color for each bars using ChartJS in Angular 4
- Chart js size and placement
- ChartJS : How to leave just points without lines
- React-Chart-JS-2 ^3.0.5 | TypeError: Cannot read properties of undefined (reading 'visible') at Chart._getSortedDatasetMetas