score:4
Accepted answer
#myChart
is not present in the DOM when you're trying to initialize the chart. Try with ng-show
instead of ng-if
.
Anyhow, it loook like you're not initializing the chart from the controller once the data is populated, like you should do.
Hope it helps.
score:0
you have to create the Chart object only after the div is created, so call the function that create the Chart on the same place where you change the chartData.length
instead of calling it right after the component is created
Source: stackoverflow.com
Related Query
- Chart.js chart does not display when inside an ngIf.
- Chart.js returns a console error and does not display the chart when using variables as data input
- The real time chart sometimes does not display when I switch the target
- ChartJS does not display when using local Chart.js file
- Chart does not display on webpage in Django app (with Chart.js)
- Chartjs does not render chart when set responsive option to true
- Angular6 and ng2-charts does not display any charts when i fill data from webservice
- Angular-Charts bar chart does not update when I change the data, series, labels
- Destroying chart.js is not working when chart created inside function - chart.destroy() is not a function
- ChartJs does not render chart when binding canvas id in Angular
- chart does not change the values when the variable changes the value
- Background color does not work when trying to create my data before using scatter chart with chart.js
- Chart.js - Line chart does not render all points when using Point[] format
- 404 Not Found Error when trying to display a chart with Chart.js
- Chart.js v2 charts do not display inside angular 2 (but Chart.js v1 works perfectly)
- Html chart does not fit a small Android WebView
- Chart looks only grey, does not show the color - Chartjs,discordjs
- Angular-chart.js - Make line chart does not curve
- Uncaught TypeError: Chart is not a constructor when using Chart.js
- Chart.js Chart in Angular does not load until resizing browser window
- vue.js vue-chartjs chart not updating when chartData replaced, updated etc
- Chartjs (Non Vue) Not Rendering Graph Chart inside V-if/V-show
- My pie chart (chartJs) does not appear
- Stacked line chart not displaying correctly when Xaxis is time
- Chartjs bar-chart does not render when values are equal
- Css style not working well when resizing chart height in angular application
- Bar Chart of ChartJS does not Render
- Angular2 and ng2-charts does not display any graph
- Chart JS chart not rendering in ArcGIS popup when using navigation arrows
- canvas does not display proper width and height chart.js
More Query from same tag
- Chart JS distance between bar stacked
- Chart.js canvas keeps shifting upwards if I add things below it? (Angular - Chart.JS - NG2Charts)
- customizing tooltip on chart.js bar chart
- Not able to show data on Chart.js
- ReactJS - Labeling multi dimension array with chartJS-2
- Chart.js label on bar
- Chart.js with dual axis incorrect starting points (if negative values)
- PieChart disappears on mouseout
- Adding a label to a doughnut chart in Chart.js shows all values in each chart
- Syntax Error: Token '{' invalid key at column 2 of the expression [{{id}}] starting at [{id}}]?
- hover mode on Chart.js
- How to align Chart JS "legend" on right-center
- Chart.js xaxis formatter changes the value shown in the chart
- Chart.js Radar Chart How to Remove Outer Labels
- Chart.js 2 - Axis Layer Padding
- Reopening a "ChartJS" chart in a new window (VS, C#, ChartJS)
- How to set the serifs on the X and Y axes?
- Chart.js legend customisation
- Chart.js how to highlight a part of a label
- Chart.JS Multiline Chart with unknown numbers of Lines from JSON
- chart.js tooltip position, tooltip not displayed
- chart.js hide x/y axis, customize
- How to only have a Y axes representing data in chart.js
- How to customize chart using chartJs?
- ChartJS show value in legend (Chart.js V3.5)
- I am getting an issue my chart using chart.js is not appering until i tap 3 time on label button
- Pagination for Chart.js line chart?
- Angular / ng2-charts: Fetching json data in chart object showing: Cannot read property 'length' of undefined
- Two charts in a page not working, using Chart.js 3.1.1 cdn in Laravel 8.x framework
- How to make chartjs pie chart responsive