score:1
hopefully this helps others:
the error was a result of the axis min value not being defaulted to zero. once that was applied to the axes all functions as expected.
score:0
ok, i'm using angular v13 with chart.js v 3.7 and chartjs-plugin-datalabels v 2. i struggled a lot trying to get things working. the problem was not errors, but the labels were just not appearing. turned out that i had to add .default to the plugin reference:
public chartplugins = [plugindatalabels.default];
now you can bind this chartplugins variable to the canvas:
<canvas basechart
[data]="linechartdata"
[options]="linechartoptions"
[type]="linecharttype"
[plugins]="chartplugins"
(charthover)="charthovered($event)"
(chartclick)="chartclicked($event)"></canvas>
and then it works!
score:5
i know this isn't exactly the same problem that the op had, but i had a bit of trouble with the angular cli compiling the code properly.
angular.json:
{
"projects": {
"myproject": {
"architect": {
"build": {
"options": {
"scripts": [
"node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js"`
create index.d.ts
file with contents:
declare module 'chartjs-plugin-datalabels'
import as follows:
import chartdatalabels from 'chartjs-plugin-datalabels';
score:8
install chartjs-plugin-datalabel by
npm install chartjs-plugin-datalabels --save
then import the same in component by
import chartdatalabels from 'chartjs-plugin-datalabels';
and add
labels:[]
..
datasets[]
..
plugin:[chartdatalabels]
this worked for me . hope it will work.
Source: stackoverflow.com
Related Query
- angular 5 chart.js datalabels plugin
- chartjs datalabels change font and color of text displaying inside pie chart
- Problem for display a chart with Chart.js and Angular
- How to properly use the chartjs datalabels plugin
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- Angular 2 chart - change point radius
- Datalabels plugin chartjs showing '[object]' instead of value
- Angular Chart JS prevent x label causing overflow
- Series Details Not Showing in Angular Chart with Charts.js
- Ng2-charts / chart.js - how to refresh/update chart - angular 4
- Extending Existing Chart Types angular chart js using chart js 2.0
- Chart.js Chart in Angular does not load until resizing browser window
- How to update data Chart in async way in Angular Chart.js?
- Angular 8 & ChartJs change color in pie chart
- Create multiple dynamic stacked chart using chart.js in Angular 10?
- Show labels on each sector to polar chart using angular js chart
- How to set single color on each bar in angular chart js
- Can't apply options of datalabels chartjs plugin in Vue
- Angular chart how to show the legend data value by default along with legend name
- How to show percentage (%) using chartjs-plugin-labels ( Pie chart ) in angular 2/8
- How to add title inside doughnut chart in Angular Chart?
- Chart Js + Angular
- ERROR TypeError: "this.canvas is undefined" | Problem with creating a chart with angular and chart.js
- Change Angular js charts.js chart type dynamically
- chartjs plugin datalabels does not show value on charts
- Implementing a choropleth chart using chartjs-chart-geo plugin with react-chartjs-2
- How to create a variable for chart js datalabel plugin formatter
- chart annotations not showing in Angular 2
- Remove additional white space on left and right side of Angular Chart
- Angular Charts.js: Can't refresh chart with data
More Query from same tag
- Round pie chart in rectangular canvas
- chart.js v2: how to add tooltips of metadata?
- Angular2 Update ng2-charts with labels
- Chart.js: How can I set paddings and draw a background box in a line chart?
- Chart.js misreading arrays for labels and axes
- Bug : Overlay loading automatically (bootstrap) (laravel 5.2)
- Parse 2d int array to List of BubbleDataPoints
- Why is here a number?
- Chartjs updating point titles
- how to use chartjs graph in a *ngFor loop
- Initializing Chart Js Multiple times for and Array of Objects
- Disable tooltip for Line chart for one line
- Setting ChartJS plugin on vue-chartjs not working
- How to expand the "Y" scale of the data in chart.js?
- Having different colors per bar with angular charts chart.js v2
- Doughnut chart from Chart.js, custom legend and call of original handler not works as expected
- how to load mysql query to chartjs with php?
- Chart.js animation: onComplete event fired on hover
- ChartJs does not render chart when binding canvas id in Angular
- Chart.js Radar chart legend label font size doesn't work
- Chart.js line chart display decimal values on Y axis
- Scatter plot in Chart.js with annotations
- How to resize chartjs in bootstrap columns for different browsers
- Angular Chart color does not change
- Change axes position in line chart
- ChartJS - Uncaught SyntaxError: Unexpected number
- Put array in chart data
- Chart js shows old chart data when hover
- Error: "barWithErrorBars" is not a chart type. Vue - chartjs-chart-error-bars
- ChartJS - Display one set of data at a time