score:30
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.
score:0
for angular 7 or greater version use
npm install ng2-charts@2.2.3
--save npm install chart.js --save
score:2
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
score:19
try using the attribute syntax for binding:
instead of:
[data]="doughnutchartdata"
try:
attr.data="{{doughnutchartdata}}"
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.
Source: stackoverflow.com
Related Query
- 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
- React & Chartjs: How can I best destroy my chart when re-rendering?
- Disable chartJS tool tip on one dataset only
- Unable to change default values in chart.js
- Chart.js Draw a Stacked Bar Chart with Limit Line
- Graph is not displayed
- [MIXED CHART.JS]How do I manipulate the label of each chart's tooltips?
- JSON Data Assigning to Javascript Var Value
- How to convert pandas dataframe to specific json format
- How can I get two stacked chart.js charts to be different types?
- Lost column of bar chart in Chart.js
- How to hide Chart.js data labels for small screens
- How Can I Get An Instance of a ChartJS Bar Chart Using Angular
- How can I do a sensitivity range with chart.js?
- How do I destroy/update Chart Data in this chart.js code example?
- How to disable a tooltip for a specific dataset in ChartJS
- Can we have number value on the top of charts bars.?
- Plot lap times with Chart.js from time strings
- ChartJS dynamic line chart ghosting back to old data when hovered on
- i have an error when use chart on laravel
- How to make a prefilled doughnut in chart.js?
- Chart js each label for each data
- Missing Tooltip for some data points using chartjs
- Pie chart using chart.js and asp.net web Service (asmx)
- How to Integrating Chart.js with Angular 7 with Data from database
- how to change background in chartjs and remove background lines?
- How to show different product name for every bar in chart js
- return array from ajax
- How to add conditional logic on Chart.js config?
- Displaying the first value of the array in datasets.label Chartjs
- Usage for angular-chart : colors and fonts