score:3
In your StackBlitz, the section (rectanlge) of the y-axis is correctly created on the target canvas
and removed from the source canvas
. The problem is that the wrong div
is horizontally scrolled. This can be fixed by changing the template and corresponding css
.
Please have a look at the following StackBlitz.
UPDATE (dynamic data)
In cases where the chart component receives dynamically changing data through an @Input()
property, your component needs to implement the OnChange
lifecycle hook.
See the following StackBlitz.
Please note that this code is far from being optimized. Instead of creating the chart from scratch on every data change, you should simply update the data and options on the existing chart.
Source: stackoverflow.com
Related Query
- Make y-axis sticky when having horizontal scroll on chartJS and Angular
- When I try to include the chart.js and angular chartjs files, I get: ReferenceError: require is not defined
- Make x label horizontal in ChartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Create a rounded bar graph with Angular and chartJS
- Maintain Y axis scale in graph with scroll in the X axis when the dataset grows bigger. Aspect-ratio problem
- Update charts in chartjs and angular
- Chartjs change horizontal axis value
- to increase space between x axis and first horizontal bar in chart js
- chartjs time cartesian axis adapter and date library setup
- ChartJS multiple X axis and extra labels in y axis
- How to make chartJs stacked bar always rounded when data is 0?
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- Minimum value for x Axis doesn't work for horizontal bar chart | ChartJS
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- ChartJS shows date, but not time, when displaying labels in time axis
- Chartjs does not show annotations when x axis is of type time
- Change font size and font color in Chartjs Angular 5
- ChartJS Horizontal bars barely visible with 50 records on the Y axis
- ChartJS tooltip when having multiple lines on a time graph
- How can I create a horizontal scroll effect with angular-chart.js and chart.js
- ChartJS x axis title not visible when axis position is centered
- Order and hide items of legend by value with Chartjs Angular
- how to increase space between legend and chart in chartjs (ng2charts ) using angular
- Angular Chartjs How to make it reactive to data change?
- Can't Draw Horizontal Line on Graph Using ChartJS Annotation Plugin and Primevue Chart
- How to make a chart with chartjs and Angular?
- How to toggle between Custom tooltip and normal tooltip in chartjs and angular
- ChartJs - Labelling minimum and maximum value of the Y Axis
- How to set min max for x axis depend on data with Chartjs and Spring Boot?
More Query from same tag
- How do I import a csv into chart.js?
- Customizing Chart.js
- Chart JS - X-Axis base on timezone
- Add bar chart in a column
- [Vue warn]: You may have an infinite update loop in watcher with expression "chartData"
- How to avoid detached HTMLCanvasElements when updating canvas with JavaScript?
- How do I add JSON Data into ChartJS
- Doughnut chart adjusting problem in chart.js
- Dates not displaying on X Axis using Chart.Js on MVC 5
- Vue + chartjs : Nearest point on hover tooltip not working
- Edge does not set height on canvas properly
- How to change space between columns in horizontalBar in Chart.js?
- generateLegend() Chart.JS V2
- Chartjs Polar Area Chart - Data labels shown don't rotate with startAngle
- How can I change background color of a specific area in my chart's grid using Chart.js and Annotation?
- How to make custom text appear underneath each bar in chartjs bar chart?
- Display line chart with connected dots using chartJS
- Angular and CharJS - ERROR TypeError: Cannot read property '15' of undefined
- Charts.js - Colors for stacked bar on multi-series line/bar chart are not working
- How to add data to chart.js with a for loop
- ChartJS yAxis showing not coherent data
- Want to show the dataset labels
- How do you get the width of a datalabel from the Chartjs plugin after the chart animates?
- The chart doesn't display the data from my call to the API with Axios
- White space at start and end of data with time scale in chart.js
- How can I move chartJs legend left side and change the width and Hight of the chart?
- Chart.js line chart set background color
- ChartJS - Adding legend title into tooltip title
- how do i use the numbers i key in from a form as the input data for chartjs
- use navigator clipboard to store image/png from canvas blob